alloc.c:defaultAlloc:
   63|  2.08M|{
   64|  2.08M|    void *p = ( g_malloc ? g_malloc(size) : malloc(size) );
  ------------------
  |  Branch (64:17): [True: 0, False: 2.08M]
  ------------------
   65|  2.08M|    if ( !p )
  ------------------
  |  Branch (65:10): [True: 0, False: 2.08M]
  ------------------
   66|      0|        defaultPanic( allocator,"Out of memory!");
   67|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_MEMORY)
   68|       |    alloccnt++;
   69|       |    SPRTF("%d: alloc   MEM %p, size %d\n", alloccnt, p, (int)size );
   70|       |    if (size == 0) {
   71|       |        SPRTF("NOTE: An allocation of ZERO bytes!!!!!!\n");
   72|       |    }
   73|       |#endif
   74|  2.08M|    return p;
   75|  2.08M|}
alloc.c:defaultRealloc:
   78|  4.41k|{
   79|  4.41k|    void *p;
   80|  4.41k|    if ( mem == NULL )
  ------------------
  |  Branch (80:10): [True: 1.32k, False: 3.08k]
  ------------------
   81|  1.32k|        return defaultAlloc( allocator, newsize );
   82|       |
   83|  3.08k|    p = ( g_realloc ? g_realloc(mem, newsize) : realloc(mem, newsize) );
  ------------------
  |  Branch (83:11): [True: 0, False: 3.08k]
  ------------------
   84|  3.08k|    if (!p)
  ------------------
  |  Branch (84:9): [True: 0, False: 3.08k]
  ------------------
   85|      0|        defaultPanic( allocator, "Out of memory!");
   86|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_MEMORY)
   87|       |    realloccnt++;
   88|       |    SPRTF("%d: realloc MEM %p, size %d\n", realloccnt, p, (int)newsize );
   89|       |#endif
   90|  3.08k|    return p;
   91|  4.41k|}
alloc.c:defaultFree:
   94|  2.16M|{
   95|  2.16M|    if ( mem )
  ------------------
  |  Branch (95:10): [True: 2.08M, False: 88.7k]
  ------------------
   96|  2.08M|    {
   97|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_MEMORY)
   98|       |        freecnt++;
   99|       |        SPRTF("%d: free    MEM %p\n", freecnt, mem );
  100|       |#endif
  101|  2.08M|        if ( g_free )
  ------------------
  |  Branch (101:14): [True: 0, False: 2.08M]
  ------------------
  102|      0|            g_free( mem );
  103|  2.08M|        else
  104|  2.08M|            free( mem );
  105|  2.08M|    }
  106|  2.16M|}

prvTidyAttrGetById:
  857|    226|{
  858|    226|   AttVal* av;
  859|    515|   for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (859:33): [True: 292, False: 223]
  ------------------
  860|    292|   {
  861|    292|     if ( AttrIsId(av, id) )
  ------------------
  |  |  169|    292|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  ------------------
  |  |  |  Branch (169:29): [True: 292, False: 0]
  |  |  |  Branch (169:37): [True: 20, False: 272]
  |  |  |  Branch (169:51): [True: 3, False: 17]
  |  |  ------------------
  ------------------
  862|      3|         return av;
  863|    292|   }
  864|    223|   return NULL;
  865|    226|}
prvTidyFindAttribute:
  869|  19.0k|{
  870|  19.0k|    if ( attval )
  ------------------
  |  Branch (870:10): [True: 19.0k, False: 0]
  ------------------
  871|  19.0k|       return attrsLookup( doc, &doc->attribs, attval->attribute );
  872|      0|    return NULL;
  873|  19.0k|}
prvTidyGetAttrByName:
  876|  86.0k|{
  877|  86.0k|    AttVal *attr;
  878|  86.2k|    for (attr = node->attributes; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (878:35): [True: 174, False: 86.0k]
  ------------------
  879|    174|    {
  880|    174|        if (attr->attribute && TY_(tmbstrcmp)(attr->attribute, name) == 0)
  ------------------
  |  |   23|     99|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     99|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (880:13): [True: 99, False: 75]
  |  Branch (880:32): [True: 16, False: 83]
  ------------------
  881|     16|            break;
  882|    174|    }
  883|  86.0k|    return attr;
  884|  86.0k|}
prvTidyAddAttribute:
  909|     25|{
  910|     25|    AttVal *av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|     25|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     25|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  911|     25|    av->delim = '"';
  912|     25|    av->attribute = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|     25|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     25|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  913|       |
  914|     25|    if (value)
  ------------------
  |  Branch (914:9): [True: 15, False: 10]
  ------------------
  915|     15|        av->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|     15|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     15|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  916|     10|    else
  917|     10|        av->value = NULL;
  918|       |
  919|     25|    av->dict = attrsLookup(doc, &doc->attribs, name);
  920|       |
  921|     25|    TY_(InsertAttributeAtEnd)(node, av);
  ------------------
  |  |   23|     25|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     25|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  922|     25|    return av;
  923|     25|}
prvTidyFreeAttrPriorityList:
  946|     98|{
  947|     98|    PriorityAttribs *priorities = &(doc->attribs.priorityAttribs);
  948|       |
  949|     98|    if ( priorities->list )
  ------------------
  |  Branch (949:10): [True: 0, False: 98]
  ------------------
  950|      0|    {
  951|      0|        uint i = 0;
  952|      0|        while ( priorities->list[i] != NULL )
  ------------------
  |  Branch (952:17): [True: 0, False: 0]
  ------------------
  953|      0|        {
  954|      0|            TidyFree( doc->allocator, priorities->list[i] );
  ------------------
  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  955|      0|            i++;
  956|      0|        }
  957|       |
  958|      0|        TidyFree( doc->allocator, priorities->list );
  ------------------
  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  959|      0|    }
  960|     98|}
prvTidyIsUrl:
 1024|  33.4k|{
 1025|  33.4k|    return CheckAttrType( doc, attrname, CH_URL );
  ------------------
  |  |   64|  33.4k|#define CH_URL         TY_(CheckUrl)
  |  |  ------------------
  |  |  |  |   23|  33.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  33.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1026|  33.4k|}
prvTidyIsScript:
 1036|    298|{
 1037|    298|    return CheckAttrType( doc, attrname, CH_SCRIPT );
  ------------------
  |  |   65|    298|#define CH_SCRIPT      CheckScript
  ------------------
 1038|    298|}
prvTidyIsAnchorElement:
 1042|      1|{
 1043|      1|    TidyTagId tid = TagId( node );
  ------------------
  |  |  270|      1|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 1, False: 0]
  |  |  |  Branch (270:39): [True: 1, False: 0]
  |  |  ------------------
  ------------------
 1044|      1|    if ( tid == TidyTag_A      ||
  ------------------
  |  Branch (1044:10): [True: 0, False: 1]
  ------------------
 1045|      1|         tid == TidyTag_APPLET ||
  ------------------
  |  Branch (1045:10): [True: 0, False: 1]
  ------------------
 1046|      1|         tid == TidyTag_FORM   ||
  ------------------
  |  Branch (1046:10): [True: 0, False: 1]
  ------------------
 1047|      1|         tid == TidyTag_FRAME  ||
  ------------------
  |  Branch (1047:10): [True: 0, False: 1]
  ------------------
 1048|      1|         tid == TidyTag_IFRAME ||
  ------------------
  |  Branch (1048:10): [True: 0, False: 1]
  ------------------
 1049|      1|         tid == TidyTag_IMG    ||
  ------------------
  |  Branch (1049:10): [True: 0, False: 1]
  ------------------
 1050|      1|         tid == TidyTag_MAP )
  ------------------
  |  Branch (1050:10): [True: 0, False: 1]
  ------------------
 1051|      0|        return yes;
 1052|       |
 1053|      1|    return no;
 1054|      1|}
prvTidyFreeAnchors:
 1256|    196|{
 1257|    196|    TidyAttribImpl* attribs = &doc->attribs;
 1258|    196|    Anchor* a;
 1259|    196|    uint h;
 1260|   200k|    for (h = 0; h < ANCHOR_HASH_SIZE; h++) {
  ------------------
  |  Branch (1260:17): [True: 200k, False: 196]
  ------------------
 1261|   200k|        while (NULL != (a = attribs->anchor_hash[h]) )
  ------------------
  |  Branch (1261:16): [True: 0, False: 200k]
  ------------------
 1262|      0|        {
 1263|      0|            attribs->anchor_hash[h] = a->next;
 1264|      0|            FreeAnchor(doc, a);
 1265|      0|        }
 1266|   200k|    }
 1267|    196|}
prvTidyInitAttrs:
 1271|     98|{
 1272|     98|    TidyClearMemory( &doc->attribs, sizeof(TidyAttribImpl) );
  ------------------
  |  |   70|     98|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1273|       |#ifdef _DEBUG
 1274|       |    {
 1275|       |      /* Attribute ID is index position in Attribute type lookup table */
 1276|       |      uint ix;
 1277|       |      for ( ix=0; ix < N_TIDY_ATTRIBS; ++ix )
 1278|       |      {
 1279|       |        const Attribute* dict = &attribute_defs[ ix ];
 1280|       |        assert( (uint) dict->id == ix );
 1281|       |      }
 1282|       |    }
 1283|       |#endif
 1284|     98|}
prvTidyFreeAttrTable:
 1301|     98|{
 1302|     98|    attrsEmptyHash( doc, &doc->attribs );
 1303|     98|    TY_(FreeAnchors)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1304|     98|    FreeDeclaredAttributes( doc );
 1305|     98|}
prvTidyRepairDuplicateAttributes:
 1388|  8.18k|{
 1389|  8.18k|    AttVal *first;
 1390|       |
 1391|  26.8k|    for (first = node->attributes; first != NULL;)
  ------------------
  |  Branch (1391:36): [True: 18.6k, False: 8.18k]
  ------------------
 1392|  18.6k|    {
 1393|  18.6k|        AttVal *second;
 1394|  18.6k|        Bool firstRedefined = no;
 1395|       |
 1396|  18.6k|        if (!(first->asp == NULL && first->php == NULL))
  ------------------
  |  Branch (1396:15): [True: 18.6k, False: 33]
  |  Branch (1396:37): [True: 18.6k, False: 14]
  ------------------
 1397|     47|        {
 1398|     47|            first = first->next;
 1399|     47|            continue;
 1400|     47|        }
 1401|       |
 1402|  52.4M|        for (second = first->next; second != NULL;)
  ------------------
  |  Branch (1402:36): [True: 52.4M, False: 18.6k]
  ------------------
 1403|  52.4M|        {
 1404|  52.4M|            AttVal *temp;
 1405|       |
 1406|  52.4M|            if (!(second->asp == NULL && second->php == NULL
  ------------------
  |  Branch (1406:19): [True: 52.4M, False: 81]
  |  Branch (1406:42): [True: 52.4M, False: 0]
  ------------------
 1407|  52.4M|                  && AttrsHaveSameName(first, second)))
  ------------------
  |  Branch (1407:22): [True: 848, False: 52.4M]
  ------------------
 1408|  52.4M|            {
 1409|  52.4M|                second = second->next;
 1410|  52.4M|                continue;
 1411|  52.4M|            }
 1412|       |
 1413|       |            /* first and second attribute have same local name */
 1414|       |            /* now determine what to do with this duplicate... */
 1415|       |
 1416|    848|            if (!isXml
  ------------------
  |  Branch (1416:17): [True: 0, False: 848]
  ------------------
 1417|    848|                && attrIsCLASS(first) && cfgBool(doc, TidyJoinClasses)
  ------------------
  |  |  206|      0|#define attrIsCLASS(av)             AttrIsId( av, TidyAttr_CLASS  )
  |  |  ------------------
  |  |  |  |  169|    848|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              && attrIsCLASS(first) && cfgBool(doc, TidyJoinClasses)
  ------------------
  |  |  418|    848|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1418|      0|                && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|    848|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 0, False: 0]
  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|      0|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 0, False: 0]
  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1419|      0|            {
 1420|       |                /* concatenate classes */
 1421|       |
 1422|      0|                TY_(AppendToClassAttr)(doc, first, second->value);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1423|       |
 1424|      0|                temp = second->next;
 1425|      0|                TY_(ReportAttrError)( doc, node, second, JOINING_ATTRIBUTE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1426|      0|                TY_(RemoveAttribute)( doc, node, second );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1427|      0|                second = temp;
 1428|      0|            }
 1429|    848|            else if (!isXml
  ------------------
  |  Branch (1429:22): [True: 0, False: 848]
  ------------------
 1430|    848|                     && attrIsSTYLE(first) && cfgBool(doc, TidyJoinStyles)
  ------------------
  |  |  323|      0|#define attrIsSTYLE(av)             AttrIsId( av, TidyAttr_STYLE  )
  |  |  ------------------
  |  |  |  |  169|    848|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                   && attrIsSTYLE(first) && cfgBool(doc, TidyJoinStyles)
  ------------------
  |  |  418|    848|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1431|      0|                     && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|    848|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 0, False: 0]
  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                                   && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|      0|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 0, False: 0]
  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1432|      0|            {
 1433|      0|                AppendToStyleAttr( doc, first, second->value );
 1434|       |
 1435|      0|                temp = second->next;
 1436|      0|                TY_(ReportAttrError)( doc, node, second, JOINING_ATTRIBUTE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1437|      0|                TY_(RemoveAttribute)( doc, node, second );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1438|      0|                second = temp;
 1439|      0|            }
 1440|    848|            else if ( cfg(doc, TidyDuplicateAttrs) == TidyKeepLast )
  ------------------
  |  |  415|    848|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1440:23): [True: 848, False: 0]
  ------------------
 1441|    848|            {
 1442|    848|                temp = first->next;
 1443|    848|                TY_(ReportAttrError)( doc, node, first, REPEATED_ATTRIBUTE);
  ------------------
  |  |   23|    848|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    848|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1444|    848|                TY_(RemoveAttribute)( doc, node, first );
  ------------------
  |  |   23|    848|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    848|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1445|    848|                firstRedefined = yes;
 1446|    848|                first = temp;
 1447|    848|                second = second->next;
 1448|    848|            }
 1449|      0|            else /* TidyDuplicateAttrs == TidyKeepFirst */
 1450|      0|            {
 1451|      0|                temp = second->next;
 1452|      0|                TY_(ReportAttrError)( doc, node, second, REPEATED_ATTRIBUTE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1453|      0|                TY_(RemoveAttribute)( doc, node, second );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1454|      0|                second = temp;
 1455|      0|            }
 1456|    848|        }
 1457|  18.6k|        if (!firstRedefined)
  ------------------
  |  Branch (1457:13): [True: 18.1k, False: 522]
  ------------------
 1458|  18.1k|            first = first->next;
 1459|  18.6k|    }
 1460|  8.18k|}
prvTidyIsBoolAttribute:
 1489|  15.3k|{
 1490|  15.3k|    const Attribute *attribute = ( attval ? attval->dict : NULL );
  ------------------
  |  Branch (1490:36): [True: 15.3k, False: 0]
  ------------------
 1491|  15.3k|    if ( attribute && attribute->attrchk == CH_BOOL )
  ------------------
  |  |   73|      9|#define CH_BOOL        CheckBool
  ------------------
  |  Branch (1491:10): [True: 9, False: 15.3k]
  |  Branch (1491:23): [True: 0, False: 9]
  ------------------
 1492|      0|        return yes;
 1493|  15.3k|    return no;
 1494|  15.3k|}
prvTidyattrIsEvent:
 1497|  15.3k|{
 1498|  15.3k|    TidyAttrId atid = AttrId( attval );
  ------------------
  |  |  168|  15.3k|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 15.3k, False: 0]
  |  |  |  Branch (168:29): [True: 9, False: 15.3k]
  |  |  ------------------
  ------------------
 1499|       |
 1500|  15.3k|    return (atid == TidyAttr_OnAFTERUPDATE     ||
  ------------------
  |  Branch (1500:13): [True: 0, False: 15.3k]
  ------------------
 1501|  15.3k|            atid == TidyAttr_OnBEFOREUNLOAD    ||
  ------------------
  |  Branch (1501:13): [True: 0, False: 15.3k]
  ------------------
 1502|  15.3k|            atid == TidyAttr_OnBEFOREUPDATE    ||
  ------------------
  |  Branch (1502:13): [True: 0, False: 15.3k]
  ------------------
 1503|  15.3k|            atid == TidyAttr_OnBLUR            ||
  ------------------
  |  Branch (1503:13): [True: 0, False: 15.3k]
  ------------------
 1504|  15.3k|            atid == TidyAttr_OnCHANGE          ||
  ------------------
  |  Branch (1504:13): [True: 0, False: 15.3k]
  ------------------
 1505|  15.3k|            atid == TidyAttr_OnCLICK           ||
  ------------------
  |  Branch (1505:13): [True: 0, False: 15.3k]
  ------------------
 1506|  15.3k|            atid == TidyAttr_OnDATAAVAILABLE   ||
  ------------------
  |  Branch (1506:13): [True: 0, False: 15.3k]
  ------------------
 1507|  15.3k|            atid == TidyAttr_OnDATASETCHANGED  ||
  ------------------
  |  Branch (1507:13): [True: 0, False: 15.3k]
  ------------------
 1508|  15.3k|            atid == TidyAttr_OnDATASETCOMPLETE ||
  ------------------
  |  Branch (1508:13): [True: 0, False: 15.3k]
  ------------------
 1509|  15.3k|            atid == TidyAttr_OnDBLCLICK        ||
  ------------------
  |  Branch (1509:13): [True: 0, False: 15.3k]
  ------------------
 1510|  15.3k|            atid == TidyAttr_OnERRORUPDATE     ||
  ------------------
  |  Branch (1510:13): [True: 0, False: 15.3k]
  ------------------
 1511|  15.3k|            atid == TidyAttr_OnFOCUS           ||
  ------------------
  |  Branch (1511:13): [True: 0, False: 15.3k]
  ------------------
 1512|  15.3k|            atid == TidyAttr_OnKEYDOWN         ||
  ------------------
  |  Branch (1512:13): [True: 0, False: 15.3k]
  ------------------
 1513|  15.3k|            atid == TidyAttr_OnKEYPRESS        ||
  ------------------
  |  Branch (1513:13): [True: 0, False: 15.3k]
  ------------------
 1514|  15.3k|            atid == TidyAttr_OnKEYUP           ||
  ------------------
  |  Branch (1514:13): [True: 0, False: 15.3k]
  ------------------
 1515|  15.3k|            atid == TidyAttr_OnLOAD            ||
  ------------------
  |  Branch (1515:13): [True: 0, False: 15.3k]
  ------------------
 1516|  15.3k|            atid == TidyAttr_OnMOUSEDOWN       ||
  ------------------
  |  Branch (1516:13): [True: 0, False: 15.3k]
  ------------------
 1517|  15.3k|            atid == TidyAttr_OnMOUSEMOVE       ||
  ------------------
  |  Branch (1517:13): [True: 0, False: 15.3k]
  ------------------
 1518|  15.3k|            atid == TidyAttr_OnMOUSEOUT        ||
  ------------------
  |  Branch (1518:13): [True: 0, False: 15.3k]
  ------------------
 1519|  15.3k|            atid == TidyAttr_OnMOUSEOVER       ||
  ------------------
  |  Branch (1519:13): [True: 0, False: 15.3k]
  ------------------
 1520|  15.3k|            atid == TidyAttr_OnMOUSEUP         ||
  ------------------
  |  Branch (1520:13): [True: 0, False: 15.3k]
  ------------------
 1521|  15.3k|            atid == TidyAttr_OnRESET           ||
  ------------------
  |  Branch (1521:13): [True: 0, False: 15.3k]
  ------------------
 1522|  15.3k|            atid == TidyAttr_OnROWENTER        ||
  ------------------
  |  Branch (1522:13): [True: 0, False: 15.3k]
  ------------------
 1523|  15.3k|            atid == TidyAttr_OnROWEXIT         ||
  ------------------
  |  Branch (1523:13): [True: 0, False: 15.3k]
  ------------------
 1524|  15.3k|            atid == TidyAttr_OnSELECT          ||
  ------------------
  |  Branch (1524:13): [True: 0, False: 15.3k]
  ------------------
 1525|  15.3k|            atid == TidyAttr_OnSUBMIT          ||
  ------------------
  |  Branch (1525:13): [True: 0, False: 15.3k]
  ------------------
 1526|  15.3k|            atid == TidyAttr_OnUNLOAD);
  ------------------
  |  Branch (1526:13): [True: 0, False: 15.3k]
  ------------------
 1527|  15.3k|}
prvTidyCheckUrl:
 1620|      8|{
 1621|      8|    tmbchar c;
 1622|      8|    tmbstr dest, p;
 1623|      8|    uint escape_count = 0, backslash_count = 0, bad_codepoint_count = 0;
 1624|      8|    uint i, pos = 0;
 1625|      8|    uint len;
 1626|      8|    uint increment;
 1627|      8|    Bool isJavascript = no;
 1628|       |
 1629|      8|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|      8|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 8, False: 0]
  |  |  |  Branch (171:44): [True: 8, False: 0]
  |  |  ------------------
  ------------------
 1630|      0|    {
 1631|      0|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1632|      0|        return;
 1633|      0|    }
 1634|       |
 1635|      8|    p = attval->value;
 1636|       |
 1637|      8|    isJavascript =
 1638|      8|        TY_(tmbstrncmp)(p,"javascript:",sizeof("javascript:")-1)==0;
  ------------------
  |  |   23|      8|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      8|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1639|       |
 1640|  1.14k|    for (i = 0; '\0' != (c = p[i]); ++i)
  ------------------
  |  Branch (1640:17): [True: 1.13k, False: 8]
  ------------------
 1641|  1.13k|    {
 1642|  1.13k|        if (c == '\\')
  ------------------
  |  Branch (1642:13): [True: 2, False: 1.13k]
  ------------------
 1643|      2|        {
 1644|      2|            ++backslash_count;
 1645|      2|            if ( cfgBool(doc, TidyFixBackslash) && !isJavascript)
  ------------------
  |  |  418|      4|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      2|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1645:52): [True: 2, False: 0]
  ------------------
 1646|      2|                p[i] = '/';
 1647|      2|        }
 1648|  1.13k|        else if ((c > 0x7e) || (c <= 0x20) || (strchr("<>", c)))
  ------------------
  |  Branch (1648:18): [True: 0, False: 1.13k]
  |  Branch (1648:32): [True: 816, False: 314]
  |  Branch (1648:47): [True: 39, False: 275]
  ------------------
 1649|    855|            ++escape_count;
 1650|  1.13k|    }
 1651|       |
 1652|    614|    while ( *p != 0 )
  ------------------
  |  Branch (1652:13): [True: 606, False: 8]
  ------------------
 1653|    606|    {
 1654|    606|        if ( !IsURLCodePoint( p, &increment ) )
  ------------------
  |  Branch (1654:14): [True: 310, False: 296]
  ------------------
 1655|    310|            ++bad_codepoint_count;
 1656|    606|         p = p + increment;
 1657|    606|    }
 1658|      8|    p = attval->value;
 1659|       |
 1660|      8|    if ( cfgBool(doc, TidyFixUri) && escape_count )
  ------------------
  |  |  418|     16|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      8|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 8, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1660:38): [True: 4, False: 4]
  ------------------
 1661|      4|    {
 1662|      4|        Bool hadnonspace = no;
 1663|      4|        len = TY_(tmbstrlen)(p) + escape_count * 2 + 1;
  ------------------
  |  |   23|      4|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      4|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1664|      4|        dest = (tmbstr) TidyDocAlloc(doc, len);
  ------------------
  |  |  157|      4|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|      4|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 1665|       | 
 1666|  1.07k|        for (i = 0; 0 != (c = p[i]); ++i)
  ------------------
  |  Branch (1666:21): [True: 1.06k, False: 4]
  ------------------
 1667|  1.06k|        {
 1668|  1.06k|            if ((c > 0x7e) || (c <= 0x20) || (strchr("<>", c)))
  ------------------
  |  Branch (1668:17): [True: 0, False: 1.06k]
  |  Branch (1668:31): [True: 816, False: 252]
  |  Branch (1668:46): [True: 39, False: 213]
  ------------------
 1669|    855|            {
 1670|    855|                if (c == 0x20)
  ------------------
  |  Branch (1670:21): [True: 24, False: 831]
  ------------------
 1671|     24|                {
 1672|       |                    /* #345 - special case for leading spaces - discard */
 1673|     24|                    if (hadnonspace)
  ------------------
  |  Branch (1673:25): [True: 24, False: 0]
  ------------------
 1674|     24|                        pos += sprintf( dest + pos, "%%%02X", (byte)c );
 1675|     24|                }
 1676|    831|                else
 1677|    831|                {
 1678|    831|                    pos += sprintf( dest + pos, "%%%02X", (byte)c );
 1679|    831|                    hadnonspace = yes;
 1680|    831|                }
 1681|    855|            }
 1682|    213|            else
 1683|    213|            {
 1684|    213|                hadnonspace = yes;
 1685|    213|                dest[pos++] = c;
 1686|    213|            }
 1687|  1.06k|        }
 1688|      4|        dest[pos] = 0;
 1689|       |
 1690|      4|        TidyDocFree(doc, attval->value);
  ------------------
  |  |  159|      4|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      4|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1691|      4|        attval->value = dest;
 1692|      4|    }
 1693|      8|    if ( backslash_count )
  ------------------
  |  Branch (1693:10): [True: 2, False: 6]
  ------------------
 1694|      2|    {
 1695|      2|        if ( cfgBool(doc, TidyFixBackslash) && !isJavascript )
  ------------------
  |  |  418|      4|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      2|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 2, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1695:48): [True: 2, False: 0]
  ------------------
 1696|      2|            TY_(ReportAttrError)( doc, node, attval, FIXED_BACKSLASH );
  ------------------
  |  |   23|      2|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      2|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1697|      0|        else
 1698|      0|            TY_(ReportAttrError)( doc, node, attval, BACKSLASH_IN_URI );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1699|      2|    }
 1700|      8|    if ( escape_count )
  ------------------
  |  Branch (1700:10): [True: 4, False: 4]
  ------------------
 1701|      4|    {
 1702|      4|        if ( cfgBool(doc, TidyFixUri) )
  ------------------
  |  |  418|      4|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      4|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 4, False: 0]
  |  |  ------------------
  ------------------
 1703|      4|            TY_(ReportAttrError)( doc, node, attval, ESCAPED_ILLEGAL_URI);
  ------------------
  |  |   23|      4|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      4|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1704|      0|        else if ( !(TY_(HTMLVersion)(doc) & VERS_HTML5) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      else if ( !(TY_(HTMLVersion)(doc) & VERS_HTML5) )
  ------------------
  |  |  213|      0|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|      0|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|      0|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (1704:19): [True: 0, False: 0]
  ------------------
 1705|      0|            TY_(ReportAttrError)( doc, node, attval, ILLEGAL_URI_REFERENCE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1706|       |
 1707|      4|        doc->badChars |= BC_INVALID_URI;
  ------------------
  |  |  304|      4|#define BC_INVALID_URI             32
  ------------------
 1708|      4|    }
 1709|      8|    if ( bad_codepoint_count )
  ------------------
  |  Branch (1709:10): [True: 4, False: 4]
  ------------------
 1710|      4|    {
 1711|      4|        TY_(ReportAttrError)( doc, node, attval, ILLEGAL_URI_CODEPOINT );
  ------------------
  |  |   23|      4|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      4|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1712|      4|    }
 1713|      8|}
prvTidyIsValidXMLID:
 1748|  62.3k|{
 1749|  62.3k|    ctmbstr s = id;
 1750|  62.3k|    tchar c;
 1751|       |
 1752|  62.3k|    if (!s)
  ------------------
  |  Branch (1752:9): [True: 0, False: 62.3k]
  ------------------
 1753|      0|        return no;
 1754|       |
 1755|  62.3k|    c = *s++;
 1756|  62.3k|    if (c > 0x7F)
  ------------------
  |  Branch (1756:9): [True: 2.28k, False: 60.0k]
  ------------------
 1757|  2.28k|        s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|  2.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1758|       |
 1759|  62.3k|    if (!(TY_(IsXMLLetter)(c) || c == '_' || c == ':'))
  ------------------
  |  |   23|  62.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  62.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1759:11): [True: 30.6k, False: 31.7k]
  |  Branch (1759:34): [True: 264, False: 31.4k]
  |  Branch (1759:46): [True: 9, False: 31.4k]
  ------------------
 1760|  31.4k|        return no;
 1761|       |
 1762|  3.45M|    while (*s)
  ------------------
  |  Branch (1762:12): [True: 3.42M, False: 29.4k]
  ------------------
 1763|  3.42M|    {
 1764|  3.42M|        c = (unsigned char)*s;
 1765|       |
 1766|  3.42M|        if (c > 0x7F)
  ------------------
  |  Branch (1766:13): [True: 2.31k, False: 3.42M]
  ------------------
 1767|  2.31k|            s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|  2.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1768|       |
 1769|  3.42M|        ++s;
 1770|       |
 1771|  3.42M|        if (!TY_(IsXMLNamechar)(c))
  ------------------
  |  |   23|  3.42M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.42M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1771:13): [True: 1.48k, False: 3.42M]
  ------------------
 1772|  1.48k|            return no;
 1773|  3.42M|    }
 1774|       |
 1775|  29.4k|    return yes;
 1776|  30.9k|}
prvTidySortAttributes:
 2460|  36.8k|{
 2461|   109k|    while (node)
  ------------------
  |  Branch (2461:12): [True: 72.9k, False: 36.8k]
  ------------------
 2462|  72.9k|    {
 2463|  72.9k|        node->attributes = SortAttVal( doc, node->attributes, strat );
 2464|  72.9k|        if (node->content)
  ------------------
  |  Branch (2464:13): [True: 36.7k, False: 36.1k]
  ------------------
 2465|  36.7k|            TY_(SortAttributes)(doc, node->content, strat);
  ------------------
  |  |   23|  36.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2466|  72.9k|        node = node->next;
 2467|  72.9k|    }
 2468|  36.8k|}
attrs.c:attrsLookup:
  836|  52.8k|{
  837|  52.8k|    const Attribute *np;
  838|  52.8k|    const AttrHash *p;
  839|       |
  840|  52.8k|    if (!atnam)
  ------------------
  |  Branch (840:9): [True: 0, False: 52.8k]
  ------------------
  841|      0|        return NULL;
  842|       |
  843|  53.1k|    for (p = attribs->hashtab[attrsHash(atnam)]; p && p->attr; p = p->next)
  ------------------
  |  Branch (843:50): [True: 17.5k, False: 35.5k]
  |  Branch (843:55): [True: 17.5k, False: 0]
  ------------------
  844|  17.5k|        if (TY_(tmbstrcasecmp)(atnam, p->attr->name) == 0)
  ------------------
  |  |   23|  17.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (844:13): [True: 17.2k, False: 316]
  ------------------
  845|  17.2k|            return p->attr;
  846|       |
  847|  8.48M|    for (np = attribute_defs; np && np->name; ++np)
  ------------------
  |  Branch (847:31): [True: 8.48M, False: 0]
  |  Branch (847:37): [True: 8.46M, False: 22.0k]
  ------------------
  848|  8.46M|        if (TY_(tmbstrcasecmp)(atnam, np->name) == 0)
  ------------------
  |  |   23|  8.46M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.46M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (848:13): [True: 13.4k, False: 8.44M]
  ------------------
  849|  13.4k|            return attrsInstall(doc, attribs, np);
  850|       |
  851|  22.0k|    return NULL;
  852|  35.5k|}
attrs.c:attrsHash:
  764|  66.2k|{
  765|  66.2k|    uint hashval;
  766|       |
  767|  2.93M|    for (hashval = 0; *s != '\0'; s++)
  ------------------
  |  Branch (767:23): [True: 2.86M, False: 66.2k]
  ------------------
  768|  2.86M|        hashval = *s + 31*hashval;
  769|       |
  770|  66.2k|    return hashval % ATTRIBUTE_HASH_SIZE;
  771|  66.2k|}
attrs.c:attrsInstall:
  775|  13.4k|{
  776|  13.4k|    AttrHash *np;
  777|  13.4k|    uint hashval;
  778|       |
  779|  13.4k|    if (old)
  ------------------
  |  Branch (779:9): [True: 13.4k, False: 0]
  ------------------
  780|  13.4k|    {
  781|  13.4k|        np = (AttrHash *)TidyDocAlloc(doc, sizeof(*np));
  ------------------
  |  |  157|  13.4k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  13.4k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  782|  13.4k|        np->attr = old;
  783|       |
  784|  13.4k|        hashval = attrsHash(old->name);
  785|  13.4k|        np->next = attribs->hashtab[hashval];
  786|  13.4k|        attribs->hashtab[hashval] = np;
  787|  13.4k|    }
  788|       |
  789|  13.4k|    return old;
  790|  13.4k|}
attrs.c:CheckAttrType:
 1018|  33.7k|{
 1019|  33.7k|    const Attribute* np = attrsLookup( doc, &doc->attribs, attrname );
 1020|  33.7k|    return (Bool)( np && np->attrchk == type );
  ------------------
  |  Branch (1020:20): [True: 30.3k, False: 3.39k]
  |  Branch (1020:26): [True: 18.4k, False: 11.9k]
  ------------------
 1021|  33.7k|}
attrs.c:attrsEmptyHash:
  814|     98|{
  815|     98|    AttrHash *dict, *next;
  816|     98|    uint i;
  817|       |
  818|  17.5k|    for (i = 0; i < ATTRIBUTE_HASH_SIZE; ++i)
  ------------------
  |  Branch (818:17): [True: 17.4k, False: 98]
  ------------------
  819|  17.4k|    {
  820|  17.4k|        dict = attribs->hashtab[i];
  821|       |
  822|  30.9k|        while(dict)
  ------------------
  |  Branch (822:15): [True: 13.4k, False: 17.4k]
  ------------------
  823|  13.4k|        {
  824|  13.4k|            next = dict->next;
  825|  13.4k|            TidyDocFree(doc, dict);
  ------------------
  |  |  159|  13.4k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  13.4k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  826|  13.4k|            dict = next;
  827|  13.4k|        }
  828|       |
  829|       |        attribs->hashtab[i] = NULL;
  830|  17.4k|    }
  831|     98|}
attrs.c:FreeDeclaredAttributes:
 1288|     98|{
 1289|     98|    TidyAttribImpl* attribs = &doc->attribs;
 1290|     98|    Attribute* dict;
 1291|     98|    while ( NULL != (dict = attribs->declared_attr_list) )
  ------------------
  |  Branch (1291:13): [True: 0, False: 98]
  ------------------
 1292|      0|    {
 1293|      0|        attribs->declared_attr_list = dict->next;
 1294|      0|        attrsRemoveFromHash( doc, &doc->attribs, dict->name );
 1295|      0|        TidyDocFree( doc, dict->name );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1296|      0|        TidyDocFree( doc, dict );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1297|      0|    }
 1298|     98|}
attrs.c:AttrsHaveSameName:
 1373|  52.4M|{
 1374|  52.4M|    TidyAttrId id1, id2;
 1375|       |
 1376|  52.4M|    id1 = AttrId(av1);
  ------------------
  |  |  168|  52.4M|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 52.4M, False: 0]
  |  |  |  Branch (168:29): [True: 42.3k, False: 52.3M]
  |  |  ------------------
  ------------------
 1377|  52.4M|    id2 = AttrId(av2);
  ------------------
  |  |  168|  52.4M|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 52.4M, False: 0]
  |  |  |  Branch (168:29): [True: 74.2k, False: 52.3M]
  |  |  ------------------
  ------------------
 1378|  52.4M|    if (id1 != TidyAttr_UNKNOWN && id2 != TidyAttr_UNKNOWN)
  ------------------
  |  Branch (1378:9): [True: 42.3k, False: 52.3M]
  |  Branch (1378:36): [True: 132, False: 42.2k]
  ------------------
 1379|    132|        return AttrsHaveSameId(av1, av2);
  ------------------
  |  |  178|    132|#define AttrsHaveSameId(a, b) (a && b && a->dict && b->dict && a->dict->id && \
  |  |  ------------------
  |  |  |  Branch (178:32): [True: 132, False: 0]
  |  |  |  Branch (178:37): [True: 132, False: 0]
  |  |  |  Branch (178:42): [True: 132, False: 0]
  |  |  |  Branch (178:53): [True: 132, False: 0]
  |  |  |  Branch (178:64): [True: 132, False: 0]
  |  |  ------------------
  |  |  179|    132|                               b->dict->id && a->dict->id == b->dict->id)
  |  |  ------------------
  |  |  |  Branch (179:32): [True: 132, False: 0]
  |  |  |  Branch (179:47): [True: 98, False: 34]
  |  |  ------------------
  ------------------
 1380|  52.4M|    if (id1 != TidyAttr_UNKNOWN || id2 != TidyAttr_UNKNOWN)
  ------------------
  |  Branch (1380:9): [True: 42.2k, False: 52.3M]
  |  Branch (1380:36): [True: 74.1k, False: 52.3M]
  ------------------
 1381|   116k|        return no;
 1382|  52.3M|    if (av1->attribute && av2->attribute)
  ------------------
  |  Branch (1382:9): [True: 52.3M, False: 0]
  |  Branch (1382:27): [True: 52.3M, False: 0]
  ------------------
 1383|  52.3M|        return TY_(tmbstrcmp)(av1->attribute, av2->attribute) == 0;
  ------------------
  |  |   23|  52.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  52.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1384|      0|     return no;
 1385|  52.3M|}
attrs.c:IsURLCodePoint:
 1572|    606|{
 1573|    606|    uint c;
 1574|    606|    *increment = TY_(GetUTF8)( p, &c ) + 1;
  ------------------
  |  |   23|    606|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    606|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1575|       |
 1576|    606|    return ISALNUM( c ) ||
  ------------------
  |  | 1569|  1.21k|#define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1566|  1.21k|#define ISUPPER(a) ((a >= 'A') && (a <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1566:21): [True: 462, False: 144]
  |  |  |  |  |  Branch (1566:35): [True: 44, False: 418]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1567|  1.16k|#define ISLOWER(a) ((a >= 'a') && (a <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1567:21): [True: 364, False: 198]
  |  |  |  |  |  Branch (1567:35): [True: 98, False: 266]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1568|    464|#define ISNUMERIC(a) ((a >= '0') && (a <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1568:23): [True: 380, False: 84]
  |  |  |  |  |  Branch (1568:37): [True: 14, False: 366]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1577|    450|        c == '%' ||    /* not a valid codepoint, but an escape sequence */
  ------------------
  |  Branch (1577:9): [True: 0, False: 450]
  ------------------
 1578|    450|        c == '#' ||    /* not a valid codepoint, but a delimiter */
  ------------------
  |  Branch (1578:9): [True: 3, False: 447]
  ------------------
 1579|    447|        c == '!' ||
  ------------------
  |  Branch (1579:9): [True: 3, False: 444]
  ------------------
 1580|    444|        c == '$' ||
  ------------------
  |  Branch (1580:9): [True: 0, False: 444]
  ------------------
 1581|    444|        c == '&' ||
  ------------------
  |  Branch (1581:9): [True: 3, False: 441]
  ------------------
 1582|    441|        c == '\'' ||
  ------------------
  |  Branch (1582:9): [True: 16, False: 425]
  ------------------
 1583|    425|        c == '(' ||
  ------------------
  |  Branch (1583:9): [True: 6, False: 419]
  ------------------
 1584|    419|        c == ')' ||
  ------------------
  |  Branch (1584:9): [True: 0, False: 419]
  ------------------
 1585|    419|        c == '*' ||
  ------------------
  |  Branch (1585:9): [True: 0, False: 419]
  ------------------
 1586|    419|        c == '+' ||
  ------------------
  |  Branch (1586:9): [True: 0, False: 419]
  ------------------
 1587|    419|        c == ',' ||
  ------------------
  |  Branch (1587:9): [True: 0, False: 419]
  ------------------
 1588|    419|        c == '-' ||
  ------------------
  |  Branch (1588:9): [True: 1, False: 418]
  ------------------
 1589|    418|        c == '.' ||
  ------------------
  |  Branch (1589:9): [True: 7, False: 411]
  ------------------
 1590|    411|        c == '/' ||
  ------------------
  |  Branch (1590:9): [True: 21, False: 390]
  ------------------
 1591|    390|        c == ':' ||
  ------------------
  |  Branch (1591:9): [True: 1, False: 389]
  ------------------
 1592|    389|        c == ';' ||
  ------------------
  |  Branch (1592:9): [True: 0, False: 389]
  ------------------
 1593|    389|        c == '=' ||
  ------------------
  |  Branch (1593:9): [True: 3, False: 386]
  ------------------
 1594|    386|        c == '?' ||
  ------------------
  |  Branch (1594:9): [True: 0, False: 386]
  ------------------
 1595|    386|        c == '@' ||
  ------------------
  |  Branch (1595:9): [True: 3, False: 383]
  ------------------
 1596|    383|        c == '_' ||
  ------------------
  |  Branch (1596:9): [True: 51, False: 332]
  ------------------
 1597|    332|        c == '~' ||
  ------------------
  |  Branch (1597:9): [True: 0, False: 332]
  ------------------
 1598|    332|        (c >= 0x00A0 && c <= 0xD7FF) ||
  ------------------
  |  Branch (1598:10): [True: 266, False: 66]
  |  Branch (1598:25): [True: 16, False: 250]
  ------------------
 1599|    316|        (c >= 0xE000 && c <= 0xFDCF) ||
  ------------------
  |  Branch (1599:10): [True: 250, False: 66]
  |  Branch (1599:25): [True: 3, False: 247]
  ------------------
 1600|    313|        (c >= 0xFDF0 && c <= 0xFFEF) ||
  ------------------
  |  Branch (1600:10): [True: 247, False: 66]
  |  Branch (1600:25): [True: 0, False: 247]
  ------------------
 1601|    313|        (c >= 0x10000 && c <= 0x1FFFD) ||
  ------------------
  |  Branch (1601:10): [True: 3, False: 310]
  |  Branch (1601:26): [True: 0, False: 3]
  ------------------
 1602|    313|        (c >= 0x20000 && c <= 0x2FFFD) ||
  ------------------
  |  Branch (1602:10): [True: 3, False: 310]
  |  Branch (1602:26): [True: 0, False: 3]
  ------------------
 1603|    313|        (c >= 0x30000 && c <= 0x3FFFD) ||
  ------------------
  |  Branch (1603:10): [True: 3, False: 310]
  |  Branch (1603:26): [True: 0, False: 3]
  ------------------
 1604|    313|        (c >= 0x40000 && c <= 0x4FFFD) ||
  ------------------
  |  Branch (1604:10): [True: 3, False: 310]
  |  Branch (1604:26): [True: 0, False: 3]
  ------------------
 1605|    313|        (c >= 0x50000 && c <= 0x5FFFD) ||
  ------------------
  |  Branch (1605:10): [True: 3, False: 310]
  |  Branch (1605:26): [True: 0, False: 3]
  ------------------
 1606|    313|        (c >= 0x60000 && c <= 0x6FFFD) ||
  ------------------
  |  Branch (1606:10): [True: 3, False: 310]
  |  Branch (1606:26): [True: 0, False: 3]
  ------------------
 1607|    313|        (c >= 0x70000 && c <= 0x7FFFD) ||
  ------------------
  |  Branch (1607:10): [True: 3, False: 310]
  |  Branch (1607:26): [True: 0, False: 3]
  ------------------
 1608|    313|        (c >= 0x80000 && c <= 0x8FFFD) ||
  ------------------
  |  Branch (1608:10): [True: 3, False: 310]
  |  Branch (1608:26): [True: 0, False: 3]
  ------------------
 1609|    313|        (c >= 0x90000 && c <= 0x9FFFD) ||
  ------------------
  |  Branch (1609:10): [True: 3, False: 310]
  |  Branch (1609:26): [True: 0, False: 3]
  ------------------
 1610|    313|        (c >= 0xA0000 && c <= 0xAFFFD) ||
  ------------------
  |  Branch (1610:10): [True: 3, False: 310]
  |  Branch (1610:26): [True: 0, False: 3]
  ------------------
 1611|    313|        (c >= 0xB0000 && c <= 0xBFFFD) ||
  ------------------
  |  Branch (1611:10): [True: 3, False: 310]
  |  Branch (1611:26): [True: 0, False: 3]
  ------------------
 1612|    313|        (c >= 0xC0000 && c <= 0xCFFFD) ||
  ------------------
  |  Branch (1612:10): [True: 3, False: 310]
  |  Branch (1612:26): [True: 0, False: 3]
  ------------------
 1613|    313|        (c >= 0xD0000 && c <= 0xDFFFD) ||
  ------------------
  |  Branch (1613:10): [True: 3, False: 310]
  |  Branch (1613:26): [True: 0, False: 3]
  ------------------
 1614|    313|        (c >= 0xE0000 && c <= 0xEFFFD) ||
  ------------------
  |  Branch (1614:10): [True: 3, False: 310]
  |  Branch (1614:26): [True: 1, False: 2]
  ------------------
 1615|    312|        (c >= 0xF0000 && c <= 0xFFFFD) ||
  ------------------
  |  Branch (1615:10): [True: 2, False: 310]
  |  Branch (1615:26): [True: 2, False: 0]
  ------------------
 1616|    310|        (c >= 0x100000 && c <= 0x10FFFD);
  ------------------
  |  Branch (1616:10): [True: 0, False: 310]
  |  Branch (1616:27): [True: 0, False: 0]
  ------------------
 1617|    606|}
attrs.c:SortAttVal:
 2592|  72.9k|{
 2593|       |    /* Get the list from the passed-in tidyDoc. */
 2594|  72.9k|    ctmbstr* priorityList = (ctmbstr*)doc->attribs.priorityAttribs.list;
 2595|       |
 2596|  72.9k|    ptAttValComparator ptComparator = GetAttValComparator(strat, priorityList);
 2597|  72.9k|    AttVal *p, *q, *e, *tail;
 2598|  72.9k|    int insize, nmerges, psize, qsize, i;
 2599|       |
 2600|       |    /*
 2601|       |    * Silly special case: if `list' was passed in as NULL, return
 2602|       |    * NULL immediately.
 2603|       |    */
 2604|  72.9k|    if (!list)
  ------------------
  |  Branch (2604:9): [True: 71.5k, False: 1.43k]
  ------------------
 2605|  71.5k|        return NULL;
 2606|       |
 2607|       |    /* If no comparator, return the list as-is */
 2608|  1.43k|    if (ptComparator == 0)
  ------------------
  |  Branch (2608:9): [True: 1.43k, False: 0]
  ------------------
 2609|  1.43k|        return list;
 2610|       |
 2611|      0|    insize = 1;
 2612|       |
 2613|      0|    while (1) {
  ------------------
  |  Branch (2613:12): [True: 0, Folded]
  ------------------
 2614|      0|        p = list;
 2615|      0|        list = NULL;
 2616|      0|        tail = NULL;
 2617|       |
 2618|      0|        nmerges = 0;  /* count number of merges we do in this pass */
 2619|       |
 2620|      0|        while (p) {
  ------------------
  |  Branch (2620:16): [True: 0, False: 0]
  ------------------
 2621|      0|            nmerges++;  /* there exists a merge to be done */
 2622|       |            /* step `insize' places along from p */
 2623|      0|            q = p;
 2624|      0|            psize = 0;
 2625|      0|            for (i = 0; i < insize; i++) {
  ------------------
  |  Branch (2625:25): [True: 0, False: 0]
  ------------------
 2626|      0|                psize++;
 2627|      0|                q = q->next;
 2628|      0|                if(!q) break;
  ------------------
  |  Branch (2628:20): [True: 0, False: 0]
  ------------------
 2629|      0|            }
 2630|       |
 2631|       |            /* if q hasn't fallen off end, we have two lists to merge */
 2632|      0|            qsize = insize;
 2633|       |
 2634|       |            /* now we have two lists; merge them */
 2635|      0|            while (psize > 0 || (qsize > 0 && q)) {
  ------------------
  |  Branch (2635:20): [True: 0, False: 0]
  |  Branch (2635:34): [True: 0, False: 0]
  |  Branch (2635:47): [True: 0, False: 0]
  ------------------
 2636|       |
 2637|       |                /* decide whether next element of merge comes from p or q */
 2638|      0|                if (psize == 0) {
  ------------------
  |  Branch (2638:21): [True: 0, False: 0]
  ------------------
 2639|       |                    /* p is empty; e must come from q. */
 2640|      0|                    e = q; q = q->next; qsize--;
 2641|      0|                } else if (qsize == 0 || !q) {
  ------------------
  |  Branch (2641:28): [True: 0, False: 0]
  |  Branch (2641:42): [True: 0, False: 0]
  ------------------
 2642|       |                    /* q is empty; e must come from p. */
 2643|      0|                    e = p; p = p->next; psize--;
 2644|      0|                } else if (ptComparator(p,q, priorityList) <= 0) {
  ------------------
  |  Branch (2644:28): [True: 0, False: 0]
  ------------------
 2645|       |                    /* First element of p is lower (or same);
 2646|       |                    * e must come from p. */
 2647|      0|                    e = p; p = p->next; psize--;
 2648|      0|                } else {
 2649|       |                    /* First element of q is lower; e must come from q. */
 2650|      0|                    e = q; q = q->next; qsize--;
 2651|      0|                }
 2652|       |
 2653|       |                /* add the next element to the merged list */
 2654|      0|                if (tail) {
  ------------------
  |  Branch (2654:21): [True: 0, False: 0]
  ------------------
 2655|      0|                    tail->next = e;
 2656|      0|                } else {
 2657|      0|                    list = e;
 2658|      0|                }
 2659|       |
 2660|      0|                tail = e;
 2661|      0|            }
 2662|       |
 2663|       |            /* now p has stepped `insize' places along, and q has too */
 2664|      0|            p = q;
 2665|      0|        }
 2666|       |
 2667|      0|        tail->next = NULL;
 2668|       |
 2669|       |        /* If we have done only one merge, we're finished. */
 2670|      0|        if (nmerges <= 1)   /* allow for nmerges==0, the empty list case */
  ------------------
  |  Branch (2670:13): [True: 0, False: 0]
  ------------------
 2671|      0|            return list;
 2672|       |
 2673|       |        /* Otherwise repeat, merging lists twice the size */
 2674|      0|        insize *= 2;
 2675|      0|    }
 2676|      0|}
attrs.c:GetAttValComparator:
 2576|  72.9k|{
 2577|  72.9k|    switch (strat)
  ------------------
  |  Branch (2577:13): [True: 72.9k, False: 0]
  ------------------
 2578|  72.9k|    {
 2579|      0|    case TidySortAttrAlpha:
  ------------------
  |  Branch (2579:5): [True: 0, False: 72.9k]
  ------------------
 2580|      0|        return AlphaComparator;
 2581|  72.9k|    case TidySortAttrNone:
  ------------------
  |  Branch (2581:5): [True: 72.9k, False: 0]
  ------------------
 2582|  72.9k|        if ( list && list[0] )
  ------------------
  |  Branch (2582:14): [True: 0, False: 72.9k]
  |  Branch (2582:22): [True: 0, False: 0]
  ------------------
 2583|      0|            return PriorityComparator;
 2584|  72.9k|        break;
 2585|  72.9k|    }
 2586|  72.9k|    return 0;
 2587|  72.9k|}

tidyInitInputBuffer:
   36|     98|{
   37|     98|  inp->getByte    = insrc_getByte;
   38|     98|  inp->eof        = insrc_eof;
   39|     98|  inp->ungetByte  = insrc_ungetByte;
   40|     98|  inp->sourceData = buf;
   41|     98|}
tidyInitOutputBuffer:
   50|    196|{
   51|    196|  outp->putByte  = outsink_putByte;
   52|    196|  outp->sinkData = buf;
   53|    196|}
tidyBufInit:
   57|    196|{
   58|    196|    assert( buf != NULL );
  ------------------
  |  Branch (58:5): [True: 0, False: 196]
  |  Branch (58:5): [True: 196, False: 0]
  ------------------
   59|    196|    tidyBufInitWithAllocator( buf, NULL );
   60|    196|}
tidyBufInitWithAllocator:
   69|    588|{
   70|    588|    assert( buf != NULL );
  ------------------
  |  Branch (70:5): [True: 0, False: 588]
  |  Branch (70:5): [True: 588, False: 0]
  ------------------
   71|    588|    TidyClearMemory( buf, sizeof(TidyBuffer) );
  ------------------
  |  |   70|    588|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
   72|    588|    buf->allocator = allocator ? allocator : &TY_(g_default_allocator);
  ------------------
  |  |   23|    196|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    196|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (72:22): [True: 392, False: 196]
  ------------------
   73|    588|}
tidyBufFree:
   85|    196|{
   86|    196|    assert( buf != NULL );
  ------------------
  |  Branch (86:5): [True: 0, False: 196]
  |  Branch (86:5): [True: 196, False: 0]
  ------------------
   87|    196|    TidyFree(  buf->allocator, buf->bp );
  ------------------
  |  |   68|    196|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
   88|    196|    tidyBufInitWithAllocator( buf, buf->allocator );
   89|    196|}
tidyBufClear:
   92|    196|{
   93|    196|    assert( buf != NULL );
  ------------------
  |  Branch (93:5): [True: 0, False: 196]
  |  Branch (93:5): [True: 196, False: 0]
  ------------------
   94|    196|    if ( buf->bp )
  ------------------
  |  Branch (94:10): [True: 0, False: 196]
  ------------------
   95|      0|    {
   96|      0|        TidyClearMemory( buf->bp, buf->allocated );
  ------------------
  |  |   70|      0|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
   97|      0|        buf->size = 0;
   98|      0|    }
   99|    196|    buf->next = 0;
  100|    196|}
tidyBufCheckAlloc:
  116|   229M|{
  117|   229M|    assert( buf != NULL );
  ------------------
  |  Branch (117:5): [True: 0, False: 229M]
  |  Branch (117:5): [True: 229M, False: 0]
  ------------------
  118|       |
  119|   229M|    if ( !buf->allocator )
  ------------------
  |  Branch (119:10): [True: 0, False: 229M]
  ------------------
  120|      0|        setDefaultAllocator( buf );
  121|       |        
  122|   229M|    if ( 0 == chunkSize )
  ------------------
  |  Branch (122:10): [True: 229M, False: 0]
  ------------------
  123|   229M|        chunkSize = 256;
  124|   229M|    if ( allocSize+1 > buf->allocated )
  ------------------
  |  Branch (124:10): [True: 1.25k, False: 229M]
  ------------------
  125|  1.25k|    {
  126|  1.25k|        byte* bp;
  127|  1.25k|        uint allocAmt = chunkSize;
  128|  1.25k|        if ( buf->allocated > 0 )
  ------------------
  |  Branch (128:14): [True: 1.15k, False: 98]
  ------------------
  129|  1.15k|            allocAmt = buf->allocated;
  130|  2.40k|        while ( allocAmt < allocSize+1 )
  ------------------
  |  Branch (130:17): [True: 1.15k, False: 1.25k]
  ------------------
  131|  1.15k|            allocAmt *= 2;
  132|       |
  133|  1.25k|        bp = (byte*)TidyRealloc( buf->allocator, buf->bp, allocAmt );
  ------------------
  |  |   67|  1.25k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  134|  1.25k|        if ( bp != NULL )
  ------------------
  |  Branch (134:14): [True: 1.25k, False: 0]
  ------------------
  135|  1.25k|        {
  136|  1.25k|            TidyClearMemory( bp + buf->allocated, allocAmt - buf->allocated );
  ------------------
  |  |   70|  1.25k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  137|  1.25k|            buf->bp = bp;
  138|  1.25k|            buf->allocated = allocAmt;
  139|  1.25k|        }
  140|  1.25k|    }
  141|   229M|}
tidyBufAttach:
  145|     98|{
  146|     98|    assert( buf != NULL );
  ------------------
  |  Branch (146:5): [True: 0, False: 98]
  |  Branch (146:5): [True: 98, False: 0]
  ------------------
  147|     98|    buf->bp = bp;
  148|     98|    buf->size = buf->allocated = size;
  149|     98|    buf->next = 0;
  150|     98|    if ( !buf->allocator )
  ------------------
  |  Branch (150:10): [True: 0, False: 98]
  ------------------
  151|      0|        setDefaultAllocator( buf );
  152|     98|}
tidyBufDetach:
  156|     98|{
  157|     98|    tidyBufInitWithAllocator( buf, buf->allocator );
  158|     98|}
tidyBufPutByte:
  177|   229M|{
  178|   229M|    assert( buf != NULL );
  ------------------
  |  Branch (178:5): [True: 0, False: 229M]
  |  Branch (178:5): [True: 229M, False: 0]
  ------------------
  179|   229M|    tidyBufCheckAlloc( buf, buf->size + 1, 0 );
  180|   229M|    buf->bp[ buf->size++ ] = bv;
  181|   229M|}
tidyBufGetByte:
  198|  42.3M|{
  199|  42.3M|    int bv = EOF;
  200|  42.3M|    if ( ! tidyBufEndOfInput(buf) )
  ------------------
  |  Branch (200:10): [True: 42.3M, False: 0]
  ------------------
  201|  42.3M|      bv = buf->bp[ buf->next++ ];
  202|  42.3M|    return bv;
  203|  42.3M|}
tidyBufEndOfInput:
  206|  84.6M|{
  207|  84.6M|    return ( buf->next >= buf->size );
  208|  84.6M|}
tidyBufUngetByte:
  211|  33.3k|{
  212|  33.3k|    if ( buf->next > 0 )
  ------------------
  |  Branch (212:10): [True: 33.3k, False: 0]
  ------------------
  213|  33.3k|    {
  214|  33.3k|        --buf->next;
  215|       |        assert( bv == buf->bp[ buf->next ] );
  ------------------
  |  Branch (215:9): [True: 0, False: 33.3k]
  |  Branch (215:9): [True: 33.3k, False: 0]
  ------------------
  216|  33.3k|    }
  217|  33.3k|}
buffio.c:insrc_getByte:
   20|  42.3M|{
   21|  42.3M|  TidyBuffer* buf = (TidyBuffer*) appData;
   22|  42.3M|  return tidyBufGetByte( buf );
   23|  42.3M|}
buffio.c:insrc_eof:
   25|  42.3M|{
   26|  42.3M|  TidyBuffer* buf = (TidyBuffer*) appData;
   27|  42.3M|  return tidyBufEndOfInput( buf );
   28|  42.3M|}
buffio.c:insrc_ungetByte:
   30|  33.3k|{
   31|  33.3k|  TidyBuffer* buf = (TidyBuffer*) appData;
   32|  33.3k|  tidyBufUngetByte( buf, bv );
   33|  33.3k|}
buffio.c:outsink_putByte:
   44|   229M|{
   45|   229M|  TidyBuffer* buf = (TidyBuffer*) appData;
   46|   229M|  tidyBufPutByte( buf, bv );
   47|   229M|}

prvTidyFreeStyles:
  267|     98|{
  268|     98|    Lexer* lexer = doc->lexer;
  269|     98|    if ( lexer )
  ------------------
  |  Branch (269:10): [True: 98, False: 0]
  ------------------
  270|     98|    {
  271|     98|        TagStyle *style, *next;
  272|     98|        for ( style = lexer->styles; style; style = next )
  ------------------
  |  Branch (272:38): [True: 0, False: 98]
  ------------------
  273|      0|        {
  274|      0|            next = style->next;
  275|      0|            TidyDocFree( doc, style->tag );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  276|      0|            TidyDocFree( doc, style->tag_class );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  277|      0|            TidyDocFree( doc, style->properties );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  278|      0|            TidyDocFree( doc, style );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  279|      0|        }
  280|     98|    }
  281|     98|}
prvTidyReplacePreformattedSpaces:
 2547|  36.8k|{
 2548|  36.8k|    Node* next;
 2549|       |
 2550|   109k|    while (node)
  ------------------
  |  Branch (2550:12): [True: 72.9k, False: 36.8k]
  ------------------
 2551|  72.9k|    {
 2552|  72.9k|        next = node->next;
 2553|       |
 2554|  72.9k|        if (node->tag && node->tag->parser == TY_(ParsePre))
  ------------------
  |  |   23|  8.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2554:13): [True: 8.16k, False: 64.8k]
  |  Branch (2554:26): [True: 0, False: 8.16k]
  ------------------
 2555|      0|        {
 2556|      0|            TY_(NormalizeSpaces)(doc->lexer, node->content);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2557|      0|            node = next;
 2558|      0|            continue;
 2559|      0|        }
 2560|       |
 2561|  72.9k|        if (node->content)
  ------------------
  |  Branch (2561:13): [True: 36.7k, False: 36.1k]
  ------------------
 2562|  36.7k|            TY_(ReplacePreformattedSpaces)(doc, node->content);
  ------------------
  |  |   23|  36.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2563|       |
 2564|  72.9k|        node = next;
 2565|  72.9k|    }
 2566|  36.8k|}

prvTidyInitConfig:
  311|     98|{
  312|     98|    TidyClearMemory( &doc->config, sizeof(TidyConfigImpl) );
  ------------------
  |  |   70|     98|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  313|     98|    TY_(ResetConfigToDefault)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  314|     98|}
prvTidyFreeConfig:
  318|     98|{
  319|     98|    doc->pConfigChangeCallback = NULL;
  320|     98|    TY_(ResetConfigToDefault)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  321|     98|    TY_(TakeConfigSnapshot)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  322|     98|}
prvTidySetOptionInt:
  482|  1.10k|{
  483|  1.10k|    Bool status = ( optId < N_TIDY_OPTIONS );
  484|  1.10k|    if ( status )
  ------------------
  |  Branch (484:10): [True: 1.10k, False: 0]
  ------------------
  485|  1.10k|    {
  486|  1.10k|        assert( option_defs[ optId ].type == TidyInteger );
  ------------------
  |  Branch (486:9): [True: 0, False: 1.10k]
  |  Branch (486:9): [True: 1.10k, False: 0]
  ------------------
  487|  1.10k|        SetOptionInteger( doc, optId, val );
  488|  1.10k|    }
  489|  1.10k|    return status;
  490|  1.10k|}
prvTidySetOptionBool:
  494|  1.27k|{
  495|  1.27k|    Bool status = ( optId < N_TIDY_OPTIONS );
  496|  1.27k|    if ( status )
  ------------------
  |  Branch (496:10): [True: 1.27k, False: 0]
  ------------------
  497|  1.27k|    {
  498|  1.27k|        assert( option_defs[ optId ].type == TidyBoolean );
  ------------------
  |  Branch (498:9): [True: 0, False: 1.27k]
  |  Branch (498:9): [True: 1.27k, False: 0]
  ------------------
  499|  1.27k|        SetOptionInteger( doc, optId, (ulong)val );
  500|  1.27k|    }
  501|  1.27k|    return status;
  502|  1.27k|}
prvTidyResetConfigToDefault:
  693|    196|{
  694|    196|    uint ixVal;
  695|    196|    const TidyOptionImpl* option = option_defs;
  696|    196|    TidyOptionValue* value = &doc->config.value[ 0 ];
  697|  20.5k|    for ( ixVal=0; ixVal < N_TIDY_OPTIONS; ++option, ++ixVal )
  ------------------
  |  Branch (697:20): [True: 20.3k, False: 196]
  ------------------
  698|  20.3k|    {
  699|  20.3k|        TidyOptionValue dflt;
  700|  20.3k|        assert( ixVal == (uint) option->id );
  ------------------
  |  Branch (700:9): [True: 0, False: 20.3k]
  |  Branch (700:9): [True: 20.3k, False: 0]
  ------------------
  701|  20.3k|        GetOptionDefault( option, &dflt );
  702|  20.3k|        CopyOptionValue( doc, option, &value[ixVal], &dflt );
  703|  20.3k|    }
  704|    196|    TY_(FreeDeclaredTags)( doc, tagtype_null );
  ------------------
  |  |   23|    196|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    196|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  705|    196|}
prvTidyTakeConfigSnapshot:
  709|    196|{
  710|    196|    uint ixVal;
  711|    196|    const TidyOptionImpl* option = option_defs;
  712|    196|    const TidyOptionValue* value = &doc->config.value[ 0 ];
  713|    196|    TidyOptionValue* snap  = &doc->config.snapshot[ 0 ];
  714|       |
  715|       |    /* @jsd: do NOT mess with user-specified settings until
  716|       |     *       absolutely necessary, and ensure that we can
  717|       |     *       can restore them immediately after the need.
  718|       |     */
  719|       |    // TY_(AdjustConfig)( doc );  /* Make sure it's consistent */
  720|  20.5k|    for ( ixVal=0; ixVal < N_TIDY_OPTIONS; ++option, ++ixVal )
  ------------------
  |  Branch (720:20): [True: 20.3k, False: 196]
  ------------------
  721|  20.3k|    {
  722|  20.3k|        assert( ixVal == (uint) option->id );
  ------------------
  |  Branch (722:9): [True: 0, False: 20.3k]
  |  Branch (722:9): [True: 20.3k, False: 0]
  ------------------
  723|  20.3k|        CopyOptionValue( doc, option, &snap[ixVal], &value[ixVal] );
  724|  20.3k|    }
  725|    196|}
prvTidyAdjustCharEncoding:
 1170|     98|{
 1171|     98|    int outenc = -1;
 1172|     98|    int inenc = -1;
 1173|       |    
 1174|     98|    switch( encoding )
  ------------------
  |  Branch (1174:13): [True: 98, False: 0]
  ------------------
 1175|     98|    {
 1176|      0|    case MACROMAN:
  ------------------
  |  |  139|      0|#define MACROMAN    6
  ------------------
  |  Branch (1176:5): [True: 0, False: 98]
  ------------------
 1177|      0|        inenc = MACROMAN;
  ------------------
  |  |  139|      0|#define MACROMAN    6
  ------------------
 1178|      0|        outenc = ASCII;
  ------------------
  |  |  134|      0|#define ASCII       1
  ------------------
 1179|      0|        break;
 1180|       |
 1181|      0|    case WIN1252:
  ------------------
  |  |  140|      0|#define WIN1252     7
  ------------------
  |  Branch (1181:5): [True: 0, False: 98]
  ------------------
 1182|      0|        inenc = WIN1252;
  ------------------
  |  |  140|      0|#define WIN1252     7
  ------------------
 1183|      0|        outenc = ASCII;
  ------------------
  |  |  134|      0|#define ASCII       1
  ------------------
 1184|      0|        break;
 1185|       |
 1186|      0|    case IBM858:
  ------------------
  |  |  141|      0|#define IBM858      8
  ------------------
  |  Branch (1186:5): [True: 0, False: 98]
  ------------------
 1187|      0|        inenc = IBM858;
  ------------------
  |  |  141|      0|#define IBM858      8
  ------------------
 1188|      0|        outenc = ASCII;
  ------------------
  |  |  134|      0|#define ASCII       1
  ------------------
 1189|      0|        break;
 1190|       |
 1191|      0|    case ASCII:
  ------------------
  |  |  134|      0|#define ASCII       1
  ------------------
  |  Branch (1191:5): [True: 0, False: 98]
  ------------------
 1192|      0|        inenc = LATIN1;
  ------------------
  |  |  136|      0|#define LATIN1      3
  ------------------
 1193|      0|        outenc = ASCII;
  ------------------
  |  |  134|      0|#define ASCII       1
  ------------------
 1194|      0|        break;
 1195|       |
 1196|      0|    case LATIN0:
  ------------------
  |  |  135|      0|#define LATIN0      2
  ------------------
  |  Branch (1196:5): [True: 0, False: 98]
  ------------------
 1197|      0|        inenc = LATIN0;
  ------------------
  |  |  135|      0|#define LATIN0      2
  ------------------
 1198|      0|        outenc = ASCII;
  ------------------
  |  |  134|      0|#define ASCII       1
  ------------------
 1199|      0|        break;
 1200|       |
 1201|      0|    case RAW:
  ------------------
  |  |  133|      0|#define RAW         0
  ------------------
  |  Branch (1201:5): [True: 0, False: 98]
  ------------------
 1202|      0|    case LATIN1:
  ------------------
  |  |  136|      0|#define LATIN1      3
  ------------------
  |  Branch (1202:5): [True: 0, False: 98]
  ------------------
 1203|     98|    case UTF8:
  ------------------
  |  |  137|     98|#define UTF8        4
  ------------------
  |  Branch (1203:5): [True: 98, False: 0]
  ------------------
 1204|     98|#ifndef NO_NATIVE_ISO2022_SUPPORT
 1205|     98|    case ISO2022:
  ------------------
  |  |  138|     98|#define ISO2022     5
  ------------------
  |  Branch (1205:5): [True: 0, False: 98]
  ------------------
 1206|     98|#endif
 1207|       |
 1208|     98|    case UTF16LE:
  ------------------
  |  |  142|     98|#define UTF16LE     9
  ------------------
  |  Branch (1208:5): [True: 0, False: 98]
  ------------------
 1209|     98|    case UTF16BE:
  ------------------
  |  |  143|     98|#define UTF16BE     10
  ------------------
  |  Branch (1209:5): [True: 0, False: 98]
  ------------------
 1210|     98|    case UTF16:
  ------------------
  |  |  144|     98|#define UTF16       11
  ------------------
  |  Branch (1210:5): [True: 0, False: 98]
  ------------------
 1211|     98|    case SHIFTJIS:
  ------------------
  |  |  146|     98|#define SHIFTJIS    13
  ------------------
  |  Branch (1211:5): [True: 0, False: 98]
  ------------------
 1212|     98|    case BIG5:
  ------------------
  |  |  145|     98|#define BIG5        12
  ------------------
  |  Branch (1212:5): [True: 0, False: 98]
  ------------------
 1213|     98|        inenc = outenc = encoding;
 1214|     98|        break;
 1215|     98|    }
 1216|       |
 1217|     98|    if ( inenc >= 0 )
  ------------------
  |  Branch (1217:10): [True: 98, False: 0]
  ------------------
 1218|     98|    {
 1219|     98|        TY_(SetOptionInt)( doc, TidyCharEncoding, encoding );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1220|     98|        TY_(SetOptionInt)( doc, TidyInCharEncoding, inenc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1221|     98|        TY_(SetOptionInt)( doc, TidyOutCharEncoding, outenc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1222|     98|        return yes;
 1223|     98|    }
 1224|      0|    return no;
 1225|     98|}
prvTidyAdjustConfig:
 1230|     98|{
 1231|     98|    if ( cfgBool(doc, TidyEncloseBlockText) )
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 98]
  |  |  ------------------
  ------------------
 1232|      0|        TY_(SetOptionBool)( doc, TidyEncloseBodyText, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1233|       |
 1234|     98|    if ( cfgAutoBool(doc, TidyIndentContent) == TidyNoState )
  ------------------
  |  |  421|     98|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1234:10): [True: 98, False: 0]
  ------------------
 1235|     98|        TY_(SetOptionInt)( doc, TidyIndentSpaces, 0 );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1236|       |
 1237|       |    /* disable wrapping */
 1238|     98|    if ( cfg(doc, TidyWrapLen) == 0 )
  ------------------
  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1238:10): [True: 98, False: 0]
  ------------------
 1239|     98|        TY_(SetOptionInt)( doc, TidyWrapLen, 0x7FFFFFFF );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1240|       |
 1241|       |    /* Word 2000 needs o:p to be declared as inline */
 1242|     98|    if ( cfgBool(doc, TidyWord2000) )
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 98]
  |  |  ------------------
  ------------------
 1243|      0|    {
 1244|      0|        doc->config.defined_tags |= tagtype_inline;
 1245|      0|        TY_(DefineTag)( doc, tagtype_inline, "o:p" );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1246|      0|    }
 1247|       |
 1248|       |    /* #480701 disable XHTML output flag if both output-xhtml and xml input are set */
 1249|     98|    if ( cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 98, False: 0]
  |  |  ------------------
  ------------------
 1250|     98|        TY_(SetOptionBool)( doc, TidyXhtmlOut, no );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1251|       |
 1252|       |    /* XHTML is written in lower case */
 1253|     98|    if ( cfgBool(doc, TidyXhtmlOut) )
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 98]
  |  |  ------------------
  ------------------
 1254|      0|    {
 1255|      0|        TY_(SetOptionBool)( doc, TidyXmlOut, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1256|      0|        TY_(SetOptionBool)( doc, TidyUpperCaseTags, no );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1257|      0|        TY_(SetOptionInt)( doc, TidyUpperCaseAttrs, no );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1258|       |        /* TY_(SetOptionBool)( doc, TidyXmlPIs, yes ); */
 1259|      0|    }
 1260|       |
 1261|       |    /* if XML in, then XML out */
 1262|     98|    if ( cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 98, False: 0]
  |  |  ------------------
  ------------------
 1263|     98|    {
 1264|     98|        TY_(SetOptionBool)( doc, TidyXmlOut, yes );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1265|     98|        TY_(SetOptionBool)( doc, TidyXmlPIs, yes );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1266|     98|    }
 1267|       |
 1268|       |    /* #427837 - fix by Dave Raggett 02 Jun 01
 1269|       |    ** generate <?xml version="1.0" encoding="iso-8859-1"?>
 1270|       |    ** if the output character encoding is Latin-1 etc.
 1271|       |    */
 1272|     98|    if ( cfg(doc, TidyOutCharEncoding) != ASCII &&
  ------------------
  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                  if ( cfg(doc, TidyOutCharEncoding) != ASCII &&
  ------------------
  |  |  134|    196|#define ASCII       1
  ------------------
  |  Branch (1272:10): [True: 98, False: 0]
  ------------------
 1273|     98|         cfg(doc, TidyOutCharEncoding) != UTF8 &&
  ------------------
  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != UTF8 &&
  ------------------
  |  |  137|    196|#define UTF8        4
  ------------------
  |  Branch (1273:10): [True: 0, False: 98]
  ------------------
 1274|      0|         cfg(doc, TidyOutCharEncoding) != UTF16 &&
  ------------------
  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != UTF16 &&
  ------------------
  |  |  144|     98|#define UTF16       11
  ------------------
  |  Branch (1274:10): [True: 0, False: 0]
  ------------------
 1275|      0|         cfg(doc, TidyOutCharEncoding) != UTF16BE &&
  ------------------
  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != UTF16BE &&
  ------------------
  |  |  143|     98|#define UTF16BE     10
  ------------------
  |  Branch (1275:10): [True: 0, False: 0]
  ------------------
 1276|      0|         cfg(doc, TidyOutCharEncoding) != UTF16LE &&
  ------------------
  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != UTF16LE &&
  ------------------
  |  |  142|     98|#define UTF16LE     9
  ------------------
  |  Branch (1276:10): [True: 0, False: 0]
  ------------------
 1277|      0|         cfg(doc, TidyOutCharEncoding) != RAW &&
  ------------------
  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != RAW &&
  ------------------
  |  |  133|     98|#define RAW         0
  ------------------
  |  Branch (1277:10): [True: 0, False: 0]
  ------------------
 1278|      0|         cfgBool(doc, TidyXmlOut) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1279|      0|    {
 1280|      0|        TY_(SetOptionBool)( doc, TidyXmlDecl, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1281|      0|    }
 1282|       |
 1283|       |    /* XML requires end tags */
 1284|     98|    if ( cfgBool(doc, TidyXmlOut) )
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 98, False: 0]
  |  |  ------------------
  ------------------
 1285|     98|    {
 1286|       |        /* XML requires a BOM on output if using UTF-16 encoding */
 1287|     98|        ulong enc = cfg( doc, TidyOutCharEncoding );
  ------------------
  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1288|     98|        if ( enc == UTF16LE || enc == UTF16BE || enc == UTF16 )
  ------------------
  |  |  142|    196|#define UTF16LE     9
  ------------------
                      if ( enc == UTF16LE || enc == UTF16BE || enc == UTF16 )
  ------------------
  |  |  143|    196|#define UTF16BE     10
  ------------------
                      if ( enc == UTF16LE || enc == UTF16BE || enc == UTF16 )
  ------------------
  |  |  144|     98|#define UTF16       11
  ------------------
  |  Branch (1288:14): [True: 0, False: 98]
  |  Branch (1288:32): [True: 0, False: 98]
  |  Branch (1288:50): [True: 0, False: 98]
  ------------------
 1289|      0|            TY_(SetOptionInt)( doc, TidyOutputBOM, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1290|       |        
 1291|     98|        TY_(SetOptionBool)( doc, TidyQuoteAmpersand, yes );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1292|     98|        TY_(SetOptionBool)( doc, TidyOmitOptionalTags, no );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1293|     98|    }
 1294|       |    
 1295|       |    /* Setup the indent character. */
 1296|     98|    if cfgBool(doc, TidyPPrintTabs) 
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:34): [True: 0, False: 98]
  |  |  ------------------
  ------------------
 1297|      0|        doc->indent_char = '\t';
 1298|     98|    else
 1299|     98|        doc->indent_char = ' ';
 1300|     98|}
prvTidyCharEncodingId:
 1707|     98|{
 1708|     98|    int enc = TY_(GetCharEncodingFromOptName)( charenc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1709|     98|    return enc;
 1710|     98|}
config.c:SetOptionInteger:
  470|  2.37k|{
  471|  2.37k|    const TidyOptionImpl* option = &option_defs[ optId ];
  472|  2.37k|    ulong* optVal = &(doc->config.value[ optId ].v);
  473|  2.37k|    Bool fire_callback = doc->pConfigChangeCallback && *optVal != val;
  ------------------
  |  Branch (473:26): [True: 0, False: 2.37k]
  |  Branch (473:56): [True: 0, False: 0]
  ------------------
  474|       |
  475|  2.37k|    *optVal = val;
  476|       |
  477|  2.37k|    if ( fire_callback )
  ------------------
  |  Branch (477:10): [True: 0, False: 2.37k]
  ------------------
  478|      0|        PerformOptionChangedCallback( doc, option );
  479|  2.37k|}
config.c:GetOptionDefault:
  507|  20.3k|{
  508|  20.3k|    if ( option->type == TidyString )
  ------------------
  |  Branch (508:10): [True: 2.54k, False: 17.8k]
  ------------------
  509|  2.54k|        dflt->p = (char*)option->pdflt;
  510|  17.8k|    else
  511|  17.8k|        dflt->v = option->dflt;
  512|  20.3k|}
config.c:CopyOptionValue:
  386|  40.7k|{
  387|  40.7k|    Bool fire_callback = no;
  388|  40.7k|    assert( oldval != NULL );
  ------------------
  |  Branch (388:5): [True: 0, False: 40.7k]
  |  Branch (388:5): [True: 40.7k, False: 0]
  ------------------
  389|       |
  390|       |    /* Compare the old and new values. */
  391|  40.7k|    if ( doc->pConfigChangeCallback )
  ------------------
  |  Branch (391:10): [True: 0, False: 40.7k]
  ------------------
  392|      0|    {
  393|      0|        if ( option->type == TidyString )
  ------------------
  |  Branch (393:14): [True: 0, False: 0]
  ------------------
  394|      0|            fire_callback = OptionChangedValuesDiffer( oldval->p, newval->p );
  395|      0|        else
  396|      0|            fire_callback = oldval->v != newval->v;
  397|      0|    }
  398|       |
  399|  40.7k|    FreeOptionValue( doc, option, oldval );
  400|       |
  401|  40.7k|    if ( option->type == TidyString )
  ------------------
  |  Branch (401:10): [True: 5.09k, False: 35.6k]
  ------------------
  402|  5.09k|    {
  403|  5.09k|        if ( newval->p && newval->p != option->pdflt )
  ------------------
  |  Branch (403:14): [True: 392, False: 4.70k]
  |  Branch (403:27): [True: 0, False: 392]
  ------------------
  404|      0|            oldval->p = TY_(tmbstrdup)( doc->allocator, newval->p );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  405|  5.09k|        else
  406|  5.09k|            oldval->p = newval->p;
  407|  5.09k|    }
  408|  35.6k|    else
  409|  35.6k|        oldval->v = newval->v;
  410|       |
  411|  40.7k|    if ( fire_callback )
  ------------------
  |  Branch (411:10): [True: 0, False: 40.7k]
  ------------------
  412|      0|        PerformOptionChangedCallback( doc, option );
  413|  40.7k|}
config.c:FreeOptionValue:
  378|  40.7k|{
  379|  40.7k|    if ( option->type == TidyString && value->p && value->p != option->pdflt )
  ------------------
  |  Branch (379:10): [True: 5.09k, False: 35.6k]
  |  Branch (379:40): [True: 196, False: 4.90k]
  |  Branch (379:52): [True: 0, False: 196]
  ------------------
  380|  40.7k|        TidyDocFree( doc, value->p );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  381|  40.7k|}

prvTidyEntityInfo:
 2115|  9.56k|{
 2116|  9.56k|    const entity* np;
 2117|  9.56k|    int res;
 2118|  9.56k|    assert( name && name[0] == '&' );
  ------------------
  |  Branch (2118:5): [True: 0, False: 9.56k]
  |  Branch (2118:5): [True: 0, False: 0]
  |  Branch (2118:5): [True: 9.56k, False: 0]
  |  Branch (2118:5): [True: 9.56k, False: 0]
  ------------------
 2119|  9.56k|    assert( code != NULL );
  ------------------
  |  Branch (2119:5): [True: 0, False: 9.56k]
  |  Branch (2119:5): [True: 9.56k, False: 0]
  ------------------
 2120|  9.56k|    assert( versions != NULL );
  ------------------
  |  Branch (2120:5): [True: 0, False: 9.56k]
  |  Branch (2120:5): [True: 9.56k, False: 0]
  ------------------
 2121|       |
 2122|       |    /* numeric entitity: name = "&#" followed by number */
 2123|  9.56k|    if ( name[1] == '#' )
  ------------------
  |  Branch (2123:10): [True: 7.94k, False: 1.61k]
  ------------------
 2124|  7.94k|    {
 2125|  7.94k|        uint c = 0;  /* zero on missing/bad number */
 2126|       |
 2127|       |        /* 'x' prefix denotes hexadecimal number format */
 2128|  7.94k|        if ( name[2] == 'x' || (!isXml && name[2] == 'X') )
  ------------------
  |  Branch (2128:14): [True: 6.60k, False: 1.34k]
  |  Branch (2128:33): [True: 0, False: 1.34k]
  |  Branch (2128:43): [True: 0, False: 0]
  ------------------
 2129|  6.60k|            res = sscanf( name+3, "%x", &c );
 2130|  1.34k|        else
 2131|  1.34k|            res = sscanf( name+2, "%u", &c );
 2132|       |
 2133|       |        /*  Issue #373 - Null Char in XML result doc - sf905 2009 */
 2134|  7.94k|        if ( res == 1 )
  ------------------
  |  Branch (2134:14): [True: 7.89k, False: 58]
  ------------------
 2135|  7.89k|        {
 2136|  7.89k|            *code = c;
 2137|  7.89k|            *versions = VERS_ALL;
  ------------------
  |  |  228|  7.89k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|  7.89k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|  7.89k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|  7.89k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  7.89k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|  7.89k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|  7.89k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|  7.89k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|  7.89k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|  7.89k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|  7.89k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|  7.89k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|  7.89k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  7.89k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|  7.89k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|  7.89k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|  7.89k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|  7.89k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|  7.89k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|  7.89k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|  7.89k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|  7.89k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|  7.89k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|  7.89k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|  7.89k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|  7.89k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|  7.89k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|  7.89k|#define HT50              131072u
  |  |  ------------------
  ------------------
 2138|  7.89k|            return yes;
 2139|  7.89k|        }
 2140|     58|        else
 2141|     58|        {
 2142|     58|            *code = 0;
 2143|     58|            *versions = ( isXml ? VERS_XML : VERS_PROPRIETARY );
  ------------------
  |  |  197|     58|#define VERS_XML           65536u
  ------------------
                          *versions = ( isXml ? VERS_XML : VERS_PROPRIETARY );
  ------------------
  |  |  231|      0|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|      0|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|      0|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|      0|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  |  Branch (2143:27): [True: 58, False: 0]
  ------------------
 2144|     58|            return no;
 2145|     58|        }
 2146|  7.94k|    }
 2147|       |
 2148|       |    /* Named entity: name ="&" followed by a name */
 2149|  1.61k|    if ( NULL != (np = entitiesLookup(name+1)) )
  ------------------
  |  Branch (2149:10): [True: 0, False: 1.61k]
  ------------------
 2150|      0|    {
 2151|      0|        *code = np->code;
 2152|      0|        *versions = np->versions;
 2153|      0|        return yes;
 2154|      0|    }
 2155|       |
 2156|  1.61k|    *code = 0;
 2157|  1.61k|    *versions = ( isXml ? VERS_XML : VERS_PROPRIETARY );
  ------------------
  |  |  197|  1.61k|#define VERS_XML           65536u
  ------------------
                  *versions = ( isXml ? VERS_XML : VERS_PROPRIETARY );
  ------------------
  |  |  231|      0|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|      0|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|      0|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|      0|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  |  Branch (2157:19): [True: 1.61k, False: 0]
  ------------------
 2158|  1.61k|    return no;
 2159|  1.61k|}
entities.c:entitiesLookup:
 2092|  1.61k|{
 2093|  1.61k|    tmbchar ch = (tmbchar)( s ? *s : 0 );
  ------------------
  |  Branch (2093:29): [True: 1.61k, False: 0]
  ------------------
 2094|  1.61k|    const entity *np = entities;
 2095|  1.61k|    if (ch == 0)
  ------------------
  |  Branch (2095:9): [True: 291, False: 1.32k]
  ------------------
 2096|    291|        return NULL;
 2097|  1.68M|    while (np->name)
  ------------------
  |  Branch (2097:12): [True: 1.68M, False: 104]
  ------------------
 2098|  1.68M|    {
 2099|  1.68M|        if (ch == *np->name)
  ------------------
  |  Branch (2099:13): [True: 1.22k, False: 1.68M]
  ------------------
 2100|  1.22k|            break;  /* stop when first letter matches */
 2101|  1.68M|        np++;
 2102|  1.68M|    }
 2103|  27.9k|    while (np->name)
  ------------------
  |  Branch (2103:12): [True: 27.2k, False: 752]
  ------------------
 2104|  27.2k|    {
 2105|  27.2k|        if (ch != *np->name)
  ------------------
  |  Branch (2105:13): [True: 575, False: 26.6k]
  ------------------
 2106|    575|            break;  /* stop when first letter does not match */
 2107|  26.6k|        if (TY_(tmbstrcmp)(s, np->name) == 0)
  ------------------
  |  |   23|  26.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2107:13): [True: 0, False: 26.6k]
  ------------------
 2108|      0|            return np;
 2109|  26.6k|        np++;
 2110|  26.6k|    }
 2111|  1.32k|    return NULL;
 2112|  1.32k|}

prvTidytidyLocalizedStringN:
  263|  1.78M|{
  264|  1.78M|    ctmbstr result;
  265|       |    
  266|  1.78M|    result  = tidyLocalizedStringImpl( messageType, tidyLanguages.currentLanguage, quantity);
  267|       |    
  268|  1.78M|    if (!result && tidyLanguages.fallbackLanguage )
  ------------------
  |  Branch (268:9): [True: 0, False: 1.78M]
  |  Branch (268:20): [True: 0, False: 0]
  ------------------
  269|      0|    {
  270|      0|        result = tidyLocalizedStringImpl( messageType, tidyLanguages.fallbackLanguage, quantity);
  271|      0|    }
  272|       |    
  273|  1.78M|    if (!result)
  ------------------
  |  Branch (273:9): [True: 0, False: 1.78M]
  ------------------
  274|      0|    {
  275|       |        /* Fallback to en which is built in. */
  276|      0|        result = tidyLocalizedStringImpl( messageType, &language_en, quantity);
  277|      0|    }
  278|       |    
  279|  1.78M|    if (!result)
  ------------------
  |  Branch (279:9): [True: 0, False: 1.78M]
  ------------------
  280|      0|    {
  281|       |        /* Last resort: Fallback to en singular which is built in. */
  282|      0|        result = tidyLocalizedStringImpl( messageType, &language_en, 1);
  283|      0|    }
  284|       |    
  285|  1.78M|    return result;
  286|  1.78M|}
prvTidytidyLocalizedString:
  298|  1.32M|{
  299|  1.32M|    return TY_(tidyLocalizedStringN)( messageType, 1 );
  ------------------
  |  |   23|  1.32M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.32M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  300|  1.32M|}
prvTidytidySetLanguage:
  399|    196|{
  400|    196|    languageDefinition *dict1 = NULL;
  401|    196|    languageDefinition *dict2 = NULL;
  402|    196|    tmbstr wantCode = NULL;
  403|    196|    char lang[3] = "";
  404|       |    
  405|    196|    if ( !languageCode || !(wantCode = TY_(tidyNormalizedLocaleName)( languageCode )) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (405:10): [True: 196, False: 0]
  |  Branch (405:27): [True: 0, False: 0]
  ------------------
  406|    196|    {
  407|    196|        return no;
  408|    196|    }
  409|       |    
  410|       |    /* We want to use the specified language as the currentLanguage, and set
  411|       |     fallback language as necessary. We have either a two or five digit code,
  412|       |     either or both of which might be installed. Let's test both of them:
  413|       |     */
  414|       |    
  415|      0|    dict1 = TY_(tidyTestLanguage( wantCode ));  /* WANTED language */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  416|       |    
  417|      0|    if ( strlen( wantCode ) > 2 )
  ------------------
  |  Branch (417:10): [True: 0, False: 0]
  ------------------
  418|      0|    {
  419|      0|        strncpy(lang, wantCode, 2);
  420|      0|        lang[2] = '\0';
  421|      0|        dict2 = TY_(tidyTestLanguage( lang ) ); /* BACKUP language? */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  422|      0|    }
  423|       |    
  424|      0|    if ( dict1 && dict2 )
  ------------------
  |  Branch (424:10): [True: 0, False: 0]
  |  Branch (424:19): [True: 0, False: 0]
  ------------------
  425|      0|    {
  426|      0|        tidyLanguages.currentLanguage = dict1;
  427|      0|        tidyLanguages.fallbackLanguage = dict2;
  428|      0|    }
  429|      0|    if ( dict1 && !dict2 )
  ------------------
  |  Branch (429:10): [True: 0, False: 0]
  |  Branch (429:19): [True: 0, False: 0]
  ------------------
  430|      0|    {
  431|      0|        tidyLanguages.currentLanguage = dict1;
  432|      0|        tidyLanguages.fallbackLanguage = NULL;
  433|      0|    }
  434|      0|    if ( !dict1 && dict2 )
  ------------------
  |  Branch (434:10): [True: 0, False: 0]
  |  Branch (434:20): [True: 0, False: 0]
  ------------------
  435|      0|    {
  436|      0|        tidyLanguages.currentLanguage = dict2;
  437|      0|        tidyLanguages.fallbackLanguage = NULL;
  438|      0|    }
  439|      0|    if ( !dict1 && !dict2 )
  ------------------
  |  Branch (439:10): [True: 0, False: 0]
  |  Branch (439:20): [True: 0, False: 0]
  ------------------
  440|      0|    {
  441|       |        /* No change. */
  442|      0|    }
  443|       |    
  444|      0|    return dict1 || dict2;
  ------------------
  |  Branch (444:12): [True: 0, False: 0]
  |  Branch (444:21): [True: 0, False: 0]
  ------------------
  445|    196|}
prvTidytidyGetLanguageSetByUser:
  464|     98|{
  465|     98|    return tidyLanguages.manually_set;
  466|     98|}
prvTidytidyDefaultStringN:
  484|   462k|{
  485|   462k|    return tidyLocalizedStringImpl( messageType, &language_en, quantity);
  486|   462k|}
prvTidytidyDefaultString:
  494|  1.38M|{
  495|  1.38M|    return tidyLocalizedStringImpl( messageType, &language_en, 1);
  496|  1.38M|}
language.c:tidyLocalizedStringImpl:
  237|  3.63M|{
  238|  3.63M|    int i;
  239|  3.63M|    languageDictionary *dictionary = &definition->messages;
  240|  3.63M|    uint pluralForm = definition->whichPluralForm(plural);
  241|       |    
  242|   486M|    for (i = 0; (*dictionary)[i].value; ++i)
  ------------------
  |  Branch (242:17): [True: 486M, False: 0]
  ------------------
  243|   486M|    {
  244|   486M|        if ( (*dictionary)[i].key == messageType && (*dictionary)[i].pluralForm == pluralForm )
  ------------------
  |  Branch (244:14): [True: 4.56M, False: 481M]
  |  Branch (244:53): [True: 3.63M, False: 924k]
  ------------------
  245|  3.63M|        {
  246|  3.63M|            return (*dictionary)[i].value;
  247|  3.63M|        }
  248|   486M|    }
  249|      0|    return NULL;
  250|  3.63M|}

language.c:whichPluralForm_en:
   31|  3.63M|static uint whichPluralForm_en(uint n) {
   32|       |    /* Plural-Forms: nplurals=2; */
   33|  3.63M|    return n != 1;
   34|  3.63M|}

prvTidyHTMLVersion:
  257|  54.4k|{
  258|  54.4k|    uint i;
  259|  54.4k|    uint j = 0;
  260|  54.4k|    uint score = 0;
  261|  54.4k|    uint vers = doc->lexer->versions;
  262|  54.4k|    uint dtver = doc->lexer->doctype;
  263|  54.4k|    TidyDoctypeModes dtmode = (TidyDoctypeModes)cfg(doc, TidyDoctypeMode);
  ------------------
  |  |  415|  54.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  264|  54.4k|    Bool xhtml = (cfgBool(doc, TidyXmlOut) || doc->lexer->isvoyager) &&
  ------------------
  |  |  418|   108k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  54.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 54.4k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (264:47): [True: 0, False: 0]
  ------------------
  265|  54.4k|                 !cfgBool(doc, TidyHtmlOut);
  ------------------
  |  |  418|   108k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  54.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (265:18): [True: 54.4k, False: 0]
  ------------------
  266|  54.4k|    Bool html4 = ((dtmode == TidyDoctypeStrict) || (dtmode == TidyDoctypeLoose) ||
  ------------------
  |  Branch (266:19): [True: 0, False: 54.4k]
  |  Branch (266:52): [True: 0, False: 54.4k]
  ------------------
  267|  54.4k|                  (VERS_HMTL40PX & dtver) ? yes : no);
  ------------------
  |  |  254|  54.4k|#define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  216|  54.4k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  207|  54.4k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  179|  54.4k|#define H40S                   4u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  182|  54.4k|#define H41S                  32u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  185|  54.4k|#define X10S                 256u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  54.4k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  54.4k|#define H40T                   8u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  54.4k|#define H41T                  64u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|  54.4k|#define X10T                 512u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  209|  54.4k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|  54.4k|#define H40F                  16u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|  54.4k|#define H41F                 128u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|  54.4k|#define X10F                1024u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  210|  54.4k|#define VERS_XHTML11       (XH11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  188|  54.4k|#define XH11                2048u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  211|  54.4k|#define VERS_BASIC         (XB10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|  54.4k|#define XB10                4096u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (267:19): [True: 0, False: 54.4k]
  ------------------
  268|  54.4k|    Bool html5 = (!html4 && ((dtmode == TidyDoctypeAuto) ||
  ------------------
  |  Branch (268:19): [True: 54.4k, False: 0]
  |  Branch (268:30): [True: 54.4k, False: 0]
  ------------------
  269|  54.4k|                  (dtmode == TidyDoctypeHtml5)) ? yes : no);
  ------------------
  |  Branch (269:19): [True: 0, False: 0]
  ------------------
  270|       |
  271|  54.4k|    if (xhtml && dtver == VERS_UNKNOWN) return XH50;
  ------------------
  |  |  204|  54.4k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  54.4k|#define xxxx                   0u
  |  |  ------------------
  ------------------
                  if (xhtml && dtver == VERS_UNKNOWN) return XH50;
  ------------------
  |  |  201|  54.4k|#define XH50              262144u
  ------------------
  |  Branch (271:9): [True: 54.4k, False: 0]
  |  Branch (271:18): [True: 54.4k, False: 0]
  ------------------
  272|      0|    if (dtver == VERS_UNKNOWN) return HT50;
  ------------------
  |  |  204|      0|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|      0|#define xxxx                   0u
  |  |  ------------------
  ------------------
                  if (dtver == VERS_UNKNOWN) return HT50;
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
  |  Branch (272:9): [True: 0, False: 0]
  ------------------
  273|       |    /* Issue #167 - if NOT XHTML, and doctype is default VERS_HTML5, then return HT50 */
  274|      0|    if (!xhtml && (dtver == VERS_HTML5)) return HT50;
  ------------------
  |  |  213|      0|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|      0|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|      0|#define XH50              262144u
  |  |  ------------------
  ------------------
                  if (!xhtml && (dtver == VERS_HTML5)) return HT50;
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
  |  Branch (274:9): [True: 0, False: 0]
  |  Branch (274:19): [True: 0, False: 0]
  ------------------
  275|       |    /* Issue #377 - If xhtml and (doctype == html5) and constrained vers contains XH50 return that,
  276|       |       and really if tidy defaults to 'html5', then maybe 'auto' should also apply! */
  277|      0|    if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  213|      0|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|      0|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|      0|#define XH50              262144u
  |  |  ------------------
  ------------------
                  if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  201|      0|#define XH50              262144u
  ------------------
                  if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  201|      0|#define XH50              262144u
  ------------------
  |  Branch (277:9): [True: 0, False: 0]
  |  Branch (277:18): [True: 0, False: 0]
  |  Branch (277:27): [True: 0, False: 0]
  ------------------
  278|       |
  279|      0|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (279:17): [True: 0, False: 0]
  ------------------
  280|      0|    {
  281|      0|        if ((xhtml && !(VERS_XHTML & W3C_Doctypes[i].vers)) ||
  ------------------
  |  |  222|      0|#define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  185|      0|#define X10S                 256u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  186|      0|#define X10T                 512u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  187|      0|#define X10F                1024u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  188|      0|#define XH11                2048u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  189|      0|#define XB10                4096u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  201|      0|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (281:14): [True: 0, False: 0]
  |  Branch (281:23): [True: 0, False: 0]
  ------------------
  282|      0|            (html4 && !(VERS_HMTL40PX & W3C_Doctypes[i].vers)))
  ------------------
  |  |  254|      0|#define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  216|      0|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  207|      0|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  179|      0|#define H40S                   4u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  182|      0|#define H41S                  32u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  185|      0|#define X10S                 256u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|      0|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|      0|#define H40T                   8u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|      0|#define H41T                  64u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|      0|#define X10T                 512u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  209|      0|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|      0|#define H40F                  16u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|      0|#define H41F                 128u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|      0|#define X10F                1024u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  210|      0|#define VERS_XHTML11       (XH11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  188|      0|#define XH11                2048u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  211|      0|#define VERS_BASIC         (XB10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|      0|#define XB10                4096u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (282:14): [True: 0, False: 0]
  |  Branch (282:23): [True: 0, False: 0]
  ------------------
  283|      0|            continue;
  284|       |
  285|      0|        if (vers & W3C_Doctypes[i].vers &&
  ------------------
  |  Branch (285:13): [True: 0, False: 0]
  ------------------
  286|      0|            (W3C_Doctypes[i].score < score || !score))
  ------------------
  |  Branch (286:14): [True: 0, False: 0]
  |  Branch (286:47): [True: 0, False: 0]
  ------------------
  287|      0|        {
  288|      0|            score = W3C_Doctypes[i].score;
  289|      0|            j = i;
  290|      0|        }
  291|      0|    }
  292|       |
  293|      0|    if (score)
  ------------------
  |  Branch (293:9): [True: 0, False: 0]
  ------------------
  294|      0|        return W3C_Doctypes[j].vers;
  295|       |
  296|      0|    return VERS_UNKNOWN;
  ------------------
  |  |  204|      0|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|      0|#define xxxx                   0u
  |  |  ------------------
  ------------------
  297|      0|}
prvTidyConstrainVersion:
  442|  6.74k|{
  443|  6.74k|    doc->lexer->versions &= (vers | VERS_PROPRIETARY);
  ------------------
  |  |  231|  6.74k|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  6.74k|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  6.74k|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  6.74k|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  444|  6.74k|}
prvTidyIsWhite:
  448|   195M|{
  449|   195M|    uint map = MAP(c);
  ------------------
  |  |  206|   195M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 195M, False: 133k]
  |  |  ------------------
  ------------------
  450|       |
  451|   195M|    return (map & white)!=0;
  ------------------
  |  |   71|   195M|#define white       8u
  ------------------
  452|   195M|}
prvTidyIsDigit:
  461|  12.9k|{
  462|  12.9k|    uint map;
  463|       |
  464|  12.9k|    map = MAP(c);
  ------------------
  |  |  206|  12.9k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 12.8k, False: 20]
  |  |  ------------------
  ------------------
  465|       |
  466|  12.9k|    return (map & digit)!=0;
  ------------------
  |  |   68|  12.9k|#define digit       1u
  ------------------
  467|  12.9k|}
prvTidyIsLetter:
  479|  1.05M|{
  480|  1.05M|    uint map;
  481|       |
  482|  1.05M|    map = MAP(c);
  ------------------
  |  |  206|  1.05M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 1.05M, False: 7.07k]
  |  |  ------------------
  ------------------
  483|       |
  484|  1.05M|    return (map & letter)!=0;
  ------------------
  |  |   69|  1.05M|#define letter      2u
  ------------------
  485|  1.05M|}
prvTidyIsNamechar:
  493|  1.16M|{
  494|  1.16M|    uint map = MAP(c);
  ------------------
  |  |  206|  1.16M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 1.16M, False: 2.23k]
  |  |  ------------------
  ------------------
  495|  1.16M|    return (map & namechar)!=0;
  ------------------
  |  |   70|  1.16M|#define namechar    4u
  ------------------
  496|  1.16M|}
prvTidyIsXMLLetter:
  499|  4.50M|{
  500|  4.50M|    return ((c >= 0x41 && c <= 0x5a) ||
  ------------------
  |  Branch (500:14): [True: 330k, False: 4.17M]
  |  Branch (500:27): [True: 33.3k, False: 297k]
  ------------------
  501|  4.47M|        (c >= 0x61 && c <= 0x7a) ||
  ------------------
  |  Branch (501:10): [True: 288k, False: 4.18M]
  |  Branch (501:23): [True: 274k, False: 14.0k]
  ------------------
  502|  4.19M|        (c >= 0xc0 && c <= 0xd6) ||
  ------------------
  |  Branch (502:10): [True: 13.7k, False: 4.18M]
  |  Branch (502:23): [True: 0, False: 13.7k]
  ------------------
  503|  4.19M|        (c >= 0xd8 && c <= 0xf6) ||
  ------------------
  |  Branch (503:10): [True: 13.7k, False: 4.18M]
  |  Branch (503:23): [True: 0, False: 13.7k]
  ------------------
  504|  4.19M|        (c >= 0xf8 && c <= 0xff) ||
  ------------------
  |  Branch (504:10): [True: 13.7k, False: 4.18M]
  |  Branch (504:23): [True: 0, False: 13.7k]
  ------------------
  505|  4.19M|        (c >= 0x100 && c <= 0x131) ||
  ------------------
  |  Branch (505:10): [True: 13.7k, False: 4.18M]
  |  Branch (505:24): [True: 0, False: 13.7k]
  ------------------
  506|  4.19M|        (c >= 0x134 && c <= 0x13e) ||
  ------------------
  |  Branch (506:10): [True: 13.7k, False: 4.18M]
  |  Branch (506:24): [True: 0, False: 13.7k]
  ------------------
  507|  4.19M|        (c >= 0x141 && c <= 0x148) ||
  ------------------
  |  Branch (507:10): [True: 13.7k, False: 4.18M]
  |  Branch (507:24): [True: 242, False: 13.5k]
  ------------------
  508|  4.19M|        (c >= 0x14a && c <= 0x17e) ||
  ------------------
  |  Branch (508:10): [True: 13.5k, False: 4.18M]
  |  Branch (508:24): [True: 0, False: 13.5k]
  ------------------
  509|  4.19M|        (c >= 0x180 && c <= 0x1c3) ||
  ------------------
  |  Branch (509:10): [True: 13.5k, False: 4.18M]
  |  Branch (509:24): [True: 0, False: 13.5k]
  ------------------
  510|  4.19M|        (c >= 0x1cd && c <= 0x1f0) ||
  ------------------
  |  Branch (510:10): [True: 13.5k, False: 4.18M]
  |  Branch (510:24): [True: 39, False: 13.4k]
  ------------------
  511|  4.19M|        (c >= 0x1f4 && c <= 0x1f5) ||
  ------------------
  |  Branch (511:10): [True: 13.4k, False: 4.18M]
  |  Branch (511:24): [True: 0, False: 13.4k]
  ------------------
  512|  4.19M|        (c >= 0x1fa && c <= 0x217) ||
  ------------------
  |  Branch (512:10): [True: 13.4k, False: 4.18M]
  |  Branch (512:24): [True: 0, False: 13.4k]
  ------------------
  513|  4.19M|        (c >= 0x250 && c <= 0x2a8) ||
  ------------------
  |  Branch (513:10): [True: 13.4k, False: 4.18M]
  |  Branch (513:24): [True: 0, False: 13.4k]
  ------------------
  514|  4.19M|        (c >= 0x2bb && c <= 0x2c1) ||
  ------------------
  |  Branch (514:10): [True: 13.4k, False: 4.18M]
  |  Branch (514:24): [True: 0, False: 13.4k]
  ------------------
  515|  4.19M|        c == 0x386 ||
  ------------------
  |  Branch (515:9): [True: 0, False: 4.19M]
  ------------------
  516|  4.19M|        (c >= 0x388 && c <= 0x38a) ||
  ------------------
  |  Branch (516:10): [True: 13.4k, False: 4.18M]
  |  Branch (516:24): [True: 0, False: 13.4k]
  ------------------
  517|  4.19M|        c == 0x38c ||
  ------------------
  |  Branch (517:9): [True: 0, False: 4.19M]
  ------------------
  518|  4.19M|        (c >= 0x38e && c <= 0x3a1) ||
  ------------------
  |  Branch (518:10): [True: 13.4k, False: 4.18M]
  |  Branch (518:24): [True: 0, False: 13.4k]
  ------------------
  519|  4.19M|        (c >= 0x3a3 && c <= 0x3ce) ||
  ------------------
  |  Branch (519:10): [True: 13.4k, False: 4.18M]
  |  Branch (519:24): [True: 0, False: 13.4k]
  ------------------
  520|  4.19M|        (c >= 0x3d0 && c <= 0x3d6) ||
  ------------------
  |  Branch (520:10): [True: 13.4k, False: 4.18M]
  |  Branch (520:24): [True: 0, False: 13.4k]
  ------------------
  521|  4.19M|        c == 0x3da ||
  ------------------
  |  Branch (521:9): [True: 0, False: 4.19M]
  ------------------
  522|  4.19M|        c == 0x3dc ||
  ------------------
  |  Branch (522:9): [True: 0, False: 4.19M]
  ------------------
  523|  4.19M|        c == 0x3de ||
  ------------------
  |  Branch (523:9): [True: 0, False: 4.19M]
  ------------------
  524|  4.19M|        c == 0x3e0 ||
  ------------------
  |  Branch (524:9): [True: 0, False: 4.19M]
  ------------------
  525|  4.19M|        (c >= 0x3e2 && c <= 0x3f3) ||
  ------------------
  |  Branch (525:10): [True: 13.4k, False: 4.18M]
  |  Branch (525:24): [True: 0, False: 13.4k]
  ------------------
  526|  4.19M|        (c >= 0x401 && c <= 0x40c) ||
  ------------------
  |  Branch (526:10): [True: 13.4k, False: 4.18M]
  |  Branch (526:24): [True: 0, False: 13.4k]
  ------------------
  527|  4.19M|        (c >= 0x40e && c <= 0x44f) ||
  ------------------
  |  Branch (527:10): [True: 13.4k, False: 4.18M]
  |  Branch (527:24): [True: 0, False: 13.4k]
  ------------------
  528|  4.19M|        (c >= 0x451 && c <= 0x45c) ||
  ------------------
  |  Branch (528:10): [True: 13.4k, False: 4.18M]
  |  Branch (528:24): [True: 0, False: 13.4k]
  ------------------
  529|  4.19M|        (c >= 0x45e && c <= 0x481) ||
  ------------------
  |  Branch (529:10): [True: 13.4k, False: 4.18M]
  |  Branch (529:24): [True: 0, False: 13.4k]
  ------------------
  530|  4.19M|        (c >= 0x490 && c <= 0x4c4) ||
  ------------------
  |  Branch (530:10): [True: 13.4k, False: 4.18M]
  |  Branch (530:24): [True: 0, False: 13.4k]
  ------------------
  531|  4.19M|        (c >= 0x4c7 && c <= 0x4c8) ||
  ------------------
  |  Branch (531:10): [True: 13.4k, False: 4.18M]
  |  Branch (531:24): [True: 0, False: 13.4k]
  ------------------
  532|  4.19M|        (c >= 0x4cb && c <= 0x4cc) ||
  ------------------
  |  Branch (532:10): [True: 13.4k, False: 4.18M]
  |  Branch (532:24): [True: 0, False: 13.4k]
  ------------------
  533|  4.19M|        (c >= 0x4d0 && c <= 0x4eb) ||
  ------------------
  |  Branch (533:10): [True: 13.4k, False: 4.18M]
  |  Branch (533:24): [True: 0, False: 13.4k]
  ------------------
  534|  4.19M|        (c >= 0x4ee && c <= 0x4f5) ||
  ------------------
  |  Branch (534:10): [True: 13.4k, False: 4.18M]
  |  Branch (534:24): [True: 0, False: 13.4k]
  ------------------
  535|  4.19M|        (c >= 0x4f8 && c <= 0x4f9) ||
  ------------------
  |  Branch (535:10): [True: 13.4k, False: 4.18M]
  |  Branch (535:24): [True: 0, False: 13.4k]
  ------------------
  536|  4.19M|        (c >= 0x531 && c <= 0x556) ||
  ------------------
  |  Branch (536:10): [True: 13.3k, False: 4.18M]
  |  Branch (536:24): [True: 0, False: 13.3k]
  ------------------
  537|  4.19M|        c == 0x559 ||
  ------------------
  |  Branch (537:9): [True: 0, False: 4.19M]
  ------------------
  538|  4.19M|        (c >= 0x561 && c <= 0x586) ||
  ------------------
  |  Branch (538:10): [True: 13.3k, False: 4.18M]
  |  Branch (538:24): [True: 0, False: 13.3k]
  ------------------
  539|  4.19M|        (c >= 0x5d0 && c <= 0x5ea) ||
  ------------------
  |  Branch (539:10): [True: 13.2k, False: 4.18M]
  |  Branch (539:24): [True: 0, False: 13.2k]
  ------------------
  540|  4.19M|        (c >= 0x5f0 && c <= 0x5f2) ||
  ------------------
  |  Branch (540:10): [True: 13.2k, False: 4.18M]
  |  Branch (540:24): [True: 0, False: 13.2k]
  ------------------
  541|  4.19M|        (c >= 0x621 && c <= 0x63a) ||
  ------------------
  |  Branch (541:10): [True: 13.2k, False: 4.18M]
  |  Branch (541:24): [True: 0, False: 13.2k]
  ------------------
  542|  4.19M|        (c >= 0x641 && c <= 0x64a) ||
  ------------------
  |  Branch (542:10): [True: 13.2k, False: 4.18M]
  |  Branch (542:24): [True: 0, False: 13.2k]
  ------------------
  543|  4.19M|        (c >= 0x671 && c <= 0x6b7) ||
  ------------------
  |  Branch (543:10): [True: 13.2k, False: 4.18M]
  |  Branch (543:24): [True: 11, False: 13.1k]
  ------------------
  544|  4.19M|        (c >= 0x6ba && c <= 0x6be) ||
  ------------------
  |  Branch (544:10): [True: 13.1k, False: 4.18M]
  |  Branch (544:24): [True: 0, False: 13.1k]
  ------------------
  545|  4.19M|        (c >= 0x6c0 && c <= 0x6ce) ||
  ------------------
  |  Branch (545:10): [True: 13.1k, False: 4.18M]
  |  Branch (545:24): [True: 0, False: 13.1k]
  ------------------
  546|  4.19M|        (c >= 0x6d0 && c <= 0x6d3) ||
  ------------------
  |  Branch (546:10): [True: 13.1k, False: 4.18M]
  |  Branch (546:24): [True: 0, False: 13.1k]
  ------------------
  547|  4.19M|        c == 0x6d5 ||
  ------------------
  |  Branch (547:9): [True: 47, False: 4.19M]
  ------------------
  548|  4.19M|        (c >= 0x6e5 && c <= 0x6e6) ||
  ------------------
  |  Branch (548:10): [True: 13.1k, False: 4.18M]
  |  Branch (548:24): [True: 0, False: 13.1k]
  ------------------
  549|  4.19M|        (c >= 0x905 && c <= 0x939) ||
  ------------------
  |  Branch (549:10): [True: 13.1k, False: 4.18M]
  |  Branch (549:24): [True: 0, False: 13.1k]
  ------------------
  550|  4.19M|        c == 0x93d ||
  ------------------
  |  Branch (550:9): [True: 0, False: 4.19M]
  ------------------
  551|  4.19M|        (c >= 0x958 && c <= 0x961) ||
  ------------------
  |  Branch (551:10): [True: 13.1k, False: 4.18M]
  |  Branch (551:24): [True: 2, False: 13.1k]
  ------------------
  552|  4.19M|        (c >= 0x985 && c <= 0x98c) ||
  ------------------
  |  Branch (552:10): [True: 13.1k, False: 4.18M]
  |  Branch (552:24): [True: 0, False: 13.1k]
  ------------------
  553|  4.19M|        (c >= 0x98f && c <= 0x990) ||
  ------------------
  |  Branch (553:10): [True: 13.1k, False: 4.18M]
  |  Branch (553:24): [True: 0, False: 13.1k]
  ------------------
  554|  4.19M|        (c >= 0x993 && c <= 0x9a8) ||
  ------------------
  |  Branch (554:10): [True: 13.1k, False: 4.18M]
  |  Branch (554:24): [True: 0, False: 13.1k]
  ------------------
  555|  4.19M|        (c >= 0x9aa && c <= 0x9b0) ||
  ------------------
  |  Branch (555:10): [True: 13.1k, False: 4.18M]
  |  Branch (555:24): [True: 56, False: 13.0k]
  ------------------
  556|  4.19M|        c == 0x9b2 ||
  ------------------
  |  Branch (556:9): [True: 0, False: 4.19M]
  ------------------
  557|  4.19M|        (c >= 0x9b6 && c <= 0x9b9) ||
  ------------------
  |  Branch (557:10): [True: 13.0k, False: 4.18M]
  |  Branch (557:24): [True: 0, False: 13.0k]
  ------------------
  558|  4.19M|        (c >= 0x9dc && c <= 0x9dd) ||
  ------------------
  |  Branch (558:10): [True: 13.0k, False: 4.18M]
  |  Branch (558:24): [True: 0, False: 13.0k]
  ------------------
  559|  4.19M|        (c >= 0x9df && c <= 0x9e1) ||
  ------------------
  |  Branch (559:10): [True: 13.0k, False: 4.18M]
  |  Branch (559:24): [True: 0, False: 13.0k]
  ------------------
  560|  4.19M|        (c >= 0x9f0 && c <= 0x9f1) ||
  ------------------
  |  Branch (560:10): [True: 12.8k, False: 4.18M]
  |  Branch (560:24): [True: 0, False: 12.8k]
  ------------------
  561|  4.19M|        (c >= 0xa05 && c <= 0xa0a) ||
  ------------------
  |  Branch (561:10): [True: 12.8k, False: 4.18M]
  |  Branch (561:24): [True: 0, False: 12.8k]
  ------------------
  562|  4.19M|        (c >= 0xa0f && c <= 0xa10) ||
  ------------------
  |  Branch (562:10): [True: 12.8k, False: 4.18M]
  |  Branch (562:24): [True: 0, False: 12.8k]
  ------------------
  563|  4.19M|        (c >= 0xa13 && c <= 0xa28) ||
  ------------------
  |  Branch (563:10): [True: 12.8k, False: 4.18M]
  |  Branch (563:24): [True: 0, False: 12.8k]
  ------------------
  564|  4.19M|        (c >= 0xa2a && c <= 0xa30) ||
  ------------------
  |  Branch (564:10): [True: 12.8k, False: 4.18M]
  |  Branch (564:24): [True: 0, False: 12.8k]
  ------------------
  565|  4.19M|        (c >= 0xa32 && c <= 0xa33) ||
  ------------------
  |  Branch (565:10): [True: 12.8k, False: 4.18M]
  |  Branch (565:24): [True: 0, False: 12.8k]
  ------------------
  566|  4.19M|        (c >= 0xa35 && c <= 0xa36) ||
  ------------------
  |  Branch (566:10): [True: 12.8k, False: 4.18M]
  |  Branch (566:24): [True: 2, False: 12.8k]
  ------------------
  567|  4.19M|        (c >= 0xa38 && c <= 0xa39) ||
  ------------------
  |  Branch (567:10): [True: 12.8k, False: 4.18M]
  |  Branch (567:24): [True: 0, False: 12.8k]
  ------------------
  568|  4.19M|        (c >= 0xa59 && c <= 0xa5c) ||
  ------------------
  |  Branch (568:10): [True: 12.8k, False: 4.18M]
  |  Branch (568:24): [True: 0, False: 12.8k]
  ------------------
  569|  4.19M|        c == 0xa5e ||
  ------------------
  |  Branch (569:9): [True: 0, False: 4.19M]
  ------------------
  570|  4.19M|        (c >= 0xa72 && c <= 0xa74) ||
  ------------------
  |  Branch (570:10): [True: 12.8k, False: 4.18M]
  |  Branch (570:24): [True: 0, False: 12.8k]
  ------------------
  571|  4.19M|        (c >= 0xa85 && c <= 0xa8b) ||
  ------------------
  |  Branch (571:10): [True: 12.8k, False: 4.18M]
  |  Branch (571:24): [True: 0, False: 12.8k]
  ------------------
  572|  4.19M|        c == 0xa8d ||
  ------------------
  |  Branch (572:9): [True: 0, False: 4.19M]
  ------------------
  573|  4.19M|        (c >= 0xa8f && c <= 0xa91) ||
  ------------------
  |  Branch (573:10): [True: 12.8k, False: 4.18M]
  |  Branch (573:24): [True: 0, False: 12.8k]
  ------------------
  574|  4.19M|        (c >= 0xa93 && c <= 0xaa8) ||
  ------------------
  |  Branch (574:10): [True: 12.8k, False: 4.18M]
  |  Branch (574:24): [True: 0, False: 12.8k]
  ------------------
  575|  4.19M|        (c >= 0xaaa && c <= 0xab0) ||
  ------------------
  |  Branch (575:10): [True: 12.8k, False: 4.18M]
  |  Branch (575:24): [True: 119, False: 12.6k]
  ------------------
  576|  4.19M|        (c >= 0xab2 && c <= 0xab3) ||
  ------------------
  |  Branch (576:10): [True: 12.6k, False: 4.18M]
  |  Branch (576:24): [True: 0, False: 12.6k]
  ------------------
  577|  4.19M|        (c >= 0xab5 && c <= 0xab9) ||
  ------------------
  |  Branch (577:10): [True: 12.6k, False: 4.18M]
  |  Branch (577:24): [True: 0, False: 12.6k]
  ------------------
  578|  4.19M|        c == 0xabd ||
  ------------------
  |  Branch (578:9): [True: 14, False: 4.19M]
  ------------------
  579|  4.19M|        c == 0xae0 ||
  ------------------
  |  Branch (579:9): [True: 0, False: 4.19M]
  ------------------
  580|  4.19M|        (c >= 0xb05 && c <= 0xb0c) ||
  ------------------
  |  Branch (580:10): [True: 12.6k, False: 4.18M]
  |  Branch (580:24): [True: 0, False: 12.6k]
  ------------------
  581|  4.19M|        (c >= 0xb0f && c <= 0xb10) ||
  ------------------
  |  Branch (581:10): [True: 12.6k, False: 4.18M]
  |  Branch (581:24): [True: 0, False: 12.6k]
  ------------------
  582|  4.19M|        (c >= 0xb13 && c <= 0xb28) ||
  ------------------
  |  Branch (582:10): [True: 12.6k, False: 4.18M]
  |  Branch (582:24): [True: 0, False: 12.6k]
  ------------------
  583|  4.19M|        (c >= 0xb2a && c <= 0xb30) ||
  ------------------
  |  Branch (583:10): [True: 12.6k, False: 4.18M]
  |  Branch (583:24): [True: 0, False: 12.6k]
  ------------------
  584|  4.19M|        (c >= 0xb32 && c <= 0xb33) ||
  ------------------
  |  Branch (584:10): [True: 12.6k, False: 4.18M]
  |  Branch (584:24): [True: 0, False: 12.6k]
  ------------------
  585|  4.19M|        (c >= 0xb36 && c <= 0xb39) ||
  ------------------
  |  Branch (585:10): [True: 12.6k, False: 4.18M]
  |  Branch (585:24): [True: 0, False: 12.6k]
  ------------------
  586|  4.19M|        c == 0xb3d ||
  ------------------
  |  Branch (586:9): [True: 0, False: 4.19M]
  ------------------
  587|  4.19M|        (c >= 0xb5c && c <= 0xb5d) ||
  ------------------
  |  Branch (587:10): [True: 12.6k, False: 4.18M]
  |  Branch (587:24): [True: 0, False: 12.6k]
  ------------------
  588|  4.19M|        (c >= 0xb5f && c <= 0xb61) ||
  ------------------
  |  Branch (588:10): [True: 12.6k, False: 4.18M]
  |  Branch (588:24): [True: 0, False: 12.6k]
  ------------------
  589|  4.19M|        (c >= 0xb85 && c <= 0xb8a) ||
  ------------------
  |  Branch (589:10): [True: 12.6k, False: 4.18M]
  |  Branch (589:24): [True: 0, False: 12.6k]
  ------------------
  590|  4.19M|        (c >= 0xb8e && c <= 0xb90) ||
  ------------------
  |  Branch (590:10): [True: 12.6k, False: 4.18M]
  |  Branch (590:24): [True: 0, False: 12.6k]
  ------------------
  591|  4.19M|        (c >= 0xb92 && c <= 0xb95) ||
  ------------------
  |  Branch (591:10): [True: 12.6k, False: 4.18M]
  |  Branch (591:24): [True: 0, False: 12.6k]
  ------------------
  592|  4.19M|        (c >= 0xb99 && c <= 0xb9a) ||
  ------------------
  |  Branch (592:10): [True: 12.6k, False: 4.18M]
  |  Branch (592:24): [True: 0, False: 12.6k]
  ------------------
  593|  4.19M|        c == 0xb9c ||
  ------------------
  |  Branch (593:9): [True: 0, False: 4.19M]
  ------------------
  594|  4.19M|        (c >= 0xb9e && c <= 0xb9f) ||
  ------------------
  |  Branch (594:10): [True: 12.6k, False: 4.18M]
  |  Branch (594:24): [True: 0, False: 12.6k]
  ------------------
  595|  4.19M|        (c >= 0xba3 && c <= 0xba4) ||
  ------------------
  |  Branch (595:10): [True: 12.6k, False: 4.18M]
  |  Branch (595:24): [True: 0, False: 12.6k]
  ------------------
  596|  4.19M|        (c >= 0xba8 && c <= 0xbaa) ||
  ------------------
  |  Branch (596:10): [True: 12.6k, False: 4.18M]
  |  Branch (596:24): [True: 0, False: 12.6k]
  ------------------
  597|  4.19M|        (c >= 0xbae && c <= 0xbb5) ||
  ------------------
  |  Branch (597:10): [True: 12.6k, False: 4.18M]
  |  Branch (597:24): [True: 132, False: 12.5k]
  ------------------
  598|  4.19M|        (c >= 0xbb7 && c <= 0xbb9) ||
  ------------------
  |  Branch (598:10): [True: 12.5k, False: 4.18M]
  |  Branch (598:24): [True: 0, False: 12.5k]
  ------------------
  599|  4.19M|        (c >= 0xc05 && c <= 0xc0c) ||
  ------------------
  |  Branch (599:10): [True: 11.9k, False: 4.18M]
  |  Branch (599:24): [True: 0, False: 11.9k]
  ------------------
  600|  4.19M|        (c >= 0xc0e && c <= 0xc10) ||
  ------------------
  |  Branch (600:10): [True: 11.9k, False: 4.18M]
  |  Branch (600:24): [True: 0, False: 11.9k]
  ------------------
  601|  4.19M|        (c >= 0xc12 && c <= 0xc28) ||
  ------------------
  |  Branch (601:10): [True: 11.9k, False: 4.18M]
  |  Branch (601:24): [True: 0, False: 11.9k]
  ------------------
  602|  4.19M|        (c >= 0xc2a && c <= 0xc33) ||
  ------------------
  |  Branch (602:10): [True: 11.9k, False: 4.18M]
  |  Branch (602:24): [True: 0, False: 11.9k]
  ------------------
  603|  4.19M|        (c >= 0xc35 && c <= 0xc39) ||
  ------------------
  |  Branch (603:10): [True: 11.9k, False: 4.18M]
  |  Branch (603:24): [True: 0, False: 11.9k]
  ------------------
  604|  4.19M|        (c >= 0xc60 && c <= 0xc61) ||
  ------------------
  |  Branch (604:10): [True: 11.9k, False: 4.18M]
  |  Branch (604:24): [True: 0, False: 11.9k]
  ------------------
  605|  4.19M|        (c >= 0xc85 && c <= 0xc8c) ||
  ------------------
  |  Branch (605:10): [True: 11.6k, False: 4.18M]
  |  Branch (605:24): [True: 0, False: 11.6k]
  ------------------
  606|  4.19M|        (c >= 0xc8e && c <= 0xc90) ||
  ------------------
  |  Branch (606:10): [True: 11.6k, False: 4.18M]
  |  Branch (606:24): [True: 0, False: 11.6k]
  ------------------
  607|  4.19M|        (c >= 0xc92 && c <= 0xca8) ||
  ------------------
  |  Branch (607:10): [True: 11.6k, False: 4.18M]
  |  Branch (607:24): [True: 0, False: 11.6k]
  ------------------
  608|  4.19M|        (c >= 0xcaa && c <= 0xcb3) ||
  ------------------
  |  Branch (608:10): [True: 11.6k, False: 4.18M]
  |  Branch (608:24): [True: 198, False: 11.4k]
  ------------------
  609|  4.19M|        (c >= 0xcb5 && c <= 0xcb9) ||
  ------------------
  |  Branch (609:10): [True: 11.4k, False: 4.18M]
  |  Branch (609:24): [True: 0, False: 11.4k]
  ------------------
  610|  4.19M|        c == 0xcde ||
  ------------------
  |  Branch (610:9): [True: 0, False: 4.19M]
  ------------------
  611|  4.19M|        (c >= 0xce0 && c <= 0xce1) ||
  ------------------
  |  Branch (611:10): [True: 10.1k, False: 4.18M]
  |  Branch (611:24): [True: 2, False: 10.1k]
  ------------------
  612|  4.19M|        (c >= 0xd05 && c <= 0xd0c) ||
  ------------------
  |  Branch (612:10): [True: 10.1k, False: 4.18M]
  |  Branch (612:24): [True: 0, False: 10.1k]
  ------------------
  613|  4.19M|        (c >= 0xd0e && c <= 0xd10) ||
  ------------------
  |  Branch (613:10): [True: 10.1k, False: 4.18M]
  |  Branch (613:24): [True: 0, False: 10.1k]
  ------------------
  614|  4.19M|        (c >= 0xd12 && c <= 0xd28) ||
  ------------------
  |  Branch (614:10): [True: 10.1k, False: 4.18M]
  |  Branch (614:24): [True: 0, False: 10.1k]
  ------------------
  615|  4.19M|        (c >= 0xd2a && c <= 0xd39) ||
  ------------------
  |  Branch (615:10): [True: 10.1k, False: 4.18M]
  |  Branch (615:24): [True: 0, False: 10.1k]
  ------------------
  616|  4.19M|        (c >= 0xd60 && c <= 0xd61) ||
  ------------------
  |  Branch (616:10): [True: 10.1k, False: 4.18M]
  |  Branch (616:24): [True: 0, False: 10.1k]
  ------------------
  617|  4.19M|        (c >= 0xe01 && c <= 0xe2e) ||
  ------------------
  |  Branch (617:10): [True: 10.1k, False: 4.18M]
  |  Branch (617:24): [True: 222, False: 9.90k]
  ------------------
  618|  4.19M|        c == 0xe30 ||
  ------------------
  |  Branch (618:9): [True: 446, False: 4.19M]
  ------------------
  619|  4.19M|        (c >= 0xe32 && c <= 0xe33) ||
  ------------------
  |  Branch (619:10): [True: 9.23k, False: 4.18M]
  |  Branch (619:24): [True: 0, False: 9.23k]
  ------------------
  620|  4.19M|        (c >= 0xe40 && c <= 0xe45) ||
  ------------------
  |  Branch (620:10): [True: 9.23k, False: 4.18M]
  |  Branch (620:24): [True: 132, False: 9.10k]
  ------------------
  621|  4.19M|        (c >= 0xe81 && c <= 0xe82) ||
  ------------------
  |  Branch (621:10): [True: 9.10k, False: 4.18M]
  |  Branch (621:24): [True: 0, False: 9.10k]
  ------------------
  622|  4.19M|        c == 0xe84 ||
  ------------------
  |  Branch (622:9): [True: 0, False: 4.19M]
  ------------------
  623|  4.19M|        (c >= 0xe87 && c <= 0xe88) ||
  ------------------
  |  Branch (623:10): [True: 9.10k, False: 4.18M]
  |  Branch (623:24): [True: 0, False: 9.10k]
  ------------------
  624|  4.19M|        c == 0xe8a ||
  ------------------
  |  Branch (624:9): [True: 0, False: 4.19M]
  ------------------
  625|  4.19M|        c == 0xe8d ||
  ------------------
  |  Branch (625:9): [True: 0, False: 4.19M]
  ------------------
  626|  4.19M|        (c >= 0xe94 && c <= 0xe97) ||
  ------------------
  |  Branch (626:10): [True: 9.10k, False: 4.18M]
  |  Branch (626:24): [True: 0, False: 9.10k]
  ------------------
  627|  4.19M|        (c >= 0xe99 && c <= 0xe9f) ||
  ------------------
  |  Branch (627:10): [True: 9.10k, False: 4.18M]
  |  Branch (627:24): [True: 0, False: 9.10k]
  ------------------
  628|  4.19M|        (c >= 0xea1 && c <= 0xea3) ||
  ------------------
  |  Branch (628:10): [True: 9.10k, False: 4.18M]
  |  Branch (628:24): [True: 0, False: 9.10k]
  ------------------
  629|  4.19M|        c == 0xea5 ||
  ------------------
  |  Branch (629:9): [True: 0, False: 4.19M]
  ------------------
  630|  4.19M|        c == 0xea7 ||
  ------------------
  |  Branch (630:9): [True: 0, False: 4.19M]
  ------------------
  631|  4.19M|        (c >= 0xeaa && c <= 0xeab) ||
  ------------------
  |  Branch (631:10): [True: 9.10k, False: 4.18M]
  |  Branch (631:24): [True: 0, False: 9.10k]
  ------------------
  632|  4.19M|        (c >= 0xead && c <= 0xeae) ||
  ------------------
  |  Branch (632:10): [True: 9.10k, False: 4.18M]
  |  Branch (632:24): [True: 0, False: 9.10k]
  ------------------
  633|  4.19M|        c == 0xeb0 ||
  ------------------
  |  Branch (633:9): [True: 0, False: 4.19M]
  ------------------
  634|  4.19M|        (c >= 0xeb2 && c <= 0xeb3) ||
  ------------------
  |  Branch (634:10): [True: 9.10k, False: 4.18M]
  |  Branch (634:24): [True: 0, False: 9.10k]
  ------------------
  635|  4.19M|        c == 0xebd ||
  ------------------
  |  Branch (635:9): [True: 0, False: 4.19M]
  ------------------
  636|  4.19M|        (c >= 0xec0 && c <= 0xec4) ||
  ------------------
  |  Branch (636:10): [True: 9.10k, False: 4.18M]
  |  Branch (636:24): [True: 0, False: 9.10k]
  ------------------
  637|  4.19M|        (c >= 0xf40 && c <= 0xf47) ||
  ------------------
  |  Branch (637:10): [True: 8.29k, False: 4.18M]
  |  Branch (637:24): [True: 0, False: 8.29k]
  ------------------
  638|  4.19M|        (c >= 0xf49 && c <= 0xf69) ||
  ------------------
  |  Branch (638:10): [True: 8.29k, False: 4.18M]
  |  Branch (638:24): [True: 0, False: 8.29k]
  ------------------
  639|  4.19M|        (c >= 0x10a0 && c <= 0x10c5) ||
  ------------------
  |  Branch (639:10): [True: 8.28k, False: 4.18M]
  |  Branch (639:25): [True: 0, False: 8.28k]
  ------------------
  640|  4.19M|        (c >= 0x10d0 && c <= 0x10f6) ||
  ------------------
  |  Branch (640:10): [True: 8.28k, False: 4.18M]
  |  Branch (640:25): [True: 0, False: 8.28k]
  ------------------
  641|  4.19M|        c == 0x1100 ||
  ------------------
  |  Branch (641:9): [True: 0, False: 4.19M]
  ------------------
  642|  4.19M|        (c >= 0x1102 && c <= 0x1103) ||
  ------------------
  |  Branch (642:10): [True: 8.28k, False: 4.18M]
  |  Branch (642:25): [True: 0, False: 8.28k]
  ------------------
  643|  4.19M|        (c >= 0x1105 && c <= 0x1107) ||
  ------------------
  |  Branch (643:10): [True: 8.28k, False: 4.18M]
  |  Branch (643:25): [True: 0, False: 8.28k]
  ------------------
  644|  4.19M|        c == 0x1109 ||
  ------------------
  |  Branch (644:9): [True: 0, False: 4.19M]
  ------------------
  645|  4.19M|        (c >= 0x110b && c <= 0x110c) ||
  ------------------
  |  Branch (645:10): [True: 8.28k, False: 4.18M]
  |  Branch (645:25): [True: 0, False: 8.28k]
  ------------------
  646|  4.19M|        (c >= 0x110e && c <= 0x1112) ||
  ------------------
  |  Branch (646:10): [True: 8.28k, False: 4.18M]
  |  Branch (646:25): [True: 0, False: 8.28k]
  ------------------
  647|  4.19M|        c == 0x113c ||
  ------------------
  |  Branch (647:9): [True: 0, False: 4.19M]
  ------------------
  648|  4.19M|        c == 0x113e ||
  ------------------
  |  Branch (648:9): [True: 0, False: 4.19M]
  ------------------
  649|  4.19M|        c == 0x1140 ||
  ------------------
  |  Branch (649:9): [True: 0, False: 4.19M]
  ------------------
  650|  4.19M|        c == 0x114c ||
  ------------------
  |  Branch (650:9): [True: 0, False: 4.19M]
  ------------------
  651|  4.19M|        c == 0x114e ||
  ------------------
  |  Branch (651:9): [True: 0, False: 4.19M]
  ------------------
  652|  4.19M|        c == 0x1150 ||
  ------------------
  |  Branch (652:9): [True: 0, False: 4.19M]
  ------------------
  653|  4.19M|        (c >= 0x1154 && c <= 0x1155) ||
  ------------------
  |  Branch (653:10): [True: 8.28k, False: 4.18M]
  |  Branch (653:25): [True: 0, False: 8.28k]
  ------------------
  654|  4.19M|        c == 0x1159 ||
  ------------------
  |  Branch (654:9): [True: 0, False: 4.19M]
  ------------------
  655|  4.19M|        (c >= 0x115f && c <= 0x1161) ||
  ------------------
  |  Branch (655:10): [True: 8.28k, False: 4.18M]
  |  Branch (655:25): [True: 0, False: 8.28k]
  ------------------
  656|  4.19M|        c == 0x1163 ||
  ------------------
  |  Branch (656:9): [True: 0, False: 4.19M]
  ------------------
  657|  4.19M|        c == 0x1165 ||
  ------------------
  |  Branch (657:9): [True: 0, False: 4.19M]
  ------------------
  658|  4.19M|        c == 0x1167 ||
  ------------------
  |  Branch (658:9): [True: 0, False: 4.19M]
  ------------------
  659|  4.19M|        c == 0x1169 ||
  ------------------
  |  Branch (659:9): [True: 0, False: 4.19M]
  ------------------
  660|  4.19M|        (c >= 0x116d && c <= 0x116e) ||
  ------------------
  |  Branch (660:10): [True: 8.28k, False: 4.18M]
  |  Branch (660:25): [True: 0, False: 8.28k]
  ------------------
  661|  4.19M|        (c >= 0x1172 && c <= 0x1173) ||
  ------------------
  |  Branch (661:10): [True: 8.28k, False: 4.18M]
  |  Branch (661:25): [True: 27, False: 8.25k]
  ------------------
  662|  4.19M|        c == 0x1175 ||
  ------------------
  |  Branch (662:9): [True: 0, False: 4.19M]
  ------------------
  663|  4.19M|        c == 0x119e ||
  ------------------
  |  Branch (663:9): [True: 0, False: 4.19M]
  ------------------
  664|  4.19M|        c == 0x11a8 ||
  ------------------
  |  Branch (664:9): [True: 0, False: 4.19M]
  ------------------
  665|  4.19M|        c == 0x11ab ||
  ------------------
  |  Branch (665:9): [True: 0, False: 4.19M]
  ------------------
  666|  4.19M|        (c >= 0x11ae && c <= 0x11af) ||
  ------------------
  |  Branch (666:10): [True: 8.25k, False: 4.18M]
  |  Branch (666:25): [True: 0, False: 8.25k]
  ------------------
  667|  4.19M|        (c >= 0x11b7 && c <= 0x11b8) ||
  ------------------
  |  Branch (667:10): [True: 8.25k, False: 4.18M]
  |  Branch (667:25): [True: 0, False: 8.25k]
  ------------------
  668|  4.19M|        c == 0x11ba ||
  ------------------
  |  Branch (668:9): [True: 0, False: 4.19M]
  ------------------
  669|  4.19M|        (c >= 0x11bc && c <= 0x11c2) ||
  ------------------
  |  Branch (669:10): [True: 8.25k, False: 4.18M]
  |  Branch (669:25): [True: 0, False: 8.25k]
  ------------------
  670|  4.19M|        c == 0x11eb ||
  ------------------
  |  Branch (670:9): [True: 14, False: 4.19M]
  ------------------
  671|  4.19M|        c == 0x11f0 ||
  ------------------
  |  Branch (671:9): [True: 0, False: 4.19M]
  ------------------
  672|  4.19M|        c == 0x11f9 ||
  ------------------
  |  Branch (672:9): [True: 0, False: 4.19M]
  ------------------
  673|  4.19M|        (c >= 0x1e00 && c <= 0x1e9b) ||
  ------------------
  |  Branch (673:10): [True: 8.24k, False: 4.18M]
  |  Branch (673:25): [True: 0, False: 8.24k]
  ------------------
  674|  4.19M|        (c >= 0x1ea0 && c <= 0x1ef9) ||
  ------------------
  |  Branch (674:10): [True: 8.24k, False: 4.18M]
  |  Branch (674:25): [True: 0, False: 8.24k]
  ------------------
  675|  4.19M|        (c >= 0x1f00 && c <= 0x1f15) ||
  ------------------
  |  Branch (675:10): [True: 8.24k, False: 4.18M]
  |  Branch (675:25): [True: 0, False: 8.24k]
  ------------------
  676|  4.19M|        (c >= 0x1f18 && c <= 0x1f1d) ||
  ------------------
  |  Branch (676:10): [True: 8.24k, False: 4.18M]
  |  Branch (676:25): [True: 0, False: 8.24k]
  ------------------
  677|  4.19M|        (c >= 0x1f20 && c <= 0x1f45) ||
  ------------------
  |  Branch (677:10): [True: 8.24k, False: 4.18M]
  |  Branch (677:25): [True: 0, False: 8.24k]
  ------------------
  678|  4.19M|        (c >= 0x1f48 && c <= 0x1f4d) ||
  ------------------
  |  Branch (678:10): [True: 8.24k, False: 4.18M]
  |  Branch (678:25): [True: 0, False: 8.24k]
  ------------------
  679|  4.19M|        (c >= 0x1f50 && c <= 0x1f57) ||
  ------------------
  |  Branch (679:10): [True: 8.24k, False: 4.18M]
  |  Branch (679:25): [True: 0, False: 8.24k]
  ------------------
  680|  4.19M|        c == 0x1f59 ||
  ------------------
  |  Branch (680:9): [True: 0, False: 4.19M]
  ------------------
  681|  4.19M|        c == 0x1f5b ||
  ------------------
  |  Branch (681:9): [True: 0, False: 4.19M]
  ------------------
  682|  4.19M|        c == 0x1f5d ||
  ------------------
  |  Branch (682:9): [True: 0, False: 4.19M]
  ------------------
  683|  4.19M|        (c >= 0x1f5f && c <= 0x1f7d) ||
  ------------------
  |  Branch (683:10): [True: 8.24k, False: 4.18M]
  |  Branch (683:25): [True: 0, False: 8.24k]
  ------------------
  684|  4.19M|        (c >= 0x1f80 && c <= 0x1fb4) ||
  ------------------
  |  Branch (684:10): [True: 8.24k, False: 4.18M]
  |  Branch (684:25): [True: 0, False: 8.24k]
  ------------------
  685|  4.19M|        (c >= 0x1fb6 && c <= 0x1fbc) ||
  ------------------
  |  Branch (685:10): [True: 8.24k, False: 4.18M]
  |  Branch (685:25): [True: 0, False: 8.24k]
  ------------------
  686|  4.19M|        c == 0x1fbe ||
  ------------------
  |  Branch (686:9): [True: 0, False: 4.19M]
  ------------------
  687|  4.19M|        (c >= 0x1fc2 && c <= 0x1fc4) ||
  ------------------
  |  Branch (687:10): [True: 8.24k, False: 4.18M]
  |  Branch (687:25): [True: 0, False: 8.24k]
  ------------------
  688|  4.19M|        (c >= 0x1fc6 && c <= 0x1fcc) ||
  ------------------
  |  Branch (688:10): [True: 8.24k, False: 4.18M]
  |  Branch (688:25): [True: 0, False: 8.24k]
  ------------------
  689|  4.19M|        (c >= 0x1fd0 && c <= 0x1fd3) ||
  ------------------
  |  Branch (689:10): [True: 8.24k, False: 4.18M]
  |  Branch (689:25): [True: 0, False: 8.24k]
  ------------------
  690|  4.19M|        (c >= 0x1fd6 && c <= 0x1fdb) ||
  ------------------
  |  Branch (690:10): [True: 8.24k, False: 4.18M]
  |  Branch (690:25): [True: 0, False: 8.24k]
  ------------------
  691|  4.19M|        (c >= 0x1fe0 && c <= 0x1fec) ||
  ------------------
  |  Branch (691:10): [True: 8.24k, False: 4.18M]
  |  Branch (691:25): [True: 8, False: 8.23k]
  ------------------
  692|  4.19M|        (c >= 0x1ff2 && c <= 0x1ff4) ||
  ------------------
  |  Branch (692:10): [True: 8.23k, False: 4.18M]
  |  Branch (692:25): [True: 0, False: 8.23k]
  ------------------
  693|  4.19M|        (c >= 0x1ff6 && c <= 0x1ffc) ||
  ------------------
  |  Branch (693:10): [True: 8.23k, False: 4.18M]
  |  Branch (693:25): [True: 0, False: 8.23k]
  ------------------
  694|  4.19M|        c == 0x2126 ||
  ------------------
  |  Branch (694:9): [True: 0, False: 4.19M]
  ------------------
  695|  4.19M|        (c >= 0x212a && c <= 0x212b) ||
  ------------------
  |  Branch (695:10): [True: 8.23k, False: 4.18M]
  |  Branch (695:25): [True: 0, False: 8.23k]
  ------------------
  696|  4.19M|        c == 0x212e ||
  ------------------
  |  Branch (696:9): [True: 0, False: 4.19M]
  ------------------
  697|  4.19M|        (c >= 0x2180 && c <= 0x2182) ||
  ------------------
  |  Branch (697:10): [True: 8.23k, False: 4.18M]
  |  Branch (697:25): [True: 0, False: 8.23k]
  ------------------
  698|  4.19M|        (c >= 0x3041 && c <= 0x3094) ||
  ------------------
  |  Branch (698:10): [True: 8.13k, False: 4.18M]
  |  Branch (698:25): [True: 0, False: 8.13k]
  ------------------
  699|  4.19M|        (c >= 0x30a1 && c <= 0x30fa) ||
  ------------------
  |  Branch (699:10): [True: 8.13k, False: 4.18M]
  |  Branch (699:25): [True: 0, False: 8.13k]
  ------------------
  700|  4.19M|        (c >= 0x3105 && c <= 0x312c) ||
  ------------------
  |  Branch (700:10): [True: 8.13k, False: 4.18M]
  |  Branch (700:25): [True: 0, False: 8.13k]
  ------------------
  701|  4.19M|        (c >= 0xac00 && c <= 0xd7a3) ||
  ------------------
  |  Branch (701:10): [True: 8.13k, False: 4.18M]
  |  Branch (701:25): [True: 0, False: 8.13k]
  ------------------
  702|  4.19M|        (c >= 0x4e00 && c <= 0x9fa5) ||
  ------------------
  |  Branch (702:10): [True: 8.13k, False: 4.18M]
  |  Branch (702:25): [True: 0, False: 8.13k]
  ------------------
  703|  4.19M|        c == 0x3007 ||
  ------------------
  |  Branch (703:9): [True: 0, False: 4.19M]
  ------------------
  704|  4.19M|        (c >= 0x3021 && c <= 0x3029) ||
  ------------------
  |  Branch (704:10): [True: 8.13k, False: 4.18M]
  |  Branch (704:25): [True: 0, False: 8.13k]
  ------------------
  705|  4.19M|        (c >= 0x4e00 && c <= 0x9fa5) ||
  ------------------
  |  Branch (705:10): [True: 8.13k, False: 4.18M]
  |  Branch (705:25): [True: 0, False: 8.13k]
  ------------------
  706|  4.19M|        c == 0x3007 ||
  ------------------
  |  Branch (706:9): [True: 0, False: 4.19M]
  ------------------
  707|  4.19M|        (c >= 0x3021 && c <= 0x3029));
  ------------------
  |  Branch (707:10): [True: 8.13k, False: 4.18M]
  |  Branch (707:25): [True: 0, False: 8.13k]
  ------------------
  708|  4.50M|}
prvTidyIsXMLNamechar:
  711|  4.44M|{
  712|  4.44M|    return (TY_(IsXMLLetter)(c) ||
  ------------------
  |  |   23|  4.44M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.44M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (712:13): [True: 279k, False: 4.16M]
  ------------------
  713|  4.16M|        c == '.' || c == '_' ||
  ------------------
  |  Branch (713:9): [True: 141, False: 4.16M]
  |  Branch (713:21): [True: 2.82k, False: 4.16M]
  ------------------
  714|  4.16M|        c == ':' || c == '-' ||
  ------------------
  |  Branch (714:9): [True: 270, False: 4.16M]
  |  Branch (714:21): [True: 67, False: 4.16M]
  ------------------
  715|  4.16M|        (c >= 0x300 && c <= 0x345) ||
  ------------------
  |  Branch (715:10): [True: 9.75k, False: 4.15M]
  |  Branch (715:24): [True: 0, False: 9.75k]
  ------------------
  716|  4.16M|        (c >= 0x360 && c <= 0x361) ||
  ------------------
  |  Branch (716:10): [True: 9.75k, False: 4.15M]
  |  Branch (716:24): [True: 0, False: 9.75k]
  ------------------
  717|  4.16M|        (c >= 0x483 && c <= 0x486) ||
  ------------------
  |  Branch (717:10): [True: 9.75k, False: 4.15M]
  |  Branch (717:24): [True: 0, False: 9.75k]
  ------------------
  718|  4.16M|        (c >= 0x591 && c <= 0x5a1) ||
  ------------------
  |  Branch (718:10): [True: 9.60k, False: 4.15M]
  |  Branch (718:24): [True: 0, False: 9.60k]
  ------------------
  719|  4.16M|        (c >= 0x5a3 && c <= 0x5b9) ||
  ------------------
  |  Branch (719:10): [True: 9.60k, False: 4.15M]
  |  Branch (719:24): [True: 0, False: 9.60k]
  ------------------
  720|  4.16M|        (c >= 0x5bb && c <= 0x5bd) ||
  ------------------
  |  Branch (720:10): [True: 9.60k, False: 4.15M]
  |  Branch (720:24): [True: 0, False: 9.60k]
  ------------------
  721|  4.16M|        c == 0x5bf ||
  ------------------
  |  Branch (721:9): [True: 0, False: 4.16M]
  ------------------
  722|  4.16M|        (c >= 0x5c1 && c <= 0x5c2) ||
  ------------------
  |  Branch (722:10): [True: 9.60k, False: 4.15M]
  |  Branch (722:24): [True: 79, False: 9.52k]
  ------------------
  723|  4.16M|        c == 0x5c4 ||
  ------------------
  |  Branch (723:9): [True: 0, False: 4.16M]
  ------------------
  724|  4.16M|        (c >= 0x64b && c <= 0x652) ||
  ------------------
  |  Branch (724:10): [True: 9.52k, False: 4.15M]
  |  Branch (724:24): [True: 0, False: 9.52k]
  ------------------
  725|  4.16M|        c == 0x670 ||
  ------------------
  |  Branch (725:9): [True: 39, False: 4.16M]
  ------------------
  726|  4.16M|        (c >= 0x6d6 && c <= 0x6dc) ||
  ------------------
  |  Branch (726:10): [True: 9.48k, False: 4.15M]
  |  Branch (726:24): [True: 0, False: 9.48k]
  ------------------
  727|  4.16M|        (c >= 0x6dd && c <= 0x6df) ||
  ------------------
  |  Branch (727:10): [True: 9.48k, False: 4.15M]
  |  Branch (727:24): [True: 0, False: 9.48k]
  ------------------
  728|  4.16M|        (c >= 0x6e0 && c <= 0x6e4) ||
  ------------------
  |  Branch (728:10): [True: 9.48k, False: 4.15M]
  |  Branch (728:24): [True: 0, False: 9.48k]
  ------------------
  729|  4.16M|        (c >= 0x6e7 && c <= 0x6e8) ||
  ------------------
  |  Branch (729:10): [True: 9.48k, False: 4.15M]
  |  Branch (729:24): [True: 0, False: 9.48k]
  ------------------
  730|  4.16M|        (c >= 0x6ea && c <= 0x6ed) ||
  ------------------
  |  Branch (730:10): [True: 9.48k, False: 4.15M]
  |  Branch (730:24): [True: 0, False: 9.48k]
  ------------------
  731|  4.16M|        (c >= 0x901 && c <= 0x903) ||
  ------------------
  |  Branch (731:10): [True: 9.48k, False: 4.15M]
  |  Branch (731:24): [True: 0, False: 9.48k]
  ------------------
  732|  4.16M|        c == 0x93c ||
  ------------------
  |  Branch (732:9): [True: 0, False: 4.16M]
  ------------------
  733|  4.16M|        (c >= 0x93e && c <= 0x94c) ||
  ------------------
  |  Branch (733:10): [True: 9.48k, False: 4.15M]
  |  Branch (733:24): [True: 0, False: 9.48k]
  ------------------
  734|  4.16M|        c == 0x94d ||
  ------------------
  |  Branch (734:9): [True: 0, False: 4.16M]
  ------------------
  735|  4.16M|        (c >= 0x951 && c <= 0x954) ||
  ------------------
  |  Branch (735:10): [True: 9.48k, False: 4.15M]
  |  Branch (735:24): [True: 0, False: 9.48k]
  ------------------
  736|  4.16M|        (c >= 0x962 && c <= 0x963) ||
  ------------------
  |  Branch (736:10): [True: 9.48k, False: 4.15M]
  |  Branch (736:24): [True: 0, False: 9.48k]
  ------------------
  737|  4.16M|        (c >= 0x981 && c <= 0x983) ||
  ------------------
  |  Branch (737:10): [True: 9.48k, False: 4.15M]
  |  Branch (737:24): [True: 0, False: 9.48k]
  ------------------
  738|  4.16M|        c == 0x9bc ||
  ------------------
  |  Branch (738:9): [True: 0, False: 4.16M]
  ------------------
  739|  4.16M|        c == 0x9be ||
  ------------------
  |  Branch (739:9): [True: 0, False: 4.16M]
  ------------------
  740|  4.16M|        c == 0x9bf ||
  ------------------
  |  Branch (740:9): [True: 0, False: 4.16M]
  ------------------
  741|  4.16M|        (c >= 0x9c0 && c <= 0x9c4) ||
  ------------------
  |  Branch (741:10): [True: 9.48k, False: 4.15M]
  |  Branch (741:24): [True: 0, False: 9.48k]
  ------------------
  742|  4.16M|        (c >= 0x9c7 && c <= 0x9c8) ||
  ------------------
  |  Branch (742:10): [True: 9.48k, False: 4.15M]
  |  Branch (742:24): [True: 0, False: 9.48k]
  ------------------
  743|  4.16M|        (c >= 0x9cb && c <= 0x9cd) ||
  ------------------
  |  Branch (743:10): [True: 9.48k, False: 4.15M]
  |  Branch (743:24): [True: 0, False: 9.48k]
  ------------------
  744|  4.16M|        c == 0x9d7 ||
  ------------------
  |  Branch (744:9): [True: 0, False: 4.16M]
  ------------------
  745|  4.16M|        (c >= 0x9e2 && c <= 0x9e3) ||
  ------------------
  |  Branch (745:10): [True: 9.48k, False: 4.15M]
  |  Branch (745:24): [True: 0, False: 9.48k]
  ------------------
  746|  4.16M|        c == 0xa02 ||
  ------------------
  |  Branch (746:9): [True: 0, False: 4.16M]
  ------------------
  747|  4.16M|        c == 0xa3c ||
  ------------------
  |  Branch (747:9): [True: 0, False: 4.16M]
  ------------------
  748|  4.16M|        c == 0xa3e ||
  ------------------
  |  Branch (748:9): [True: 0, False: 4.16M]
  ------------------
  749|  4.16M|        c == 0xa3f ||
  ------------------
  |  Branch (749:9): [True: 44, False: 4.16M]
  ------------------
  750|  4.16M|        (c >= 0xa40 && c <= 0xa42) ||
  ------------------
  |  Branch (750:10): [True: 9.20k, False: 4.15M]
  |  Branch (750:24): [True: 0, False: 9.20k]
  ------------------
  751|  4.16M|        (c >= 0xa47 && c <= 0xa48) ||
  ------------------
  |  Branch (751:10): [True: 9.20k, False: 4.15M]
  |  Branch (751:24): [True: 0, False: 9.20k]
  ------------------
  752|  4.16M|        (c >= 0xa4b && c <= 0xa4d) ||
  ------------------
  |  Branch (752:10): [True: 9.20k, False: 4.15M]
  |  Branch (752:24): [True: 0, False: 9.20k]
  ------------------
  753|  4.16M|        (c >= 0xa70 && c <= 0xa71) ||
  ------------------
  |  Branch (753:10): [True: 9.20k, False: 4.15M]
  |  Branch (753:24): [True: 0, False: 9.20k]
  ------------------
  754|  4.16M|        (c >= 0xa81 && c <= 0xa83) ||
  ------------------
  |  Branch (754:10): [True: 9.20k, False: 4.15M]
  |  Branch (754:24): [True: 0, False: 9.20k]
  ------------------
  755|  4.16M|        c == 0xabc ||
  ------------------
  |  Branch (755:9): [True: 0, False: 4.16M]
  ------------------
  756|  4.16M|        (c >= 0xabe && c <= 0xac5) ||
  ------------------
  |  Branch (756:10): [True: 9.20k, False: 4.15M]
  |  Branch (756:24): [True: 0, False: 9.20k]
  ------------------
  757|  4.16M|        (c >= 0xac7 && c <= 0xac9) ||
  ------------------
  |  Branch (757:10): [True: 9.20k, False: 4.15M]
  |  Branch (757:24): [True: 0, False: 9.20k]
  ------------------
  758|  4.16M|        (c >= 0xacb && c <= 0xacd) ||
  ------------------
  |  Branch (758:10): [True: 9.20k, False: 4.15M]
  |  Branch (758:24): [True: 0, False: 9.20k]
  ------------------
  759|  4.16M|        (c >= 0xb01 && c <= 0xb03) ||
  ------------------
  |  Branch (759:10): [True: 9.20k, False: 4.15M]
  |  Branch (759:24): [True: 0, False: 9.20k]
  ------------------
  760|  4.16M|        c == 0xb3c ||
  ------------------
  |  Branch (760:9): [True: 0, False: 4.16M]
  ------------------
  761|  4.16M|        (c >= 0xb3e && c <= 0xb43) ||
  ------------------
  |  Branch (761:10): [True: 9.20k, False: 4.15M]
  |  Branch (761:24): [True: 0, False: 9.20k]
  ------------------
  762|  4.16M|        (c >= 0xb47 && c <= 0xb48) ||
  ------------------
  |  Branch (762:10): [True: 9.20k, False: 4.15M]
  |  Branch (762:24): [True: 0, False: 9.20k]
  ------------------
  763|  4.16M|        (c >= 0xb4b && c <= 0xb4d) ||
  ------------------
  |  Branch (763:10): [True: 9.20k, False: 4.15M]
  |  Branch (763:24): [True: 0, False: 9.20k]
  ------------------
  764|  4.16M|        (c >= 0xb56 && c <= 0xb57) ||
  ------------------
  |  Branch (764:10): [True: 9.20k, False: 4.15M]
  |  Branch (764:24): [True: 0, False: 9.20k]
  ------------------
  765|  4.16M|        (c >= 0xb82 && c <= 0xb83) ||
  ------------------
  |  Branch (765:10): [True: 9.20k, False: 4.15M]
  |  Branch (765:24): [True: 0, False: 9.20k]
  ------------------
  766|  4.16M|        (c >= 0xbbe && c <= 0xbc2) ||
  ------------------
  |  Branch (766:10): [True: 9.20k, False: 4.15M]
  |  Branch (766:24): [True: 0, False: 9.20k]
  ------------------
  767|  4.16M|        (c >= 0xbc6 && c <= 0xbc8) ||
  ------------------
  |  Branch (767:10): [True: 9.20k, False: 4.15M]
  |  Branch (767:24): [True: 0, False: 9.20k]
  ------------------
  768|  4.16M|        (c >= 0xbca && c <= 0xbcd) ||
  ------------------
  |  Branch (768:10): [True: 9.20k, False: 4.15M]
  |  Branch (768:24): [True: 0, False: 9.20k]
  ------------------
  769|  4.16M|        c == 0xbd7 ||
  ------------------
  |  Branch (769:9): [True: 0, False: 4.16M]
  ------------------
  770|  4.16M|        (c >= 0xc01 && c <= 0xc03) ||
  ------------------
  |  Branch (770:10): [True: 9.03k, False: 4.15M]
  |  Branch (770:24): [True: 385, False: 8.64k]
  ------------------
  771|  4.16M|        (c >= 0xc3e && c <= 0xc44) ||
  ------------------
  |  Branch (771:10): [True: 8.64k, False: 4.15M]
  |  Branch (771:24): [True: 0, False: 8.64k]
  ------------------
  772|  4.16M|        (c >= 0xc46 && c <= 0xc48) ||
  ------------------
  |  Branch (772:10): [True: 8.64k, False: 4.15M]
  |  Branch (772:24): [True: 0, False: 8.64k]
  ------------------
  773|  4.16M|        (c >= 0xc4a && c <= 0xc4d) ||
  ------------------
  |  Branch (773:10): [True: 8.64k, False: 4.15M]
  |  Branch (773:24): [True: 0, False: 8.64k]
  ------------------
  774|  4.16M|        (c >= 0xc55 && c <= 0xc56) ||
  ------------------
  |  Branch (774:10): [True: 8.64k, False: 4.15M]
  |  Branch (774:24): [True: 0, False: 8.64k]
  ------------------
  775|  4.16M|        (c >= 0xc82 && c <= 0xc83) ||
  ------------------
  |  Branch (775:10): [True: 8.64k, False: 4.15M]
  |  Branch (775:24): [True: 330, False: 8.31k]
  ------------------
  776|  4.16M|        (c >= 0xcbe && c <= 0xcc4) ||
  ------------------
  |  Branch (776:10): [True: 8.31k, False: 4.15M]
  |  Branch (776:24): [True: 0, False: 8.31k]
  ------------------
  777|  4.16M|        (c >= 0xcc6 && c <= 0xcc8) ||
  ------------------
  |  Branch (777:10): [True: 8.31k, False: 4.15M]
  |  Branch (777:24): [True: 1.28k, False: 7.03k]
  ------------------
  778|  4.15M|        (c >= 0xcca && c <= 0xccd) ||
  ------------------
  |  Branch (778:10): [True: 7.03k, False: 4.15M]
  |  Branch (778:24): [True: 0, False: 7.03k]
  ------------------
  779|  4.15M|        (c >= 0xcd5 && c <= 0xcd6) ||
  ------------------
  |  Branch (779:10): [True: 7.03k, False: 4.15M]
  |  Branch (779:24): [True: 0, False: 7.03k]
  ------------------
  780|  4.15M|        (c >= 0xd02 && c <= 0xd03) ||
  ------------------
  |  Branch (780:10): [True: 7.03k, False: 4.15M]
  |  Branch (780:24): [True: 0, False: 7.03k]
  ------------------
  781|  4.15M|        (c >= 0xd3e && c <= 0xd43) ||
  ------------------
  |  Branch (781:10): [True: 7.03k, False: 4.15M]
  |  Branch (781:24): [True: 0, False: 7.03k]
  ------------------
  782|  4.15M|        (c >= 0xd46 && c <= 0xd48) ||
  ------------------
  |  Branch (782:10): [True: 7.03k, False: 4.15M]
  |  Branch (782:24): [True: 0, False: 7.03k]
  ------------------
  783|  4.15M|        (c >= 0xd4a && c <= 0xd4d) ||
  ------------------
  |  Branch (783:10): [True: 7.03k, False: 4.15M]
  |  Branch (783:24): [True: 0, False: 7.03k]
  ------------------
  784|  4.15M|        c == 0xd57 ||
  ------------------
  |  Branch (784:9): [True: 0, False: 4.15M]
  ------------------
  785|  4.15M|        c == 0xe31 ||
  ------------------
  |  Branch (785:9): [True: 222, False: 4.15M]
  ------------------
  786|  4.15M|        (c >= 0xe34 && c <= 0xe3a) ||
  ------------------
  |  Branch (786:10): [True: 6.76k, False: 4.15M]
  |  Branch (786:24): [True: 0, False: 6.76k]
  ------------------
  787|  4.15M|        (c >= 0xe47 && c <= 0xe4e) ||
  ------------------
  |  Branch (787:10): [True: 6.76k, False: 4.15M]
  |  Branch (787:24): [True: 0, False: 6.76k]
  ------------------
  788|  4.15M|        c == 0xeb1 ||
  ------------------
  |  Branch (788:9): [True: 0, False: 4.15M]
  ------------------
  789|  4.15M|        (c >= 0xeb4 && c <= 0xeb9) ||
  ------------------
  |  Branch (789:10): [True: 6.76k, False: 4.15M]
  |  Branch (789:24): [True: 0, False: 6.76k]
  ------------------
  790|  4.15M|        (c >= 0xebb && c <= 0xebc) ||
  ------------------
  |  Branch (790:10): [True: 6.76k, False: 4.15M]
  |  Branch (790:24): [True: 0, False: 6.76k]
  ------------------
  791|  4.15M|        (c >= 0xec8 && c <= 0xecd) ||
  ------------------
  |  Branch (791:10): [True: 6.76k, False: 4.15M]
  |  Branch (791:24): [True: 0, False: 6.76k]
  ------------------
  792|  4.15M|        (c >= 0xf18 && c <= 0xf19) ||
  ------------------
  |  Branch (792:10): [True: 6.76k, False: 4.15M]
  |  Branch (792:24): [True: 0, False: 6.76k]
  ------------------
  793|  4.15M|        c == 0xf35 ||
  ------------------
  |  Branch (793:9): [True: 0, False: 4.15M]
  ------------------
  794|  4.15M|        c == 0xf37 ||
  ------------------
  |  Branch (794:9): [True: 0, False: 4.15M]
  ------------------
  795|  4.15M|        c == 0xf39 ||
  ------------------
  |  Branch (795:9): [True: 0, False: 4.15M]
  ------------------
  796|  4.15M|        c == 0xf3e ||
  ------------------
  |  Branch (796:9): [True: 792, False: 4.15M]
  ------------------
  797|  4.15M|        c == 0xf3f ||
  ------------------
  |  Branch (797:9): [True: 0, False: 4.15M]
  ------------------
  798|  4.15M|        (c >= 0xf71 && c <= 0xf84) ||
  ------------------
  |  Branch (798:10): [True: 5.95k, False: 4.15M]
  |  Branch (798:24): [True: 0, False: 5.95k]
  ------------------
  799|  4.15M|        (c >= 0xf86 && c <= 0xf8b) ||
  ------------------
  |  Branch (799:10): [True: 5.95k, False: 4.15M]
  |  Branch (799:24): [True: 0, False: 5.95k]
  ------------------
  800|  4.15M|        (c >= 0xf90 && c <= 0xf95) ||
  ------------------
  |  Branch (800:10): [True: 5.95k, False: 4.15M]
  |  Branch (800:24): [True: 0, False: 5.95k]
  ------------------
  801|  4.15M|        c == 0xf97 ||
  ------------------
  |  Branch (801:9): [True: 0, False: 4.15M]
  ------------------
  802|  4.15M|        (c >= 0xf99 && c <= 0xfad) ||
  ------------------
  |  Branch (802:10): [True: 5.95k, False: 4.15M]
  |  Branch (802:24): [True: 0, False: 5.95k]
  ------------------
  803|  4.15M|        (c >= 0xfb1 && c <= 0xfb7) ||
  ------------------
  |  Branch (803:10): [True: 5.94k, False: 4.15M]
  |  Branch (803:24): [True: 0, False: 5.94k]
  ------------------
  804|  4.15M|        c == 0xfb9 ||
  ------------------
  |  Branch (804:9): [True: 0, False: 4.15M]
  ------------------
  805|  4.15M|        (c >= 0x20d0 && c <= 0x20dc) ||
  ------------------
  |  Branch (805:10): [True: 5.94k, False: 4.15M]
  |  Branch (805:25): [True: 0, False: 5.94k]
  ------------------
  806|  4.15M|        c == 0x20e1 ||
  ------------------
  |  Branch (806:9): [True: 0, False: 4.15M]
  ------------------
  807|  4.15M|        (c >= 0x302a && c <= 0x302f) ||
  ------------------
  |  Branch (807:10): [True: 5.84k, False: 4.15M]
  |  Branch (807:25): [True: 0, False: 5.84k]
  ------------------
  808|  4.15M|        c == 0x3099 ||
  ------------------
  |  Branch (808:9): [True: 0, False: 4.15M]
  ------------------
  809|  4.15M|        c == 0x309a ||
  ------------------
  |  Branch (809:9): [True: 0, False: 4.15M]
  ------------------
  810|  4.15M|        (c >= 0x30 && c <= 0x39) ||
  ------------------
  |  Branch (810:10): [True: 3.16M, False: 988k]
  |  Branch (810:23): [True: 3.14M, False: 20.2k]
  ------------------
  811|  1.00M|        (c >= 0x660 && c <= 0x669) ||
  ------------------
  |  Branch (811:10): [True: 6.42k, False: 1.00M]
  |  Branch (811:24): [True: 0, False: 6.42k]
  ------------------
  812|  1.00M|        (c >= 0x6f0 && c <= 0x6f9) ||
  ------------------
  |  Branch (812:10): [True: 6.42k, False: 1.00M]
  |  Branch (812:24): [True: 0, False: 6.42k]
  ------------------
  813|  1.00M|        (c >= 0x966 && c <= 0x96f) ||
  ------------------
  |  Branch (813:10): [True: 6.42k, False: 1.00M]
  |  Branch (813:24): [True: 0, False: 6.42k]
  ------------------
  814|  1.00M|        (c >= 0x9e6 && c <= 0x9ef) ||
  ------------------
  |  Branch (814:10): [True: 6.42k, False: 1.00M]
  |  Branch (814:24): [True: 237, False: 6.19k]
  ------------------
  815|  1.00M|        (c >= 0xa66 && c <= 0xa6f) ||
  ------------------
  |  Branch (815:10): [True: 6.19k, False: 1.00M]
  |  Branch (815:24): [True: 0, False: 6.19k]
  ------------------
  816|  1.00M|        (c >= 0xae6 && c <= 0xaef) ||
  ------------------
  |  Branch (816:10): [True: 6.19k, False: 1.00M]
  |  Branch (816:24): [True: 0, False: 6.19k]
  ------------------
  817|  1.00M|        (c >= 0xb66 && c <= 0xb6f) ||
  ------------------
  |  Branch (817:10): [True: 6.19k, False: 1.00M]
  |  Branch (817:24): [True: 0, False: 6.19k]
  ------------------
  818|  1.00M|        (c >= 0xbe7 && c <= 0xbef) ||
  ------------------
  |  Branch (818:10): [True: 6.19k, False: 1.00M]
  |  Branch (818:24): [True: 175, False: 6.01k]
  ------------------
  819|  1.00M|        (c >= 0xc66 && c <= 0xc6f) ||
  ------------------
  |  Branch (819:10): [True: 6.01k, False: 1.00M]
  |  Branch (819:24): [True: 0, False: 6.01k]
  ------------------
  820|  1.00M|        (c >= 0xce6 && c <= 0xcef) ||
  ------------------
  |  Branch (820:10): [True: 6.01k, False: 1.00M]
  |  Branch (820:24): [True: 0, False: 6.01k]
  ------------------
  821|  1.00M|        (c >= 0xd66 && c <= 0xd6f) ||
  ------------------
  |  Branch (821:10): [True: 5.97k, False: 1.00M]
  |  Branch (821:24): [True: 0, False: 5.97k]
  ------------------
  822|  1.00M|        (c >= 0xe50 && c <= 0xe59) ||
  ------------------
  |  Branch (822:10): [True: 5.97k, False: 1.00M]
  |  Branch (822:24): [True: 0, False: 5.97k]
  ------------------
  823|  1.00M|        (c >= 0xed0 && c <= 0xed9) ||
  ------------------
  |  Branch (823:10): [True: 5.97k, False: 1.00M]
  |  Branch (823:24): [True: 0, False: 5.97k]
  ------------------
  824|  1.00M|        (c >= 0xf20 && c <= 0xf29) ||
  ------------------
  |  Branch (824:10): [True: 5.97k, False: 1.00M]
  |  Branch (824:24): [True: 11, False: 5.96k]
  ------------------
  825|  1.00M|        c == 0xb7 ||
  ------------------
  |  Branch (825:9): [True: 0, False: 1.00M]
  ------------------
  826|  1.00M|        c == 0x2d0 ||
  ------------------
  |  Branch (826:9): [True: 0, False: 1.00M]
  ------------------
  827|  1.00M|        c == 0x2d1 ||
  ------------------
  |  Branch (827:9): [True: 0, False: 1.00M]
  ------------------
  828|  1.00M|        c == 0x387 ||
  ------------------
  |  Branch (828:9): [True: 0, False: 1.00M]
  ------------------
  829|  1.00M|        c == 0x640 ||
  ------------------
  |  Branch (829:9): [True: 0, False: 1.00M]
  ------------------
  830|  1.00M|        c == 0xe46 ||
  ------------------
  |  Branch (830:9): [True: 0, False: 1.00M]
  ------------------
  831|  1.00M|        c == 0xec6 ||
  ------------------
  |  Branch (831:9): [True: 0, False: 1.00M]
  ------------------
  832|  1.00M|        c == 0x3005 ||
  ------------------
  |  Branch (832:9): [True: 0, False: 1.00M]
  ------------------
  833|  1.00M|        (c >= 0x3031 && c <= 0x3035) ||
  ------------------
  |  Branch (833:10): [True: 5.84k, False: 1.00M]
  |  Branch (833:25): [True: 0, False: 5.84k]
  ------------------
  834|  1.00M|        (c >= 0x309d && c <= 0x309e) ||
  ------------------
  |  Branch (834:10): [True: 5.84k, False: 1.00M]
  |  Branch (834:25): [True: 0, False: 5.84k]
  ------------------
  835|  1.00M|        (c >= 0x30fc && c <= 0x30fe));
  ------------------
  |  Branch (835:10): [True: 5.84k, False: 1.00M]
  |  Branch (835:25): [True: 0, False: 5.84k]
  ------------------
  836|  4.44M|}
prvTidyIsUpper:
  839|    197|{
  840|    197|    uint map = MAP(c);
  ------------------
  |  |  206|    197|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 38, False: 159]
  |  |  ------------------
  ------------------
  841|       |
  842|    197|    return (map & uppercase)!=0;
  ------------------
  |  |   74|    197|#define uppercase   64u
  ------------------
  843|    197|}
prvTidyToLower:
  846|  18.2M|{
  847|  18.2M|    uint map = MAP(c);
  ------------------
  |  |  206|  18.2M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 17.0M, False: 1.21M]
  |  |  ------------------
  ------------------
  848|       |
  849|  18.2M|    if (map & uppercase)
  ------------------
  |  |   74|  18.2M|#define uppercase   64u
  ------------------
  |  Branch (849:9): [True: 1.39M, False: 16.8M]
  ------------------
  850|  1.39M|        c += 'a' - 'A';
  851|       |
  852|  18.2M|    return c;
  853|  18.2M|}
prvTidyToUpper:
  856|   117k|{
  857|   117k|    uint map = MAP(c);
  ------------------
  |  |  206|   117k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 117k, False: 148]
  |  |  ------------------
  ------------------
  858|       |
  859|   117k|    if (map & lowercase)
  ------------------
  |  |   73|   117k|#define lowercase   32u
  ------------------
  |  Branch (859:9): [True: 400, False: 116k]
  ------------------
  860|    400|        c += (uint) ('A' - 'a' );
  861|       |
  862|   117k|    return c;
  863|   117k|}
prvTidyNewLexer:
  881|     98|{
  882|     98|    Lexer* lexer = (Lexer*) TidyDocAlloc( doc, sizeof(Lexer) );
  ------------------
  |  |  157|     98|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|     98|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  883|       |
  884|     98|    if ( lexer != NULL )
  ------------------
  |  Branch (884:10): [True: 98, False: 0]
  ------------------
  885|     98|    {
  886|     98|        TidyClearMemory( lexer, sizeof(Lexer) );
  ------------------
  |  |   70|     98|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  887|       |
  888|     98|        lexer->allocator = doc->allocator;
  889|     98|        lexer->lines = 1;
  890|     98|        lexer->columns = 1;
  891|     98|        lexer->state = LEX_CONTENT;
  892|       |
  893|     98|        lexer->versions = (VERS_ALL|VERS_PROPRIETARY);
  ------------------
  |  |  228|     98|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|     98|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|     98|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|     98|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|     98|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|     98|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|     98|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|     98|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|     98|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|     98|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|     98|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|     98|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|     98|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|     98|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|     98|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|     98|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|     98|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|     98|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|     98|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|     98|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|     98|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|     98|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|     98|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|     98|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|     98|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|     98|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|     98|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|     98|#define HT50              131072u
  |  |  ------------------
  ------------------
                      lexer->versions = (VERS_ALL|VERS_PROPRIETARY);
  ------------------
  |  |  231|     98|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|     98|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|     98|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|     98|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  894|     98|        lexer->doctype = VERS_UNKNOWN;
  ------------------
  |  |  204|     98|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|     98|#define xxxx                   0u
  |  |  ------------------
  ------------------
  895|     98|        lexer->root = &doc->root;
  896|     98|    }
  897|     98|    return lexer;
  898|     98|}
prvTidyFreeLexer:
  907|    196|{
  908|    196|    Lexer *lexer = doc->lexer;
  909|    196|    if ( lexer )
  ------------------
  |  Branch (909:10): [True: 98, False: 98]
  ------------------
  910|     98|    {
  911|     98|        TY_(FreeStyles)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  912|       |
  913|       |        /* See GetToken() */
  914|     98|        if ( lexer->pushed || lexer->itoken )
  ------------------
  |  Branch (914:14): [True: 0, False: 98]
  |  Branch (914:31): [True: 0, False: 98]
  ------------------
  915|      0|        {
  916|      0|            if (lexer->pushed)
  ------------------
  |  Branch (916:17): [True: 0, False: 0]
  ------------------
  917|      0|                TY_(FreeNode)( doc, lexer->itoken );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  918|      0|            TY_(FreeNode)( doc, lexer->token );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  919|      0|        }
  920|       |
  921|     98|        while ( lexer->istacksize > 0 )
  ------------------
  |  Branch (921:17): [True: 0, False: 98]
  ------------------
  922|      0|            TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  923|       |
  924|     98|        TidyDocFree( doc, lexer->istack );
  ------------------
  |  |  159|     98|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  925|     98|        TidyDocFree( doc, lexer->lexbuf );
  ------------------
  |  |  159|     98|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  926|     98|        TidyDocFree( doc, lexer );
  ------------------
  |  |  159|     98|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  927|       |        doc->lexer = NULL;
  928|     98|    }
  929|    196|}
prvTidyAddCharToLexer:
  975|   249M|{
  976|   249M|    int i, err, count = 0;
  977|   249M|    tmbchar buf[10] = {0};
  978|       |    
  979|   249M|    err = TY_(EncodeCharToUTF8Bytes)( c, buf, NULL, &count );
  ------------------
  |  |   23|   249M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   249M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  980|   249M|    if (err)
  ------------------
  |  Branch (980:9): [True: 15, False: 249M]
  ------------------
  981|     15|    {
  982|       |        /* replacement character 0xFFFD encoded as UTF-8 */
  983|     15|        buf[0] = (byte) 0xEF;
  984|     15|        buf[1] = (byte) 0xBF;
  985|     15|        buf[2] = (byte) 0xBD;
  986|     15|        count = 3;
  987|     15|    }
  988|       |    
  989|   498M|    for ( i = 0; i < count; ++i )
  ------------------
  |  Branch (989:18): [True: 249M, False: 249M]
  ------------------
  990|   249M|        AddByte( lexer, buf[i] );
  991|   249M|}
prvTidyNewNode:
 1425|  73.7k|{
 1426|  73.7k|    Node* node = (Node*) TidyAlloc( allocator, sizeof(Node) );
  ------------------
  |  |   66|  73.7k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 1427|  73.7k|    TidyClearMemory( node, sizeof(Node) );
  ------------------
  |  |   70|  73.7k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1428|  73.7k|    if ( lexer )
  ------------------
  |  Branch (1428:10): [True: 73.7k, False: 0]
  ------------------
 1429|  73.7k|    {
 1430|  73.7k|        node->line = lexer->lines;
 1431|  73.7k|        node->column = lexer->columns;
 1432|  73.7k|    }
 1433|  73.7k|    node->type = TextNode;
 1434|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_ALLOCATION)
 1435|       |    SPRTF("Allocated node %p\n", node );
 1436|       |#endif
 1437|  73.7k|    return node;
 1438|  73.7k|}
prvTidyFreeAttrs:
 1464|  73.7k|{
 1465|  92.0k|    while ( node->attributes )
  ------------------
  |  Branch (1465:13): [True: 18.3k, False: 73.7k]
  ------------------
 1466|  18.3k|    {
 1467|  18.3k|        AttVal *av = node->attributes;
 1468|       |
 1469|  18.3k|        if ( av->attribute )
  ------------------
  |  Branch (1469:14): [True: 18.2k, False: 122]
  ------------------
 1470|  18.2k|        {
 1471|  18.2k|            if ( (attrIsID(av) || attrIsNAME(av)) &&
  ------------------
  |  |  243|  18.2k|#define attrIsID(av)                AttrIsId( av, TidyAttr_ID  )
  |  |  ------------------
  |  |  |  |  169|  36.4k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 18.2k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 289, False: 17.9k]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 289]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( (attrIsID(av) || attrIsNAME(av)) &&
  ------------------
  |  |  265|  18.2k|#define attrIsNAME(av)              AttrIsId( av, TidyAttr_NAME  )
  |  |  ------------------
  |  |  |  |  169|  18.2k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 18.2k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 289, False: 17.9k]
  |  |  |  |  |  Branch (169:51): [True: 1, False: 288]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1472|      1|                 TY_(IsAnchorElement)(doc, node) )
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1472:18): [True: 0, False: 1]
  ------------------
 1473|      0|            {
 1474|      0|                TY_(RemoveAnchorByNode)( doc, av->value, node );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1475|      0|            }
 1476|  18.2k|        }
 1477|       |
 1478|  18.3k|        node->attributes = av->next;
 1479|  18.3k|        TY_(FreeAttribute)( doc, av );
  ------------------
  |  |   23|  18.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1480|  18.3k|    }
 1481|  73.7k|}
prvTidyFreeAttribute:
 1485|  52.0k|{
 1486|  52.0k|    TY_(FreeNode)( doc, av->asp );
  ------------------
  |  |   23|  52.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  52.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1487|  52.0k|    TY_(FreeNode)( doc, av->php );
  ------------------
  |  |   23|  52.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  52.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1488|  52.0k|    TidyDocFree( doc, av->attribute );
  ------------------
  |  |  159|  52.0k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  52.0k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1489|  52.0k|    TidyDocFree( doc, av->value );
  ------------------
  |  |  159|  52.0k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  52.0k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1490|  52.0k|    TidyDocFree( doc, av );
  ------------------
  |  |  159|  52.0k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  52.0k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1491|  52.0k|}
prvTidyDetachAttribute:
 1496|    848|{
 1497|    848|    AttVal *av, *prev = NULL;
 1498|       |
 1499|   961k|    for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (1499:34): [True: 961k, False: 0]
  ------------------
 1500|   961k|    {
 1501|   961k|        if ( av == attr )
  ------------------
  |  Branch (1501:14): [True: 848, False: 960k]
  ------------------
 1502|    848|        {
 1503|    848|            if ( prev )
  ------------------
  |  Branch (1503:18): [True: 768, False: 80]
  ------------------
 1504|    768|                prev->next = attr->next;
 1505|     80|            else
 1506|     80|                node->attributes = attr->next;
 1507|    848|            break;
 1508|    848|        }
 1509|   960k|        prev = av;
 1510|   960k|    }
 1511|    848|}
prvTidyRemoveAttribute:
 1516|    848|{
 1517|    848|    TY_(DetachAttribute)( node, attr );
  ------------------
  |  |   23|    848|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    848|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1518|    848|    TY_(FreeAttribute)( doc, attr );
  ------------------
  |  |   23|    848|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    848|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1519|    848|}
prvTidyFreeNode:
 1527|   178k|{
 1528|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_ALLOCATION)
 1529|       |    /* avoid showing free of root node! */
 1530|       |    if (node) {
 1531|       |        if (RootNode != node->type) {
 1532|       |            SPRTF("Free node %p\n", node);
 1533|       |        }
 1534|       |        else {
 1535|       |            SPRTF("Root node %p\n", node);
 1536|       |        }
 1537|       |    }
 1538|       |#endif
 1539|       |
 1540|   252k|    while ( node )
  ------------------
  |  Branch (1540:13): [True: 73.7k, False: 178k]
  ------------------
 1541|  73.7k|    {
 1542|  73.7k|        Node* next = node->next;
 1543|       |
 1544|  73.7k|        TY_(FreeAttrs)( doc, node );
  ------------------
  |  |   23|  73.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1545|  73.7k|        TY_(FreeNode)( doc, node->content );
  ------------------
  |  |   23|  73.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1546|  73.7k|        TidyDocFree( doc, node->element );
  ------------------
  |  |  159|  73.7k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  73.7k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1547|  73.7k|        if (RootNode != node->type)
  ------------------
  |  Branch (1547:13): [True: 73.5k, False: 196]
  ------------------
 1548|  73.7k|            TidyDocFree( doc, node );
  ------------------
  |  |  159|  73.5k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  73.5k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1549|    196|        else
 1550|    196|            node->content = NULL;
 1551|       |
 1552|  73.7k|        node = next;
 1553|  73.7k|    }
 1554|   178k|}
prvTidyTextToken:
 1557|  35.9k|{
 1558|  35.9k|    Node *node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|  35.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1559|  35.9k|    node->start = lexer->txtstart;
 1560|  35.9k|    node->end = lexer->txtend;
 1561|  35.9k|    return node;
 1562|  35.9k|}
prvTidyGetToken:
 2441|  53.1k|{
 2442|  53.1k|    Node *node;
 2443|  53.1k|    Lexer* lexer = doc->lexer;
 2444|       |
 2445|  53.1k|    if (lexer->pushed || lexer->itoken)
  ------------------
  |  Branch (2445:9): [True: 0, False: 53.1k]
  |  Branch (2445:26): [True: 0, False: 53.1k]
  ------------------
 2446|      0|    {
 2447|       |        /* Deal with previously returned duplicate inline token */
 2448|      0|        if (lexer->itoken)
  ------------------
  |  Branch (2448:13): [True: 0, False: 0]
  ------------------
 2449|      0|        {
 2450|       |            /* itoken rejected */
 2451|      0|            if (lexer->pushed)
  ------------------
  |  Branch (2451:17): [True: 0, False: 0]
  ------------------
 2452|      0|            {
 2453|      0|                lexer->pushed = no;
 2454|      0|                node = lexer->itoken;
 2455|      0|                GTDBG(doc,"lex-itoken", node);
 2456|      0|                return node;
 2457|      0|            }
 2458|       |            /* itoken has been accepted */
 2459|      0|            lexer->itoken = NULL;
 2460|      0|        }
 2461|       |            
 2462|       |        /* duplicate inlines in preference to pushed text nodes when appropriate */
 2463|      0|        lexer->pushed = no;
 2464|      0|        if (lexer->token->type != TextNode
  ------------------
  |  Branch (2464:13): [True: 0, False: 0]
  ------------------
 2465|      0|            || !(lexer->insert || lexer->inode)) {
  ------------------
  |  Branch (2465:18): [True: 0, False: 0]
  |  Branch (2465:35): [True: 0, False: 0]
  ------------------
 2466|      0|            node = lexer->token;
 2467|      0|            GTDBG(doc,"lex-token", node);
 2468|      0|            return node;
 2469|      0|        }
 2470|      0|        lexer->itoken = TY_(InsertedToken)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2471|      0|        node = lexer->itoken;
 2472|      0|        GTDBG(doc,"lex-inserted", node);
 2473|      0|        return node;
 2474|      0|    }
 2475|       |
 2476|  53.1k|    assert( !(lexer->pushed || lexer->itoken) );
  ------------------
  |  Branch (2476:5): [True: 53.1k, False: 0]
  |  Branch (2476:5): [True: 0, False: 0]
  |  Branch (2476:5): [True: 0, False: 53.1k]
  |  Branch (2476:5): [True: 0, False: 53.1k]
  ------------------
 2477|       |
 2478|       |    /* at start of block elements, unclosed inline
 2479|       |       elements are inserted into the token stream 
 2480|       |       Issue #341 - Can NOT insert a token if NO istacksize  
 2481|       |     */
 2482|  53.1k|    if ((lexer->insert || lexer->inode) && lexer->istacksize)
  ------------------
  |  Branch (2482:10): [True: 0, False: 53.1k]
  |  Branch (2482:27): [True: 0, False: 53.1k]
  |  Branch (2482:44): [True: 0, False: 0]
  ------------------
 2483|      0|    {
 2484|       |        /*\ Issue #92: could fix by the following, but instead chose not to stack these 2
 2485|       |         *  if ( !(lexer->insert && (nodeIsINS(lexer->insert) || nodeIsDEL(lexer->insert))) ) {
 2486|       |        \*/
 2487|      0|        lexer->token = TY_(InsertedToken)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2488|      0|        node = lexer->token;
 2489|      0|        GTDBG(doc,"lex-inserted2", node);
 2490|      0|        return node;
 2491|      0|    }
 2492|       |
 2493|  53.1k|    if (mode == CdataContent)
  ------------------
  |  Branch (2493:9): [True: 0, False: 53.1k]
  ------------------
 2494|      0|    {
 2495|      0|        assert( lexer->parent != NULL );
  ------------------
  |  Branch (2495:9): [True: 0, False: 0]
  |  Branch (2495:9): [True: 0, False: 0]
  ------------------
 2496|      0|        node = GetCDATA(doc, lexer->parent);
 2497|      0|        GTDBG(doc,"lex-cdata", node);
 2498|      0|        return node;
 2499|      0|    }
 2500|       |
 2501|  53.1k|    return GetTokenFromStream( doc, mode );
 2502|  53.1k|}
prvTidyInitMap:
 3480|     98|{
 3481|     98|    MapStr("\r\n\f", newline|white);
  ------------------
  |  |   72|     98|#define newline     16u
  ------------------
                  MapStr("\r\n\f", newline|white);
  ------------------
  |  |   71|     98|#define white       8u
  ------------------
 3482|     98|    MapStr(" \t", white);
  ------------------
  |  |   71|     98|#define white       8u
  ------------------
 3483|     98|    MapStr("-.:_", namechar);
  ------------------
  |  |   70|     98|#define namechar    4u
  ------------------
 3484|     98|    MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   68|     98|#define digit       1u
  ------------------
                  MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   75|     98|#define digithex    128u
  ------------------
                  MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   70|     98|#define namechar    4u
  ------------------
 3485|     98|    MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   73|     98|#define lowercase   32u
  ------------------
                  MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   69|     98|#define letter      2u
  ------------------
                  MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   70|     98|#define namechar    4u
  ------------------
 3486|     98|    MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   74|     98|#define uppercase   64u
  ------------------
                  MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   69|     98|#define letter      2u
  ------------------
                  MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   70|     98|#define namechar    4u
  ------------------
 3487|     98|    MapStr("abcdefABCDEF", digithex);
  ------------------
  |  |   75|     98|#define digithex    128u
  ------------------
 3488|     98|}
prvTidyNewAttribute:
 4155|  52.0k|{
 4156|  52.0k|    AttVal *av = (AttVal*) TidyDocAlloc( doc, sizeof(AttVal) );
  ------------------
  |  |  157|  52.0k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  52.0k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 4157|  52.0k|    TidyClearMemory( av, sizeof(AttVal) );
  ------------------
  |  |   70|  52.0k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 4158|  52.0k|    return av;
 4159|  52.0k|}
prvTidyInsertAttributeAtEnd:
 4187|     25|{
 4188|     25|    AddAttrToList(&node->attributes, av);
 4189|     25|}
lexer.c:AddByte:
  936|   249M|{
  937|   249M|    if ( lexer->lexsize + 2 >= lexer->lexlength )
  ------------------
  |  Branch (937:10): [True: 929, False: 249M]
  ------------------
  938|    929|    {
  939|    929|        tmbstr buf = NULL;
  940|    929|        uint allocAmt = lexer->lexlength;
  941|    929|        uint prev = allocAmt; /* Is. #761 */
  942|  1.85k|        while ( lexer->lexsize + 2 >= allocAmt )
  ------------------
  |  Branch (942:17): [True: 929, False: 929]
  ------------------
  943|    929|        {
  944|    929|            if ( allocAmt == 0 )
  ------------------
  |  Branch (944:18): [True: 98, False: 831]
  ------------------
  945|     98|                allocAmt = 8192;
  946|    831|            else
  947|    831|                allocAmt *= 2;
  948|    929|            if (allocAmt < prev) /* Is. #761 - watch for wrap - and */
  ------------------
  |  Branch (948:17): [True: 0, False: 929]
  ------------------
  949|      0|                TidyPanic(lexer->allocator, "\nPanic: out of internal memory!\nDocument input too big!\n");
  ------------------
  |  |   69|      0|#define TidyPanic(allocator, msg) ((allocator)->vtbl->panic((allocator), (msg)))
  ------------------
  950|    929|        }
  951|    929|        buf = (tmbstr) TidyRealloc( lexer->allocator, lexer->lexbuf, allocAmt );
  ------------------
  |  |   67|    929|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  952|    929|        if ( buf )
  ------------------
  |  Branch (952:14): [True: 929, False: 0]
  ------------------
  953|    929|        {
  954|    929|          TidyClearMemory( buf + lexer->lexlength, 
  ------------------
  |  |   70|    929|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  955|    929|                           allocAmt - lexer->lexlength );
  956|    929|          lexer->lexbuf = buf;
  957|    929|          lexer->lexlength = allocAmt;
  958|    929|        }
  959|    929|    }
  960|       |
  961|   249M|    lexer->lexbuf[ lexer->lexsize++ ] = ch;
  962|   249M|    lexer->lexbuf[ lexer->lexsize ]   = '\0';  /* debug */
  963|   249M|}
lexer.c:SetLexerLocus:
 1007|   894k|{
 1008|   894k|    lexer->lines = doc->docIn->curline;
 1009|   894k|    lexer->columns = doc->docIn->curcol;
 1010|   894k|}
lexer.c:GetTokenFromStream:
 2512|  53.1k|{
 2513|  53.1k|    Lexer* lexer = doc->lexer;
 2514|  53.1k|    uint c, lexdump, badcomment = 0;
 2515|  53.1k|    Bool isempty = no;
 2516|  53.1k|    AttVal *attributes = NULL;
 2517|  53.1k|    Node *node;
 2518|  53.1k|    Bool fixComments;
 2519|       |    
 2520|  53.1k|    switch ( cfgAutoBool(doc, TidyFixComments) )
  ------------------
  |  |  421|  53.1k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  53.1k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2521|  53.1k|    {
 2522|      0|        case TidyYesState:
  ------------------
  |  Branch (2522:9): [True: 0, False: 53.1k]
  ------------------
 2523|      0|            fixComments = yes;
 2524|      0|            break;
 2525|       |
 2526|      0|        case TidyNoState:
  ------------------
  |  Branch (2526:9): [True: 0, False: 53.1k]
  ------------------
 2527|      0|            fixComments = no;
 2528|      0|            break;
 2529|       |
 2530|  53.1k|        default:
  ------------------
  |  Branch (2530:9): [True: 53.1k, False: 0]
  ------------------
 2531|  53.1k|            fixComments = (TY_(HTMLVersion)(doc) & HT50) == 0;
  ------------------
  |  |   23|  53.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  53.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          fixComments = (TY_(HTMLVersion)(doc) & HT50) == 0;
  ------------------
  |  |  200|  53.1k|#define HT50              131072u
  ------------------
 2532|  53.1k|            break;
 2533|  53.1k|    }
 2534|       |
 2535|       |    /* Lexer->token must be set on return. Nullify it for safety. */
 2536|  53.1k|    lexer->token = NULL;
 2537|       |
 2538|  53.1k|    SetLexerLocus( doc, lexer );
 2539|  53.1k|    lexer->waswhite = no;
 2540|       |
 2541|  53.1k|    lexer->txtstart = lexer->txtend = lexer->lexsize;
 2542|       |
 2543|   125M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|   125M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   125M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|   125M|#define EndOfStream (~0u)
  ------------------
  |  Branch (2543:12): [True: 125M, False: 8.35k]
  ------------------
 2544|   125M|    {
 2545|   125M|        if (lexer->insertspace)
  ------------------
  |  Branch (2545:13): [True: 0, False: 125M]
  ------------------
 2546|      0|        {
 2547|      0|            TY_(AddCharToLexer)(lexer, ' ');
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2548|      0|            lexer->waswhite = yes;
 2549|      0|            lexer->insertspace = no;
 2550|      0|        }
 2551|       |
 2552|   125M|        if (c == 160 && (mode == Preformatted))
  ------------------
  |  Branch (2552:13): [True: 1, False: 125M]
  |  Branch (2552:25): [True: 0, False: 1]
  ------------------
 2553|      0|            c = ' ';
 2554|       |
 2555|   125M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   125M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   125M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2556|       |
 2557|   125M|        switch (lexer->state)
  ------------------
  |  Branch (2557:17): [True: 125M, False: 0]
  ------------------
 2558|   125M|        {
 2559|  70.5M|            case LEX_CONTENT:  /* element content */
  ------------------
  |  Branch (2559:13): [True: 70.5M, False: 55.0M]
  ------------------
 2560|       |
 2561|       |                /*
 2562|       |                 Discard white space if appropriate. Its cheaper
 2563|       |                 to do this here rather than in parser methods
 2564|       |                 for elements that don't have mixed content.
 2565|       |                */
 2566|  70.5M|                if (TY_(IsWhite)(c) && (mode == IgnoreWhitespace) 
  ------------------
  |  |   23|  70.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  70.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2566:21): [True: 67.3M, False: 3.18M]
  |  Branch (2566:40): [True: 638k, False: 66.7M]
  ------------------
 2567|   638k|                      && lexer->lexsize == lexer->txtstart + 1)
  ------------------
  |  Branch (2567:26): [True: 398k, False: 239k]
  ------------------
 2568|   398k|                {
 2569|   398k|                    --(lexer->lexsize);
 2570|   398k|                    lexer->waswhite = no;
 2571|   398k|                    SetLexerLocus( doc, lexer );
 2572|   398k|                    continue;
 2573|   398k|                }
 2574|       |
 2575|  70.1M|                if (c == '<')
  ------------------
  |  Branch (2575:21): [True: 1.03M, False: 69.1M]
  ------------------
 2576|  1.03M|                {
 2577|  1.03M|                    lexer->state = LEX_GT;
 2578|  1.03M|                    continue;
 2579|  1.03M|                }
 2580|       |
 2581|  69.1M|                if (TY_(IsWhite)(c))
  ------------------
  |  |   23|  69.1M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  69.1M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2581:21): [True: 66.9M, False: 2.15M]
  ------------------
 2582|  66.9M|                {
 2583|       |                    /* was previous character white? */
 2584|  66.9M|                    if (lexer->waswhite)
  ------------------
  |  Branch (2584:25): [True: 65.9M, False: 1.01M]
  ------------------
 2585|  65.9M|                    {
 2586|  65.9M|                        if (mode != Preformatted && mode != IgnoreMarkup)
  ------------------
  |  Branch (2586:29): [True: 439k, False: 65.5M]
  |  Branch (2586:53): [True: 439k, False: 0]
  ------------------
 2587|   439k|                        {
 2588|   439k|                            --(lexer->lexsize);
 2589|   439k|                            SetLexerLocus( doc, lexer );
 2590|   439k|                        }
 2591|  65.9M|                    }
 2592|  1.01M|                    else /* prev character wasn't white */
 2593|  1.01M|                    {
 2594|  1.01M|                        lexer->waswhite = yes;
 2595|       |
 2596|  1.01M|                        if (mode != Preformatted && mode != IgnoreMarkup && c != ' ')
  ------------------
  |  Branch (2596:29): [True: 1.00M, False: 8.63k]
  |  Branch (2596:53): [True: 1.00M, False: 0]
  |  Branch (2596:77): [True: 16.5k, False: 985k]
  ------------------
 2597|  16.5k|                            ChangeChar(lexer, ' ');
 2598|  1.01M|                    }
 2599|       |
 2600|  66.9M|                    continue;
 2601|  66.9M|                }
 2602|  2.15M|                else if (c == '&' && mode != IgnoreMarkup)
  ------------------
  |  Branch (2602:26): [True: 2.65k, False: 2.14M]
  |  Branch (2602:38): [True: 2.65k, False: 0]
  ------------------
 2603|  2.65k|                    ParseEntity( doc, mode );
 2604|       |
 2605|       |                /* this is needed to avoid trimming trailing whitespace */
 2606|  2.15M|                if (mode == IgnoreWhitespace)
  ------------------
  |  Branch (2606:21): [True: 5.15k, False: 2.14M]
  ------------------
 2607|  5.15k|                    mode = MixedContent;
 2608|       |
 2609|  2.15M|                lexer->waswhite = no;
 2610|  2.15M|                continue;
 2611|       |
 2612|  1.03M|            case LEX_GT:  /* < */
  ------------------
  |  Branch (2612:13): [True: 1.03M, False: 124M]
  ------------------
 2613|       |
 2614|       |                /* check for endtag */
 2615|  1.03M|                if (c == '/')
  ------------------
  |  Branch (2615:21): [True: 213, False: 1.03M]
  ------------------
 2616|    213|                {
 2617|    213|                    if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|    213|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    213|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|    213|#define EndOfStream (~0u)
  ------------------
  |  Branch (2617:25): [True: 0, False: 213]
  ------------------
 2618|      0|                    {
 2619|      0|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2620|      0|                        continue;
 2621|      0|                    }
 2622|       |
 2623|    213|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|    213|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    213|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2624|       |
 2625|    213|                    if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|    213|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    213|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |  418|    252|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    126|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 126, False: 0]
  |  |  ------------------
  ------------------
                                  if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|    126|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    126|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2625:25): [True: 87, False: 126]
  |  Branch (2625:75): [True: 125, False: 1]
  ------------------
 2626|    212|                    {
 2627|    212|                        lexer->lexsize -= 3;
 2628|    212|                        lexer->txtend = lexer->lexsize;
 2629|    212|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    212|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    212|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2630|    212|                        lexer->state = LEX_ENDTAG;
 2631|    212|                        lexer->lexbuf[lexer->lexsize] = '\0';  /* debug */
 2632|    212|                        doc->docIn->curcol -= 2;
 2633|       |
 2634|       |                        /* if some text before the </ return it now */
 2635|    212|                        if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (2635:29): [True: 87, False: 125]
  ------------------
 2636|     87|                        {
 2637|       |                            /* trim space character before end tag */
 2638|     87|                            if (mode == IgnoreWhitespace && lexer->lexbuf[lexer->lexsize - 1] == ' ')
  ------------------
  |  Branch (2638:33): [True: 27, False: 60]
  |  Branch (2638:61): [True: 0, False: 27]
  ------------------
 2639|      0|                            {
 2640|      0|                                lexer->lexsize -= 1;
 2641|      0|                                lexer->txtend = lexer->lexsize;
 2642|      0|                            }
 2643|     87|                            lexer->token = TY_(TextToken)(lexer);
  ------------------
  |  |   23|     87|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     87|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2644|     87|                            node = lexer->token;
 2645|     87|                            GTDBG(doc,"text", node);
 2646|     87|                            return node;
 2647|     87|                        }
 2648|       |
 2649|    125|                        continue;       /* no text so keep going */
 2650|    212|                    }
 2651|       |
 2652|       |                    /* otherwise treat as CDATA */
 2653|      1|                    lexer->waswhite = no;
 2654|      1|                    lexer->state = LEX_CONTENT;
 2655|      1|                    continue;
 2656|    213|                }
 2657|       |
 2658|  1.03M|                if (mode == IgnoreMarkup)
  ------------------
  |  Branch (2658:21): [True: 0, False: 1.03M]
  ------------------
 2659|      0|                {
 2660|       |                    /* otherwise treat as CDATA */
 2661|      0|                    lexer->waswhite = no;
 2662|      0|                    lexer->state = LEX_CONTENT;
 2663|      0|                    continue;
 2664|      0|                }
 2665|       |
 2666|       |                /*
 2667|       |                   look out for comments, doctype or marked sections
 2668|       |                   this isn't quite right, but its getting there ...
 2669|       |                */
 2670|  1.03M|                if (c == '!')
  ------------------
  |  Branch (2670:21): [True: 29.1k, False: 1.00M]
  ------------------
 2671|  29.1k|                {
 2672|  29.1k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  29.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2673|       |
 2674|  29.1k|                    if (c == '-')
  ------------------
  |  Branch (2674:25): [True: 5, False: 29.1k]
  ------------------
 2675|      5|                    {
 2676|      5|                        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|      5|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      5|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2677|       |
 2678|      5|                        if (c == '-')
  ------------------
  |  Branch (2678:29): [True: 5, False: 0]
  ------------------
 2679|      5|                        {
 2680|      5|                            lexer->state = LEX_COMMENT;  /* comment */
 2681|      5|                            lexer->lexsize -= 2;
 2682|      5|                            lexer->txtend = lexer->lexsize;
 2683|       |
 2684|      5|                            CondReturnTextNode(doc, 4)
  ------------------
  |  | 2424|      5|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 1, False: 4]
  |  |  ------------------
  |  | 2425|      5|            { \
  |  | 2426|      1|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|      1|                return lexer->token; \
  |  | 2428|      1|            }
  ------------------
 2685|       |
 2686|      4|                            lexer->txtstart = lexer->lexsize;
 2687|      4|                            continue;
 2688|      5|                        }
 2689|       |
 2690|       |                        /*
 2691|       |                           TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_DROPPING );
 2692|       |                           Warning now done later - see issue #487
 2693|       |                         */
 2694|      5|                    }
 2695|  29.1k|                    else if (c == 'd' || c == 'D')
  ------------------
  |  Branch (2695:30): [True: 28.4k, False: 695]
  |  Branch (2695:42): [True: 318, False: 377]
  ------------------
 2696|  28.7k|                    {
 2697|       |                        /* todo: check for complete "<!DOCTYPE" not just <!D */
 2698|       |
 2699|  28.7k|                        uint skip = 0;
 2700|       |
 2701|  28.7k|                        lexer->state = LEX_DOCTYPE; /* doctype */
 2702|  28.7k|                        lexer->lexsize -= 2;
 2703|  28.7k|                        lexer->txtend = lexer->lexsize;
 2704|  28.7k|                        mode = IgnoreWhitespace;
 2705|       |
 2706|       |                        /* skip until white space or '>' */
 2707|       |
 2708|  28.7k|                        for (;;)
 2709|  28.8k|                        {
 2710|  28.8k|                            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  28.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2711|  28.8k|                            ++skip;
 2712|       |
 2713|  28.8k|                            if (c == EndOfStream || c == '>')
  ------------------
  |  | 1064|  57.6k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2713:33): [True: 11, False: 28.7k]
  |  Branch (2713:53): [True: 7, False: 28.7k]
  ------------------
 2714|     18|                            {
 2715|     18|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     18|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     18|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2716|     18|                                break;
 2717|     18|                            }
 2718|       |
 2719|       |
 2720|  28.7k|                            if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|  28.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2720:33): [True: 35, False: 28.7k]
  ------------------
 2721|     35|                                continue;
 2722|       |
 2723|       |                            /* and skip to end of whitespace */
 2724|       |
 2725|  28.7k|                            for (;;)
 2726|   636k|                            {
 2727|   636k|                                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   636k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   636k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2728|   636k|                                ++skip;
 2729|       |
 2730|   636k|                                if (c == EndOfStream || c == '>')
  ------------------
  |  | 1064|  1.27M|#define EndOfStream (~0u)
  ------------------
  |  Branch (2730:37): [True: 0, False: 636k]
  |  Branch (2730:57): [True: 0, False: 636k]
  ------------------
 2731|      0|                                {
 2732|      0|                                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2733|      0|                                    break;
 2734|      0|                                }
 2735|       |
 2736|       |
 2737|   636k|                                if (TY_(IsWhite)(c))
  ------------------
  |  |   23|   636k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   636k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2737:37): [True: 607k, False: 28.7k]
  ------------------
 2738|   607k|                                    continue;
 2739|       |
 2740|  28.7k|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  28.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2741|  28.7k|                                break;
 2742|   636k|                            }
 2743|       |
 2744|  28.7k|                            break;
 2745|  28.7k|                        }
 2746|       |
 2747|  28.7k|                        CondReturnTextNode(doc, (skip + 3))
  ------------------
  |  | 2424|  28.7k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 185, False: 28.5k]
  |  |  ------------------
  |  | 2425|  28.7k|            { \
  |  | 2426|    185|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|    185|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    185|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|    185|                return lexer->token; \
  |  | 2428|    185|            }
  ------------------
 2748|       |
 2749|  28.5k|                        lexer->txtstart = lexer->lexsize;
 2750|  28.5k|                        continue;
 2751|  28.7k|                    }
 2752|    377|                    else if (c == '[')
  ------------------
  |  Branch (2752:30): [True: 364, False: 13]
  ------------------
 2753|    364|                    {
 2754|       |                        /* Word 2000 embeds <![if ...]> ... <![endif]> sequences */
 2755|    364|                        lexer->lexsize -= 2;
 2756|    364|                        lexer->state = LEX_SECTION;
 2757|    364|                        lexer->txtend = lexer->lexsize;
 2758|       |
 2759|    364|                        CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|    364|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 11, False: 353]
  |  |  ------------------
  |  | 2425|    364|            { \
  |  | 2426|     11|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|     11|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     11|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|     11|                return lexer->token; \
  |  | 2428|     11|            }
  ------------------
 2760|       |
 2761|    353|                        lexer->txtstart = lexer->lexsize;
 2762|    353|                        continue;
 2763|    364|                    }
 2764|       |
 2765|       |
 2766|       |                    /*
 2767|       |                       We only print this message if there's a missing
 2768|       |                       starting hyphen; this comment will be dropped.
 2769|       |                     */
 2770|     13|                    TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_DROPPING ); /* Is. #487 */
  ------------------
  |  |   23|     13|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     13|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2771|       |
 2772|       |                    /* else swallow characters up to and including next '>' */
 2773|   202k|                    while ((c = TY_(ReadChar)(doc->docIn)) != '>')
  ------------------
  |  |   23|   202k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   202k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2773:28): [True: 202k, False: 12]
  ------------------
 2774|   202k|                    {
 2775|   202k|                        if (c == EndOfStream)
  ------------------
  |  | 1064|   202k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2775:29): [True: 1, False: 202k]
  ------------------
 2776|      1|                        {
 2777|      1|                            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2778|      1|                            break;
 2779|      1|                        }
 2780|   202k|                    }
 2781|       |
 2782|     13|                    lexer->lexsize -= 2;
 2783|     13|                    lexer->lexbuf[lexer->lexsize] = '\0';
 2784|     13|                    lexer->state = LEX_CONTENT;
 2785|     13|                    continue;
 2786|  29.1k|                }
 2787|       |
 2788|       |                /*
 2789|       |                   processing instructions
 2790|       |                */
 2791|       |
 2792|  1.00M|                if (c == '?')
  ------------------
  |  Branch (2792:21): [True: 149, False: 1.00M]
  ------------------
 2793|    149|                {
 2794|    149|                    lexer->lexsize -= 2;
 2795|    149|                    lexer->state = LEX_PROCINSTR;
 2796|    149|                    lexer->txtend = lexer->lexsize;
 2797|       |
 2798|    149|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|    149|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 120, False: 29]
  |  |  ------------------
  |  | 2425|    149|            { \
  |  | 2426|    120|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|    120|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    120|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|    120|                return lexer->token; \
  |  | 2428|    120|            }
  ------------------
 2799|       |
 2800|     29|                    lexer->txtstart = lexer->lexsize;
 2801|     29|                    continue;
 2802|    149|                }
 2803|       |
 2804|       |                /* Microsoft ASP's e.g. <% ... server-code ... %> */
 2805|  1.00M|                if (c == '%')
  ------------------
  |  Branch (2805:21): [True: 45, False: 1.00M]
  ------------------
 2806|     45|                {
 2807|     45|                    lexer->lexsize -= 2;
 2808|     45|                    lexer->state = LEX_ASP;
 2809|     45|                    lexer->txtend = lexer->lexsize;
 2810|       |
 2811|     45|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|     45|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 26, False: 19]
  |  |  ------------------
  |  | 2425|     45|            { \
  |  | 2426|     26|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|     26|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     26|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|     26|                return lexer->token; \
  |  | 2428|     26|            }
  ------------------
 2812|       |
 2813|     19|                    lexer->txtstart = lexer->lexsize;
 2814|     19|                    continue;
 2815|     45|                }
 2816|       |
 2817|       |                /* Netscapes JSTE e.g. <# ... server-code ... #> */
 2818|  1.00M|                if (c == '#')
  ------------------
  |  Branch (2818:21): [True: 6, False: 1.00M]
  ------------------
 2819|      6|                {
 2820|      6|                    lexer->lexsize -= 2;
 2821|      6|                    lexer->state = LEX_JSTE;
 2822|      6|                    lexer->txtend = lexer->lexsize;
 2823|       |
 2824|      6|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|      6|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 6, False: 0]
  |  |  ------------------
  |  | 2425|      6|            { \
  |  | 2426|      6|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|      6|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      6|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|      6|                return lexer->token; \
  |  | 2428|      6|            }
  ------------------
 2825|       |
 2826|      0|                    lexer->txtstart = lexer->lexsize;
 2827|      0|                    continue;
 2828|      6|                }
 2829|       |
 2830|       |                /* check for start tag */
 2831|  1.00M|                if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|  1.00M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |  418|  2.00M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.00M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 1.00M, False: 0]
  |  |  ------------------
  ------------------
                              if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|  1.00M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2831:21): [True: 5.11k, False: 1.00M]
  |  Branch (2831:71): [True: 3.06k, False: 998k]
  ------------------
 2832|  8.18k|                {
 2833|  8.18k|                    TY_(UngetChar)(c, doc->docIn);     /* push back letter */
  ------------------
  |  |   23|  8.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2834|  8.18k|                    TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|  8.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2835|  8.18k|                    lexer->lexsize -= 2;      /* discard "<" + letter */
 2836|  8.18k|                    lexer->txtend = lexer->lexsize;
 2837|  8.18k|                    lexer->state = LEX_STARTTAG;         /* ready to read tag name */
 2838|       |
 2839|  8.18k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  8.18k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 6.63k, False: 1.55k]
  |  |  ------------------
  |  | 2425|  8.18k|            { \
  |  | 2426|  6.63k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  6.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  6.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  6.63k|                return lexer->token; \
  |  | 2428|  6.63k|            }
  ------------------
 2840|       |
 2841|       |                    /* lexer->txtstart = lexer->lexsize; missing here? */
 2842|  1.55k|                    continue;       /* no text so keep going */
 2843|  8.18k|                }
 2844|       |
 2845|       |                /* otherwise treat as CDATA */
 2846|       |                /* fix for bug 762102 (486) */
 2847|       |                /* Issue #384 - Fix skipping parsing character, particularly '<<' */
 2848|   998k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   998k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   998k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2849|   998k|                lexer->lexsize -= 1;
 2850|   998k|                lexer->state = LEX_CONTENT;
 2851|   998k|                lexer->waswhite = no;
 2852|   998k|                continue;
 2853|       |
 2854|    212|            case LEX_ENDTAG:  /* </letter */
  ------------------
  |  Branch (2854:13): [True: 212, False: 125M]
  ------------------
 2855|    212|                lexer->txtstart = lexer->lexsize - 1;
 2856|    212|                doc->docIn->curcol += 2;
 2857|    212|                c = ParseTagName( doc );
 2858|    212|                lexer->token = TagToken( doc, EndTag );  /* create endtag token */
 2859|    212|                lexer->lexsize = lexer->txtend = lexer->txtstart;
 2860|       |
 2861|       |                /* skip to '>' */
 2862|  14.2k|                while ( c != '>' && c != EndOfStream )
  ------------------
  |  | 1064|  14.0k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2862:25): [True: 14.0k, False: 212]
  |  Branch (2862:37): [True: 14.0k, False: 0]
  ------------------
 2863|  14.0k|                {
 2864|  14.0k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  14.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2865|  14.0k|                }
 2866|       |
 2867|    212|                if (c == EndOfStream)
  ------------------
  |  | 1064|    212|#define EndOfStream (~0u)
  ------------------
  |  Branch (2867:21): [True: 0, False: 212]
  ------------------
 2868|      0|                {
 2869|      0|                    TY_(FreeNode)( doc, lexer->token );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2870|      0|                    continue;
 2871|      0|                }
 2872|       |
 2873|    212|                lexer->state = LEX_CONTENT;
 2874|    212|                lexer->waswhite = no;
 2875|    212|                node = lexer->token;
 2876|    212|                GTDBG(doc,"endtag", node);
 2877|    212|                return node;  /* the endtag token */
 2878|       |
 2879|  8.18k|            case LEX_STARTTAG: /* first letter of tagname */
  ------------------
  |  Branch (2879:13): [True: 8.18k, False: 125M]
  ------------------
 2880|  8.18k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  8.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2881|  8.18k|                ChangeChar(lexer, (tmbchar)c);
 2882|  8.18k|                lexer->txtstart = lexer->lexsize - 1; /* set txtstart to first letter */
 2883|  8.18k|                c = ParseTagName( doc );
 2884|  8.18k|                isempty = no;
 2885|  8.18k|                attributes = NULL;
 2886|  8.18k|                lexer->token = TagToken( doc, StartTag ); /* [i_a]2 'isempty' is always false, thanks to code 2 lines above */
 2887|       |
 2888|       |                /* parse attributes, consuming closing ">" */
 2889|  8.18k|                if (c != '>')
  ------------------
  |  Branch (2889:21): [True: 8.14k, False: 41]
  ------------------
 2890|  8.14k|                {
 2891|  8.14k|                    if (c == '/')
  ------------------
  |  Branch (2891:25): [True: 627, False: 7.51k]
  ------------------
 2892|    627|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    627|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    627|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2893|       |
 2894|  8.14k|                    attributes = ParseAttrs( doc, &isempty );
 2895|  8.14k|                }
 2896|       |
 2897|  8.18k|                if (isempty)
  ------------------
  |  Branch (2897:21): [True: 0, False: 8.18k]
  ------------------
 2898|      0|                    lexer->token->type = StartEndTag;
 2899|       |
 2900|  8.18k|                lexer->token->attributes = attributes;
 2901|  8.18k|                lexer->lexsize = lexer->txtend = lexer->txtstart;
 2902|       |
 2903|       |                /* swallow newline following start tag */
 2904|       |                /* special check needed for CRLF sequence */
 2905|       |                /* this doesn't apply to empty elements */
 2906|       |                /* nor to preformatted content that needs escaping */
 2907|       |                /*\
 2908|       |                 * Issue #230: Need to KEEP this user newline character in certain 
 2909|       |                 * circumstances, certainly for <pre>, <script>, <style>...
 2910|       |                 * Any others?
 2911|       |                 * Issue #238: maybe **ONLY** for <pre>
 2912|       |                \*/
 2913|  8.18k|                if ( nodeIsPRE(lexer->token) )
  ------------------
  |  |  383|  8.18k|#define nodeIsPRE( node )        TagIsId( node, TidyTag_PRE )
  |  |  ------------------
  |  |  |  |  275|  8.18k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.18k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.18k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 8.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2914|      0|                {
 2915|      0|                    mode = Preformatted;
 2916|      0|                }
 2917|       |
 2918|  8.18k|                if ((mode != Preformatted && ExpectsContent(lexer->token))
  ------------------
  |  Branch (2918:22): [True: 8.18k, False: 2]
  |  Branch (2918:46): [True: 8.18k, False: 0]
  ------------------
 2919|  8.18k|                    || nodeIsBR(lexer->token) || nodeIsHR(lexer->token))
  ------------------
  |  |  400|      2|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  8.18k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  || nodeIsBR(lexer->token) || nodeIsHR(lexer->token))
  ------------------
  |  |  380|      2|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|      2|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 2]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2920|  8.18k|                {
 2921|  8.18k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  8.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2922|       |
 2923|  8.18k|                    if ((c == '\n') && (mode != IgnoreWhitespace)) /* Issue #329 - Can NOT afford to lose this newline */
  ------------------
  |  Branch (2923:25): [True: 2, False: 8.18k]
  |  Branch (2923:40): [True: 0, False: 2]
  ------------------
 2924|      0|                        TY_(UngetChar)(c, doc->docIn);  /* Issue #329 - make sure the newline is maintained for now */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2925|  8.18k|                    else if (c != '\n' && c != '\f')
  ------------------
  |  Branch (2925:30): [True: 8.18k, False: 2]
  |  Branch (2925:43): [True: 8.18k, False: 0]
  ------------------
 2926|  8.18k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  8.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2927|       |
 2928|  8.18k|                    lexer->waswhite = yes;  /* to swallow leading whitespace */
 2929|  8.18k|                }
 2930|      2|                else
 2931|      2|                    lexer->waswhite = no;
 2932|       |
 2933|  8.18k|                lexer->state = LEX_CONTENT;
 2934|  8.18k|                if (lexer->token->tag == NULL) 
  ------------------
  |  Branch (2934:21): [True: 0, False: 8.18k]
  ------------------
 2935|      0|                {
 2936|      0|                    if (mode != OtherNamespace) /* [i_a]2 only issue warning if NOT 'OtherNamespace', and tag null */
  ------------------
  |  Branch (2936:25): [True: 0, False: 0]
  ------------------
 2937|      0|                    {
 2938|       |                        /* Special case for HTML5 unknown tags: if it looks 
 2939|       |                           like an autonomous custom tag, then emit a variation
 2940|       |                           of the standard message. We don't want to do this
 2941|       |                           for older HTML, because it's not truly supported
 2942|       |                           by the standard, although Tidy will allow it. */
 2943|      0|                        if ( (doc->lexer->doctype & VERS_HTML5) > 0 && TY_(elementIsAutonomousCustomFormat)( lexer->token->element ) )
  ------------------
  |  |  213|      0|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|      0|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|      0|#define XH50              262144u
  |  |  ------------------
  ------------------
                                      if ( (doc->lexer->doctype & VERS_HTML5) > 0 && TY_(elementIsAutonomousCustomFormat)( lexer->token->element ) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2943:30): [True: 0, False: 0]
  |  Branch (2943:72): [True: 0, False: 0]
  ------------------
 2944|      0|                            TY_(Report)( doc, NULL, lexer->token, UNKNOWN_ELEMENT_LOOKS_CUSTOM );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2945|      0|                        else
 2946|      0|                            TY_(Report)( doc, NULL, lexer->token, UNKNOWN_ELEMENT );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2947|      0|                    }
 2948|      0|                }
 2949|  8.18k|                else if ( !cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  8.18k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  8.18k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2949:27): [True: 0, False: 8.18k]
  ------------------
 2950|      0|                {
 2951|      0|                    TY_(ConstrainVersion)( doc, lexer->token->tag->versions );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2952|      0|                    TY_(RepairDuplicateAttributes)( doc, lexer->token, no );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2953|      0|                } else 
 2954|  8.18k|                    TY_(RepairDuplicateAttributes)( doc, lexer->token, yes );
  ------------------
  |  |   23|  8.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2955|  8.18k|                node = lexer->token;
 2956|  8.18k|                GTDBG(doc,"starttag", node);
 2957|  8.18k|                return node;  /* return start tag */
 2958|       |
 2959|  2.57M|            case LEX_COMMENT:  /* seen <!-- so look for --> */
  ------------------
  |  Branch (2959:13): [True: 2.57M, False: 123M]
  ------------------
 2960|       |
 2961|  2.57M|                if (c != '-')
  ------------------
  |  Branch (2961:21): [True: 2.22M, False: 355k]
  ------------------
 2962|  2.22M|                    continue;
 2963|       |
 2964|   355k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   355k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   355k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2965|       |
 2966|       |                /* Fix hyphens at beginning of tag */
 2967|   355k|                if ( c != '-' && fixComments && lexer->lexsize - lexer->txtstart == 1 )
  ------------------
  |  Branch (2967:22): [True: 318k, False: 36.6k]
  |  Branch (2967:34): [True: 318k, False: 0]
  |  Branch (2967:49): [True: 0, False: 318k]
  ------------------
 2968|      0|                {
 2969|      0|                    lexer->lexbuf[lexer->lexsize - 1] = '=';
 2970|      0|                }
 2971|       |
 2972|   355k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   355k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   355k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2973|       |
 2974|   355k|                if (c != '-')
  ------------------
  |  Branch (2974:21): [True: 318k, False: 36.6k]
  ------------------
 2975|   318k|                    continue;
 2976|       |
 2977|   854k|            end_comment:
 2978|   854k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   854k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   854k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2979|       |
 2980|   854k|                if (c == '>')
  ------------------
  |  Branch (2980:21): [True: 0, False: 854k]
  ------------------
 2981|      0|                {
 2982|      0|                    if (badcomment)
  ------------------
  |  Branch (2982:25): [True: 0, False: 0]
  ------------------
 2983|      0|                    {
 2984|       |                        /*
 2985|       |                           We've got bad comments that we either fixed or
 2986|       |                           ignored; provide proper user feedback based on
 2987|       |                           doctype and whether or not we fixed them.
 2988|       |                         */
 2989|      0|                        if ( (TY_(HTMLVersion)(doc) & HT50) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                      if ( (TY_(HTMLVersion)(doc) & HT50) )
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
  |  Branch (2989:30): [True: 0, False: 0]
  ------------------
 2990|      0|                        {
 2991|      0|                            if ( fixComments )
  ------------------
  |  Branch (2991:34): [True: 0, False: 0]
  ------------------
 2992|      0|                                TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2993|       |                            /* Otherwise for HTML5, it's safe to ignore. */
 2994|      0|                        }
 2995|      0|                        else
 2996|      0|                        {
 2997|      0|                            if ( fixComments )
  ------------------
  |  Branch (2997:34): [True: 0, False: 0]
  ------------------
 2998|      0|                                TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2999|      0|                            else
 3000|      0|                                TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_WARN );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3001|      0|                        }
 3002|      0|                    }
 3003|       |
 3004|       |                    /* do not store closing -- in lexbuf */
 3005|      0|                    lexer->lexsize -= 2;
 3006|      0|                    lexer->txtend = lexer->lexsize;
 3007|      0|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3008|      0|                    lexer->state = LEX_CONTENT;
 3009|      0|                    lexer->waswhite = no;
 3010|      0|                    lexer->token = CommentToken(doc);
  ------------------
  |  | 1611|      0|#define CommentToken(doc) NewToken(doc, CommentTag)
  ------------------
 3011|       |
 3012|       |                    /* now look for a line break */
 3013|       |
 3014|      0|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3015|       |
 3016|      0|                    if (c == '\n')
  ------------------
  |  Branch (3016:25): [True: 0, False: 0]
  ------------------
 3017|      0|                        lexer->token->linebreak = yes;
 3018|      0|                    else
 3019|      0|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3020|       |
 3021|      0|                    node = lexer->token;
 3022|      0|                    GTDBG(doc,"comment", node);
 3023|      0|                    return node;
 3024|      0|                }
 3025|       |
 3026|       |                /* note position of first such error in the comment */
 3027|   854k|                if (!badcomment)
  ------------------
  |  Branch (3027:21): [True: 5, False: 854k]
  ------------------
 3028|      5|                {
 3029|      5|                    SetLexerLocus( doc, lexer );
 3030|      5|                    lexer->columns -= 3;
 3031|      5|                }
 3032|       |
 3033|   854k|                badcomment++;
 3034|       |
 3035|       |                /* fix hyphens in the middle */
 3036|   854k|                if ( fixComments )
  ------------------
  |  Branch (3036:22): [True: 854k, False: 0]
  ------------------
 3037|   854k|                    lexer->lexbuf[lexer->lexsize - 2] = '=';
 3038|       |
 3039|       |                /* if '-' then look for '>' to end the comment */
 3040|   854k|                if (c == '-')
  ------------------
  |  Branch (3040:21): [True: 817k, False: 36.6k]
  ------------------
 3041|   817k|                {
 3042|   817k|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   817k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   817k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3043|   817k|                    goto end_comment;
 3044|   817k|                }
 3045|       |
 3046|       |                /* fix hyphens end, and continue to look for --> */
 3047|  36.6k|                if ( fixComments )
  ------------------
  |  Branch (3047:22): [True: 36.6k, False: 0]
  ------------------
 3048|  36.6k|                    lexer->lexbuf[lexer->lexsize - 1] = '=';
 3049|       |
 3050|       |                /* http://tidy.sf.net/bug/1266647 */
 3051|  36.6k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  36.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3052|       |
 3053|  36.6k|                continue; 
 3054|       |
 3055|  28.7k|            case LEX_DOCTYPE:  /* seen <!d so look for '>' munging whitespace */
  ------------------
  |  Branch (3055:13): [True: 28.7k, False: 125M]
  ------------------
 3056|       |
 3057|       |                /* use ParseDocTypeDecl() to tokenize doctype declaration */
 3058|  28.7k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  28.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3059|  28.7k|                lexer->lexsize -= 1;
 3060|  28.7k|                lexer->token = ParseDocTypeDecl(doc);
 3061|       |
 3062|  28.7k|                lexer->txtend = lexer->lexsize;
 3063|  28.7k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3064|  28.7k|                lexer->state = LEX_CONTENT;
 3065|  28.7k|                lexer->waswhite = no;
 3066|       |
 3067|       |                /* make a note of the version named by the 1st doctype */
 3068|  28.7k|                if (lexer->doctype == VERS_UNKNOWN && lexer->token && !cfgBool(doc, TidyXmlTags))
  ------------------
  |  |  204|  57.5k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  28.7k|#define xxxx                   0u
  |  |  ------------------
  ------------------
                              if (lexer->doctype == VERS_UNKNOWN && lexer->token && !cfgBool(doc, TidyXmlTags))
  ------------------
  |  |  418|  28.7k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  28.7k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (3068:21): [True: 28.7k, False: 0]
  |  Branch (3068:55): [True: 28.7k, False: 49]
  |  Branch (3068:71): [True: 0, False: 28.7k]
  ------------------
 3069|      0|                {
 3070|      0|                    lexer->doctype = FindGivenVersion(doc, lexer->token);
 3071|      0|                    if (lexer->doctype != VERS_HTML5)
  ------------------
  |  |  213|      0|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|      0|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|      0|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (3071:25): [True: 0, False: 0]
  ------------------
 3072|      0|                    {
 3073|       |                        /*\
 3074|       |                         *  Back to legacy HTML4 mode for -
 3075|       |                         *  Issue #167 & #169 - TidyTag_A
 3076|       |                         *  Issue #196        - TidyTag_CAPTION
 3077|       |                         *  others?
 3078|       |                        \*/ 
 3079|      0|                        TY_(AdjustTags)(doc); /* Dynamically modify the tags table  */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3080|      0|                    }
 3081|      0|                }
 3082|  28.7k|                node = lexer->token;
 3083|  28.7k|                GTDBG(doc,"doctype", node);
 3084|  28.7k|                return node;
 3085|       |
 3086|  46.2M|            case LEX_PROCINSTR:  /* seen <? so look for '>' */
  ------------------
  |  Branch (3086:13): [True: 46.2M, False: 79.4M]
  ------------------
 3087|       |                /* check for PHP preprocessor instructions <?php ... ?> */
 3088|       |
 3089|  46.2M|                if  (lexer->lexsize - lexer->txtstart == 3)
  ------------------
  |  Branch (3089:22): [True: 149, False: 46.2M]
  ------------------
 3090|    149|                {
 3091|    149|                    if (TY_(tmbstrncmp)(lexer->lexbuf + lexer->txtstart, "php", 3) == 0)
  ------------------
  |  |   23|    149|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    149|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3091:25): [True: 0, False: 149]
  ------------------
 3092|      0|                    {
 3093|      0|                        lexer->state = LEX_PHP;
 3094|      0|                        continue;
 3095|      0|                    }
 3096|    149|                }
 3097|       |
 3098|  46.2M|                if  (lexer->lexsize - lexer->txtstart == 4)
  ------------------
  |  Branch (3098:22): [True: 134, False: 46.2M]
  ------------------
 3099|    134|                {
 3100|    134|                    if (TY_(tmbstrncmp)(lexer->lexbuf + lexer->txtstart, "xml", 3) == 0 &&
  ------------------
  |  |   23|    134|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    134|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3100:25): [True: 132, False: 2]
  ------------------
 3101|    132|                        TY_(IsWhite)(lexer->lexbuf[lexer->txtstart + 3]))
  ------------------
  |  |   23|    132|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    132|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3101:25): [True: 117, False: 15]
  ------------------
 3102|    117|                    {
 3103|    117|                        lexer->state = LEX_XMLDECL;
 3104|    117|                        attributes = NULL;
 3105|    117|                        continue;
 3106|    117|                    }
 3107|    134|                }
 3108|       |
 3109|  46.2M|                if (cfgBool(doc, TidyXmlPIs) || lexer->isvoyager) /* insist on ?> as terminator */
  ------------------
  |  |  418|  92.4M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  46.2M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 46.2M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (3109:49): [True: 0, False: 0]
  ------------------
 3110|  46.2M|                {
 3111|  46.2M|                    if (c != '?')
  ------------------
  |  Branch (3111:25): [True: 46.2M, False: 114]
  ------------------
 3112|  46.2M|                        continue;
 3113|       |
 3114|       |                    /* now look for '>' */
 3115|    114|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    114|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    114|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3116|       |
 3117|    114|                    if (c == EndOfStream)
  ------------------
  |  | 1064|    114|#define EndOfStream (~0u)
  ------------------
  |  Branch (3117:25): [True: 0, False: 114]
  ------------------
 3118|      0|                    {
 3119|      0|                        TY_(Report)(doc, NULL, NULL, UNEXPECTED_END_OF_FILE );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3120|      0|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3121|      0|                        continue;
 3122|      0|                    }
 3123|       |
 3124|    114|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|    114|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    114|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3125|    114|                }
 3126|       |
 3127|       |
 3128|    114|                if (c != '>')
  ------------------
  |  Branch (3128:21): [True: 99, False: 15]
  ------------------
 3129|     99|                    continue;
 3130|       |
 3131|     15|                lexer->lexsize -= 1;
 3132|       |
 3133|     15|                if (lexer->lexsize)
  ------------------
  |  Branch (3133:21): [True: 15, False: 0]
  ------------------
 3134|     15|                {
 3135|     15|                    uint i;
 3136|     15|                    Bool closed;
 3137|       |
 3138|    105|                    for (i = 0; i < lexer->lexsize - lexer->txtstart &&
  ------------------
  |  Branch (3138:33): [True: 105, False: 0]
  ------------------
 3139|    105|                        !TY_(IsWhite)(lexer->lexbuf[i + lexer->txtstart]); ++i)
  ------------------
  |  |   23|    105|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    105|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3139:25): [True: 90, False: 15]
  ------------------
 3140|     90|                        /**/;
 3141|       |
 3142|     15|                    closed = lexer->lexbuf[lexer->lexsize - 1] == '?';
 3143|       |
 3144|     15|                    if (closed)
  ------------------
  |  Branch (3144:25): [True: 15, False: 0]
  ------------------
 3145|     15|                        lexer->lexsize -= 1;
 3146|       |
 3147|     15|                    lexer->txtstart += i;
 3148|     15|                    lexer->txtend = lexer->lexsize;
 3149|     15|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3150|       |
 3151|     15|                    lexer->token = PIToken(doc);
  ------------------
  |  | 1613|     15|#define PIToken(doc)      NewToken(doc, ProcInsTag)
  ------------------
 3152|     15|                    lexer->token->closed = closed;
 3153|     15|                    lexer->token->element = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|     15|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     15|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3154|     15|                                                            lexer->lexbuf +
 3155|     15|                                                            lexer->txtstart - i, i);
 3156|     15|                }
 3157|      0|                else
 3158|      0|                {
 3159|      0|                    lexer->txtend = lexer->lexsize;
 3160|      0|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3161|      0|                    lexer->token = PIToken(doc);
  ------------------
  |  | 1613|      0|#define PIToken(doc)      NewToken(doc, ProcInsTag)
  ------------------
 3162|      0|                }
 3163|       |
 3164|     15|                lexer->state = LEX_CONTENT;
 3165|     15|                lexer->waswhite = no;
 3166|     15|                node = lexer->token;
 3167|     15|                GTDBG(doc,"procinstr", node);
 3168|     15|                return node;
 3169|       |
 3170|  3.06M|            case LEX_ASP:  /* seen <% so look for "%>" */
  ------------------
  |  Branch (3170:13): [True: 3.06M, False: 122M]
  ------------------
 3171|  3.06M|                if (c != '%')
  ------------------
  |  Branch (3171:21): [True: 3.06M, False: 60]
  ------------------
 3172|  3.06M|                    continue;
 3173|       |
 3174|       |                /* now look for '>' */
 3175|     60|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|     60|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     60|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3176|       |
 3177|       |
 3178|     60|                if (c != '>')
  ------------------
  |  Branch (3178:21): [True: 17, False: 43]
  ------------------
 3179|     17|                {
 3180|     17|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     17|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     17|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3181|     17|                    continue;
 3182|     17|                }
 3183|       |
 3184|     43|                lexer->lexsize -= 1;
 3185|     43|                lexer->txtend = lexer->lexsize;
 3186|     43|                lexer->lexbuf[lexer->lexsize] = '\0';
 3187|     43|                lexer->state = LEX_CONTENT;
 3188|     43|                lexer->waswhite = no;
 3189|     43|                lexer->token = AspToken(doc);
  ------------------
  |  | 1614|     43|#define AspToken(doc)     NewToken(doc, AspTag)
  ------------------
 3190|     43|                node = lexer->token;
 3191|     43|                GTDBG(doc,"ASP", node);
 3192|     43|                return node;  /* the endtag token */
 3193|       |
 3194|       |
 3195|       |
 3196|    243|            case LEX_JSTE:  /* seen <# so look for "#>" */
  ------------------
  |  Branch (3196:13): [True: 243, False: 125M]
  ------------------
 3197|    243|                if (c != '#')
  ------------------
  |  Branch (3197:21): [True: 240, False: 3]
  ------------------
 3198|    240|                    continue;
 3199|       |
 3200|       |                /* now look for '>' */
 3201|      3|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|      3|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      3|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3202|       |
 3203|       |
 3204|      3|                if (c != '>')
  ------------------
  |  Branch (3204:21): [True: 0, False: 3]
  ------------------
 3205|      0|                {
 3206|      0|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3207|      0|                    continue;
 3208|      0|                }
 3209|       |
 3210|      3|                lexer->lexsize -= 1;
 3211|      3|                lexer->txtend = lexer->lexsize;
 3212|      3|                lexer->lexbuf[lexer->lexsize] = '\0';
 3213|      3|                lexer->state = LEX_CONTENT;
 3214|      3|                lexer->waswhite = no;
 3215|      3|                lexer->token = JsteToken(doc);
  ------------------
  |  | 1615|      3|#define JsteToken(doc)    NewToken(doc, JsteTag)
  ------------------
 3216|      3|                node = lexer->token;
 3217|      3|                GTDBG(doc,"JSTE", node);
 3218|      3|                return node;  /* the JSTE token */
 3219|       |
 3220|       |
 3221|      0|            case LEX_PHP: /* seen "<?php" so look for "?>" */
  ------------------
  |  Branch (3221:13): [True: 0, False: 125M]
  ------------------
 3222|      0|                if (c != '?')
  ------------------
  |  Branch (3222:21): [True: 0, False: 0]
  ------------------
 3223|      0|                    continue;
 3224|       |
 3225|       |                /* now look for '>' */
 3226|      0|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3227|       |
 3228|      0|                if (c != '>')
  ------------------
  |  Branch (3228:21): [True: 0, False: 0]
  ------------------
 3229|      0|                {
 3230|      0|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3231|      0|                    continue;
 3232|      0|                }
 3233|       |
 3234|      0|                lexer->lexsize -= 1;
 3235|      0|                lexer->txtend = lexer->lexsize;
 3236|      0|                lexer->lexbuf[lexer->lexsize] = '\0';
 3237|      0|                lexer->state = LEX_CONTENT;
 3238|      0|                lexer->waswhite = no;
 3239|      0|                lexer->token = PhpToken(doc);
  ------------------
  |  | 1616|      0|#define PhpToken(doc)     NewToken(doc, PhpTag)
  ------------------
 3240|      0|                node = lexer->token;
 3241|      0|                GTDBG(doc,"PHP", node);
 3242|      0|                return node;  /* the PHP token */
 3243|       |
 3244|    218|            case LEX_XMLDECL: /* seen "<?xml" so look for "?>" */
  ------------------
  |  Branch (3244:13): [True: 218, False: 125M]
  ------------------
 3245|       |
 3246|    218|                if (TY_(IsWhite)(c) && c != '?')
  ------------------
  |  |   23|    218|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    218|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3246:21): [True: 1, False: 217]
  |  Branch (3246:40): [True: 1, False: 0]
  ------------------
 3247|      1|                    continue;
 3248|       |
 3249|       |                /* get pseudo-attribute */
 3250|    217|                if (c != '?')
  ------------------
  |  Branch (3250:21): [True: 174, False: 43]
  ------------------
 3251|    174|                {
 3252|    174|                    tmbstr name;
 3253|    174|                    Node *asp, *php;
 3254|    174|                    AttVal *av = NULL;
 3255|    174|                    int pdelim = 0;
 3256|    174|                    isempty = no;
 3257|       |
 3258|    174|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    174|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    174|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3259|       |
 3260|    174|                    name = ParseAttribute( doc, &isempty, &asp, &php );
 3261|       |
 3262|    174|                    if (!name)
  ------------------
  |  Branch (3262:25): [True: 98, False: 76]
  ------------------
 3263|     98|                    {
 3264|       |                        /* check if attributes are created by ASP markup */
 3265|     98|                        if (asp)
  ------------------
  |  Branch (3265:29): [True: 43, False: 55]
  ------------------
 3266|     43|                        {
 3267|     43|                            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|     43|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     43|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3268|     43|                            av->asp = asp;
 3269|     43|                            AddAttrToList( &attributes, av ); 
 3270|     43|                        }
 3271|       |
 3272|       |                        /* check if attributes are created by PHP markup */
 3273|     98|                        if (php)
  ------------------
  |  Branch (3273:29): [True: 32, False: 66]
  ------------------
 3274|     32|                        {
 3275|     32|                            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|     32|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     32|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3276|     32|                            av->php = php;
 3277|     32|                            AddAttrToList( &attributes, av ); 
 3278|     32|                        }
 3279|       |                      
 3280|       |                        /* fix for http://tidy.sf.net/bug/788031 */
 3281|     98|                        lexer->lexsize -= 1;
 3282|     98|                        lexer->txtend = lexer->txtstart;
 3283|     98|                        lexer->lexbuf[lexer->txtend] = '\0';
 3284|     98|                        lexer->state = LEX_CONTENT;
 3285|     98|                        lexer->waswhite = no;
 3286|     98|                        lexer->token = XmlDeclToken(doc);
  ------------------
  |  | 1617|     98|#define XmlDeclToken(doc) NewToken(doc, XmlDecl)
  ------------------
 3287|     98|                        lexer->token->attributes = attributes;
 3288|     98|                        node = lexer->token;
 3289|     98|                        GTDBG(doc,"xml", node);
 3290|     98|                        return node;  /* the xml token */
 3291|     98|                    }
 3292|       |
 3293|     76|                    av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|     76|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     76|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3294|     76|                    av->attribute = name;
 3295|     76|                    av->value = ParseValue( doc, name, yes, &isempty, &pdelim );
 3296|     76|                    av->delim = pdelim;
 3297|     76|                    av->dict = TY_(FindAttribute)( doc, av );
  ------------------
  |  |   23|     76|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     76|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3298|       |
 3299|     76|                    AddAttrToList( &attributes, av );
 3300|       |                    /* continue; */
 3301|     76|                }
 3302|       |
 3303|       |                /* now look for '>' */
 3304|    119|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    119|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    119|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3305|       |
 3306|    119|                if (c != '>')
  ------------------
  |  Branch (3306:21): [True: 100, False: 19]
  ------------------
 3307|    100|                {
 3308|    100|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    100|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    100|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3309|    100|                    continue;
 3310|    100|                }
 3311|     19|                lexer->lexsize -= 1;
 3312|     19|                lexer->txtend = lexer->txtstart;
 3313|     19|                lexer->lexbuf[lexer->txtend] = '\0';
 3314|     19|                lexer->state = LEX_CONTENT;
 3315|     19|                lexer->waswhite = no;
 3316|     19|                lexer->token = XmlDeclToken(doc);
  ------------------
  |  | 1617|     19|#define XmlDeclToken(doc) NewToken(doc, XmlDecl)
  ------------------
 3317|     19|                lexer->token->attributes = attributes;
 3318|     19|                node = lexer->token;
 3319|     19|                GTDBG(doc,"XML", node);
 3320|     19|                return node;  /* the XML token */
 3321|       |
 3322|  2.16M|            case LEX_SECTION: /* seen "<![" so look for "]>" */
  ------------------
  |  Branch (3322:13): [True: 2.16M, False: 123M]
  ------------------
 3323|  2.16M|                if (c == '[')
  ------------------
  |  Branch (3323:21): [True: 1.88k, False: 2.16M]
  ------------------
 3324|  1.88k|                {
 3325|  1.88k|                    if (lexer->lexsize == (lexer->txtstart + 6) &&
  ------------------
  |  Branch (3325:25): [True: 0, False: 1.88k]
  ------------------
 3326|      0|                        TY_(tmbstrncmp)(lexer->lexbuf+lexer->txtstart, "CDATA[", 6) == 0)
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3326:25): [True: 0, False: 0]
  ------------------
 3327|      0|                    {
 3328|      0|                        lexer->state = LEX_CDATA;
 3329|      0|                        lexer->lexsize -= 6;
 3330|      0|                        continue;
 3331|      0|                    }
 3332|  1.88k|                }
 3333|       |
 3334|  2.16M|                if (c == '>')
  ------------------
  |  Branch (3334:21): [True: 363, False: 2.16M]
  ------------------
 3335|    363|                {
 3336|       |                    /* Is. #462 - reached '>' before ']' */
 3337|    363|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    363|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    363|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3338|  2.16M|                } else if (c != ']')
  ------------------
  |  Branch (3338:28): [True: 2.16M, False: 663]
  ------------------
 3339|  2.16M|                    continue;
 3340|       |
 3341|       |                /* now look for '>' */
 3342|  1.02k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3343|       |
 3344|  1.02k|                lexdump = 1;
 3345|  1.02k|                if (c != '>')
  ------------------
  |  Branch (3345:21): [True: 663, False: 363]
  ------------------
 3346|    663|                {
 3347|       |                    /* Issue #153 - can also be ]'-->' */
 3348|    663|                    if (c == '-') 
  ------------------
  |  Branch (3348:25): [True: 47, False: 616]
  ------------------
 3349|     47|                    {
 3350|     47|                        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|     47|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     47|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3351|     47|                        if (c == '-')
  ------------------
  |  Branch (3351:29): [True: 47, False: 0]
  ------------------
 3352|     47|                        {
 3353|     47|                            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|     47|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     47|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3354|     47|                            if (c != '>')
  ------------------
  |  Branch (3354:33): [True: 47, False: 0]
  ------------------
 3355|     47|                            {
 3356|     47|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     47|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     47|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3357|     47|                                TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|     47|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     47|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3358|     47|                                TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|     47|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     47|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3359|     47|                                continue;
 3360|     47|                            }
 3361|       |                            /* this failed!
 3362|       |                               TY_(AddCharToLexer)(lexer, '-'); TY_(AddCharToLexer)(lexer, '-'); lexdump = 0; 
 3363|       |                               got output <![endif]--]> - needs further fix in pprint section output
 3364|       |                             */
 3365|     47|                        }
 3366|      0|                        else
 3367|      0|                        {
 3368|      0|                            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3369|      0|                            TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3370|      0|                            continue;
 3371|      0|                        }
 3372|     47|                    } 
 3373|    616|                    else 
 3374|    616|                    {
 3375|    616|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    616|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    616|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3376|    616|                        continue;
 3377|    616|                    }
 3378|    663|                }
 3379|       | 
 3380|    363|                lexer->lexsize -= lexdump;
 3381|    363|                lexer->txtend = lexer->lexsize;
 3382|    363|                lexer->lexbuf[lexer->lexsize] = '\0';
 3383|    363|                lexer->state = LEX_CONTENT;
 3384|    363|                lexer->waswhite = no;
 3385|    363|                lexer->token = SectionToken(doc);
  ------------------
  |  | 1618|    363|#define SectionToken(doc) NewToken(doc, SectionTag)
  ------------------
 3386|    363|                node = lexer->token;
 3387|    363|                GTDBG(doc,"SECTION", node);
 3388|    363|                return node;  /* the SECTION token */
 3389|       |
 3390|      0|            case LEX_CDATA: /* seen "<![CDATA[" so look for "]]>" */
  ------------------
  |  Branch (3390:13): [True: 0, False: 125M]
  ------------------
 3391|      0|                if (c != ']')
  ------------------
  |  Branch (3391:21): [True: 0, False: 0]
  ------------------
 3392|      0|                    continue;
 3393|       |
 3394|       |                /* now look for ']' */
 3395|      0|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3396|       |
 3397|      0|                if (c != ']')
  ------------------
  |  Branch (3397:21): [True: 0, False: 0]
  ------------------
 3398|      0|                {
 3399|      0|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3400|      0|                    continue;
 3401|      0|                }
 3402|       |
 3403|       |                /* now look for '>' */
 3404|      0|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3405|       |
 3406|      0|                if (c != '>')
  ------------------
  |  Branch (3406:21): [True: 0, False: 0]
  ------------------
 3407|      0|                {
 3408|      0|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3409|      0|                    TY_(UngetChar)(']', doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3410|      0|                    continue;
 3411|      0|                }
 3412|       |
 3413|      0|                lexer->lexsize -= 1;
 3414|      0|                lexer->txtend = lexer->lexsize;
 3415|      0|                lexer->lexbuf[lexer->lexsize] = '\0';
 3416|      0|                lexer->state = LEX_CONTENT;
 3417|      0|                lexer->waswhite = no;
 3418|      0|                lexer->token = CDATAToken(doc);
  ------------------
  |  | 1619|      0|#define CDATAToken(doc)   NewToken(doc, CDATATag)
  ------------------
 3419|      0|                node = lexer->token;
 3420|      0|                GTDBG(doc,"CDATA", node);
 3421|      0|                return node;  /* the CDATA token */
 3422|   125M|        }
 3423|   125M|    }
 3424|       |
 3425|  8.35k|    if (lexer->state == LEX_CONTENT)  /* text string */
  ------------------
  |  Branch (3425:9): [True: 8.21k, False: 139]
  ------------------
 3426|  8.21k|    {
 3427|  8.21k|        lexer->txtend = lexer->lexsize;
 3428|       |
 3429|  8.21k|        if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3429:13): [True: 23, False: 8.19k]
  ------------------
 3430|     23|        {
 3431|     23|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     23|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     23|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3432|       |
 3433|     23|            if (lexer->lexbuf[lexer->lexsize - 1] == ' ')
  ------------------
  |  Branch (3433:17): [True: 5, False: 18]
  ------------------
 3434|      5|            {
 3435|      5|                lexer->lexsize -= 1;
 3436|      5|                lexer->txtend = lexer->lexsize;
 3437|      5|            }
 3438|     23|            lexer->token = TY_(TextToken)(lexer);
  ------------------
  |  |   23|     23|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     23|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3439|     23|            node = lexer->token;
 3440|     23|            GTDBG(doc,"textstring", node);
 3441|     23|            return node;  /* the textstring token */
 3442|     23|        }
 3443|  8.21k|    }
 3444|    139|    else if (lexer->state == LEX_COMMENT) /* comment */
  ------------------
  |  Branch (3444:14): [True: 5, False: 134]
  ------------------
 3445|      5|    {
 3446|      5|        if (c == EndOfStream)
  ------------------
  |  | 1064|      5|#define EndOfStream (~0u)
  ------------------
  |  Branch (3446:13): [True: 5, False: 0]
  ------------------
 3447|      5|        {
 3448|       |            /* We print this if we reached end of the stream mid-comment. */
 3449|      5|            TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_EOS );
  ------------------
  |  |   23|      5|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      5|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3450|      5|        }
 3451|       |
 3452|      5|        lexer->txtend = lexer->lexsize;
 3453|      5|        lexer->lexbuf[lexer->lexsize] = '\0';
 3454|      5|        lexer->state = LEX_CONTENT;
 3455|      5|        lexer->waswhite = no;
 3456|      5|        lexer->token = CommentToken(doc);
  ------------------
  |  | 1611|      5|#define CommentToken(doc) NewToken(doc, CommentTag)
  ------------------
 3457|      5|        node = lexer->token;
 3458|      5|        GTDBG(doc,"COMMENT", node);
 3459|      5|        return node;  /* the COMMENT token */
 3460|      5|    }
 3461|       |
 3462|       |    /* check attributes before return NULL */
 3463|  8.33k|    if (attributes)
  ------------------
  |  Branch (3463:9): [True: 0, False: 8.33k]
  ------------------
 3464|      0|        TY_(FreeAttribute)( doc, attributes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3465|       |
 3466|  8.33k|    DEBUG_LOG(SPRTF("Returning NULL...\n"));
 3467|       |    return NULL;
 3468|  8.35k|}
lexer.c:ChangeChar:
  966|  31.2k|{
  967|  31.2k|    if ( lexer->lexsize > 0 )
  ------------------
  |  Branch (967:10): [True: 31.2k, False: 0]
  ------------------
  968|  31.2k|    {
  969|  31.2k|        lexer->lexbuf[ lexer->lexsize-1 ] = c;
  970|  31.2k|    }
  971|  31.2k|}
lexer.c:ParseEntity:
 1157|  9.56k|{
 1158|  9.56k|    typedef enum
 1159|  9.56k|    {
 1160|  9.56k|        ENT_default,
 1161|  9.56k|        ENT_numdec,
 1162|  9.56k|        ENT_numhex
 1163|  9.56k|    } ENTState;
 1164|       |    
 1165|  9.56k|    typedef Bool (*ENTfn)(uint);
 1166|  9.56k|    const ENTfn entFn[] = {
 1167|  9.56k|        TY_(IsNamechar),
  ------------------
  |  |   23|  9.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1168|  9.56k|        TY_(IsDigit),
  ------------------
  |  |   23|  9.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1169|  9.56k|        IsDigitHex
 1170|  9.56k|    };
 1171|  9.56k|    uint start;
 1172|  9.56k|    ENTState entState = ENT_default;
 1173|  9.56k|    uint charRead = 0;
 1174|  9.56k|    Bool semicolon = no, found = no;
 1175|  9.56k|    Bool isXml = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|  9.56k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  9.56k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1176|  9.56k|    Bool preserveEntities = cfgBool( doc, TidyPreserveEntities );
  ------------------
  |  |  418|  9.56k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  9.56k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1177|  9.56k|    uint c, ch, startcol, entver = 0;
 1178|  9.56k|    Lexer* lexer = doc->lexer;
 1179|       |
 1180|  9.56k|    start = lexer->lexsize - 1;  /* to start at "&" */
 1181|  9.56k|    startcol = doc->docIn->curcol - 1;
 1182|       |
 1183|   898k|    while ( (c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  |   23|   898k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   898k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ( (c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  | 1064|   898k|#define EndOfStream (~0u)
  ------------------
  |  Branch (1183:13): [True: 898k, False: 8]
  ------------------
 1184|   898k|    {
 1185|   898k|        if ( c == ';' )
  ------------------
  |  Branch (1185:14): [True: 6.71k, False: 891k]
  ------------------
 1186|  6.71k|        {
 1187|  6.71k|            semicolon = yes;
 1188|  6.71k|            break;
 1189|  6.71k|        }
 1190|   891k|        ++charRead;
 1191|       |
 1192|   891k|        if (charRead == 1 && c == '#')
  ------------------
  |  Branch (1192:13): [True: 9.56k, False: 882k]
  |  Branch (1192:30): [True: 7.94k, False: 1.61k]
  ------------------
 1193|  7.94k|        {
 1194|  7.94k|            if ( !cfgBool(doc, TidyNCR) ||
  ------------------
  |  |  418|  15.8k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  7.94k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1194:18): [True: 0, False: 7.94k]
  ------------------
 1195|  7.94k|                 cfg(doc, TidyInCharEncoding) == BIG5 ||
  ------------------
  |  |  415|  7.94k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                               cfg(doc, TidyInCharEncoding) == BIG5 ||
  ------------------
  |  |  145|  15.8k|#define BIG5        12
  ------------------
  |  Branch (1195:18): [True: 0, False: 7.94k]
  ------------------
 1196|  7.94k|                 cfg(doc, TidyInCharEncoding) == SHIFTJIS )
  ------------------
  |  |  415|  7.94k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                               cfg(doc, TidyInCharEncoding) == SHIFTJIS )
  ------------------
  |  |  146|  7.94k|#define SHIFTJIS    13
  ------------------
  |  Branch (1196:18): [True: 0, False: 7.94k]
  ------------------
 1197|      0|            {
 1198|      0|                TY_(UngetChar)('#', doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1199|      0|                return;
 1200|      0|            }
 1201|       |
 1202|  7.94k|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|  7.94k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.94k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1203|  7.94k|            entState = ENT_numdec;
 1204|  7.94k|            continue;
 1205|  7.94k|        }
 1206|   883k|        else if (charRead == 2 && entState == ENT_numdec
  ------------------
  |  Branch (1206:18): [True: 9.27k, False: 874k]
  |  Branch (1206:35): [True: 7.94k, False: 1.32k]
  ------------------
 1207|  7.94k|                 && (c == 'x' || (!isXml && c == 'X')) )
  ------------------
  |  Branch (1207:22): [True: 6.60k, False: 1.34k]
  |  Branch (1207:35): [True: 0, False: 1.34k]
  |  Branch (1207:45): [True: 0, False: 0]
  ------------------
 1208|  6.60k|        {
 1209|  6.60k|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|  6.60k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.60k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1210|  6.60k|            entState = ENT_numhex;
 1211|  6.60k|            continue;
 1212|  6.60k|        }
 1213|       |
 1214|   877k|        if ( entFn[entState](c) )
  ------------------
  |  Branch (1214:14): [True: 874k, False: 2.84k]
  ------------------
 1215|   874k|        {
 1216|   874k|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|   874k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   874k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1217|   874k|            continue;
 1218|   874k|        }
 1219|       |
 1220|       |        /* otherwise put it back */
 1221|  2.84k|        TY_(UngetChar)( c, doc->docIn );
  ------------------
  |  |   23|  2.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1222|  2.84k|        break;
 1223|   877k|    }
 1224|       |
 1225|       |    /* make sure entity is NULL terminated */
 1226|  9.56k|    lexer->lexbuf[lexer->lexsize] = '\0';
 1227|       |
 1228|       |    /* Should contrain version to XML/XHTML if &apos; 
 1229|       |    ** is encountered.  But this is not possible with
 1230|       |    ** Tidy's content model bit mask.
 1231|       |    */
 1232|  9.56k|    if ( TY_(tmbstrcmp)(lexer->lexbuf+start, "&apos") == 0
  ------------------
  |  |   23|  9.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1232:10): [True: 0, False: 9.56k]
  ------------------
 1233|      0|         && !cfgBool(doc, TidyXmlOut)
  ------------------
  |  |  418|  9.56k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1233:13): [True: 0, False: 0]
  ------------------
 1234|      0|         && !lexer->isvoyager
  ------------------
  |  Branch (1234:13): [True: 0, False: 0]
  ------------------
 1235|      0|         && !cfgBool(doc, TidyXhtmlOut)
  ------------------
  |  |  418|  9.56k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1235:13): [True: 0, False: 0]
  ------------------
 1236|      0|         && !(TY_(HTMLVersion)(doc) == HT50) ) /* Issue #239 - no warning if in HTML5++ mode */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                       && !(TY_(HTMLVersion)(doc) == HT50) ) /* Issue #239 - no warning if in HTML5++ mode */
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
  |  Branch (1236:13): [True: 0, False: 0]
  ------------------
 1237|      0|        TY_(ReportEntityError)( doc, APOS_UNDEFINED, lexer->lexbuf+start, 39 );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1238|       |
 1239|  9.56k|    if (( mode == OtherNamespace ) && ( c == ';' ))
  ------------------
  |  Branch (1239:9): [True: 0, False: 9.56k]
  |  Branch (1239:39): [True: 0, False: 0]
  ------------------
 1240|      0|    {
 1241|       |        /* #130 MathML attr and entity fix! */
 1242|      0|        found = yes;
 1243|      0|        ch = 255;
 1244|      0|        entver = XH50|HT50;
  ------------------
  |  |  201|      0|#define XH50              262144u
  ------------------
                      entver = XH50|HT50;
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
 1245|      0|        preserveEntities = yes;
 1246|      0|    }
 1247|  9.56k|    else
 1248|  9.56k|    {
 1249|       |        /* Lookup entity code and version
 1250|       |        */
 1251|  9.56k|        found = TY_(EntityInfo)( lexer->lexbuf+start, isXml, &ch, &entver );
  ------------------
  |  |   23|  9.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1252|  9.56k|    }
 1253|       |
 1254|       |    /* Issue #483 - Deal with 'surrogate pairs' */
 1255|       |    /* TODO: Maybe warning/error, like found a leading surrogate
 1256|       |       but no following surrogate! Maybe should avoid outputting
 1257|       |       invalid utf-8 for this entity - maybe substitute?  */
 1258|  9.56k|    if (!preserveEntities && found && TY_(IsLowSurrogate)(ch))
  ------------------
  |  |   23|  7.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1258:9): [True: 9.56k, False: 0]
  |  Branch (1258:30): [True: 7.89k, False: 1.67k]
  |  Branch (1258:39): [True: 1.10k, False: 6.78k]
  ------------------
 1259|  1.10k|    {
 1260|  1.10k|        uint c1;
 1261|  1.10k|        if ((c1 = TY_(ReadChar)(doc->docIn)) == '&')
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1261:13): [True: 1.04k, False: 56]
  ------------------
 1262|  1.04k|        {
 1263|  1.04k|            SPStatus status;
 1264|       |            /* Have a following entity, 
 1265|       |               so there is a chance of having a valid surrogate pair */
 1266|  1.04k|            c1 = ch;    /* keep first value, in case of error */
 1267|  1.04k|            status = GetSurrogatePair(doc, isXml, &ch);
 1268|  1.04k|            if (status == SP_error)
  ------------------
  |  Branch (1268:17): [True: 1.04k, False: 0]
  ------------------
 1269|  1.04k|            {
 1270|  1.04k|                TY_(ReportSurrogateError)(doc, BAD_SURROGATE_TAIL, c1, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1271|  1.04k|                TY_(UngetChar)('&', doc->docIn);  /* otherwise put it back */
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1272|  1.04k|            }
 1273|  1.04k|        }
 1274|     56|        else
 1275|     56|        {
 1276|       |            /* put this non-entity lead char back */
 1277|     56|            TY_(UngetChar)(c1, doc->docIn);
  ------------------
  |  |   23|     56|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     56|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1278|       |            /* Have leading surrogate pair, with no tail */
 1279|     56|            TY_(ReportSurrogateError)(doc, BAD_SURROGATE_TAIL, ch, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|     56|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     56|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1280|     56|            ch = 0xFFFD;
 1281|     56|        }
 1282|  1.10k|    } 
 1283|  8.46k|    else if (!preserveEntities && found && TY_(IsHighSurrogate)(ch))
  ------------------
  |  |   23|  6.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1283:14): [True: 8.46k, False: 0]
  |  Branch (1283:35): [True: 6.78k, False: 1.67k]
  |  Branch (1283:44): [True: 0, False: 6.78k]
  ------------------
 1284|      0|    {
 1285|       |        /* Have trailing surrogate pair, with no lead */
 1286|      0|        TY_(ReportSurrogateError)(doc, BAD_SURROGATE_LEAD, ch, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1287|      0|        ch = 0xFFFD;
 1288|      0|    }
 1289|       |
 1290|       |    /* deal with unrecognized or invalid entities */
 1291|       |    /* #433012 - fix by Randy Waki 17 Feb 01 */
 1292|       |    /* report invalid NCR's - Terry Teague 01 Sep 01 */
 1293|  9.56k|    if ( !found || (ch >= 128 && ch <= 159) || (ch >= 256 && c != ';') )
  ------------------
  |  Branch (1293:10): [True: 1.67k, False: 7.89k]
  |  Branch (1293:21): [True: 1.14k, False: 6.74k]
  |  Branch (1293:34): [True: 1, False: 1.14k]
  |  Branch (1293:49): [True: 1.14k, False: 6.74k]
  |  Branch (1293:62): [True: 1.14k, False: 0]
  ------------------
 1294|  2.81k|    {
 1295|       |        /* set error position just before offending character */
 1296|  2.81k|        SetLexerLocus( doc, lexer );
 1297|  2.81k|        lexer->columns = startcol;
 1298|       |
 1299|  2.81k|        if (lexer->lexsize > start + 1)
  ------------------
  |  Branch (1299:13): [True: 2.52k, False: 291]
  ------------------
 1300|  2.52k|        {
 1301|  2.52k|            if (ch >= 128 && ch <= 159)
  ------------------
  |  Branch (1301:17): [True: 1.14k, False: 1.38k]
  |  Branch (1301:30): [True: 1, False: 1.14k]
  ------------------
 1302|      1|            {
 1303|       |                /* invalid numeric character reference */
 1304|       |                
 1305|      1|                uint c1 = 0;
 1306|      1|                int replaceMode = DISCARDED_CHAR;
  ------------------
  |  |  314|      1|#define DISCARDED_CHAR          1
  ------------------
 1307|       |            
 1308|       |                /* Always assume Win1252 in this circumstance. */
 1309|      1|                c1 = TY_(DecodeWin1252)( ch );
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1310|       |
 1311|      1|                if ( c1 )
  ------------------
  |  Branch (1311:22): [True: 1, False: 0]
  ------------------
 1312|      1|                    replaceMode = REPLACED_CHAR;
  ------------------
  |  |  313|      1|#define REPLACED_CHAR           0
  ------------------
 1313|       |                
 1314|      1|                if ( c != ';' )  /* issue warning if not terminated by ';' */
  ------------------
  |  Branch (1314:22): [True: 1, False: 0]
  ------------------
 1315|      1|                    TY_(ReportEntityError)( doc, MISSING_SEMICOLON_NCR,
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1316|      1|                                            lexer->lexbuf+start, c );
 1317|       | 
 1318|      1|                TY_(ReportEncodingError)(doc, INVALID_NCR, ch, replaceMode == DISCARDED_CHAR);
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportEncodingError)(doc, INVALID_NCR, ch, replaceMode == DISCARDED_CHAR);
  ------------------
  |  |  314|      1|#define DISCARDED_CHAR          1
  ------------------
 1319|       |                
 1320|      1|                if ( c1 )
  ------------------
  |  Branch (1320:22): [True: 1, False: 0]
  ------------------
 1321|      1|                {
 1322|       |                    /* make the replacement */
 1323|      1|                    lexer->lexsize = start;
 1324|      1|                    TY_(AddCharToLexer)( lexer, c1 );
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1325|      1|                    semicolon = no;
 1326|      1|                }
 1327|      0|                else
 1328|      0|                {
 1329|       |                    /* discard */
 1330|      0|                    lexer->lexsize = start;
 1331|      0|                    semicolon = no;
 1332|      0|               }
 1333|       |               
 1334|      1|            }
 1335|  2.52k|            else
 1336|  2.52k|                TY_(ReportEntityError)( doc, UNKNOWN_ENTITY,
  ------------------
  |  |   23|  2.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1337|  2.52k|                                        lexer->lexbuf+start, ch );
 1338|       |
 1339|  2.52k|            if (semicolon)
  ------------------
  |  Branch (1339:17): [True: 6, False: 2.52k]
  ------------------
 1340|      6|                TY_(AddCharToLexer)( lexer, ';' );
  ------------------
  |  |   23|      6|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      6|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1341|  2.52k|        }
 1342|    291|        else
 1343|    291|        {
 1344|       |            /*\ 
 1345|       |             *  Issue #207 - A naked & is allowed in HTML5, as an unambiguous ampersand!
 1346|       |            \*/
 1347|    291|            if (TY_(HTMLVersion)(doc) != HT50) 
  ------------------
  |  |   23|    291|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    291|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(HTMLVersion)(doc) != HT50) 
  ------------------
  |  |  200|    291|#define HT50              131072u
  ------------------
  |  Branch (1347:17): [True: 291, False: 0]
  ------------------
 1348|    291|            {
 1349|    291|                TY_(ReportEntityError)( doc, UNESCAPED_AMPERSAND,
  ------------------
  |  |   23|    291|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    291|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1350|    291|                                    lexer->lexbuf+start, ch );
 1351|    291|            }
 1352|    291|        }
 1353|  2.81k|    }
 1354|  6.74k|    else
 1355|  6.74k|    {
 1356|  6.74k|        if ( c != ';' )    /* issue warning if not terminated by ';' */
  ------------------
  |  Branch (1356:14): [True: 41, False: 6.70k]
  ------------------
 1357|     41|        {
 1358|       |            /* set error position just before offending character */
 1359|     41|            SetLexerLocus( doc, lexer );
 1360|     41|            lexer->columns = startcol;
 1361|     41|            TY_(ReportEntityError)( doc, MISSING_SEMICOLON, lexer->lexbuf+start, c );
  ------------------
  |  |   23|     41|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     41|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1362|     41|        }
 1363|       |
 1364|  6.74k|        if (preserveEntities)
  ------------------
  |  Branch (1364:13): [True: 0, False: 6.74k]
  ------------------
 1365|      0|            TY_(AddCharToLexer)( lexer, ';' );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1366|  6.74k|        else
 1367|  6.74k|        {
 1368|  6.74k|            lexer->lexsize = start;
 1369|  6.74k|            if ( ch == 160 && (mode == Preformatted) )
  ------------------
  |  Branch (1369:18): [True: 0, False: 6.74k]
  |  Branch (1369:31): [True: 0, False: 0]
  ------------------
 1370|      0|                ch = ' ';
 1371|  6.74k|            TY_(AddCharToLexer)( lexer, ch );
  ------------------
  |  |   23|  6.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1372|       |
 1373|  6.74k|            if ( ch == '&' && !cfgBool(doc, TidyQuoteAmpersand) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1373:18): [True: 0, False: 6.74k]
  |  Branch (1373:31): [True: 0, False: 0]
  ------------------
 1374|      0|                AddStringToLexer( lexer, "amp;" );
 1375|  6.74k|        }
 1376|       |
 1377|       |        /* Detect extended vs. basic entities */
 1378|  6.74k|        TY_(ConstrainVersion)( doc, entver );
  ------------------
  |  |   23|  6.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1379|  6.74k|    }
 1380|  9.56k|}
lexer.c:IsDigitHex:
  470|  6.81k|{
  471|  6.81k|    uint map;
  472|       |
  473|  6.81k|    map = MAP(c);
  ------------------
  |  |  206|  6.81k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 6.72k, False: 90]
  |  |  ------------------
  ------------------
  474|       |
  475|  6.81k|    return (map & digithex)!=0;
  ------------------
  |  |   75|  6.81k|#define digithex    128u
  ------------------
  476|  6.81k|}
lexer.c:GetSurrogatePair:
 1026|  1.04k|{
 1027|  1.04k|    Lexer* lexer = doc->lexer;
 1028|  1.04k|    uint bufSize = 32;
 1029|  1.04k|    uint c, ch = 0, offset = 0;
 1030|  1.04k|    tmbstr buf = 0;
 1031|  1.04k|    SPStatus status = SP_error;  /* assume failed */
 1032|  1.04k|    int type = 0;   /* assume numeric */
 1033|  1.04k|    uint fch = *pch;
 1034|  1.04k|    int i;  /* has to be signed due to for i >= 0 */
 1035|  1.04k|    if (!lexer)
  ------------------
  |  Branch (1035:9): [True: 0, False: 1.04k]
  ------------------
 1036|      0|        return status;
 1037|  1.04k|    buf = (tmbstr)TidyRealloc(lexer->allocator, buf, bufSize);
  ------------------
  |  |   67|  1.04k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
 1038|  1.04k|    if (!buf)
  ------------------
  |  Branch (1038:9): [True: 0, False: 1.04k]
  ------------------
 1039|      0|        return status;
 1040|  7.09k|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  |   23|  7.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  | 1064|  7.09k|#define EndOfStream (~0u)
  ------------------
  |  Branch (1040:12): [True: 7.08k, False: 6]
  ------------------
 1041|  7.08k|    {
 1042|  7.08k|        if (c == ';')
  ------------------
  |  Branch (1042:13): [True: 0, False: 7.08k]
  ------------------
 1043|      0|        {
 1044|      0|            break;  /* reached end of entity */
 1045|      0|        }
 1046|  7.08k|        if ((offset + 2) > bufSize)
  ------------------
  |  Branch (1046:13): [True: 0, False: 7.08k]
  ------------------
 1047|      0|        {
 1048|      0|            bufSize *= 2;
 1049|      0|            buf = (tmbstr)TidyRealloc(lexer->allocator, buf, bufSize);
  ------------------
  |  |   67|      0|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
 1050|      0|            if (!buf)
  ------------------
  |  Branch (1050:17): [True: 0, False: 0]
  ------------------
 1051|      0|            {
 1052|      0|                break;
 1053|      0|            }
 1054|      0|        }
 1055|  7.08k|        buf[offset++] = c;  /* add char to buffer */
 1056|  7.08k|        if (offset == 1)
  ------------------
  |  Branch (1056:13): [True: 1.04k, False: 6.04k]
  ------------------
 1057|  1.04k|        {
 1058|  1.04k|            if (c != '#')   /* is a numeric entity */
  ------------------
  |  Branch (1058:17): [True: 1, False: 1.04k]
  ------------------
 1059|      1|                break;
 1060|  1.04k|        }
 1061|  6.04k|        else if (offset == 2 && ((c == 'x') || (!isXml && c == 'X')))
  ------------------
  |  Branch (1061:18): [True: 1.04k, False: 4.99k]
  |  Branch (1061:34): [True: 38, False: 1.00k]
  |  Branch (1061:49): [True: 0, False: 1.00k]
  |  Branch (1061:59): [True: 0, False: 0]
  ------------------
 1062|     38|        {
 1063|     38|            type = 1;   /* set hex digits */
 1064|     38|        }
 1065|  6.00k|        else
 1066|  6.00k|        {
 1067|  6.00k|            if (type)   /* if hex digits */
  ------------------
  |  Branch (1067:17): [True: 38, False: 5.96k]
  ------------------
 1068|     38|            {
 1069|     38|                if (!IsDigitHex(c))
  ------------------
  |  Branch (1069:21): [True: 38, False: 0]
  ------------------
 1070|     38|                    break;
 1071|     38|            }
 1072|  5.96k|            else    /* if numeric */
 1073|  5.96k|            {
 1074|  5.96k|                if (!TY_(IsDigit)(c))
  ------------------
  |  |   23|  5.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1074:21): [True: 1.00k, False: 4.96k]
  ------------------
 1075|  1.00k|                    break;
 1076|  5.96k|            }
 1077|  6.00k|        }
 1078|  7.08k|    }
 1079|       |
 1080|  1.04k|    if (c == ';')
  ------------------
  |  Branch (1080:9): [True: 0, False: 1.04k]
  ------------------
 1081|      0|    {
 1082|      0|        int scanned;
 1083|       |
 1084|      0|        buf[offset] = 0;
 1085|      0|        if (type)
  ------------------
  |  Branch (1085:13): [True: 0, False: 0]
  ------------------
 1086|      0|            scanned = sscanf(buf + 2, "%x", &ch);
 1087|      0|        else
 1088|      0|            scanned = sscanf(buf + 1, "%d", &ch);
 1089|       |
 1090|      0|        if (scanned == 1 && TY_(IsHighSurrogate)(ch))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1090:13): [True: 0, False: 0]
  |  Branch (1090:29): [True: 0, False: 0]
  ------------------
 1091|      0|        {
 1092|      0|            ch = TY_(CombineSurrogatePair)(ch, fch);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1093|      0|            if (TY_(IsValidCombinedChar)(ch))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1093:17): [True: 0, False: 0]
  ------------------
 1094|      0|            {
 1095|      0|                *pch = ch;  /* return combined pair value */
 1096|      0|                status = SP_ok; /* full success - pair used */
 1097|      0|            }
 1098|      0|            else
 1099|      0|            {
 1100|      0|                status = SP_failed; /* is one of the 32 out-of-range pairs */
 1101|      0|                *pch = 0xFFFD;  /* return substitute character */
 1102|      0|                TY_(ReportSurrogateError)(doc, BAD_SURROGATE_PAIR, fch, ch); /* SP WARNING: -  */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1103|      0|            }
 1104|      0|        }
 1105|      0|    }
 1106|       |
 1107|  1.04k|    if (status == SP_error)
  ------------------
  |  Branch (1107:9): [True: 1.04k, False: 0]
  ------------------
 1108|  1.04k|    {
 1109|       |        /* Error condition - can only put back all the chars */
 1110|  1.04k|        if (c == ';') /* if last, not added to buffer */
  ------------------
  |  Branch (1110:13): [True: 0, False: 1.04k]
  ------------------
 1111|      0|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1112|  1.04k|        if (buf && offset)
  ------------------
  |  Branch (1112:13): [True: 1.04k, False: 0]
  |  Branch (1112:20): [True: 1.04k, False: 0]
  ------------------
 1113|  1.04k|        {
 1114|       |            /* correct the order for unget - last first */
 1115|  8.13k|            for (i = offset - 1; i >= 0; i--)
  ------------------
  |  Branch (1115:34): [True: 7.08k, False: 1.04k]
  ------------------
 1116|  7.08k|            {
 1117|  7.08k|                c = buf[i];
 1118|  7.08k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  7.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1119|  7.08k|            }
 1120|  1.04k|        }
 1121|  1.04k|    }
 1122|       |
 1123|  1.04k|    if (buf)
  ------------------
  |  Branch (1123:9): [True: 1.04k, False: 0]
  ------------------
 1124|  1.04k|        TidyFree(lexer->allocator, buf);
  ------------------
  |  |   68|  1.04k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 1125|       |
 1126|  1.04k|    return status;
 1127|  1.04k|}
lexer.c:ParseTagName:
 1383|  8.39k|{
 1384|  8.39k|    Lexer *lexer = doc->lexer;
 1385|  8.39k|    uint c = lexer->lexbuf[ lexer->txtstart ];
 1386|  8.39k|    Bool xml = cfgBool(doc, TidyXmlTags);
  ------------------
  |  |  418|  8.39k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  8.39k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1387|       |
 1388|       |    /* fold case of first character in buffer */
 1389|  8.39k|    if (!xml && TY_(IsUpper)(c))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1389:9): [True: 0, False: 8.39k]
  |  Branch (1389:17): [True: 0, False: 0]
  ------------------
 1390|      0|        lexer->lexbuf[lexer->txtstart] = (tmbchar) TY_(ToLower)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1391|       |
 1392|  18.0k|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|  18.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|  18.0k|#define EndOfStream (~0u)
  ------------------
  |  Branch (1392:12): [True: 18.0k, False: 1]
  ------------------
 1393|  18.0k|    {
 1394|  18.0k|        if ((!xml && !TY_(IsNamechar)(c)) ||
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1394:14): [True: 0, False: 18.0k]
  |  Branch (1394:22): [True: 0, False: 0]
  ------------------
 1395|  18.0k|            (xml && !TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|  18.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1395:14): [True: 18.0k, False: 0]
  |  Branch (1395:21): [True: 8.39k, False: 9.65k]
  ------------------
 1396|  8.39k|            break;
 1397|       |
 1398|       |        /* fold case of subsequent characters */
 1399|  9.65k|        if (!xml && TY_(IsUpper)(c))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1399:13): [True: 0, False: 9.65k]
  |  Branch (1399:21): [True: 0, False: 0]
  ------------------
 1400|      0|             c = TY_(ToLower)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1401|       |
 1402|  9.65k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  9.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1403|  9.65k|    }
 1404|       |
 1405|  8.39k|    lexer->txtend = lexer->lexsize;
 1406|  8.39k|    return (tmbchar) c;
 1407|  8.39k|}
lexer.c:TagToken:
 1585|  8.39k|{
 1586|  8.39k|    Lexer* lexer = doc->lexer;
 1587|  8.39k|    Node* node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|  8.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1588|  8.39k|    node->type = type;
 1589|  8.39k|    node->element = TY_(tmbstrndup)( doc->allocator,
  ------------------
  |  |   23|  8.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1590|  8.39k|                                     lexer->lexbuf + lexer->txtstart,
 1591|  8.39k|                                     lexer->txtend - lexer->txtstart );
 1592|  8.39k|    node->start = lexer->txtstart;
 1593|  8.39k|    node->end = lexer->txtstart;
 1594|       |
 1595|  8.39k|    if ( type == StartTag || type == StartEndTag || type == EndTag )
  ------------------
  |  Branch (1595:10): [True: 8.18k, False: 212]
  |  Branch (1595:30): [True: 0, False: 212]
  |  Branch (1595:53): [True: 212, False: 0]
  ------------------
 1596|  8.39k|        TY_(FindTag)(doc, node);
  ------------------
  |  |   23|  8.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1597|       |
 1598|  8.39k|    return node;
 1599|  8.39k|}
lexer.c:ParseAttrs:
 4200|  8.14k|{
 4201|  8.14k|    Lexer* lexer = doc->lexer;
 4202|  8.14k|    AttVal *av, *list;
 4203|  8.14k|    tmbstr value;
 4204|  8.14k|    int delim;
 4205|  8.14k|    Node *asp, *php;
 4206|       |
 4207|  8.14k|    list = NULL;
 4208|       |
 4209|  60.0k|    while ( !EndOfInput(doc) )
  ------------------
  |  Branch (4209:13): [True: 60.0k, False: 31]
  ------------------
 4210|  60.0k|    {
 4211|  60.0k|        tmbstr attribute = ParseAttribute( doc, isempty, &asp, &php );
 4212|       |
 4213|  60.0k|        if (attribute == NULL)
  ------------------
  |  Branch (4213:13): [True: 8.15k, False: 51.8k]
  ------------------
 4214|  8.15k|        {
 4215|       |            /* check if attributes are created by ASP markup */
 4216|  8.15k|            if (asp)
  ------------------
  |  Branch (4216:17): [True: 33, False: 8.12k]
  ------------------
 4217|     33|            {
 4218|     33|                av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|     33|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     33|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4219|     33|                av->asp = asp;
 4220|     33|                AddAttrToList( &list, av ); 
 4221|     33|                continue;
 4222|     33|            }
 4223|       |
 4224|       |            /* check if attributes are created by PHP markup */
 4225|  8.12k|            if (php)
  ------------------
  |  Branch (4225:17): [True: 14, False: 8.11k]
  ------------------
 4226|     14|            {
 4227|     14|                av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|     14|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     14|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4228|     14|                av->php = php;
 4229|     14|                AddAttrToList( &list, av ); 
 4230|     14|                continue;
 4231|     14|            }
 4232|       |
 4233|  8.11k|            break;
 4234|  8.12k|        }
 4235|       |
 4236|  51.8k|        value = ParseValue( doc, attribute, no, isempty, &delim );
 4237|       |
 4238|  51.8k|        if (attribute && (IsValidAttrName(attribute) ||
  ------------------
  |  Branch (4238:13): [True: 51.8k, False: 0]
  |  Branch (4238:27): [True: 18.2k, False: 33.6k]
  ------------------
 4239|  33.6k|            (cfgBool(doc, TidyXmlTags) && IsValidXMLAttrName(attribute))))
  ------------------
  |  |  418|  67.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  33.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 33.6k, False: 0]
  |  |  ------------------
  ------------------
                          (cfgBool(doc, TidyXmlTags) && IsValidXMLAttrName(attribute))))
  ------------------
  |  |  209|  33.6k|#define IsValidXMLAttrName(name) TY_(IsValidXMLID)(name)
  |  |  ------------------
  |  |  |  |   23|  33.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  33.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 729, False: 32.8k]
  |  |  ------------------
  ------------------
 4240|  18.9k|        {
 4241|  18.9k|            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  18.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4242|  18.9k|            av->delim = delim ? delim : '"';
  ------------------
  |  Branch (4242:25): [True: 18.6k, False: 275]
  ------------------
 4243|  18.9k|            av->attribute = attribute;
 4244|  18.9k|            av->value = value;
 4245|  18.9k|            av->dict = TY_(FindAttribute)( doc, av );
  ------------------
  |  |   23|  18.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4246|  18.9k|            AddAttrToList( &list, av );
 4247|  18.9k|            if ( !delim && value )
  ------------------
  |  Branch (4247:18): [True: 275, False: 18.6k]
  |  Branch (4247:28): [True: 275, False: 0]
  ------------------
 4248|    275|                TY_(ReportAttrError)( doc, lexer->token, av, MISSING_QUOTEMARK_OPEN);
  ------------------
  |  |   23|    275|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    275|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4249|  18.9k|        }
 4250|  32.8k|        else
 4251|  32.8k|        {
 4252|  32.8k|            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  32.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4253|  32.8k|            av->attribute = attribute;
 4254|  32.8k|            av->value = value;
 4255|       |
 4256|  32.8k|            if (LastChar(attribute) == '"')
  ------------------
  |  Branch (4256:17): [True: 20, False: 32.8k]
  ------------------
 4257|     20|                TY_(ReportAttrError)( doc, lexer->token, av, MISSING_QUOTEMARK);
  ------------------
  |  |   23|     20|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     20|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4258|  32.8k|            else if (value == NULL)
  ------------------
  |  Branch (4258:22): [True: 32.3k, False: 516]
  ------------------
 4259|  32.3k|                TY_(ReportAttrError)(doc, lexer->token, av, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  32.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4260|    516|            else
 4261|    516|                TY_(ReportAttrError)(doc, lexer->token, av, INVALID_ATTRIBUTE);
  ------------------
  |  |   23|    516|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    516|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4262|       |
 4263|  32.8k|            TY_(FreeAttribute)( doc, av );
  ------------------
  |  |   23|  32.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4264|  32.8k|        }
 4265|  51.8k|    }
 4266|       |
 4267|  8.14k|    return list;
 4268|  8.14k|}
lexer.c:EndOfInput:
  901|  60.0k|{
  902|  60.0k|    assert( doc->docIn != NULL );
  ------------------
  |  Branch (902:5): [True: 0, False: 60.0k]
  |  Branch (902:5): [True: 60.0k, False: 0]
  ------------------
  903|  60.0k|    return ( !doc->docIn->pushed && TY_(IsEOF)(doc->docIn) );
  ------------------
  |  |   23|  8.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (903:14): [True: 8.35k, False: 51.6k]
  |  Branch (903:37): [True: 31, False: 8.32k]
  ------------------
  904|  60.0k|}
lexer.c:IsValidAttrName:
 4132|  51.8k|{
 4133|  51.8k|    uint i, c = attr[0];
 4134|       |
 4135|       |    /* first character should be a letter */
 4136|  51.8k|    if (!TY_(IsLetter)(c))
  ------------------
  |  |   23|  51.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4136:9): [True: 31.6k, False: 20.1k]
  ------------------
 4137|  31.6k|        return no;
 4138|       |
 4139|       |    /* remaining characters should be namechars */
 4140|   319k|    for( i = 1; i < TY_(tmbstrlen)(attr); i++)
  ------------------
  |  |   23|   319k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   319k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4140:17): [True: 301k, False: 18.2k]
  ------------------
 4141|   301k|    {
 4142|   301k|        c = attr[i];
 4143|       |
 4144|   301k|        if (TY_(IsNamechar)(c))
  ------------------
  |  |   23|   301k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   301k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4144:13): [True: 299k, False: 1.92k]
  ------------------
 4145|   299k|            continue;
 4146|       |
 4147|  1.92k|        return no;
 4148|   301k|    }
 4149|       |
 4150|  18.2k|    return yes;
 4151|  20.1k|}
lexer.c:LastChar:
  871|  32.8k|{
  872|  32.8k|    if ( str && *str )
  ------------------
  |  Branch (872:10): [True: 32.8k, False: 0]
  |  Branch (872:17): [True: 32.8k, False: 0]
  ------------------
  873|  32.8k|    {
  874|  32.8k|        int n = TY_(tmbstrlen)(str);
  ------------------
  |  |   23|  32.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  875|  32.8k|        return str[n-1];
  876|  32.8k|    }
  877|      0|    return 0;
  878|  32.8k|}
lexer.c:ExpectsContent:
 2192|  8.18k|{
 2193|  8.18k|    if (node->type != StartTag)
  ------------------
  |  Branch (2193:9): [True: 0, False: 8.18k]
  ------------------
 2194|      0|        return no;
 2195|       |
 2196|       |    /* unknown element? */
 2197|  8.18k|    if (node->tag == NULL)
  ------------------
  |  Branch (2197:9): [True: 0, False: 8.18k]
  ------------------
 2198|      0|        return yes;
 2199|       |
 2200|  8.18k|    if (node->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  8.18k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (2200:9): [True: 0, False: 8.18k]
  ------------------
 2201|      0|        return no;
 2202|       |
 2203|  8.18k|    return yes;
 2204|  8.18k|}
lexer.c:NewToken:
 1602|    668|{
 1603|    668|    Lexer* lexer = doc->lexer;
 1604|    668|    Node* node = TY_(NewNode)(lexer->allocator, lexer);
  ------------------
  |  |   23|    668|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    668|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1605|    668|    node->type = type;
 1606|    668|    node->start = lexer->txtstart;
 1607|    668|    node->end = lexer->txtend;
 1608|    668|    return node;
 1609|    668|}
lexer.c:ParseDocTypeDecl:
 4284|  28.7k|{
 4285|  28.7k|    Lexer *lexer = doc->lexer;
 4286|  28.7k|    int start = lexer->lexsize;
 4287|  28.7k|    ParseDocTypeDeclState state = DT_DOCTYPENAME;
 4288|  28.7k|    uint c;
 4289|  28.7k|    uint delim = 0;
 4290|  28.7k|    Bool hasfpi = yes;
 4291|       |
 4292|  28.7k|    Node* node = TY_(NewNode)(lexer->allocator, lexer);
  ------------------
  |  |   23|  28.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4293|  28.7k|    node->type = DocTypeTag;
 4294|  28.7k|    node->start = lexer->txtstart;
 4295|  28.7k|    node->end = lexer->txtend;
 4296|       |
 4297|  28.7k|    lexer->waswhite = no;
 4298|       |
 4299|       |    /* todo: reset lexer->lexsize when appropriate to avoid wasting memory */
 4300|       |
 4301|  48.9M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|  48.9M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  48.9M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|  48.9M|#define EndOfStream (~0u)
  ------------------
  |  Branch (4301:12): [True: 48.9M, False: 3]
  ------------------
 4302|  48.9M|    {
 4303|       |        /* convert newlines to spaces */
 4304|  48.9M|        if (state != DT_INTSUBSET)
  ------------------
  |  Branch (4304:13): [True: 524k, False: 48.4M]
  ------------------
 4305|   524k|            c = c == '\n' ? ' ' : c;
  ------------------
  |  Branch (4305:17): [True: 341, False: 524k]
  ------------------
 4306|       |
 4307|       |        /* convert white-space sequences to single space character */
 4308|  48.9M|        if (TY_(IsWhite)(c) && state != DT_INTSUBSET)
  ------------------
  |  |   23|  48.9M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  48.9M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4308:13): [True: 48.5M, False: 434k]
  |  Branch (4308:32): [True: 136k, False: 48.4M]
  ------------------
 4309|   136k|        {
 4310|   136k|            if (!lexer->waswhite)
  ------------------
  |  Branch (4310:17): [True: 425, False: 135k]
  ------------------
 4311|    425|            {
 4312|    425|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|    425|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    425|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4313|    425|                lexer->waswhite = yes;
 4314|    425|            }
 4315|   135k|            else
 4316|   135k|            {
 4317|       |                /* discard space */
 4318|   135k|                continue;
 4319|   135k|            }
 4320|   136k|        }
 4321|  48.8M|        else
 4322|  48.8M|        {
 4323|  48.8M|            TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  48.8M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  48.8M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4324|  48.8M|            lexer->waswhite = no;
 4325|  48.8M|        }
 4326|       |
 4327|  48.8M|        switch(state)
  ------------------
  |  Branch (4327:16): [True: 48.8M, False: 0]
  ------------------
 4328|  48.8M|        {
 4329|  58.5k|        case DT_INTERMEDIATE:
  ------------------
  |  Branch (4329:9): [True: 58.5k, False: 48.7M]
  ------------------
 4330|       |            /* determine what's next */
 4331|  58.5k|            if (TY_(ToUpper)(c) == 'P' || TY_(ToUpper)(c) == 'S')
  ------------------
  |  |   23|  58.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  58.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(ToUpper)(c) == 'P' || TY_(ToUpper)(c) == 'S')
  ------------------
  |  |   23|  58.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  58.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4331:17): [True: 1, False: 58.5k]
  |  Branch (4331:43): [True: 6, False: 58.5k]
  ------------------
 4332|      7|            {
 4333|      7|                start = lexer->lexsize - 1;
 4334|      7|                state = DT_PUBLICSYSTEM;
 4335|      7|                continue;
 4336|      7|            }
 4337|  58.5k|            else if (c == '[')
  ------------------
  |  Branch (4337:22): [True: 28.8k, False: 29.7k]
  ------------------
 4338|  28.8k|            {
 4339|  28.8k|                start = lexer->lexsize;
 4340|  28.8k|                state = DT_INTSUBSET;
 4341|  28.8k|                continue;
 4342|  28.8k|            }
 4343|  29.7k|            else if (c == '\'' || c == '"')
  ------------------
  |  Branch (4343:22): [True: 13, False: 29.7k]
  |  Branch (4343:35): [True: 13, False: 29.7k]
  ------------------
 4344|     26|            {
 4345|     26|                start = lexer->lexsize;
 4346|     26|                delim = c;
 4347|     26|                state = DT_QUOTEDSTRING;
 4348|     26|                continue;
 4349|     26|            }
 4350|  29.7k|            else if (c == '>')
  ------------------
  |  Branch (4350:22): [True: 28.7k, False: 953]
  ------------------
 4351|  28.7k|            {
 4352|  28.7k|                AttVal* si;
 4353|       |
 4354|  28.7k|                node->end = --(lexer->lexsize);
 4355|       |
 4356|  28.7k|                si = TY_(GetAttrByName)(node, "SYSTEM");
  ------------------
  |  |   23|  28.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4357|  28.7k|                if (si)
  ------------------
  |  Branch (4357:21): [True: 8, False: 28.7k]
  ------------------
 4358|      8|                    TY_(CheckUrl)(doc, node, si);
  ------------------
  |  |   23|      8|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      8|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4359|       |
 4360|  28.7k|                if (!node->element || !IsValidXMLElemName(node->element))
  ------------------
  |  |  210|  28.7k|#define IsValidXMLElemName(name) TY_(IsValidXMLID)(name)
  |  |  ------------------
  |  |  |  |   23|  28.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  28.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4360:21): [True: 28, False: 28.7k]
  |  Branch (4360:39): [True: 18, False: 28.7k]
  ------------------
 4361|     46|                {
 4362|     46|                    TY_(Report)(doc, NULL, NULL, MALFORMED_DOCTYPE);
  ------------------
  |  |   23|     46|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     46|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4363|     46|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|     46|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     46|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4364|     46|                    return NULL;
 4365|     46|                }
 4366|  28.7k|                return node;
 4367|  28.7k|            }
 4368|    953|            else
 4369|    953|            {
 4370|       |                /* error */
 4371|    953|            }
 4372|    953|            break;
 4373|   329k|        case DT_DOCTYPENAME:
  ------------------
  |  Branch (4373:9): [True: 329k, False: 48.5M]
  ------------------
 4374|       |            /* read document type name */
 4375|   329k|            if (TY_(IsWhite)(c) || c == '>' || c == '[')
  ------------------
  |  |   23|   329k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   329k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4375:17): [True: 240, False: 329k]
  |  Branch (4375:36): [True: 19, False: 329k]
  |  Branch (4375:48): [True: 28.5k, False: 300k]
  ------------------
 4376|  28.7k|            {
 4377|  28.7k|                node->element = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  28.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4378|  28.7k|                                                lexer->lexbuf + start,
 4379|  28.7k|                                                lexer->lexsize - start - 1);
 4380|  28.7k|                if (c == '>' || c == '[')
  ------------------
  |  Branch (4380:21): [True: 19, False: 28.7k]
  |  Branch (4380:33): [True: 28.5k, False: 240]
  ------------------
 4381|  28.5k|                {
 4382|  28.5k|                    --(lexer->lexsize);
 4383|  28.5k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  28.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4384|  28.5k|                }
 4385|       |
 4386|  28.7k|                state = DT_INTERMEDIATE;
 4387|  28.7k|                continue;
 4388|  28.7k|            }
 4389|   300k|            break;
 4390|   300k|        case DT_PUBLICSYSTEM:
  ------------------
  |  Branch (4390:9): [True: 36, False: 48.8M]
  ------------------
 4391|       |            /* read PUBLIC/SYSTEM */
 4392|     36|            if (TY_(IsWhite)(c) || c == '>')
  ------------------
  |  |   23|     36|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     36|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4392:17): [True: 6, False: 30]
  |  Branch (4392:36): [True: 1, False: 29]
  ------------------
 4393|      7|            {
 4394|      7|                char *attname = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|      7|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      7|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4395|      7|                                                lexer->lexbuf + start,
 4396|      7|                                                lexer->lexsize - start - 1);
 4397|      7|                hasfpi = !(TY_(tmbstrcasecmp)(attname, "SYSTEM") == 0);
  ------------------
  |  |   23|      7|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      7|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4398|       |
 4399|      7|                TidyDocFree(doc, attname);
  ------------------
  |  |  159|      7|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      7|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 4400|       |
 4401|       |                /* todo: report an error if SYSTEM/PUBLIC not uppercase */
 4402|       |
 4403|      7|                if (c == '>')
  ------------------
  |  Branch (4403:21): [True: 1, False: 6]
  ------------------
 4404|      1|                {
 4405|      1|                    --(lexer->lexsize);
 4406|      1|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4407|      1|                }
 4408|       |
 4409|      7|                state = DT_INTERMEDIATE;
 4410|      7|                continue;
 4411|      7|            }
 4412|     29|            break;
 4413|    703|        case DT_QUOTEDSTRING:
  ------------------
  |  Branch (4413:9): [True: 703, False: 48.8M]
  ------------------
 4414|       |            /* read quoted string */
 4415|    703|            if (c == delim)
  ------------------
  |  Branch (4415:17): [True: 25, False: 678]
  ------------------
 4416|     25|            {
 4417|     25|                char *value = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|     25|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     25|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4418|     25|                                              lexer->lexbuf + start,
 4419|     25|                                              lexer->lexsize - start - 1);
 4420|     25|                AttVal* att = TY_(AddAttribute)(doc, node, hasfpi ? "PUBLIC" : "SYSTEM", value);
  ------------------
  |  |   23|     25|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     25|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4420:60): [True: 14, False: 11]
  ------------------
 4421|     25|                TidyDocFree(doc, value);
  ------------------
  |  |  159|     25|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     25|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 4422|     25|                att->delim = delim;
 4423|     25|                hasfpi = no;
 4424|     25|                state = DT_INTERMEDIATE;
 4425|     25|                delim = 0;
 4426|     25|                continue;
 4427|     25|            }
 4428|    678|            break;
 4429|  48.4M|        case DT_INTSUBSET:
  ------------------
  |  Branch (4429:9): [True: 48.4M, False: 388k]
  ------------------
 4430|       |            /* read internal subset */
 4431|  48.4M|            if (c == ']')
  ------------------
  |  Branch (4431:17): [True: 28.8k, False: 48.4M]
  ------------------
 4432|  28.8k|            {
 4433|  28.8k|                Node* subset;
 4434|  28.8k|                lexer->txtstart = start;
 4435|  28.8k|                lexer->txtend = lexer->lexsize - 1;
 4436|  28.8k|                subset = TY_(TextToken)(lexer);
  ------------------
  |  |   23|  28.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4437|  28.8k|                TY_(InsertNodeAtEnd)(node, subset);
  ------------------
  |  |   23|  28.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4438|  28.8k|                state = DT_INTERMEDIATE;
 4439|  28.8k|            }
 4440|  48.4M|            break;
 4441|  48.8M|        }
 4442|  48.8M|    }
 4443|       |
 4444|       |    /* document type declaration not finished */
 4445|      3|    TY_(Report)(doc, NULL, NULL, MALFORMED_DOCTYPE);
  ------------------
  |  |   23|      3|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      3|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4446|      3|    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|      3|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      3|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4447|       |    return NULL;
 4448|  28.7k|}
lexer.c:ParseAttribute:
 3594|  60.1k|{
 3595|  60.1k|    Lexer* lexer = doc->lexer;
 3596|  60.1k|    int start, len = 0;
 3597|  60.1k|    tmbstr attr = NULL;
 3598|  60.1k|    uint c, lastc;
 3599|       |
 3600|  60.1k|    *asp = NULL;  /* clear asp pointer */
 3601|  60.1k|    *php = NULL;  /* clear php pointer */
 3602|       |
 3603|       | /* skip white space before the attribute */
 3604|       |
 3605|  60.1k|    for (;;)
 3606|   453k|    {
 3607|   453k|        c = TY_(ReadChar)( doc->docIn );
  ------------------
  |  |   23|   453k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   453k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3608|       |
 3609|       |
 3610|   453k|        if (c == '/')
  ------------------
  |  Branch (3610:13): [True: 1.71k, False: 452k]
  ------------------
 3611|  1.71k|        {
 3612|  1.71k|            c = TY_(ReadChar)( doc->docIn );
  ------------------
  |  |   23|  1.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3613|       |
 3614|  1.71k|            if (c == '>')
  ------------------
  |  Branch (3614:17): [True: 0, False: 1.71k]
  ------------------
 3615|      0|            {
 3616|      0|                *isempty = yes;
 3617|      0|                return NULL;
 3618|      0|            }
 3619|       |
 3620|  1.71k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3621|  1.71k|            c = '/';
 3622|  1.71k|            break;
 3623|  1.71k|        }
 3624|       |
 3625|   452k|        if (c == '>')
  ------------------
  |  Branch (3625:13): [True: 2.78k, False: 449k]
  ------------------
 3626|  2.78k|            return NULL;
 3627|       |
 3628|   449k|        if (c =='<')
  ------------------
  |  Branch (3628:13): [True: 5.47k, False: 443k]
  ------------------
 3629|  5.47k|        {
 3630|  5.47k|            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  5.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3631|       |
 3632|  5.47k|            if (c == '%')
  ------------------
  |  Branch (3632:17): [True: 76, False: 5.39k]
  ------------------
 3633|     76|            {
 3634|     76|                *asp = ParseAsp( doc );
 3635|     76|                return NULL;
 3636|     76|            }
 3637|  5.39k|            else if (c == '?')
  ------------------
  |  Branch (3637:22): [True: 46, False: 5.34k]
  ------------------
 3638|     46|            {
 3639|     46|                *php = ParsePhp( doc );
 3640|     46|                return NULL;
 3641|     46|            }
 3642|       |
 3643|  5.34k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  5.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3644|  5.34k|            TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|  5.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3645|  5.34k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|  5.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3646|  5.34k|            return NULL;
 3647|  5.47k|        }
 3648|       |
 3649|   443k|        if (c == '=')
  ------------------
  |  Branch (3649:13): [True: 0, False: 443k]
  ------------------
 3650|      0|        {
 3651|      0|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_EQUALSIGN );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3652|      0|            continue;
 3653|      0|        }
 3654|       |
 3655|   443k|        if (c == '"' || c == '\'')
  ------------------
  |  Branch (3655:13): [True: 252, False: 443k]
  |  Branch (3655:25): [True: 0, False: 443k]
  ------------------
 3656|    252|        {
 3657|    252|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_QUOTEMARK );
  ------------------
  |  |   23|    252|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    252|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3658|    252|            continue;
 3659|    252|        }
 3660|       |
 3661|   443k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   443k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3661:13): [True: 0, False: 443k]
  ------------------
 3662|      0|        {
 3663|      0|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3664|      0|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3665|      0|            return NULL;
 3666|      0|        }
 3667|       |
 3668|       |
 3669|   443k|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|   443k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   443k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3669:13): [True: 50.2k, False: 393k]
  ------------------
 3670|  50.2k|           break;
 3671|   443k|    }
 3672|       |
 3673|  51.9k|    start = lexer->lexsize;
 3674|  51.9k|    lastc = c;
 3675|       |
 3676|  51.9k|    for (;;)
 3677|  4.26M|    {
 3678|       |     /* but push back '=' for parseValue() */
 3679|  4.26M|        if (c == '=' || c == '>')
  ------------------
  |  Branch (3679:13): [True: 641, False: 4.26M]
  |  Branch (3679:25): [True: 2.76k, False: 4.26M]
  ------------------
 3680|  3.40k|        {
 3681|  3.40k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  3.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3682|  3.40k|            break;
 3683|  3.40k|        }
 3684|       |
 3685|  4.26M|        if (c == '<' || c == EndOfStream)
  ------------------
  |  | 1064|  4.26M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3685:13): [True: 4.11k, False: 4.26M]
  |  Branch (3685:25): [True: 9, False: 4.26M]
  ------------------
 3686|  4.12k|        {
 3687|  4.12k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  4.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3688|  4.12k|            break;
 3689|  4.12k|        }
 3690|       |
 3691|  4.26M|        if (lastc == '-' && (c == '"' || c == '\''))
  ------------------
  |  Branch (3691:13): [True: 5.21k, False: 4.25M]
  |  Branch (3691:30): [True: 0, False: 5.21k]
  |  Branch (3691:42): [True: 0, False: 5.21k]
  ------------------
 3692|      0|        {
 3693|      0|            lexer->lexsize--;
 3694|      0|            --len;
 3695|      0|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3696|      0|            break;
 3697|      0|        }
 3698|       |
 3699|  4.26M|        if (TY_(IsWhite)(c))
  ------------------
  |  |   23|  4.26M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.26M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3699:13): [True: 44.4k, False: 4.21M]
  ------------------
 3700|  44.4k|            break;
 3701|       |
 3702|  4.21M|        if (c == '/') /* Issue #395 - potential self closing tag */
  ------------------
  |  Branch (3702:13): [True: 3.28k, False: 4.21M]
  ------------------
 3703|  3.28k|        {
 3704|  3.28k|            c = TY_(ReadChar)(doc->docIn);  /* read next */
  ------------------
  |  |   23|  3.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3705|  3.28k|            if (c == '>')
  ------------------
  |  Branch (3705:17): [True: 1, False: 3.28k]
  ------------------
 3706|      1|            {
 3707|       |                /* got a self closing tag - put is back and continue... */
 3708|      1|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3709|      1|                break;
 3710|      1|            }
 3711|  3.28k|            else
 3712|  3.28k|            {
 3713|       |                /* Not '/>' - put it back */
 3714|  3.28k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  3.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3715|  3.28k|                c = '/';  /* restore original char */
 3716|  3.28k|            }
 3717|  3.28k|        }
 3718|       |
 3719|       |        /* what should be done about non-namechar characters? */
 3720|       |        /* currently these are incorporated into the attr name */
 3721|       |
 3722|  4.21M|        if ( cfg(doc, TidyUpperCaseAttrs) != TidyUppercasePreserve )
  ------------------
  |  |  415|  4.21M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (3722:14): [True: 4.21M, False: 0]
  ------------------
 3723|  4.21M|        {
 3724|  4.21M|            if ( !cfgBool(doc, TidyXmlTags) && TY_(IsUpper)(c) )
  ------------------
  |  |  418|  8.43M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  4.21M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                          if ( !cfgBool(doc, TidyXmlTags) && TY_(IsUpper)(c) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3724:18): [True: 0, False: 4.21M]
  |  Branch (3724:48): [True: 0, False: 0]
  ------------------
 3725|      0|                c = TY_(ToLower)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3726|  4.21M|        }
 3727|       |
 3728|  4.21M|        TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|  4.21M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.21M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3729|  4.21M|        lastc = c;
 3730|  4.21M|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  4.21M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.21M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3731|  4.21M|    }
 3732|       |
 3733|       |    /* handle attribute names with multibyte chars */
 3734|  51.9k|    len = lexer->lexsize - start;
 3735|  51.9k|    attr = (len > 0 ? TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  51.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3735:13): [True: 51.9k, False: 0]
  ------------------
 3736|  51.9k|                                      lexer->lexbuf+start, len) : NULL);
 3737|  51.9k|    lexer->lexsize = start;
 3738|  51.9k|    return attr;
 3739|  60.1k|}
lexer.c:ParseAsp:
 3508|     76|{
 3509|     76|    Lexer* lexer = doc->lexer;
 3510|     76|    uint c;
 3511|     76|    Node *asp = NULL;
 3512|       |
 3513|     76|    lexer->txtstart = lexer->lexsize;
 3514|       |
 3515|     76|    for (;;)
 3516|  22.8M|    {
 3517|  22.8M|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  22.8M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.8M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  22.8M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3517:13): [True: 5, False: 22.8M]
  ------------------
 3518|      5|            break;
 3519|       |
 3520|  22.8M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  22.8M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.8M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3521|       |
 3522|       |
 3523|  22.8M|        if (c != '%')
  ------------------
  |  Branch (3523:13): [True: 22.8M, False: 72]
  ------------------
 3524|  22.8M|            continue;
 3525|       |
 3526|     72|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|     72|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     72|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|     72|#define EndOfStream (~0u)
  ------------------
  |  Branch (3526:13): [True: 0, False: 72]
  ------------------
 3527|      0|            break;
 3528|       |
 3529|     72|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|     72|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     72|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3530|       |
 3531|     72|        if (c == '>')
  ------------------
  |  Branch (3531:13): [True: 71, False: 1]
  ------------------
 3532|     71|        {
 3533|     71|            lexer->lexsize -= 2;
 3534|     71|            break;
 3535|     71|        }
 3536|     72|    }
 3537|       |
 3538|     76|    lexer->txtend = lexer->lexsize;
 3539|     76|    if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3539:9): [True: 76, False: 0]
  ------------------
 3540|     76|        asp = AspToken(doc);
  ------------------
  |  | 1614|     76|#define AspToken(doc)     NewToken(doc, AspTag)
  ------------------
 3541|       |
 3542|     76|    lexer->txtstart = lexer->txtend;
 3543|     76|    return asp;
 3544|     76|}   
lexer.c:ParsePhp:
 3552|     46|{
 3553|     46|    Lexer* lexer = doc->lexer;
 3554|     46|    uint c;
 3555|     46|    Node *php = NULL;
 3556|       |
 3557|     46|    lexer->txtstart = lexer->lexsize;
 3558|       |
 3559|     46|    for (;;)
 3560|  44.0M|    {
 3561|  44.0M|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  44.0M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.0M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  44.0M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3561:13): [True: 14, False: 44.0M]
  ------------------
 3562|     14|            break;
 3563|       |
 3564|  44.0M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  44.0M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.0M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3565|       |
 3566|       |
 3567|  44.0M|        if (c != '?')
  ------------------
  |  Branch (3567:13): [True: 44.0M, False: 32]
  ------------------
 3568|  44.0M|            continue;
 3569|       |
 3570|     32|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|     32|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     32|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|     32|#define EndOfStream (~0u)
  ------------------
  |  Branch (3570:13): [True: 0, False: 32]
  ------------------
 3571|      0|            break;
 3572|       |
 3573|     32|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|     32|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     32|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3574|       |
 3575|     32|        if (c == '>')
  ------------------
  |  Branch (3575:13): [True: 32, False: 0]
  ------------------
 3576|     32|        {
 3577|     32|            lexer->lexsize -= 2;
 3578|     32|            break;
 3579|     32|        }
 3580|     32|    }
 3581|       |
 3582|     46|    lexer->txtend = lexer->lexsize;
 3583|     46|    if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3583:9): [True: 46, False: 0]
  ------------------
 3584|     46|        php = PhpToken(doc);
  ------------------
  |  | 1616|     46|#define PhpToken(doc)     NewToken(doc, PhpTag)
  ------------------
 3585|       |
 3586|     46|    lexer->txtstart = lexer->txtend;
 3587|     46|    return php;
 3588|     46|}   
lexer.c:ParseValue:
 3842|  51.9k|{
 3843|  51.9k|    Lexer* lexer = doc->lexer;
 3844|  51.9k|    int len = 0, start;
 3845|  51.9k|    Bool seen_gt = no;
 3846|  51.9k|    Bool munge = yes;
 3847|  51.9k|    uint c, lastc, delim, quotewarning;
 3848|  51.9k|    tmbstr value;
 3849|       |
 3850|  51.9k|    delim = (tmbchar) 0;
 3851|  51.9k|    *pdelim = '"';
 3852|       |
 3853|       |    /*
 3854|       |     Henry Zrepa reports that some folk are using the
 3855|       |     embed element with script attributes where newlines
 3856|       |     are significant and must be preserved
 3857|       |    */
 3858|  51.9k|    if ( cfgBool(doc, TidyLiteralAttribs) )
  ------------------
  |  |  418|  51.9k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  51.9k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 51.9k]
  |  |  ------------------
  ------------------
 3859|      0|        munge = no;
 3860|       |
 3861|       | /* skip white space before the '=' */
 3862|       |
 3863|  51.9k|    for (;;)
 3864|   182k|    {
 3865|   182k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   182k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   182k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3866|       |
 3867|   182k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   182k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3867:13): [True: 9, False: 182k]
  ------------------
 3868|      9|        {
 3869|      9|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      9|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      9|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3870|      9|            break;
 3871|      9|        }
 3872|       |
 3873|   182k|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|   182k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   182k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3873:13): [True: 51.9k, False: 130k]
  ------------------
 3874|  51.9k|           break;
 3875|   182k|    }
 3876|       |
 3877|       |/*
 3878|       |  c should be '=' if there is a value
 3879|       |  other legal possibilities are white
 3880|       |  space, '/' and '>'
 3881|       |*/
 3882|       |
 3883|  51.9k|    if (c != '=' && c != '"' && c != '\'')
  ------------------
  |  Branch (3883:9): [True: 51.2k, False: 641]
  |  Branch (3883:21): [True: 50.8k, False: 466]
  |  Branch (3883:33): [True: 50.8k, False: 0]
  ------------------
 3884|  50.8k|    {
 3885|  50.8k|        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  50.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  50.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3886|  50.8k|        return NULL;
 3887|  50.8k|    }
 3888|       |
 3889|       | /* skip white space after '=' */
 3890|       |
 3891|  1.10k|    for (;;)
 3892|  1.10k|    {
 3893|  1.10k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3894|       |
 3895|  1.10k|        if (c == EndOfStream)
  ------------------
  |  | 1064|  1.10k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3895:13): [True: 0, False: 1.10k]
  ------------------
 3896|      0|        {
 3897|      0|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3898|      0|            break;
 3899|      0|        }
 3900|       |
 3901|  1.10k|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3901:13): [True: 1.10k, False: 0]
  ------------------
 3902|  1.10k|           break;
 3903|  1.10k|    }
 3904|       |
 3905|       | /* check for quote marks */
 3906|       |
 3907|  1.10k|    if (c == '"' || c == '\'')
  ------------------
  |  Branch (3907:9): [True: 431, False: 676]
  |  Branch (3907:21): [True: 0, False: 676]
  ------------------
 3908|    431|        delim = c;
 3909|    676|    else if (c == '<')
  ------------------
  |  Branch (3909:14): [True: 2, False: 674]
  ------------------
 3910|      2|    {
 3911|      2|        start = lexer->lexsize;
 3912|      2|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|      2|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      2|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3913|      2|        *pdelim = ParseServerInstruction( doc );
 3914|      2|        len = lexer->lexsize - start;
 3915|      2|        lexer->lexsize = start;
 3916|      2|        return (len > 0 ? TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|      2|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      2|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3916:17): [True: 2, False: 0]
  ------------------
 3917|      2|                                          lexer->lexbuf+start, len) : NULL);
 3918|      2|    }
 3919|    674|    else
 3920|    674|        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    674|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    674|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3921|       |
 3922|       | /*
 3923|       |   and read the value string
 3924|       |   check for quote mark if needed
 3925|       | */
 3926|       |
 3927|  1.10k|    quotewarning = 0;
 3928|  1.10k|    start = lexer->lexsize;
 3929|  1.10k|    c = '\0';
 3930|       |
 3931|  1.10k|    for (;;)
 3932|   602k|    {
 3933|   602k|        lastc = c;  /* track last character */
 3934|   602k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   602k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   602k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3935|       |
 3936|   602k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   602k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3936:13): [True: 1, False: 602k]
  ------------------
 3937|      1|        {
 3938|      1|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3939|      1|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3940|      1|            break;
 3941|      1|        }
 3942|       |
 3943|   602k|        if (delim == (tmbchar)0)
  ------------------
  |  Branch (3943:13): [True: 3.32k, False: 599k]
  ------------------
 3944|  3.32k|        {
 3945|  3.32k|            if (c == '>')
  ------------------
  |  Branch (3945:17): [True: 0, False: 3.32k]
  ------------------
 3946|      0|            {
 3947|      0|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3948|      0|                break;
 3949|      0|            }
 3950|       |
 3951|  3.32k|            if (c == '"' || c == '\'')
  ------------------
  |  Branch (3951:17): [True: 0, False: 3.32k]
  |  Branch (3951:29): [True: 0, False: 3.32k]
  ------------------
 3952|      0|            {
 3953|      0|                uint q = c;
 3954|       |
 3955|       |                /* handle <input onclick=s("btn1")> and <a title=foo""">...</a> */
 3956|       |                /* this doesn't handle <a title=foo"/> which browsers treat as  */
 3957|       |                /* 'foo"/' nor  <a title=foo" /> which browser treat as 'foo"'  */
 3958|       |                
 3959|      0|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3960|      0|                if (c == '>')
  ------------------
  |  Branch (3960:21): [True: 0, False: 0]
  ------------------
 3961|      0|                {
 3962|      0|                    TY_(AddCharToLexer)(lexer, q);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3963|      0|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3964|      0|                    break;
 3965|      0|                }
 3966|      0|                else
 3967|      0|                {
 3968|      0|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3969|      0|                    c = q;
 3970|      0|                }
 3971|      0|            }
 3972|       |
 3973|  3.32k|            if (c == '<')
  ------------------
  |  Branch (3973:17): [True: 26, False: 3.29k]
  ------------------
 3974|     26|            {
 3975|     26|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     26|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     26|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3976|     26|                c = '>';
 3977|     26|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     26|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     26|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3978|     26|                TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|     26|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     26|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3979|     26|                break;
 3980|     26|            }
 3981|       |
 3982|       |            /*
 3983|       |             For cases like <br clear=all/> need to avoid treating /> as
 3984|       |             part of the attribute value, however care is needed to avoid
 3985|       |             so treating <a href=http://www.acme.com/> in this way, which
 3986|       |             would map the <a> tag to <a href="http://www.acme.com"/>
 3987|       |            */
 3988|  3.29k|            if (c == '/')
  ------------------
  |  Branch (3988:17): [True: 0, False: 3.29k]
  ------------------
 3989|      0|            {
 3990|       |                /* peek ahead in case of /> */
 3991|      0|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3992|       |
 3993|      0|                if ( c == '>' && !TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3993:22): [True: 0, False: 0]
  |  Branch (3993:34): [True: 0, False: 0]
  ------------------
 3994|      0|                {
 3995|      0|                    *isempty = yes;
 3996|      0|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3997|      0|                    break;
 3998|      0|                }
 3999|       |
 4000|       |                /* unget peeked character */
 4001|      0|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4002|      0|                c = '/';
 4003|      0|            }
 4004|  3.29k|        }
 4005|   599k|        else  /* delim is '\'' or '"' */
 4006|   599k|        {
 4007|   599k|            if (c == delim)
  ------------------
  |  Branch (4007:17): [True: 430, False: 598k]
  ------------------
 4008|    430|                break;
 4009|       |
 4010|   598k|            if (c == '\n' || c == '<' || c == '>')
  ------------------
  |  Branch (4010:17): [True: 10.8k, False: 587k]
  |  Branch (4010:30): [True: 7.20k, False: 580k]
  |  Branch (4010:42): [True: 715, False: 580k]
  ------------------
 4011|  18.7k|                ++quotewarning;
 4012|       |
 4013|   598k|            if (c == '>')
  ------------------
  |  Branch (4013:17): [True: 715, False: 598k]
  ------------------
 4014|    715|                seen_gt = yes;
 4015|   598k|        }
 4016|       |
 4017|   602k|        if (c == '&')
  ------------------
  |  Branch (4017:13): [True: 6.90k, False: 595k]
  ------------------
 4018|  6.90k|        {
 4019|  6.90k|            TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  6.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4020|  6.90k|            ParseEntity( doc, IgnoreWhitespace );
 4021|  6.90k|            if (lexer->lexbuf[lexer->lexsize - 1] == '\n' && munge)
  ------------------
  |  Branch (4021:17): [True: 6.50k, False: 401]
  |  Branch (4021:62): [True: 6.50k, False: 0]
  ------------------
 4022|  6.50k|                ChangeChar(lexer, ' ');
 4023|  6.90k|            continue;
 4024|  6.90k|        }
 4025|       |
 4026|       |        /*
 4027|       |         kludge for JavaScript attribute values
 4028|       |         with line continuations in string literals
 4029|       |        */
 4030|   595k|        if (c == '\\')
  ------------------
  |  Branch (4030:13): [True: 2.39k, False: 592k]
  ------------------
 4031|  2.39k|        {
 4032|  2.39k|            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  2.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4033|       |
 4034|  2.39k|            if (c != '\n')
  ------------------
  |  Branch (4034:17): [True: 2.39k, False: 0]
  ------------------
 4035|  2.39k|            {
 4036|  2.39k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  2.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4037|  2.39k|                c = '\\';
 4038|  2.39k|            }
 4039|  2.39k|        }
 4040|       |
 4041|   595k|        if (TY_(IsWhite)(c))
  ------------------
  |  |   23|   595k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   595k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4041:13): [True: 36.4k, False: 558k]
  ------------------
 4042|  36.4k|        {
 4043|  36.4k|            if ( delim == 0 )
  ------------------
  |  Branch (4043:18): [True: 648, False: 35.7k]
  ------------------
 4044|    648|                break;
 4045|       |
 4046|  35.7k|            if (munge)
  ------------------
  |  Branch (4046:17): [True: 35.7k, False: 0]
  ------------------
 4047|  35.7k|            {
 4048|       |                /* discard line breaks in quoted URLs */ 
 4049|       |                /* #438650 - fix by Randy Waki */
 4050|  35.7k|                if ( c == '\n' && TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|  10.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4050:22): [True: 10.8k, False: 24.9k]
  |  Branch (4050:35): [True: 604, False: 10.2k]
  ------------------
 4051|    604|                {
 4052|       |                    /* warn that we discard this newline */
 4053|    604|                    TY_(ReportAttrError)( doc, lexer->token, NULL, NEWLINE_IN_URI);
  ------------------
  |  |   23|    604|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    604|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4054|    604|                    continue;
 4055|    604|                }
 4056|       |                
 4057|  35.1k|                c = ' ';
 4058|       |
 4059|  35.1k|                if (lastc == ' ')
  ------------------
  |  Branch (4059:21): [True: 22.3k, False: 12.8k]
  ------------------
 4060|  22.3k|                {
 4061|  22.3k|                    if (TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|  22.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4061:25): [True: 17.5k, False: 4.80k]
  ------------------
 4062|  17.5k|                        TY_(ReportAttrError)( doc, lexer->token, NULL, WHITE_IN_URI);
  ------------------
  |  |   23|  17.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4063|  22.3k|                    continue;
 4064|  22.3k|                }
 4065|  35.1k|            }
 4066|  35.7k|        }
 4067|   558k|        else if (foldCase && TY_(IsUpper)(c))
  ------------------
  |  |   23|    197|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    197|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4067:18): [True: 197, False: 558k]
  |  Branch (4067:30): [True: 21, False: 176]
  ------------------
 4068|     21|            c = TY_(ToLower)(c);
  ------------------
  |  |   23|     21|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     21|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4069|       |
 4070|   571k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   571k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   571k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4071|   571k|    }
 4072|       |
 4073|  1.10k|    if (quotewarning > 10 && seen_gt && munge)
  ------------------
  |  Branch (4073:9): [True: 405, False: 700]
  |  Branch (4073:30): [True: 298, False: 107]
  |  Branch (4073:41): [True: 298, False: 0]
  ------------------
 4074|    298|    {
 4075|       |        /*
 4076|       |           there is almost certainly a missing trailing quote mark
 4077|       |           as we have see too many newlines, < or > characters.
 4078|       |
 4079|       |           an exception is made for Javascript attributes and the
 4080|       |           javascript URL scheme which may legitimately include < and >,
 4081|       |           and for attributes starting with "<xml " as generated by
 4082|       |           Microsoft Office.
 4083|       |        */
 4084|    298|        if ( !TY_(IsScript)(doc, name) &&
  ------------------
  |  |   23|    298|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    298|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4084:14): [True: 298, False: 0]
  ------------------
 4085|    298|             !(TY_(IsUrl)(doc, name) && TY_(tmbstrncmp)(lexer->lexbuf+start, "javascript:", 11) == 0) &&
  ------------------
  |  |   23|    298|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    298|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           !(TY_(IsUrl)(doc, name) && TY_(tmbstrncmp)(lexer->lexbuf+start, "javascript:", 11) == 0) &&
  ------------------
  |  |   23|    297|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    297|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4085:16): [True: 297, False: 1]
  |  Branch (4085:41): [True: 0, False: 297]
  ------------------
 4086|    298|             !(TY_(tmbstrncmp)(lexer->lexbuf+start, "<xml ", 5) == 0)
  ------------------
  |  |   23|    298|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    298|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4086:14): [True: 298, False: 0]
  ------------------
 4087|    298|           )
 4088|    298|            TY_(Report)( doc, NULL, NULL, SUSPECTED_MISSING_QUOTE ); 
  ------------------
  |  |   23|    298|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    298|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4089|    298|    }
 4090|       |
 4091|  1.10k|    len = lexer->lexsize - start;
 4092|  1.10k|    lexer->lexsize = start;
 4093|       |
 4094|       |
 4095|  1.10k|    if (len > 0 || delim)
  ------------------
  |  Branch (4095:9): [True: 1.10k, False: 0]
  |  Branch (4095:20): [True: 0, False: 0]
  ------------------
 4096|  1.10k|    {
 4097|       |        /* ignore leading and trailing white space for all but title, alt, value */
 4098|       |        /* and prompts attributes unless --literal-attributes is set to yes      */
 4099|       |        /* #994841 - Whitespace is removed from value attributes                 */
 4100|       |
 4101|       |        /* Issue #217 - Also only if/while (len > 0) - MUST NEVER GO NEGATIVE! */
 4102|  1.10k|        if ((len > 0) && munge &&
  ------------------
  |  Branch (4102:13): [True: 1.10k, False: 0]
  |  Branch (4102:26): [True: 1.10k, False: 0]
  ------------------
 4103|  1.10k|            TY_(tmbstrcasecmp)(name, "alt") &&
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4103:13): [True: 1.10k, False: 0]
  ------------------
 4104|  1.10k|            TY_(tmbstrcasecmp)(name, "title") &&
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4104:13): [True: 1.10k, False: 0]
  ------------------
 4105|  1.10k|            TY_(tmbstrcasecmp)(name, "value") &&
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4105:13): [True: 1.10k, False: 0]
  ------------------
 4106|  1.10k|            TY_(tmbstrcasecmp)(name, "prompt"))
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4106:13): [True: 1.10k, False: 0]
  ------------------
 4107|  1.10k|        {
 4108|  1.31k|            while (TY_(IsWhite)(lexer->lexbuf[start+len-1]) && (len > 0))
  ------------------
  |  |   23|  1.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4108:20): [True: 214, False: 1.10k]
  |  Branch (4108:64): [True: 214, False: 0]
  ------------------
 4109|    214|                --len;
 4110|       |
 4111|       |            /* Issue #497 - Fix leading space trimming */
 4112|  1.10k|            while (TY_(IsWhite)(lexer->lexbuf[start]) && (len > 0))
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4112:20): [True: 0, False: 1.10k]
  |  Branch (4112:58): [True: 0, False: 0]
  ------------------
 4113|      0|            {
 4114|      0|                ++start;
 4115|      0|                --len;
 4116|      0|            }
 4117|  1.10k|        }
 4118|       |
 4119|  1.10k|        value = TY_(tmbstrndup)(doc->allocator, lexer->lexbuf + start, len);
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4120|  1.10k|    }
 4121|      0|    else
 4122|      0|        value = NULL;
 4123|       |
 4124|       |    /* note delimiter if given */
 4125|  1.10k|    *pdelim = delim;
 4126|       |
 4127|  1.10k|    return value;
 4128|  1.10k|}
lexer.c:ParseServerInstruction:
 3747|      2|{
 3748|      2|    Lexer* lexer = doc->lexer;
 3749|      2|    uint c;
 3750|      2|    int delim = '"';
 3751|      2|    Bool isrule = no;
 3752|       |
 3753|      2|    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|      2|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      2|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3754|      2|    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|      2|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      2|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3755|       |
 3756|       |    /* check for ASP, PHP or Tango */
 3757|      2|    if (c == '%' || c == '?' || c == '@')
  ------------------
  |  Branch (3757:9): [True: 0, False: 2]
  |  Branch (3757:21): [True: 0, False: 2]
  |  Branch (3757:33): [True: 0, False: 2]
  ------------------
 3758|      0|        isrule = yes;
 3759|       |
 3760|      2|    for (;;)
 3761|   262k|    {
 3762|   262k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   262k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   262k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3763|       |
 3764|   262k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   262k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3764:13): [True: 1, False: 262k]
  ------------------
 3765|      1|            break;
 3766|       |
 3767|   262k|        if (c == '>')
  ------------------
  |  Branch (3767:13): [True: 0, False: 262k]
  ------------------
 3768|      0|        {
 3769|      0|            if (isrule)
  ------------------
  |  Branch (3769:17): [True: 0, False: 0]
  ------------------
 3770|      0|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3771|      0|            else
 3772|      0|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3773|       |
 3774|      0|            break;
 3775|      0|        }
 3776|       |
 3777|       |        /* if not recognized as ASP, PHP or Tango */
 3778|       |        /* then also finish value on whitespace */
 3779|   262k|        if (!isrule)
  ------------------
  |  Branch (3779:13): [True: 262k, False: 0]
  ------------------
 3780|   262k|        {
 3781|   262k|            if (TY_(IsWhite)(c))
  ------------------
  |  |   23|   262k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   262k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3781:17): [True: 1, False: 262k]
  ------------------
 3782|      1|                break;
 3783|   262k|        }
 3784|       |
 3785|   262k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   262k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   262k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3786|       |
 3787|   262k|        if (c == '"')
  ------------------
  |  Branch (3787:13): [True: 2.10k, False: 260k]
  ------------------
 3788|  2.10k|        {
 3789|  2.10k|            do
 3790|   126k|            {
 3791|   126k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   126k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   126k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3792|   126k|                if (c == EndOfStream) /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  | 1064|   126k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3792:21): [True: 0, False: 126k]
  ------------------
 3793|      0|                {
 3794|      0|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3795|      0|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3796|      0|                    return 0;
 3797|      0|                }
 3798|   126k|                if (c == '>') /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  Branch (3798:21): [True: 0, False: 126k]
  ------------------
 3799|      0|                {
 3800|      0|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3801|      0|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3802|      0|                    return 0;
 3803|      0|                }
 3804|   126k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   126k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   126k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3805|   126k|            }
 3806|   126k|            while (c != '"');
  ------------------
  |  Branch (3806:20): [True: 124k, False: 2.10k]
  ------------------
 3807|  2.10k|            delim = '\'';
 3808|  2.10k|            continue;
 3809|  2.10k|        }
 3810|       |
 3811|   260k|        if (c == '\'')
  ------------------
  |  Branch (3811:13): [True: 134k, False: 126k]
  ------------------
 3812|   134k|        {
 3813|   134k|            do
 3814|   485k|            {
 3815|   485k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   485k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   485k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3816|   485k|                if (c == EndOfStream) /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  | 1064|   485k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3816:21): [True: 0, False: 485k]
  ------------------
 3817|      0|                {
 3818|      0|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3819|      0|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3820|      0|                    return 0;
 3821|      0|                }
 3822|   485k|                if (c == '>') /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  Branch (3822:21): [True: 0, False: 485k]
  ------------------
 3823|      0|                {
 3824|      0|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3825|      0|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3826|      0|                    return 0;
 3827|      0|                }
 3828|   485k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   485k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   485k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3829|   485k|            }
 3830|   485k|            while (c != '\'');
  ------------------
  |  Branch (3830:20): [True: 351k, False: 134k]
  ------------------
 3831|   134k|        }
 3832|   260k|    }
 3833|       |
 3834|      2|    return delim;
 3835|      2|}
lexer.c:MapStr:
 3471|    686|{
 3472|  8.82k|    while ( *str )
  ------------------
  |  Branch (3472:13): [True: 8.13k, False: 686]
  ------------------
 3473|  8.13k|    {
 3474|  8.13k|        uint i = (byte) *str++;
 3475|  8.13k|        lexmap[i] |= code;
 3476|  8.13k|    }
 3477|    686|}
lexer.c:AddAttrToList:
 4174|  19.1k|{
 4175|  19.1k|  if ( *list == NULL )
  ------------------
  |  Branch (4175:8): [True: 1.44k, False: 17.7k]
  ------------------
 4176|  1.44k|    *list = av;
 4177|  17.7k|  else
 4178|  17.7k|  {
 4179|  17.7k|    AttVal* here = *list;
 4180|  53.7M|    while ( here->next )
  ------------------
  |  Branch (4180:13): [True: 53.7M, False: 17.7k]
  ------------------
 4181|  53.7M|      here = here->next;
 4182|  17.7k|    here->next = av;
 4183|  17.7k|  }
 4184|  19.1k|}

prvTidyReport:
  943|   231k|{
  944|   231k|    va_list args;
  945|   231k|    va_start(args, code);
  946|   231k|    vReport(doc, element, node, code, args);
  947|       |    va_end(args);
  948|   231k|}
prvTidyReportAttrError:
  965|  57.7k|{
  966|  57.7k|    TY_(Report)( doc, NULL, node, code, av );
  ------------------
  |  |   23|  57.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  967|  57.7k|}
prvTidyReportEntityError:
  978|  2.85k|{
  979|       |    /* Note that the report formatter currently doesn't use argument c */
  980|  2.85k|    TY_(Report)( doc, NULL, NULL, code, entity, c );
  ------------------
  |  |   23|  2.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  981|  2.85k|}
prvTidyReportEncodingError:
  991|   168k|{
  992|   168k|    TY_(Report)( doc, NULL, NULL, code, c, discarded );
  ------------------
  |  |   23|   168k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   168k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  993|   168k|}
prvTidyReportSurrogateError:
 1009|  1.10k|{
 1010|  1.10k|    TY_(Report)( doc, NULL, NULL, code, c1,c2 );
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1011|  1.10k|}
prvTidyDialogue:
 1130|    107|{
 1131|    107|    int i = 0;
 1132|    107|    va_list args;
 1133|       |
 1134|    708|    while ( dialogueDispatchTable[i].code != 0 )
  ------------------
  |  Branch (1134:13): [True: 708, False: 0]
  ------------------
 1135|    708|    {
 1136|    708|        if ( dialogueDispatchTable[i].code == code )
  ------------------
  |  Branch (1136:14): [True: 107, False: 601]
  ------------------
 1137|    107|        {
 1138|    107|            TidyMessageImpl *message;
 1139|    107|            TidyReportLevel level = dialogueDispatchTable[i].level;
 1140|    107|            va_start(args, code);
 1141|    107|            message = formatDialogue( doc, code, level, args );
 1142|    107|            va_end(args);
 1143|    107|            messageOut( message );
 1144|    107|            break;
 1145|    107|        }
 1146|    601|        i++;
 1147|    601|    }
 1148|    107|}
prvTidyReportMarkupVersion:
 1274|     98|{
 1275|     98|    if ( doc->givenDoctype )
  ------------------
  |  Branch (1275:10): [True: 0, False: 98]
  ------------------
 1276|      0|        TY_(Report)( doc, NULL, NULL, STRING_DOCTYPE_GIVEN, doc->givenDoctype );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1277|       |
 1278|     98|    if ( ! cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1278:10): [True: 0, False: 98]
  ------------------
 1279|      0|    {
 1280|      0|        Bool isXhtml = doc->lexer->isvoyager;
 1281|      0|        uint apparentVers = TY_(ApparentVersion)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1282|      0|        ctmbstr vers = TY_(HTMLVersionNameFromCode)( apparentVers, isXhtml );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1283|       |
 1284|      0|        if ( !vers )
  ------------------
  |  Branch (1284:14): [True: 0, False: 0]
  ------------------
 1285|      0|            vers = tidyLocalizedString(STRING_HTML_PROPRIETARY);
 1286|       |
 1287|      0|        TY_(Report)( doc, NULL, NULL, STRING_CONTENT_LOOKS, vers );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1288|       |
 1289|       |        /* Warn about missing system identifier (SI) in emitted doctype */
 1290|      0|        if ( TY_(WarnMissingSIInEmittedDocType)( doc ) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1290:14): [True: 0, False: 0]
  ------------------
 1291|      0|            TY_(Report)( doc, NULL, NULL, STRING_NO_SYSID );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1292|      0|    }
 1293|     98|}
prvTidyReportNumWarnings:
 1300|     98|{
 1301|     98|    if ( doc->warnings > 0 || doc->errors > 0 )
  ------------------
  |  Branch (1301:10): [True: 83, False: 15]
  |  Branch (1301:31): [True: 1, False: 14]
  ------------------
 1302|     84|    {
 1303|     84|        if ( doc->errors > cfg(doc, TidyShowErrors) || !cfgBool(doc, TidyShowWarnings) )
  ------------------
  |  |  415|    168|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                      if ( doc->errors > cfg(doc, TidyShowErrors) || !cfgBool(doc, TidyShowWarnings) )
  ------------------
  |  |  418|     82|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     82|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1303:14): [True: 2, False: 82]
  |  Branch (1303:56): [True: 82, False: 0]
  ------------------
 1304|     84|        {
 1305|     84|            TY_(Dialogue)( doc, STRING_NOT_ALL_SHOWN );
  ------------------
  |  |   23|     84|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     84|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1306|     84|        }
 1307|      0|        else
 1308|      0|        {
 1309|      0|            TY_(Dialogue)( doc, STRING_ERROR_COUNT );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1310|      0|        }
 1311|       |
 1312|     84|    }
 1313|     14|    else
 1314|     14|    {
 1315|     14|        TY_(Dialogue)( doc, STRING_NO_ERRORS );
  ------------------
  |  |   23|     14|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     14|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1316|     14|    }
 1317|     98|}
prvTidyFreeMutedMessageList:
 1326|     98|{
 1327|     98|    TidyMutedMessages *list = &(doc->muted);
 1328|       |
 1329|     98|    if ( list->list )
  ------------------
  |  Branch (1329:10): [True: 0, False: 98]
  ------------------
 1330|      0|        TidyFree( doc->allocator, list->list );
  ------------------
  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 1331|     98|}
prvTidytidyErrorCodeAsKey:
 1436|   231k|{
 1437|   231k|    uint i = 0;
 1438|  24.8M|    while (tidyStringsKeys[i].key) {
  ------------------
  |  Branch (1438:12): [True: 24.8M, False: 0]
  ------------------
 1439|  24.8M|        if ( tidyStringsKeys[i].value == code )
  ------------------
  |  Branch (1439:14): [True: 231k, False: 24.5M]
  ------------------
 1440|   231k|            return tidyStringsKeys[i].key;
 1441|  24.5M|        i++;
 1442|  24.5M|    }
 1443|      0|    return "UNDEFINED";
 1444|   231k|}
message.c:vReport:
  903|   231k|{
  904|   231k|    int i = 0;
  905|   231k|    va_list args_copy;
  906|       |
  907|  11.8M|    while ( dispatchTable[i].code != 0 )
  ------------------
  |  Branch (907:13): [True: 11.8M, False: 0]
  ------------------
  908|  11.8M|    {
  909|  11.8M|        if ( dispatchTable[i].code == code )
  ------------------
  |  Branch (909:14): [True: 231k, False: 11.6M]
  ------------------
  910|   231k|        {
  911|   231k|            TidyMessageImpl *message;
  912|   231k|            messageFormatter *handler = dispatchTable[i].handler;
  913|   231k|            TidyReportLevel level = dispatchTable[i].level;
  914|       |
  915|   231k|            va_copy(args_copy, args);
  916|   231k|            message = handler( doc, element, node, code, level, args_copy );
  917|   231k|            va_end(args_copy);
  918|       |
  919|   231k|            messageOut( message );
  920|       |
  921|   231k|            if ( dispatchTable[i].next )
  ------------------
  |  Branch (921:18): [True: 0, False: 231k]
  ------------------
  922|      0|            {
  923|      0|                va_copy(args_copy, args);
  924|      0|                vReport(doc, element, node, dispatchTable[i].next, args_copy);
  925|      0|                va_end(args_copy);
  926|      0|            }
  927|   231k|            break;
  928|   231k|        }
  929|  11.6M|        i++;
  930|  11.6M|    }
  931|   231k|}
message.c:formatStandard:
  673|  4.53k|{
  674|  4.53k|    char nodedesc[ 256 ] = {0};
  675|  4.53k|    char elemdesc[ 256 ] = {0};
  676|  4.53k|    Node* rpt = ( element ? element : node );
  ------------------
  |  Branch (676:19): [True: 204, False: 4.32k]
  ------------------
  677|       |
  678|  4.53k|    TagToString(node, nodedesc, sizeof(nodedesc));
  679|       |
  680|  4.53k|    if ( element )
  ------------------
  |  Branch (680:10): [True: 204, False: 4.32k]
  ------------------
  681|    204|        TagToString(element, elemdesc, sizeof(elemdesc));
  682|       |
  683|  4.53k|    switch ( code )
  ------------------
  |  Branch (683:14): [True: 4.53k, False: 0]
  ------------------
  684|  4.53k|    {
  685|      0|        case CUSTOM_TAG_DETECTED:
  ------------------
  |  Branch (685:9): [True: 0, False: 4.53k]
  ------------------
  686|      0|        {
  687|      0|            ctmbstr tagtype;
  688|      0|            switch ( cfg( doc, TidyUseCustomTags ) )
  ------------------
  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  689|      0|            {
  690|      0|                case TidyCustomBlocklevel:
  ------------------
  |  Branch (690:17): [True: 0, False: 0]
  ------------------
  691|      0|                    tagtype = tidyLocalizedString( TIDYCUSTOMBLOCKLEVEL_STRING );
  692|      0|                    break;
  693|      0|                case TidyCustomEmpty:
  ------------------
  |  Branch (693:17): [True: 0, False: 0]
  ------------------
  694|      0|                    tagtype = tidyLocalizedString( TIDYCUSTOMEMPTY_STRING );
  695|      0|                    break;
  696|      0|                case TidyCustomInline:
  ------------------
  |  Branch (696:17): [True: 0, False: 0]
  ------------------
  697|      0|                    tagtype = tidyLocalizedString( TIDYCUSTOMINLINE_STRING );
  698|      0|                    break;
  699|      0|                case TidyCustomPre:
  ------------------
  |  Branch (699:17): [True: 0, False: 0]
  ------------------
  700|      0|                default:
  ------------------
  |  Branch (700:17): [True: 0, False: 0]
  ------------------
  701|      0|                    tagtype = tidyLocalizedString( TIDYCUSTOMPRE_STRING );
  702|      0|                    break;
  703|      0|            }
  704|      0|            return TY_(tidyMessageCreateWithNode)(doc, element, code, level, elemdesc, tagtype );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  705|      0|        }
  706|       |
  707|      0|        case STRING_NO_SYSID:
  ------------------
  |  Branch (707:9): [True: 0, False: 4.53k]
  ------------------
  708|      0|            return TY_(tidyMessageCreate)( doc, code, level );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  709|       |            
  710|      0|        case FILE_CANT_OPEN:
  ------------------
  |  Branch (710:9): [True: 0, False: 4.53k]
  ------------------
  711|      0|        case FILE_CANT_OPEN_CFG:
  ------------------
  |  Branch (711:9): [True: 0, False: 4.53k]
  ------------------
  712|      0|        case FILE_NOT_FILE:
  ------------------
  |  Branch (712:9): [True: 0, False: 4.53k]
  ------------------
  713|      0|        case STRING_CONTENT_LOOKS:
  ------------------
  |  Branch (713:9): [True: 0, False: 4.53k]
  ------------------
  714|      0|        case STRING_DOCTYPE_GIVEN:
  ------------------
  |  Branch (714:9): [True: 0, False: 4.53k]
  ------------------
  715|      0|        case STRING_MISSING_MALFORMED:
  ------------------
  |  Branch (715:9): [True: 0, False: 4.53k]
  ------------------
  716|      0|        case STRING_MUTING_TYPE:
  ------------------
  |  Branch (716:9): [True: 0, False: 4.53k]
  ------------------
  717|      0|        {
  718|      0|            ctmbstr str;
  719|      0|            if ( (str = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (719:18): [True: 0, False: 0]
  ------------------
  720|      0|                return TY_(tidyMessageCreate)( doc, code, level, str );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  721|       |
  722|      0|        } break;
  723|       |
  724|      0|        case APOS_UNDEFINED:
  ------------------
  |  Branch (724:9): [True: 0, False: 4.53k]
  ------------------
  725|      1|        case MISSING_SEMICOLON_NCR:
  ------------------
  |  Branch (725:9): [True: 1, False: 4.53k]
  ------------------
  726|     42|        case MISSING_SEMICOLON:
  ------------------
  |  Branch (726:9): [True: 41, False: 4.49k]
  ------------------
  727|    333|        case UNESCAPED_AMPERSAND:
  ------------------
  |  Branch (727:9): [True: 291, False: 4.24k]
  ------------------
  728|  2.85k|        case UNKNOWN_ENTITY:
  ------------------
  |  Branch (728:9): [True: 2.52k, False: 2.00k]
  ------------------
  729|  2.85k|        {
  730|  2.85k|            ctmbstr entityname;
  731|  2.85k|            if ( !(entityname = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (731:18): [True: 0, False: 2.85k]
  ------------------
  732|      0|            {
  733|      0|                entityname = "NULL";
  734|      0|            }
  735|  2.85k|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, entityname);
  ------------------
  |  |   23|  2.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  736|    333|        }
  737|       |
  738|      0|        case MISSING_ATTRIBUTE:
  ------------------
  |  Branch (738:9): [True: 0, False: 4.53k]
  ------------------
  739|      0|        {
  740|      0|            ctmbstr name;
  741|      0|            if ( (name = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (741:18): [True: 0, False: 0]
  ------------------
  742|      0|                return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc, name );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  743|      0|        } break;
  744|       |
  745|      0|        case STRING_UNKNOWN_OPTION:
  ------------------
  |  Branch (745:9): [True: 0, False: 4.53k]
  ------------------
  746|      0|        case OPTION_REMOVED:
  ------------------
  |  Branch (746:9): [True: 0, False: 4.53k]
  ------------------
  747|      0|        {
  748|      0|            ctmbstr str;
  749|      0|            if ( (str = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (749:18): [True: 0, False: 0]
  ------------------
  750|      0|                return TY_(tidyMessageCreateWithLexer)(doc, code, level, str);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  751|      0|        } break;
  752|       |
  753|      0|        case OPTION_REMOVED_UNAPPLIED:
  ------------------
  |  Branch (753:9): [True: 0, False: 4.53k]
  ------------------
  754|      0|        case STRING_ARGUMENT_BAD:
  ------------------
  |  Branch (754:9): [True: 0, False: 4.53k]
  ------------------
  755|      0|        {
  756|      0|            ctmbstr s1 = va_arg( args, ctmbstr );
  757|      0|            ctmbstr s2 = va_arg( args, ctmbstr );
  758|      0|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, s1, s2);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  759|      0|        }
  760|       |
  761|      0|        case OPTION_REMOVED_APPLIED:
  ------------------
  |  Branch (761:9): [True: 0, False: 4.53k]
  ------------------
  762|      0|        {
  763|      0|            ctmbstr s1 = va_arg( args, ctmbstr );
  764|      0|            ctmbstr s2 = va_arg( args, ctmbstr );
  765|      0|            ctmbstr s3 = va_arg( args, ctmbstr );
  766|      0|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, s1, s2, s3);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  767|      0|        }
  768|       |
  769|       |
  770|      0|        case BAD_SURROGATE_LEAD:
  ------------------
  |  Branch (770:9): [True: 0, False: 4.53k]
  ------------------
  771|      0|        case BAD_SURROGATE_PAIR:
  ------------------
  |  Branch (771:9): [True: 0, False: 4.53k]
  ------------------
  772|  1.10k|        case BAD_SURROGATE_TAIL:
  ------------------
  |  Branch (772:9): [True: 1.10k, False: 3.42k]
  ------------------
  773|  1.10k|        {
  774|  1.10k|            uint c1 = va_arg( args, uint );
  775|  1.10k|            uint c2 = va_arg( args, uint );
  776|  1.10k|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, c1, c2);
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  777|      0|        }
  778|       |
  779|      0|        case SPACE_PRECEDING_XMLDECL:
  ------------------
  |  Branch (779:9): [True: 0, False: 4.53k]
  ------------------
  780|       |            /* @TODO: Should this be a TidyInfo "silent" fix? */
  781|      0|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  782|       |
  783|      0|        case CANT_BE_NESTED:
  ------------------
  |  Branch (783:9): [True: 0, False: 4.53k]
  ------------------
  784|      0|        case NOFRAMES_CONTENT:
  ------------------
  |  Branch (784:9): [True: 0, False: 4.53k]
  ------------------
  785|      0|        case USING_BR_INPLACE_OF:
  ------------------
  |  Branch (785:9): [True: 0, False: 4.53k]
  ------------------
  786|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  787|      0|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  788|       |
  789|      0|        case ELEMENT_VERS_MISMATCH_ERROR:
  ------------------
  |  Branch (789:9): [True: 0, False: 4.53k]
  ------------------
  790|      0|        case ELEMENT_VERS_MISMATCH_WARN:
  ------------------
  |  Branch (790:9): [True: 0, False: 4.53k]
  ------------------
  791|      0|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc, HTMLVersion(doc) );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  792|       |
  793|      0|        case TAG_NOT_ALLOWED_IN:
  ------------------
  |  Branch (793:9): [True: 0, False: 4.53k]
  ------------------
  794|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  795|      0|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc, element ? element->element : NULL );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (795:85): [True: 0, False: 0]
  ------------------
  796|       |
  797|      0|        case INSERTING_TAG:
  ------------------
  |  Branch (797:9): [True: 0, False: 4.53k]
  ------------------
  798|      0|        case MISSING_STARTTAG:
  ------------------
  |  Branch (798:9): [True: 0, False: 4.53k]
  ------------------
  799|      0|        case TOO_MANY_ELEMENTS:
  ------------------
  |  Branch (799:9): [True: 0, False: 4.53k]
  ------------------
  800|      0|        case UNEXPECTED_ENDTAG:
  ------------------
  |  Branch (800:9): [True: 0, False: 4.53k]
  ------------------
  801|      0|        case UNEXPECTED_ENDTAG_ERR:  /* generated by XML docs */
  ------------------
  |  Branch (801:9): [True: 0, False: 4.53k]
  ------------------
  802|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  803|      0|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, node->element );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  804|       |
  805|    204|        case UNEXPECTED_ENDTAG_IN:
  ------------------
  |  Branch (805:9): [True: 204, False: 4.32k]
  ------------------
  806|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  807|    204|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, node->element, element ? element->element : NULL );
  ------------------
  |  |   23|    204|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    204|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (807:90): [True: 204, False: 0]
  ------------------
  808|       |
  809|      0|        case BAD_CDATA_CONTENT:
  ------------------
  |  Branch (809:9): [True: 0, False: 4.53k]
  ------------------
  810|      0|        case CONTENT_AFTER_BODY:
  ------------------
  |  Branch (810:9): [True: 0, False: 4.53k]
  ------------------
  811|      0|        case DOCTYPE_AFTER_TAGS:
  ------------------
  |  Branch (811:9): [True: 0, False: 4.53k]
  ------------------
  812|      0|        case DUPLICATE_FRAMESET:
  ------------------
  |  Branch (812:9): [True: 0, False: 4.53k]
  ------------------
  813|      0|        case MALFORMED_COMMENT:
  ------------------
  |  Branch (813:9): [True: 0, False: 4.53k]
  ------------------
  814|     13|        case MALFORMED_COMMENT_DROPPING:
  ------------------
  |  Branch (814:9): [True: 13, False: 4.51k]
  ------------------
  815|     18|        case MALFORMED_COMMENT_EOS:
  ------------------
  |  Branch (815:9): [True: 5, False: 4.52k]
  ------------------
  816|     18|        case MALFORMED_COMMENT_WARN:
  ------------------
  |  Branch (816:9): [True: 0, False: 4.53k]
  ------------------
  817|     67|        case MALFORMED_DOCTYPE:
  ------------------
  |  Branch (817:9): [True: 49, False: 4.48k]
  ------------------
  818|     67|        case MISSING_DOCTYPE:
  ------------------
  |  Branch (818:9): [True: 0, False: 4.53k]
  ------------------
  819|     67|        case MISSING_TITLE_ELEMENT:
  ------------------
  |  Branch (819:9): [True: 0, False: 4.53k]
  ------------------
  820|     67|        case NESTED_QUOTATION:
  ------------------
  |  Branch (820:9): [True: 0, False: 4.53k]
  ------------------
  821|    365|        case SUSPECTED_MISSING_QUOTE:
  ------------------
  |  Branch (821:9): [True: 298, False: 4.23k]
  ------------------
  822|    365|        case XML_DECLARATION_DETECTED:
  ------------------
  |  Branch (822:9): [True: 0, False: 4.53k]
  ------------------
  823|    365|        case BLANK_TITLE_ELEMENT:
  ------------------
  |  Branch (823:9): [True: 0, False: 4.53k]
  ------------------
  824|    365|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level );
  ------------------
  |  |   23|    365|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    365|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  825|       |
  826|      0|        case ELEMENT_NOT_EMPTY:
  ------------------
  |  Branch (826:9): [True: 0, False: 4.53k]
  ------------------
  827|      0|        case FOUND_STYLE_IN_BODY:
  ------------------
  |  Branch (827:9): [True: 0, False: 4.53k]
  ------------------
  828|      0|        case ILLEGAL_NESTING:
  ------------------
  |  Branch (828:9): [True: 0, False: 4.53k]
  ------------------
  829|      0|        case MOVED_STYLE_TO_HEAD:
  ------------------
  |  Branch (829:9): [True: 0, False: 4.53k]
  ------------------
  830|      0|        case TRIM_EMPTY_ELEMENT:
  ------------------
  |  Branch (830:9): [True: 0, False: 4.53k]
  ------------------
  831|      0|        case UNEXPECTED_END_OF_FILE:
  ------------------
  |  Branch (831:9): [True: 0, False: 4.53k]
  ------------------
  832|      0|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, elemdesc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  833|       |
  834|      0|        case OBSOLETE_ELEMENT:
  ------------------
  |  Branch (834:9): [True: 0, False: 4.53k]
  ------------------
  835|      0|        case REPLACING_ELEMENT:
  ------------------
  |  Branch (835:9): [True: 0, False: 4.53k]
  ------------------
  836|      0|        case REPLACING_UNEX_ELEMENT:
  ------------------
  |  Branch (836:9): [True: 0, False: 4.53k]
  ------------------
  837|      0|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, elemdesc, nodedesc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  838|       |
  839|      0|        case ADDED_MISSING_CHARSET:
  ------------------
  |  Branch (839:9): [True: 0, False: 4.53k]
  ------------------
  840|      0|        case BAD_SUMMARY_HTML5:
  ------------------
  |  Branch (840:9): [True: 0, False: 4.53k]
  ------------------
  841|      0|        case NESTED_EMPHASIS:
  ------------------
  |  Branch (841:9): [True: 0, False: 4.53k]
  ------------------
  842|      0|        case PROPRIETARY_ELEMENT:
  ------------------
  |  Branch (842:9): [True: 0, False: 4.53k]
  ------------------
  843|      0|        case REMOVED_HTML5:
  ------------------
  |  Branch (843:9): [True: 0, False: 4.53k]
  ------------------
  844|      0|        case UNKNOWN_ELEMENT:
  ------------------
  |  Branch (844:9): [True: 0, False: 4.53k]
  ------------------
  845|      0|        case UNKNOWN_ELEMENT_LOOKS_CUSTOM:
  ------------------
  |  Branch (845:9): [True: 0, False: 4.53k]
  ------------------
  846|      0|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, nodedesc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  847|       |
  848|      0|        case MISSING_ENDTAG_FOR:
  ------------------
  |  Branch (848:9): [True: 0, False: 4.53k]
  ------------------
  849|      0|        case MISSING_ENDTAG_OPTIONAL:
  ------------------
  |  Branch (849:9): [True: 0, False: 4.53k]
  ------------------
  850|      0|        case PREVIOUS_LOCATION:
  ------------------
  |  Branch (850:9): [True: 0, False: 4.53k]
  ------------------
  851|      0|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, element? element->element : NULL );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (851:74): [True: 0, False: 0]
  ------------------
  852|       |
  853|      0|        case MISSING_ENDTAG_BEFORE:
  ------------------
  |  Branch (853:9): [True: 0, False: 4.53k]
  ------------------
  854|      0|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, element? element->element : NULL, nodedesc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (854:74): [True: 0, False: 0]
  ------------------
  855|       |
  856|      0|        case COERCE_TO_ENDTAG:
  ------------------
  |  Branch (856:9): [True: 0, False: 4.53k]
  ------------------
  857|      0|        case NON_MATCHING_ENDTAG:
  ------------------
  |  Branch (857:9): [True: 0, False: 4.53k]
  ------------------
  858|      0|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, node->element, node->element );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  859|      0|        case TOO_MANY_ELEMENTS_IN:
  ------------------
  |  Branch (859:9): [True: 0, False: 4.53k]
  ------------------
  860|      0|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, node->element, element ? element->element : NULL);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (860:89): [True: 0, False: 0]
  ------------------
  861|       |
  862|  4.53k|    }
  863|       |
  864|      0|    return NULL;
  865|  4.53k|}
message.c:TagToString:
   42|  62.6k|{
   43|  62.6k|    *buf = 0;
   44|  62.6k|    if (tag)
  ------------------
  |  Branch (44:9): [True: 58.3k, False: 4.35k]
  ------------------
   45|  58.3k|    {
   46|  58.3k|        if (TY_(nodeIsElement)(tag))
  ------------------
  |  |   23|  58.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  58.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (46:13): [True: 57.9k, False: 377]
  ------------------
   47|  57.9k|            TY_(tmbsnprintf)(buf, count, "<%s>", tag->element);
  ------------------
  |  |   23|  57.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   48|    377|        else if (tag->type == EndTag)
  ------------------
  |  Branch (48:18): [True: 204, False: 173]
  ------------------
   49|    204|            TY_(tmbsnprintf)(buf, count, "</%s>", tag->element);
  ------------------
  |  |   23|    204|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    204|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   50|    173|        else if (tag->type == DocTypeTag)
  ------------------
  |  Branch (50:18): [True: 69, False: 104]
  ------------------
   51|     69|            TY_(tmbsnprintf)(buf, count, "<!DOCTYPE>");
  ------------------
  |  |   23|     69|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     69|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   52|    104|        else if (tag->type == TextNode)
  ------------------
  |  Branch (52:18): [True: 104, False: 0]
  ------------------
   53|    104|            TY_(tmbsnprintf)(buf, count, "%s", "STRING_PLAIN_TEXT");
  ------------------
  |  |   23|    104|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    104|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   54|      0|        else if (tag->type == XmlDecl)
  ------------------
  |  Branch (54:18): [True: 0, False: 0]
  ------------------
   55|      0|            TY_(tmbsnprintf)(buf, count, "%s", "STRING_XML_DECLARATION");
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   56|      0|        else if (tag->element)
  ------------------
  |  Branch (56:18): [True: 0, False: 0]
  ------------------
   57|      0|            TY_(tmbsnprintf)(buf, count, "%s", tag->element);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   58|  58.3k|    }
   59|  62.6k|    return buf + TY_(tmbstrlen)(buf);
  ------------------
  |  |   23|  62.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  62.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   60|  62.6k|}
message.c:formatAttributeReport:
  533|  57.7k|{
  534|  57.7k|    AttVal *av = NULL;
  535|  57.7k|    char const *name = "NULL";
  536|  57.7k|    char const *value = "NULL";
  537|  57.7k|    char tagdesc[64];
  538|       |
  539|  57.7k|    TagToString(node, tagdesc, sizeof(tagdesc));
  540|       |
  541|  57.7k|    if ( ( av = va_arg(args, AttVal*) ) )
  ------------------
  |  Branch (541:10): [True: 34.0k, False: 23.7k]
  ------------------
  542|  34.0k|    {
  543|  34.0k|        if (av->attribute)
  ------------------
  |  Branch (543:13): [True: 34.0k, False: 0]
  ------------------
  544|  34.0k|            name = av->attribute;
  545|  34.0k|        if (av->value)
  ------------------
  |  Branch (545:13): [True: 889, False: 33.1k]
  ------------------
  546|    889|            value = av->value;
  547|  34.0k|    }
  548|       |
  549|  57.7k|    switch (code)
  ------------------
  |  Branch (549:13): [True: 57.7k, False: 0]
  ------------------
  550|  57.7k|    {
  551|    275|        case MISSING_QUOTEMARK_OPEN:
  ------------------
  |  Branch (551:9): [True: 275, False: 57.5k]
  ------------------
  552|    275|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, name );
  ------------------
  |  |   23|    275|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    275|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  553|       |		
  554|      0|        case BACKSLASH_IN_URI:
  ------------------
  |  Branch (554:9): [True: 0, False: 57.7k]
  ------------------
  555|      4|        case ESCAPED_ILLEGAL_URI:
  ------------------
  |  Branch (555:9): [True: 4, False: 57.7k]
  ------------------
  556|      6|        case FIXED_BACKSLASH:
  ------------------
  |  Branch (556:9): [True: 2, False: 57.7k]
  ------------------
  557|      6|        case ID_NAME_MISMATCH:
  ------------------
  |  Branch (557:9): [True: 0, False: 57.7k]
  ------------------
  558|     10|        case ILLEGAL_URI_CODEPOINT:
  ------------------
  |  Branch (558:9): [True: 4, False: 57.7k]
  ------------------
  559|     10|        case ILLEGAL_URI_REFERENCE:
  ------------------
  |  Branch (559:9): [True: 0, False: 57.7k]
  ------------------
  560|     10|        case INVALID_XML_ID:
  ------------------
  |  Branch (560:9): [True: 0, False: 57.7k]
  ------------------
  561|     10|        case MISSING_IMAGEMAP:
  ------------------
  |  Branch (561:9): [True: 0, False: 57.7k]
  ------------------
  562|     30|        case MISSING_QUOTEMARK:
  ------------------
  |  Branch (562:9): [True: 20, False: 57.7k]
  ------------------
  563|    634|        case NEWLINE_IN_URI:
  ------------------
  |  Branch (563:9): [True: 604, False: 57.1k]
  ------------------
  564|    634|        case UNEXPECTED_EQUALSIGN:
  ------------------
  |  Branch (564:9): [True: 0, False: 57.7k]
  ------------------
  565|  6.00k|        case UNEXPECTED_GT:
  ------------------
  |  Branch (565:9): [True: 5.37k, False: 52.4k]
  ------------------
  566|  6.26k|        case UNEXPECTED_QUOTEMARK:
  ------------------
  |  Branch (566:9): [True: 252, False: 57.5k]
  ------------------
  567|  23.7k|        case WHITE_IN_URI:
  ------------------
  |  Branch (567:9): [True: 17.5k, False: 40.2k]
  ------------------
  568|  23.7k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc );
  ------------------
  |  |   23|  23.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  569|       |
  570|      0|        case ATTRIBUTE_IS_NOT_ALLOWED:
  ------------------
  |  Branch (570:9): [True: 0, False: 57.7k]
  ------------------
  571|      0|        case JOINING_ATTRIBUTE:
  ------------------
  |  Branch (571:9): [True: 0, False: 57.7k]
  ------------------
  572|  32.3k|        case MISSING_ATTR_VALUE:
  ------------------
  |  Branch (572:9): [True: 32.3k, False: 25.4k]
  ------------------
  573|  32.3k|        case PROPRIETARY_ATTRIBUTE:
  ------------------
  |  Branch (573:9): [True: 0, False: 57.7k]
  ------------------
  574|  32.3k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name );
  ------------------
  |  |   23|  32.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  575|       |
  576|      0|        case ATTRIBUTE_VALUE_REPLACED:
  ------------------
  |  Branch (576:9): [True: 0, False: 57.7k]
  ------------------
  577|      0|        case BAD_ATTRIBUTE_VALUE:
  ------------------
  |  Branch (577:9): [True: 0, False: 57.7k]
  ------------------
  578|      0|        case BAD_ATTRIBUTE_VALUE_REPLACED:
  ------------------
  |  Branch (578:9): [True: 0, False: 57.7k]
  ------------------
  579|      0|        case INSERTING_AUTO_ATTRIBUTE:
  ------------------
  |  Branch (579:9): [True: 0, False: 57.7k]
  ------------------
  580|    516|        case INVALID_ATTRIBUTE:
  ------------------
  |  Branch (580:9): [True: 516, False: 57.2k]
  ------------------
  581|    516|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name, value );
  ------------------
  |  |   23|    516|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    516|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  582|       |
  583|      0|        case MISMATCHED_ATTRIBUTE_ERROR:
  ------------------
  |  Branch (583:9): [True: 0, False: 57.7k]
  ------------------
  584|      0|        case MISMATCHED_ATTRIBUTE_WARN:
  ------------------
  |  Branch (584:9): [True: 0, False: 57.7k]
  ------------------
  585|      0|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name, HTMLVersion(doc));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  586|       |
  587|      0|        case ANCHOR_NOT_UNIQUE:
  ------------------
  |  Branch (587:9): [True: 0, False: 57.7k]
  ------------------
  588|      0|        case ANCHOR_DUPLICATED:
  ------------------
  |  Branch (588:9): [True: 0, False: 57.7k]
  ------------------
  589|      0|        case ATTR_VALUE_NOT_LCASE:
  ------------------
  |  Branch (589:9): [True: 0, False: 57.7k]
  ------------------
  590|      0|        case PROPRIETARY_ATTR_VALUE:
  ------------------
  |  Branch (590:9): [True: 0, False: 57.7k]
  ------------------
  591|      0|        case XML_ID_SYNTAX:
  ------------------
  |  Branch (591:9): [True: 0, False: 57.7k]
  ------------------
  592|      0|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, value );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  593|       |
  594|    848|        case REPEATED_ATTRIBUTE:
  ------------------
  |  Branch (594:9): [True: 848, False: 56.9k]
  ------------------
  595|    848|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, value, name );
  ------------------
  |  |   23|    848|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    848|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  596|       |
  597|      1|        case UNEXPECTED_END_OF_FILE_ATTR:
  ------------------
  |  Branch (597:9): [True: 1, False: 57.7k]
  ------------------
  598|       |            /* on end of file adjust reported position to end of input */
  599|      1|            doc->lexer->lines   = doc->docIn->curline;
  600|      1|            doc->lexer->columns = doc->docIn->curcol;
  601|      1|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, tagdesc );
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  602|  57.7k|    }
  603|       |
  604|      0|    return NULL;
  605|  57.7k|}
message.c:formatStandardDynamic:
  872|    163|{
  873|    163|    char nodedesc[ 256 ] = {0};
  874|       |
  875|    163|    TagToString(node, nodedesc, sizeof(nodedesc));
  876|       |
  877|    163|    switch (code)
  ------------------
  |  Branch (877:13): [True: 163, False: 0]
  ------------------
  878|    163|    {
  879|    163|        case DISCARDING_UNEXPECTED:
  ------------------
  |  Branch (879:9): [True: 163, False: 0]
  ------------------
  880|       |            /* Force error if in a bad form, or Issue #166 - repeated <main> element. */
  881|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  882|    163|            return TY_(tidyMessageCreateWithNode)(doc, node, code, doc->badForm ? TidyError : TidyWarning, nodedesc );
  ------------------
  |  |   23|    163|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    163|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (882:68): [True: 0, False: 163]
  ------------------
  883|      0|            break;
  884|    163|    }
  885|       |
  886|      0|    return NULL;
  887|    163|}
message.c:formatEncodingReport:
  616|   168k|{
  617|   168k|    char buf[ 32 ] = {'\0'};
  618|   168k|    uint c = va_arg( args, uint );
  619|   168k|    Bool discarded = va_arg( args, Bool );
  620|   168k|    ctmbstr action = tidyLocalizedString(discarded ? STRING_DISCARDING : STRING_REPLACING);
  ------------------
  |  Branch (620:42): [True: 0, False: 168k]
  ------------------
  621|       |
  622|   168k|    switch (code)
  ------------------
  |  Branch (622:13): [True: 168k, False: 0]
  ------------------
  623|   168k|    {
  624|      1|        case INVALID_NCR:
  ------------------
  |  Branch (624:9): [True: 1, False: 168k]
  ------------------
  625|      1|            NtoS(c, buf);
  626|      1|            doc->badChars |= BC_INVALID_NCR;
  ------------------
  |  |  305|      1|#define BC_INVALID_NCR             64
  ------------------
  627|      1|            break;
  628|       |
  629|      0|        case INVALID_SGML_CHARS:
  ------------------
  |  Branch (629:9): [True: 0, False: 168k]
  ------------------
  630|      0|            NtoS(c, buf);
  631|      0|            doc->badChars |= BC_INVALID_SGML_CHARS;
  ------------------
  |  |  300|      0|#define BC_INVALID_SGML_CHARS      2
  ------------------
  632|      0|            break;
  633|       |
  634|   168k|        case INVALID_UTF8:
  ------------------
  |  Branch (634:9): [True: 168k, False: 1]
  ------------------
  635|   168k|            TY_(tmbsnprintf)(buf, sizeof(buf), "U+%04X", c);
  ------------------
  |  |   23|   168k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   168k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  636|   168k|            doc->badChars |= BC_INVALID_UTF8;
  ------------------
  |  |  301|   168k|#define BC_INVALID_UTF8            4
  ------------------
  637|   168k|            break;
  638|       |
  639|      0|        case INVALID_UTF16:
  ------------------
  |  Branch (639:9): [True: 0, False: 168k]
  ------------------
  640|      0|            TY_(tmbsnprintf)(buf, sizeof(buf), "U+%04X", c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  641|      0|            doc->badChars |= BC_INVALID_UTF16;
  ------------------
  |  |  302|      0|#define BC_INVALID_UTF16           8
  ------------------
  642|      0|            break;
  643|       |
  644|      0|        case VENDOR_SPECIFIC_CHARS:
  ------------------
  |  Branch (644:9): [True: 0, False: 168k]
  ------------------
  645|      0|            NtoS(c, buf);
  646|      0|            doc->badChars |= BC_VENDOR_SPECIFIC_CHARS;
  ------------------
  |  |  299|      0|#define BC_VENDOR_SPECIFIC_CHARS   1
  ------------------
  647|      0|            break;
  648|       |
  649|      0|        case ENCODING_MISMATCH:
  ------------------
  |  Branch (649:9): [True: 0, False: 168k]
  ------------------
  650|      0|            doc->badChars |= BC_ENCODING_MISMATCH;
  ------------------
  |  |  303|      0|#define BC_ENCODING_MISMATCH       16 /* fatal error */
  ------------------
  651|      0|            return TY_(tidyMessageCreateWithLexer)(doc,
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  652|      0|                                                   code,
  653|      0|                                                   level,
  654|      0|                                                   TY_(CharEncodingName)(doc->docIn->encoding),
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  655|      0|                                                   TY_(CharEncodingName)(c));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  656|      0|            break;
  657|   168k|    }
  658|       |
  659|   168k|    return TY_(tidyMessageCreateWithLexer)(doc, code, level, action, buf );
  ------------------
  |  |   23|   168k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   168k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  660|       |
  661|   168k|}
message.c:NtoS:
   65|      1|{
   66|      1|    tmbchar buf[40];
   67|      1|    int i;
   68|       |    
   69|      2|    for (i = 0;; ++i)
   70|      3|    {
   71|      3|        buf[i] = (tmbchar)( (n % 10) + '0' );
   72|       |        
   73|      3|        n = n / 10;
   74|       |        
   75|      3|        if (n == 0)
  ------------------
  |  Branch (75:13): [True: 1, False: 2]
  ------------------
   76|      1|            break;
   77|      3|    }
   78|       |    
   79|      1|    n = i;
   80|       |    
   81|      4|    while (i >= 0)
  ------------------
  |  Branch (81:12): [True: 3, False: 1]
  ------------------
   82|      3|    {
   83|      3|        str[n-i] = buf[i];
   84|      3|        --i;
   85|      3|    }
   86|       |    
   87|      1|    str[n+1] = '\0';
   88|      1|}
message.c:formatDialogue:
 1077|    107|{
 1078|    107|    switch (code)
 1079|    107|    {
 1080|      0|        case TEXT_SGML_CHARS:
  ------------------
  |  Branch (1080:9): [True: 0, False: 107]
  ------------------
 1081|      0|        case TEXT_VENDOR_CHARS:
  ------------------
  |  Branch (1081:9): [True: 0, False: 107]
  ------------------
 1082|      0|        {
 1083|      0|            ctmbstr str = va_arg(args, ctmbstr);
 1084|      0|            return TY_(tidyMessageCreate)( doc, code, level, str );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1085|      0|        }
 1086|       |            
 1087|      0|        case STRING_ERROR_COUNT:
  ------------------
  |  Branch (1087:9): [True: 0, False: 107]
  ------------------
 1088|     84|        case STRING_NOT_ALL_SHOWN:
  ------------------
  |  Branch (1088:9): [True: 84, False: 23]
  ------------------
 1089|     84|            return TY_(tidyMessageCreate)( doc, code, level,
  ------------------
  |  |   23|     84|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     84|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1090|     84|                                           doc->warnings, "STRING_ERROR_COUNT_WARNING",
 1091|     84|                                           doc->errors, "STRING_ERROR_COUNT_ERROR" );
 1092|       |
 1093|      0|        case FOOTNOTE_TRIM_EMPTY_ELEMENT:
  ------------------
  |  Branch (1093:9): [True: 0, False: 107]
  ------------------
 1094|      0|        case STRING_HELLO_ACCESS:
  ------------------
  |  Branch (1094:9): [True: 0, False: 107]
  ------------------
 1095|      9|        case STRING_NEEDS_INTERVENTION:
  ------------------
  |  Branch (1095:9): [True: 9, False: 98]
  ------------------
 1096|     23|        case STRING_NO_ERRORS:
  ------------------
  |  Branch (1096:9): [True: 14, False: 93]
  ------------------
 1097|     23|        case TEXT_ACCESS_ADVICE1:
  ------------------
  |  Branch (1097:9): [True: 0, False: 107]
  ------------------
 1098|     23|        case TEXT_ACCESS_ADVICE2:
  ------------------
  |  Branch (1098:9): [True: 0, False: 107]
  ------------------
 1099|     23|        case TEXT_BAD_FORM:
  ------------------
  |  Branch (1099:9): [True: 0, False: 107]
  ------------------
 1100|     23|        case TEXT_BAD_MAIN:
  ------------------
  |  Branch (1100:9): [True: 0, False: 107]
  ------------------
 1101|     23|        case TEXT_GENERAL_INFO:
  ------------------
  |  Branch (1101:9): [True: 0, False: 107]
  ------------------
 1102|     23|        case TEXT_GENERAL_INFO_PLEA:
  ------------------
  |  Branch (1102:9): [True: 0, False: 107]
  ------------------
 1103|     23|        case TEXT_HTML_T_ALGORITHM:
  ------------------
  |  Branch (1103:9): [True: 0, False: 107]
  ------------------
 1104|     23|        case TEXT_INVALID_URI:
  ------------------
  |  Branch (1104:9): [True: 0, False: 107]
  ------------------
 1105|     23|        case TEXT_INVALID_UTF8:
  ------------------
  |  Branch (1105:9): [True: 0, False: 107]
  ------------------
 1106|     23|        case TEXT_INVALID_UTF16:
  ------------------
  |  Branch (1106:9): [True: 0, False: 107]
  ------------------
 1107|     23|        case TEXT_M_IMAGE_ALT:
  ------------------
  |  Branch (1107:9): [True: 0, False: 107]
  ------------------
 1108|     23|        case TEXT_M_IMAGE_MAP:
  ------------------
  |  Branch (1108:9): [True: 0, False: 107]
  ------------------
 1109|     23|        case TEXT_M_LINK_ALT:
  ------------------
  |  Branch (1109:9): [True: 0, False: 107]
  ------------------
 1110|     23|        case TEXT_M_SUMMARY:
  ------------------
  |  Branch (1110:9): [True: 0, False: 107]
  ------------------
 1111|     23|        case TEXT_USING_BODY:
  ------------------
  |  Branch (1111:9): [True: 0, False: 107]
  ------------------
 1112|     23|        case TEXT_USING_FONT:
  ------------------
  |  Branch (1112:9): [True: 0, False: 107]
  ------------------
 1113|     23|        case TEXT_USING_FRAMES:
  ------------------
  |  Branch (1113:9): [True: 0, False: 107]
  ------------------
 1114|     23|        case TEXT_USING_LAYER:
  ------------------
  |  Branch (1114:9): [True: 0, False: 107]
  ------------------
 1115|     23|        case TEXT_USING_NOBR:
  ------------------
  |  Branch (1115:9): [True: 0, False: 107]
  ------------------
 1116|     23|        case TEXT_USING_SPACER:
  ------------------
  |  Branch (1116:9): [True: 0, False: 107]
  ------------------
 1117|     23|        default:
  ------------------
  |  Branch (1117:9): [True: 0, False: 107]
  ------------------
 1118|     23|            return TY_(tidyMessageCreate)( doc, code, level );
  ------------------
  |  |   23|     23|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     23|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1119|    107|    }
 1120|       |    
 1121|      0|    return NULL;
 1122|    107|}
message.c:messageOut:
  116|   231k|{
  117|   231k|    TidyDocImpl *doc;
  118|   231k|    Bool go = yes;
  119|       |
  120|   231k|    if ( !message )
  ------------------
  |  Branch (120:10): [True: 0, False: 231k]
  ------------------
  121|      0|        return;
  122|       |
  123|   231k|    doc = message->tidyDoc;
  124|       |
  125|       |    /* The filter has had a chance to suppress *any* message from output. */
  126|   231k|    go = message->allowMessage;
  127|       |
  128|       |    /* Update the count of each report type. */
  129|   231k|    switch ( message->level )
  130|   231k|    {
  131|    275|        case TidyInfo:
  ------------------
  |  Branch (131:9): [True: 275, False: 230k]
  ------------------
  132|    275|            doc->infoMessages++;
  133|    275|            break;
  134|   230k|        case TidyWarning:
  ------------------
  |  Branch (134:9): [True: 230k, False: 591]
  ------------------
  135|   230k|            doc->warnings++;
  136|   230k|            break;
  137|      0|        case TidyConfig:
  ------------------
  |  Branch (137:9): [True: 0, False: 231k]
  ------------------
  138|      0|            doc->optionErrors++;
  139|      0|            break;
  140|      0|        case TidyAccess:
  ------------------
  |  Branch (140:9): [True: 0, False: 231k]
  ------------------
  141|      0|            doc->accessErrors++;
  142|      0|            break;
  143|    209|        case TidyError:
  ------------------
  |  Branch (143:9): [True: 209, False: 231k]
  ------------------
  144|    209|            doc->errors++;
  145|    209|            break;
  146|      0|        case TidyBadDocument:
  ------------------
  |  Branch (146:9): [True: 0, False: 231k]
  ------------------
  147|      0|            doc->docErrors++;
  148|      0|            break;
  149|      0|        case TidyFatal:
  ------------------
  |  Branch (149:9): [True: 0, False: 231k]
  ------------------
  150|       |            /* Ack! */
  151|      0|            break;
  152|    107|        default:
  ------------------
  |  Branch (152:9): [True: 107, False: 231k]
  ------------------
  153|    107|            break;
  154|   231k|    }
  155|       |
  156|       |    /* Suppress report messages if they've been muted. */
  157|   231k|    go = go & !message->muted;
  158|       |
  159|       |    /* Suppress report messages if we've already reached the reporting limit. */
  160|   231k|    if ( message->level <= TidyFatal )
  ------------------
  |  Branch (160:10): [True: 231k, False: 107]
  ------------------
  161|   231k|    {
  162|   231k|        go = go & ( doc->errors < cfg(doc, TidyShowErrors) );
  ------------------
  |  |  415|   231k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  163|   231k|    }
  164|       |
  165|       |    /* Let TidyQuiet silence a lot of things. */
  166|   231k|    if ( cfgBool( doc, TidyQuiet ) == yes )
  ------------------
  |  |  418|   231k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   231k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (166:10): [True: 231k, False: 0]
  ------------------
  167|   231k|    {
  168|   231k|        go = go && message->code != STRING_DOCTYPE_GIVEN;
  ------------------
  |  Branch (168:14): [True: 142k, False: 88.9k]
  |  Branch (168:20): [True: 142k, False: 0]
  ------------------
  169|   231k|        go = go && message->code != STRING_CONTENT_LOOKS;
  ------------------
  |  Branch (169:14): [True: 142k, False: 88.9k]
  |  Branch (169:20): [True: 142k, False: 0]
  ------------------
  170|   231k|        go = go && message->code != STRING_NO_SYSID;
  ------------------
  |  Branch (170:14): [True: 142k, False: 88.9k]
  |  Branch (170:20): [True: 142k, False: 0]
  ------------------
  171|   231k|        go = go && message->level != TidyDialogueInfo;
  ------------------
  |  Branch (171:14): [True: 142k, False: 88.9k]
  |  Branch (171:20): [True: 142k, False: 0]
  ------------------
  172|   231k|        go = go && message->level != TidyConfig;
  ------------------
  |  Branch (172:14): [True: 142k, False: 88.9k]
  |  Branch (172:20): [True: 142k, False: 0]
  ------------------
  173|   231k|        go = go && message->level != TidyInfo;
  ------------------
  |  Branch (173:14): [True: 142k, False: 88.9k]
  |  Branch (173:20): [True: 142k, False: 47]
  ------------------
  174|   231k|        go = go && !(message->level >= TidyDialogueSummary &&
  ------------------
  |  Branch (174:14): [True: 142k, False: 88.9k]
  |  Branch (174:22): [True: 107, False: 142k]
  ------------------
  175|    107|                            message->code != STRING_NEEDS_INTERVENTION);
  ------------------
  |  Branch (175:29): [True: 98, False: 9]
  ------------------
  176|   231k|    }
  177|       |
  178|       |    /* Let !TidyShowInfo silence some things. */
  179|   231k|    if ( cfgBool( doc, TidyShowInfo ) == no )
  ------------------
  |  |  418|   231k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   231k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (179:10): [True: 0, False: 231k]
  ------------------
  180|      0|    {
  181|      0|        go = go && message->level != TidyInfo;
  ------------------
  |  Branch (181:14): [True: 0, False: 0]
  |  Branch (181:20): [True: 0, False: 0]
  ------------------
  182|       |
  183|       |        /* Temporary; TidyShowInfo shouldn't affect TidyDialogueInfo, but
  184|       |           right now such messages are hidden until we granularize the
  185|       |           output controls. */
  186|      0|        go = go && message->level != TidyDialogueInfo;
  ------------------
  |  Branch (186:14): [True: 0, False: 0]
  |  Branch (186:20): [True: 0, False: 0]
  ------------------
  187|      0|    }
  188|       |
  189|       |    /* Let !TidyShowWarnings silence some things. */
  190|   231k|    if ( cfgBool( doc, TidyShowWarnings ) == no )
  ------------------
  |  |  418|   231k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   231k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (190:10): [True: 231k, False: 0]
  ------------------
  191|   231k|    {
  192|   231k|        go = go && message->level != TidyWarning;
  ------------------
  |  Branch (192:14): [True: 142k, False: 89.0k]
  |  Branch (192:20): [True: 27, False: 142k]
  ------------------
  193|   231k|    }
  194|       |
  195|       |    /* Output the message if applicable. */
  196|   231k|    if ( go )
  ------------------
  |  Branch (196:10): [True: 27, False: 231k]
  ------------------
  197|     27|    {
  198|     27|        TidyOutputSink *outp = &doc->errout->sink;
  199|     27|        ctmbstr cp;
  200|     27|        byte b = '\0';
  201|  2.07k|        for ( cp = message->messageOutput; *cp; ++cp )
  ------------------
  |  Branch (201:44): [True: 2.04k, False: 27]
  ------------------
  202|  2.04k|        {
  203|  2.04k|            b = (*cp & 0xff);
  204|  2.04k|            if (b == (byte)'\n')
  ------------------
  |  Branch (204:17): [True: 18, False: 2.02k]
  ------------------
  205|     18|                TY_(WriteChar)( b, doc->errout );   /* for EOL translation */
  ------------------
  |  |   23|     18|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     18|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  206|  2.02k|            else
  207|  2.02k|                outp->putByte( outp->sinkData, b ); /* #383 - no encoding */
  208|  2.04k|        }
  209|       |
  210|       |        /* Always add a trailing newline. Reports require this, and dialogue
  211|       |           messages will be better spaced out without having to fill the
  212|       |           language file with superfluous newlines. */
  213|     27|        TY_(WriteChar)( '\n', doc->errout );
  ------------------
  |  |   23|     27|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     27|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  214|     27|    }
  215|       |
  216|   231k|    TY_(tidyMessageRelease)(message);
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  217|   231k|}

prvTidytidyMessageCreate:
  245|    107|{
  246|    107|    TidyMessageImpl *result;
  247|    107|    va_list args;
  248|    107|    va_start(args, level);
  249|    107|    result = tidyMessageCreateInitV(doc, NULL, code, 0, 0, level, args);
  250|    107|    va_end(args);
  251|       |    
  252|    107|    return result;
  253|    107|}
prvTidytidyMessageCreateWithNode:
  261|  58.5k|{
  262|  58.5k|    TidyMessageImpl *result;
  263|  58.5k|    va_list args_copy;
  264|  58.5k|    int line = ( node ? node->line :
  ------------------
  |  Branch (264:18): [True: 58.1k, False: 391]
  ------------------
  265|  58.5k|                ( doc->lexer ? doc->lexer->lines : 0 ) );
  ------------------
  |  Branch (265:19): [True: 391, False: 0]
  ------------------
  266|  58.5k|    int col  = ( node ? node->column :
  ------------------
  |  Branch (266:18): [True: 58.1k, False: 391]
  ------------------
  267|  58.5k|                ( doc->lexer ? doc->lexer->columns : 0 ) );
  ------------------
  |  Branch (267:19): [True: 391, False: 0]
  ------------------
  268|       |    
  269|  58.5k|    va_start(args_copy, level);
  270|  58.5k|    result = tidyMessageCreateInitV(doc, node, code, line, col, level, args_copy);
  271|  58.5k|    va_end(args_copy);
  272|       |    
  273|  58.5k|    return result;
  274|  58.5k|}
prvTidytidyMessageCreateWithLexer:
  281|   172k|{
  282|   172k|    TidyMessageImpl *result;
  283|   172k|    va_list args_copy;
  284|   172k|    int line = ( doc->lexer ? doc->lexer->lines : 0 );
  ------------------
  |  Branch (284:18): [True: 172k, False: 0]
  ------------------
  285|   172k|    int col  = ( doc->lexer ? doc->lexer->columns : 0 );
  ------------------
  |  Branch (285:18): [True: 172k, False: 0]
  ------------------
  286|       |    
  287|   172k|    va_start(args_copy, level);
  288|   172k|    result = tidyMessageCreateInitV(doc, NULL, code, line, col, level, args_copy);
  289|   172k|    va_end(args_copy);
  290|       |    
  291|   172k|    return result;
  292|   172k|}
prvTidytidyMessageRelease:
  296|   231k|{
  297|   231k|    if ( !message )
  ------------------
  |  Branch (297:10): [True: 0, False: 231k]
  ------------------
  298|      0|        return;
  299|   231k|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->arguments );
  ------------------
  |  |  159|   231k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   231k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  300|   231k|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->messageDefault );
  ------------------
  |  |  159|   231k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   231k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  301|   231k|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->message );
  ------------------
  |  |  159|   231k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   231k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  302|   231k|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->messagePosDefault );
  ------------------
  |  |  159|   231k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   231k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  303|   231k|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->messagePos );
  ------------------
  |  |  159|   231k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   231k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  304|   231k|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->messageOutputDefault );
  ------------------
  |  |  159|   231k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   231k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  305|   231k|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->messageOutput );
  ------------------
  |  |  159|   231k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   231k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  306|   231k|    TidyDocFree(tidyDocToImpl(message->tidyDoc), message); /* Issue #597 - and discard the message structure */
  ------------------
  |  |  159|   231k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   231k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  307|   231k|}
messageobj.c:tidyMessageCreateInitV:
   81|   231k|{
   82|   231k|    TidyMessageImpl *result = TidyDocAlloc(doc, sizeof(TidyMessageImpl));
  ------------------
  |  |  157|   231k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   231k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
   83|   231k|    TidyDoc tdoc = tidyImplToDoc(doc);
  ------------------
  |  |  141|   231k|#define tidyImplToDoc( doc )            ((TidyDoc)(doc))
  ------------------
   84|   231k|    va_list args_copy;
   85|   231k|    enum { sizeMessageBuf=2048 };
   86|   231k|    ctmbstr pattern;
   87|   231k|    uint i = 0;
   88|       |
   89|       |
   90|       |    /* Things we know... */
   91|       |
   92|   231k|    result->tidyDoc = doc;
   93|   231k|    result->tidyNode = node;
   94|   231k|    result->code = code;
   95|   231k|    result->line = line;
   96|   231k|    result->column = column;
   97|   231k|    result->level = level;
   98|       |    /* Is #719 - set 'muted' before any callbacks. */
   99|   231k|    result->muted = no;
  100|   231k|    i = 0;
  101|   231k|    while ((doc->muted.list) && (doc->muted.list[i] != 0))
  ------------------
  |  Branch (101:12): [True: 0, False: 231k]
  |  Branch (101:33): [True: 0, False: 0]
  ------------------
  102|      0|    {
  103|      0|        if (doc->muted.list[i] == code)
  ------------------
  |  Branch (103:13): [True: 0, False: 0]
  ------------------
  104|      0|        {
  105|      0|            result->muted = yes;
  106|      0|            break;
  107|      0|        }
  108|      0|        i++;
  109|      0|    }
  110|       |
  111|       |    /* Things we create... */
  112|       |
  113|   231k|    va_copy(args_copy, args);
  114|   231k|    result->arguments = BuildArgArray(doc, tidyDefaultString(code), args_copy, &result->argcount);
  115|   231k|    va_end(args_copy);
  116|       |
  117|   231k|    result->messageKey = TY_(tidyErrorCodeAsKey)(code);
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  118|       |
  119|   231k|    result->messageFormatDefault = tidyDefaultString(code);
  120|   231k|    result->messageFormat = tidyLocalizedString(code);
  121|       |
  122|   231k|    result->messageDefault = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|   231k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   231k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  123|   231k|    va_copy(args_copy, args);
  124|   231k|    TY_(tmbvsnprintf)(result->messageDefault, sizeMessageBuf, result->messageFormatDefault, args_copy);
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  125|   231k|    va_end(args_copy);
  126|       |
  127|   231k|    result->message = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|   231k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   231k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  128|   231k|    va_copy(args_copy, args);
  129|   231k|    TY_(tmbvsnprintf)(result->message, sizeMessageBuf, result->messageFormat, args_copy);
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  130|   231k|    va_end(args_copy);
  131|       |
  132|       |    /* Some things already hit us localized, and some things need to be
  133|       |       localized here. Look for these codewords and replace them here.
  134|       |     */
  135|   231k|    TY_(strrep)(result->messageDefault, "STRING_PLAIN_TEXT",      tidyDefaultString(STRING_PLAIN_TEXT));
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  136|   231k|    TY_(strrep)(result->message,        "STRING_PLAIN_TEXT",      tidyLocalizedString(STRING_PLAIN_TEXT));
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  137|       |
  138|   231k|    TY_(strrep)(result->messageDefault, "STRING_XML_DECLARATION", tidyDefaultString(STRING_XML_DECLARATION));
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  139|   231k|    TY_(strrep)(result->message,        "STRING_XML_DECLARATION", tidyLocalizedString(STRING_XML_DECLARATION));
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  140|       |
  141|   231k|    TY_(strrep)(result->messageDefault, "STRING_ERROR_COUNT_WARNING", tidyDefaultStringN(STRING_ERROR_COUNT_WARNING, doc->warnings));
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  142|   231k|    TY_(strrep)(result->message,        "STRING_ERROR_COUNT_WARNING", tidyLocalizedStringN(STRING_ERROR_COUNT_WARNING, doc->warnings));
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  143|       |
  144|   231k|    TY_(strrep)(result->messageDefault, "STRING_ERROR_COUNT_ERROR", tidyDefaultStringN(STRING_ERROR_COUNT_ERROR, doc->errors));
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  145|   231k|    TY_(strrep)(result->message,        "STRING_ERROR_COUNT_ERROR", tidyLocalizedStringN(STRING_ERROR_COUNT_ERROR, doc->errors));
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  146|       |
  147|       |
  148|   231k|    result->messagePosDefault = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|   231k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   231k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  149|   231k|    result->messagePos = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|   231k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   231k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  150|       |
  151|   231k|    if ( cfgBool(doc, TidyEmacs) && cfgStr(doc, TidyEmacsFile) )
  ------------------
  |  |  418|   462k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   231k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 231k]
  |  |  ------------------
  ------------------
                  if ( cfgBool(doc, TidyEmacs) && cfgStr(doc, TidyEmacsFile) )
  ------------------
  |  |  424|      0|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  |  |  ------------------
  |  |  |  Branch (424:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  152|      0|    {
  153|       |        /* Change formatting to be parsable by GNU Emacs */
  154|      0|        TY_(tmbsnprintf)(result->messagePosDefault, sizeMessageBuf, "%s:%d:%d: ", cfgStr(doc, TidyEmacsFile), line, column);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(tmbsnprintf)(result->messagePosDefault, sizeMessageBuf, "%s:%d:%d: ", cfgStr(doc, TidyEmacsFile), line, column);
  ------------------
  |  |  424|      0|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  ------------------
  155|      0|        TY_(tmbsnprintf)(result->messagePos, sizeMessageBuf, "%s:%d:%d: ", cfgStr(doc, TidyEmacsFile), line, column);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(tmbsnprintf)(result->messagePos, sizeMessageBuf, "%s:%d:%d: ", cfgStr(doc, TidyEmacsFile), line, column);
  ------------------
  |  |  424|      0|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  ------------------
  156|      0|    }
  157|   231k|    else if ( cfgBool(doc, TidyShowFilename) && cfgStr(doc, TidyEmacsFile) )
  ------------------
  |  |  418|   462k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   231k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 231k]
  |  |  ------------------
  ------------------
                  else if ( cfgBool(doc, TidyShowFilename) && cfgStr(doc, TidyEmacsFile) )
  ------------------
  |  |  424|      0|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  |  |  ------------------
  |  |  |  Branch (424:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  158|      0|    {
  159|       |        /* Include filename in output */
  160|      0|        TY_(tmbsnprintf)(result->messagePosDefault, sizeMessageBuf, tidyDefaultString(FN_LINE_COLUMN_STRING),
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  161|      0|            cfgStr(doc, TidyEmacsFile), line, column);
  ------------------
  |  |  424|      0|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  ------------------
  162|      0|        TY_(tmbsnprintf)(result->messagePos, sizeMessageBuf, tidyLocalizedString(FN_LINE_COLUMN_STRING),
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  163|      0|            cfgStr(doc, TidyEmacsFile), line, column);
  ------------------
  |  |  424|      0|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  ------------------
  164|      0|    }
  165|   231k|    else
  166|   231k|    {
  167|       |        /* traditional format */
  168|   231k|        TY_(tmbsnprintf)(result->messagePosDefault, sizeMessageBuf, tidyDefaultString(LINE_COLUMN_STRING), line, column);
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  169|   231k|        TY_(tmbsnprintf)(result->messagePos, sizeMessageBuf, tidyLocalizedString(LINE_COLUMN_STRING), line, column);
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  170|   231k|    }
  171|       |
  172|   231k|    result->messagePrefixDefault = tidyDefaultString(level);
  173|       |
  174|   231k|    result->messagePrefix = tidyLocalizedString(level);
  175|       |
  176|   231k|    if ( line > 0 && column > 0 )
  ------------------
  |  Branch (176:10): [True: 231k, False: 107]
  |  Branch (176:22): [True: 231k, False: 0]
  ------------------
  177|   231k|        pattern = "%s%s%s";      /* pattern if there's location information */
  178|    107|    else
  179|    107|        pattern = "%.0s%s%s";    /* otherwise if there isn't */
  180|       |
  181|   231k|    if ( level > TidyFatal )
  ------------------
  |  Branch (181:10): [True: 107, False: 231k]
  ------------------
  182|    107|        pattern = "%.0s%.0s%s";  /* dialog doesn't have pos or prefix */
  183|       |
  184|   231k|    result->messageOutputDefault = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|   231k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   231k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  185|   231k|    TY_(tmbsnprintf)(result->messageOutputDefault, sizeMessageBuf, pattern,
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  186|   231k|                     result->messagePosDefault, result->messagePrefixDefault,
  187|   231k|                     result->messageDefault);
  188|       |
  189|   231k|    result->messageOutput = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|   231k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   231k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  190|   231k|    TY_(tmbsnprintf)(result->messageOutput, sizeMessageBuf, pattern,
  ------------------
  |  |   23|   231k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   231k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  191|   231k|                     result->messagePos, result->messagePrefix,
  192|   231k|                     result->message);
  193|       |
  194|   231k|    if ( ( cfgBool(doc, TidyMuteShow) == yes ) && level <= TidyFatal )
  ------------------
  |  |  418|   231k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   231k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (194:10): [True: 0, False: 231k]
  |  Branch (194:51): [True: 0, False: 0]
  ------------------
  195|      0|    {
  196|       |        /*\ Issue #655 - Unsafe to use output buffer as one of the va_list
  197|       |         *  input parameters in some snprintf implementations.
  198|       |        \*/
  199|      0|        ctmbstr pc = TY_(tidyErrorCodeAsKey)(code);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  200|      0|        i = TY_(tmbstrlen)(result->messageOutputDefault);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  201|      0|        if (i < sizeMessageBuf)
  ------------------
  |  Branch (201:13): [True: 0, False: 0]
  ------------------
  202|      0|            TY_(tmbsnprintf)(result->messageOutputDefault + i, sizeMessageBuf - i, " (%s)", pc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  203|      0|        i = TY_(tmbstrlen)(result->messageOutput);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  204|      0|        if (i < sizeMessageBuf)
  ------------------
  |  Branch (204:13): [True: 0, False: 0]
  ------------------
  205|      0|            TY_(tmbsnprintf)(result->messageOutput + i, sizeMessageBuf - i, " (%s)", pc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  206|      0|    }
  207|       |
  208|   231k|    result->allowMessage = yes;
  209|       |
  210|       |    /* reportFilter is a simple error filter that provides minimal information
  211|       |       to callback functions, and includes the message buffer in LibTidy's
  212|       |       configured localization. As it's a "legacy" API, it does not receive
  213|       |       TidyDialogue messages.*/
  214|   231k|    if ( (result->level <= TidyFatal) && doc->reportFilter )
  ------------------
  |  Branch (214:10): [True: 231k, False: 107]
  |  Branch (214:42): [True: 0, False: 231k]
  ------------------
  215|      0|    {
  216|      0|        result->allowMessage = result->allowMessage & doc->reportFilter( tdoc, result->level, result->line, result->column, result->messageOutput );
  217|      0|    }
  218|       |
  219|       |    /* reportCallback is intended to allow LibTidy users to localize messages
  220|       |       via their own means by providing a key and the parameters to fill it. 
  221|       |       As it's a "legacy" API, it does not receive TidyDialogue messages. */
  222|   231k|    if ( (result->level <= TidyFatal) && doc->reportCallback )
  ------------------
  |  Branch (222:10): [True: 231k, False: 107]
  |  Branch (222:42): [True: 0, False: 231k]
  ------------------
  223|      0|    {
  224|      0|        TidyDoc tdoc = tidyImplToDoc( doc );
  ------------------
  |  |  141|      0|#define tidyImplToDoc( doc )            ((TidyDoc)(doc))
  ------------------
  225|      0|        va_copy(args_copy, args);
  226|      0|        result->allowMessage = result->allowMessage & doc->reportCallback( tdoc, result->level, result->line, result->column, result->messageKey, args_copy );
  227|      0|        va_end(args_copy);
  228|      0|    }
  229|       |
  230|       |    /* messageCallback is the newest interface to interrogate Tidy's
  231|       |       emitted messages. */
  232|   231k|    if ( doc->messageCallback )
  ------------------
  |  Branch (232:10): [True: 0, False: 231k]
  ------------------
  233|      0|    {
  234|      0|        result->allowMessage = result->allowMessage & doc->messageCallback( tidyImplToMessage(result) );
  ------------------
  |  |  144|      0|#define tidyImplToMessage( message )    ((TidyMessage)(message))
  ------------------
  235|      0|    }
  236|       |
  237|   231k|    return result;
  238|   231k|}
messageobj.c:BuildArgArray:
  517|   231k|{
  518|   231k|    int number = 0; /* the quantity of valid arguments found; returned as rv. */
  519|   231k|    int cn = -1;    /* keeps track of which parameter index is current. */
  520|   231k|    int i = 0;      /* typical index. */
  521|   231k|    int pos = -1;   /* starting position of current argument. */
  522|   231k|    const char* p;  /* current position in format string. */
  523|   231k|    char c;         /* current character. */
  524|   231k|    struct printfArg* nas;
  525|       |    
  526|       |    /* first pass: determine number of valid % to allocate space. */
  527|       |    
  528|   231k|    p = fmt;
  529|   231k|    *rv = 0;
  530|       |    
  531|  8.36M|    while( ( c = *p++ ) != 0 )
  ------------------
  |  Branch (531:12): [True: 8.13M, False: 231k]
  ------------------
  532|  8.13M|    {
  533|  8.13M|        if( c != '%' )
  ------------------
  |  Branch (533:13): [True: 7.69M, False: 434k]
  ------------------
  534|  7.69M|            continue;
  535|       |        
  536|   434k|        if( ( c = *p++ ) == '%' )	/* skip %% case */
  ------------------
  |  Branch (536:13): [True: 0, False: 434k]
  ------------------
  537|      0|            continue;
  538|   434k|        else
  539|   434k|            number++;
  540|   434k|    }
  541|       |        
  542|       |
  543|   231k|    if( number == 0 )
  ------------------
  |  Branch (543:9): [True: 679, False: 230k]
  ------------------
  544|    679|        return NULL;
  545|       |
  546|       |    
  547|   230k|    nas = (struct printfArg*)TidyDocAlloc( doc, number * sizeof( struct printfArg ) );
  ------------------
  |  |  157|   230k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   230k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  548|   230k|    if( !nas )
  ------------------
  |  Branch (548:9): [True: 0, False: 230k]
  ------------------
  549|      0|    {
  550|      0|        *rv = -1;
  551|      0|        return NULL;
  552|      0|    }
  553|       |
  554|       |
  555|   665k|    for( i = 0; i < number; i++ )
  ------------------
  |  Branch (555:17): [True: 434k, False: 230k]
  ------------------
  556|   434k|    {
  557|   434k|        nas[i].type = tidyFormatType_UNKNOWN;
  558|   434k|    }
  559|       |    
  560|       |    
  561|       |    /* second pass: set nas[].type and location. */
  562|       |    
  563|   230k|    p = fmt;
  564|  8.32M|    while( ( c = *p++ ) != 0 )
  ------------------
  |  Branch (564:12): [True: 8.09M, False: 230k]
  ------------------
  565|  8.09M|    {
  566|  8.09M|        if( c != '%' )
  ------------------
  |  Branch (566:13): [True: 7.66M, False: 434k]
  ------------------
  567|  7.66M|            continue;
  568|       |        
  569|   434k|        if( ( c = *p++ ) == '%' )
  ------------------
  |  Branch (569:13): [True: 0, False: 434k]
  ------------------
  570|      0|            continue; /* skip %% case */
  571|       |
  572|   434k|        pos = p - fmt - 2; /* p already incremented twice */
  573|       |
  574|       |        /* width -- width via parameter */
  575|   434k|        if (c == '*')
  ------------------
  |  Branch (575:13): [True: 0, False: 434k]
  ------------------
  576|      0|        {
  577|       |            /* not supported feature */
  578|      0|            *rv = -1;
  579|      0|            break;
  580|      0|        }
  581|       |        
  582|       |        /* width field -- skip */
  583|   436k|        while ((c >= '0') && (c <= '9'))
  ------------------
  |  Branch (583:16): [True: 436k, False: 0]
  |  Branch (583:30): [True: 2.20k, False: 434k]
  ------------------
  584|  2.20k|        {
  585|  2.20k|            c = *p++;
  586|  2.20k|        }
  587|       |        
  588|       |        /* precision */
  589|   434k|        if (c == '.')
  ------------------
  |  Branch (589:13): [True: 0, False: 434k]
  ------------------
  590|      0|        {
  591|      0|            c = *p++;
  592|      0|            if (c == '*') {
  ------------------
  |  Branch (592:17): [True: 0, False: 0]
  ------------------
  593|       |                /* not supported feature */
  594|      0|                *rv = -1;
  595|      0|                break;
  596|      0|            }
  597|       |            
  598|      0|            while ((c >= '0') && (c <= '9'))
  ------------------
  |  Branch (598:20): [True: 0, False: 0]
  |  Branch (598:34): [True: 0, False: 0]
  ------------------
  599|      0|            {
  600|      0|                c = *p++;
  601|      0|            }
  602|      0|        }
  603|       |        
  604|       |        
  605|   434k|        cn++;
  606|       |        
  607|       |        /* size and format */
  608|   434k|        nas[cn].type = tidyFormatType_UINT;
  609|   434k|        switch (c)
  610|   434k|        {
  611|      0|            case 'c': /* unsigned int (char) */
  ------------------
  |  Branch (611:13): [True: 0, False: 434k]
  ------------------
  612|    168|            case 'u': /* unsigned int */
  ------------------
  |  Branch (612:13): [True: 168, False: 434k]
  ------------------
  613|  1.27k|            case 'X': /* unsigned int as hex */
  ------------------
  |  Branch (613:13): [True: 1.10k, False: 433k]
  ------------------
  614|  1.27k|            case 'x': /* unsigned int as hex */
  ------------------
  |  Branch (614:13): [True: 0, False: 434k]
  ------------------
  615|  1.27k|            case 'o': /* octal */
  ------------------
  |  Branch (615:13): [True: 0, False: 434k]
  ------------------
  616|  1.27k|                nas[cn].u.ui = va_arg( ap, unsigned int );
  617|  1.27k|                break;
  618|       |
  619|      0|            case 'd': /* signed int */
  ------------------
  |  Branch (619:13): [True: 0, False: 434k]
  ------------------
  620|      0|            case 'i': /* signed int */
  ------------------
  |  Branch (620:13): [True: 0, False: 434k]
  ------------------
  621|      0|                nas[cn].type = tidyFormatType_INT;
  622|      0|                nas[cn].u.i = va_arg( ap, int );
  623|      0|                break;
  624|       |
  625|       |
  626|   433k|            case 's': /* string */
  ------------------
  |  Branch (626:13): [True: 433k, False: 1.27k]
  ------------------
  627|   433k|                nas[cn].type = tidyFormatType_STRING;
  628|   433k|                nas[cn].u.s = va_arg( ap, char* );
  629|   433k|                break;
  630|       |
  631|      0|            case 'e': /* double */
  ------------------
  |  Branch (631:13): [True: 0, False: 434k]
  ------------------
  632|      0|            case 'E': /* double */
  ------------------
  |  Branch (632:13): [True: 0, False: 434k]
  ------------------
  633|      0|            case 'f': /* double */
  ------------------
  |  Branch (633:13): [True: 0, False: 434k]
  ------------------
  634|      0|            case 'F': /* double */
  ------------------
  |  Branch (634:13): [True: 0, False: 434k]
  ------------------
  635|      0|            case 'g': /* double */
  ------------------
  |  Branch (635:13): [True: 0, False: 434k]
  ------------------
  636|      0|            case 'G': /* double */
  ------------------
  |  Branch (636:13): [True: 0, False: 434k]
  ------------------
  637|      0|                nas[cn].type = tidyFormatType_DOUBLE;
  638|      0|                nas[cn].u.d = va_arg( ap, double );
  639|      0|                break;
  640|       |
  641|      0|            default:
  ------------------
  |  Branch (641:13): [True: 0, False: 434k]
  ------------------
  642|      0|                nas[cn].type = tidyFormatType_UNKNOWN;
  643|      0|                *rv = -1;
  644|      0|                break;
  645|   434k|        }
  646|       |
  647|       |        /* position and format */
  648|   434k|        nas[cn].formatStart = pos;
  649|   434k|        nas[cn].formatLength = (p - fmt) - pos;
  650|       |        
  651|       |        /* the format string exceeds the buffer length */
  652|   434k|        if ( nas[cn].formatLength >= FORMAT_LENGTH )
  ------------------
  |  |   27|   434k|#define FORMAT_LENGTH 21
  ------------------
  |  Branch (652:14): [True: 0, False: 434k]
  ------------------
  653|      0|        {
  654|      0|            *rv = -1;
  655|      0|            break;
  656|      0|        }
  657|   434k|        else
  658|   434k|        {
  659|   434k|            strncpy(nas[cn].format, fmt + nas[cn].formatStart, nas[cn].formatLength);
  660|   434k|            nas[cn].format[nas[cn].formatLength] = 0; /* Is. #800 - If count <= srcLen, no 0 added! */
  661|   434k|        }
  662|       |        
  663|       |
  664|       |        /* Something's not right. */
  665|   434k|        if( nas[cn].type == tidyFormatType_UNKNOWN )
  ------------------
  |  Branch (665:13): [True: 0, False: 434k]
  ------------------
  666|      0|        {
  667|      0|            *rv = -1;
  668|      0|            break;
  669|      0|        }
  670|   434k|    }
  671|       |    
  672|       |    
  673|       |    /* third pass: fill the nas[cn].ap */
  674|       |    
  675|   230k|    if( *rv < 0 )
  ------------------
  |  Branch (675:9): [True: 0, False: 230k]
  ------------------
  676|      0|    {
  677|      0|        TidyDocFree( doc, nas );;
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  678|      0|        return NULL;
  679|      0|    }
  680|       |
  681|   230k|    *rv = number;
  682|   230k|    return nas;
  683|   230k|}

prvTidyInitParserStack:
  843|     98|{
  844|     98|    enum { default_size = 32 };
  845|     98|    TidyParserMemory *content = (TidyParserMemory *) TidyAlloc( doc->allocator, sizeof(TidyParserMemory) * default_size );
  ------------------
  |  |   66|     98|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  846|       |
  847|     98|    doc->stack.content = content;
  848|     98|    doc->stack.size = default_size;
  849|     98|    doc->stack.top = -1;
  850|     98|}
prvTidyFreeParserStack:
  857|     98|{
  858|     98|    TidyFree( doc->allocator, doc->stack.content );
  ------------------
  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  859|       |
  860|       |    doc->stack.content = NULL;
  861|     98|    doc->stack.size = 0;
  862|     98|    doc->stack.top = -1;
  863|     98|}
prvTidyisEmptyParserStack:
  886|  22.2k|{
  887|  22.2k|    return doc->stack.top < 0;
  888|  22.2k|}
prvTidypeekMemoryIdentity:
  905|  8.09k|{
  906|  8.09k|    return doc->stack.content[doc->stack.top].identity;
  907|  8.09k|}
prvTidypopMemory:
  924|  11.0k|{
  925|  11.0k|    if ( !TY_(isEmptyParserStack)( doc ) )
  ------------------
  |  |   23|  11.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (925:10): [True: 11.0k, False: 0]
  ------------------
  926|  11.0k|    {
  927|  11.0k|        TidyParserMemory data = doc->stack.content[doc->stack.top];
  928|  11.0k|        DEBUG_LOG(SPRTF("\n"
  929|  11.0k|                        "<--POP  original: %s @ %p\n"
  930|  11.0k|                        "         reentry: %s @ %p\n"
  931|  11.0k|                        "     stack depth: %lu @ %p\n"
  932|  11.0k|                        "            mode: %u\n"
  933|  11.0k|                        "      register 1: %i\n"
  934|  11.0k|                        "      register 2: %i\n\n",
  935|  11.0k|                        data.original_node ? data.original_node->element : "none", data.original_node,
  936|  11.0k|                        data.reentry_node ? data.reentry_node->element : "none", data.reentry_node,
  937|  11.0k|                        doc->stack.top, &doc->stack.content[doc->stack.top],
  938|  11.0k|                        data.mode,
  939|  11.0k|                        data.register_1,
  940|  11.0k|                        data.register_2
  941|  11.0k|                        ));
  942|  11.0k|        doc->stack.top = doc->stack.top - 1;
  943|  11.0k|        return data;
  944|  11.0k|    }
  945|      0|    TidyParserMemory blank = { NULL };
  946|      0|    return blank;
  947|  11.0k|}
prvTidypushMemory:
  954|  11.0k|{
  955|  11.0k|    if ( doc->stack.top == doc->stack.size - 1 )
  ------------------
  |  Branch (955:10): [True: 19, False: 10.9k]
  ------------------
  956|     19|        growParserStack( doc );
  957|       |
  958|  11.0k|    doc->stack.top++;
  959|       |    
  960|  11.0k|    doc->stack.content[doc->stack.top] = data;
  961|  11.0k|    DEBUG_LOG(SPRTF("\n"
  962|  11.0k|                    "-->PUSH original: %s @ %p\n"
  963|  11.0k|                    "         reentry: %s @ %p\n"
  964|  11.0k|                    "     stack depth: %lu @ %p\n"
  965|  11.0k|                    "            mode: %u\n"
  966|  11.0k|                    "      register 1: %i\n"
  967|  11.0k|                    "      register 2: %i\n\n",
  968|  11.0k|                    data.original_node ? data.original_node->element : "none", data.original_node,
  969|  11.0k|                    data.reentry_node ? data.reentry_node->element : "none", data.reentry_node,
  970|  11.0k|                    doc->stack.top, &doc->stack.content[doc->stack.top],
  971|  11.0k|                    data.mode,
  972|  11.0k|                    data.register_1,
  973|  11.0k|                    data.register_2
  974|  11.0k|                    ));
  975|  11.0k|}
ParseHTMLWithNode:
 1064|     90|{
 1065|     90|    GetTokenMode mode = IgnoreWhitespace;
 1066|     90|    Parser* parser = GetParserForNode( doc, node );
 1067|     90|    Bool something_to_do = yes;
 1068|       |
 1069|       |    /*
 1070|       |     This main loop is only extinguished when all of the parser tokens are
 1071|       |     consumed. Ideally, EVERY parser will return nodes to this loop for
 1072|       |     dispatch to the appropriate parser, but some of the recursive parsers
 1073|       |     still consume some tokens on their own.
 1074|       |     */
 1075|  16.3k|    while (something_to_do)
  ------------------
  |  Branch (1075:12): [True: 16.3k, False: 90]
  ------------------
 1076|  16.3k|    {
 1077|  16.3k|        node = parser ? parser( doc, node, mode ) : NULL;
  ------------------
  |  Branch (1077:16): [True: 16.3k, False: 0]
  ------------------
 1078|       |        
 1079|       |        /*
 1080|       |         We have a node, so anything deferred was already pushed to the stack
 1081|       |         to be dealt with later.
 1082|       |         */
 1083|  16.3k|        if ( node )
  ------------------
  |  Branch (1083:14): [True: 8.09k, False: 8.21k]
  ------------------
 1084|  8.09k|        {
 1085|  8.09k|            parser = GetParserForNode( doc, node );
 1086|  8.09k|            continue;
 1087|  8.09k|        }
 1088|       |
 1089|       |        /*
 1090|       |         We weren't given a node, which means this particular leaf is bottomed
 1091|       |         out. We'll re-enter the parsers using information from the stack.
 1092|       |         */
 1093|  8.21k|        if ( !TY_(isEmptyParserStack)(doc))
  ------------------
  |  |   23|  8.21k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.21k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1093:14): [True: 8.09k, False: 120]
  ------------------
 1094|  8.09k|        {
 1095|  8.09k|            parser = TY_(peekMemoryIdentity)(doc);
  ------------------
  |  |   23|  8.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1096|  8.09k|            if (parser)
  ------------------
  |  Branch (1096:17): [True: 8.09k, False: 0]
  ------------------
 1097|  8.09k|            {
 1098|  8.09k|                continue;
 1099|  8.09k|            }
 1100|      0|            else
 1101|      0|            {
 1102|       |                /* No parser means we're only passing back a parsing mode. */
 1103|      0|                mode = TY_(peekMemoryMode)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1104|      0|                TY_(popMemory)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1105|      0|            }
 1106|  8.09k|        }
 1107|       |        
 1108|       |        /*
 1109|       |         At this point, there's nothing being returned from parsers, and
 1110|       |         nothing on the stack, so we can draw a new node from the lexer.
 1111|       |         */
 1112|    120|        node = TY_(GetToken)( doc, mode );
  ------------------
  |  |   23|    120|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    120|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1113|    120|        DEBUG_LOG_GOT_TOKEN(node);
 1114|       |
 1115|    120|        if (node)
  ------------------
  |  Branch (1115:13): [True: 30, False: 90]
  ------------------
 1116|     30|            parser = GetParserForNode( doc, node );
 1117|     90|        else
 1118|     90|            something_to_do = no;
 1119|    120|    }
 1120|     90|}
prvTidyCheckNodeIntegrity:
 5902|  72.9k|{
 5903|  72.9k|#ifndef NO_NODE_INTEGRITY_CHECK
 5904|  72.9k|    Node *child;
 5905|       |
 5906|  72.9k|    if (node->prev)
  ------------------
  |  Branch (5906:9): [True: 36.0k, False: 36.8k]
  ------------------
 5907|  36.0k|    {
 5908|  36.0k|        if (node->prev->next != node)
  ------------------
  |  Branch (5908:13): [True: 0, False: 36.0k]
  ------------------
 5909|      0|            return no;
 5910|  36.0k|    }
 5911|       |
 5912|  72.9k|    if (node->next)
  ------------------
  |  Branch (5912:9): [True: 36.0k, False: 36.8k]
  ------------------
 5913|  36.0k|    {
 5914|  36.0k|        if (node->next == node || node->next->prev != node)
  ------------------
  |  Branch (5914:13): [True: 0, False: 36.0k]
  |  Branch (5914:35): [True: 0, False: 36.0k]
  ------------------
 5915|      0|            return no;
 5916|  36.0k|    }
 5917|       |
 5918|  72.9k|    if (node->parent)
  ------------------
  |  Branch (5918:9): [True: 72.8k, False: 98]
  ------------------
 5919|  72.8k|    {
 5920|  72.8k|        if (node->prev == NULL && node->parent->content != node)
  ------------------
  |  Branch (5920:13): [True: 36.7k, False: 36.0k]
  |  Branch (5920:35): [True: 0, False: 36.7k]
  ------------------
 5921|      0|            return no;
 5922|       |
 5923|  72.8k|        if (node->next == NULL && node->parent->last != node)
  ------------------
  |  Branch (5923:13): [True: 36.7k, False: 36.0k]
  |  Branch (5923:35): [True: 0, False: 36.7k]
  ------------------
 5924|      0|            return no;
 5925|  72.8k|    }
 5926|       |
 5927|   145k|    for (child = node->content; child; child = child->next)
  ------------------
  |  Branch (5927:33): [True: 72.8k, False: 72.9k]
  ------------------
 5928|  72.8k|        if ( child->parent != node || !TY_(CheckNodeIntegrity)(child) )
  ------------------
  |  |   23|  72.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  72.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5928:14): [True: 0, False: 72.8k]
  |  Branch (5928:39): [True: 0, False: 72.8k]
  ------------------
 5929|      0|            return no;
 5930|       |
 5931|  72.9k|#endif
 5932|  72.9k|    return yes;
 5933|  72.9k|}
prvTidyInsertNodeAtStart:
 6015|      1|{
 6016|      1|    node->parent = element;
 6017|       |
 6018|      1|    if (element->content == NULL)
  ------------------
  |  Branch (6018:9): [True: 1, False: 0]
  ------------------
 6019|      1|        element->last = node;
 6020|      0|    else
 6021|      0|        element->content->prev = node;
 6022|       |
 6023|      1|    node->next = element->content;
 6024|       |    node->prev = NULL;
 6025|      1|    element->content = node;
 6026|      1|}
prvTidyInsertNodeAtEnd:
 6033|  73.1k|{
 6034|  73.1k|    node->parent = element;
 6035|  73.1k|    node->prev = element ? element->last : NULL;
  ------------------
  |  Branch (6035:18): [True: 73.1k, False: 0]
  ------------------
 6036|       |
 6037|  73.1k|    if (element && element->last != NULL)
  ------------------
  |  Branch (6037:9): [True: 73.1k, False: 0]
  |  Branch (6037:20): [True: 36.2k, False: 36.9k]
  ------------------
 6038|  36.2k|        element->last->next = node;
 6039|  36.9k|    else
 6040|  36.9k|        if (element)
  ------------------
  |  Branch (6040:13): [True: 36.9k, False: 0]
  ------------------
 6041|  36.9k|            element->content = node;
 6042|       |
 6043|  73.1k|    if (element)
  ------------------
  |  Branch (6043:9): [True: 73.1k, False: 0]
  ------------------
 6044|  73.1k|        element->last = node;
 6045|  73.1k|}
prvTidyXMLPreserveWhiteSpace:
 6202|  11.1k|{
 6203|  11.1k|    AttVal *attribute;
 6204|       |
 6205|       |    /* search attributes for xml:space */
 6206|  44.6k|    for (attribute = element->attributes; attribute; attribute = attribute->next)
  ------------------
  |  Branch (6206:43): [True: 33.5k, False: 11.1k]
  ------------------
 6207|  33.5k|    {
 6208|  33.5k|        if (attrIsXML_SPACE(attribute))
  ------------------
  |  |  342|  33.5k|#define attrIsXML_SPACE(av)         AttrIsId( av, TidyAttr_XML_SPACE  )
  |  |  ------------------
  |  |  |  |  169|  33.5k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 33.5k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 299, False: 33.2k]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 299]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6209|      0|        {
 6210|      0|            if (AttrValueIs(attribute, "preserve"))
  ------------------
  |  |  172|      0|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|      0|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 0, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|      0|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 6211|      0|                return yes;
 6212|       |
 6213|      0|            return no;
 6214|      0|        }
 6215|  33.5k|    }
 6216|       |
 6217|  11.1k|    if (element->element == NULL)
  ------------------
  |  Branch (6217:9): [True: 15, False: 11.1k]
  ------------------
 6218|     15|        return no;
 6219|       |        
 6220|       |    /* kludge for html docs without explicit xml:space attribute */
 6221|  11.1k|    if (nodeIsPRE(element)    ||
  ------------------
  |  |  383|  11.1k|#define nodeIsPRE( node )        TagIsId( node, TidyTag_PRE )
  |  |  ------------------
  |  |  |  |  275|  22.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 11.1k, False: 15]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 11.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6222|  11.1k|        nodeIsSCRIPT(element) ||
  ------------------
  |  |  422|  11.1k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  22.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 11.1k, False: 15]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 11.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6223|  11.1k|        nodeIsSTYLE(element)  ||
  ------------------
  |  |  421|  11.1k|#define nodeIsSTYLE( node )      TagIsId( node, TidyTag_STYLE )
  |  |  ------------------
  |  |  |  |  275|  22.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 11.1k, False: 15]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 11.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6224|  11.1k|        TY_(FindParser)(doc, element) == TY_(ParsePre))
  ------------------
  |  |   23|  11.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(FindParser)(doc, element) == TY_(ParsePre))
  ------------------
  |  |   23|  11.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6224:9): [True: 43, False: 11.0k]
  ------------------
 6225|     43|        return yes;
 6226|       |
 6227|       |    /* kludge for XSL docs */
 6228|  11.0k|    if ( TY_(tmbstrcasecmp)(element->element, "xsl:text") == 0 )
  ------------------
  |  |   23|  11.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6228:10): [True: 0, False: 11.0k]
  ------------------
 6229|      0|        return yes;
 6230|       |
 6231|  11.0k|    return no;
 6232|  11.0k|}
prvTidyParseXMLDocument:
 6393|     98|{
 6394|     98|    Node *node, *doctype = NULL;
 6395|       |
 6396|     98|    TY_(SetOptionBool)( doc, TidyXmlTags, yes );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6397|       |
 6398|     98|    doc->xmlDetected = yes;
 6399|       |
 6400|    356|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|    356|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    356|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6400:12): [True: 258, False: 98]
  ------------------
 6401|    258|    {
 6402|       |        /* discard unexpected end tags */
 6403|    258|        if (node->type == EndTag)
  ------------------
  |  Branch (6403:13): [True: 0, False: 258]
  ------------------
 6404|      0|        {
 6405|      0|            TY_(Report)(doc, NULL, node, UNEXPECTED_ENDTAG);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6406|      0|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6407|      0|            continue;
 6408|      0|        }
 6409|       |
 6410|       |         /* deal with comments etc. */
 6411|    258|        if (InsertMisc( &doc->root, node))
  ------------------
  |  Branch (6411:13): [True: 6, False: 252]
  ------------------
 6412|      6|            continue;
 6413|       |
 6414|    252|        if (node->type == DocTypeTag)
  ------------------
  |  Branch (6414:13): [True: 73, False: 179]
  ------------------
 6415|     73|        {
 6416|     73|            if (doctype == NULL)
  ------------------
  |  Branch (6416:17): [True: 14, False: 59]
  ------------------
 6417|     14|            {
 6418|     14|                TY_(InsertNodeAtEnd)( &doc->root, node);
  ------------------
  |  |   23|     14|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     14|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6419|     14|                doctype = node;
 6420|     14|            }
 6421|     59|            else
 6422|     59|            {
 6423|     59|                TY_(Report)(doc, &doc->root, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|     59|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     59|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6424|     59|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|     59|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     59|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6425|     59|            }
 6426|     73|            continue;
 6427|     73|        }
 6428|       |
 6429|    179|        if (node->type == StartEndTag)
  ------------------
  |  Branch (6429:13): [True: 0, False: 179]
  ------------------
 6430|      0|        {
 6431|      0|            TY_(InsertNodeAtEnd)( &doc->root, node);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6432|      0|            continue;
 6433|      0|        }
 6434|       |
 6435|       |       /* if start tag then parse element's content */
 6436|    179|        if (node->type == StartTag)
  ------------------
  |  Branch (6436:13): [True: 90, False: 89]
  ------------------
 6437|     90|        {
 6438|     90|            TY_(InsertNodeAtEnd)( &doc->root, node );
  ------------------
  |  |   23|     90|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     90|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6439|     90|            ParseHTMLWithNode( doc, node );
 6440|     90|            continue;
 6441|     90|        }
 6442|       |
 6443|     89|        TY_(Report)(doc, &doc->root, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|     89|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     89|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6444|     89|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|     89|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     89|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6445|     89|    }
 6446|       |
 6447|       |    /* ensure presence of initial <?xml version="1.0"?> */
 6448|     98|    if ( cfgBool(doc, TidyXmlDecl) )
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 98]
  |  |  ------------------
  ------------------
 6449|      0|        TY_(FixXmlDecl)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6450|     98|}
parser.c:growParserStack:
  870|     19|{
  871|     19|    TidyParserMemory *content;
  872|     19|    content = (TidyParserMemory *) TidyAlloc( doc->allocator, sizeof(TidyParserMemory) * doc->stack.size * 2 );
  ------------------
  |  |   66|     19|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  873|       |
  874|     19|    memcpy( content, doc->stack.content, sizeof(TidyParserMemory) * (doc->stack.top + 1) );
  875|     19|    TidyFree(doc->allocator, doc->stack.content);
  ------------------
  |  |   68|     19|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  876|       |
  877|     19|    doc->stack.content = content;
  878|     19|    doc->stack.size = doc->stack.size * 2;
  879|     19|}
parser.c:GetParserForNode:
 1017|  8.21k|{
 1018|  8.21k|    Lexer* lexer = doc->lexer;
 1019|       |
 1020|  8.21k|    if ( cfgBool( doc, TidyXmlTags ) )
  ------------------
  |  |  418|  8.21k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  8.21k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 8.21k, False: 0]
  |  |  ------------------
  ------------------
 1021|  8.21k|        return ParseXMLElement;
 1022|       |    
 1023|       |    /* [i_a]2 prevent crash for active content (php, asp) docs */
 1024|      0|    if (!node || node->tag == NULL)
  ------------------
  |  Branch (1024:9): [True: 0, False: 0]
  |  Branch (1024:18): [True: 0, False: 0]
  ------------------
 1025|      0|        return NULL;
 1026|       |
 1027|       |    /*
 1028|       |       Fix by GLP 2000-12-21.  Need to reset insertspace if this is both
 1029|       |       a non-inline and empty tag (base, link, meta, isindex, hr, area).
 1030|       |    */
 1031|      0|    if (node->tag->model & CM_EMPTY)
  ------------------
  |  |  139|      0|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (1031:9): [True: 0, False: 0]
  ------------------
 1032|      0|    {
 1033|      0|        lexer->waswhite = no;
 1034|      0|        if (node->tag->parser == NULL)
  ------------------
  |  Branch (1034:13): [True: 0, False: 0]
  ------------------
 1035|      0|            return NULL;
 1036|      0|    }
 1037|      0|    else if (!(node->tag->model & CM_INLINE))
  ------------------
  |  |  143|      0|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1037:14): [True: 0, False: 0]
  ------------------
 1038|      0|        lexer->insertspace = no;
 1039|       |
 1040|      0|    if (node->tag->parser == NULL)
  ------------------
  |  Branch (1040:9): [True: 0, False: 0]
  ------------------
 1041|      0|        return NULL;
 1042|       |
 1043|      0|    if (node->type == StartEndTag)
  ------------------
  |  Branch (1043:9): [True: 0, False: 0]
  ------------------
 1044|      0|        return NULL;
 1045|       |
 1046|       |    /* [i_a]2 added this - not sure why - CHECKME: */
 1047|      0|    lexer->parent = node;
 1048|       |
 1049|      0|    return (node->tag->parser);
 1050|      0|}
parser.c:ParseXMLElement:
 5638|  16.3k|{
 5639|  16.3k|    Lexer* lexer = doc->lexer;
 5640|  16.3k|    Node *node;
 5641|       |
 5642|  16.3k|    if ( element == NULL )
  ------------------
  |  Branch (5642:10): [True: 8.09k, False: 8.21k]
  ------------------
 5643|  8.09k|    {
 5644|  8.09k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  8.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5645|  8.09k|        element = memory.original_node;
 5646|  8.09k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 5647|  8.09k|        mode = memory.reentry_mode;
 5648|  8.09k|        TY_(InsertNodeAtEnd)(element, node); /* The only re-entry action needed. */
  ------------------
  |  |   23|  8.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5649|  8.09k|    }
 5650|  8.21k|    else
 5651|  8.21k|    {
 5652|       |        /* if node is pre or has xml:space="preserve" then do so */
 5653|  8.21k|        if ( TY_(XMLPreserveWhiteSpace)(doc, element) )
  ------------------
  |  |   23|  8.21k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.21k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5653:14): [True: 23, False: 8.19k]
  ------------------
 5654|     23|            mode = Preformatted;
 5655|       |
 5656|       |        /* deal with comments etc. */
 5657|  8.21k|        InsertMisc( &doc->root, element);
 5658|       |        
 5659|       |        /* we shouldn't have plain text at this point. */
 5660|  8.21k|        if (TY_(nodeIsText)(element))
  ------------------
  |  |   23|  8.21k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.21k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5660:13): [True: 15, False: 8.19k]
  ------------------
 5661|     15|        {
 5662|     15|            TY_(Report)(doc, &doc->root, element, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|     15|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     15|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5663|     15|            TY_(FreeNode)( doc, element);
  ------------------
  |  |   23|     15|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     15|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5664|     15|            return NULL;
 5665|     15|        }
 5666|  8.21k|    }
 5667|  52.6k|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|  52.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  52.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5667:12): [True: 44.4k, False: 8.19k]
  ------------------
 5668|  44.4k|    {
 5669|  44.4k|        if (node->type == EndTag &&
  ------------------
  |  Branch (5669:13): [True: 212, False: 44.2k]
  ------------------
 5670|    212|           node->element && element->element &&
  ------------------
  |  Branch (5670:12): [True: 212, False: 0]
  |  Branch (5670:29): [True: 212, False: 0]
  ------------------
 5671|    212|           TY_(tmbstrcmp)(node->element, element->element) == 0)
  ------------------
  |  |   23|    212|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    212|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5671:12): [True: 8, False: 204]
  ------------------
 5672|      8|        {
 5673|      8|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|      8|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      8|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5674|      8|            element->closed = yes;
 5675|      8|            break;
 5676|      8|        }
 5677|       |
 5678|       |        /* discard unexpected end tags */
 5679|  44.4k|        if (node->type == EndTag)
  ------------------
  |  Branch (5679:13): [True: 204, False: 44.2k]
  ------------------
 5680|    204|        {
 5681|    204|            if (element)
  ------------------
  |  Branch (5681:17): [True: 204, False: 0]
  ------------------
 5682|    204|                TY_(Report)(doc, element, node, UNEXPECTED_ENDTAG_IN);
  ------------------
  |  |   23|    204|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    204|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5683|      0|            else
 5684|      0|                TY_(Report)(doc, element, node, UNEXPECTED_ENDTAG_ERR);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5685|       |
 5686|    204|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    204|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    204|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5687|    204|            continue;
 5688|    204|        }
 5689|       |
 5690|       |        /* parse content on seeing start tag */
 5691|  44.2k|        if (node->type == StartTag)
  ------------------
  |  Branch (5691:13): [True: 8.09k, False: 36.1k]
  ------------------
 5692|  8.09k|        {
 5693|  8.09k|            TidyParserMemory memory = {0};
 5694|  8.09k|            memory.identity = ParseXMLElement;
 5695|  8.09k|            memory.original_node = element;
 5696|  8.09k|            memory.reentry_node = node;
 5697|  8.09k|            memory.reentry_mode = mode;
 5698|  8.09k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  8.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5699|  8.09k|            return node;
 5700|  8.09k|        }
 5701|       |
 5702|  36.1k|        TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  36.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5703|  36.1k|    } /* while */
 5704|       |
 5705|       |    /*
 5706|       |     if first child is text then trim initial space and
 5707|       |     delete text node if it is empty.
 5708|       |    */
 5709|       |
 5710|  8.19k|    node = element->content;
 5711|       |
 5712|  8.19k|    if (TY_(nodeIsText)(node) && mode != Preformatted)
  ------------------
  |  |   23|  8.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5712:9): [True: 3.85k, False: 4.34k]
  |  Branch (5712:34): [True: 3.83k, False: 23]
  ------------------
 5713|  3.83k|    {
 5714|  3.83k|        if ( lexer->lexbuf[node->start] == ' ' )
  ------------------
  |  Branch (5714:14): [True: 0, False: 3.83k]
  ------------------
 5715|      0|        {
 5716|      0|            node->start++;
 5717|       |
 5718|      0|            if (node->start >= node->end)
  ------------------
  |  Branch (5718:17): [True: 0, False: 0]
  ------------------
 5719|      0|                TY_(DiscardElement)( doc, node );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5720|      0|        }
 5721|  3.83k|    }
 5722|       |
 5723|       |    /*
 5724|       |     if last child is text then trim final space and
 5725|       |     delete the text node if it is empty
 5726|       |    */
 5727|       |
 5728|  8.19k|    node = element->last;
 5729|       |
 5730|  8.19k|    if (TY_(nodeIsText)(node) && mode != Preformatted)
  ------------------
  |  |   23|  8.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5730:9): [True: 66, False: 8.13k]
  |  Branch (5730:34): [True: 48, False: 18]
  ------------------
 5731|     48|    {
 5732|     48|        if ( lexer->lexbuf[node->end - 1] == ' ' )
  ------------------
  |  Branch (5732:14): [True: 0, False: 48]
  ------------------
 5733|      0|        {
 5734|      0|            node->end--;
 5735|       |
 5736|      0|            if (node->start >= node->end)
  ------------------
  |  Branch (5736:17): [True: 0, False: 0]
  ------------------
 5737|      0|                TY_(DiscardElement)( doc, node );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5738|      0|        }
 5739|     48|    }
 5740|       |    return NULL;
 5741|  16.2k|}
parser.c:InsertMisc:
   90|  8.47k|{
   91|  8.47k|    if (node->type == CommentTag ||
  ------------------
  |  Branch (91:9): [True: 2, False: 8.47k]
  ------------------
   92|  8.47k|        node->type == ProcInsTag ||
  ------------------
  |  Branch (92:9): [True: 0, False: 8.47k]
  ------------------
   93|  8.47k|        node->type == CDATATag ||
  ------------------
  |  Branch (93:9): [True: 0, False: 8.47k]
  ------------------
   94|  8.47k|        node->type == SectionTag ||
  ------------------
  |  Branch (94:9): [True: 2, False: 8.46k]
  ------------------
   95|  8.46k|        node->type == AspTag ||
  ------------------
  |  Branch (95:9): [True: 1, False: 8.46k]
  ------------------
   96|  8.46k|        node->type == JsteTag ||
  ------------------
  |  Branch (96:9): [True: 0, False: 8.46k]
  ------------------
   97|  8.46k|        node->type == PhpTag )
  ------------------
  |  Branch (97:9): [True: 0, False: 8.46k]
  ------------------
   98|      5|    {
   99|      5|        TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|      5|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      5|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  100|      5|        return yes;
  101|      5|    }
  102|       |
  103|  8.46k|    if ( node->type == XmlDecl )
  ------------------
  |  Branch (103:10): [True: 1, False: 8.46k]
  ------------------
  104|      1|    {
  105|      1|        Node* root = element;
  106|      1|        while ( root && root->parent )
  ------------------
  |  Branch (106:17): [True: 1, False: 0]
  |  Branch (106:25): [True: 0, False: 1]
  ------------------
  107|      0|            root = root->parent;
  108|      1|        if ( root && !(root->content && root->content->type == XmlDecl))
  ------------------
  |  Branch (108:14): [True: 1, False: 0]
  |  Branch (108:24): [True: 0, False: 1]
  |  Branch (108:41): [True: 0, False: 0]
  ------------------
  109|      1|        {
  110|      1|          TY_(InsertNodeAtStart)( root, node );
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  111|      1|          return yes;
  112|      1|        }
  113|      1|    }
  114|       |
  115|       |    /* Declared empty tags seem to be slipping through
  116|       |    ** the cracks.  This is an experiment to figure out
  117|       |    ** a decent place to pick them up.
  118|       |    */
  119|  8.46k|    if ( node->tag &&
  ------------------
  |  Branch (119:10): [True: 8.27k, False: 192]
  ------------------
  120|  8.27k|         TY_(nodeIsElement)(node) &&
  ------------------
  |  |   23|  8.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (120:10): [True: 8.27k, False: 0]
  ------------------
  121|  8.27k|         TY_(nodeCMIsEmpty)(node) && TagId(node) == TidyTag_UNKNOWN &&
  ------------------
  |  |   23|  8.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                       TY_(nodeCMIsEmpty)(node) && TagId(node) == TidyTag_UNKNOWN &&
  ------------------
  |  |  270|      0|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 0, False: 0]
  |  |  |  Branch (270:39): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (121:10): [True: 0, False: 8.27k]
  |  Branch (121:38): [True: 0, False: 0]
  ------------------
  122|      0|         (node->tag->versions & VERS_PROPRIETARY) != 0 )
  ------------------
  |  |  231|      0|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|      0|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|      0|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|      0|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  |  Branch (122:10): [True: 0, False: 0]
  ------------------
  123|      0|    {
  124|      0|        TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  125|      0|        return yes;
  126|      0|    }
  127|       |
  128|  8.46k|    return no;
  129|  8.46k|}

prvTidyInitPrintBuf:
  286|    196|{
  287|    196|    TidyClearMemory( &doc->pprint, sizeof(TidyPrintImpl) );
  ------------------
  |  |   70|    196|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  288|    196|    InitIndent( &doc->pprint.indent[0] );
  289|    196|    InitIndent( &doc->pprint.indent[1] );
  290|    196|    doc->pprint.allocator = doc->allocator;
  291|    196|    doc->pprint.line = 0;
  292|    196|}
prvTidyFreePrintBuf:
  299|     98|{
  300|     98|    TidyDocFree( doc, doc->pprint.linebuf );
  ------------------
  |  |  159|     98|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  301|     98|    TY_(InitPrintBuf)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  302|     98|}
prvTidyPFlushLine:
  847|  3.91k|{
  848|  3.91k|    TidyPrintImpl* pprint = &doc->pprint;
  849|       |
  850|  3.91k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (850:10): [True: 3.90k, False: 5]
  ------------------
  851|  3.90k|        PFlushLineImpl( doc );
  852|       |
  853|  3.91k|    TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|  3.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  854|  3.91k|    pprint->line++;
  855|       |
  856|  3.91k|    if (pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (856:9): [True: 5, False: 3.90k]
  ------------------
  857|      5|    {
  858|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_INDENT)
  859|       |        SPRTF("%s Indent from %d to %d\n", __FUNCTION__, pprint->indent[ 0 ].spaces, indent );
  860|       |#endif  
  861|      5|        pprint->indent[ 0 ].spaces = indent;
  862|      5|    }
  863|  3.91k|}
prvTidyPPrintXMLTree:
 2570|     89|{
 2571|     89|    Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|     89|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     89|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2572|     89|    Node* next = NULL;
 2573|       |    
 2574|  34.9k|    while ( node  )
  ------------------
  |  Branch (2574:13): [True: 34.8k, False: 85]
  ------------------
 2575|  34.8k|    {
 2576|  34.8k|        next = node->next;
 2577|       |        
 2578|  34.8k|        if (doc->progressCallback)
  ------------------
  |  Branch (2578:13): [True: 0, False: 34.8k]
  ------------------
 2579|      0|        {
 2580|      0|            doc->progressCallback( tidyImplToDoc(doc), node->line, node->column, doc->pprint.line + 1 );
  ------------------
  |  |  141|      0|#define tidyImplToDoc( doc )            ((TidyDoc)(doc))
  ------------------
 2581|      0|        }
 2582|       |        
 2583|  34.8k|        if ( node->type == TextNode)
  ------------------
  |  Branch (2583:14): [True: 3.05k, False: 31.7k]
  ------------------
 2584|  3.05k|        {
 2585|  3.05k|            PPrintText( doc, mode, indent, node );
 2586|  3.05k|        }
 2587|  31.7k|        else if ( node->type == RootNode )
  ------------------
  |  Branch (2587:19): [True: 89, False: 31.6k]
  ------------------
 2588|     89|        {
 2589|     89|            if (node->content) {
  ------------------
  |  Branch (2589:17): [True: 85, False: 4]
  ------------------
 2590|     85|                node = node->content;
 2591|     85|                continue;
 2592|     85|            } else {
 2593|      4|                break;
 2594|      4|            }
 2595|     89|        }
 2596|  31.6k|        else if ( node->type == CommentTag )
  ------------------
  |  Branch (2596:19): [True: 0, False: 31.6k]
  ------------------
 2597|      0|        {
 2598|      0|            PCondFlushLineSmart( doc, indent );
 2599|      0|            PPrintComment( doc, indent, node);
 2600|       |            /* PCondFlushLine( doc, 0 ); */
 2601|      0|        }
 2602|  31.6k|        else if ( node->type == DocTypeTag )
  ------------------
  |  Branch (2602:19): [True: 28.5k, False: 3.10k]
  ------------------
 2603|  28.5k|            PPrintDocType( doc, indent, node );
 2604|  3.10k|        else if ( node->type == ProcInsTag )
  ------------------
  |  Branch (2604:19): [True: 15, False: 3.08k]
  ------------------
 2605|     15|            PPrintPI( doc, indent, node );
 2606|  3.08k|        else if ( node->type == XmlDecl )
  ------------------
  |  Branch (2606:19): [True: 113, False: 2.97k]
  ------------------
 2607|    113|            PPrintXmlDecl( doc, indent, node );
 2608|  2.97k|        else if ( node->type == CDATATag )
  ------------------
  |  Branch (2608:19): [True: 0, False: 2.97k]
  ------------------
 2609|      0|            PPrintCDATA( doc, indent, node );
 2610|  2.97k|        else if ( node->type == SectionTag )
  ------------------
  |  Branch (2610:19): [True: 1, False: 2.97k]
  ------------------
 2611|      1|            PPrintSection( doc, indent, node );
 2612|  2.97k|        else if ( node->type == AspTag )
  ------------------
  |  Branch (2612:19): [True: 51, False: 2.92k]
  ------------------
 2613|     51|            PPrintAsp( doc, indent, node );
 2614|  2.92k|        else if ( node->type == JsteTag)
  ------------------
  |  Branch (2614:19): [True: 3, False: 2.91k]
  ------------------
 2615|      3|            PPrintJste( doc, indent, node );
 2616|  2.91k|        else if ( node->type == PhpTag)
  ------------------
  |  Branch (2616:19): [True: 0, False: 2.91k]
  ------------------
 2617|      0|            PPrintPhp( doc, indent, node );
 2618|  2.91k|        else if ( TY_(nodeHasCM)(node, CM_EMPTY) ||
  ------------------
  |  |   23|  2.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      else if ( TY_(nodeHasCM)(node, CM_EMPTY) ||
  ------------------
  |  |  139|  2.91k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (2618:19): [True: 0, False: 2.91k]
  ------------------
 2619|  2.91k|                  (node->type == StartEndTag && !xhtmlOut) )
  ------------------
  |  Branch (2619:20): [True: 0, False: 2.91k]
  |  Branch (2619:49): [True: 0, False: 0]
  ------------------
 2620|      0|        {
 2621|      0|            PCondFlushLineSmart( doc, indent );
 2622|      0|            PPrintTag( doc, mode, indent, node );
 2623|       |            /* TY_(PFlushLine)( doc, indent ); */
 2624|      0|        }
 2625|  2.91k|        else if ( node->type != RootNode )  /* some kind of container element */
  ------------------
  |  Branch (2625:19): [True: 2.91k, False: 0]
  ------------------
 2626|  2.91k|        {
 2627|  2.91k|            TidyParserMemory memory = {0};
 2628|  2.91k|            uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|  2.91k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 2629|  2.91k|            Node *content;
 2630|  2.91k|            Bool mixed = no;
 2631|  2.91k|            uint cindent;
 2632|       |
 2633|  31.4k|            for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2633:44): [True: 31.3k, False: 83]
  ------------------
 2634|  31.3k|            {
 2635|  31.3k|                if ( TY_(nodeIsText)(content) )
  ------------------
  |  |   23|  31.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2635:22): [True: 2.83k, False: 28.5k]
  ------------------
 2636|  2.83k|                {
 2637|  2.83k|                    mixed = yes;
 2638|  2.83k|                    break;
 2639|  2.83k|                }
 2640|  31.3k|            }
 2641|       |
 2642|  2.91k|            PCondFlushLineSmart( doc, indent );
 2643|       |
 2644|  2.91k|            if ( TY_(XMLPreserveWhiteSpace)(doc, node) )
  ------------------
  |  |   23|  2.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2644:18): [True: 20, False: 2.89k]
  ------------------
 2645|     20|            {
 2646|     20|                indent = 0;
 2647|     20|                mixed = no;
 2648|     20|                cindent = 0;
 2649|     20|            }
 2650|  2.89k|            else if (mixed)
  ------------------
  |  Branch (2650:22): [True: 2.81k, False: 83]
  ------------------
 2651|  2.81k|                cindent = indent;
 2652|     83|            else
 2653|     83|                cindent = indent + spaces;
 2654|       |
 2655|  2.91k|            PPrintTag( doc, mode, indent, node );
 2656|  2.91k|            if ( !mixed && node->content )
  ------------------
  |  Branch (2656:18): [True: 103, False: 2.81k]
  |  Branch (2656:28): [True: 65, False: 38]
  ------------------
 2657|     65|                PFlushLineSmart( doc, cindent );
 2658|       |     
 2659|  2.91k|            memory.original_node = node;
 2660|  2.91k|            memory.reentry_node = next;
 2661|  2.91k|            memory.register_1 = mixed;
 2662|  2.91k|            memory.register_2 = indent;
 2663|  2.91k|            TY_(pushMemory)(doc, memory);
  ------------------
  |  |   23|  2.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2664|       |
 2665|       |            /* Prevent infinite indentation. Seriously, at what point is
 2666|       |               anyone going to read a file with infinite indentation? It
 2667|       |               slows down rendering for arbitrarily-deep test cases that
 2668|       |               are only meant to crash Tidy in the first place. Let's
 2669|       |               consider whether to remove this limitation, lower it,
 2670|       |               increase it, or add a new configuration option to control
 2671|       |               it, or even emit an info-level message about it.
 2672|       |             */
 2673|  2.91k|            if (indent < TIDY_INDENTATION_LIMIT * spaces)
  ------------------
  |  |  615|  2.91k|#  define TIDY_INDENTATION_LIMIT 50
  ------------------
  |  Branch (2673:17): [True: 0, False: 2.91k]
  ------------------
 2674|      0|                indent = cindent;
 2675|       |
 2676|  2.91k|            if (node->content)
  ------------------
  |  Branch (2676:17): [True: 2.88k, False: 38]
  ------------------
 2677|  2.88k|            {
 2678|  2.88k|                node = node->content;
 2679|  2.88k|                continue;
 2680|  2.88k|            }
 2681|  2.91k|        }
 2682|       |        
 2683|  31.8k|        if (next)
  ------------------
  |  Branch (2683:13): [True: 31.7k, False: 103]
  ------------------
 2684|  31.7k|        {
 2685|  31.7k|            node = next;
 2686|  31.7k|            continue;
 2687|  31.7k|        }
 2688|       |        
 2689|    103|        if ( TY_(isEmptyParserStack)(doc) == no )
  ------------------
  |  |   23|    103|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    103|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2689:14): [True: 101, False: 2]
  ------------------
 2690|    101|        {
 2691|       |            /* It's possible that the reentry_node is null, because we
 2692|       |               only pushed this record as a marker for the end tag while
 2693|       |               there was no next node. Thus the loop will pop until we have
 2694|       |               what we need. This also closes multiple end tags.
 2695|       |             */
 2696|  2.91k|            do {
 2697|  2.91k|                TidyParserMemory memory = TY_(popMemory)(doc);
  ------------------
  |  |   23|  2.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2698|  2.91k|                Node* close_node = memory.original_node;
 2699|  2.91k|                Bool mixed = memory.register_1;
 2700|  2.91k|                indent = memory.register_2;
 2701|       |                
 2702|  2.91k|                if ( !mixed && close_node->content )
  ------------------
  |  Branch (2702:22): [True: 103, False: 2.81k]
  |  Branch (2702:32): [True: 65, False: 38]
  ------------------
 2703|     65|                    PCondFlushLineSmart( doc, indent );
 2704|       |
 2705|  2.91k|                PPrintEndTag( doc, mode, indent, close_node );
 2706|       |                /* PCondFlushLine( doc, indent ); */
 2707|       |           
 2708|  2.91k|                node = memory.reentry_node;
 2709|  2.91k|            } while ( node == NULL && TY_(isEmptyParserStack)(doc) == no );
  ------------------
  |  |   23|  2.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2709:23): [True: 2.90k, False: 18]
  |  Branch (2709:39): [True: 2.81k, False: 83]
  ------------------
 2710|    101|            continue;;
 2711|      0|        }
 2712|      2|        node = NULL;
 2713|      2|    } /* while */
 2714|     89|}
pprint.c:InitIndent:
  275|    392|{
  276|    392|    ind->spaces = -1;
  277|    392|    ind->attrValStart = -1;
  278|    392|    ind->attrStringStart = -1;
  279|    392|}
pprint.c:PFlushLineImpl:
  821|  66.9k|{
  822|  66.9k|    TidyPrintImpl* pprint = &doc->pprint;
  823|       |
  824|  66.9k|    uint i;
  825|       |
  826|  66.9k|    CheckWrapLine( doc );
  827|       |
  828|  66.9k|    if ( WantIndent(doc) )
  ------------------
  |  Branch (828:10): [True: 0, False: 66.9k]
  ------------------
  829|      0|        WriteIndentChar(doc);
  830|       |
  831|   229M|    for ( i = 0; i < pprint->linelen; ++i )
  ------------------
  |  Branch (831:18): [True: 229M, False: 66.9k]
  ------------------
  832|   229M|        TY_(WriteChar)( pprint->linebuf[i], doc->docOut );
  ------------------
  |  |   23|   229M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   229M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  833|       |
  834|  66.9k|    if ( IsInString(pprint) )
  ------------------
  |  Branch (834:10): [True: 0, False: 66.9k]
  ------------------
  835|      0|        TY_(WriteChar)( '\\', doc->docOut );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  836|  66.9k|    ResetLine( pprint );
  837|  66.9k|    pprint->linelen = 0;
  838|  66.9k|}
pprint.c:CheckWrapLine:
  680|  66.9k|{
  681|  66.9k|    TidyPrintImpl* pprint = &doc->pprint;
  682|  66.9k|    if ( GetSpaces(pprint) + pprint->linelen >= cfg(doc, TidyWrapLen) )
  ------------------
  |  |  415|  66.9k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (682:10): [True: 0, False: 66.9k]
  ------------------
  683|      0|    {
  684|      0|        WrapLine( doc );
  685|      0|        return yes;
  686|      0|    }
  687|  66.9k|    return no;
  688|  66.9k|}
pprint.c:GetSpaces:
  343|   221M|{
  344|   221M|    int spaces = pprint->indent[ 0 ].spaces;
  345|   221M|    return ( spaces < 0 ? 0U : (uint) spaces );
  ------------------
  |  Branch (345:14): [True: 9.21k, False: 221M]
  ------------------
  346|   221M|}
pprint.c:WantIndent:
  489|  66.9k|{
  490|  66.9k|    TidyPrintImpl* pprint = &doc->pprint;
  491|  66.9k|    Bool wantIt = GetSpaces(pprint) > 0;
  492|  66.9k|    if ( wantIt )
  ------------------
  |  Branch (492:10): [True: 0, False: 66.9k]
  ------------------
  493|      0|    {
  494|      0|        Bool indentAttrs = cfgBool( doc, TidyIndentAttributes );
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  495|      0|        wantIt = ( ( !IsWrapInAttrVal(pprint) || indentAttrs ) &&
  ------------------
  |  Branch (495:22): [True: 0, False: 0]
  |  Branch (495:50): [True: 0, False: 0]
  ------------------
  496|      0|                   !IsWrapInString(pprint) );
  ------------------
  |  Branch (496:20): [True: 0, False: 0]
  ------------------
  497|      0|    }
  498|  66.9k|    return wantIt;
  499|  66.9k|}
pprint.c:IsInString:
  380|  66.9k|{
  381|  66.9k|    TidyIndent *ind = pprint->indent + 0; /* Always 1st */
  382|  66.9k|    return ( ind->attrStringStart >= 0 && 
  ------------------
  |  Branch (382:14): [True: 0, False: 66.9k]
  ------------------
  383|      0|             ind->attrStringStart < (int) pprint->linelen );
  ------------------
  |  Branch (383:14): [True: 0, False: 0]
  ------------------
  384|  66.9k|}
pprint.c:ResetLine:
  564|  66.9k|{
  565|  66.9k|    TidyIndent* ind = pprint->indent + 0;
  566|  66.9k|    if ( pprint->ixInd > 0 )
  ------------------
  |  Branch (566:10): [True: 0, False: 66.9k]
  ------------------
  567|      0|    {
  568|      0|        ind[0] = ind[1];
  569|      0|        InitIndent( &ind[1] );
  570|      0|    }
  571|       |
  572|  66.9k|    if ( pprint->wraphere > 0 )
  ------------------
  |  Branch (572:10): [True: 63.0k, False: 3.87k]
  ------------------
  573|  63.0k|    {
  574|  63.0k|        int wrap = (int) pprint->wraphere;
  575|  63.0k|        if ( ind[0].attrStringStart > wrap )
  ------------------
  |  Branch (575:14): [True: 0, False: 63.0k]
  ------------------
  576|      0|            ind[0].attrStringStart -= wrap;
  577|  63.0k|        if ( ind[0].attrValStart > wrap )
  ------------------
  |  Branch (577:14): [True: 0, False: 63.0k]
  ------------------
  578|      0|            ind[0].attrValStart -= wrap;
  579|  63.0k|    }
  580|  3.87k|    else
  581|  3.87k|    {
  582|  3.87k|        if ( ind[0].attrStringStart > 0 )
  ------------------
  |  Branch (582:14): [True: 0, False: 3.87k]
  ------------------
  583|      0|            ind[0].attrStringStart = 0;
  584|  3.87k|        if ( ind[0].attrValStart > 0 )
  ------------------
  |  Branch (584:14): [True: 0, False: 3.87k]
  ------------------
  585|      0|            ind[0].attrValStart = 0;
  586|  3.87k|    }
  587|  66.9k|    pprint->wraphere = pprint->ixInd = 0;
  588|  66.9k|}
pprint.c:PPrintText:
 1359|  31.7k|{
 1360|  31.7k|    uint start = node->start;
 1361|  31.7k|    uint end = node->end;
 1362|  31.7k|    uint ix, c = 0;
 1363|  31.7k|    int  ixNL = TextEndsWithNewline( doc->lexer, node, mode );
 1364|  31.7k|    int  ixWS = TextStartsWithWhitespace( doc->lexer, node, start, mode );
 1365|  31.7k|    if ( ixNL > 0 )
  ------------------
  |  Branch (1365:10): [True: 0, False: 31.7k]
  ------------------
 1366|      0|      end -= ixNL;
 1367|  31.7k|    start = IncrWS( start, end, indent, ixWS );
 1368|       |
 1369|   220M|    for ( ix = start; ix < end; ++ix )
  ------------------
  |  Branch (1369:23): [True: 220M, False: 31.7k]
  ------------------
 1370|   220M|    {
 1371|   220M|        CheckWrapIndent( doc, indent );
 1372|       |        /*
 1373|       |        if ( CheckWrapIndent(doc, indent) )
 1374|       |        {
 1375|       |            ixWS = TextStartsWithWhitespace( doc->lexer, node, ix );
 1376|       |            ix = IncrWS( ix, end, indent, ixWS );
 1377|       |        }
 1378|       |        */
 1379|   220M|        c = (byte) doc->lexer->lexbuf[ix];
 1380|       |
 1381|       |        /* look for UTF-8 multibyte character */
 1382|   220M|        if ( c > 0x7F )
  ------------------
  |  Branch (1382:14): [True: 18.8k, False: 220M]
  ------------------
 1383|  18.8k|             ix += TY_(GetUTF8)( doc->lexer->lexbuf + ix, &c );
  ------------------
  |  |   23|  18.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1384|       |
 1385|   220M|        if ( c == '\n' )
  ------------------
  |  Branch (1385:14): [True: 3.82k, False: 220M]
  ------------------
 1386|  3.82k|        {
 1387|  3.82k|            TY_(PFlushLine)( doc, indent );
  ------------------
  |  |   23|  3.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1388|  3.82k|            ixWS = TextStartsWithWhitespace( doc->lexer, node, ix+1, mode );
 1389|  3.82k|            ix = IncrWS( ix, end, indent, ixWS );
 1390|  3.82k|        }
 1391|   220M|        else if (( c == '&' ) && (TY_(HTMLVersion)(doc) == HT50) &&
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      else if (( c == '&' ) && (TY_(HTMLVersion)(doc) == HT50) &&
  ------------------
  |  |  200|  1.00k|#define HT50              131072u
  ------------------
  |  Branch (1391:18): [True: 1.00k, False: 220M]
  |  Branch (1391:34): [True: 0, False: 1.00k]
  ------------------
 1392|      0|            (((ix + 1) == end) || (((ix + 1) < end) && (isspace(doc->lexer->lexbuf[ix+1] & 0xff)))) )
  ------------------
  |  Branch (1392:14): [True: 0, False: 0]
  |  Branch (1392:36): [True: 0, False: 0]
  |  Branch (1392:56): [True: 0, False: 0]
  ------------------
 1393|      0|        {
 1394|       |            /*\
 1395|       |             * Issue #207 - This is an unambiguous ampersand need not be 'quoted' in HTML5
 1396|       |             * Issue #379 - Ensure only 0 to 255 passed to 'isspace' to avoid debug assert
 1397|       |            \*/
 1398|      0|            PPrintChar( doc, c, (mode | CDATA) );
 1399|      0|        }
 1400|   220M|        else
 1401|   220M|        {
 1402|   220M|            PPrintChar( doc, c, mode );
 1403|   220M|        }
 1404|   220M|    }
 1405|  31.7k|}
pprint.c:TextEndsWithNewline:
  999|  31.7k|{
 1000|  31.7k|    if ( (mode & (CDATA|COMMENT)) && TY_(nodeIsText)(node) && node->end > node->start )
  ------------------
  |  |   23|  28.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1000:10): [True: 28.6k, False: 3.05k]
  |  Branch (1000:38): [True: 28.5k, False: 90]
  |  Branch (1000:63): [True: 28.4k, False: 122]
  ------------------
 1001|  28.4k|    {
 1002|  28.4k|        uint ch, ix = node->end - 1;
 1003|       |        /*\
 1004|       |         *  Skip non-newline whitespace.
 1005|       |         *  Issue #379 - Only if ix is GT start can it be decremented!
 1006|       |        \*/
 1007|  3.77M|        while ( ix > node->start && (ch = (lexer->lexbuf[ix] & 0xff))
  ------------------
  |  Branch (1007:17): [True: 3.74M, False: 26.3k]
  |  Branch (1007:37): [True: 3.74M, False: 0]
  ------------------
 1008|  3.74M|                 && ( ch == ' ' || ch == '\t' || ch == '\r' ) )
  ------------------
  |  Branch (1008:23): [True: 3.74M, False: 2.06k]
  |  Branch (1008:36): [True: 0, False: 2.06k]
  |  Branch (1008:50): [True: 0, False: 2.06k]
  ------------------
 1009|  3.74M|            --ix;
 1010|       |
 1011|  28.4k|        if ( lexer->lexbuf[ ix ] == '\n' )
  ------------------
  |  Branch (1011:14): [True: 0, False: 28.4k]
  ------------------
 1012|      0|          return node->end - ix - 1; /* #543262 tidy eats all memory */
 1013|  28.4k|    }
 1014|  31.7k|    return -1;
 1015|  31.7k|}
pprint.c:TextStartsWithWhitespace:
 1044|  35.5k|{
 1045|  35.5k|    assert( node != NULL );
  ------------------
  |  Branch (1045:5): [True: 0, False: 35.5k]
  |  Branch (1045:5): [True: 35.5k, False: 0]
  ------------------
 1046|  35.5k|    if ( (mode & (CDATA|COMMENT)) && TY_(nodeIsTextLike)(node) && node->end > node->start && start >= node->start )
  ------------------
  |  |   23|  32.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1046:10): [True: 32.3k, False: 3.15k]
  |  Branch (1046:38): [True: 32.3k, False: 43]
  |  Branch (1046:67): [True: 32.2k, False: 138]
  |  Branch (1046:94): [True: 32.2k, False: 0]
  ------------------
 1047|  32.2k|    {
 1048|  32.2k|        uint ch, ix = start;
 1049|       |        /* Skip whitespace. */
 1050|  50.4M|        while ( ix < node->end && (ch = (lexer->lexbuf[ix] & 0xff))
  ------------------
  |  Branch (1050:17): [True: 50.4M, False: 26.4k]
  |  Branch (1050:35): [True: 50.4M, False: 0]
  ------------------
 1051|  50.4M|                && ( ch==' ' || ch=='\t' || ch=='\r' ) )
  ------------------
  |  Branch (1051:22): [True: 50.4M, False: 6.02k]
  |  Branch (1051:33): [True: 215, False: 5.80k]
  |  Branch (1051:45): [True: 0, False: 5.80k]
  ------------------
 1052|  50.4M|            ++ix;
 1053|       |
 1054|  32.2k|        if ( ix > start )
  ------------------
  |  Branch (1054:14): [True: 28.7k, False: 3.43k]
  ------------------
 1055|  28.7k|          return ix - start;
 1056|  32.2k|    }
 1057|  6.77k|    return -1;
 1058|  35.5k|}
pprint.c:prvTidynodeIsTextLike:
 1028|  32.3k|{
 1029|  32.3k|    if ( TY_(nodeIsText)(node) )
  ------------------
  |  |   23|  32.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1029:10): [True: 32.2k, False: 128]
  ------------------
 1030|  32.2k|        return yes;
 1031|    128|    if ( node->type == AspTag )
  ------------------
  |  Branch (1031:10): [True: 66, False: 62]
  ------------------
 1032|     66|        return yes;
 1033|     62|    if (node->type == PhpTag)
  ------------------
  |  Branch (1033:9): [True: 19, False: 43]
  ------------------
 1034|     19|        return yes; /* Issue #392 */
 1035|       |    /* add other text like nodes... */
 1036|     43|    return no;
 1037|     62|}
pprint.c:IncrWS:
 1341|  35.5k|{
 1342|  35.5k|  if ( ixWS > 0 )
  ------------------
  |  Branch (1342:8): [True: 28.7k, False: 6.77k]
  ------------------
 1343|  28.7k|  {
 1344|  28.7k|    uint st = start + MIN( (uint)ixWS, indent );
  ------------------
  |  |   25|  28.7k|#define MIN(a,b) (((a) < (b))?(a):(b))
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 28.7k]
  |  |  ------------------
  ------------------
 1345|  28.7k|    start = MIN( st, end );
  ------------------
  |  |   25|  28.7k|#define MIN(a,b) (((a) < (b))?(a):(b))
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 28.7k, False: 0]
  |  |  ------------------
  ------------------
 1346|  28.7k|  }
 1347|  35.5k|  return start;
 1348|  35.5k|}
pprint.c:CheckWrapIndent:
  696|   220M|{
  697|   220M|    TidyPrintImpl* pprint = &doc->pprint;
  698|   220M|    if ( GetSpaces(pprint) + pprint->linelen >= cfg(doc, TidyWrapLen) )
  ------------------
  |  |  415|   220M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (698:10): [True: 0, False: 220M]
  ------------------
  699|      0|    {
  700|      0|        WrapLine( doc );
  701|      0|        if ( pprint->indent[ 0 ].spaces < 0 )
  ------------------
  |  Branch (701:14): [True: 0, False: 0]
  ------------------
  702|      0|        {
  703|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_INDENT)
  704|       |            SPRTF("%s Indent from %d to %d\n", __FUNCTION__, pprint->indent[ 0 ].spaces, indent );
  705|       |#endif
  706|      0|            pprint->indent[ 0 ].spaces = indent;
  707|      0|        }
  708|      0|        return yes;
  709|      0|    }
  710|   220M|    return no;
  711|   220M|}
pprint.c:PPrintChar:
 1138|   222M|{
 1139|   222M|    tmbchar entity[128];
 1140|   222M|    ctmbstr p;
 1141|   222M|    TidyPrintImpl* pprint  = &doc->pprint;
 1142|   222M|    uint outenc = cfg( doc, TidyOutCharEncoding );
  ------------------
  |  |  415|   222M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1143|   222M|    Bool qmark = cfgBool( doc, TidyQuoteMarks );
  ------------------
  |  |  418|   222M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   222M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1144|       |
 1145|   222M|    if ( c == ' ' && !(mode & (PREFORMATTED | COMMENT | ATTRIBVALUE | CDATA)))
  ------------------
  |  Branch (1145:10): [True: 220M, False: 1.76M]
  |  Branch (1145:22): [True: 56.0M, False: 164M]
  ------------------
 1146|  56.0M|    {
 1147|       |        /* coerce a space character to a non-breaking space */
 1148|  56.0M|        if (mode & NOWRAP)
  ------------------
  |  Branch (1148:13): [True: 0, False: 56.0M]
  ------------------
 1149|      0|        {
 1150|      0|            ctmbstr ent = "&nbsp;";
 1151|       |            /* by default XML doesn't define &nbsp; */
 1152|      0|            if ( cfgBool(doc, TidyNumEntities) || cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                          if ( cfgBool(doc, TidyNumEntities) || cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1153|      0|                ent = "&#160;";
 1154|      0|            AddString( pprint, ent );
 1155|      0|            return;
 1156|      0|        }
 1157|  56.0M|        else
 1158|  56.0M|            pprint->wraphere = pprint->linelen;
 1159|  56.0M|    }
 1160|       |
 1161|       |    /* comment characters are passed raw */
 1162|   222M|    if ( mode & (COMMENT | CDATA) )
  ------------------
  |  Branch (1162:10): [True: 163M, False: 58.2M]
  ------------------
 1163|   163M|    {
 1164|   163M|        AddChar( pprint, c );
 1165|   163M|        return;
 1166|   163M|    }
 1167|       |
 1168|       |    /* except in CDATA map < to &lt; etc. */
 1169|  58.2M|    if ( !(mode & CDATA) )
  ------------------
  |  Branch (1169:10): [True: 58.2M, False: 0]
  ------------------
 1170|  58.2M|    {
 1171|  58.2M|        if ( c == '<')
  ------------------
  |  Branch (1171:14): [True: 969k, False: 57.3M]
  ------------------
 1172|   969k|        {
 1173|   969k|            AddString( pprint, "&lt;" );
 1174|   969k|            return;
 1175|   969k|        }
 1176|       |            
 1177|  57.3M|        if ( c == '>')
  ------------------
  |  Branch (1177:14): [True: 121, False: 57.3M]
  ------------------
 1178|    121|        {
 1179|    121|            AddString( pprint, "&gt;" );
 1180|    121|            return;
 1181|    121|        }
 1182|       |
 1183|       |        /*
 1184|       |          naked '&' chars can be left alone or
 1185|       |          quoted as &amp; The latter is required
 1186|       |          for XML where naked '&' are illegal.
 1187|       |        */
 1188|  57.3M|        if ( c == '&' && cfgBool(doc, TidyQuoteAmpersand)
  ------------------
  |  |  418|  57.3M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    989|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 989, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1188:14): [True: 989, False: 57.3M]
  ------------------
 1189|    989|             && !cfgBool(doc, TidyPreserveEntities)
  ------------------
  |  |  418|  57.3M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    989|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1189:17): [True: 989, False: 0]
  ------------------
 1190|    989|             && ( mode != OtherNamespace) ) /* #130 MathML attr and entity fix! */
  ------------------
  |  Branch (1190:17): [True: 989, False: 0]
  ------------------
 1191|    989|        {
 1192|    989|            AddString( pprint, "&amp;" );
 1193|    989|            return;
 1194|    989|        }
 1195|       |
 1196|  57.3M|        if ( c == '"' && qmark )
  ------------------
  |  Branch (1196:14): [True: 51.2k, False: 57.2M]
  |  Branch (1196:26): [True: 0, False: 51.2k]
  ------------------
 1197|      0|        {
 1198|      0|            AddString( pprint, "&quot;" );
 1199|      0|            return;
 1200|      0|        }
 1201|       |
 1202|  57.3M|        if ( c == '\'' && qmark )
  ------------------
  |  Branch (1202:14): [True: 2.72k, False: 57.3M]
  |  Branch (1202:27): [True: 0, False: 2.72k]
  ------------------
 1203|      0|        {
 1204|      0|            AddString( pprint, "&#39;" );
 1205|      0|            return;
 1206|      0|        }
 1207|       |
 1208|  57.3M|        if ( c == 160 && outenc != RAW )
  ------------------
  |  |  133|      0|#define RAW         0
  ------------------
  |  Branch (1208:14): [True: 0, False: 57.3M]
  |  Branch (1208:26): [True: 0, False: 0]
  ------------------
 1209|      0|        {
 1210|      0|            if ( cfgBool(doc, TidyQuoteNbsp) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1211|      0|            {
 1212|      0|                if ( cfgBool(doc, TidyNumEntities) ||
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1213|      0|                     cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1214|      0|                    AddString( pprint, "&#160;" );
 1215|      0|                else
 1216|      0|                    AddString( pprint, "&nbsp;" );
 1217|      0|            }
 1218|      0|            else
 1219|      0|                AddChar( pprint, c );
 1220|      0|            return;
 1221|      0|        }
 1222|  57.3M|    }
 1223|       |
 1224|       |    /* Handle encoding-specific issues */
 1225|  57.3M|    switch ( outenc )
  ------------------
  |  Branch (1225:14): [True: 57.3M, False: 0]
  ------------------
 1226|  57.3M|    {
 1227|  57.3M|    case UTF8:
  ------------------
  |  |  137|  57.3M|#define UTF8        4
  ------------------
  |  Branch (1227:5): [True: 57.3M, False: 0]
  ------------------
 1228|  57.3M|    case UTF16:
  ------------------
  |  |  144|  57.3M|#define UTF16       11
  ------------------
  |  Branch (1228:5): [True: 0, False: 57.3M]
  ------------------
 1229|  57.3M|    case UTF16LE:
  ------------------
  |  |  142|  57.3M|#define UTF16LE     9
  ------------------
  |  Branch (1229:5): [True: 0, False: 57.3M]
  ------------------
 1230|  57.3M|    case UTF16BE:
  ------------------
  |  |  143|  57.3M|#define UTF16BE     10
  ------------------
  |  Branch (1230:5): [True: 0, False: 57.3M]
  ------------------
 1231|  57.3M|        if (!(mode & PREFORMATTED) && cfg(doc, TidyPunctWrap))
  ------------------
  |  |  415|  56.2M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (415:33): [True: 0, False: 56.2M]
  |  |  ------------------
  ------------------
  |  Branch (1231:13): [True: 56.2M, False: 1.08M]
  ------------------
 1232|      0|        {
 1233|      0|            WrapPoint wp = CharacterWrapPoint(c);
 1234|      0|            if (wp == WrapBefore)
  ------------------
  |  Branch (1234:17): [True: 0, False: 0]
  ------------------
 1235|      0|                pprint->wraphere = pprint->linelen;
 1236|      0|            else if (wp == WrapAfter)
  ------------------
  |  Branch (1236:22): [True: 0, False: 0]
  ------------------
 1237|      0|                pprint->wraphere = pprint->linelen + 1;
 1238|      0|        }
 1239|  57.3M|        break;
 1240|       |
 1241|      0|    case BIG5:
  ------------------
  |  |  145|      0|#define BIG5        12
  ------------------
  |  Branch (1241:5): [True: 0, False: 57.3M]
  ------------------
 1242|       |        /* Allow linebreak at Chinese punctuation characters */
 1243|       |        /* There are not many spaces in Chinese */
 1244|      0|        AddChar( pprint, c );
 1245|      0|        if (!(mode & PREFORMATTED)  && cfg(doc, TidyPunctWrap))
  ------------------
  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (415:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1245:13): [True: 0, False: 0]
  ------------------
 1246|      0|        {
 1247|      0|            WrapPoint wp = Big5WrapPoint(c);
 1248|      0|            if (wp == WrapBefore)
  ------------------
  |  Branch (1248:17): [True: 0, False: 0]
  ------------------
 1249|      0|                pprint->wraphere = pprint->linelen;
 1250|      0|            else if (wp == WrapAfter)
  ------------------
  |  Branch (1250:22): [True: 0, False: 0]
  ------------------
 1251|      0|                pprint->wraphere = pprint->linelen + 1;
 1252|      0|        }
 1253|      0|        return;
 1254|       |
 1255|      0|    case SHIFTJIS:
  ------------------
  |  |  146|      0|#define SHIFTJIS    13
  ------------------
  |  Branch (1255:5): [True: 0, False: 57.3M]
  ------------------
 1256|      0|#ifndef NO_NATIVE_ISO2022_SUPPORT
 1257|      0|    case ISO2022: /* ISO 2022 characters are passed raw */
  ------------------
  |  |  138|      0|#define ISO2022     5
  ------------------
  |  Branch (1257:5): [True: 0, False: 57.3M]
  ------------------
 1258|      0|#endif
 1259|      0|    case RAW:
  ------------------
  |  |  133|      0|#define RAW         0
  ------------------
  |  Branch (1259:5): [True: 0, False: 57.3M]
  ------------------
 1260|      0|        AddChar( pprint, c );
 1261|      0|        return;
 1262|  57.3M|    }
 1263|       |
 1264|       |    /* don't map latin-1 chars to entities */
 1265|  57.3M|    if ( outenc == LATIN1 )
  ------------------
  |  |  136|  57.3M|#define LATIN1      3
  ------------------
  |  Branch (1265:10): [True: 0, False: 57.3M]
  ------------------
 1266|      0|    {
 1267|      0|        if (c > 255)  /* multi byte chars */
  ------------------
  |  Branch (1267:13): [True: 0, False: 0]
  ------------------
 1268|      0|        {
 1269|      0|            uint vers = TY_(HTMLVersion)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1270|      0|            if ( !cfgBool(doc, TidyNumEntities) && (p = TY_(EntityName)(c, vers)) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                          if ( !cfgBool(doc, TidyNumEntities) && (p = TY_(EntityName)(c, vers)) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1270:18): [True: 0, False: 0]
  |  Branch (1270:52): [True: 0, False: 0]
  ------------------
 1271|      0|                TY_(tmbsnprintf)(entity, sizeof(entity), "&%s;", p);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1272|      0|            else
 1273|      0|                TY_(tmbsnprintf)(entity, sizeof(entity), "&#%u;", c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1274|       |
 1275|      0|            AddString( pprint, entity );
 1276|      0|            return;
 1277|      0|        }
 1278|       |
 1279|      0|        if (c > 126 && c < 160)
  ------------------
  |  Branch (1279:13): [True: 0, False: 0]
  |  Branch (1279:24): [True: 0, False: 0]
  ------------------
 1280|      0|        {
 1281|      0|            TY_(tmbsnprintf)(entity, sizeof(entity), "&#%u;", c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1282|      0|            AddString( pprint, entity );
 1283|      0|            return;
 1284|      0|        }
 1285|       |
 1286|      0|        AddChar( pprint, c );
 1287|      0|        return;
 1288|      0|    }
 1289|       |
 1290|       |    /* don't map UTF-8 chars to entities */
 1291|  57.3M|    if ( outenc == UTF8 )
  ------------------
  |  |  137|  57.3M|#define UTF8        4
  ------------------
  |  Branch (1291:10): [True: 57.3M, False: 0]
  ------------------
 1292|  57.3M|    {
 1293|  57.3M|        AddChar( pprint, c );
 1294|  57.3M|        return;
 1295|  57.3M|    }
 1296|       |
 1297|       |    /* don't map UTF-16 chars to entities */
 1298|      0|    if ( outenc == UTF16 || outenc == UTF16LE || outenc == UTF16BE )
  ------------------
  |  |  144|      0|#define UTF16       11
  ------------------
                  if ( outenc == UTF16 || outenc == UTF16LE || outenc == UTF16BE )
  ------------------
  |  |  142|      0|#define UTF16LE     9
  ------------------
                  if ( outenc == UTF16 || outenc == UTF16LE || outenc == UTF16BE )
  ------------------
  |  |  143|      0|#define UTF16BE     10
  ------------------
  |  Branch (1298:10): [True: 0, False: 0]
  |  Branch (1298:29): [True: 0, False: 0]
  |  Branch (1298:50): [True: 0, False: 0]
  ------------------
 1299|      0|    {
 1300|      0|        AddChar( pprint, c );
 1301|      0|        return;
 1302|      0|    }
 1303|       |
 1304|       |    /* use numeric entities only  for XML */
 1305|      0|    if ( cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1306|      0|    {
 1307|       |        /* if ASCII use numeric entities for chars > 127 */
 1308|      0|        if ( c > 127 && outenc == ASCII )
  ------------------
  |  |  134|      0|#define ASCII       1
  ------------------
  |  Branch (1308:14): [True: 0, False: 0]
  |  Branch (1308:25): [True: 0, False: 0]
  ------------------
 1309|      0|        {
 1310|      0|            TY_(tmbsnprintf)(entity, sizeof(entity), "&#%u;", c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1311|      0|            AddString( pprint, entity );
 1312|      0|            return;
 1313|      0|        }
 1314|       |
 1315|       |        /* otherwise output char raw */
 1316|      0|        AddChar( pprint, c );
 1317|      0|        return;
 1318|      0|    }
 1319|       |
 1320|       |    /* default treatment for ASCII */
 1321|      0|    if ( outenc == ASCII && (c > 126 || (c < ' ' && c != '\t')) )
  ------------------
  |  |  134|      0|#define ASCII       1
  ------------------
  |  Branch (1321:10): [True: 0, False: 0]
  |  Branch (1321:30): [True: 0, False: 0]
  |  Branch (1321:42): [True: 0, False: 0]
  |  Branch (1321:53): [True: 0, False: 0]
  ------------------
 1322|      0|    {
 1323|      0|        uint vers = TY_(HTMLVersion)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1324|      0|        if (!cfgBool(doc, TidyNumEntities) && (p = TY_(EntityName)(c, vers)) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                      if (!cfgBool(doc, TidyNumEntities) && (p = TY_(EntityName)(c, vers)) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1324:13): [True: 0, False: 0]
  |  Branch (1324:47): [True: 0, False: 0]
  ------------------
 1325|      0|            TY_(tmbsnprintf)(entity, sizeof(entity), "&%s;", p);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1326|      0|        else
 1327|      0|            TY_(tmbsnprintf)(entity, sizeof(entity), "&#%u;", c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1328|       |
 1329|      0|        AddString( pprint, entity );
 1330|      0|        return;
 1331|      0|    }
 1332|       |
 1333|      0|    AddChar( pprint, c );
 1334|      0|}
pprint.c:AddString:
  807|  1.29M|{
  808|  1.29M|   return pprint->linelen = AddAsciiString( pprint, str, pprint->linelen );
  809|  1.29M|}
pprint.c:AddAsciiString:
  792|  1.29M|{
  793|  1.29M|    uint ix, len = TY_(tmbstrlen)( str );
  ------------------
  |  |   23|  1.29M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.29M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  794|  1.29M|    if ( string_index + len >= pprint->lbufsize )
  ------------------
  |  Branch (794:10): [True: 61, False: 1.29M]
  ------------------
  795|     61|        expand( pprint, string_index + len );
  796|       |
  797|  7.12M|    for ( ix=0; ix<len; ++ix )
  ------------------
  |  Branch (797:17): [True: 5.82M, False: 1.29M]
  ------------------
  798|  5.82M|        pprint->linebuf[string_index + ix] = str[ ix ];
  799|  1.29M|    return string_index + len;
  800|  1.29M|}
pprint.c:expand:
  314|  1.14k|{
  315|  1.14k|    uint* ip;
  316|  1.14k|    uint buflen = pprint->lbufsize;
  317|       |
  318|  1.14k|    if ( buflen == 0 )
  ------------------
  |  Branch (318:10): [True: 85, False: 1.05k]
  ------------------
  319|     85|        buflen = 256;
  320|  2.20k|    while ( len >= buflen )
  ------------------
  |  Branch (320:13): [True: 1.06k, False: 1.14k]
  ------------------
  321|  1.06k|        buflen *= 2;
  322|       |
  323|  1.14k|    ip = (uint*) TidyRealloc( pprint->allocator, pprint->linebuf, buflen*sizeof(uint) );
  ------------------
  |  |   67|  1.14k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  324|  1.14k|    if ( ip )
  ------------------
  |  Branch (324:10): [True: 1.14k, False: 0]
  ------------------
  325|  1.14k|    {
  326|  1.14k|      TidyClearMemory( ip+pprint->lbufsize, 
  ------------------
  |  |   70|  1.14k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  327|  1.14k|                       (buflen-pprint->lbufsize)*sizeof(uint) );
  328|  1.14k|      pprint->lbufsize = buflen;
  329|  1.14k|      pprint->linebuf = ip;
  330|  1.14k|    }
  331|  1.14k|}
pprint.c:AddChar:
  782|   223M|{
  783|   223M|    AddC( pprint, c, pprint->linelen );
  784|   223M|    return ++pprint->linelen;
  785|   223M|}
pprint.c:AddC:
  771|   223M|{
  772|   223M|    if ( string_index + 1 >= pprint->lbufsize )
  ------------------
  |  Branch (772:10): [True: 1.08k, False: 223M]
  ------------------
  773|  1.08k|        expand( pprint, string_index + 1 );
  774|   223M|    pprint->linebuf[string_index] = c;
  775|   223M|}
pprint.c:SetWrap:
  541|   101k|{
  542|   101k|    TidyPrintImpl* pprint = &doc->pprint;
  543|   101k|    Bool wrap = ( indent + pprint->linelen < cfg(doc, TidyWrapLen) );
  ------------------
  |  |  415|   101k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  544|   101k|    if ( wrap )
  ------------------
  |  Branch (544:10): [True: 101k, False: 0]
  ------------------
  545|   101k|    {
  546|   101k|        if ( pprint->indent[0].spaces < 0 )
  ------------------
  |  Branch (546:14): [True: 13, False: 101k]
  ------------------
  547|     13|            pprint->indent[0].spaces = indent;
  548|   101k|        pprint->wraphere = pprint->linelen;
  549|   101k|    }
  550|      0|    else if ( pprint->ixInd == 0 )
  ------------------
  |  Branch (550:15): [True: 0, False: 0]
  ------------------
  551|      0|    {
  552|       |        /* Save indent 1st time we pass the the wrap line */
  553|      0|        pprint->indent[ 1 ].spaces = indent;
  554|      0|        pprint->ixInd = 1;
  555|      0|    }
  556|   101k|    return wrap;
  557|   101k|}
pprint.c:PPrintDocType:
 1878|  28.5k|{
 1879|  28.5k|    TidyPrintImpl* pprint = &doc->pprint;
 1880|  28.5k|    uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  28.5k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1881|  28.5k|    uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|  28.5k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1882|  28.5k|    AttVal* fpi = TY_(GetAttrByName)(node, "PUBLIC");
  ------------------
  |  |   23|  28.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1883|  28.5k|    AttVal* sys = TY_(GetAttrByName)(node, "SYSTEM");
  ------------------
  |  |   23|  28.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1884|       |
 1885|       |    /* todo: handle non-ASCII characters in FPI / SI / node->element */
 1886|       |
 1887|  28.5k|    SetWrap( doc, indent );
 1888|  28.5k|    PCondFlushLineSmart( doc, indent );
 1889|       |
 1890|  28.5k|    AddString( pprint, "<!DOCTYPE " );
 1891|  28.5k|    SetWrap( doc, indent );
 1892|  28.5k|    if (node->element)
  ------------------
  |  Branch (1892:9): [True: 28.5k, False: 0]
  ------------------
 1893|  28.5k|    {
 1894|  28.5k|        AddString(pprint, node->element);
 1895|  28.5k|    }
 1896|       |
 1897|  28.5k|    if (fpi && fpi->value)
  ------------------
  |  Branch (1897:9): [True: 4, False: 28.5k]
  |  Branch (1897:16): [True: 0, False: 4]
  ------------------
 1898|      0|    {
 1899|      0|        AddString(pprint, " PUBLIC ");
 1900|      0|        AddChar(pprint, fpi->delim);
 1901|      0|        AddString(pprint, fpi->value);
 1902|      0|        AddChar(pprint, fpi->delim);
 1903|      0|    }
 1904|       |
 1905|  28.5k|    if (fpi && fpi->value && sys && sys->value)
  ------------------
  |  Branch (1905:9): [True: 4, False: 28.5k]
  |  Branch (1905:16): [True: 0, False: 4]
  |  Branch (1905:30): [True: 0, False: 0]
  |  Branch (1905:37): [True: 0, False: 0]
  ------------------
 1906|      0|    {
 1907|      0|        uint i = pprint->linelen - (TY_(tmbstrlen)(sys->value) + 2) - 1;
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1908|      0|        if (!(i>0&&TY_(tmbstrlen)(sys->value)+2+i<wraplen&&i<=(spaces?spaces:2)*2))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1908:15): [True: 0, False: 0]
  |  Branch (1908:20): [True: 0, False: 0]
  |  Branch (1908:60): [True: 0, False: 0]
  |  Branch (1908:64): [True: 0, False: 0]
  ------------------
 1909|      0|            i = 0;
 1910|       |
 1911|      0|        PCondFlushLineSmart(doc, i);
 1912|      0|        if (pprint->linelen)
  ------------------
  |  Branch (1912:13): [True: 0, False: 0]
  ------------------
 1913|      0|            AddChar(pprint, ' ');
 1914|      0|    }
 1915|  28.5k|    else if (sys && sys->value)
  ------------------
  |  Branch (1915:14): [True: 4, False: 28.5k]
  |  Branch (1915:21): [True: 4, False: 0]
  ------------------
 1916|      4|    {
 1917|      4|        AddString(pprint, " SYSTEM ");
 1918|      4|    }
 1919|       |
 1920|  28.5k|    if (sys && sys->value)
  ------------------
  |  Branch (1920:9): [True: 4, False: 28.5k]
  |  Branch (1920:16): [True: 4, False: 0]
  ------------------
 1921|      4|    {
 1922|      4|        AddChar(pprint, sys->delim);
 1923|      4|        AddString(pprint, sys->value);
 1924|      4|        AddChar(pprint, sys->delim);
 1925|      4|    }
 1926|       |
 1927|  28.5k|    if (node->content)
  ------------------
  |  Branch (1927:9): [True: 28.5k, False: 6]
  ------------------
 1928|  28.5k|    {
 1929|  28.5k|        PCondFlushLineSmart(doc, indent);
 1930|  28.5k|        AddChar(pprint, '[');
 1931|  28.5k|        PPrintText(doc, CDATA, 0, node->content);
 1932|  28.5k|        AddChar(pprint, ']');
 1933|  28.5k|    }
 1934|       |
 1935|  28.5k|    SetWrap( doc, 0 );
 1936|  28.5k|    AddChar( pprint, '>' );
 1937|  28.5k|    PCondFlushLineSmart( doc, indent );
 1938|  28.5k|}
pprint.c:PPrintPI:
 1945|     15|{
 1946|     15|    TidyPrintImpl* pprint = &doc->pprint;
 1947|     15|    tchar c;
 1948|     15|    tmbstr s;
 1949|       |
 1950|     15|    SetWrap( doc, indent );
 1951|     15|    AddString( pprint, "<?" );
 1952|       |
 1953|     15|    s = node->element;
 1954|       |
 1955|    105|    while (s && *s)
  ------------------
  |  Branch (1955:12): [True: 105, False: 0]
  |  Branch (1955:17): [True: 90, False: 15]
  ------------------
 1956|     90|    {
 1957|     90|        c = (unsigned char)*s;
 1958|     90|        if (c > 0x7F)
  ------------------
  |  Branch (1958:13): [True: 0, False: 90]
  ------------------
 1959|      0|            s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1960|     90|        AddChar(pprint, c);
 1961|     90|        ++s;
 1962|     90|    }
 1963|       |
 1964|       |    /* set CDATA to pass < and > unescaped */
 1965|     15|    PPrintText( doc, CDATA, indent, node );
 1966|       |
 1967|     15|    if (cfgBool(doc, TidyXmlOut) ||
  ------------------
  |  |  418|     30|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     15|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 15, False: 0]
  |  |  ------------------
  ------------------
 1968|      0|        cfgBool(doc, TidyXhtmlOut) || node->closed)
  ------------------
  |  |  418|     15|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1968:39): [True: 0, False: 0]
  ------------------
 1969|     15|        AddChar( pprint, '?' );
 1970|       |
 1971|     15|    AddChar( pprint, '>' );
 1972|     15|    PCondFlushLine( doc, indent );
 1973|     15|}
pprint.c:PCondFlushLine:
  873|     15|{
  874|     15|    TidyPrintImpl* pprint = &doc->pprint;
  875|       |
  876|     15|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (876:10): [True: 15, False: 0]
  ------------------
  877|     15|    {
  878|     15|         PFlushLineImpl( doc );
  879|       |
  880|     15|         TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|     15|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     15|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  881|     15|         pprint->line++;
  882|     15|    }
  883|       |
  884|       |    /* Issue #390 - Whether chars to flush or not, set new indent */
  885|     15|    if ( pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (885:10): [True: 0, False: 15]
  ------------------
  886|      0|    {
  887|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_INDENT)
  888|       |        SPRTF("%s Indent from %d to %d\n", __FUNCTION__, pprint->indent[ 0 ].spaces, indent );
  889|       |#endif  
  890|      0|        pprint->indent[ 0 ].spaces = indent;
  891|      0|    }
  892|     15|}
pprint.c:PPrintXmlDecl:
 1980|    113|{
 1981|    113|    AttVal* att;
 1982|    113|    uint saveWrap;
 1983|    113|    TidyPrintImpl* pprint = &doc->pprint;
 1984|    113|    Bool ucAttrs;
 1985|    113|    SetWrap( doc, indent );
 1986|    113|    saveWrap = WrapOff( doc );
 1987|       |
 1988|       |    /* no case translation for XML declaration pseudo attributes */
 1989|    113|    ucAttrs = cfg(doc, TidyUpperCaseAttrs);
  ------------------
  |  |  415|    113|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1990|    113|    TY_(SetOptionInt)(doc, TidyUpperCaseAttrs, no);
  ------------------
  |  |   23|    113|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    113|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1991|       |
 1992|    113|    AddString( pprint, "<?xml" );
 1993|       |
 1994|       |    /* Force order of XML declaration attributes */
 1995|       |    /* PPrintAttrs( doc, indent, node ); */
 1996|    113|    if ( NULL != (att = TY_(AttrGetById)(node, TidyAttr_VERSION)) )
  ------------------
  |  |   23|    113|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    113|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1996:10): [True: 0, False: 113]
  ------------------
 1997|      0|      PPrintAttribute( doc, indent, node, att );
 1998|    113|    if ( NULL != (att = TY_(AttrGetById)(node, TidyAttr_ENCODING)) )
  ------------------
  |  |   23|    113|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    113|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1998:10): [True: 3, False: 110]
  ------------------
 1999|      3|      PPrintAttribute( doc, indent, node, att );
 2000|    113|    if ( NULL != (att = TY_(GetAttrByName)(node, "standalone")) )
  ------------------
  |  |   23|    113|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    113|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2000:10): [True: 0, False: 113]
  ------------------
 2001|      0|      PPrintAttribute( doc, indent, node, att );
 2002|       |
 2003|       |    /* restore old config value */
 2004|    113|    TY_(SetOptionInt)(doc, TidyUpperCaseAttrs, ucAttrs);
  ------------------
  |  |   23|    113|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    113|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2005|       |
 2006|    113|    if ( node->end <= 0 || doc->lexer->lexbuf[node->end - 1] != '?' )
  ------------------
  |  Branch (2006:10): [True: 0, False: 113]
  |  Branch (2006:28): [True: 113, False: 0]
  ------------------
 2007|    113|        AddChar( pprint, '?' );
 2008|    113|    AddChar( pprint, '>' );
 2009|    113|    WrapOn( doc, saveWrap );
 2010|    113|    PFlushLineSmart( doc, indent );
 2011|    113|}
pprint.c:WrapOff:
  508|    113|{
  509|    113|    uint saveWrap = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|    113|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  510|    113|    TY_(SetOptionInt)( doc, TidyWrapLen, 0xFFFFFFFF );  /* very large number */
  ------------------
  |  |   23|    113|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    113|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  511|    113|    return saveWrap;
  512|    113|}
pprint.c:PPrintAttribute:
 1546|  15.3k|{
 1547|  15.3k|    TidyPrintImpl* pprint = &doc->pprint;
 1548|  15.3k|    Bool xmlOut    = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|  15.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  15.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1549|  15.3k|    Bool xhtmlOut  = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  15.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  15.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1550|  15.3k|    Bool wrapAttrs = cfgBool( doc, TidyWrapAttVals );
  ------------------
  |  |  418|  15.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  15.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1551|  15.3k|    uint ucAttrs   = cfg( doc, TidyUpperCaseAttrs );
  ------------------
  |  |  415|  15.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1552|  15.3k|    Bool indAttrs  = cfgBool( doc, TidyIndentAttributes );
  ------------------
  |  |  418|  15.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  15.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1553|  15.3k|    uint xtra      = AttrIndent( doc, node, attr );
 1554|  15.3k|    Bool first     = (attr == node->attributes);
 1555|  15.3k|    tmbstr name    = attr->attribute;
 1556|  15.3k|    Bool wrappable = no;
 1557|  15.3k|    tchar c;
 1558|       |
 1559|       |    /* fix for odd attribute indentation bug triggered by long values */
 1560|  15.3k|    if (!indAttrs)
  ------------------
  |  Branch (1560:9): [True: 15.3k, False: 0]
  ------------------
 1561|  15.3k|      xtra = 0;
 1562|       |
 1563|  15.3k|    if ( indAttrs )
  ------------------
  |  Branch (1563:10): [True: 0, False: 15.3k]
  ------------------
 1564|      0|    {
 1565|      0|        if ( TY_(nodeIsElement)(node) && !first )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1565:14): [True: 0, False: 0]
  |  Branch (1565:42): [True: 0, False: 0]
  ------------------
 1566|      0|        {
 1567|      0|            indent += xtra;
 1568|      0|            PCondFlushLineSmart( doc, indent );
 1569|      0|        }
 1570|      0|    }
 1571|       |
 1572|  15.3k|    CheckWrapIndent( doc, indent );
 1573|       |
 1574|  15.3k|    if ( !xmlOut && !xhtmlOut && attr->dict )
  ------------------
  |  Branch (1574:10): [True: 0, False: 15.3k]
  |  Branch (1574:21): [True: 0, False: 0]
  |  Branch (1574:34): [True: 0, False: 0]
  ------------------
 1575|      0|    {
 1576|      0|        if ( TY_(IsScript)(doc, name) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1576:14): [True: 0, False: 0]
  ------------------
 1577|      0|            wrappable = cfgBool( doc, TidyWrapScriptlets );
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1578|      0|        else if (!(attrIsCONTENT(attr) || attrIsVALUE(attr) || attrIsALT(attr) || attrIsTITLE(attr)) && wrapAttrs )
  ------------------
  |  |  216|      0|#define attrIsCONTENT(av)           AttrIsId( av, TidyAttr_CONTENT  )
  |  |  ------------------
  |  |  |  |  169|      0|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      else if (!(attrIsCONTENT(attr) || attrIsVALUE(attr) || attrIsALT(attr) || attrIsTITLE(attr)) && wrapAttrs )
  ------------------
  |  |  333|      0|#define attrIsVALUE(av)             AttrIsId( av, TidyAttr_VALUE  )
  |  |  ------------------
  |  |  |  |  169|      0|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      else if (!(attrIsCONTENT(attr) || attrIsVALUE(attr) || attrIsALT(attr) || attrIsTITLE(attr)) && wrapAttrs )
  ------------------
  |  |  189|      0|#define attrIsALT(av)               AttrIsId( av, TidyAttr_ALT  )
  |  |  ------------------
  |  |  |  |  169|      0|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      else if (!(attrIsCONTENT(attr) || attrIsVALUE(attr) || attrIsALT(attr) || attrIsTITLE(attr)) && wrapAttrs )
  ------------------
  |  |  328|      0|#define attrIsTITLE(av)             AttrIsId( av, TidyAttr_TITLE  )
  |  |  ------------------
  |  |  |  |  169|      0|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 0, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1578:105): [True: 0, False: 0]
  ------------------
 1579|      0|            wrappable = yes;
 1580|      0|    }
 1581|       |
 1582|  15.3k|    if ( !first && !SetWrap(doc, indent) )
  ------------------
  |  Branch (1582:10): [True: 15.3k, False: 43]
  |  Branch (1582:20): [True: 0, False: 15.3k]
  ------------------
 1583|      0|    {
 1584|      0|        TY_(PFlushLine)( doc, indent+xtra );  /* Put it on next line */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1585|      0|    }
 1586|  15.3k|    else if ( pprint->linelen > 0 )
  ------------------
  |  Branch (1586:15): [True: 15.3k, False: 0]
  ------------------
 1587|  15.3k|    {
 1588|  15.3k|        AddChar( pprint, ' ' );
 1589|  15.3k|    }
 1590|       |
 1591|       |    /* Attribute name */
 1592|  2.67M|    while (*name)
  ------------------
  |  Branch (1592:12): [True: 2.66M, False: 15.3k]
  ------------------
 1593|  2.66M|    {
 1594|  2.66M|        c = (unsigned char)*name;
 1595|       |
 1596|  2.66M|        if (c > 0x7F)
  ------------------
  |  Branch (1596:13): [True: 5, False: 2.66M]
  ------------------
 1597|      5|            name += TY_(GetUTF8)(name, &c);
  ------------------
  |  |   23|      5|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      5|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1598|  2.66M|        else if (ucAttrs == TidyUppercaseYes)
  ------------------
  |  Branch (1598:18): [True: 0, False: 2.66M]
  ------------------
 1599|      0|            c = TY_(ToUpper)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1600|       |
 1601|  2.66M|        AddChar(pprint, c);
 1602|  2.66M|        ++name;
 1603|  2.66M|    }
 1604|       |
 1605|  15.3k|    CheckWrapIndent( doc, indent );
 1606|       | 
 1607|  15.3k|    if ( attr->value == NULL )
  ------------------
  |  Branch (1607:10): [True: 15.3k, False: 29]
  ------------------
 1608|  15.3k|    {
 1609|  15.3k|        Bool isB = TY_(IsBoolAttribute)(attr);
  ------------------
  |  |   23|  15.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1610|  15.3k|        Bool scriptAttr = TY_(attrIsEvent)(attr);
  ------------------
  |  |   23|  15.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1611|       |
 1612|  15.3k|        if ( xmlOut )
  ------------------
  |  Branch (1612:14): [True: 15.3k, False: 0]
  ------------------
 1613|  15.3k|            PPrintAttrValue( doc, indent, isB ? attr->attribute : NULLSTR,
  ------------------
  |  |  625|  30.6k|#  define NULLSTR (tmbstr)""
  ------------------
  |  Branch (1613:43): [True: 0, False: 15.3k]
  ------------------
 1614|  15.3k|                             attr->delim, no, scriptAttr );
 1615|       |
 1616|      0|        else if ( !isB && !TY_(IsNewNode)(node) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1616:19): [True: 0, False: 0]
  |  Branch (1616:27): [True: 0, False: 0]
  ------------------
 1617|      0|            PPrintAttrValue( doc, indent, "", attr->delim, yes, scriptAttr );
 1618|       |
 1619|      0|        else 
 1620|      0|            SetWrap( doc, indent );
 1621|  15.3k|    }
 1622|     29|    else
 1623|     29|        PPrintAttrValue( doc, indent, attr->value, attr->delim, wrappable, no );
 1624|  15.3k|}
pprint.c:AttrIndent:
 1525|  15.3k|{
 1526|  15.3k|  uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|  15.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1527|  15.3k|  uint xtra = 2;  /* 1 for the '<', another for the ' ' */
 1528|  15.3k|  if ( node->element == NULL )
  ------------------
  |  Branch (1528:8): [True: 3, False: 15.3k]
  ------------------
 1529|      3|    return spaces;
 1530|       |
 1531|  15.3k|  if ( !TY_(nodeHasCM)(node, CM_INLINE) ||
  ------------------
  |  |   23|  15.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                if ( !TY_(nodeHasCM)(node, CM_INLINE) ||
  ------------------
  |  |  143|  15.3k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1531:8): [True: 15.3k, False: 0]
  ------------------
 1532|      0|       !ShouldIndent(doc, node->parent ? node->parent: node) )
  ------------------
  |  Branch (1532:8): [True: 0, False: 0]
  |  Branch (1532:27): [True: 0, False: 0]
  ------------------
 1533|  15.3k|    return xtra + TY_(tmbstrlen)( node->element );
  ------------------
  |  |   23|  15.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1534|       |
 1535|      0|  if ( NULL != (node = TY_(FindContainer)(node)) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1535:8): [True: 0, False: 0]
  ------------------
 1536|      0|    return xtra + TY_(tmbstrlen)( node->element );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1537|      0|  return spaces;
 1538|      0|}
pprint.c:PPrintAttrValue:
 1413|  15.3k|{
 1414|  15.3k|    TidyPrintImpl* pprint = &doc->pprint;
 1415|  15.3k|    Bool scriptlets = cfgBool(doc, TidyWrapScriptlets);
  ------------------
  |  |  418|  15.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  15.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1416|       |
 1417|  15.3k|    uint mode = PREFORMATTED | ATTRIBVALUE;
 1418|  15.3k|    if ( wrappable )
  ------------------
  |  Branch (1418:10): [True: 0, False: 15.3k]
  ------------------
 1419|      0|        mode = NORMAL | ATTRIBVALUE;
 1420|       |
 1421|       |    /* look for ASP, Tango or PHP instructions for computed attribute value */
 1422|  15.3k|    if ( value && value[0] == '<' )
  ------------------
  |  Branch (1422:10): [True: 15.3k, False: 0]
  |  Branch (1422:19): [True: 2, False: 15.3k]
  ------------------
 1423|      2|    {
 1424|      2|        if ( value[1] == '%' || value[1] == '@'||
  ------------------
  |  Branch (1424:14): [True: 0, False: 2]
  |  Branch (1424:33): [True: 0, False: 2]
  ------------------
 1425|      2|             TY_(tmbstrncmp)(value, "<?php", 5) == 0 )
  ------------------
  |  |   23|      2|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      2|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1425:14): [True: 0, False: 2]
  ------------------
 1426|      0|            mode |= CDATA;
 1427|      2|    }
 1428|       |
 1429|  15.3k|    if ( delim == 0 )
  ------------------
  |  Branch (1429:10): [True: 3, False: 15.3k]
  ------------------
 1430|      3|        delim = '"';
 1431|       |
 1432|  15.3k|    AddChar( pprint, '=' );
 1433|       |
 1434|       |    /* don't wrap after "=" for xml documents */
 1435|  15.3k|    if ( !cfgBool(doc, TidyXmlOut) || cfgBool(doc, TidyXhtmlOut) )
  ------------------
  |  |  418|  30.7k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  15.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                  if ( !cfgBool(doc, TidyXmlOut) || cfgBool(doc, TidyXhtmlOut) )
  ------------------
  |  |  418|  15.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  15.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 15.3k]
  |  |  ------------------
  ------------------
  |  Branch (1435:10): [True: 0, False: 15.3k]
  ------------------
 1436|      0|    {
 1437|      0|        SetWrap( doc, indent );
 1438|      0|        CheckWrapIndent( doc, indent );
 1439|       |        /*
 1440|       |        if ( !SetWrap(doc, indent) )
 1441|       |            PCondFlushLine( doc, indent );
 1442|       |        */
 1443|      0|    }
 1444|       |
 1445|  15.3k|    AddChar( pprint, delim );
 1446|       |
 1447|  15.3k|    if ( value )
  ------------------
  |  Branch (1447:10): [True: 15.3k, False: 0]
  ------------------
 1448|  15.3k|    {
 1449|  15.3k|        uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  15.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1450|  15.3k|        int attrStart = SetInAttrVal( pprint );
 1451|  15.3k|        int strStart = ClearInString( pprint );
 1452|       |
 1453|  1.41M|        while (*value != '\0')
  ------------------
  |  Branch (1453:16): [True: 1.39M, False: 15.3k]
  ------------------
 1454|  1.39M|        {
 1455|  1.39M|            uint c = *value;
 1456|       |
 1457|  1.39M|            if ( wrappable && c == ' ' )
  ------------------
  |  Branch (1457:18): [True: 0, False: 1.39M]
  |  Branch (1457:31): [True: 0, False: 0]
  ------------------
 1458|      0|                SetWrapAttr( doc, indent, attrStart, strStart );
 1459|       |
 1460|  1.39M|            if ( wrappable && pprint->wraphere > 0 &&
  ------------------
  |  Branch (1460:18): [True: 0, False: 1.39M]
  |  Branch (1460:31): [True: 0, False: 0]
  ------------------
 1461|      0|                 GetSpaces(pprint) + pprint->linelen >= wraplen )
  ------------------
  |  Branch (1461:18): [True: 0, False: 0]
  ------------------
 1462|      0|                WrapAttrVal( doc );
 1463|       |
 1464|  1.39M|            if ( c == delim )
  ------------------
  |  Branch (1464:18): [True: 269k, False: 1.12M]
  ------------------
 1465|   269k|            {
 1466|   269k|                ctmbstr entity = (c == '"' ? "&quot;" : "&#39;");
  ------------------
  |  Branch (1466:35): [True: 0, False: 269k]
  ------------------
 1467|   269k|                AddString( pprint, entity );
 1468|   269k|                ++value;
 1469|   269k|                continue;
 1470|   269k|            }
 1471|  1.12M|            else if (c == '"')
  ------------------
  |  Branch (1471:22): [True: 4.20k, False: 1.12M]
  ------------------
 1472|  4.20k|            {
 1473|  4.20k|                if ( cfgBool(doc, TidyQuoteMarks) )
  ------------------
  |  |  418|  4.20k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  4.20k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 4.20k]
  |  |  ------------------
  ------------------
 1474|      0|                    AddString( pprint, "&quot;" );
 1475|  4.20k|                else
 1476|  4.20k|                    AddChar( pprint, c );
 1477|       |
 1478|  4.20k|                if ( delim == '\'' && scriptAttr && scriptlets )
  ------------------
  |  Branch (1478:22): [True: 4.20k, False: 0]
  |  Branch (1478:39): [True: 0, False: 4.20k]
  |  Branch (1478:53): [True: 0, False: 0]
  ------------------
 1479|      0|                    strStart = ToggleInString( pprint );
 1480|       |
 1481|  4.20k|                ++value;
 1482|  4.20k|                continue;
 1483|  4.20k|            }
 1484|  1.12M|            else if ( c == '\'' )
  ------------------
  |  Branch (1484:23): [True: 1, False: 1.12M]
  ------------------
 1485|      1|            {
 1486|      1|                if ( cfgBool(doc, TidyQuoteMarks) )
  ------------------
  |  |  418|      1|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      1|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 1]
  |  |  ------------------
  ------------------
 1487|      0|                    AddString( pprint, "&#39;" );
 1488|      1|                else
 1489|      1|                    AddChar( pprint, c );
 1490|       |
 1491|      1|                if ( delim == '"' && scriptAttr && scriptlets )
  ------------------
  |  Branch (1491:22): [True: 1, False: 0]
  |  Branch (1491:38): [True: 0, False: 1]
  |  Branch (1491:52): [True: 0, False: 0]
  ------------------
 1492|      0|                    strStart = ToggleInString( pprint );
 1493|       |
 1494|      1|                ++value;
 1495|      1|                continue;
 1496|      1|            }
 1497|       |
 1498|       |            /* look for UTF-8 multibyte character */
 1499|  1.12M|            if ( c > 0x7F )
  ------------------
  |  Branch (1499:18): [True: 17.3k, False: 1.10M]
  ------------------
 1500|  17.3k|                 value += TY_(GetUTF8)( value, &c );
  ------------------
  |  |   23|  17.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1501|  1.12M|            ++value;
 1502|       |
 1503|  1.12M|            if ( c == '\n' )
  ------------------
  |  Branch (1503:18): [True: 0, False: 1.12M]
  ------------------
 1504|      0|            {
 1505|       |                /* No indent inside Javascript literals */
 1506|      0|                TY_(PFlushLine)( doc, (strStart < 0
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1506:40): [True: 0, False: 0]
  ------------------
 1507|      0|                                       && !cfgBool(doc, TidyLiteralAttribs) ?
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1507:43): [True: 0, False: 0]
  ------------------
 1508|      0|                                       indent : 0) );
 1509|      0|                continue;
 1510|      0|            }
 1511|  1.12M|            PPrintChar( doc, c, mode );
 1512|  1.12M|        }
 1513|  15.3k|        ClearInAttrVal( pprint );
 1514|  15.3k|        ClearInString( pprint );
 1515|  15.3k|    }
 1516|  15.3k|    AddChar( pprint, delim );
 1517|  15.3k|}
pprint.c:SetInAttrVal:
  419|  15.3k|{
  420|  15.3k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  421|  15.3k|    return ind->attrValStart = (int) pprint->linelen;
  422|  15.3k|}
pprint.c:ClearInString:
  355|  30.7k|{
  356|  30.7k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  357|  30.7k|    return ind->attrStringStart = -1;
  358|  30.7k|}
pprint.c:ClearInAttrVal:
  406|  15.3k|{
  407|  15.3k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  408|  15.3k|    ind->attrValStart = -1;
  409|  15.3k|}
pprint.c:WrapOn:
  520|    174|{
  521|    174|    TY_(SetOptionInt)( doc, TidyWrapLen, saveWrap );
  ------------------
  |  |   23|    174|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    174|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  522|    174|}
pprint.c:PPrintSection:
 2103|      1|{
 2104|      1|    TidyPrintImpl* pprint = &doc->pprint;
 2105|      1|    Bool wrapSect = cfgBool( doc, TidyWrapSection );
  ------------------
  |  |  418|      1|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      1|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2106|      1|    uint saveWrap = WrapOffCond( doc, !wrapSect  );
 2107|       |
 2108|      1|    AddString( pprint, "<![" );
 2109|      1|    PPrintText( doc, (wrapSect ? CDATA : COMMENT),
  ------------------
  |  Branch (2109:23): [True: 1, False: 0]
  ------------------
 2110|      1|                indent, node );
 2111|      1|    AddString( pprint, "]>" );
 2112|       |
 2113|       |    /* PCondFlushLine( doc, indent ); */
 2114|      1|    WrapOn( doc, saveWrap );
 2115|      1|}
pprint.c:WrapOffCond:
  529|     61|{
  530|     61|    if ( onoff )
  ------------------
  |  Branch (530:10): [True: 0, False: 61]
  ------------------
  531|      0|        return WrapOff( doc );
  532|     61|    return cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|     61|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  533|     61|}
pprint.c:PPrintAsp:
 2019|     57|{
 2020|     57|    TidyPrintImpl* pprint = &doc->pprint;
 2021|     57|    Bool wrapAsp  = cfgBool( doc, TidyWrapAsp );
  ------------------
  |  |  418|     57|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     57|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2022|     57|    Bool wrapJste = cfgBool( doc, TidyWrapJste );
  ------------------
  |  |  418|     57|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     57|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2023|     57|    uint saveWrap = WrapOffCond( doc, !wrapAsp || !wrapJste );
  ------------------
  |  Branch (2023:39): [True: 0, False: 57]
  |  Branch (2023:51): [True: 0, False: 57]
  ------------------
 2024|       |
 2025|     57|    AddString( pprint, "<%" );
 2026|     57|    PPrintText( doc, (wrapAsp ? CDATA : COMMENT), indent, node );
  ------------------
  |  Branch (2026:23): [True: 57, False: 0]
  ------------------
 2027|     57|    AddString( pprint, "%>" );
 2028|       |
 2029|       |    /* PCondFlushLine( doc, indent ); */
 2030|     57|    WrapOn( doc, saveWrap );
 2031|     57|}
pprint.c:PPrintJste:
 2039|      3|{
 2040|      3|    TidyPrintImpl* pprint = &doc->pprint;
 2041|      3|    Bool wrapAsp = cfgBool( doc, TidyWrapAsp );
  ------------------
  |  |  418|      3|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      3|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2042|      3|    uint saveWrap = WrapOffCond( doc, !wrapAsp  );
 2043|       |
 2044|      3|    AddString( pprint, "<#" );
 2045|      3|    PPrintText( doc, (cfgBool(doc, TidyWrapJste) ? CDATA : COMMENT),
  ------------------
  |  |  418|      3|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      3|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 3, False: 0]
  |  |  ------------------
  ------------------
 2046|      3|                indent, node );
 2047|      3|    AddString( pprint, "#>" );
 2048|       |
 2049|       |    /* PCondFlushLine( doc, indent ); */
 2050|      3|    WrapOn( doc, saveWrap );
 2051|      3|}
pprint.c:PPrintPhp:
 2059|     14|{
 2060|     14|    TidyPrintImpl* pprint = &doc->pprint;
 2061|     14|    Bool wrapPhp = cfgBool( doc, TidyWrapPhp );
  ------------------
  |  |  418|     14|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     14|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2062|       |    /* uint saveWrap = WrapOffCond( doc, !wrapPhp  ); */
 2063|       |
 2064|     14|    AddString( pprint, "<?" );
 2065|     14|    PPrintText( doc, CDATA, indent, node );
 2066|     14|    AddString( pprint, "?>" );
 2067|       |
 2068|       |    /* Issue #437 - add a new line if 'wrap-php' is on */
 2069|     14|    if (wrapPhp)
  ------------------
  |  Branch (2069:9): [True: 0, False: 14]
  ------------------
 2070|      0|        PCondFlushLine( doc, indent ); 
 2071|       |       
 2072|       |    /* WrapOn( doc, saveWrap ); */
 2073|     14|}
pprint.c:PCondFlushLineSmart:
  930|  88.7k|{
  931|  88.7k|    TidyPrintImpl* pprint = &doc->pprint;
  932|       |
  933|  88.7k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (933:10): [True: 62.8k, False: 25.9k]
  ------------------
  934|  62.8k|    {
  935|  62.8k|         PFlushLineImpl( doc );
  936|       |
  937|       |         /* Issue #228 - cfgBool( doc, TidyVertSpace ); */
  938|  62.8k|         if(TidyAddVS) {
  ------------------
  |  |   52|  62.8k|#define TidyAddVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyAutoState) ? no : yes )
  |  |  ------------------
  |  |  |  |  421|  62.8k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  62.8k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (52:19): [True: 62.8k, False: 0]
  |  |  |  Branch (52:20): [True: 0, False: 62.8k]
  |  |  ------------------
  ------------------
  939|  62.8k|            TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|  62.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  62.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  940|  62.8k|            pprint->line++;
  941|  62.8k|         }
  942|  62.8k|    }
  943|       |
  944|       |    /*\
  945|       |     *  Issue #390 - Must still deal with fixing indent!
  946|       |     *  If TidyOmitOptionalTags, then in cerain circumstances no PrintEndTag
  947|       |     *  will be done, so linelen will be 0...
  948|       |    \*/
  949|  88.7k|    if (pprint->indent[ 0 ].spaces != (int)indent)
  ------------------
  |  Branch (949:9): [True: 71, False: 88.6k]
  ------------------
  950|     71|    {
  951|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_INDENT)
  952|       |        SPRTF("%s Indent from %d to %d\n", __FUNCTION__, pprint->indent[ 0 ].spaces, indent );
  953|       |#endif  
  954|     71|        pprint->indent[ 0 ].spaces = indent;
  955|     71|    }
  956|  88.7k|}
pprint.c:PFlushLineSmart:
  901|    178|{
  902|    178|    TidyPrintImpl* pprint = &doc->pprint;
  903|       |
  904|    178|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (904:10): [True: 178, False: 0]
  ------------------
  905|    178|        PFlushLineImpl( doc );
  906|       |
  907|       |    /* Issue #228 - cfgBool( doc, TidyVertSpace ); */
  908|    178|    if(TidyAddVS) {
  ------------------
  |  |   52|    178|#define TidyAddVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyAutoState) ? no : yes )
  |  |  ------------------
  |  |  |  |  421|    178|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|    178|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (52:19): [True: 178, False: 0]
  |  |  |  Branch (52:20): [True: 0, False: 178]
  |  |  ------------------
  ------------------
  909|    178|        TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|    178|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    178|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  910|    178|        pprint->line++;
  911|    178|    }
  912|       |
  913|    178|    if ( pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (913:10): [True: 0, False: 178]
  ------------------
  914|      0|    {
  915|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_INDENT)
  916|       |        SPRTF("%s Indent from %d to %d\n", __FUNCTION__, pprint->indent[ 0 ].spaces, indent );
  917|       |#endif  
  918|      0|        pprint->indent[ 0 ].spaces = indent;
  919|      0|    }
  920|    178|}
pprint.c:PPrintTag:
 1772|  2.91k|{
 1773|  2.91k|    TidyPrintImpl* pprint = &doc->pprint;
 1774|  2.91k|    Bool uc = cfgBool( doc, TidyUpperCaseTags );
  ------------------
  |  |  418|  2.91k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.91k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1775|  2.91k|    Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  2.91k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.91k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1776|  2.91k|    Bool xmlOut = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|  2.91k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.91k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1777|  2.91k|    tchar c;
 1778|  2.91k|    tmbstr s = node->element;
 1779|       |
 1780|  2.91k|    AddChar( pprint, '<' );
 1781|       |
 1782|  2.91k|    if ( node->type == EndTag )
  ------------------
  |  Branch (1782:10): [True: 0, False: 2.91k]
  ------------------
 1783|      0|        AddChar( pprint, '/' );
 1784|       |
 1785|  2.91k|    if (s)
  ------------------
  |  Branch (1785:9): [True: 2.91k, False: 0]
  ------------------
 1786|  2.91k|    {
 1787|  6.30k|        while (*s)
  ------------------
  |  Branch (1787:16): [True: 3.38k, False: 2.91k]
  ------------------
 1788|  3.38k|        {
 1789|  3.38k|            c = (unsigned char)*s;
 1790|       |
 1791|  3.38k|            if (c > 0x7F)
  ------------------
  |  Branch (1791:17): [True: 125, False: 3.25k]
  ------------------
 1792|    125|                s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|    125|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    125|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1793|  3.25k|            else if (uc)
  ------------------
  |  Branch (1793:22): [True: 0, False: 3.25k]
  ------------------
 1794|      0|                c = TY_(ToUpper)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1795|       |
 1796|  3.38k|            AddChar(pprint, c);
 1797|  3.38k|            ++s;
 1798|  3.38k|        }
 1799|  2.91k|    }
 1800|       |
 1801|  2.91k|    PPrintAttrs( doc, indent, node );
 1802|       |
 1803|  2.91k|    if ( (xmlOut || xhtmlOut) &&
  ------------------
  |  Branch (1803:11): [True: 2.91k, False: 0]
  |  Branch (1803:21): [True: 0, False: 0]
  ------------------
 1804|  2.91k|         (node->type == StartEndTag || TY_(nodeCMIsEmpty)(node)) )
  ------------------
  |  |   23|  2.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1804:11): [True: 0, False: 2.91k]
  |  Branch (1804:40): [True: 0, False: 2.91k]
  ------------------
 1805|      0|    {
 1806|      0|        AddChar( pprint, ' ' );   /* Space is NS compatibility hack <br /> */
 1807|      0|        AddChar( pprint, '/' );   /* Required end tag marker */
 1808|      0|    }
 1809|       |
 1810|  2.91k|    AddChar( pprint, '>' );
 1811|       |
 1812|       |    /*\
 1813|       |     *  Appears this was added for Issue #111, #112, #113, but will now add an end tag
 1814|       |     *  for elements like <img ...> which do NOT have an EndTag, even in html5
 1815|       |     *  See Issue #162 - void elements also get a closing tag, like img, br, ...
 1816|       |     *  A complete list of the void elements in HTML.
 1817|       |     *  area, base, br, col, command, embed, hr, img, input, keygen, link, meta, param, source, track, wbr
 1818|       |     *  A new CM_VOID was added to tag_defs[] to account for these.
 1819|       |    \*/
 1820|  2.91k|    if ((node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50) && !TY_(nodeHasCM)(node, CM_VOID ) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if ((node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50) && !TY_(nodeHasCM)(node, CM_VOID ) )
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
                  if ((node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50) && !TY_(nodeHasCM)(node, CM_VOID ) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if ((node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50) && !TY_(nodeHasCM)(node, CM_VOID ) )
  ------------------
  |  |  161|      0|#define CM_VOID         (1 << 22)  /**< Elements that are void per https://www.w3.org/TR/2011/WD-html-markup-20110113/syntax.html#syntax-elements. */
  ------------------
  |  Branch (1820:10): [True: 0, False: 2.91k]
  |  Branch (1820:39): [True: 0, False: 0]
  |  Branch (1820:73): [True: 0, False: 0]
  ------------------
 1821|      0|    {
 1822|      0|        PPrintEndTag( doc, mode, indent, node );
 1823|      0|    }
 1824|       |
 1825|  2.91k|    if ( (node->type != StartEndTag || xhtmlOut || (node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50)) && !(mode & PREFORMATTED) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if ( (node->type != StartEndTag || xhtmlOut || (node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50)) && !(mode & PREFORMATTED) )
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
  |  Branch (1825:11): [True: 2.91k, False: 0]
  |  Branch (1825:40): [True: 0, False: 0]
  |  Branch (1825:53): [True: 0, False: 0]
  |  Branch (1825:82): [True: 0, False: 0]
  |  Branch (1825:117): [True: 2.91k, False: 0]
  ------------------
 1826|  2.91k|    {
 1827|  2.91k|        uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  2.91k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1828|  2.91k|        CheckWrapIndent( doc, indent );
 1829|       |
 1830|  2.91k|        if ( indent + pprint->linelen < wraplen )
  ------------------
  |  Branch (1830:14): [True: 2.91k, False: 0]
  ------------------
 1831|  2.91k|        {
 1832|       |            /* wrap after start tag if is <br/> or if it's not inline.
 1833|       |               Technically, it would be safe to call only AfterSpace.
 1834|       |               However, it would disrupt the existing algorithm. So let's
 1835|       |               leave as is. Note that AfterSpace returns true for non inline
 1836|       |               elements but can still be false for some <br>. So it has to
 1837|       |               stay as well. */
 1838|  2.91k|            if (!(mode & NOWRAP)
  ------------------
  |  Branch (1838:17): [True: 2.91k, False: 0]
  ------------------
 1839|  2.91k|                && (!TY_(nodeCMIsInline)(node) || nodeIsBR(node))
  ------------------
  |  |   23|  2.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              && (!TY_(nodeCMIsInline)(node) || nodeIsBR(node))
  ------------------
  |  |  400|      0|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|      0|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1839:21): [True: 2.91k, False: 0]
  ------------------
 1840|  2.91k|                && AfterSpace(doc->lexer, node))
  ------------------
  |  Branch (1840:20): [True: 2.91k, False: 0]
  ------------------
 1841|  2.91k|            {
 1842|  2.91k|                pprint->wraphere = pprint->linelen;
 1843|  2.91k|            }
 1844|  2.91k|        }
 1845|       |        /* flush the current buffer only if it is known to be safe,
 1846|       |           i.e. it will not introduce some spurious white spaces.
 1847|       |           See bug #996484 */
 1848|      0|        else if ( mode & NOWRAP ||
  ------------------
  |  Branch (1848:19): [True: 0, False: 0]
  ------------------
 1849|      0|                  nodeIsBR(node) || AfterSpace(doc->lexer, node))
  ------------------
  |  |  400|      0|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|      0|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1849:37): [True: 0, False: 0]
  ------------------
 1850|      0|            PCondFlushLineSmart( doc, indent );
 1851|  2.91k|    }
 1852|  2.91k|}
pprint.c:PPrintAttrs:
 1631|  2.91k|{
 1632|  2.91k|    TidyPrintImpl* pprint = &doc->pprint;
 1633|  2.91k|    AttVal* av;
 1634|       |
 1635|       |    /* add xml:space attribute to pre and other elements */
 1636|  2.91k|    if ( cfgBool(doc, TidyXmlOut) && cfgBool(doc, TidyXmlSpace) &&
  ------------------
  |  |  418|  5.83k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.91k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 2.91k, False: 0]
  |  |  ------------------
  ------------------
                  if ( cfgBool(doc, TidyXmlOut) && cfgBool(doc, TidyXmlSpace) &&
  ------------------
  |  |  418|  5.83k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.91k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 2.91k]
  |  |  ------------------
  ------------------
 1637|      0|         !TY_(GetAttrByName)(node, "xml:space") &&
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1637:10): [True: 0, False: 0]
  ------------------
 1638|      0|         TY_(XMLPreserveWhiteSpace)(doc, node) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1638:10): [True: 0, False: 0]
  ------------------
 1639|      0|    {
 1640|      0|        TY_(AddAttribute)( doc, node, "xml:space", "preserve" );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1641|      0|    }
 1642|       |
 1643|  18.2k|    for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (1643:34): [True: 15.3k, False: 2.91k]
  ------------------
 1644|  15.3k|    {
 1645|  15.3k|        if ( av->attribute != NULL )
  ------------------
  |  Branch (1645:14): [True: 15.3k, False: 20]
  ------------------
 1646|  15.3k|        {
 1647|  15.3k|            PPrintAttribute( doc, indent, node, av );
 1648|  15.3k|        }
 1649|     20|        else if ( av->asp != NULL )
  ------------------
  |  Branch (1649:19): [True: 6, False: 14]
  ------------------
 1650|      6|        {
 1651|      6|            AddChar( pprint, ' ' );
 1652|      6|            PPrintAsp( doc, indent, av->asp );
 1653|      6|        }
 1654|     14|        else if ( av->php != NULL )
  ------------------
  |  Branch (1654:19): [True: 14, False: 0]
  ------------------
 1655|     14|        {
 1656|     14|            AddChar( pprint, ' ' );
 1657|     14|            PPrintPhp( doc, indent, av->php );
 1658|     14|        }
 1659|  15.3k|    }
 1660|  2.91k|}
pprint.c:AfterSpace:
 1729|  2.91k|{
 1730|  2.91k|    return AfterSpaceImp(lexer, node, TY_(nodeCMIsEmpty)(node));
  ------------------
  |  |   23|  2.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1731|  2.91k|}
pprint.c:AfterSpaceImp:
 1689|  2.91k|{
 1690|  2.91k|    Node *prev;
 1691|       |
 1692|  2.91k|    if ( !TY_(nodeCMIsInline)(node) )
  ------------------
  |  |   23|  2.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1692:10): [True: 2.91k, False: 0]
  ------------------
 1693|  2.91k|        return yes;
 1694|       |
 1695|      0|    prev = node->prev;
 1696|      0|    if (prev)
  ------------------
  |  Branch (1696:9): [True: 0, False: 0]
  ------------------
 1697|      0|    {
 1698|      0|        if (TY_(nodeIsText)(prev))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1698:13): [True: 0, False: 0]
  ------------------
 1699|      0|            return TY_(TextNodeEndWithSpace)( lexer, prev );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1700|      0|        else if (nodeIsBR(prev))
  ------------------
  |  |  400|      0|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|      0|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1701|      0|            return yes;
 1702|       |
 1703|      0|        return no;
 1704|      0|    }
 1705|       |
 1706|      0|    if ( isEmpty && !TY_(nodeCMIsInline)(node->parent) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1706:10): [True: 0, False: 0]
  |  Branch (1706:21): [True: 0, False: 0]
  ------------------
 1707|      0|        return no;
 1708|       |
 1709|      0|    return AfterSpaceImp(lexer, node->parent, isEmpty);
 1710|      0|}
pprint.c:PPrintEndTag:
 1739|  2.91k|{
 1740|  2.91k|    TidyPrintImpl* pprint = &doc->pprint;
 1741|  2.91k|    Bool uc = cfgBool( doc, TidyUpperCaseTags );
  ------------------
  |  |  418|  2.91k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.91k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1742|  2.91k|    tmbstr s = node->element;
 1743|  2.91k|    tchar c;
 1744|       |
 1745|  2.91k|    AddString( pprint, "</" );
 1746|       |
 1747|  2.91k|    if (s)
  ------------------
  |  Branch (1747:9): [True: 2.91k, False: 0]
  ------------------
 1748|  2.91k|    {
 1749|  6.30k|        while (*s)
  ------------------
  |  Branch (1749:16): [True: 3.38k, False: 2.91k]
  ------------------
 1750|  3.38k|        {
 1751|  3.38k|             c = (unsigned char)*s;
 1752|       |
 1753|  3.38k|             if (c > 0x7F)
  ------------------
  |  Branch (1753:18): [True: 125, False: 3.25k]
  ------------------
 1754|    125|                 s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|    125|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    125|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1755|  3.25k|             else if (uc)
  ------------------
  |  Branch (1755:23): [True: 0, False: 3.25k]
  ------------------
 1756|      0|                 c = TY_(ToUpper)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1757|       |
 1758|  3.38k|             AddChar(pprint, c);
 1759|  3.38k|             ++s;
 1760|  3.38k|        }
 1761|  2.91k|    }
 1762|       |
 1763|  2.91k|    AddChar( pprint, '>' );
 1764|  2.91k|}

prvTidyStdErrOutput:
   68|     98|{
   69|     98|  if ( stderrStreamOut.sink.sinkData == 0 )
  ------------------
  |  Branch (69:8): [True: 1, False: 97]
  ------------------
   70|      1|      stderrStreamOut.sink.sinkData = stderr;
   71|     98|  return &stderrStreamOut;
   72|     98|}
prvTidyReleaseStreamOut:
   75|    196|{
   76|    196|    if ( out && out != &stderrStreamOut && out != &stdoutStreamOut )
  ------------------
  |  Branch (76:10): [True: 196, False: 0]
  |  Branch (76:17): [True: 98, False: 98]
  |  Branch (76:44): [True: 98, False: 0]
  ------------------
   77|     98|    {
   78|     98|        if ( out->iotype == FileIO )
  ------------------
  |  Branch (78:14): [True: 0, False: 98]
  ------------------
   79|      0|            fclose( (FILE*) out->sink.sinkData );
   80|     98|        TidyDocFree( doc, out );
  ------------------
  |  |  159|     98|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   81|     98|    }
   82|    196|}
prvTidyinitStreamIn:
   91|     98|{
   92|     98|    StreamIn *in = (StreamIn*) TidyDocAlloc( doc, sizeof(StreamIn) );
  ------------------
  |  |  157|     98|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|     98|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
   93|       |
   94|     98|    TidyClearMemory( in, sizeof(StreamIn) );
  ------------------
  |  |   70|     98|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
   95|     98|    in->curline = 1;
   96|     98|    in->curcol = 1;
   97|     98|    in->encoding = encoding;
   98|     98|    in->state = FSM_ASCII;
   99|     98|    in->doc = doc;
  100|     98|    in->bufsize = CHARBUF_SIZE;
  101|     98|    in->allocator = doc->allocator;
  102|     98|    in->charbuf = (tchar*)TidyDocAlloc(doc, sizeof(tchar) * in->bufsize);
  ------------------
  |  |  157|     98|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|     98|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  103|     98|    InitLastPos( in );
  104|     98|    return in;
  105|     98|}
prvTidyfreeStreamIn:
  108|     98|{
  109|     98|    TidyFree(in->allocator, in->charbuf);
  ------------------
  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  110|     98|    TidyFree(in->allocator, in);
  ------------------
  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  111|     98|}
prvTidyBufferInput:
  126|     98|{
  127|     98|    StreamIn *in = TY_(initStreamIn)( doc, encoding );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  128|     98|    tidyInitInputBuffer( &in->source, buf );
  129|     98|    in->iotype = BufferIO;
  130|     98|    return in;
  131|     98|}
prvTidyReadBOMEncoding:
  142|     98|{
  143|     98|    uint c, c1;
  144|     98|    uint bom;
  145|       |
  146|     98|    c = ReadByte(in);
  147|     98|    if (c == EndOfStream)
  ------------------
  |  | 1064|     98|#define EndOfStream (~0u)
  ------------------
  |  Branch (147:9): [True: 0, False: 98]
  ------------------
  148|      0|        return -1;
  149|       |
  150|     98|    c1 = ReadByte( in );
  151|     98|    if (c1 == EndOfStream)
  ------------------
  |  | 1064|     98|#define EndOfStream (~0u)
  ------------------
  |  Branch (151:9): [True: 0, False: 98]
  ------------------
  152|      0|    {
  153|      0|        UngetByte(in, c);
  154|      0|        return -1;
  155|      0|    }
  156|       |
  157|       |    /* todo: dont warn about mismatch for auto input encoding */
  158|       |    /* todo: let the user override the encoding found here */
  159|       |
  160|     98|    bom = (c << 8) + c1;
  161|       |
  162|     98|    if ( bom == UNICODE_BOM_BE )
  ------------------
  |  |   28|     98|#define UNICODE_BOM_BE   0xFEFF   /* big-endian (default) UNICODE BOM */
  ------------------
  |  Branch (162:10): [True: 0, False: 98]
  ------------------
  163|      0|    {
  164|       |        /* big-endian UTF-16 */
  165|      0|        if ( in->encoding != UTF16 && in->encoding != UTF16BE )
  ------------------
  |  |  144|      0|#define UTF16       11
  ------------------
                      if ( in->encoding != UTF16 && in->encoding != UTF16BE )
  ------------------
  |  |  143|      0|#define UTF16BE     10
  ------------------
  |  Branch (165:14): [True: 0, False: 0]
  |  Branch (165:39): [True: 0, False: 0]
  ------------------
  166|      0|            TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16BE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16BE);
  ------------------
  |  |  143|      0|#define UTF16BE     10
  ------------------
  167|       |
  168|      0|        return UTF16BE; /* return decoded BOM */
  ------------------
  |  |  143|      0|#define UTF16BE     10
  ------------------
  169|      0|    }
  170|     98|    else if (bom == UNICODE_BOM_LE)
  ------------------
  |  |   30|     98|#define UNICODE_BOM_LE   0xFFFE   /* little-endian UNICODE BOM */
  ------------------
  |  Branch (170:14): [True: 0, False: 98]
  ------------------
  171|      0|    {
  172|       |        /* little-endian UTF-16 */
  173|      0|        if (in->encoding != UTF16 && in->encoding != UTF16LE)
  ------------------
  |  |  144|      0|#define UTF16       11
  ------------------
                      if (in->encoding != UTF16 && in->encoding != UTF16LE)
  ------------------
  |  |  142|      0|#define UTF16LE     9
  ------------------
  |  Branch (173:13): [True: 0, False: 0]
  |  Branch (173:38): [True: 0, False: 0]
  ------------------
  174|      0|            TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16LE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16LE);
  ------------------
  |  |  142|      0|#define UTF16LE     9
  ------------------
  175|       |
  176|      0|        return UTF16LE; /* return decoded BOM */
  ------------------
  |  |  142|      0|#define UTF16LE     9
  ------------------
  177|      0|    }
  178|     98|    else
  179|     98|    {
  180|     98|        uint c2 = ReadByte(in);
  181|       |
  182|     98|        if (c2 == EndOfStream)
  ------------------
  |  | 1064|     98|#define EndOfStream (~0u)
  ------------------
  |  Branch (182:13): [True: 0, False: 98]
  ------------------
  183|      0|        {
  184|      0|            UngetByte(in, c1);
  185|      0|            UngetByte(in, c);
  186|      0|            return -1;
  187|      0|        }
  188|       |
  189|     98|        if (((c << 16) + (c1 << 8) + c2) == UNICODE_BOM_UTF8)
  ------------------
  |  |   31|     98|#define UNICODE_BOM_UTF8 0xEFBBBF /* UTF-8 UNICODE BOM */
  ------------------
  |  Branch (189:13): [True: 0, False: 98]
  ------------------
  190|      0|        {
  191|       |            /* UTF-8 */
  192|      0|            if (in->encoding != UTF8)
  ------------------
  |  |  137|      0|#define UTF8        4
  ------------------
  |  Branch (192:17): [True: 0, False: 0]
  ------------------
  193|      0|                TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF8);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF8);
  ------------------
  |  |  137|      0|#define UTF8        4
  ------------------
  194|       |
  195|      0|            return UTF8;
  ------------------
  |  |  137|      0|#define UTF8        4
  ------------------
  196|      0|        }
  197|     98|        else
  198|     98|            UngetByte( in, c2 );
  199|     98|    }
  200|       |
  201|     98|    UngetByte(in, c1);
  202|     98|    UngetByte(in, c);
  203|       |
  204|     98|    return -1;
  205|     98|}
prvTidyReadChar:
  240|   250M|{
  241|   250M|    uint c = EndOfStream;
  ------------------
  |  | 1064|   250M|#define EndOfStream (~0u)
  ------------------
  242|       |
  243|   250M|    if ( in->pushed )
  ------------------
  |  Branch (243:10): [True: 1.23M, False: 249M]
  ------------------
  244|  1.23M|        return PopChar( in );
  245|       |
  246|   249M|    SaveLastPos( in );
  247|       |
  248|   249M|    if ( in->tabs > 0 )
  ------------------
  |  Branch (248:10): [True: 207M, False: 42.1M]
  ------------------
  249|   207M|    {
  250|   207M|        in->curcol++;
  251|   207M|        in->tabs--;
  252|   207M|        return ' ';
  253|   207M|    }
  254|       |    
  255|  42.1M|    for (;;)
  256|  42.1M|    {
  257|  42.1M|        c = ReadCharFromStream(in);
  258|       |
  259|  42.1M|        if ( EndOfStream == c )
  ------------------
  |  | 1064|  42.1M|#define EndOfStream (~0u)
  ------------------
  |  Branch (259:14): [True: 8.46k, False: 42.1M]
  ------------------
  260|  8.46k|            return EndOfStream;
  ------------------
  |  | 1064|  8.46k|#define EndOfStream (~0u)
  ------------------
  261|       |
  262|  42.1M|        if (c == '\n')
  ------------------
  |  Branch (262:13): [True: 45.7k, False: 42.1M]
  ------------------
  263|  45.7k|        {
  264|  45.7k|            in->curcol = 1;
  265|  45.7k|            in->curline++;
  266|  45.7k|            break;
  267|  45.7k|        }
  268|       |
  269|  42.1M|        if (c == '\t')
  ------------------
  |  Branch (269:13): [True: 29.7M, False: 12.3M]
  ------------------
  270|  29.7M|        {
  271|  29.7M|            Bool keeptabs = cfg( in->doc, TidyKeepTabs );
  ------------------
  |  |  415|  29.7M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  272|  29.7M|            if (!keeptabs) {
  ------------------
  |  Branch (272:17): [True: 29.7M, False: 0]
  ------------------
  273|  29.7M|                uint tabsize = cfg(in->doc, TidyTabSize);
  ------------------
  |  |  415|  29.7M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  274|  29.7M|                in->tabs = tabsize > 0 ?
  ------------------
  |  Branch (274:28): [True: 29.7M, False: 0]
  ------------------
  275|  29.7M|                    tabsize - ((in->curcol - 1) % tabsize) - 1
  276|  29.7M|                    : 0;
  277|  29.7M|                c = ' ';
  278|  29.7M|            }
  279|  29.7M|            in->curcol++;
  280|  29.7M|            break;
  281|  29.7M|        }
  282|       |
  283|       |        /* #427663 - map '\r' to '\n' - Andy Quick 11 Aug 00 */
  284|  12.3M|        if (c == '\r')
  ------------------
  |  Branch (284:13): [True: 37.2k, False: 12.3M]
  ------------------
  285|  37.2k|        {
  286|  37.2k|            c = ReadCharFromStream(in);
  287|  37.2k|            if (c != '\n')
  ------------------
  |  Branch (287:17): [True: 37.2k, False: 0]
  ------------------
  288|  37.2k|            {
  289|  37.2k|                TY_(UngetChar)( c, in );
  ------------------
  |  |   23|  37.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  290|  37.2k|                c = '\n';
  291|  37.2k|            }
  292|      0|            else
  293|      0|            {
  294|      0|            }
  295|  37.2k|            in->curcol = 1;
  296|  37.2k|            in->curline++;
  297|  37.2k|            break;
  298|  37.2k|        }
  299|       |
  300|  12.3M|#ifndef NO_NATIVE_ISO2022_SUPPORT
  301|       |        /* strip control characters, except for Esc */
  302|  12.3M|        if (c == '\033')
  ------------------
  |  Branch (302:13): [True: 57, False: 12.3M]
  ------------------
  303|     57|            break;
  304|  12.3M|#endif
  305|       |
  306|       |        /* Form Feed is allowed in HTML */
  307|  12.3M|        if ( c == '\015' && !cfgBool(in->doc, TidyXmlTags) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (307:14): [True: 0, False: 12.3M]
  |  Branch (307:29): [True: 0, False: 0]
  ------------------
  308|      0|            break;
  309|       |            
  310|  12.3M|        if ( c < 32 )
  ------------------
  |  Branch (310:14): [True: 43.8k, False: 12.2M]
  ------------------
  311|  43.8k|            continue; /* discard control char */
  312|       |
  313|       |        /* watch out for chars that have already been decoded such as */
  314|       |        /* IS02022, UTF-8 etc, that don't require further decoding */
  315|       |
  316|  12.2M|        if (
  317|  12.2M|            in->encoding == RAW
  ------------------
  |  |  133|  24.5M|#define RAW         0
  ------------------
  |  Branch (317:13): [True: 0, False: 12.2M]
  ------------------
  318|  12.2M|#ifndef NO_NATIVE_ISO2022_SUPPORT
  319|  12.2M|         || in->encoding == ISO2022
  ------------------
  |  |  138|  24.5M|#define ISO2022     5
  ------------------
  |  Branch (319:13): [True: 0, False: 12.2M]
  ------------------
  320|  12.2M|#endif
  321|  12.2M|         || in->encoding == UTF8
  ------------------
  |  |  137|  24.5M|#define UTF8        4
  ------------------
  |  Branch (321:13): [True: 12.2M, False: 0]
  ------------------
  322|      0|         || in->encoding == SHIFTJIS /* #431953 - RJ */
  ------------------
  |  |  146|  12.2M|#define SHIFTJIS    13
  ------------------
  |  Branch (322:13): [True: 0, False: 0]
  ------------------
  323|      0|         || in->encoding == BIG5     /* #431953 - RJ */
  ------------------
  |  |  145|      0|#define BIG5        12
  ------------------
  |  Branch (323:13): [True: 0, False: 0]
  ------------------
  324|  12.2M|           )
  325|  12.2M|        {
  326|  12.2M|            in->curcol++;
  327|  12.2M|            break;
  328|  12.2M|        }
  329|       |
  330|       |        /* handle surrogate pairs */
  331|      0|        if ( in->encoding == UTF16LE ||
  ------------------
  |  |  142|      0|#define UTF16LE     9
  ------------------
  |  Branch (331:14): [True: 0, False: 0]
  ------------------
  332|      0|             in->encoding == UTF16   ||
  ------------------
  |  |  144|      0|#define UTF16       11
  ------------------
  |  Branch (332:14): [True: 0, False: 0]
  ------------------
  333|      0|             in->encoding == UTF16BE )
  ------------------
  |  |  143|      0|#define UTF16BE     10
  ------------------
  |  Branch (333:14): [True: 0, False: 0]
  ------------------
  334|      0|        {
  335|      0|            if ( !TY_(IsValidUTF16FromUCS4)(c) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (335:18): [True: 0, False: 0]
  ------------------
  336|      0|            {
  337|       |                /* invalid UTF-16 value */
  338|      0|                TY_(ReportEncodingError)(in->doc, INVALID_UTF16, c, yes);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  339|      0|                c = 0;
  340|      0|            }
  341|      0|            else if ( TY_(IsLowSurrogate)(c) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (341:23): [True: 0, False: 0]
  ------------------
  342|      0|            {
  343|      0|                uint n = c;
  344|      0|                uint m = ReadCharFromStream( in );
  345|      0|                if ( m == EndOfStream )
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
  |  Branch (345:22): [True: 0, False: 0]
  ------------------
  346|      0|                   return EndOfStream;
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
  347|       |
  348|      0|                c = 0;
  349|      0|                if ( TY_(IsHighSurrogate)(m) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (349:22): [True: 0, False: 0]
  ------------------
  350|      0|                {
  351|      0|                    n = TY_(CombineSurrogatePair)( m, n );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  352|      0|                    if ( TY_(IsValidCombinedChar)(n) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (352:26): [True: 0, False: 0]
  ------------------
  353|      0|                        c = n;
  354|      0|                }
  355|       |                /* not a valid pair */
  356|      0|                if ( 0 == c )
  ------------------
  |  Branch (356:22): [True: 0, False: 0]
  ------------------
  357|      0|                    TY_(ReportEncodingError)( in->doc, INVALID_UTF16, c, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  358|      0|            }
  359|      0|        }
  360|       |
  361|       |        /* Do first: acts on range 128 - 255 */
  362|      0|        switch ( in->encoding )
  ------------------
  |  Branch (362:18): [True: 0, False: 0]
  ------------------
  363|      0|        {
  364|      0|        case MACROMAN:
  ------------------
  |  |  139|      0|#define MACROMAN    6
  ------------------
  |  Branch (364:9): [True: 0, False: 0]
  ------------------
  365|      0|            c = TY_(DecodeMacRoman)( c );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  366|      0|            break;
  367|      0|        case IBM858:
  ------------------
  |  |  141|      0|#define IBM858      8
  ------------------
  |  Branch (367:9): [True: 0, False: 0]
  ------------------
  368|      0|            c = DecodeIbm850( c );
  369|      0|            break;
  370|      0|        case LATIN0:
  ------------------
  |  |  135|      0|#define LATIN0      2
  ------------------
  |  Branch (370:9): [True: 0, False: 0]
  ------------------
  371|      0|            c = DecodeLatin0( c );
  372|      0|            break;
  373|      0|        }
  374|       |
  375|       |        /* produced e.g. as a side-effect of smart quotes in Word */
  376|       |        /* but can't happen if using MACROMAN encoding */
  377|      0|        if ( 127 < c && c < 160 )
  ------------------
  |  Branch (377:14): [True: 0, False: 0]
  |  Branch (377:25): [True: 0, False: 0]
  ------------------
  378|      0|        {
  379|      0|            uint c1 = 0, replMode = DISCARDED_CHAR;
  ------------------
  |  |  314|      0|#define DISCARDED_CHAR          1
  ------------------
  380|      0|            Bool isVendorChar = ( in->encoding == WIN1252 ||
  ------------------
  |  |  140|      0|#define WIN1252     7
  ------------------
  |  Branch (380:35): [True: 0, False: 0]
  ------------------
  381|      0|                                  in->encoding == MACROMAN );
  ------------------
  |  |  139|      0|#define MACROMAN    6
  ------------------
  |  Branch (381:35): [True: 0, False: 0]
  ------------------
  382|      0|            Bool isMacChar    = ( in->encoding == MACROMAN );
  ------------------
  |  |  139|      0|#define MACROMAN    6
  ------------------
  383|       |            
  384|       |            /* set error position just before offending character */
  385|      0|            if (in->doc->lexer)
  ------------------
  |  Branch (385:17): [True: 0, False: 0]
  ------------------
  386|      0|            {
  387|      0|                in->doc->lexer->lines = in->curline;
  388|      0|                in->doc->lexer->columns = in->curcol;
  389|      0|            }
  390|       |                
  391|      0|            if ( isMacChar )
  ------------------
  |  Branch (391:18): [True: 0, False: 0]
  ------------------
  392|      0|                c1 = TY_(DecodeMacRoman)( c );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  393|      0|            else
  394|      0|                c1 = TY_(DecodeWin1252)( c );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  395|      0|            if ( c1 )
  ------------------
  |  Branch (395:18): [True: 0, False: 0]
  ------------------
  396|      0|                replMode = REPLACED_CHAR;
  ------------------
  |  |  313|      0|#define REPLACED_CHAR           0
  ------------------
  397|       |                
  398|      0|            if ( c1 == 0 && isVendorChar )
  ------------------
  |  Branch (398:18): [True: 0, False: 0]
  |  Branch (398:29): [True: 0, False: 0]
  ------------------
  399|      0|                TY_(ReportEncodingError)(in->doc, VENDOR_SPECIFIC_CHARS, c, replMode == DISCARDED_CHAR);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportEncodingError)(in->doc, VENDOR_SPECIFIC_CHARS, c, replMode == DISCARDED_CHAR);
  ------------------
  |  |  314|      0|#define DISCARDED_CHAR          1
  ------------------
  400|      0|            else if ( ! isVendorChar )
  ------------------
  |  Branch (400:23): [True: 0, False: 0]
  ------------------
  401|      0|                TY_(ReportEncodingError)(in->doc, INVALID_SGML_CHARS, c, replMode == DISCARDED_CHAR);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportEncodingError)(in->doc, INVALID_SGML_CHARS, c, replMode == DISCARDED_CHAR);
  ------------------
  |  |  314|      0|#define DISCARDED_CHAR          1
  ------------------
  402|       |                
  403|      0|            c = c1;
  404|      0|        }
  405|       |
  406|      0|        if ( c == 0 )
  ------------------
  |  Branch (406:14): [True: 0, False: 0]
  ------------------
  407|      0|            continue; /* illegal char is discarded */
  408|       |        
  409|      0|        in->curcol++;
  410|      0|        break;
  411|      0|    }
  412|       |
  413|  42.1M|    return c;
  414|  42.1M|}
prvTidyUngetChar:
  440|  1.23M|{
  441|  1.23M|    if (c == EndOfStream)
  ------------------
  |  | 1064|  1.23M|#define EndOfStream (~0u)
  ------------------
  |  Branch (441:9): [True: 125, False: 1.23M]
  ------------------
  442|    125|    {
  443|       |        /* fprintf(stderr, "Attempt to UngetChar EOF\n"); */
  444|    125|        return;
  445|    125|    }
  446|       |    
  447|  1.23M|    in->pushed = yes;
  448|       |
  449|  1.23M|    if (in->bufpos + 1 >= in->bufsize)
  ------------------
  |  Branch (449:9): [True: 45, False: 1.23M]
  ------------------
  450|     45|        in->charbuf = (tchar*)TidyRealloc(in->allocator, in->charbuf, sizeof(tchar) * ++(in->bufsize));
  ------------------
  |  |   67|     45|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  451|       |
  452|  1.23M|    in->charbuf[(in->bufpos)++] = c;
  453|       |
  454|  1.23M|    if (c == '\n')
  ------------------
  |  Branch (454:9): [True: 187, False: 1.23M]
  ------------------
  455|    187|        --(in->curline);
  456|       |
  457|  1.23M|    RestoreLastPos( in );
  458|  1.23M|}
prvTidyBufferOutput:
  484|    196|{
  485|    196|    StreamOut* out = initStreamOut( doc, encoding, nl );
  486|    196|    tidyInitOutputBuffer( &out->sink, buf );
  487|    196|    out->iotype = BufferIO;
  488|    196|    return out;
  489|    196|}
prvTidyWriteChar:
  499|   229M|{
  500|       |    /* Translate outgoing newlines */
  501|   229M|    if ( LF == c )
  ------------------
  |  |  163|   229M|#define LF    0xA
  ------------------
  |  Branch (501:10): [True: 66.9k, False: 229M]
  ------------------
  502|  66.9k|    {
  503|  66.9k|      if ( out->nl == TidyCRLF )
  ------------------
  |  Branch (503:12): [True: 0, False: 66.9k]
  ------------------
  504|      0|          TY_(WriteChar)( CR, out );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                        TY_(WriteChar)( CR, out );
  ------------------
  |  |  162|      0|#define CR    0xD
  ------------------
  505|  66.9k|      else if ( out->nl == TidyCR )
  ------------------
  |  Branch (505:17): [True: 0, False: 66.9k]
  ------------------
  506|      0|          c = CR;
  ------------------
  |  |  162|      0|#define CR    0xD
  ------------------
  507|  66.9k|    }
  508|       |
  509|   229M|    if (out->encoding == MACROMAN)
  ------------------
  |  |  139|   229M|#define MACROMAN    6
  ------------------
  |  Branch (509:9): [True: 0, False: 229M]
  ------------------
  510|      0|    {
  511|      0|        EncodeMacRoman( c, out );
  512|      0|    }
  513|   229M|    else if (out->encoding == WIN1252)
  ------------------
  |  |  140|   229M|#define WIN1252     7
  ------------------
  |  Branch (513:14): [True: 0, False: 229M]
  ------------------
  514|      0|    {
  515|      0|        EncodeWin1252( c, out );
  516|      0|    }
  517|   229M|    else if (out->encoding == IBM858)
  ------------------
  |  |  141|   229M|#define IBM858      8
  ------------------
  |  Branch (517:14): [True: 0, False: 229M]
  ------------------
  518|      0|    {
  519|      0|        EncodeIbm858( c, out );
  520|      0|    }
  521|   229M|    else if (out->encoding == LATIN0)
  ------------------
  |  |  135|   229M|#define LATIN0      2
  ------------------
  |  Branch (521:14): [True: 0, False: 229M]
  ------------------
  522|      0|    {
  523|      0|        EncodeLatin0( c, out );
  524|      0|    }
  525|       |
  526|   229M|    else if (out->encoding == UTF8)
  ------------------
  |  |  137|   229M|#define UTF8        4
  ------------------
  |  Branch (526:14): [True: 229M, False: 0]
  ------------------
  527|   229M|    {
  528|   229M|        int count = 0;
  529|       |        
  530|   229M|        TY_(EncodeCharToUTF8Bytes)( c, NULL, &out->sink, &count );
  ------------------
  |  |   23|   229M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   229M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  531|   229M|        if (count <= 0)
  ------------------
  |  Branch (531:13): [True: 0, False: 229M]
  ------------------
  532|      0|        {
  533|       |            /* replacement char 0xFFFD encoded as UTF-8 */
  534|      0|            PutByte(0xEF, out); PutByte(0xBF, out); PutByte(0xBF, out);
  535|      0|        }
  536|   229M|    }
  537|      0|#ifndef NO_NATIVE_ISO2022_SUPPORT
  538|      0|    else if (out->encoding == ISO2022)
  ------------------
  |  |  138|      0|#define ISO2022     5
  ------------------
  |  Branch (538:14): [True: 0, False: 0]
  ------------------
  539|      0|    {
  540|      0|        if (c == 0x1b)  /* ESC */
  ------------------
  |  Branch (540:13): [True: 0, False: 0]
  ------------------
  541|      0|            out->state = FSM_ESC;
  542|      0|        else
  543|      0|        {
  544|      0|            switch (out->state)
  ------------------
  |  Branch (544:21): [True: 0, False: 0]
  ------------------
  545|      0|            {
  546|      0|            case FSM_ESC:
  ------------------
  |  Branch (546:13): [True: 0, False: 0]
  ------------------
  547|      0|                if (c == '$')
  ------------------
  |  Branch (547:21): [True: 0, False: 0]
  ------------------
  548|      0|                    out->state = FSM_ESCD;
  549|      0|                else if (c == '(')
  ------------------
  |  Branch (549:26): [True: 0, False: 0]
  ------------------
  550|      0|                    out->state = FSM_ESCP;
  551|      0|                else
  552|      0|                    out->state = FSM_ASCII;
  553|      0|                break;
  554|       |
  555|      0|            case FSM_ESCD:
  ------------------
  |  Branch (555:13): [True: 0, False: 0]
  ------------------
  556|      0|                if (c == '(')
  ------------------
  |  Branch (556:21): [True: 0, False: 0]
  ------------------
  557|      0|                    out->state = FSM_ESCDP;
  558|      0|                else
  559|      0|                    out->state = FSM_NONASCII;
  560|      0|                break;
  561|       |
  562|      0|            case FSM_ESCDP:
  ------------------
  |  Branch (562:13): [True: 0, False: 0]
  ------------------
  563|      0|                out->state = FSM_NONASCII;
  564|      0|                break;
  565|       |
  566|      0|            case FSM_ESCP:
  ------------------
  |  Branch (566:13): [True: 0, False: 0]
  ------------------
  567|      0|                out->state = FSM_ASCII;
  568|      0|                break;
  569|       |
  570|      0|            case FSM_NONASCII:
  ------------------
  |  Branch (570:13): [True: 0, False: 0]
  ------------------
  571|      0|                c &= 0x7F;
  572|      0|                break;
  573|       |
  574|      0|            case FSM_ASCII:
  ------------------
  |  Branch (574:13): [True: 0, False: 0]
  ------------------
  575|      0|                break;
  576|      0|            }
  577|      0|        }
  578|       |
  579|      0|        PutByte(c, out);
  580|      0|    }
  581|      0|#endif /* NO_NATIVE_ISO2022_SUPPORT */
  582|       |
  583|      0|    else if ( out->encoding == UTF16LE ||
  ------------------
  |  |  142|      0|#define UTF16LE     9
  ------------------
  |  Branch (583:15): [True: 0, False: 0]
  ------------------
  584|      0|              out->encoding == UTF16BE ||
  ------------------
  |  |  143|      0|#define UTF16BE     10
  ------------------
  |  Branch (584:15): [True: 0, False: 0]
  ------------------
  585|      0|              out->encoding == UTF16 )
  ------------------
  |  |  144|      0|#define UTF16       11
  ------------------
  |  Branch (585:15): [True: 0, False: 0]
  ------------------
  586|      0|    {
  587|      0|        int i, numChars = 1;
  588|      0|        uint theChars[2];
  589|       |        
  590|      0|        if ( !TY_(IsValidUTF16FromUCS4)(c) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (590:14): [True: 0, False: 0]
  ------------------
  591|      0|        {
  592|       |            /* invalid UTF-16 value */
  593|      0|            numChars = 0;
  594|      0|        }
  595|      0|        else if ( TY_(IsCombinedChar)(c) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (595:19): [True: 0, False: 0]
  ------------------
  596|      0|        {
  597|       |            /* output both, unless something goes wrong */
  598|      0|            numChars = 2;
  599|      0|            if ( !TY_(SplitSurrogatePair)(c, &theChars[0], &theChars[1]) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (599:18): [True: 0, False: 0]
  ------------------
  600|      0|            {
  601|      0|                numChars = 0;
  602|      0|            }
  603|      0|        }
  604|      0|        else
  605|      0|        {
  606|       |            /* just put the char out */
  607|      0|            theChars[0] = c;
  608|      0|        }
  609|       |        
  610|      0|        for (i = 0; i < numChars; i++)
  ------------------
  |  Branch (610:21): [True: 0, False: 0]
  ------------------
  611|      0|        {
  612|      0|            c = theChars[i];
  613|       |            
  614|      0|            if (out->encoding == UTF16LE)
  ------------------
  |  |  142|      0|#define UTF16LE     9
  ------------------
  |  Branch (614:17): [True: 0, False: 0]
  ------------------
  615|      0|            {
  616|      0|                uint ch = c & 0xFF; PutByte(ch, out); 
  617|      0|                ch = (c >> 8) & 0xFF; PutByte(ch, out); 
  618|      0|            }
  619|       |    
  620|      0|            else if (out->encoding == UTF16BE || out->encoding == UTF16)
  ------------------
  |  |  143|      0|#define UTF16BE     10
  ------------------
                          else if (out->encoding == UTF16BE || out->encoding == UTF16)
  ------------------
  |  |  144|      0|#define UTF16       11
  ------------------
  |  Branch (620:22): [True: 0, False: 0]
  |  Branch (620:50): [True: 0, False: 0]
  ------------------
  621|      0|            {
  622|      0|                uint ch = (c >> 8) & 0xFF; PutByte(ch, out); 
  623|      0|                ch = c & 0xFF; PutByte(ch, out); 
  624|      0|            }
  625|      0|        }
  626|      0|    }
  627|      0|    else if (out->encoding == BIG5 || out->encoding == SHIFTJIS)
  ------------------
  |  |  145|      0|#define BIG5        12
  ------------------
                  else if (out->encoding == BIG5 || out->encoding == SHIFTJIS)
  ------------------
  |  |  146|      0|#define SHIFTJIS    13
  ------------------
  |  Branch (627:14): [True: 0, False: 0]
  |  Branch (627:39): [True: 0, False: 0]
  ------------------
  628|      0|    {
  629|      0|        if (c < 128)
  ------------------
  |  Branch (629:13): [True: 0, False: 0]
  ------------------
  630|      0|            PutByte(c, out);
  631|      0|        else
  632|      0|        {
  633|      0|            uint ch = (c >> 8) & 0xFF; PutByte(ch, out); 
  634|      0|            ch = c & 0xFF; PutByte(ch, out); 
  635|      0|        }
  636|      0|    }
  637|      0|    else
  638|      0|        PutByte( c, out );
  639|   229M|}
prvTidyDecodeWin1252:
  660|      1|{
  661|      1|    if (127 < c && c < 160)
  ------------------
  |  Branch (661:9): [True: 1, False: 0]
  |  Branch (661:20): [True: 1, False: 0]
  ------------------
  662|      1|        c = Win2Unicode[c - 128];
  663|       |        
  664|      1|    return c;
  665|      1|}
tidyGetByte:
  879|  42.1M|{
  880|  42.1M|  int bv = source->getByte( source->sourceData );
  881|  42.1M|  return (uint) bv;
  882|  42.1M|}
tidyIsEOF:
  884|  42.2M|{
  885|  42.2M|  return source->eof( source->sourceData );
  886|  42.2M|}
tidyUngetByte:
  888|    294|{
  889|    294|    source->ungetByte( source->sourceData, (byte) ch );
  890|    294|}
prvTidyIsEOF:
  901|  42.2M|{
  902|  42.2M|    return tidyIsEOF( &in->source );
  903|  42.2M|}
prvTidyGetCharEncodingFromOptName:
 1132|     98|{
 1133|     98|    uint i;
 1134|       |
 1135|    392|    for (i = 0; i < sizeof(enc2iana)/sizeof(enc2iana[0]); ++i)
  ------------------
  |  Branch (1135:17): [True: 392, False: 0]
  ------------------
 1136|    392|        if (TY_(tmbstrcasecmp)(charenc, enc2iana[i].tidyOptName) == 0 )
  ------------------
  |  |   23|    392|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    392|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1136:13): [True: 98, False: 294]
  ------------------
 1137|     98|            return enc2iana[i].id;
 1138|       |
 1139|      0|    return -1;
 1140|     98|}
streamio.c:InitLastPos:
  208|     98|{
  209|     98|    in->curlastpos = 0;
  210|     98|    in->firstlastpos = 0;
  211|     98|}
streamio.c:SaveLastPos:
  221|   249M|{
  222|   249M|    PopLastPos( in );
  223|   249M|    in->lastcols[in->curlastpos] = in->curcol;
  224|   249M|}
streamio.c:PopLastPos:
  214|   250M|{
  215|   250M|    in->curlastpos = (in->curlastpos+1)%LASTPOS_SIZE;
  216|   250M|    if ( in->curlastpos == in->firstlastpos )
  ------------------
  |  Branch (216:10): [True: 249M, False: 1.24M]
  ------------------
  217|   249M|        in->firstlastpos = (in->firstlastpos+1)%LASTPOS_SIZE;
  218|   250M|}
streamio.c:PopChar:
  417|  1.23M|{
  418|  1.23M|    uint c = EndOfStream;
  ------------------
  |  | 1064|  1.23M|#define EndOfStream (~0u)
  ------------------
  419|  1.23M|    if ( in->pushed )
  ------------------
  |  Branch (419:10): [True: 1.23M, False: 0]
  ------------------
  420|  1.23M|    {
  421|  1.23M|        assert( in->bufpos > 0 );
  ------------------
  |  Branch (421:9): [True: 0, False: 1.23M]
  |  Branch (421:9): [True: 1.23M, False: 0]
  ------------------
  422|  1.23M|        c = in->charbuf[ --in->bufpos ];
  423|  1.23M|        if ( in->bufpos == 0 )
  ------------------
  |  Branch (423:14): [True: 1.21M, False: 26.2k]
  ------------------
  424|  1.21M|            in->pushed = no;
  425|       |
  426|  1.23M|        if ( c == '\n' )
  ------------------
  |  Branch (426:14): [True: 187, False: 1.23M]
  ------------------
  427|    187|        {
  428|    187|            in->curcol = 1;
  429|    187|            in->curline++;
  430|    187|            PopLastPos( in );
  431|    187|            return c;
  432|    187|        }
  433|  1.23M|        in->curcol++;
  434|  1.23M|        PopLastPos( in );
  435|  1.23M|    }
  436|  1.23M|    return c;
  437|  1.23M|}
streamio.c:RestoreLastPos:
  227|  1.23M|{
  228|  1.23M|    if ( in->firstlastpos == in->curlastpos )
  ------------------
  |  Branch (228:10): [True: 0, False: 1.23M]
  ------------------
  229|      0|        in->curcol = 0;
  230|  1.23M|    else
  231|  1.23M|    {
  232|  1.23M|        in->curcol = in->lastcols[in->curlastpos];
  233|  1.23M|        if ( in->curlastpos == 0 )
  ------------------
  |  Branch (233:14): [True: 19.2k, False: 1.21M]
  ------------------
  234|  19.2k|            in->curlastpos = LASTPOS_SIZE;
  235|  1.23M|        in->curlastpos--;
  236|  1.23M|    }
  237|  1.23M|}
streamio.c:initStreamOut:
  467|    196|{
  468|    196|    StreamOut* out = (StreamOut*) TidyDocAlloc( doc, sizeof(StreamOut) );
  ------------------
  |  |  157|    196|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|    196|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  469|    196|    TidyClearMemory( out, sizeof(StreamOut) );
  ------------------
  |  |   70|    196|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  470|    196|    out->encoding = encoding;
  471|    196|    out->state = FSM_ASCII;
  472|    196|    out->nl = nl;
  473|    196|    return out;
  474|    196|}
streamio.c:ReadByte:
  897|  42.1M|{
  898|  42.1M|    return tidyGetByte( &in->source );
  899|  42.1M|}
streamio.c:UngetByte:
  905|    294|{
  906|    294|    tidyUngetByte( &in->source, byteValue );
  907|    294|}
streamio.c:ReadCharFromStream:
  915|  42.1M|{
  916|  42.1M|    uint c, n;
  917|       |
  918|  42.1M|    if ( TY_(IsEOF)(in) )
  ------------------
  |  |   23|  42.1M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.1M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (918:10): [True: 8.46k, False: 42.1M]
  ------------------
  919|  8.46k|        return EndOfStream;
  ------------------
  |  | 1064|  8.46k|#define EndOfStream (~0u)
  ------------------
  920|       |    
  921|  42.1M|    c = ReadByte( in );
  922|       |
  923|  42.1M|    if (c == EndOfStream)
  ------------------
  |  | 1064|  42.1M|#define EndOfStream (~0u)
  ------------------
  |  Branch (923:9): [True: 0, False: 42.1M]
  ------------------
  924|      0|        return c;
  925|       |
  926|  42.1M|#ifndef NO_NATIVE_ISO2022_SUPPORT
  927|       |    /*
  928|       |       A document in ISO-2022 based encoding uses some ESC sequences
  929|       |       called "designator" to switch character sets. The designators
  930|       |       defined and used in ISO-2022-JP are:
  931|       |
  932|       |        "ESC" + "(" + ?     for ISO646 variants
  933|       |
  934|       |        "ESC" + "$" + ?     and
  935|       |        "ESC" + "$" + "(" + ?   for multibyte character sets
  936|       |
  937|       |       Where ? stands for a single character used to indicate the
  938|       |       character set for multibyte characters.
  939|       |
  940|       |       Tidy handles this by preserving the escape sequence and
  941|       |       setting the top bit of each byte for non-ascii chars. This
  942|       |       bit is then cleared on output. The input stream keeps track
  943|       |       of the state to determine when to set/clear the bit.
  944|       |    */
  945|       |
  946|  42.1M|    if (in->encoding == ISO2022)
  ------------------
  |  |  138|  42.1M|#define ISO2022     5
  ------------------
  |  Branch (946:9): [True: 0, False: 42.1M]
  ------------------
  947|      0|    {
  948|      0|        if (c == 0x1b)  /* ESC */
  ------------------
  |  Branch (948:13): [True: 0, False: 0]
  ------------------
  949|      0|        {
  950|      0|            in->state = FSM_ESC;
  951|      0|            return c;
  952|      0|        }
  953|       |
  954|      0|        switch (in->state)
  ------------------
  |  Branch (954:17): [True: 0, False: 0]
  ------------------
  955|      0|        {
  956|      0|        case FSM_ESC:
  ------------------
  |  Branch (956:9): [True: 0, False: 0]
  ------------------
  957|      0|            if (c == '$')
  ------------------
  |  Branch (957:17): [True: 0, False: 0]
  ------------------
  958|      0|                in->state = FSM_ESCD;
  959|      0|            else if (c == '(')
  ------------------
  |  Branch (959:22): [True: 0, False: 0]
  ------------------
  960|      0|                in->state = FSM_ESCP;
  961|      0|            else
  962|      0|                in->state = FSM_ASCII;
  963|      0|            break;
  964|       |
  965|      0|        case FSM_ESCD:
  ------------------
  |  Branch (965:9): [True: 0, False: 0]
  ------------------
  966|      0|            if (c == '(')
  ------------------
  |  Branch (966:17): [True: 0, False: 0]
  ------------------
  967|      0|                in->state = FSM_ESCDP;
  968|      0|            else
  969|      0|                in->state = FSM_NONASCII;
  970|      0|            break;
  971|       |
  972|      0|        case FSM_ESCDP:
  ------------------
  |  Branch (972:9): [True: 0, False: 0]
  ------------------
  973|      0|            in->state = FSM_NONASCII;
  974|      0|            break;
  975|       |
  976|      0|        case FSM_ESCP:
  ------------------
  |  Branch (976:9): [True: 0, False: 0]
  ------------------
  977|      0|            in->state = FSM_ASCII;
  978|      0|            break;
  979|       |
  980|      0|        case FSM_NONASCII:
  ------------------
  |  Branch (980:9): [True: 0, False: 0]
  ------------------
  981|      0|            c |= 0x80;
  982|      0|            break;
  983|       |
  984|      0|        case FSM_ASCII:
  ------------------
  |  Branch (984:9): [True: 0, False: 0]
  ------------------
  985|      0|            break;
  986|      0|        }
  987|       |
  988|      0|        return c;
  989|      0|    }
  990|  42.1M|#endif /* NO_NATIVE_ISO2022_SUPPORT */
  991|       |
  992|  42.1M|    if ( in->encoding == UTF16LE )
  ------------------
  |  |  142|  42.1M|#define UTF16LE     9
  ------------------
  |  Branch (992:10): [True: 0, False: 42.1M]
  ------------------
  993|      0|    {
  994|      0|        uint c1 = ReadByte( in );
  995|      0|        if ( EndOfStream == c1 )
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
  |  Branch (995:14): [True: 0, False: 0]
  ------------------
  996|      0|            return EndOfStream;
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
  997|      0|        n = (c1 << 8) + c;
  998|      0|        return n;
  999|      0|    }
 1000|       |
 1001|  42.1M|    if ((in->encoding == UTF16) || (in->encoding == UTF16BE)) /* UTF-16 is big-endian by default */
  ------------------
  |  |  144|  42.1M|#define UTF16       11
  ------------------
                  if ((in->encoding == UTF16) || (in->encoding == UTF16BE)) /* UTF-16 is big-endian by default */
  ------------------
  |  |  143|  42.1M|#define UTF16BE     10
  ------------------
  |  Branch (1001:9): [True: 0, False: 42.1M]
  |  Branch (1001:36): [True: 0, False: 42.1M]
  ------------------
 1002|      0|    {
 1003|      0|        uint c1 = ReadByte( in );
 1004|      0|        if ( EndOfStream == c1 )
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
  |  Branch (1004:14): [True: 0, False: 0]
  ------------------
 1005|      0|            return EndOfStream;
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
 1006|      0|        n = (c << 8) + c1;
 1007|      0|        return n;
 1008|      0|    }
 1009|       |
 1010|  42.1M|    if ( in->encoding == UTF8 )
  ------------------
  |  |  137|  42.1M|#define UTF8        4
  ------------------
  |  Branch (1010:10): [True: 42.1M, False: 0]
  ------------------
 1011|  42.1M|    {
 1012|       |        /* deal with UTF-8 encoded char */
 1013|       |
 1014|  42.1M|        int err, count = 0;
 1015|       |        
 1016|       |        /* first byte "c" is passed in separately */
 1017|  42.1M|        err = TY_(DecodeUTF8BytesToChar)( &n, c, NULL, &in->source, &count );
  ------------------
  |  |   23|  42.1M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.1M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1018|  42.1M|        if (!err && (n == (uint)EndOfStream) && (count == 1)) /* EOF */
  ------------------
  |  | 1064|  42.0M|#define EndOfStream (~0u)
  ------------------
  |  Branch (1018:13): [True: 42.0M, False: 168k]
  |  Branch (1018:21): [True: 0, False: 42.0M]
  |  Branch (1018:49): [True: 0, False: 0]
  ------------------
 1019|      0|            return EndOfStream;
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
 1020|  42.1M|        else if (err)
  ------------------
  |  Branch (1020:18): [True: 168k, False: 42.0M]
  ------------------
 1021|   168k|        {
 1022|       |            /* set error position just before offending character */
 1023|   168k|            in->doc->lexer->lines = in->curline;
 1024|   168k|            in->doc->lexer->columns = in->curcol;
 1025|       |
 1026|   168k|            TY_(ReportEncodingError)(in->doc, INVALID_UTF8, n, no);
  ------------------
  |  |   23|   168k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   168k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1027|   168k|            n = 0xFFFD; /* replacement char */
 1028|   168k|        }
 1029|       |        
 1030|  42.1M|        return n;
 1031|  42.1M|    }
 1032|       |    
 1033|       |    /*
 1034|       |       This section is suitable for any "multibyte" variable-width 
 1035|       |       character encoding in which a one-byte code is less than
 1036|       |       128, and the first byte of a two-byte code is greater or
 1037|       |       equal to 128. Note that Big5 and ShiftJIS fit into this
 1038|       |       kind, even though their second byte may be less than 128
 1039|       |    */
 1040|      0|    if ((in->encoding == BIG5) || (in->encoding == SHIFTJIS))
  ------------------
  |  |  145|      0|#define BIG5        12
  ------------------
                  if ((in->encoding == BIG5) || (in->encoding == SHIFTJIS))
  ------------------
  |  |  146|      0|#define SHIFTJIS    13
  ------------------
  |  Branch (1040:9): [True: 0, False: 0]
  |  Branch (1040:35): [True: 0, False: 0]
  ------------------
 1041|      0|    {
 1042|      0|        if (c < 128)
  ------------------
  |  Branch (1042:13): [True: 0, False: 0]
  ------------------
 1043|      0|            return c;
 1044|      0|        else if ((in->encoding == SHIFTJIS) && (c >= 0xa1 && c <= 0xdf)) /* 461643 - fix suggested by Rick Cameron 14 Sep 01 */
  ------------------
  |  |  146|      0|#define SHIFTJIS    13
  ------------------
  |  Branch (1044:18): [True: 0, False: 0]
  |  Branch (1044:49): [True: 0, False: 0]
  |  Branch (1044:62): [True: 0, False: 0]
  ------------------
 1045|      0|        {
 1046|       |            /*
 1047|       |              Rick Cameron pointed out that for Shift_JIS, the values from
 1048|       |              0xa1 through 0xdf represent singe-byte characters
 1049|       |              (U+FF61 to U+FF9F - half-shift Katakana)
 1050|       |            */
 1051|      0|            return c;
 1052|      0|        }
 1053|      0|        else
 1054|      0|        {
 1055|      0|            uint c1 = ReadByte( in );
 1056|      0|            if ( EndOfStream == c1 )
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
  |  Branch (1056:18): [True: 0, False: 0]
  ------------------
 1057|      0|                return EndOfStream;
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
 1058|      0|            n = (c << 8) + c1;
 1059|      0|            return n;
 1060|      0|        }
 1061|      0|    }
 1062|      0|    else
 1063|      0|        n = c;
 1064|       |        
 1065|      0|    return n;
 1066|      0|}

prvTidyFindTag:
  564|  8.39k|{
  565|  8.39k|    const Dict *np = NULL;
  566|       |
  567|  8.39k|    if ( cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  8.39k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  8.39k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 8.39k, False: 0]
  |  |  ------------------
  ------------------
  568|  8.39k|    {
  569|  8.39k|        node->tag = doc->tags.xml_tags;
  570|  8.39k|        return yes;
  571|  8.39k|    }
  572|       |
  573|      0|    if ( node->element && (np = tagsLookup(doc, &doc->tags, node->element)) )
  ------------------
  |  Branch (573:10): [True: 0, False: 0]
  |  Branch (573:27): [True: 0, False: 0]
  ------------------
  574|      0|    {
  575|      0|        node->tag = np;
  576|      0|        return yes;
  577|      0|    }
  578|       |    
  579|       |    /* Add autonomous custom tag. This can be done in both HTML5 mode and
  580|       |       earlier, although if it's earlier we will complain about it elsewhere. */
  581|      0|    if ( TY_(nodeIsAutonomousCustomTag)( doc, node) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (581:10): [True: 0, False: 0]
  ------------------
  582|      0|    {
  583|      0|        const TidyOptionImpl* opt = TY_(getOption)( TidyCustomTags );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  584|       |
  585|      0|        TY_(DeclareUserTag)( doc, opt, node->element );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  586|      0|        node->tag = tagsLookup(doc, &doc->tags, node->element);
  587|       |
  588|       |        /* Output a message the first time we encounter an autonomous custom 
  589|       |           tag. This applies despite the HTML5 mode. */
  590|      0|        TY_(Report)(doc, node, node, CUSTOM_TAG_DETECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  591|       |
  592|      0|        return yes;
  593|      0|    }
  594|       |    
  595|      0|    return no;
  596|      0|}
prvTidyLookupTagDef:
  599|    392|{
  600|    392|    const Dict *np;
  601|       |
  602|  9.11k|    for (np = tag_defs + 1; np < tag_defs + N_TIDY_TAGS; ++np )
  ------------------
  |  Branch (602:29): [True: 9.11k, False: 0]
  ------------------
  603|  9.11k|        if (np->id == tid)
  ------------------
  |  Branch (603:13): [True: 392, False: 8.72k]
  ------------------
  604|    392|            return np;
  605|       |
  606|      0|    return NULL;
  607|    392|}
prvTidyFindParser:
  610|  11.1k|{
  611|  11.1k|    const Dict* np = tagsLookup( doc, &doc->tags, node->element );
  612|  11.1k|    if ( np )
  ------------------
  |  Branch (612:10): [True: 421, False: 10.6k]
  ------------------
  613|    421|        return np->parser;
  614|  10.6k|    return NULL;
  615|  11.1k|}
prvTidyInitTags:
  697|     98|{
  698|     98|    Dict* xml;
  699|     98|    TidyTagImpl* tags = &doc->tags;
  700|       |
  701|     98|    TidyClearMemory( tags, sizeof(TidyTagImpl) );
  ------------------
  |  |   70|     98|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  702|       |
  703|       |    /* create dummy entry for all xml tags */
  704|     98|    xml =  NewDict( doc, NULL );
  705|     98|    xml->versions = VERS_XML;
  ------------------
  |  |  197|     98|#define VERS_XML           65536u
  ------------------
  706|     98|    xml->model = CM_BLOCK;
  ------------------
  |  |  142|     98|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  707|     98|    xml->parser = 0;
  708|     98|    xml->chkattrs = 0;
  709|       |    xml->attrvers = NULL;
  710|     98|    tags->xml_tags = xml;
  711|     98|}
prvTidyFreeDeclaredTags:
  717|    294|{
  718|    294|    TidyTagImpl* tags = &doc->tags;
  719|    294|    Dict *curr, *next = NULL, *prev = NULL;
  720|       |
  721|    294|    for ( curr=tags->declared_tag_list; curr; curr = next )
  ------------------
  |  Branch (721:41): [True: 0, False: 294]
  ------------------
  722|      0|    {
  723|      0|        Bool deleteIt = yes;
  724|      0|        next = curr->next;
  725|      0|        switch ( tagType )
  ------------------
  |  Branch (725:18): [True: 0, False: 0]
  ------------------
  726|      0|        {
  727|      0|        case tagtype_empty:
  ------------------
  |  Branch (727:9): [True: 0, False: 0]
  ------------------
  728|      0|            deleteIt = ( curr->model & CM_EMPTY ) != 0;
  ------------------
  |  |  139|      0|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  729|      0|            break;
  730|       |
  731|      0|        case tagtype_inline:
  ------------------
  |  Branch (731:9): [True: 0, False: 0]
  ------------------
  732|      0|            deleteIt = ( curr->model & CM_INLINE ) != 0;
  ------------------
  |  |  143|      0|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  733|      0|            break;
  734|       |
  735|      0|        case tagtype_block:
  ------------------
  |  Branch (735:9): [True: 0, False: 0]
  ------------------
  736|      0|            deleteIt = ( (curr->model & CM_BLOCK) != 0 &&
  ------------------
  |  |  142|      0|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (736:26): [True: 0, False: 0]
  ------------------
  737|      0|                         curr->parser == TY_(ParseBlock) );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (737:26): [True: 0, False: 0]
  ------------------
  738|      0|            break;
  739|       |
  740|      0|        case tagtype_pre:
  ------------------
  |  Branch (740:9): [True: 0, False: 0]
  ------------------
  741|      0|            deleteIt = ( (curr->model & CM_BLOCK) != 0 &&
  ------------------
  |  |  142|      0|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (741:26): [True: 0, False: 0]
  ------------------
  742|      0|                         curr->parser == TY_(ParsePre) );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (742:26): [True: 0, False: 0]
  ------------------
  743|      0|            break;
  744|       |
  745|      0|        case tagtype_null:
  ------------------
  |  Branch (745:9): [True: 0, False: 0]
  ------------------
  746|      0|            break;
  747|      0|        }
  748|       |
  749|      0|        if ( deleteIt )
  ------------------
  |  Branch (749:14): [True: 0, False: 0]
  ------------------
  750|      0|        {
  751|      0|          tagsRemoveFromHash( doc, &doc->tags, curr->name );
  752|      0|          FreeDict( doc, curr );
  753|      0|          if ( prev )
  ------------------
  |  Branch (753:16): [True: 0, False: 0]
  ------------------
  754|      0|            prev->next = next;
  755|      0|          else
  756|      0|            tags->declared_tag_list = next;
  757|      0|        }
  758|      0|        else
  759|      0|          prev = curr;
  760|      0|    }
  761|    294|}
prvTidyResetTags:
  833|     98|{
  834|     98|    Dict *np = (Dict *)TY_(LookupTagDef)( TidyTag_A );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  835|     98|    TidyTagImpl* tags = &doc->tags;
  836|     98|    if (np) 
  ------------------
  |  Branch (836:9): [True: 98, False: 0]
  ------------------
  837|     98|    {
  838|     98|        np->parser = TY_(ParseBlock);
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  839|     98|        np->model  = (CM_INLINE|CM_BLOCK|CM_MIXED);
  ------------------
  |  |  143|     98|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                      np->model  = (CM_INLINE|CM_BLOCK|CM_MIXED);
  ------------------
  |  |  142|     98|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                      np->model  = (CM_INLINE|CM_BLOCK|CM_MIXED);
  ------------------
  |  |  156|     98|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  840|     98|    }
  841|     98|    np = (Dict *)TY_(LookupTagDef)( TidyTag_CAPTION );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  842|     98|    if (np)
  ------------------
  |  Branch (842:9): [True: 98, False: 0]
  ------------------
  843|     98|    {
  844|     98|        np->parser = TY_(ParseBlock);
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  845|     98|    }
  846|       |
  847|     98|    np = (Dict *)TY_(LookupTagDef)( TidyTag_OBJECT );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  848|     98|    if (np)
  ------------------
  |  Branch (848:9): [True: 98, False: 0]
  ------------------
  849|     98|    {
  850|     98|        np->model = (CM_OBJECT|CM_IMG|CM_INLINE|CM_PARAM); /* reset */
  ------------------
  |  |  150|     98|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
                      np->model = (CM_OBJECT|CM_IMG|CM_INLINE|CM_PARAM); /* reset */
  ------------------
  |  |  155|     98|#define CM_IMG          (1 << 16)  /**< Elements that use "align" attribute for vertical position. */
  ------------------
                      np->model = (CM_OBJECT|CM_IMG|CM_INLINE|CM_PARAM); /* reset */
  ------------------
  |  |  143|     98|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                      np->model = (CM_OBJECT|CM_IMG|CM_INLINE|CM_PARAM); /* reset */
  ------------------
  |  |  151|     98|#define CM_PARAM        (1 << 12)  /**< Elements that allows "PARAM". */
  ------------------
  851|     98|    }
  852|       |    /*\
  853|       |     * Issue #461
  854|       |     * TidyTag_BUTTON reset to inline in HTML5
  855|       |    \*/
  856|     98|    np = (Dict *)TY_(LookupTagDef)(TidyTag_BUTTON);
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  857|     98|    if (np)
  ------------------
  |  Branch (857:9): [True: 98, False: 0]
  ------------------
  858|     98|    {
  859|     98|        np->parser = TY_(ParseInline);
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  860|     98|    }
  861|       |
  862|     98|    tagsEmptyHash( doc, tags ); /* not sure this is really required, but to be sure */
  863|     98|    doc->HTML5Mode = yes;   /* set HTML5 mode */
  864|     98|}
prvTidyFreeTags:
  867|     98|{
  868|     98|    TidyTagImpl* tags = &doc->tags;
  869|       |
  870|     98|    tagsEmptyHash( doc, tags );
  871|     98|    TY_(FreeDeclaredTags)( doc, tagtype_null );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  872|     98|    FreeDict( doc, tags->xml_tags );
  873|       |
  874|       |    /* get rid of dangling tag references */
  875|     98|    TidyClearMemory( tags, sizeof(TidyTagImpl) );
  ------------------
  |  |   70|     98|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  876|       |
  877|     98|}
prvTidynodeIsText:
 1031|   117k|{
 1032|   117k|  return ( node && node->type == TextNode );
  ------------------
  |  Branch (1032:12): [True: 116k, False: 108]
  |  Branch (1032:20): [True: 67.6k, False: 49.2k]
  ------------------
 1033|   117k|}
prvTidynodeIsElement:
 1052|  66.6k|{
 1053|  66.6k|  return ( node &&
  ------------------
  |  Branch (1053:12): [True: 66.6k, False: 0]
  ------------------
 1054|  66.6k|           (node->type == StartTag || node->type == StartEndTag) );
  ------------------
  |  Branch (1054:13): [True: 66.2k, False: 377]
  |  Branch (1054:39): [True: 0, False: 377]
  ------------------
 1055|  66.6k|}
prvTidynodeHasCM:
 1092|  38.2k|{
 1093|  38.2k|  return ( node && node->tag &&
  ------------------
  |  Branch (1093:12): [True: 38.2k, False: 0]
  |  Branch (1093:20): [True: 38.2k, False: 0]
  ------------------
 1094|  38.2k|           (node->tag->model & contentModel) != 0 );
  ------------------
  |  Branch (1094:12): [True: 0, False: 38.2k]
  ------------------
 1095|  38.2k|}
prvTidynodeCMIsInline:
 1102|  5.83k|{
 1103|  5.83k|  return TY_(nodeHasCM)( node, CM_INLINE );
  ------------------
  |  |   23|  5.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                return TY_(nodeHasCM)( node, CM_INLINE );
  ------------------
  |  |  143|  5.83k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
 1104|  5.83k|}
prvTidynodeCMIsEmpty:
 1106|  14.1k|{
 1107|  14.1k|  return TY_(nodeHasCM)( node, CM_EMPTY );
  ------------------
  |  |   23|  14.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                return TY_(nodeHasCM)( node, CM_EMPTY );
  ------------------
  |  |  139|  14.1k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
 1108|  14.1k|}
tags.c:tagsLookup:
  408|  11.1k|{
  409|  11.1k|    const Dict *np;
  410|  11.1k|    const DictHash* p;
  411|       |
  412|  11.1k|    if (!s)
  ------------------
  |  Branch (412:9): [True: 0, False: 11.1k]
  ------------------
  413|      0|        return NULL;
  414|       |
  415|       |    /* this breaks if declared elements get changed between two   */
  416|       |    /* parser runs since Tidy would use the cached version rather */
  417|       |    /* than the new one.                                          */
  418|       |    /* However, as FreeDeclaredTags() correctly cleans the hash   */
  419|       |    /* this should not be true anymore.                           */
  420|  11.1k|    for (p = tags->hashtab[tagsHash(s)]; p && p->tag; p = p->next)
  ------------------
  |  Branch (420:42): [True: 374, False: 10.7k]
  |  Branch (420:47): [True: 374, False: 0]
  ------------------
  421|    374|        if (TY_(tmbstrcmp)(s, p->tag->name) == 0)
  ------------------
  |  |   23|    374|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    374|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (421:13): [True: 374, False: 0]
  ------------------
  422|    374|            return p->tag;
  423|       |
  424|  1.63M|    for (np = tag_defs + 1; np < tag_defs + N_TIDY_TAGS; ++np)
  ------------------
  |  Branch (424:29): [True: 1.62M, False: 10.6k]
  ------------------
  425|  1.62M|        if (TY_(tmbstrcmp)(s, np->name) == 0)
  ------------------
  |  |   23|  1.62M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.62M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (425:13): [True: 47, False: 1.62M]
  ------------------
  426|     47|            return tagsInstall(doc, tags, np);
  427|       |
  428|  10.6k|    for (np = tags->declared_tag_list; np; np = np->next)
  ------------------
  |  Branch (428:40): [True: 0, False: 10.6k]
  ------------------
  429|      0|        if (TY_(tmbstrcmp)(s, np->name) == 0)
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (429:13): [True: 0, False: 0]
  ------------------
  430|      0|            return tagsInstall(doc, tags, np);
  431|       |
  432|  10.6k|    return NULL;
  433|  10.6k|}
tags.c:tagsHash:
  339|  11.1k|{
  340|  11.1k|    uint hashval;
  341|       |
  342|  35.8k|    for (hashval = 0; *s != '\0'; s++)
  ------------------
  |  Branch (342:23): [True: 24.6k, False: 11.1k]
  ------------------
  343|  24.6k|        hashval = *s + 31*hashval;
  344|       |
  345|  11.1k|    return hashval % ELEMENT_HASH_SIZE;
  346|  11.1k|}
tags.c:tagsInstall:
  349|     47|{
  350|     47|    DictHash *np;
  351|     47|    uint hashval;
  352|       |
  353|     47|    if (old)
  ------------------
  |  Branch (353:9): [True: 47, False: 0]
  ------------------
  354|     47|    {
  355|     47|        np = (DictHash *)TidyDocAlloc(doc, sizeof(*np));
  ------------------
  |  |  157|     47|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|     47|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  356|     47|        np->tag = old;
  357|       |
  358|     47|        hashval = tagsHash(old->name);
  359|     47|        np->next = tags->hashtab[hashval];
  360|     47|        tags->hashtab[hashval] = np;
  361|     47|    }
  362|       |
  363|     47|    return old;
  364|     47|}
tags.c:NewDict:
  436|     98|{
  437|     98|    Dict *np = (Dict*) TidyDocAlloc( doc, sizeof(Dict) );
  ------------------
  |  |  157|     98|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|     98|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  438|     98|    np->id = TidyTag_UNKNOWN;
  439|     98|    np->name = name ? TY_(tmbstrdup)( doc->allocator, name ) : NULL;
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (439:16): [True: 0, False: 98]
  ------------------
  440|     98|    np->versions = VERS_UNKNOWN;
  ------------------
  |  |  204|     98|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|     98|#define xxxx                   0u
  |  |  ------------------
  ------------------
  441|     98|    np->attrvers = NULL;
  442|     98|    np->model = CM_UNKNOWN;
  ------------------
  |  |  138|     98|#define CM_UNKNOWN      0
  ------------------
  443|     98|    np->parser = 0;
  444|     98|    np->chkattrs = 0;
  445|       |    np->next = NULL;
  446|     98|    return np;
  447|     98|}
tags.c:FreeDict:
  450|     98|{
  451|     98|    if ( d )
  ------------------
  |  Branch (451:10): [True: 98, False: 0]
  ------------------
  452|     98|        TidyDocFree( doc, d->name );
  ------------------
  |  |  159|     98|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  453|     98|    TidyDocFree( doc, d );
  ------------------
  |  |  159|     98|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  454|     98|}
tags.c:tagsEmptyHash:
  387|    196|{
  388|    196|    uint i;
  389|    196|    DictHash *prev, *next;
  390|       |
  391|  35.0k|    for (i = 0; i < ELEMENT_HASH_SIZE; ++i)
  ------------------
  |  Branch (391:17): [True: 34.8k, False: 196]
  ------------------
  392|  34.8k|    {
  393|  34.8k|        prev = NULL;
  394|  34.8k|        next = tags->hashtab[i];
  395|       |
  396|  34.9k|        while(next)
  ------------------
  |  Branch (396:15): [True: 47, False: 34.8k]
  ------------------
  397|     47|        {
  398|     47|            prev = next->next;
  399|     47|            TidyDocFree(doc, next);
  ------------------
  |  |  159|     47|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     47|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  400|     47|            next = prev;
  401|     47|        }
  402|       |
  403|       |        tags->hashtab[i] = NULL;
  404|  34.8k|    }
  405|    196|}

tidyCreate:
   87|     98|{
   88|     98|  TidyDocImpl* impl = tidyDocCreate( &TY_(g_default_allocator) );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   89|     98|  return tidyImplToDoc( impl );
  ------------------
  |  |  141|     98|#define tidyImplToDoc( doc )            ((TidyDoc)(doc))
  ------------------
   90|     98|}
tidyRelease:
   99|     98|{
  100|     98|  TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|     98|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  101|     98|  tidyDocRelease( impl );
  102|     98|}
tidySetCharEncoding:
  272|     98|{
  273|     98|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|     98|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  274|     98|    if ( impl )
  ------------------
  |  Branch (274:10): [True: 98, False: 0]
  ------------------
  275|     98|    {
  276|     98|        int enc = TY_(CharEncodingId)( impl, encnam );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  277|     98|        if ( enc >= 0 && TY_(AdjustCharEncoding)(impl, enc) )
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (277:14): [True: 98, False: 0]
  |  Branch (277:26): [True: 98, False: 0]
  ------------------
  278|     98|            return 0;
  279|       |
  280|      0|        TY_(ReportBadArgument)( impl, "char-encoding" );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  281|      0|    }
  282|      0|    return -EINVAL;
  283|     98|}
tidyOptSetInt:
  501|     98|{
  502|     98|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|     98|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  503|     98|    if ( impl )
  ------------------
  |  Branch (503:10): [True: 98, False: 0]
  ------------------
  504|     98|    {
  505|       |        /* Special case for TidyDoctype, because it has a picklist */
  506|     98|        if ( optId == TidyDoctype )
  ------------------
  |  Branch (506:14): [True: 0, False: 98]
  ------------------
  507|      0|            return TY_(SetOptionInt)( impl, TidyDoctypeMode, val );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  508|     98|        else
  509|     98|            return TY_(SetOptionInt)( impl, optId, val );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  510|     98|    }
  511|      0|    return no;
  512|     98|}
tidyOptSetBool:
  530|    686|{
  531|    686|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|    686|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  532|    686|    if ( impl )
  ------------------
  |  Branch (532:10): [True: 686, False: 0]
  ------------------
  533|    686|        return TY_(SetOptionBool)( impl, optId, val );
  ------------------
  |  |   23|    686|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    686|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  534|      0|    return no;
  535|    686|}
tidySetErrorBuffer:
  974|     98|{
  975|     98|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|     98|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  976|     98|    if ( impl )
  ------------------
  |  Branch (976:10): [True: 98, False: 0]
  ------------------
  977|     98|    {
  978|     98|        uint outenc = cfg( impl, TidyOutCharEncoding );
  ------------------
  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  979|     98|        uint nl = cfg( impl, TidyNewline );
  ------------------
  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  980|     98|        TY_(ReleaseStreamOut)( impl, impl->errout );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  981|     98|        impl->errout = TY_(BufferOutput)( impl, errbuf, outenc, nl );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  982|     98|        return ( impl->errout ? 0 : -ENOMEM );
  ------------------
  |  Branch (982:18): [True: 98, False: 0]
  ------------------
  983|     98|    }
  984|      0|    return -EINVAL;
  985|     98|}
tidyParseString:
 1115|     98|{
 1116|     98|    TidyDocImpl* doc = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|     98|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1117|     98|    return tidyDocParseString( doc, content );
 1118|     98|}
tidySaveBuffer:
 1255|     98|{
 1256|     98|    TidyDocImpl* doc = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|     98|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1257|     98|    return tidyDocSaveBuffer( doc, outbuf );
 1258|     98|}
tidyCleanAndRepair:
 1419|     98|{
 1420|     98|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|     98|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1421|     98|    if ( impl )
  ------------------
  |  Branch (1421:10): [True: 98, False: 0]
  ------------------
 1422|     98|      return tidyDocCleanAndRepair( impl );
 1423|      0|    return -EINVAL;
 1424|     98|}
tidyRunDiagnostics:
 1427|     98|{
 1428|     98|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|     98|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1429|     98|    if ( impl )
  ------------------
  |  Branch (1429:10): [True: 98, False: 0]
  ------------------
 1430|     98|      return tidyDocRunDiagnostics( impl );
 1431|      0|    return -EINVAL;
 1432|     98|}
prvTidyDocParseStream:
 1456|     98|{
 1457|     98|    Bool xmlIn = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1458|     98|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 1459|       |    
 1460|     98|    int bomEnc;
 1461|     98|    doc->pConfigChangeCallback = NULL;
 1462|       |
 1463|     98|    assert( doc != NULL && in != NULL );
  ------------------
  |  Branch (1463:5): [True: 0, False: 98]
  |  Branch (1463:5): [True: 0, False: 0]
  |  Branch (1463:5): [True: 98, False: 0]
  |  Branch (1463:5): [True: 98, False: 0]
  ------------------
 1464|     98|    assert( doc->docIn == NULL );
  ------------------
  |  Branch (1464:5): [True: 0, False: 98]
  |  Branch (1464:5): [True: 98, False: 0]
  ------------------
 1465|     98|    doc->docIn = in;
 1466|       |
 1467|     98|    TY_(ResetTags)(doc);             /* Reset table to html5 mode */
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1468|     98|    TY_(TakeConfigSnapshot)( doc );  /* Save config state */
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1469|     98|    TY_(AdjustConfig)( doc );        /* Ensure config internal consistency */
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1470|     98|    TY_(FreeAnchors)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1471|       |
 1472|     98|    TY_(FreeNode)(doc, &doc->root);
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1473|     98|    TidyClearMemory(&doc->root, sizeof(Node));
  ------------------
  |  |   70|     98|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1474|       |
 1475|     98|    if (doc->givenDoctype)
  ------------------
  |  Branch (1475:9): [True: 0, False: 98]
  ------------------
 1476|     98|        TidyDocFree(doc, doc->givenDoctype);
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1477|       |    /*\ 
 1478|       |     *  Issue #186 - Now FreeNode depend on the doctype, so the lexer is needed
 1479|       |     *  to determine which hash is to be used, so free it last.
 1480|       |    \*/
 1481|     98|    TY_(FreeLexer)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1482|     98|    doc->givenDoctype = NULL;
 1483|       |
 1484|     98|    doc->lexer = TY_(NewLexer)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1485|       |    /* doc->lexer->root = &doc->root; */
 1486|     98|    doc->root.line = doc->lexer->lines;
 1487|     98|    doc->root.column = doc->lexer->columns;
 1488|     98|    doc->inputHadBOM = no;
 1489|     98|    doc->xmlDetected = no;
 1490|       |
 1491|     98|    bomEnc = TY_(ReadBOMEncoding)(in);
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1492|       |
 1493|     98|    if (bomEnc != -1)
  ------------------
  |  Branch (1493:9): [True: 0, False: 98]
  ------------------
 1494|      0|    {
 1495|      0|        in->encoding = bomEnc;
 1496|      0|        TY_(SetOptionInt)(doc, TidyInCharEncoding, bomEnc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1497|      0|    }
 1498|       |
 1499|       |    /* Tidy doesn't alter the doctype for generic XML docs */
 1500|     98|    if ( xmlIn )
  ------------------
  |  Branch (1500:10): [True: 98, False: 0]
  ------------------
 1501|     98|    {
 1502|     98|        TY_(ParseXMLDocument)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1503|     98|        if ( !TY_(CheckNodeIntegrity)( &doc->root ) )
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1503:14): [True: 0, False: 98]
  ------------------
 1504|      0|            TidyPanic( doc->allocator, integrity );
  ------------------
  |  |   69|      0|#define TidyPanic(allocator, msg) ((allocator)->vtbl->panic((allocator), (msg)))
  ------------------
 1505|     98|    }
 1506|      0|    else
 1507|      0|    {
 1508|      0|        doc->warnings = 0;
 1509|      0|        TY_(ParseDocument)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1510|      0|        if ( !TY_(CheckNodeIntegrity)( &doc->root ) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1510:14): [True: 0, False: 0]
  ------------------
 1511|      0|            TidyPanic( doc->allocator, integrity );
  ------------------
  |  |   69|      0|#define TidyPanic(allocator, msg) ((allocator)->vtbl->panic((allocator), (msg)))
  ------------------
 1512|      0|    }
 1513|       |
 1514|     98|    doc->docIn = NULL;
 1515|     98|    doc->pConfigChangeCallback = callback;
 1516|       |
 1517|     98|    return tidyDocStatus( doc );
 1518|     98|}
tidyLocalizedStringN:
 2686|   462k|{
 2687|   462k|    return TY_(tidyLocalizedStringN)( messageType, quantity);
  ------------------
  |  |   23|   462k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   462k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2688|   462k|}
tidyLocalizedString:
 2691|  1.32M|{
 2692|  1.32M|    return TY_(tidyLocalizedString)( messageType );
  ------------------
  |  |   23|  1.32M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.32M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2693|  1.32M|}
tidyDefaultStringN:
 2696|   462k|{
 2697|   462k|    return TY_(tidyDefaultStringN)( messageType, quantity);
  ------------------
  |  |   23|   462k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   462k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2698|   462k|}
tidyDefaultString:
 2701|  1.38M|{
 2702|  1.38M|    return TY_(tidyDefaultString)( messageType );
  ------------------
  |  |   23|  1.38M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.38M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2703|  1.38M|}
tidylib.c:tidyDocCreate:
  105|     98|{
  106|     98|    TidyDocImpl* doc = (TidyDocImpl*)TidyAlloc( allocator, sizeof(TidyDocImpl) );
  ------------------
  |  |   66|     98|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  107|     98|    TidyClearMemory( doc, sizeof(*doc) );
  ------------------
  |  |   70|     98|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  108|     98|    doc->allocator = allocator;
  109|       |
  110|     98|    TY_(InitMap)();
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  111|     98|    TY_(InitTags)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  112|     98|    TY_(InitAttrs)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  113|     98|    TY_(InitConfig)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  114|     98|    TY_(InitPrintBuf)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  115|     98|    TY_(InitParserStack)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  116|       |
  117|       |    /* Set the locale for tidy's output. This both configures
  118|       |    ** LibTidy to use the environment's locale as well as the
  119|       |    ** standard library.
  120|       |    */
  121|     98|#if SUPPORT_LOCALIZATIONS
  122|     98|    if ( TY_(tidyGetLanguageSetByUser)() == no )
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (122:10): [True: 98, False: 0]
  ------------------
  123|     98|    {
  124|     98|        if( ! TY_(tidySetLanguage)( getenv( "LC_MESSAGES" ) ) )
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (124:13): [True: 98, False: 0]
  ------------------
  125|     98|        {
  126|     98|            if( ! TY_(tidySetLanguage)( getenv( "LANG" ) ) )
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (126:17): [True: 98, False: 0]
  ------------------
  127|     98|            {
  128|       |                /*\
  129|       |                *  Is. #770 #783 #780 #790 and maybe others -
  130|       |                *  TY_(tidySetLanguage)( setlocale( LC_ALL, "" ) );
  131|       |                *  this seems a 'bad' choice!
  132|       |               \*/
  133|     98|            }
  134|     98|        }
  135|     98|    }
  136|     98|#endif
  137|       |
  138|       |    /* By default, wire tidy messages to standard error.
  139|       |    ** Document input will be set by parsing routines.
  140|       |    ** Document output will be set by pretty print routines.
  141|       |    ** Config input will be set by config parsing routines.
  142|       |    ** But we need to start off with a way to report errors.
  143|       |    */
  144|     98|    doc->errout = TY_(StdErrOutput)();
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  145|     98|    return doc;
  146|     98|}
tidylib.c:tidyDocRelease:
  149|     98|{
  150|       |    /* doc in/out opened and closed by parse/print routines */
  151|     98|    if ( doc )
  ------------------
  |  Branch (151:10): [True: 98, False: 0]
  ------------------
  152|     98|    {
  153|     98|        assert( doc->docIn == NULL );
  ------------------
  |  Branch (153:9): [True: 0, False: 98]
  |  Branch (153:9): [True: 98, False: 0]
  ------------------
  154|     98|        assert( doc->docOut == NULL );
  ------------------
  |  Branch (154:9): [True: 0, False: 98]
  |  Branch (154:9): [True: 98, False: 0]
  ------------------
  155|       |
  156|     98|        TY_(ReleaseStreamOut)( doc, doc->errout );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  157|     98|        doc->errout = NULL;
  158|       |
  159|     98|        TY_(FreePrintBuf)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  160|     98|        TY_(FreeNode)(doc, &doc->root);
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  161|     98|        TidyClearMemory(&doc->root, sizeof(Node));
  ------------------
  |  |   70|     98|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  162|       |
  163|     98|        if (doc->givenDoctype)
  ------------------
  |  Branch (163:13): [True: 0, False: 98]
  ------------------
  164|     98|            TidyDocFree(doc, doc->givenDoctype);
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  165|       |
  166|     98|        TY_(FreeConfig)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  167|     98|        TY_(FreeAttrTable)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  168|     98|        TY_(FreeAttrPriorityList)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  169|     98|        TY_(FreeMutedMessageList( doc ));
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  170|     98|        TY_(FreeTags)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  171|       |        /*\ 
  172|       |         *  Issue #186 - Now FreeNode depend on the doctype, so the lexer is needed
  173|       |         *  to determine which hash is to be used, so free it last.
  174|       |        \*/
  175|     98|        TY_(FreeLexer)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  176|     98|        TY_(FreeParserStack)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  177|     98|        TidyDocFree( doc, doc );
  ------------------
  |  |  159|     98|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  178|     98|    }
  179|     98|}
tidylib.c:tidyDocParseString:
 1210|     98|{
 1211|     98|    int status = -EINVAL;
 1212|     98|    TidyBuffer inbuf;
 1213|     98|    StreamIn* in = NULL;
 1214|       |
 1215|     98|    if ( content )
  ------------------
  |  Branch (1215:10): [True: 98, False: 0]
  ------------------
 1216|     98|    {
 1217|     98|        tidyBufInitWithAllocator( &inbuf, doc->allocator );
 1218|     98|        tidyBufAttach( &inbuf, (byte*)content, TY_(tmbstrlen)(content)+1 );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1219|     98|        in = TY_(BufferInput)( doc, &inbuf, cfg( doc, TidyInCharEncoding ));
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      in = TY_(BufferInput)( doc, &inbuf, cfg( doc, TidyInCharEncoding ));
  ------------------
  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1220|     98|        status = TY_(DocParseStream)( doc, in );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1221|     98|        tidyBufDetach( &inbuf );
 1222|     98|        TY_(freeStreamIn)(in);
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1223|     98|    }
 1224|     98|    return status;
 1225|     98|}
tidylib.c:tidyDocSaveStream:
 2270|     98|{
 2271|     98|    Bool showMarkup  = cfgBool( doc, TidyShowMarkup );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2272|     98|    Bool forceOutput = cfgBool( doc, TidyForceOutput );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2273|     98|    Bool outputBOM   = ( cfgAutoBool(doc, TidyOutputBOM) == TidyYesState );
  ------------------
  |  |  421|     98|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2274|     98|    Bool smartBOM    = ( cfgAutoBool(doc, TidyOutputBOM) == TidyAutoState );
  ------------------
  |  |  421|     98|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2275|     98|    Bool xmlOut      = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2276|     98|    Bool xhtmlOut    = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2277|     98|    TidyTriState bodyOnly    = cfgAutoBool( doc, TidyBodyOnly );
  ------------------
  |  |  421|     98|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2278|       |
 2279|     98|    Bool dropComments = cfgBool(doc, TidyHideComments);
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2280|     98|    Bool makeClean    = cfgBool(doc, TidyMakeClean);
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2281|     98|    Bool asciiChars   = cfgBool(doc, TidyAsciiChars);
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2282|     98|    Bool makeBare     = cfgBool(doc, TidyMakeBare);
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2283|     98|    Bool escapeCDATA  = cfgBool(doc, TidyEscapeCdata);
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2284|     98|    TidyAttrSortStrategy sortAttrStrat = cfg(doc, TidySortAttributes);
  ------------------
  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 2285|     98|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 2286|     98|    doc->pConfigChangeCallback = NULL;
 2287|       |
 2288|       |    
 2289|     98|    if (escapeCDATA)
  ------------------
  |  Branch (2289:9): [True: 0, False: 98]
  ------------------
 2290|      0|        TY_(ConvertCDATANodes)(doc, &doc->root);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2291|       |
 2292|     98|    if (dropComments)
  ------------------
  |  Branch (2292:9): [True: 0, False: 98]
  ------------------
 2293|      0|        TY_(DropComments)(doc, &doc->root);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2294|       |
 2295|     98|    if (makeClean)
  ------------------
  |  Branch (2295:9): [True: 0, False: 98]
  ------------------
 2296|      0|    {
 2297|       |        /* noop */
 2298|      0|        TY_(DropFontElements)(doc, &doc->root, NULL);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2299|      0|    }
 2300|       |
 2301|     98|    if ((makeClean && asciiChars) || makeBare)
  ------------------
  |  Branch (2301:10): [True: 0, False: 98]
  |  Branch (2301:23): [True: 0, False: 0]
  |  Branch (2301:38): [True: 0, False: 98]
  ------------------
 2302|      0|        TY_(DowngradeTypography)(doc, &doc->root);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2303|       |
 2304|     98|    if (makeBare)
  ------------------
  |  Branch (2304:9): [True: 0, False: 98]
  ------------------
 2305|       |        /* Note: no longer replaces &nbsp; in */
 2306|       |        /* attribute values / non-text tokens */
 2307|      0|        TY_(NormalizeSpaces)(doc->lexer, &doc->root);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2308|     98|    else
 2309|     98|        TY_(ReplacePreformattedSpaces)(doc, &doc->root);
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2310|       |
 2311|     98|    TY_(SortAttributes)(doc, &doc->root, sortAttrStrat);
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2312|       |
 2313|     98|    if ( showMarkup && (doc->errors == 0 || forceOutput) )
  ------------------
  |  Branch (2313:10): [True: 98, False: 0]
  |  Branch (2313:25): [True: 89, False: 9]
  |  Branch (2313:45): [True: 0, False: 9]
  ------------------
 2314|     89|    {
 2315|       |        /* Output a Byte Order Mark if required */
 2316|     89|        if ( outputBOM || (doc->inputHadBOM && smartBOM) )
  ------------------
  |  Branch (2316:14): [True: 0, False: 89]
  |  Branch (2316:28): [True: 0, False: 89]
  |  Branch (2316:48): [True: 0, False: 0]
  ------------------
 2317|      0|            TY_(outBOM)( out );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2318|       |
 2319|       |        /* No longer necessary. No DOCTYPE == HTML 3.2,
 2320|       |        ** which gives you only the basic character entities,
 2321|       |        ** which are safe in any browser.
 2322|       |        ** if ( !TY_(FindDocType)(doc) )
 2323|       |        **    TY_(SetOptionBool)( doc, TidyNumEntities, yes );
 2324|       |        */
 2325|       |
 2326|     89|        doc->docOut = out;
 2327|     89|        if ( xmlOut && !xhtmlOut )
  ------------------
  |  Branch (2327:14): [True: 89, False: 0]
  |  Branch (2327:24): [True: 89, False: 0]
  ------------------
 2328|     89|            TY_(PPrintXMLTree)( doc, NORMAL, 0, &doc->root );
  ------------------
  |  |   23|     89|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     89|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2329|      0|        else if ( showBodyOnly( doc, bodyOnly ) )
  ------------------
  |  Branch (2329:19): [True: 0, False: 0]
  ------------------
 2330|      0|            TY_(PrintBody)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2331|      0|        else
 2332|      0|            TY_(PPrintTree)( doc, NORMAL, 0, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2333|       |
 2334|     89|        TY_(PFlushLine)( doc, 0 );
  ------------------
  |  |   23|     89|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     89|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2335|     89|        doc->docOut = NULL;
 2336|     89|    }
 2337|       |
 2338|       |    /* @jsd: removing this should solve #673, and allow saving of the buffer multiple times. */
 2339|       |//    TY_(ResetConfigToSnapshot)( doc );
 2340|     98|    doc->pConfigChangeCallback = callback;
 2341|       |    
 2342|     98|    return tidyDocStatus( doc );
 2343|     98|}
tidylib.c:tidyDocSaveBuffer:
 1383|     98|{
 1384|     98|    int status = -EINVAL;
 1385|     98|    if ( outbuf )
  ------------------
  |  Branch (1385:10): [True: 98, False: 0]
  ------------------
 1386|     98|    {
 1387|     98|        uint outenc = cfg( doc, TidyOutCharEncoding );
  ------------------
  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1388|     98|        uint nl = cfg( doc, TidyNewline );
  ------------------
  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1389|     98|        StreamOut* out = TY_(BufferOutput)( doc, outbuf, outenc, nl );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1390|       |
 1391|     98|        status = tidyDocSaveStream( doc, out );
 1392|     98|        TidyDocFree( doc, out );
  ------------------
  |  |  159|     98|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     98|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1393|     98|    }
 1394|     98|    return status;
 1395|     98|}
tidylib.c:tidyDocStatus:
 1408|    392|{
 1409|    392|    if ( doc->errors > 0 )
  ------------------
  |  Branch (1409:10): [True: 36, False: 356]
  ------------------
 1410|     36|        return 2;
 1411|    356|    if ( doc->warnings > 0 || doc->accessErrors > 0 )
  ------------------
  |  Branch (1411:10): [True: 300, False: 56]
  |  Branch (1411:31): [True: 0, False: 56]
  ------------------
 1412|    300|        return 1;
 1413|     56|    return 0;
 1414|    356|}
tidylib.c:tidyDocRunDiagnostics:
 1521|     98|{
 1522|     98|    TY_(ReportMarkupVersion)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1523|     98|    TY_(ReportNumWarnings)( doc );
  ------------------
  |  |   23|     98|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     98|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1524|       |
 1525|     98|    if ( doc->errors > 0 && !cfgBool( doc, TidyForceOutput ) )
  ------------------
  |  |  418|      9|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      9|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1525:10): [True: 9, False: 89]
  |  Branch (1525:29): [True: 9, False: 0]
  ------------------
 1526|      9|        TY_(Dialogue)(doc, STRING_NEEDS_INTERVENTION );
  ------------------
  |  |   23|      9|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      9|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1527|       |
 1528|     98|     return tidyDocStatus( doc );
 1529|     98|}
tidylib.c:tidyDocCleanAndRepair:
 2100|     98|{
 2101|     98|    Bool word2K   = cfgBool( doc, TidyWord2000 );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2102|     98|    Bool logical  = cfgBool( doc, TidyLogicalEmphasis );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2103|     98|    Bool clean    = cfgBool( doc, TidyMakeClean );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2104|     98|    Bool gdoc     = cfgBool( doc, TidyGDocClean );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2105|     98|    Bool htmlOut  = cfgBool( doc, TidyHtmlOut );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2106|     98|    Bool xmlOut   = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2107|     98|    Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2108|     98|    Bool xmlDecl  = cfgBool( doc, TidyXmlDecl );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2109|     98|    Bool tidyMark = cfgBool( doc, TidyMark );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2110|     98|    Bool tidyXmlTags = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2111|     98|    Bool wantNameAttr = cfgBool( doc, TidyAnchorAsName );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2112|     98|    Bool mergeEmphasis = cfgBool( doc, TidyMergeEmphasis );
  ------------------
  |  |  418|     98|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|     98|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2113|     98|    Node* node;
 2114|     98|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 2115|     98|    doc->pConfigChangeCallback = NULL;
 2116|       |
 2117|       |#if defined(ENABLE_DEBUG_LOG)
 2118|       |    SPRTF("All nodes BEFORE clean and repair\n");
 2119|       |    dbg_show_all_nodes( doc, &doc->root, 0  );
 2120|       |#endif
 2121|     98|    if (tidyXmlTags)
  ------------------
  |  Branch (2121:9): [True: 98, False: 0]
  ------------------
 2122|     98|    {
 2123|     98|        doc->pConfigChangeCallback = callback;
 2124|     98|        return tidyDocStatus( doc );
 2125|     98|    }
 2126|       |
 2127|       |    /* Issue #567 - move style elements from body to head */
 2128|      0|    TY_(CleanStyle)(doc, &doc->root);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2129|       |
 2130|       |    /* simplifies <b><b> ... </b> ...</b> etc. */
 2131|      0|    if ( mergeEmphasis )
  ------------------
  |  Branch (2131:10): [True: 0, False: 0]
  ------------------
 2132|      0|        TY_(NestedEmphasis)( doc, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2133|       |
 2134|       |    /* cleans up <dir>indented text</dir> etc. */
 2135|      0|    TY_(List2BQ)( doc, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2136|      0|    TY_(BQ2Div)( doc, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2137|       |
 2138|       |    /* replaces i by em and b by strong */
 2139|      0|    if ( logical )
  ------------------
  |  Branch (2139:10): [True: 0, False: 0]
  ------------------
 2140|      0|        TY_(EmFromI)( doc, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2141|       |
 2142|      0|    if ( word2K && TY_(IsWord2000)(doc) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2142:10): [True: 0, False: 0]
  |  Branch (2142:20): [True: 0, False: 0]
  ------------------
 2143|      0|    {
 2144|       |        /* prune Word2000's <![if ...]> ... <![endif]> */
 2145|      0|        TY_(DropSections)( doc, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2146|       |
 2147|       |        /* drop style & class attributes and empty p, span elements */
 2148|      0|        TY_(CleanWord2000)( doc, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2149|      0|        TY_(DropEmptyElements)(doc, &doc->root);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2150|      0|    }
 2151|       |
 2152|       |    /* replaces presentational markup by style rules */
 2153|      0|    if ( clean )
  ------------------
  |  Branch (2153:10): [True: 0, False: 0]
  ------------------
 2154|      0|        TY_(CleanDocument)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2155|       |
 2156|       |    /* clean up html exported by Google Docs */
 2157|      0|    if ( gdoc )
  ------------------
  |  Branch (2157:10): [True: 0, False: 0]
  ------------------
 2158|      0|        TY_(CleanGoogleDocument)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2159|       |
 2160|       |    /*  Reconcile http-equiv meta element with output encoding  */
 2161|      0|    TY_(TidyMetaCharset)(doc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2162|       |
 2163|      0|    if ( !TY_(CheckNodeIntegrity)( &doc->root ) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2163:10): [True: 0, False: 0]
  ------------------
 2164|      0|        TidyPanic( doc->allocator, integrity );
  ------------------
  |  |   69|      0|#define TidyPanic(allocator, msg) ((allocator)->vtbl->panic((allocator), (msg)))
  ------------------
 2165|       |
 2166|       |    /* remember given doctype for reporting */
 2167|      0|    node = TY_(FindDocType)(doc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2168|       |
 2169|      0|    if (node)
  ------------------
  |  Branch (2169:9): [True: 0, False: 0]
  ------------------
 2170|      0|    {
 2171|      0|        AttVal* fpi = TY_(GetAttrByName)(node, "PUBLIC");
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2172|      0|        if (AttrHasValue(fpi))
  ------------------
  |  |  171|      0|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 0, False: 0]
  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2173|      0|        {
 2174|      0|            if (doc->givenDoctype)
  ------------------
  |  Branch (2174:17): [True: 0, False: 0]
  ------------------
 2175|      0|                TidyDocFree(doc, doc->givenDoctype);
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2176|      0|            doc->givenDoctype = TY_(tmbstrdup)(doc->allocator,fpi->value);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2177|      0|        }
 2178|      0|    }
 2179|       |
 2180|      0|    if ( doc->root.content )
  ------------------
  |  Branch (2180:10): [True: 0, False: 0]
  ------------------
 2181|      0|    {
 2182|       |        /* If we had XHTML input but want HTML output */
 2183|      0|        if ( htmlOut && doc->lexer->isvoyager )
  ------------------
  |  Branch (2183:14): [True: 0, False: 0]
  |  Branch (2183:25): [True: 0, False: 0]
  ------------------
 2184|      0|        {
 2185|      0|            Node* node = TY_(FindDocType)(doc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2186|       |            /* Remove reference, but do not free */
 2187|      0|            if (node)
  ------------------
  |  Branch (2187:17): [True: 0, False: 0]
  ------------------
 2188|      0|              TY_(RemoveNode)(node);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2189|      0|        }
 2190|       |
 2191|      0|        if (xhtmlOut && !htmlOut)
  ------------------
  |  Branch (2191:13): [True: 0, False: 0]
  |  Branch (2191:25): [True: 0, False: 0]
  ------------------
 2192|      0|        {
 2193|      0|            TY_(SetXHTMLDocType)(doc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2194|      0|            TY_(FixAnchors)(doc, &doc->root, wantNameAttr, yes);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2195|      0|            TY_(FixXhtmlNamespace)(doc, yes);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2196|      0|            TY_(FixLanguageInformation)(doc, &doc->root, yes, yes);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2197|      0|        }
 2198|      0|        else
 2199|      0|        {
 2200|      0|            TY_(FixDocType)(doc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2201|      0|            TY_(FixAnchors)(doc, &doc->root, wantNameAttr, yes);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2202|      0|            TY_(FixXhtmlNamespace)(doc, no);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2203|      0|            TY_(FixLanguageInformation)(doc, &doc->root, no, yes);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2204|      0|        }
 2205|       |
 2206|      0|        if (tidyMark )
  ------------------
  |  Branch (2206:13): [True: 0, False: 0]
  ------------------
 2207|      0|            TY_(AddGenerator)(doc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2208|       |
 2209|      0|    }
 2210|       |
 2211|       |    /* ensure presence of initial <?xml version="1.0"?> */
 2212|      0|    if ( xmlOut && xmlDecl )
  ------------------
  |  Branch (2212:10): [True: 0, False: 0]
  |  Branch (2212:20): [True: 0, False: 0]
  ------------------
 2213|      0|        TY_(FixXmlDecl)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2214|       |
 2215|       |    /* At this point the apparent doctype is going to be as stable as
 2216|       |       it can ever be, so we can start detecting things that shouldn't
 2217|       |       be in this version of HTML
 2218|       |     */
 2219|      0|    if (doc->lexer) 
  ------------------
  |  Branch (2219:9): [True: 0, False: 0]
  ------------------
 2220|      0|    {
 2221|       |        /*\ 
 2222|       |         *  Issue #429 #426 - These services can only be used
 2223|       |         *  when there is a document loaded, ie a lexer created.
 2224|       |         *  But really should not be calling a Clean and Repair
 2225|       |         *  service with no doc!
 2226|       |        \*/
 2227|      0|        if (doc->lexer->versionEmitted & VERS_HTML5)
  ------------------
  |  |  213|      0|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|      0|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|      0|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (2227:13): [True: 0, False: 0]
  ------------------
 2228|      0|            TY_(CheckHTML5)( doc, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2229|      0|        TY_(CheckHTMLTagsAttribsVersions)( doc, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2230|       |
 2231|      0|        if ( !doc->lexer->isvoyager && doc->xmlDetected )
  ------------------
  |  Branch (2231:14): [True: 0, False: 0]
  |  Branch (2231:40): [True: 0, False: 0]
  ------------------
 2232|      0|        {
 2233|      0|            TY_(Report)(doc, NULL, TY_(FindXmlDecl)(doc), XML_DECLARATION_DETECTED );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(Report)(doc, NULL, TY_(FindXmlDecl)(doc), XML_DECLARATION_DETECTED );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2234|       |
 2235|      0|        }
 2236|      0|    }
 2237|       |
 2238|      0|    TY_(CleanHead)(doc); /* Is #692 - discard multiple <title> tags */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2239|       |
 2240|       |#if defined(ENABLE_DEBUG_LOG)
 2241|       |    SPRTF("All nodes AFTER clean and repair\n");
 2242|       |    dbg_show_all_nodes( doc, &doc->root, 0  );
 2243|       |#endif
 2244|       |
 2245|      0|    doc->pConfigChangeCallback = callback;
 2246|      0|    return tidyDocStatus( doc );
 2247|     98|}

prvTidytmbstrdup:
   14|     40|{
   15|     40|    tmbstr s = NULL;
   16|     40|    if ( str )
  ------------------
  |  Branch (16:10): [True: 40, False: 0]
  ------------------
   17|     40|    {
   18|     40|        uint len = TY_(tmbstrlen)( str );
  ------------------
  |  |   23|     40|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     40|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   19|     40|        tmbstr cp = s = (tmbstr) TidyAlloc( allocator, 1+len );
  ------------------
  |  |   66|     40|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
   20|  1.40k|        while ( 0 != (*cp++ = *str++) )
  ------------------
  |  Branch (20:17): [True: 1.36k, False: 40]
  ------------------
   21|  1.36k|            /**/;
   22|     40|    }
   23|     40|    return s;
   24|     40|}
prvTidytmbstrndup:
   28|  90.2k|{
   29|  90.2k|    tmbstr s = NULL;
   30|  90.2k|    if ( str && len > 0 )
  ------------------
  |  Branch (30:10): [True: 90.2k, False: 0]
  |  Branch (30:17): [True: 90.2k, False: 38]
  ------------------
   31|  90.2k|    {
   32|  90.2k|        tmbstr cp = s = (tmbstr) TidyAlloc( allocator, 1+len );
  ------------------
  |  |   66|  90.2k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
   33|  6.23M|        while ( len-- > 0 &&  (*cp++ = *str++) )
  ------------------
  |  Branch (33:17): [True: 6.14M, False: 90.2k]
  |  Branch (33:31): [True: 6.14M, False: 0]
  ------------------
   34|  6.14M|          /**/;
   35|  90.2k|        *cp = 0;
   36|  90.2k|    }
   37|  90.2k|    return s;
   38|  90.2k|}
prvTidytmbstrcmp:
   78|  53.9M|{
   79|  53.9M|    int c;
   80|  60.3M|    while ((c = *s1) == *s2)
  ------------------
  |  Branch (80:12): [True: 6.39M, False: 53.9M]
  ------------------
   81|  6.39M|    {
   82|  6.39M|        if (c == '\0')
  ------------------
  |  Branch (82:13): [True: 1.19k, False: 6.38M]
  ------------------
   83|  1.19k|            return 0;
   84|       |
   85|  6.38M|        ++s1;
   86|  6.38M|        ++s2;
   87|  6.38M|    }
   88|       |
   89|  53.9M|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (89:13): [True: 29.4M, False: 24.5M]
  ------------------
   90|  53.9M|}
prvTidytmbstrlen:
   94|  1.73M|{
   95|  1.73M|    uint len = 0;
   96|  1.73M|    if ( str ) 
  ------------------
  |  Branch (96:10): [True: 1.73M, False: 0]
  ------------------
   97|  1.73M|    {
   98|  69.9M|        while ( *str++ )
  ------------------
  |  Branch (98:17): [True: 68.2M, False: 1.73M]
  ------------------
   99|  68.2M|            ++len;
  100|  1.73M|    }
  101|  1.73M|    return len;
  102|  1.73M|}
prvTidytmbstrcasecmp:
  112|  8.49M|{
  113|  8.49M|    uint c;
  114|       |
  115|  9.11M|    while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  9.11M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.11M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  9.11M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.11M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (115:12): [True: 652k, False: 8.46M]
  ------------------
  116|   652k|    {
  117|   652k|        if (c == '\0')
  ------------------
  |  Branch (117:13): [True: 30.8k, False: 621k]
  ------------------
  118|  30.8k|            return 0;
  119|       |
  120|   621k|        ++s1;
  121|   621k|        ++s2;
  122|   621k|    }
  123|       |
  124|  8.46M|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (124:13): [True: 2.67M, False: 5.78M]
  ------------------
  125|  8.49M|}
prvTidytmbstrncmp:
  128|    888|{
  129|    888|    uint c;
  130|       |
  131|    888|	if (s1 == NULL || s2 == NULL)
  ------------------
  |  Branch (131:6): [True: 0, False: 888]
  |  Branch (131:20): [True: 0, False: 888]
  ------------------
  132|      0|    {
  133|      0|        if (s1 == s2)
  ------------------
  |  Branch (133:13): [True: 0, False: 0]
  ------------------
  134|      0|            return 0;
  135|      0|        return (s1 == NULL ? -1 : 1);
  ------------------
  |  Branch (135:17): [True: 0, False: 0]
  ------------------
  136|      0|    }
  137|       |
  138|  1.28k|    while ((c = (byte)*s1) == (byte)*s2)
  ------------------
  |  Branch (138:12): [True: 398, False: 888]
  ------------------
  139|    398|    {
  140|    398|        if (c == '\0')
  ------------------
  |  Branch (140:13): [True: 0, False: 398]
  ------------------
  141|      0|            return 0;
  142|       |
  143|    398|        if (n == 0)
  ------------------
  |  Branch (143:13): [True: 0, False: 398]
  ------------------
  144|      0|            return 0;
  145|       |
  146|    398|        ++s1;
  147|    398|        ++s2;
  148|    398|        --n;
  149|    398|    }
  150|       |
  151|    888|    if (n == 0)
  ------------------
  |  Branch (151:9): [True: 132, False: 756]
  ------------------
  152|    132|        return 0;
  153|       |
  154|    756|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (154:13): [True: 135, False: 621]
  ------------------
  155|    888|}
prvTidytmbvsnprintf:
  227|  1.61M|{
  228|  1.61M|    int retval;
  229|       |
  230|  1.61M|#if HAS_VSNPRINTF
  231|  1.61M|    retval = vsnprintf(buffer, count - 1, format, args);
  232|       |    /* todo: conditionally null-terminate the string? */
  233|  1.61M|    buffer[count - 1] = 0;
  234|       |#else
  235|       |    retval = vsprintf(buffer, format, args);
  236|       |#endif /* HAS_VSNPRINTF */
  237|  1.61M|    return retval;
  238|  1.61M|}
prvTidytmbsnprintf:
  241|  1.15M|{
  242|  1.15M|    int retval;
  243|  1.15M|    va_list args;
  244|  1.15M|    va_start(args, format);
  245|  1.15M|    retval = TY_(tmbvsnprintf)(buffer, count, format, args);
  ------------------
  |  |   23|  1.15M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.15M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  246|       |    va_end(args);
  247|  1.15M|    return retval;
  248|  1.15M|}
prvTidystrrep:
  251|  1.84M|{
  252|  1.84M|    char *p = strstr(buffer, str);
  253|  1.84M|    do
  254|  1.84M|    {
  255|  1.84M|        if(p)
  ------------------
  |  Branch (255:12): [True: 544, False: 1.84M]
  ------------------
  256|    544|        {
  257|    544|            char buf[1024];
  258|    544|            memset(buf,'\0',strlen(buf));
  259|       |
  260|    544|            if(buffer == p)
  ------------------
  |  Branch (260:16): [True: 0, False: 544]
  ------------------
  261|      0|            {
  262|      0|                strcpy(buf,rep);
  263|      0|                strcat(buf,p+strlen(str));
  264|      0|            }
  265|    544|            else
  266|    544|            {
  267|    544|                strncpy(buf,buffer,strlen(buffer) - strlen(p));
  268|    544|                strcat(buf,rep);
  269|    544|                strcat(buf,p+strlen(str));
  270|    544|            }
  271|       |
  272|    544|            memset(buffer,'\0',strlen(buffer));
  273|    544|            strcpy(buffer,buf);
  274|    544|        }
  275|       |
  276|  1.84M|    } while(p && (p = strstr(buffer, str)));
  ------------------
  |  Branch (276:13): [True: 544, False: 1.84M]
  |  Branch (276:18): [True: 0, False: 544]
  ------------------
  277|  1.84M|}

prvTidyDecodeUTF8BytesToChar:
  166|  42.2M|{
  167|  42.2M|    byte tempbuf[10];
  168|  42.2M|    byte *buf = &tempbuf[0];
  169|  42.2M|    uint ch = 0, n = 0;
  170|  42.2M|    int i, bytes = 0;
  171|  42.2M|    Bool hasError = no;
  172|       |    
  173|  42.2M|    if ( successorBytes )
  ------------------
  |  Branch (173:10): [True: 41.6k, False: 42.1M]
  ------------------
  174|  41.6k|        buf = (byte*) successorBytes;
  175|       |        
  176|       |    /* special check if we have been passed an EOF char */
  177|  42.2M|    if ( firstByte == EndOfStream )
  ------------------
  |  | 1064|  42.2M|#define EndOfStream (~0u)
  ------------------
  |  Branch (177:10): [True: 0, False: 42.2M]
  ------------------
  178|      0|    {
  179|       |        /* at present */
  180|      0|        *c = firstByte;
  181|      0|        *count = 1;
  182|      0|        return 0;
  183|      0|    }
  184|       |
  185|  42.2M|    ch = firstByte; /* first byte is passed in separately */
  186|       |    
  187|  42.2M|    if (ch <= 0x7F) /* 0XXX XXXX one byte */
  ------------------
  |  Branch (187:9): [True: 41.9M, False: 244k]
  ------------------
  188|  41.9M|    {
  189|  41.9M|        n = ch;
  190|  41.9M|        bytes = 1;
  191|  41.9M|    }
  192|   244k|    else if ((ch & 0xE0) == 0xC0)  /* 110X XXXX  two bytes */
  ------------------
  |  Branch (192:14): [True: 18.9k, False: 225k]
  ------------------
  193|  18.9k|    {
  194|  18.9k|        n = ch & 31;
  195|  18.9k|        bytes = 2;
  196|  18.9k|    }
  197|   225k|    else if ((ch & 0xF0) == 0xE0)  /* 1110 XXXX  three bytes */
  ------------------
  |  Branch (197:14): [True: 61.2k, False: 164k]
  ------------------
  198|  61.2k|    {
  199|  61.2k|        n = ch & 15;
  200|  61.2k|        bytes = 3;
  201|  61.2k|    }
  202|   164k|    else if ((ch & 0xF8) == 0xF0)  /* 1111 0XXX  four bytes */
  ------------------
  |  Branch (202:14): [True: 27.3k, False: 136k]
  ------------------
  203|  27.3k|    {
  204|  27.3k|        n = ch & 7;
  205|  27.3k|        bytes = 4;
  206|  27.3k|    }
  207|   136k|    else if ((ch & 0xFC) == 0xF8)  /* 1111 10XX  five bytes */
  ------------------
  |  Branch (207:14): [True: 609, False: 136k]
  ------------------
  208|    609|    {
  209|    609|        n = ch & 3;
  210|    609|        bytes = 5;
  211|    609|        hasError = yes;
  212|    609|    }
  213|   136k|    else if ((ch & 0xFE) == 0xFC)  /* 1111 110X  six bytes */
  ------------------
  |  Branch (213:14): [True: 7, False: 136k]
  ------------------
  214|      7|    {
  215|      7|        n = ch & 1;
  216|      7|        bytes = 6;
  217|      7|        hasError = yes;
  218|      7|    }
  219|   136k|    else
  220|   136k|    {
  221|       |        /* not a valid first byte of a UTF-8 sequence */
  222|   136k|        n = ch;
  223|   136k|        bytes = 1;
  224|   136k|        hasError = yes;
  225|   136k|    }
  226|       |
  227|       |    /* successor bytes should have the form 10XX XXXX */
  228|       |
  229|       |    /* If caller supplied buffer, use it.  Else see if caller
  230|       |    ** supplied an input source, use that.
  231|       |    */
  232|  42.2M|    if ( successorBytes )
  ------------------
  |  Branch (232:10): [True: 41.6k, False: 42.1M]
  ------------------
  233|  41.6k|    {
  234|   120k|        for ( i=0; i < bytes-1; ++i )
  ------------------
  |  Branch (234:20): [True: 79.1k, False: 41.3k]
  ------------------
  235|  79.1k|        {
  236|  79.1k|            if ( !buf[i] || (buf[i] & 0xC0) != 0x80 )
  ------------------
  |  Branch (236:18): [True: 40, False: 79.1k]
  |  Branch (236:29): [True: 201, False: 78.9k]
  ------------------
  237|    241|            {
  238|    241|                hasError = yes;
  239|    241|                bytes = i+1;
  240|    241|                break;
  241|    241|            }
  242|  78.9k|            n = (n << 6) | (buf[i] & 0x3F);
  243|  78.9k|        }
  244|  41.6k|    }
  245|  42.1M|    else if ( inp )
  ------------------
  |  Branch (245:15): [True: 42.1M, False: 0]
  ------------------
  246|  42.1M|    {
  247|  42.2M|        for ( i=0; i < bytes-1 && !inp->eof(inp->sourceData); ++i )
  ------------------
  |  Branch (247:20): [True: 126k, False: 42.1M]
  |  Branch (247:35): [True: 126k, False: 0]
  ------------------
  248|   126k|        {
  249|   126k|            int b = inp->getByte( inp->sourceData );
  250|   126k|            buf[i] = (tmbchar) b;
  251|       |
  252|       |            /* End of data or illegal successor byte value */
  253|   126k|            if ( b == EOF || (buf[i] & 0xC0) != 0x80 )
  ------------------
  |  Branch (253:18): [True: 0, False: 126k]
  |  Branch (253:30): [True: 33.0k, False: 93.1k]
  ------------------
  254|  33.0k|            {
  255|  33.0k|                hasError = yes;
  256|  33.0k|                bytes = i+1;
  257|  33.0k|                if ( b != EOF )
  ------------------
  |  Branch (257:22): [True: 33.0k, False: 0]
  ------------------
  258|  33.0k|                    inp->ungetByte( inp->sourceData, buf[i] );
  259|  33.0k|                break;
  260|  33.0k|            }
  261|  93.1k|            n = (n << 6) | (buf[i] & 0x3F);
  262|  93.1k|        }
  263|  42.1M|    }
  264|      0|    else if ( bytes > 1 )
  ------------------
  |  Branch (264:15): [True: 0, False: 0]
  ------------------
  265|      0|    {
  266|      0|        hasError = yes;
  267|      0|        bytes = 1;
  268|      0|    }
  269|       |    
  270|  42.2M|    if (!hasError && ((n == kUTF8ByteSwapNotAChar) || (n == kUTF8NotAChar)))
  ------------------
  |  |  121|  42.0M|#define kUTF8ByteSwapNotAChar    0xFFFE
  ------------------
                  if (!hasError && ((n == kUTF8ByteSwapNotAChar) || (n == kUTF8NotAChar)))
  ------------------
  |  |  122|  42.0M|#define kUTF8NotAChar            0xFFFF
  ------------------
  |  Branch (270:9): [True: 42.0M, False: 169k]
  |  Branch (270:23): [True: 0, False: 42.0M]
  |  Branch (270:55): [True: 97, False: 42.0M]
  ------------------
  271|     97|        hasError = yes;
  272|       |        
  273|  42.2M|    if (!hasError && (n > kMaxUTF8FromUCS4))
  ------------------
  |  |  124|  42.0M|#define kMaxUTF8FromUCS4         0x10FFFF
  ------------------
  |  Branch (273:9): [True: 42.0M, False: 169k]
  |  Branch (273:22): [True: 6, False: 42.0M]
  ------------------
  274|      6|        hasError = yes;
  275|       |
  276|  42.2M|    if (!hasError)
  ------------------
  |  Branch (276:9): [True: 42.0M, False: 169k]
  ------------------
  277|  42.0M|    {
  278|  42.0M|        int lo, hi;
  279|       |        
  280|  42.0M|        lo = offsetUTF8Sequences[bytes - 1];
  281|  42.0M|        hi = offsetUTF8Sequences[bytes] - 1;
  282|       |        
  283|       |        /* check for overlong sequences */
  284|  42.0M|        if ((n < validUTF8[lo].lowChar) || (n > validUTF8[hi].highChar))
  ------------------
  |  Branch (284:13): [True: 1.50k, False: 42.0M]
  |  Branch (284:44): [True: 0, False: 42.0M]
  ------------------
  285|  1.50k|            hasError = yes;
  286|  42.0M|        else
  287|  42.0M|        {
  288|  42.0M|            hasError = yes; /* assume error until proven otherwise */
  289|       |        
  290|  84.2M|            for (i = lo; i <= hi; i++)
  ------------------
  |  Branch (290:26): [True: 42.1M, False: 42.0M]
  ------------------
  291|  42.1M|            {
  292|  42.1M|                int tempCount;
  293|  42.1M|                byte theByte;
  294|       |                
  295|  84.4M|                for (tempCount = 0; tempCount < bytes; tempCount++)
  ------------------
  |  Branch (295:37): [True: 42.3M, False: 42.0M]
  ------------------
  296|  42.3M|                {
  297|  42.3M|                    if (!tempCount)
  ------------------
  |  Branch (297:25): [True: 42.1M, False: 245k]
  ------------------
  298|  42.1M|                        theByte = (tmbchar) firstByte;
  299|   245k|                    else
  300|   245k|                        theByte = buf[tempCount - 1];
  301|       |                        
  302|  42.3M|                    if ( theByte >= validUTF8[i].validBytes[(tempCount * 2)] &&
  ------------------
  |  Branch (302:26): [True: 42.3M, False: 30.1k]
  ------------------
  303|  42.3M|                         theByte <= validUTF8[i].validBytes[(tempCount * 2) + 1] )
  ------------------
  |  Branch (303:26): [True: 42.2M, False: 81.4k]
  ------------------
  304|  42.2M|                        hasError = no;
  305|  42.3M|                    if (hasError)
  ------------------
  |  Branch (305:25): [True: 61.3k, False: 42.3M]
  ------------------
  306|  61.3k|                        break;
  307|  42.3M|                }
  308|  42.1M|            }
  309|  42.0M|        }
  310|  42.0M|    }
  311|       |
  312|       |#if 1 && defined(_DEBUG)
  313|       |    if ( hasError )
  314|       |    {
  315|       |       /* debug */
  316|       |       fprintf( stderr, "UTF-8 decoding error of %d bytes : ", bytes );
  317|       |       fprintf( stderr, "0x%02x ", firstByte );
  318|       |       for (i = 1; i < bytes; i++)
  319|       |           fprintf( stderr, "0x%02x ", buf[i - 1] );
  320|       |       fprintf( stderr, " = U+%04X\n", n );
  321|       |    }
  322|       |#endif
  323|       |
  324|  42.2M|    *count = bytes;
  325|  42.2M|    *c = n;
  326|  42.2M|    if ( hasError )
  ------------------
  |  Branch (326:10): [True: 171k, False: 42.0M]
  ------------------
  327|   171k|        return -1;
  328|  42.0M|    return 0;
  329|  42.2M|}
prvTidyEncodeCharToUTF8Bytes:
  333|   479M|{
  334|   479M|    byte tempbuf[10] = {0};
  335|   479M|    byte* buf = &tempbuf[0];
  336|   479M|    int bytes = 0;
  337|   479M|    Bool hasError = no;
  338|       |    
  339|   479M|    if ( encodebuf )
  ------------------
  |  Branch (339:10): [True: 249M, False: 229M]
  ------------------
  340|   249M|        buf = (byte*) encodebuf;
  341|       |        
  342|   479M|    if (c <= 0x7F)  /* 0XXX XXXX one byte */
  ------------------
  |  Branch (342:9): [True: 478M, False: 231k]
  ------------------
  343|   478M|    {
  344|   478M|        buf[0] = (tmbchar) c;
  345|   478M|        bytes = 1;
  346|   478M|    }
  347|   231k|    else if (c <= 0x7FF)  /* 110X XXXX  two bytes */
  ------------------
  |  Branch (347:14): [True: 2.02k, False: 229k]
  ------------------
  348|  2.02k|    {
  349|  2.02k|        buf[0] = (tmbchar) ( 0xC0 | (c >> 6) );
  350|  2.02k|        buf[1] = (tmbchar) ( 0x80 | (c & 0x3F) );
  351|  2.02k|        bytes = 2;
  352|  2.02k|    }
  353|   229k|    else if (c <= 0xFFFF)  /* 1110 XXXX  three bytes */
  ------------------
  |  Branch (353:14): [True: 209k, False: 20.1k]
  ------------------
  354|   209k|    {
  355|   209k|        buf[0] = (tmbchar) (0xE0 | (c >> 12));
  356|   209k|        buf[1] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  357|   209k|        buf[2] = (tmbchar) (0x80 | (c & 0x3F));
  358|   209k|        bytes = 3;
  359|   209k|        if ( c == kUTF8ByteSwapNotAChar || c == kUTF8NotAChar )
  ------------------
  |  |  121|   419k|#define kUTF8ByteSwapNotAChar    0xFFFE
  ------------------
                      if ( c == kUTF8ByteSwapNotAChar || c == kUTF8NotAChar )
  ------------------
  |  |  122|   209k|#define kUTF8NotAChar            0xFFFF
  ------------------
  |  Branch (359:14): [True: 0, False: 209k]
  |  Branch (359:44): [True: 0, False: 209k]
  ------------------
  360|      0|            hasError = yes;
  361|   209k|    }
  362|  20.1k|    else if (c <= 0x1FFFFF)  /* 1111 0XXX  four bytes */
  ------------------
  |  Branch (362:14): [True: 20.1k, False: 15]
  ------------------
  363|  20.1k|    {
  364|  20.1k|        buf[0] = (tmbchar) (0xF0 | (c >> 18));
  365|  20.1k|        buf[1] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  366|  20.1k|        buf[2] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  367|  20.1k|        buf[3] = (tmbchar) (0x80 | (c & 0x3F));
  368|  20.1k|        bytes = 4;
  369|  20.1k|        if (c > kMaxUTF8FromUCS4)
  ------------------
  |  |  124|  20.1k|#define kMaxUTF8FromUCS4         0x10FFFF
  ------------------
  |  Branch (369:13): [True: 0, False: 20.1k]
  ------------------
  370|      0|            hasError = yes;
  371|  20.1k|    }
  372|     15|    else if (c <= 0x3FFFFFF)  /* 1111 10XX  five bytes */
  ------------------
  |  Branch (372:14): [True: 0, False: 15]
  ------------------
  373|      0|    {
  374|      0|        buf[0] = (tmbchar) (0xF8 | (c >> 24));
  375|      0|        buf[1] = (tmbchar) (0x80 | (c >> 18));
  376|      0|        buf[2] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  377|      0|        buf[3] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  378|      0|        buf[4] = (tmbchar) (0x80 | (c & 0x3F));
  379|      0|        bytes = 5;
  380|      0|        hasError = yes;
  381|      0|    }
  382|     15|    else if (c <= 0x7FFFFFFF)  /* 1111 110X  six bytes */
  ------------------
  |  Branch (382:14): [True: 0, False: 15]
  ------------------
  383|      0|    {
  384|      0|        buf[0] = (tmbchar) (0xFC | (c >> 30));
  385|      0|        buf[1] = (tmbchar) (0x80 | ((c >> 24) & 0x3F));
  386|      0|        buf[2] = (tmbchar) (0x80 | ((c >> 18) & 0x3F));
  387|      0|        buf[3] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  388|      0|        buf[4] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  389|      0|        buf[5] = (tmbchar) (0x80 | (c & 0x3F));
  390|      0|        bytes = 6;
  391|      0|        hasError = yes;
  392|      0|    }
  393|     15|    else
  394|     15|        hasError = yes;
  395|       |        
  396|       |    /* don't output invalid UTF-8 byte sequence to a stream */
  397|   479M|    if ( !hasError && outp != NULL )
  ------------------
  |  Branch (397:10): [True: 479M, False: 15]
  |  Branch (397:23): [True: 229M, False: 249M]
  ------------------
  398|   229M|    {
  399|   229M|        int ix;
  400|   459M|        for ( ix=0; ix < bytes; ++ix )
  ------------------
  |  Branch (400:21): [True: 229M, False: 229M]
  ------------------
  401|   229M|          outp->putByte( outp->sinkData, buf[ix] );
  402|   229M|    }
  403|       |
  404|       |#if 1 && defined(_DEBUG)
  405|       |    if ( hasError )
  406|       |    {
  407|       |        int i;
  408|       |        fprintf( stderr, "UTF-8 encoding error for U+%x : ", c );
  409|       |        for (i = 0; i < bytes; i++)
  410|       |            fprintf( stderr, "0x%02x ", buf[i] );
  411|       |        fprintf( stderr, "\n" );
  412|       |    }
  413|       |#endif
  414|       |    
  415|   479M|    *count = bytes;
  416|   479M|    if (hasError)
  ------------------
  |  Branch (416:9): [True: 15, False: 479M]
  ------------------
  417|     15|        return -1;
  418|   479M|    return 0;
  419|   479M|}
prvTidyGetUTF8:
  426|  41.6k|{
  427|  41.6k|    uint n;
  428|  41.6k|    int bytes;
  429|       |
  430|  41.6k|    int err;
  431|       |    
  432|  41.6k|    bytes = 0;
  433|       |    
  434|       |    /* first byte "str[0]" is passed in separately from the */
  435|       |    /* rest of the UTF-8 byte sequence starting at "str[1]" */
  436|  41.6k|    err = TY_(DecodeUTF8BytesToChar)( &n, str[0], str+1, NULL, &bytes );
  ------------------
  |  |   23|  41.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  437|  41.6k|    if (err)
  ------------------
  |  Branch (437:9): [True: 2.53k, False: 39.0k]
  ------------------
  438|  2.53k|    {
  439|       |#if 1 && defined(_DEBUG)
  440|       |        fprintf(stderr, "pprint UTF-8 decoding error for U+%x : ", n);
  441|       |#endif
  442|  2.53k|        n = 0xFFFD; /* replacement char */
  443|  2.53k|    }
  444|       |
  445|  41.6k|    *ch = n;
  446|  41.6k|    return bytes - 1;
  447|  41.6k|}
prvTidyIsHighSurrogate:
  477|  6.78k|{
  478|  6.78k|    return ( ch >= kUTF16HighSurrogateBegin && ch <= kUTF16HighSurrogateEnd );
  ------------------
  |  |  132|  13.5k|#define kUTF16HighSurrogateBegin 0xDC00
  ------------------
                  return ( ch >= kUTF16HighSurrogateBegin && ch <= kUTF16HighSurrogateEnd );
  ------------------
  |  |  133|     21|#define kUTF16HighSurrogateEnd   0xDFFF
  ------------------
  |  Branch (478:14): [True: 21, False: 6.76k]
  |  Branch (478:48): [True: 0, False: 21]
  ------------------
  479|  6.78k|}
prvTidyIsLowSurrogate:
  481|  7.89k|{
  482|  7.89k|    return ( ch >= kUTF16LowSurrogateBegin && ch <= kUTF16LowSurrogateEnd );
  ------------------
  |  |  130|  15.7k|#define kUTF16LowSurrogateBegin  0xD800
  ------------------
                  return ( ch >= kUTF16LowSurrogateBegin && ch <= kUTF16LowSurrogateEnd );
  ------------------
  |  |  131|  1.12k|#define kUTF16LowSurrogateEnd    0xDBFF
  ------------------
  |  Branch (482:14): [True: 1.12k, False: 6.76k]
  |  Branch (482:47): [True: 1.10k, False: 21]
  ------------------
  483|  7.89k|}

TidyXml:
   26|     98|             TidyBuffer *terror) {
   27|     98|  TidyDoc tdoc = tidyCreate();
   28|     98|  tidyBufClear(toutput);
   29|     98|  tidyBufClear(terror);
   30|     98|  if (tidyOptSetBool(tdoc, TidyXmlOut, yes)) {
  ------------------
  |  Branch (30:7): [True: 98, False: 0]
  ------------------
   31|     98|    tidySetCharEncoding(tdoc, "utf8");
   32|     98|    tidySetErrorBuffer(tdoc, terror);
   33|     98|    tidyOptSetInt(tdoc, TidyWrapLen, 0);
   34|     98|    tidyOptSetBool(tdoc, TidyXmlTags, yes);
   35|     98|    tidyOptSetBool(tdoc, TidyQuoteNbsp, no);
   36|     98|    tidyOptSetBool(tdoc, TidyNumEntities, yes);
   37|     98|    tidyOptSetBool(tdoc, TidyQuiet, yes);
   38|     98|    tidyOptSetBool(tdoc, TidyMark, no);
   39|     98|    tidyOptSetBool(tdoc, TidyShowWarnings, no);
   40|     98|    tidyParseString(tdoc, fuzz_inp);
   41|     98|    tidyCleanAndRepair(tdoc);
   42|     98|    tidyRunDiagnostics(tdoc);
   43|     98|    tidySaveBuffer(tdoc, toutput);
   44|     98|  }
   45|       |
   46|     98|  tidyRelease(tdoc);
   47|     98|}
LLVMFuzzerTestOneInput:
   49|     98|int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
   50|     98|  char *fuzz_inp = malloc(size+1);
   51|     98|  memcpy(fuzz_inp, data, size);
   52|     98|  fuzz_inp[size] = '\0';
   53|       |
   54|     98|  TidyBuffer fuzz_toutput;
   55|     98|  TidyBuffer fuzz_terror;
   56|       |
   57|     98|  tidyBufInit(&fuzz_toutput);
   58|     98|  tidyBufInit(&fuzz_terror);
   59|       |
   60|     98|  TidyXml(fuzz_inp, &fuzz_toutput, &fuzz_terror);
   61|       |
   62|     98|  free(fuzz_inp);
   63|     98|  tidyBufFree(&fuzz_toutput);
   64|     98|  tidyBufFree(&fuzz_terror);
   65|     98|  return 0;
   66|     98|}

