alloc.c:defaultAlloc:
   63|  92.4M|{
   64|  92.4M|    void *p = ( g_malloc ? g_malloc(size) : malloc(size) );
  ------------------
  |  Branch (64:17): [True: 0, False: 92.4M]
  ------------------
   65|  92.4M|    if ( !p )
  ------------------
  |  Branch (65:10): [True: 0, False: 92.4M]
  ------------------
   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|  92.4M|    return p;
   75|  92.4M|}
alloc.c:defaultRealloc:
   78|   479k|{
   79|   479k|    void *p;
   80|   479k|    if ( mem == NULL )
  ------------------
  |  Branch (80:10): [True: 144k, False: 335k]
  ------------------
   81|   144k|        return defaultAlloc( allocator, newsize );
   82|       |
   83|   335k|    p = ( g_realloc ? g_realloc(mem, newsize) : realloc(mem, newsize) );
  ------------------
  |  Branch (83:11): [True: 0, False: 335k]
  ------------------
   84|   335k|    if (!p)
  ------------------
  |  Branch (84:9): [True: 0, False: 335k]
  ------------------
   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|   335k|    return p;
   91|   479k|}
alloc.c:defaultFree:
   94|  92.9M|{
   95|  92.9M|    if ( mem )
  ------------------
  |  Branch (95:10): [True: 91.9M, False: 1.07M]
  ------------------
   96|  91.9M|    {
   97|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_MEMORY)
   98|       |        freecnt++;
   99|       |        SPRTF("%d: free    MEM %p\n", freecnt, mem );
  100|       |#endif
  101|  91.9M|        if ( g_free )
  ------------------
  |  Branch (101:14): [True: 0, False: 91.9M]
  ------------------
  102|      0|            g_free( mem );
  103|  91.9M|        else
  104|  91.9M|            free( mem );
  105|  91.9M|    }
  106|  92.9M|}

prvTidyNodeAttributeVersions:
  503|  41.5k|{
  504|  41.5k|    uint i;
  505|       |
  506|  41.5k|    if (!node || !node->tag || !node->tag->attrvers)
  ------------------
  |  Branch (506:9): [True: 0, False: 41.5k]
  |  Branch (506:18): [True: 0, False: 41.5k]
  |  Branch (506:32): [True: 457, False: 41.0k]
  ------------------
  507|    457|        return VERS_UNKNOWN;
  ------------------
  |  |  204|    457|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|    457|#define xxxx                   0u
  |  |  ------------------
  ------------------
  508|       |
  509|  1.84M|    for (i = 0; node->tag->attrvers[i].attribute; ++i)
  ------------------
  |  Branch (509:17): [True: 1.84M, False: 0]
  ------------------
  510|  1.84M|        if (node->tag->attrvers[i].attribute == id)
  ------------------
  |  Branch (510:13): [True: 41.0k, False: 1.80M]
  ------------------
  511|  41.0k|            return node->tag->attrvers[i].versions;
  512|       |
  513|      0|    return VERS_UNKNOWN;
  ------------------
  |  |  204|      0|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|      0|#define xxxx                   0u
  |  |  ------------------
  ------------------
  514|  41.0k|}
prvTidyAttributeIsProprietary:
  522|   337k|{
  523|   337k|    if (!node || !attval)
  ------------------
  |  Branch (523:9): [True: 0, False: 337k]
  |  Branch (523:18): [True: 0, False: 337k]
  ------------------
  524|      0|        return no;
  525|       |
  526|   337k|    if (!node->tag)
  ------------------
  |  Branch (526:9): [True: 1.90k, False: 335k]
  ------------------
  527|  1.90k|        return no;
  528|       |
  529|   335k|    if (!(node->tag->versions & VERS_ALL))
  ------------------
  |  |  228|   335k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|   335k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|   335k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|   335k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|   335k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|   335k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|   335k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|   335k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|   335k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|   335k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|   335k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|   335k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|   335k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|   335k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|   335k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|   335k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|   335k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|   335k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|   335k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|   335k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|   335k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|   335k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|   335k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|   335k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|   335k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|   335k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|   335k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|   335k|#define HT50              131072u
  |  |  ------------------
  ------------------
  |  Branch (529:9): [True: 1.50k, False: 334k]
  ------------------
  530|  1.50k|        return no;
  531|       |
  532|   334k|    if (AttributeVersions(node, attval) & VERS_ALL)
  ------------------
  |  |  228|   334k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|   334k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|   334k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|   334k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|   334k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|   334k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|   334k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|   334k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|   334k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|   334k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|   334k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|   334k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|   334k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|   334k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|   334k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|   334k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|   334k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|   334k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|   334k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|   334k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|   334k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|   334k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|   334k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|   334k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|   334k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|   334k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|   334k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|   334k|#define HT50              131072u
  |  |  ------------------
  ------------------
  |  Branch (532:9): [True: 240k, False: 94.0k]
  ------------------
  533|   240k|        return no;
  534|       |
  535|  94.0k|    return yes;
  536|   334k|}
prvTidyAttributeIsMismatched:
  545|  7.54k|{
  546|  7.54k|    uint doctype;
  547|       |    
  548|  7.54k|    if (!node || !attval)
  ------------------
  |  Branch (548:9): [True: 0, False: 7.54k]
  |  Branch (548:18): [True: 0, False: 7.54k]
  ------------------
  549|      0|        return no;
  550|       |    
  551|  7.54k|    if (!node->tag)
  ------------------
  |  Branch (551:9): [True: 85, False: 7.45k]
  ------------------
  552|     85|        return no;
  553|       |    
  554|  7.45k|    if (!(node->tag->versions & VERS_ALL))
  ------------------
  |  |  228|  7.45k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|  7.45k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|  7.45k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|  7.45k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  7.45k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|  7.45k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|  7.45k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|  7.45k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|  7.45k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|  7.45k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|  7.45k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|  7.45k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|  7.45k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  7.45k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|  7.45k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|  7.45k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|  7.45k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|  7.45k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|  7.45k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|  7.45k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|  7.45k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|  7.45k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|  7.45k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|  7.45k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|  7.45k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|  7.45k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|  7.45k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|  7.45k|#define HT50              131072u
  |  |  ------------------
  ------------------
  |  Branch (554:9): [True: 246, False: 7.21k]
  ------------------
  555|    246|        return no;
  556|       |
  557|  7.21k|    doctype = doc->lexer->versionEmitted == 0 ? doc->lexer->doctype : doc->lexer->versionEmitted;
  ------------------
  |  Branch (557:15): [True: 0, False: 7.21k]
  ------------------
  558|       |
  559|  7.21k|    if (AttributeVersions(node, attval) & doctype)
  ------------------
  |  Branch (559:9): [True: 4.44k, False: 2.76k]
  ------------------
  560|  4.44k|        return no;
  561|       |    
  562|  2.76k|    return yes;
  563|  7.21k|}
prvTidyAttrGetById:
  857|  6.48M|{
  858|  6.48M|   AttVal* av;
  859|  7.17M|   for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (859:33): [True: 814k, False: 6.36M]
  ------------------
  860|   814k|   {
  861|   814k|     if ( AttrIsId(av, id) )
  ------------------
  |  |  169|   814k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  ------------------
  |  |  |  Branch (169:29): [True: 814k, False: 0]
  |  |  |  Branch (169:37): [True: 615k, False: 198k]
  |  |  |  Branch (169:51): [True: 125k, False: 490k]
  |  |  ------------------
  ------------------
  862|   125k|         return av;
  863|   814k|   }
  864|  6.36M|   return NULL;
  865|  6.48M|}
prvTidyFindAttribute:
  869|   389k|{
  870|   389k|    if ( attval )
  ------------------
  |  Branch (870:10): [True: 389k, False: 0]
  ------------------
  871|   389k|       return attrsLookup( doc, &doc->attribs, attval->attribute );
  872|      0|    return NULL;
  873|   389k|}
prvTidyGetAttrByName:
  876|   200k|{
  877|   200k|    AttVal *attr;
  878|   301k|    for (attr = node->attributes; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (878:35): [True: 132k, False: 168k]
  ------------------
  879|   132k|    {
  880|   132k|        if (attr->attribute && TY_(tmbstrcmp)(attr->attribute, name) == 0)
  ------------------
  |  |   23|   130k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   130k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (880:13): [True: 130k, False: 2.14k]
  |  Branch (880:32): [True: 31.6k, False: 98.9k]
  ------------------
  881|  31.6k|            break;
  882|   132k|    }
  883|   200k|    return attr;
  884|   200k|}
prvTidyAddAttribute:
  909|   127k|{
  910|   127k|    AttVal *av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|   127k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   127k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  911|   127k|    av->delim = '"';
  912|   127k|    av->attribute = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|   127k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   127k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  913|       |
  914|   127k|    if (value)
  ------------------
  |  Branch (914:9): [True: 90.1k, False: 37.7k]
  ------------------
  915|  90.1k|        av->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|  90.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  90.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  916|  37.7k|    else
  917|  37.7k|        av->value = NULL;
  918|       |
  919|   127k|    av->dict = attrsLookup(doc, &doc->attribs, name);
  920|       |
  921|   127k|    TY_(InsertAttributeAtEnd)(node, av);
  ------------------
  |  |   23|   127k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   127k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  922|   127k|    return av;
  923|   127k|}
prvTidyRepairAttrValue:
  926|  57.6k|{
  927|  57.6k|    AttVal* old = TY_(GetAttrByName)(node, name);
  ------------------
  |  |   23|  57.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  928|       |
  929|  57.6k|    if (old)
  ------------------
  |  Branch (929:9): [True: 90, False: 57.5k]
  ------------------
  930|     90|    {
  931|     90|        if (old->value)
  ------------------
  |  Branch (931:13): [True: 88, False: 2]
  ------------------
  932|     90|            TidyDocFree(doc, old->value);
  ------------------
  |  |  159|     88|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     88|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  933|     90|        if (value)
  ------------------
  |  Branch (933:13): [True: 90, False: 0]
  ------------------
  934|     90|            old->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|     90|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     90|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  935|      0|        else
  936|      0|            old->value = NULL;
  937|       |
  938|     90|        return old;
  939|     90|    }
  940|  57.5k|    else
  941|  57.5k|        return TY_(AddAttribute)(doc, node, name, value);
  ------------------
  |  |   23|  57.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  942|  57.6k|}
prvTidyFreeAttrPriorityList:
  946|  20.2k|{
  947|  20.2k|    PriorityAttribs *priorities = &(doc->attribs.priorityAttribs);
  948|       |
  949|  20.2k|    if ( priorities->list )
  ------------------
  |  Branch (949:10): [True: 0, False: 20.2k]
  ------------------
  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|  20.2k|}
prvTidyIsUrl:
 1024|  15.6k|{
 1025|  15.6k|    return CheckAttrType( doc, attrname, CH_URL );
  ------------------
  |  |   64|  15.6k|#define CH_URL         TY_(CheckUrl)
  |  |  ------------------
  |  |  |  |   23|  15.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  15.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1026|  15.6k|}
prvTidyIsScript:
 1036|    970|{
 1037|    970|    return CheckAttrType( doc, attrname, CH_SCRIPT );
  ------------------
  |  |   65|    970|#define CH_SCRIPT      CheckScript
  ------------------
 1038|    970|}
prvTidyIsAnchorElement:
 1042|  2.82M|{
 1043|  2.82M|    TidyTagId tid = TagId( node );
  ------------------
  |  |  270|  2.82M|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 2.82M, False: 0]
  |  |  |  Branch (270:39): [True: 2.32M, False: 499k]
  |  |  ------------------
  ------------------
 1044|  2.82M|    if ( tid == TidyTag_A      ||
  ------------------
  |  Branch (1044:10): [True: 21.7k, False: 2.80M]
  ------------------
 1045|  2.80M|         tid == TidyTag_APPLET ||
  ------------------
  |  Branch (1045:10): [True: 1.24k, False: 2.80M]
  ------------------
 1046|  2.80M|         tid == TidyTag_FORM   ||
  ------------------
  |  Branch (1046:10): [True: 9.40k, False: 2.79M]
  ------------------
 1047|  2.79M|         tid == TidyTag_FRAME  ||
  ------------------
  |  Branch (1047:10): [True: 2.75k, False: 2.78M]
  ------------------
 1048|  2.78M|         tid == TidyTag_IFRAME ||
  ------------------
  |  Branch (1048:10): [True: 1.11k, False: 2.78M]
  ------------------
 1049|  2.78M|         tid == TidyTag_IMG    ||
  ------------------
  |  Branch (1049:10): [True: 3.43k, False: 2.78M]
  ------------------
 1050|  2.78M|         tid == TidyTag_MAP )
  ------------------
  |  Branch (1050:10): [True: 51.3k, False: 2.73M]
  ------------------
 1051|  91.0k|        return yes;
 1052|       |
 1053|  2.73M|    return no;
 1054|  2.82M|}
prvTidyRemoveAnchorByNode:
 1153|  12.1k|{
 1154|  12.1k|    TidyAttribImpl* attribs = &doc->attribs;
 1155|  12.1k|    Anchor *delme = NULL, *curr, *prev = NULL;
 1156|  12.1k|    uint h;
 1157|  12.1k|    if (TY_(HTMLVersion)(doc) == HT50)
  ------------------
  |  |   23|  12.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (TY_(HTMLVersion)(doc) == HT50)
  ------------------
  |  |  200|  12.1k|#define HT50              131072u
  ------------------
  |  Branch (1157:9): [True: 0, False: 12.1k]
  ------------------
 1158|      0|        h = anchorNameHash5(name);
 1159|  12.1k|    else
 1160|  12.1k|        h = anchorNameHash(name);
 1161|       |
 1162|  21.6k|    for ( curr=attribs->anchor_hash[h]; curr!=NULL; curr=curr->next )
  ------------------
  |  Branch (1162:41): [True: 10.5k, False: 11.0k]
  ------------------
 1163|  10.5k|    {
 1164|  10.5k|        if ( curr->node == node )
  ------------------
  |  Branch (1164:14): [True: 1.14k, False: 9.43k]
  ------------------
 1165|  1.14k|        {
 1166|  1.14k|            if ( prev )
  ------------------
  |  Branch (1166:18): [True: 203, False: 943]
  ------------------
 1167|    203|                prev->next = curr->next;
 1168|    943|            else
 1169|    943|                attribs->anchor_hash[h] = curr->next;
 1170|  1.14k|            delme = curr;
 1171|  1.14k|            break;
 1172|  1.14k|        }
 1173|  9.43k|        prev = curr;
 1174|  9.43k|    }
 1175|  12.1k|    FreeAnchor( doc, delme );
 1176|  12.1k|}
prvTidyFreeAnchors:
 1256|  40.4k|{
 1257|  40.4k|    TidyAttribImpl* attribs = &doc->attribs;
 1258|  40.4k|    Anchor* a;
 1259|  40.4k|    uint h;
 1260|  41.3M|    for (h = 0; h < ANCHOR_HASH_SIZE; h++) {
  ------------------
  |  Branch (1260:17): [True: 41.2M, False: 40.4k]
  ------------------
 1261|  41.3M|        while (NULL != (a = attribs->anchor_hash[h]) )
  ------------------
  |  Branch (1261:16): [True: 38.0k, False: 41.2M]
  ------------------
 1262|  38.0k|        {
 1263|  38.0k|            attribs->anchor_hash[h] = a->next;
 1264|  38.0k|            FreeAnchor(doc, a);
 1265|  38.0k|        }
 1266|  41.2M|    }
 1267|  40.4k|}
prvTidyInitAttrs:
 1271|  20.2k|{
 1272|  20.2k|    TidyClearMemory( &doc->attribs, sizeof(TidyAttribImpl) );
  ------------------
  |  |   70|  20.2k|#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|  20.2k|}
prvTidyFreeAttrTable:
 1301|  20.2k|{
 1302|  20.2k|    attrsEmptyHash( doc, &doc->attribs );
 1303|  20.2k|    TY_(FreeAnchors)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1304|  20.2k|    FreeDeclaredAttributes( doc );
 1305|  20.2k|}
prvTidyRepairDuplicateAttributes:
 1388|   776k|{
 1389|   776k|    AttVal *first;
 1390|       |
 1391|   857k|    for (first = node->attributes; first != NULL;)
  ------------------
  |  Branch (1391:36): [True: 80.2k, False: 776k]
  ------------------
 1392|  80.2k|    {
 1393|  80.2k|        AttVal *second;
 1394|  80.2k|        Bool firstRedefined = no;
 1395|       |
 1396|  80.2k|        if (!(first->asp == NULL && first->php == NULL))
  ------------------
  |  Branch (1396:15): [True: 79.3k, False: 919]
  |  Branch (1396:37): [True: 75.5k, False: 3.85k]
  ------------------
 1397|  4.77k|        {
 1398|  4.77k|            first = first->next;
 1399|  4.77k|            continue;
 1400|  4.77k|        }
 1401|       |
 1402|   116k|        for (second = first->next; second != NULL;)
  ------------------
  |  Branch (1402:36): [True: 40.7k, False: 75.5k]
  ------------------
 1403|  40.7k|        {
 1404|  40.7k|            AttVal *temp;
 1405|       |
 1406|  40.7k|            if (!(second->asp == NULL && second->php == NULL
  ------------------
  |  Branch (1406:19): [True: 40.1k, False: 569]
  |  Branch (1406:42): [True: 39.4k, False: 733]
  ------------------
 1407|  39.4k|                  && AttrsHaveSameName(first, second)))
  ------------------
  |  Branch (1407:22): [True: 7.85k, False: 31.6k]
  ------------------
 1408|  32.9k|            {
 1409|  32.9k|                second = second->next;
 1410|  32.9k|                continue;
 1411|  32.9k|            }
 1412|       |
 1413|       |            /* first and second attribute have same local name */
 1414|       |            /* now determine what to do with this duplicate... */
 1415|       |
 1416|  7.85k|            if (!isXml
  ------------------
  |  Branch (1416:17): [True: 7.85k, False: 0]
  ------------------
 1417|  7.85k|                && attrIsCLASS(first) && cfgBool(doc, TidyJoinClasses)
  ------------------
  |  |  206|  7.85k|#define attrIsCLASS(av)             AttrIsId( av, TidyAttr_CLASS  )
  |  |  ------------------
  |  |  |  |  169|  15.7k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 7.85k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 5.88k, False: 1.97k]
  |  |  |  |  |  Branch (169:51): [True: 194, False: 5.69k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              && attrIsCLASS(first) && cfgBool(doc, TidyJoinClasses)
  ------------------
  |  |  418|  8.05k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    194|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 194]
  |  |  ------------------
  ------------------
 1418|      0|                && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|  7.85k|#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|  7.85k|            else if (!isXml
  ------------------
  |  Branch (1429:22): [True: 7.85k, False: 0]
  ------------------
 1430|  7.85k|                     && attrIsSTYLE(first) && cfgBool(doc, TidyJoinStyles)
  ------------------
  |  |  323|  7.85k|#define attrIsSTYLE(av)             AttrIsId( av, TidyAttr_STYLE  )
  |  |  ------------------
  |  |  |  |  169|  15.7k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 7.85k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 5.88k, False: 1.97k]
  |  |  |  |  |  Branch (169:51): [True: 1.94k, False: 3.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                   && attrIsSTYLE(first) && cfgBool(doc, TidyJoinStyles)
  ------------------
  |  |  418|  9.79k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.94k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 1.94k, False: 0]
  |  |  ------------------
  ------------------
 1431|  1.94k|                     && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|  9.79k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.94k, False: 0]
  |  |  |  Branch (171:44): [True: 1.69k, False: 242]
  |  |  ------------------
  ------------------
                                   && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|  1.69k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.69k, False: 0]
  |  |  |  Branch (171:44): [True: 1.46k, False: 232]
  |  |  ------------------
  ------------------
 1432|  1.46k|            {
 1433|  1.46k|                AppendToStyleAttr( doc, first, second->value );
 1434|       |
 1435|  1.46k|                temp = second->next;
 1436|  1.46k|                TY_(ReportAttrError)( doc, node, second, JOINING_ATTRIBUTE);
  ------------------
  |  |   23|  1.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1437|  1.46k|                TY_(RemoveAttribute)( doc, node, second );
  ------------------
  |  |   23|  1.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1438|  1.46k|                second = temp;
 1439|  1.46k|            }
 1440|  6.39k|            else if ( cfg(doc, TidyDuplicateAttrs) == TidyKeepLast )
  ------------------
  |  |  415|  6.39k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1440:23): [True: 6.39k, False: 0]
  ------------------
 1441|  6.39k|            {
 1442|  6.39k|                temp = first->next;
 1443|  6.39k|                TY_(ReportAttrError)( doc, node, first, REPEATED_ATTRIBUTE);
  ------------------
  |  |   23|  6.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1444|  6.39k|                TY_(RemoveAttribute)( doc, node, first );
  ------------------
  |  |   23|  6.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1445|  6.39k|                firstRedefined = yes;
 1446|  6.39k|                first = temp;
 1447|  6.39k|                second = second->next;
 1448|  6.39k|            }
 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|  7.85k|        }
 1457|  75.5k|        if (!firstRedefined)
  ------------------
  |  Branch (1457:13): [True: 72.3k, False: 3.17k]
  ------------------
 1458|  72.3k|            first = first->next;
 1459|  75.5k|    }
 1460|   776k|}
prvTidyCheckAttribute:
 1464|   327k|{
 1465|   327k|    const Attribute* attribute = attval->dict;
 1466|       |
 1467|   327k|    if ( attribute != NULL )
  ------------------
  |  Branch (1467:10): [True: 247k, False: 79.8k]
  ------------------
 1468|   247k|    {
 1469|   247k|        if (attrIsXML_LANG(attval) || attrIsXML_SPACE(attval))
  ------------------
  |  |  341|   247k|#define attrIsXML_LANG(av)          AttrIsId( av, TidyAttr_XML_LANG  )
  |  |  ------------------
  |  |  |  |  169|   494k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 247k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 247k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 35.9k, False: 211k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (attrIsXML_LANG(attval) || attrIsXML_SPACE(attval))
  ------------------
  |  |  342|   211k|#define attrIsXML_SPACE(av)         AttrIsId( av, TidyAttr_XML_SPACE  )
  |  |  ------------------
  |  |  |  |  169|   211k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 211k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 211k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 226, False: 211k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1470|  36.2k|        {
 1471|  36.2k|            doc->lexer->isvoyager = yes;
 1472|  36.2k|            if (!cfgBool(doc, TidyHtmlOut))
  ------------------
  |  |  418|  36.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  36.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1472:17): [True: 36.2k, False: 0]
  ------------------
 1473|  36.2k|            {
 1474|  36.2k|                TY_(SetOptionBool)(doc, TidyXhtmlOut, yes);
  ------------------
  |  |   23|  36.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1475|  36.2k|                TY_(SetOptionBool)(doc, TidyXmlOut, yes);
  ------------------
  |  |   23|  36.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1476|  36.2k|            }
 1477|  36.2k|        }
 1478|       |
 1479|   247k|        TY_(ConstrainVersion)(doc, AttributeVersions(node, attval));
  ------------------
  |  |   23|   247k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   247k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1480|       |        
 1481|   247k|        if (attribute->attrchk)
  ------------------
  |  Branch (1481:13): [True: 195k, False: 51.4k]
  ------------------
 1482|   195k|            attribute->attrchk( doc, node, attval );
 1483|   247k|    }
 1484|       |
 1485|   327k|    return attribute;
 1486|   327k|}
prvTidyIsBoolAttribute:
 1489|   122k|{
 1490|   122k|    const Attribute *attribute = ( attval ? attval->dict : NULL );
  ------------------
  |  Branch (1490:36): [True: 122k, False: 0]
  ------------------
 1491|   122k|    if ( attribute && attribute->attrchk == CH_BOOL )
  ------------------
  |  |   73|  79.7k|#define CH_BOOL        CheckBool
  ------------------
  |  Branch (1491:10): [True: 79.7k, False: 42.8k]
  |  Branch (1491:23): [True: 623, False: 79.0k]
  ------------------
 1492|    623|        return yes;
 1493|   121k|    return no;
 1494|   122k|}
prvTidyattrIsEvent:
 1497|   122k|{
 1498|   122k|    TidyAttrId atid = AttrId( attval );
  ------------------
  |  |  168|   122k|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 122k, False: 0]
  |  |  |  Branch (168:29): [True: 79.7k, False: 42.8k]
  |  |  ------------------
  ------------------
 1499|       |
 1500|   122k|    return (atid == TidyAttr_OnAFTERUPDATE     ||
  ------------------
  |  Branch (1500:13): [True: 0, False: 122k]
  ------------------
 1501|   122k|            atid == TidyAttr_OnBEFOREUNLOAD    ||
  ------------------
  |  Branch (1501:13): [True: 0, False: 122k]
  ------------------
 1502|   122k|            atid == TidyAttr_OnBEFOREUPDATE    ||
  ------------------
  |  Branch (1502:13): [True: 0, False: 122k]
  ------------------
 1503|   122k|            atid == TidyAttr_OnBLUR            ||
  ------------------
  |  Branch (1503:13): [True: 0, False: 122k]
  ------------------
 1504|   122k|            atid == TidyAttr_OnCHANGE          ||
  ------------------
  |  Branch (1504:13): [True: 0, False: 122k]
  ------------------
 1505|   122k|            atid == TidyAttr_OnCLICK           ||
  ------------------
  |  Branch (1505:13): [True: 423, False: 122k]
  ------------------
 1506|   122k|            atid == TidyAttr_OnDATAAVAILABLE   ||
  ------------------
  |  Branch (1506:13): [True: 0, False: 122k]
  ------------------
 1507|   122k|            atid == TidyAttr_OnDATASETCHANGED  ||
  ------------------
  |  Branch (1507:13): [True: 0, False: 122k]
  ------------------
 1508|   122k|            atid == TidyAttr_OnDATASETCOMPLETE ||
  ------------------
  |  Branch (1508:13): [True: 0, False: 122k]
  ------------------
 1509|   122k|            atid == TidyAttr_OnDBLCLICK        ||
  ------------------
  |  Branch (1509:13): [True: 0, False: 122k]
  ------------------
 1510|   122k|            atid == TidyAttr_OnERRORUPDATE     ||
  ------------------
  |  Branch (1510:13): [True: 0, False: 122k]
  ------------------
 1511|   122k|            atid == TidyAttr_OnFOCUS           ||
  ------------------
  |  Branch (1511:13): [True: 0, False: 122k]
  ------------------
 1512|   122k|            atid == TidyAttr_OnKEYDOWN         ||
  ------------------
  |  Branch (1512:13): [True: 0, False: 122k]
  ------------------
 1513|   122k|            atid == TidyAttr_OnKEYPRESS        ||
  ------------------
  |  Branch (1513:13): [True: 0, False: 122k]
  ------------------
 1514|   122k|            atid == TidyAttr_OnKEYUP           ||
  ------------------
  |  Branch (1514:13): [True: 0, False: 122k]
  ------------------
 1515|   122k|            atid == TidyAttr_OnLOAD            ||
  ------------------
  |  Branch (1515:13): [True: 0, False: 122k]
  ------------------
 1516|   122k|            atid == TidyAttr_OnMOUSEDOWN       ||
  ------------------
  |  Branch (1516:13): [True: 0, False: 122k]
  ------------------
 1517|   122k|            atid == TidyAttr_OnMOUSEMOVE       ||
  ------------------
  |  Branch (1517:13): [True: 0, False: 122k]
  ------------------
 1518|   122k|            atid == TidyAttr_OnMOUSEOUT        ||
  ------------------
  |  Branch (1518:13): [True: 0, False: 122k]
  ------------------
 1519|   122k|            atid == TidyAttr_OnMOUSEOVER       ||
  ------------------
  |  Branch (1519:13): [True: 0, False: 122k]
  ------------------
 1520|   122k|            atid == TidyAttr_OnMOUSEUP         ||
  ------------------
  |  Branch (1520:13): [True: 0, False: 122k]
  ------------------
 1521|   122k|            atid == TidyAttr_OnRESET           ||
  ------------------
  |  Branch (1521:13): [True: 0, False: 122k]
  ------------------
 1522|   122k|            atid == TidyAttr_OnROWENTER        ||
  ------------------
  |  Branch (1522:13): [True: 0, False: 122k]
  ------------------
 1523|   122k|            atid == TidyAttr_OnROWEXIT         ||
  ------------------
  |  Branch (1523:13): [True: 0, False: 122k]
  ------------------
 1524|   122k|            atid == TidyAttr_OnSELECT          ||
  ------------------
  |  Branch (1524:13): [True: 0, False: 122k]
  ------------------
 1525|   122k|            atid == TidyAttr_OnSUBMIT          ||
  ------------------
  |  Branch (1525:13): [True: 0, False: 122k]
  ------------------
 1526|   122k|            atid == TidyAttr_OnUNLOAD);
  ------------------
  |  Branch (1526:13): [True: 0, False: 122k]
  ------------------
 1527|   122k|}
prvTidyCheckUrl:
 1620|  43.3k|{
 1621|  43.3k|    tmbchar c;
 1622|  43.3k|    tmbstr dest, p;
 1623|  43.3k|    uint escape_count = 0, backslash_count = 0, bad_codepoint_count = 0;
 1624|  43.3k|    uint i, pos = 0;
 1625|  43.3k|    uint len;
 1626|  43.3k|    uint increment;
 1627|  43.3k|    Bool isJavascript = no;
 1628|       |
 1629|  43.3k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  43.3k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 43.3k, False: 0]
  |  |  |  Branch (171:44): [True: 40.6k, False: 2.64k]
  |  |  ------------------
  ------------------
 1630|  2.64k|    {
 1631|  2.64k|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  2.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1632|  2.64k|        return;
 1633|  2.64k|    }
 1634|       |
 1635|  40.6k|    p = attval->value;
 1636|       |
 1637|  40.6k|    isJavascript =
 1638|  40.6k|        TY_(tmbstrncmp)(p,"javascript:",sizeof("javascript:")-1)==0;
  ------------------
  |  |   23|  40.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1639|       |
 1640|  5.15M|    for (i = 0; '\0' != (c = p[i]); ++i)
  ------------------
  |  Branch (1640:17): [True: 5.11M, False: 40.6k]
  ------------------
 1641|  5.11M|    {
 1642|  5.11M|        if (c == '\\')
  ------------------
  |  Branch (1642:13): [True: 29.3k, False: 5.08M]
  ------------------
 1643|  29.3k|        {
 1644|  29.3k|            ++backslash_count;
 1645|  29.3k|            if ( cfgBool(doc, TidyFixBackslash) && !isJavascript)
  ------------------
  |  |  418|  58.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  29.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 29.3k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1645:52): [True: 28.7k, False: 605]
  ------------------
 1646|  28.7k|                p[i] = '/';
 1647|  29.3k|        }
 1648|  5.08M|        else if ((c > 0x7e) || (c <= 0x20) || (strchr("<>", c)))
  ------------------
  |  Branch (1648:18): [True: 444, False: 5.08M]
  |  Branch (1648:32): [True: 4.40M, False: 674k]
  |  Branch (1648:47): [True: 23.8k, False: 650k]
  ------------------
 1649|  4.43M|            ++escape_count;
 1650|  5.11M|    }
 1651|       |
 1652|  3.16M|    while ( *p != 0 )
  ------------------
  |  Branch (1652:13): [True: 3.12M, False: 40.6k]
  ------------------
 1653|  3.12M|    {
 1654|  3.12M|        if ( !IsURLCodePoint( p, &increment ) )
  ------------------
  |  Branch (1654:14): [True: 2.47M, False: 644k]
  ------------------
 1655|  2.47M|            ++bad_codepoint_count;
 1656|  3.12M|         p = p + increment;
 1657|  3.12M|    }
 1658|  40.6k|    p = attval->value;
 1659|       |
 1660|  40.6k|    if ( cfgBool(doc, TidyFixUri) && escape_count )
  ------------------
  |  |  418|  81.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  40.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 40.6k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1660:38): [True: 38.2k, False: 2.40k]
  ------------------
 1661|  38.2k|    {
 1662|  38.2k|        Bool hadnonspace = no;
 1663|  38.2k|        len = TY_(tmbstrlen)(p) + escape_count * 2 + 1;
  ------------------
  |  |   23|  38.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1664|  38.2k|        dest = (tmbstr) TidyDocAlloc(doc, len);
  ------------------
  |  |  157|  38.2k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  38.2k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 1665|       | 
 1666|  5.14M|        for (i = 0; 0 != (c = p[i]); ++i)
  ------------------
  |  Branch (1666:21): [True: 5.10M, False: 38.2k]
  ------------------
 1667|  5.10M|        {
 1668|  5.10M|            if ((c > 0x7e) || (c <= 0x20) || (strchr("<>", c)))
  ------------------
  |  Branch (1668:17): [True: 444, False: 5.10M]
  |  Branch (1668:31): [True: 4.40M, False: 696k]
  |  Branch (1668:46): [True: 23.8k, False: 672k]
  ------------------
 1669|  4.43M|            {
 1670|  4.43M|                if (c == 0x20)
  ------------------
  |  Branch (1670:21): [True: 1.42M, False: 3.00M]
  ------------------
 1671|  1.42M|                {
 1672|       |                    /* #345 - special case for leading spaces - discard */
 1673|  1.42M|                    if (hadnonspace)
  ------------------
  |  Branch (1673:25): [True: 1.42M, False: 5.33k]
  ------------------
 1674|  1.42M|                        pos += sprintf( dest + pos, "%%%02X", (byte)c );
 1675|  1.42M|                }
 1676|  3.00M|                else
 1677|  3.00M|                {
 1678|  3.00M|                    pos += sprintf( dest + pos, "%%%02X", (byte)c );
 1679|  3.00M|                    hadnonspace = yes;
 1680|  3.00M|                }
 1681|  4.43M|            }
 1682|   672k|            else
 1683|   672k|            {
 1684|   672k|                hadnonspace = yes;
 1685|   672k|                dest[pos++] = c;
 1686|   672k|            }
 1687|  5.10M|        }
 1688|  38.2k|        dest[pos] = 0;
 1689|       |
 1690|  38.2k|        TidyDocFree(doc, attval->value);
  ------------------
  |  |  159|  38.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  38.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1691|  38.2k|        attval->value = dest;
 1692|  38.2k|    }
 1693|  40.6k|    if ( backslash_count )
  ------------------
  |  Branch (1693:10): [True: 26.7k, False: 13.9k]
  ------------------
 1694|  26.7k|    {
 1695|  26.7k|        if ( cfgBool(doc, TidyFixBackslash) && !isJavascript )
  ------------------
  |  |  418|  53.5k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  26.7k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 26.7k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1695:48): [True: 26.5k, False: 250]
  ------------------
 1696|  26.5k|            TY_(ReportAttrError)( doc, node, attval, FIXED_BACKSLASH );
  ------------------
  |  |   23|  26.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1697|    250|        else
 1698|    250|            TY_(ReportAttrError)( doc, node, attval, BACKSLASH_IN_URI );
  ------------------
  |  |   23|    250|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    250|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1699|  26.7k|    }
 1700|  40.6k|    if ( escape_count )
  ------------------
  |  Branch (1700:10): [True: 38.2k, False: 2.40k]
  ------------------
 1701|  38.2k|    {
 1702|  38.2k|        if ( cfgBool(doc, TidyFixUri) )
  ------------------
  |  |  418|  38.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  38.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 38.2k, False: 0]
  |  |  ------------------
  ------------------
 1703|  38.2k|            TY_(ReportAttrError)( doc, node, attval, ESCAPED_ILLEGAL_URI);
  ------------------
  |  |   23|  38.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.2k|#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|  38.2k|        doc->badChars |= BC_INVALID_URI;
  ------------------
  |  |  304|  38.2k|#define BC_INVALID_URI             32
  ------------------
 1708|  38.2k|    }
 1709|  40.6k|    if ( bad_codepoint_count )
  ------------------
  |  Branch (1709:10): [True: 37.1k, False: 3.58k]
  ------------------
 1710|  37.1k|    {
 1711|  37.1k|        TY_(ReportAttrError)( doc, node, attval, ILLEGAL_URI_CODEPOINT );
  ------------------
  |  |   23|  37.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1712|  37.1k|    }
 1713|  40.6k|}
prvTidyIsValidHTMLID:
 1733|  72.2k|{
 1734|  72.2k|    ctmbstr s = id;
 1735|       |
 1736|  72.2k|    if (!s)
  ------------------
  |  Branch (1736:9): [True: 222, False: 72.0k]
  ------------------
 1737|    222|        return no;
 1738|       |
 1739|  2.03M|    while (*s)
  ------------------
  |  Branch (1739:12): [True: 2.01M, False: 17.5k]
  ------------------
 1740|  2.01M|        if (TY_(IsHTMLSpace)(*s++))
  ------------------
  |  |   23|  2.01M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.01M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1740:13): [True: 54.4k, False: 1.96M]
  ------------------
 1741|  54.4k|            return no;
 1742|       |
 1743|  17.5k|    return yes;
 1744|       |
 1745|  72.0k|}
prvTidyIsValidXMLID:
 1748|  66.8k|{
 1749|  66.8k|    ctmbstr s = id;
 1750|  66.8k|    tchar c;
 1751|       |
 1752|  66.8k|    if (!s)
  ------------------
  |  Branch (1752:9): [True: 0, False: 66.8k]
  ------------------
 1753|      0|        return no;
 1754|       |
 1755|  66.8k|    c = *s++;
 1756|  66.8k|    if (c > 0x7F)
  ------------------
  |  Branch (1756:9): [True: 984, False: 65.9k]
  ------------------
 1757|    984|        s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|    984|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    984|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1758|       |
 1759|  66.8k|    if (!(TY_(IsXMLLetter)(c) || c == '_' || c == ':'))
  ------------------
  |  |   23|  66.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  66.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1759:11): [True: 57.5k, False: 9.37k]
  |  Branch (1759:34): [True: 454, False: 8.91k]
  |  Branch (1759:46): [True: 6.10k, False: 2.81k]
  ------------------
 1760|  2.81k|        return no;
 1761|       |
 1762|   836k|    while (*s)
  ------------------
  |  Branch (1762:12): [True: 809k, False: 26.5k]
  ------------------
 1763|   809k|    {
 1764|   809k|        c = (unsigned char)*s;
 1765|       |
 1766|   809k|        if (c > 0x7F)
  ------------------
  |  Branch (1766:13): [True: 221k, False: 588k]
  ------------------
 1767|   221k|            s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|   221k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   221k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1768|       |
 1769|   809k|        ++s;
 1770|       |
 1771|   809k|        if (!TY_(IsXMLNamechar)(c))
  ------------------
  |  |   23|   809k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   809k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1771:13): [True: 37.5k, False: 772k]
  ------------------
 1772|  37.5k|            return no;
 1773|   809k|    }
 1774|       |
 1775|  26.5k|    return yes;
 1776|  64.0k|}
prvTidySortAttributes:
 2460|  2.10M|{
 2461|  4.83M|    while (node)
  ------------------
  |  Branch (2461:12): [True: 2.73M, False: 2.10M]
  ------------------
 2462|  2.73M|    {
 2463|  2.73M|        node->attributes = SortAttVal( doc, node->attributes, strat );
 2464|  2.73M|        if (node->content)
  ------------------
  |  Branch (2464:13): [True: 2.08M, False: 651k]
  ------------------
 2465|  2.08M|            TY_(SortAttributes)(doc, node->content, strat);
  ------------------
  |  |   23|  2.08M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.08M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2466|  2.73M|        node = node->next;
 2467|  2.73M|    }
 2468|  2.10M|}
attrs.c:AttributeVersions:
  479|   588k|{
  480|   588k|    uint i;
  481|       |
  482|       |    /* Override or add to items in attrdict.c */
  483|   588k|    if (attval && attval->attribute) {
  ------------------
  |  Branch (483:9): [True: 588k, False: 0]
  |  Branch (483:19): [True: 579k, False: 9.38k]
  ------------------
  484|       |        /* HTML5 data-* attributes can't be added generically; handle here. */
  485|   579k|        if (TY_(tmbstrncmp)(attval->attribute, "data-", 5) == 0)
  ------------------
  |  |   23|   579k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   579k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (485:13): [True: 766, False: 578k]
  ------------------
  486|    766|            return (XH50 | HT50);
  ------------------
  |  |  201|    766|#define XH50              262144u
  ------------------
                          return (XH50 | HT50);
  ------------------
  |  |  200|    766|#define HT50              131072u
  ------------------
  487|   579k|    }
  488|       |    /* TODO: maybe this should return VERS_PROPRIETARY instead? */
  489|   587k|    if (!attval || !attval->dict)
  ------------------
  |  Branch (489:9): [True: 0, False: 587k]
  |  Branch (489:20): [True: 61.3k, False: 526k]
  ------------------
  490|  61.3k|        return VERS_UNKNOWN;
  ------------------
  |  |  204|  61.3k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  61.3k|#define xxxx                   0u
  |  |  ------------------
  ------------------
  491|       |
  492|   526k|    if (!(!node || !node->tag || !node->tag->attrvers))
  ------------------
  |  Branch (492:11): [True: 0, False: 526k]
  |  Branch (492:20): [True: 0, False: 526k]
  |  Branch (492:34): [True: 1.35k, False: 525k]
  ------------------
  493|  34.5M|        for (i = 0; node->tag->attrvers[i].attribute; ++i)
  ------------------
  |  Branch (493:21): [True: 34.4M, False: 90.6k]
  ------------------
  494|  34.4M|            if (node->tag->attrvers[i].attribute == attval->dict->id)
  ------------------
  |  Branch (494:17): [True: 434k, False: 34.0M]
  ------------------
  495|   434k|                return node->tag->attrvers[i].versions;
  496|       |
  497|  91.9k|    return VERS_PROPRIETARY;
  ------------------
  |  |  231|  91.9k|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  91.9k|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  91.9k|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  91.9k|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  498|   526k|}
attrs.c:attrsLookup:
  836|   534k|{
  837|   534k|    const Attribute *np;
  838|   534k|    const AttrHash *p;
  839|       |
  840|   534k|    if (!atnam)
  ------------------
  |  Branch (840:9): [True: 7.77k, False: 526k]
  ------------------
  841|  7.77k|        return NULL;
  842|       |
  843|   527k|    for (p = attribs->hashtab[attrsHash(atnam)]; p && p->attr; p = p->next)
  ------------------
  |  Branch (843:50): [True: 308k, False: 218k]
  |  Branch (843:55): [True: 308k, False: 0]
  ------------------
  844|   308k|        if (TY_(tmbstrcasecmp)(atnam, p->attr->name) == 0)
  ------------------
  |  |   23|   308k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   308k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (844:13): [True: 308k, False: 550]
  ------------------
  845|   308k|            return p->attr;
  846|       |
  847|  58.7M|    for (np = attribute_defs; np && np->name; ++np)
  ------------------
  |  Branch (847:31): [True: 58.7M, False: 0]
  |  Branch (847:37): [True: 58.5M, False: 149k]
  ------------------
  848|  58.5M|        if (TY_(tmbstrcasecmp)(atnam, np->name) == 0)
  ------------------
  |  |   23|  58.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  58.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (848:13): [True: 69.2k, False: 58.4M]
  ------------------
  849|  69.2k|            return attrsInstall(doc, attribs, np);
  850|       |
  851|   149k|    return NULL;
  852|   218k|}
attrs.c:attrsHash:
  764|   595k|{
  765|   595k|    uint hashval;
  766|       |
  767|  3.46M|    for (hashval = 0; *s != '\0'; s++)
  ------------------
  |  Branch (767:23): [True: 2.86M, False: 595k]
  ------------------
  768|  2.86M|        hashval = *s + 31*hashval;
  769|       |
  770|   595k|    return hashval % ATTRIBUTE_HASH_SIZE;
  771|   595k|}
attrs.c:CheckAction:
 1722|    400|{
 1723|    400|    if (AttrHasValue(attval))
  ------------------
  |  |  171|    400|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 400, False: 0]
  |  |  |  Branch (171:44): [True: 200, False: 200]
  |  |  ------------------
  ------------------
 1724|    200|        TY_(CheckUrl)( doc, node, attval );
  ------------------
  |  |   23|    200|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    200|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1725|    400|}
attrs.c:CheckAlign:
 1926|  12.9k|{
 1927|  12.9k|    ctmbstr const values[] = {"left", "right", "center", "justify", NULL};
 1928|       |
 1929|       |    /* IMG, OBJECT, APPLET and EMBED use align for vertical position */
 1930|  12.9k|    if (node->tag && (node->tag->model & CM_IMG))
  ------------------
  |  |  155|  12.9k|#define CM_IMG          (1 << 16)  /**< Elements that use "align" attribute for vertical position. */
  ------------------
  |  Branch (1930:9): [True: 12.9k, False: 0]
  |  Branch (1930:22): [True: 859, False: 12.0k]
  ------------------
 1931|    859|    {
 1932|    859|        CheckValign( doc, node, attval );
 1933|    859|        return;
 1934|    859|    }
 1935|       |
 1936|  12.0k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  12.0k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 12.0k, False: 0]
  |  |  |  Branch (171:44): [True: 11.6k, False: 397]
  |  |  ------------------
  ------------------
 1937|    397|    {
 1938|    397|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    397|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    397|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1939|    397|        return;
 1940|    397|    }
 1941|       |
 1942|  11.6k|    CheckLowerCaseAttrValue( doc, node, attval);
 1943|       |
 1944|       |    /* currently CheckCaption(...) takes care of the remaining cases */
 1945|  11.6k|    if (nodeIsCAPTION(node))
  ------------------
  |  |  394|  11.6k|#define nodeIsCAPTION( node )    TagIsId( node, TidyTag_CAPTION )
  |  |  ------------------
  |  |  |  |  275|  11.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 11.6k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 9.71k, False: 1.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1946|  9.71k|        return;
 1947|       |
 1948|  1.95k|    if (!AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (1948:9): [True: 1.30k, False: 649]
  ------------------
 1949|  1.30k|    {
 1950|       |        /* align="char" is allowed for elements with CM_TABLE|CM_ROW
 1951|       |           except CAPTION which is excluded above, */
 1952|  1.30k|        if( !(AttrValueIs(attval, "char")
  ------------------
  |  |  172|  2.61k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  2.61k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 1.30k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 1.30k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  2.61k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  1.30k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.30k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 444, False: 865]
  |  |  ------------------
  ------------------
 1953|    444|              && TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)) )
  ------------------
  |  |   23|    444|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    444|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                            && TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)) )
  ------------------
  |  |  146|    444|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                            && TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)) )
  ------------------
  |  |  148|    444|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (1953:18): [True: 195, False: 249]
  ------------------
 1954|  1.11k|             TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  1.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1955|  1.30k|    }
 1956|  1.95k|}
attrs.c:CheckLowerCaseAttrValue:
 1530|  20.2k|{
 1531|  20.2k|    tmbstr p;
 1532|  20.2k|    Bool hasUpper = no;
 1533|       |    
 1534|  20.2k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  20.2k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 20.2k, False: 0]
  |  |  |  Branch (171:44): [True: 20.2k, False: 0]
  |  |  ------------------
  ------------------
 1535|      0|        return;
 1536|       |
 1537|  20.2k|    p = attval->value;
 1538|       |    
 1539|  77.0k|    while (*p)
  ------------------
  |  Branch (1539:12): [True: 70.4k, False: 6.61k]
  ------------------
 1540|  70.4k|    {
 1541|  70.4k|        if (TY_(IsUpper)(*p)) /* #501230 - fix by Terry Teague - 09 Jan 02 */
  ------------------
  |  |   23|  70.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  70.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1541:13): [True: 13.6k, False: 56.8k]
  ------------------
 1542|  13.6k|        {
 1543|  13.6k|            hasUpper = yes;
 1544|  13.6k|            break;
 1545|  13.6k|        }
 1546|  56.8k|        p++;
 1547|  56.8k|    }
 1548|       |
 1549|  20.2k|    if (hasUpper)
  ------------------
  |  Branch (1549:9): [True: 13.6k, False: 6.61k]
  ------------------
 1550|  13.6k|    {
 1551|  13.6k|        Lexer* lexer = doc->lexer;
 1552|  13.6k|        if (lexer->isvoyager)
  ------------------
  |  Branch (1552:13): [True: 1.20k, False: 12.4k]
  ------------------
 1553|  1.20k|            TY_(ReportAttrError)( doc, node, attval, ATTR_VALUE_NOT_LCASE);
  ------------------
  |  |   23|  1.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.20k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1554|       |  
 1555|  13.6k|        if ( lexer->isvoyager || cfgBool(doc, TidyLowerLiterals) )
  ------------------
  |  |  418|  12.4k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  12.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 12.4k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1555:14): [True: 1.20k, False: 12.4k]
  ------------------
 1556|  13.6k|            attval->value = TY_(tmbstrtolower)(attval->value);
  ------------------
  |  |   23|  13.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1557|  13.6k|    }
 1558|  20.2k|}
attrs.c:AttrValueIsAmong:
 1803|  16.9k|{
 1804|  16.9k|    const ctmbstr *v;   
 1805|  61.5k|    for (v = list; *v; ++v)
  ------------------
  |  Branch (1805:20): [True: 49.8k, False: 11.7k]
  ------------------
 1806|  49.8k|        if (AttrValueIs(attval, *v))
  ------------------
  |  |  172|  49.8k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  99.7k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 49.8k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 49.8k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  49.8k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  49.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  49.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 5.18k, False: 44.6k]
  |  |  ------------------
  ------------------
 1807|  5.18k|            return yes;
 1808|  11.7k|    return no;
 1809|  16.9k|}
attrs.c:CheckColor:
 2139|  4.82k|{
 2140|  4.82k|    Bool valid = no;
 2141|  4.82k|    tmbstr given;
 2142|       |
 2143|  4.82k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  4.82k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 4.82k, False: 0]
  |  |  |  Branch (171:44): [True: 4.61k, False: 208]
  |  |  ------------------
  ------------------
 2144|    208|    {
 2145|    208|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    208|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    208|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2146|    208|        return;
 2147|    208|    }
 2148|       |
 2149|  4.61k|    given = attval->value;
 2150|       |
 2151|       |    /* 727851 - add hash to hash-less color values */
 2152|  4.61k|    if (given[0] != '#' && (valid = IsValidColorCode(given)))
  ------------------
  |  Branch (2152:9): [True: 3.87k, False: 737]
  |  Branch (2152:28): [True: 847, False: 3.02k]
  ------------------
 2153|    847|    {
 2154|    847|        tmbstr cp, s;
 2155|       |
 2156|    847|        cp = s = (tmbstr) TidyDocAlloc(doc, 2 + TY_(tmbstrlen)(given));
  ------------------
  |  |  157|    847|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|    847|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 2157|    847|        *cp++ = '#';
 2158|  5.92k|        while ('\0' != (*cp++ = *given++))
  ------------------
  |  Branch (2158:16): [True: 5.08k, False: 847]
  ------------------
 2159|  5.08k|            continue;
 2160|       |
 2161|    847|        TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE_REPLACED);
  ------------------
  |  |   23|    847|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    847|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2162|       |
 2163|    847|        TidyDocFree(doc, attval->value);
  ------------------
  |  |  159|    847|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|    847|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2164|    847|        given = attval->value = s;
 2165|    847|    }
 2166|       |
 2167|  4.61k|    if (!valid && given[0] == '#')
  ------------------
  |  Branch (2167:9): [True: 3.76k, False: 847]
  |  Branch (2167:19): [True: 737, False: 3.02k]
  ------------------
 2168|    737|        valid = IsValidColorCode(given + 1);
 2169|       |
 2170|  4.61k|    if (valid && given[0] == '#' && cfgBool(doc, TidyReplaceColor))
  ------------------
  |  |  418|  1.18k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.18k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 1.18k]
  |  |  ------------------
  ------------------
  |  Branch (2170:9): [True: 1.18k, False: 3.43k]
  |  Branch (2170:18): [True: 1.18k, False: 0]
  ------------------
 2171|      0|    {
 2172|      0|        ctmbstr newName = GetColorName(given, TY_(IsHTML5Mode)(doc));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2173|       |
 2174|      0|        if (newName)
  ------------------
  |  Branch (2174:13): [True: 0, False: 0]
  ------------------
 2175|      0|        {
 2176|      0|            TidyDocFree(doc, attval->value);
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2177|      0|            given = attval->value = TY_(tmbstrdup)(doc->allocator, newName);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2178|      0|        }
 2179|      0|    }
 2180|       |
 2181|       |    /* if it is not a valid color code, it is a color name */
 2182|  4.61k|    if (!valid)
  ------------------
  |  Branch (2182:9): [True: 3.43k, False: 1.18k]
  ------------------
 2183|  3.43k|        valid = GetColorCode(given, TY_(IsHTML5Mode)(doc)) != NULL;
  ------------------
  |  |   23|  3.43k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.43k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2184|       |
 2185|  4.61k|    if (valid && given[0] == '#')
  ------------------
  |  Branch (2185:9): [True: 1.92k, False: 2.68k]
  |  Branch (2185:18): [True: 1.18k, False: 744]
  ------------------
 2186|  1.18k|        attval->value = TY_(tmbstrtoupper)(attval->value);
  ------------------
  |  |   23|  1.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2187|  3.43k|    else if (valid)
  ------------------
  |  Branch (2187:14): [True: 744, False: 2.68k]
  ------------------
 2188|    744|        attval->value = TY_(tmbstrtolower)(attval->value);
  ------------------
  |  |   23|    744|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    744|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2189|       |
 2190|  4.61k|    if (!valid)
  ------------------
  |  Branch (2190:9): [True: 2.68k, False: 1.92k]
  ------------------
 2191|  2.68k|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  2.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2192|  4.61k|}
attrs.c:IsValidColorCode:
 2123|  4.61k|{
 2124|  4.61k|    uint i;
 2125|       |
 2126|  4.61k|    if (TY_(tmbstrlen)(color) != 6)
  ------------------
  |  |   23|  4.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2126:9): [True: 2.46k, False: 2.14k]
  ------------------
 2127|  2.46k|        return no;
 2128|       |
 2129|       |    /* check if valid hex digits and letters */
 2130|  11.9k|    for (i = 0; i < 6; i++)
  ------------------
  |  Branch (2130:17): [True: 10.8k, False: 1.18k]
  ------------------
 2131|  10.8k|        if (!TY_(IsDigit)(color[i]) && !strchr("abcdef", TY_(ToLower)(color[i])))
  ------------------
  |  |   23|  10.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if (!TY_(IsDigit)(color[i]) && !strchr("abcdef", TY_(ToLower)(color[i])))
  ------------------
  |  |   23|  10.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2131:13): [True: 10.0k, False: 792]
  |  Branch (2131:40): [True: 967, False: 9.04k]
  ------------------
 2132|    967|            return no;
 2133|       |
 2134|  1.18k|    return yes;
 2135|  2.14k|}
attrs.c:GetColorCode:
  732|  3.43k|{
  733|  3.43k|    uint i;
  734|       |
  735|  51.5k|    for (i = 0; colors[i].name; ++i)
  ------------------
  |  Branch (735:17): [True: 48.5k, False: 2.94k]
  ------------------
  736|  48.5k|        if (TY_(tmbstrcasecmp)(name, colors[i].name) == 0)
  ------------------
  |  |   23|  48.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  48.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (736:13): [True: 487, False: 48.1k]
  ------------------
  737|    487|            return colors[i].hex;
  738|       |
  739|  2.94k|    if (use_css_colors)
  ------------------
  |  Branch (739:9): [True: 2.73k, False: 209]
  ------------------
  740|   357k|        for (i = 0; extended_colors[i].name; ++i)
  ------------------
  |  Branch (740:21): [True: 354k, False: 2.48k]
  ------------------
  741|   354k|            if (TY_(tmbstrcasecmp)(name, extended_colors[i].name) == 0)
  ------------------
  |  |   23|   354k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   354k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (741:17): [True: 257, False: 354k]
  ------------------
  742|    257|                return extended_colors[i].hex;
  743|       |
  744|  2.68k|    return NULL;
  745|  2.94k|}
attrs.c:CheckNumber:
 2087|  4.98k|{
 2088|  4.98k|    tmbstr p;
 2089|       |    
 2090|  4.98k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  4.98k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 4.98k, False: 0]
  |  |  |  Branch (171:44): [True: 4.76k, False: 219]
  |  |  ------------------
  ------------------
 2091|    219|    {
 2092|    219|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    219|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    219|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2093|    219|        return;
 2094|    219|    }
 2095|       |
 2096|       |    /* don't check <frameset cols=... rows=...> */
 2097|  4.76k|    if ( nodeIsFRAMESET(node) &&
  ------------------
  |  |  376|  4.76k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  9.53k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.76k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.76k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.24k, False: 2.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2098|  2.24k|        (attrIsCOLS(attval) || attrIsROWS(attval)))
  ------------------
  |  |  213|  2.24k|#define attrIsCOLS(av)              AttrIsId( av, TidyAttr_COLS  )
  |  |  ------------------
  |  |  |  |  169|  4.48k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.24k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.24k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 2.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (attrIsCOLS(attval) || attrIsROWS(attval)))
  ------------------
  |  |  306|  2.24k|#define attrIsROWS(av)              AttrIsId( av, TidyAttr_ROWS  )
  |  |  ------------------
  |  |  |  |  169|  2.24k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.24k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.24k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 194, False: 2.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2099|    194|     return;
 2100|       |
 2101|  4.57k|    p  = attval->value;
 2102|       |    
 2103|       |    /* font size may be preceded by + or - */
 2104|  4.57k|    if ( nodeIsFONT(node) && (*p == '+' || *p == '-') )
  ------------------
  |  |  417|  4.57k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  9.14k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.57k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.57k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.04k, False: 3.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2104:31): [True: 253, False: 794]
  |  Branch (2104:44): [True: 285, False: 509]
  ------------------
 2105|    538|        ++p;
 2106|       |    /* tabindex may be preceded by - */
 2107|  4.57k|    if (attval->attribute && (strcmp(attval->attribute,"tabindex") == 0) && (*p == '-'))
  ------------------
  |  Branch (2107:9): [True: 4.57k, False: 0]
  |  Branch (2107:30): [True: 402, False: 4.17k]
  |  Branch (2107:77): [True: 201, False: 201]
  ------------------
 2108|    201|        ++p;
 2109|       |
 2110|  8.46k|    while (*p)
  ------------------
  |  Branch (2110:12): [True: 7.21k, False: 1.24k]
  ------------------
 2111|  7.21k|    {
 2112|  7.21k|        if (!TY_(IsDigit)(*p))
  ------------------
  |  |   23|  7.21k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.21k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2112:13): [True: 3.32k, False: 3.89k]
  ------------------
 2113|  3.32k|        {
 2114|  3.32k|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  3.32k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.32k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2115|  3.32k|            break;
 2116|  3.32k|        }
 2117|  3.89k|        ++p;
 2118|  3.89k|    }
 2119|  4.57k|}
attrs.c:CheckLength:
 1992|  2.77k|{
 1993|  2.77k|    tmbstr p;
 1994|       |    
 1995|  2.77k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  2.77k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 2.77k, False: 0]
  |  |  |  Branch (171:44): [True: 2.52k, False: 243]
  |  |  ------------------
  ------------------
 1996|    243|    {
 1997|    243|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    243|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    243|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1998|    243|        return;
 1999|    243|    }
 2000|       |
 2001|       |    /* don't check for <col width=...> and <colgroup width=...> */
 2002|  2.52k|    if (attrIsWIDTH(attval) && (nodeIsCOL(node) || nodeIsCOLGROUP(node)))
  ------------------
  |  |  338|  2.52k|#define attrIsWIDTH(av)             AttrIsId( av, TidyAttr_WIDTH  )
  |  |  ------------------
  |  |  |  |  169|  5.05k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.52k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.52k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 1.75k, False: 770]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (attrIsWIDTH(attval) && (nodeIsCOL(node) || nodeIsCOLGROUP(node)))
  ------------------
  |  |  398|  1.75k|#define nodeIsCOL( node )        TagIsId( node, TidyTag_COL )
  |  |  ------------------
  |  |  |  |  275|  3.51k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.75k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.75k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 200, False: 1.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (attrIsWIDTH(attval) && (nodeIsCOL(node) || nodeIsCOLGROUP(node)))
  ------------------
  |  |  399|  1.55k|#define nodeIsCOLGROUP( node )   TagIsId( node, TidyTag_COLGROUP )
  |  |  ------------------
  |  |  |  |  275|  1.55k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.55k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.55k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 211, False: 1.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2003|    411|        return;
 2004|       |
 2005|  2.11k|    p = attval->value;
 2006|       |    
 2007|  2.11k|    if (!TY_(IsDigit)(*p++))
  ------------------
  |  |   23|  2.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2007:9): [True: 688, False: 1.42k]
  ------------------
 2008|    688|    {
 2009|    688|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    688|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    688|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2010|    688|    }
 2011|  1.42k|    else
 2012|  1.42k|    {
 2013|  1.42k|        Bool percentFound = no;
 2014|  2.85k|        while (*p)
  ------------------
  |  Branch (2014:16): [True: 1.83k, False: 1.01k]
  ------------------
 2015|  1.83k|        {
 2016|  1.83k|            if (!percentFound && *p == '%')
  ------------------
  |  Branch (2016:17): [True: 1.62k, False: 218]
  |  Branch (2016:34): [True: 218, False: 1.40k]
  ------------------
 2017|    218|            {
 2018|    218|                percentFound = yes;
 2019|    218|            }
 2020|  1.62k|            else if (percentFound || !TY_(IsDigit)(*p))
  ------------------
  |  |   23|  1.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2020:22): [True: 218, False: 1.40k]
  |  Branch (2020:38): [True: 199, False: 1.20k]
  ------------------
 2021|    417|            {
 2022|    417|                TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    417|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    417|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2023|    417|                break;
 2024|    417|            }
 2025|       |
 2026|  1.42k|            ++p;
 2027|  1.42k|        }
 2028|  1.42k|    }
 2029|  2.11k|}
attrs.c:CheckClear:
 2057|  1.28k|{
 2058|  1.28k|    ctmbstr const values[] = {"none", "left", "right", "all", NULL};
 2059|       |
 2060|  1.28k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.28k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.28k, False: 0]
  |  |  |  Branch (171:44): [True: 1.08k, False: 204]
  |  |  ------------------
  ------------------
 2061|    204|    {
 2062|    204|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    204|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    204|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2063|    204|        if (attval->value == NULL)
  ------------------
  |  Branch (2063:13): [True: 204, False: 0]
  ------------------
 2064|    204|            attval->value = TY_(tmbstrdup)( doc->allocator, "none" );
  ------------------
  |  |   23|    204|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    204|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2065|    204|        return;
 2066|    204|    }
 2067|       |
 2068|  1.08k|    CheckLowerCaseAttrValue( doc, node, attval );
 2069|       |        
 2070|  1.08k|    if (!AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2070:9): [True: 850, False: 233]
  ------------------
 2071|    850|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    850|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    850|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2072|  1.08k|}
attrs.c:CheckTextDir:
 2210|  1.66k|{
 2211|  1.66k|    ctmbstr const values4[] = { "rtl", "ltr", NULL };
 2212|       |    /* PR #712 - add 'auto' for HTML5 - @doronbehar */
 2213|  1.66k|    ctmbstr const values5[] = { "rtl", "ltr", "auto", NULL };
 2214|  1.66k|    CheckAttrValidity(doc, node, attval,
 2215|  1.66k|        (TY_(IsHTML5Mode)(doc) ? values5 : values4));
  ------------------
  |  |   23|  1.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2215:10): [True: 1.30k, False: 353]
  ------------------
 2216|  1.66k|}
attrs.c:CheckAttrValidity:
 1813|  4.38k|{
 1814|  4.38k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  4.38k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 4.38k, False: 0]
  |  |  |  Branch (171:44): [True: 2.06k, False: 2.32k]
  |  |  ------------------
  ------------------
 1815|  2.32k|    {
 1816|  2.32k|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  2.32k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.32k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1817|  2.32k|        return;
 1818|  2.32k|    }
 1819|       |
 1820|  2.06k|    CheckLowerCaseAttrValue( doc, node, attval );
 1821|       |
 1822|  2.06k|    if (!AttrValueIsAmong(attval, list))
  ------------------
  |  Branch (1822:9): [True: 1.50k, False: 554]
  ------------------
 1823|  1.50k|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  1.50k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.50k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1824|  2.06k|}
attrs.c:CheckLang:
 2220|  36.9k|{
 2221|       |    /* empty xml:lang is allowed through XML 1.0 SE errata */
 2222|  36.9k|    if (!AttrHasValue(attval) && !attrIsXML_LANG(attval))
  ------------------
  |  |  171|  73.8k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 36.9k, False: 0]
  |  |  |  Branch (171:44): [True: 326, False: 36.6k]
  |  |  ------------------
  ------------------
                  if (!AttrHasValue(attval) && !attrIsXML_LANG(attval))
  ------------------
  |  |  341|  36.6k|#define attrIsXML_LANG(av)          AttrIsId( av, TidyAttr_XML_LANG  )
  |  |  ------------------
  |  |  |  |  169|  36.6k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 36.6k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 36.6k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 35.7k, False: 893]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2223|    893|    {
 2224|    893|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|    893|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (2224:14): [True: 893, False: 0]
  ------------------
 2225|    893|        {
 2226|    893|            TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE );
  ------------------
  |  |   23|    893|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    893|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2227|    893|        }
 2228|    893|        return;
 2229|    893|    }
 2230|  36.9k|}
attrs.c:CheckId:
 1854|  70.7k|{
 1855|  70.7k|    Lexer* lexer = doc->lexer;
 1856|  70.7k|    Node *old;
 1857|       |
 1858|  70.7k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  70.7k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 70.7k, False: 0]
  |  |  |  Branch (171:44): [True: 67.7k, False: 2.94k]
  |  |  ------------------
  ------------------
 1859|  2.94k|    {
 1860|  2.94k|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  2.94k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.94k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1861|  2.94k|        return;
 1862|  2.94k|    }
 1863|       |
 1864|  67.7k|    if (!TY_(IsValidHTMLID)(attval->value))
  ------------------
  |  |   23|  67.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  67.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1864:9): [True: 54.2k, False: 13.5k]
  ------------------
 1865|  54.2k|    {
 1866|  54.2k|        if (lexer->isvoyager && TY_(IsValidXMLID)(attval->value))
  ------------------
  |  |   23|  35.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1866:13): [True: 35.7k, False: 18.4k]
  |  Branch (1866:33): [True: 0, False: 35.7k]
  ------------------
 1867|      0|            TY_(ReportAttrError)( doc, node, attval, XML_ID_SYNTAX);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1868|  54.2k|        else
 1869|  54.2k|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  54.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  54.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1870|  54.2k|    }
 1871|       |
 1872|  67.7k|    if ((old = GetNodeByAnchor(doc, attval->value)) &&  old != node)
  ------------------
  |  Branch (1872:9): [True: 29.3k, False: 38.4k]
  |  Branch (1872:57): [True: 29.3k, False: 7]
  ------------------
 1873|  29.3k|    {
 1874|  29.3k|        if (node->implicit) /* Is #709 - improve warning text */
  ------------------
  |  Branch (1874:13): [True: 28.2k, False: 1.07k]
  ------------------
 1875|  28.2k|            TY_(ReportAttrError)(doc, node, attval, ANCHOR_DUPLICATED);
  ------------------
  |  |   23|  28.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1876|  1.07k|        else
 1877|  1.07k|            TY_(ReportAttrError)( doc, node, attval, ANCHOR_NOT_UNIQUE);
  ------------------
  |  |   23|  1.07k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.07k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1878|  29.3k|    }
 1879|  38.4k|    else
 1880|  38.4k|        AddAnchor( doc, attval->value, node );
 1881|  67.7k|}
attrs.c:GetNodeByAnchor:
 1228|  72.8k|{
 1229|  72.8k|    TidyAttribImpl* attribs = &doc->attribs;
 1230|  72.8k|    Anchor *found;
 1231|  72.8k|    uint h;
 1232|  72.8k|    tmbstr lname = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|  72.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  72.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1233|  72.8k|    if (TY_(HTMLVersion)(doc) == HT50) {
  ------------------
  |  |   23|  72.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  72.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (TY_(HTMLVersion)(doc) == HT50) {
  ------------------
  |  |  200|  72.8k|#define HT50              131072u
  ------------------
  |  Branch (1233:9): [True: 0, False: 72.8k]
  ------------------
 1234|      0|        h = anchorNameHash5(name);
 1235|      0|    }
 1236|  72.8k|    else
 1237|  72.8k|    {
 1238|  72.8k|        h = anchorNameHash(name);
 1239|  72.8k|        lname = TY_(tmbstrtolower)(lname);
  ------------------
  |  |   23|  72.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  72.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1240|  72.8k|    }
 1241|       |
 1242|  17.9M|    for ( found = attribs->anchor_hash[h]; found != NULL; found = found->next )
  ------------------
  |  Branch (1242:44): [True: 17.8M, False: 39.1k]
  ------------------
 1243|  17.8M|    {
 1244|  17.8M|        if ( TY_(tmbstrcmp)(found->name, lname) == 0 )
  ------------------
  |  |   23|  17.8M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.8M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1244:14): [True: 33.6k, False: 17.8M]
  ------------------
 1245|  33.6k|            break;
 1246|  17.8M|    }
 1247|       |    
 1248|  72.8k|    TidyDocFree(doc, lname);
  ------------------
  |  |  159|  72.8k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  72.8k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1249|  72.8k|    if ( found )
  ------------------
  |  Branch (1249:10): [True: 33.6k, False: 39.1k]
  ------------------
 1250|  33.6k|        return found->node;
 1251|  39.1k|    return NULL;
 1252|  72.8k|}
attrs.c:AddAnchor:
 1200|  39.1k|{
 1201|  39.1k|    TidyAttribImpl* attribs = &doc->attribs;
 1202|  39.1k|    Anchor *a = NewAnchor( doc, name, node );
 1203|  39.1k|    uint h;
 1204|  39.1k|    if (TY_(HTMLVersion)(doc) == HT50)
  ------------------
  |  |   23|  39.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (TY_(HTMLVersion)(doc) == HT50)
  ------------------
  |  |  200|  39.1k|#define HT50              131072u
  ------------------
  |  Branch (1204:9): [True: 0, False: 39.1k]
  ------------------
 1205|      0|        h = anchorNameHash5(name);
 1206|  39.1k|    else
 1207|  39.1k|        h = anchorNameHash(name);
 1208|       |
 1209|  39.1k|    if ( attribs->anchor_hash[h] == NULL)
  ------------------
  |  Branch (1209:10): [True: 2.46k, False: 36.7k]
  ------------------
 1210|  2.46k|         attribs->anchor_hash[h] = a;
 1211|  36.7k|    else
 1212|  36.7k|    {
 1213|  36.7k|        Anchor *here =  attribs->anchor_hash[h];
 1214|  17.8M|        while (here->next)
  ------------------
  |  Branch (1214:16): [True: 17.7M, False: 36.7k]
  ------------------
 1215|  17.7M|            here = here->next;
 1216|  36.7k|        here->next = a;
 1217|  36.7k|    }
 1218|       |
 1219|  39.1k|    return attribs->anchor_hash[h];
 1220|  39.1k|}
attrs.c:NewAnchor:
 1182|  39.1k|{
 1183|  39.1k|    Anchor *a = (Anchor*) TidyDocAlloc( doc, sizeof(Anchor) );
  ------------------
  |  |  157|  39.1k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  39.1k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 1184|       |
 1185|  39.1k|    a->name = TY_(tmbstrdup)( doc->allocator, name );
  ------------------
  |  |   23|  39.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1186|  39.1k|    if (!TY_(IsHTML5Mode)(doc)) /* Is. #726 - if NOT HTML5, to lowercase */
  ------------------
  |  |   23|  39.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1186:9): [True: 259, False: 38.9k]
  ------------------
 1187|    259|        a->name = TY_(tmbstrtolower)(a->name);
  ------------------
  |  |   23|    259|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    259|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1188|  39.1k|    a->node = node;
 1189|  39.1k|    a->next = NULL;
 1190|       |
 1191|  39.1k|    return a;
 1192|  39.1k|}
attrs.c:CheckIs:
 1884|    843|{
 1885|    843|    const char *ptr;
 1886|    843|    Bool go = yes;
 1887|       |
 1888|       |    /* `is` MUST NOT be in an autonomous custom tag */
 1889|    843|    ptr = strchr(node->element, '-');
 1890|    843|    if ( ( ptr && (ptr - node->element > 0) ) )
  ------------------
  |  Branch (1890:12): [True: 0, False: 843]
  |  Branch (1890:19): [True: 0, False: 0]
  ------------------
 1891|      0|    {
 1892|      0|        TY_(ReportAttrError)( doc, node, attval, ATTRIBUTE_IS_NOT_ALLOWED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1893|      0|    }
 1894|       |
 1895|       |    /* Even if we fail the above test, we'll continue to emit reports because
 1896|       |       the user should *also* know that his attribute values are wrong, even
 1897|       |       if they shouldn't be in custom tags anyway. */
 1898|       |
 1899|       |    /* `is` MUST have a value */
 1900|    843|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|    843|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 843, False: 0]
  |  |  |  Branch (171:44): [True: 625, False: 218]
  |  |  ------------------
  ------------------
 1901|    218|    {
 1902|    218|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    218|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    218|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1903|    218|        return;
 1904|    218|    }
 1905|       |
 1906|       |    /* `is` MUST contain a hyphen and no space. */
 1907|    625|    ptr = strchr(attval->value, '-');
 1908|    625|    go = ( ptr && (ptr - attval->value > 0) );
  ------------------
  |  Branch (1908:12): [True: 200, False: 425]
  |  Branch (1908:19): [True: 199, False: 1]
  ------------------
 1909|    625|    ptr = strchr(attval->value, ' ');
 1910|    625|    go = go & (ptr == NULL);
 1911|    625|    if ( !go )
  ------------------
  |  Branch (1911:10): [True: 426, False: 199]
  ------------------
 1912|    426|    {
 1913|    426|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    426|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    426|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1914|    426|    }
 1915|    625|}
attrs.c:CheckFsubmit:
 2051|    432|{
 2052|       |    ctmbstr const values[] = {"get", "post", NULL};
 2053|    432|    CheckAttrValidity( doc, node, attval, values );
 2054|    432|}
attrs.c:CheckName:
 1827|  6.00k|{
 1828|  6.00k|    Node *old;
 1829|       |
 1830|  6.00k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  6.00k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 6.00k, False: 0]
  |  |  |  Branch (171:44): [True: 5.29k, False: 715]
  |  |  ------------------
  ------------------
 1831|    715|    {
 1832|    715|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    715|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    715|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1833|    715|        return;
 1834|    715|    }
 1835|       |
 1836|  5.29k|    if ( TY_(IsAnchorElement)(doc, node) )
  ------------------
  |  |   23|  5.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1836:10): [True: 5.06k, False: 233]
  ------------------
 1837|  5.06k|    {
 1838|  5.06k|        if (cfgBool(doc, TidyXmlOut) && !IsValidNMTOKEN(attval->value))
  ------------------
  |  |  418|  10.1k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.06k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 5.06k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1838:41): [True: 3.40k, False: 1.65k]
  ------------------
 1839|  3.40k|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  3.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1840|       |
 1841|  5.06k|        if ((old = GetNodeByAnchor(doc, attval->value)) &&  old != node)
  ------------------
  |  Branch (1841:13): [True: 4.31k, False: 743]
  |  Branch (1841:61): [True: 4.31k, False: 1]
  ------------------
 1842|  4.31k|        {
 1843|  4.31k|            if (node->implicit) /* Is #709 - improve warning text */
  ------------------
  |  Branch (1843:17): [True: 2.58k, False: 1.73k]
  ------------------
 1844|  2.58k|                TY_(ReportAttrError)(doc, node, attval, ANCHOR_DUPLICATED);
  ------------------
  |  |   23|  2.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1845|  1.73k|            else
 1846|  1.73k|                TY_(ReportAttrError)( doc, node, attval, ANCHOR_NOT_UNIQUE);
  ------------------
  |  |   23|  1.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1847|  4.31k|        }
 1848|    744|        else
 1849|    744|            AddAnchor( doc, attval->value, node );
 1850|  5.06k|    }
 1851|  5.29k|}
attrs.c:IsValidNMTOKEN:
 1779|  5.06k|{
 1780|  5.06k|    ctmbstr s = name;
 1781|  5.06k|    tchar c;
 1782|       |
 1783|  5.06k|    if (!s)
  ------------------
  |  Branch (1783:9): [True: 0, False: 5.06k]
  ------------------
 1784|      0|        return no;
 1785|       |
 1786|  25.7k|    while (*s)
  ------------------
  |  Branch (1786:12): [True: 24.0k, False: 1.65k]
  ------------------
 1787|  24.0k|    {
 1788|  24.0k|        c = (unsigned char)*s;
 1789|       |
 1790|  24.0k|        if (c > 0x7F)
  ------------------
  |  Branch (1790:13): [True: 17.8k, False: 6.21k]
  ------------------
 1791|  17.8k|            s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|  17.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1792|       |
 1793|  24.0k|        ++s;
 1794|       |
 1795|  24.0k|        if (!TY_(IsXMLNamechar)(c))
  ------------------
  |  |   23|  24.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1795:13): [True: 3.40k, False: 20.6k]
  ------------------
 1796|  3.40k|            return no;
 1797|  24.0k|    }
 1798|       |
 1799|  1.65k|    return yes;
 1800|  5.06k|}
attrs.c:CheckScope:
 2081|    201|{
 2082|       |    ctmbstr const values[] = {"row", "rowgroup", "col", "colgroup", NULL};
 2083|    201|    CheckAttrValidity( doc, node, attval, values );
 2084|    201|}
attrs.c:CheckScroll:
 2203|    360|{
 2204|       |    ctmbstr const values[] = {"no", "auto", "yes", NULL};
 2205|    360|    CheckAttrValidity( doc, node, attval, values );
 2206|    360|}
attrs.c:CheckShape:
 2075|    215|{
 2076|       |    ctmbstr const values[] = {"rect", "default", "circle", "poly", NULL};
 2077|    215|    CheckAttrValidity( doc, node, attval, values );
 2078|    215|}
attrs.c:CheckTarget:
 2032|  1.52k|{
 2033|  1.52k|    ctmbstr const values[] = {"_blank", "_self", "_parent", "_top", NULL};
 2034|       |
 2035|  1.52k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.52k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.52k, False: 0]
  |  |  |  Branch (171:44): [True: 1.12k, False: 402]
  |  |  ------------------
  ------------------
 2036|    402|    {
 2037|    402|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    402|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    402|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2038|    402|        return;
 2039|    402|    }
 2040|       |
 2041|       |    /* target names must begin with A-Za-z ... */
 2042|  1.12k|    if (TY_(IsLetter)(attval->value[0]))
  ------------------
  |  |   23|  1.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2042:9): [True: 225, False: 899]
  ------------------
 2043|    225|        return;
 2044|       |
 2045|       |    /* or be one of the allowed list */
 2046|    899|    if (!AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2046:9): [True: 618, False: 281]
  ------------------
 2047|    618|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    618|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    618|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2048|    899|}
attrs.c:CheckType:
 2241|  3.18k|{
 2242|  3.18k|    ctmbstr const valuesINPUT[] = {
 2243|  3.18k|        "text", "password", "checkbox", "radio", "submit", "reset", "file",
 2244|  3.18k|        "hidden", "image", "button", "color", "date", "datetime",
 2245|  3.18k|        "datetime-local", "email", "month", "number", "range", "search",
 2246|  3.18k|        "tel", "time", "url", "week", NULL};
 2247|  3.18k|    ctmbstr const valuesBUTTON[] = {"button", "submit", "reset", NULL};
 2248|  3.18k|    ctmbstr const valuesUL[] = {"disc", "square", "circle", NULL};
 2249|  3.18k|    ctmbstr const valuesOL[] = {"1", "a", "i", NULL};
 2250|       |
 2251|  3.18k|    if (nodeIsINPUT(node))
  ------------------
  |  |  431|  3.18k|#define nodeIsINPUT( node )      TagIsId( node, TidyTag_INPUT )
  |  |  ------------------
  |  |  |  |  275|  3.18k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.18k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.18k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 241, False: 2.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2252|    241|        CheckAttrValidity( doc, node, attval, valuesINPUT );
 2253|  2.94k|    else if (nodeIsBUTTON(node))
  ------------------
  |  |  453|  2.94k|#define nodeIsBUTTON( node )     TagIsId( node, TidyTag_BUTTON )
  |  |  ------------------
  |  |  |  |  275|  2.94k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.94k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.94k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 272, False: 2.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2254|    272|        CheckAttrValidity( doc, node, attval, valuesBUTTON );
 2255|  2.66k|    else if (nodeIsUL(node))
  ------------------
  |  |  386|  2.66k|#define nodeIsUL( node )         TagIsId( node, TidyTag_UL )
  |  |  ------------------
  |  |  |  |  275|  2.66k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.66k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.66k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 196, False: 2.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2256|    196|        CheckAttrValidity( doc, node, attval, valuesUL );
 2257|  2.47k|    else if (nodeIsOL(node))
  ------------------
  |  |  387|  2.47k|#define nodeIsOL( node )         TagIsId( node, TidyTag_OL )
  |  |  ------------------
  |  |  |  |  275|  2.47k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.47k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.47k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 755, False: 1.71k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2258|    755|    {
 2259|    755|        if (!AttrHasValue(attval))
  ------------------
  |  |  171|    755|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 755, False: 0]
  |  |  |  Branch (171:44): [True: 559, False: 196]
  |  |  ------------------
  ------------------
 2260|    196|        {
 2261|    196|            TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    196|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    196|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2262|    196|            return;
 2263|    196|        }
 2264|    559|        if (!AttrValueIsAmong(attval, valuesOL))
  ------------------
  |  Branch (2264:13): [True: 280, False: 279]
  ------------------
 2265|    280|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    280|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    280|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2266|    559|    }
 2267|  1.71k|    else if (nodeIsLI(node))
  ------------------
  |  |  390|  1.71k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|  1.71k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.71k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.71k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.26k, False: 454]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2268|  1.26k|    {
 2269|  1.26k|        if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.26k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.26k, False: 0]
  |  |  |  Branch (171:44): [True: 1.06k, False: 202]
  |  |  ------------------
  ------------------
 2270|    202|        {
 2271|    202|            TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    202|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    202|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2272|    202|            return;
 2273|    202|        }
 2274|  1.06k|        if (AttrValueIsAmong(attval, valuesUL))
  ------------------
  |  Branch (2274:13): [True: 499, False: 562]
  ------------------
 2275|    499|            CheckLowerCaseAttrValue( doc, node, attval );
 2276|    562|        else if (!AttrValueIsAmong(attval, valuesOL))
  ------------------
  |  Branch (2276:18): [True: 365, False: 197]
  ------------------
 2277|    365|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    365|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    365|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2278|  1.06k|    }
 2279|  2.78k|    return;
 2280|  3.18k|}
attrs.c:CheckValign:
 1959|  2.73k|{
 1960|  2.73k|    ctmbstr const values[] = {"top", "middle", "bottom", "baseline", NULL};
 1961|  2.73k|    ctmbstr const values2[] = {"left", "right", NULL};
 1962|  2.73k|    ctmbstr const valuesp[] = {"texttop", "absmiddle", "absbottom",
 1963|  2.73k|                               "textbottom", NULL};
 1964|       |
 1965|  2.73k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  2.73k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 2.73k, False: 0]
  |  |  |  Branch (171:44): [True: 2.44k, False: 284]
  |  |  ------------------
  ------------------
 1966|    284|    {
 1967|    284|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    284|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    284|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1968|    284|        return;
 1969|    284|    }
 1970|       |
 1971|  2.44k|    CheckLowerCaseAttrValue( doc, node, attval );
 1972|       |
 1973|  2.44k|    if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (1973:9): [True: 410, False: 2.03k]
  ------------------
 1974|    410|    {
 1975|       |            /* all is fine */
 1976|    410|    }
 1977|  2.03k|    else if (AttrValueIsAmong(attval, values2))
  ------------------
  |  Branch (1977:14): [True: 399, False: 1.63k]
  ------------------
 1978|    399|    {
 1979|    399|        if (!(node->tag && (node->tag->model & CM_IMG)))
  ------------------
  |  |  155|    399|#define CM_IMG          (1 << 16)  /**< Elements that use "align" attribute for vertical position. */
  ------------------
  |  Branch (1979:15): [True: 399, False: 0]
  |  Branch (1979:28): [True: 198, False: 201]
  ------------------
 1980|    201|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    201|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    201|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1981|    399|    }
 1982|  1.63k|    else if (AttrValueIsAmong(attval, valuesp))
  ------------------
  |  Branch (1982:14): [True: 413, False: 1.22k]
  ------------------
 1983|    413|    {
 1984|    413|        TY_(ConstrainVersion)( doc, VERS_PROPRIETARY );
  ------------------
  |  |   23|    413|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    413|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(ConstrainVersion)( doc, VERS_PROPRIETARY );
  ------------------
  |  |  231|    413|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|    413|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|    413|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|    413|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
 1985|    413|        TY_(ReportAttrError)( doc, node, attval, PROPRIETARY_ATTR_VALUE);
  ------------------
  |  |   23|    413|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    413|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1986|    413|    }
 1987|  1.22k|    else
 1988|  1.22k|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  1.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1989|  2.44k|}
attrs.c:CheckVType:
 2196|    600|{
 2197|       |    ctmbstr const values[] = {"data", "object", "ref", NULL};
 2198|    600|    CheckAttrValidity( doc, node, attval, values );
 2199|    600|}
attrs.c:CheckRDFaSafeCURIE:
 2761|    389|{
 2762|    389|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|    389|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 389, False: 0]
  |  |  |  Branch (171:44): [True: 195, False: 194]
  |  |  ------------------
  ------------------
 2763|    194|    {
 2764|    194|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2765|    194|        return;
 2766|    194|    }
 2767|       |
 2768|    389|}
attrs.c:CheckRDFaTerm:
 2747|    422|{
 2748|    422|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|    422|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 422, False: 0]
  |  |  |  Branch (171:44): [True: 218, False: 204]
  |  |  ------------------
  ------------------
 2749|    204|    {
 2750|    204|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    204|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    204|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2751|    204|        return;
 2752|    204|    }
 2753|       |
 2754|    422|}
attrs.c:CheckRDFaPrefix:
 2691|  1.46k|{
 2692|  1.46k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.46k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.46k, False: 0]
  |  |  |  Branch (171:44): [True: 1.25k, False: 207]
  |  |  ------------------
  ------------------
 2693|    207|    {
 2694|    207|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    207|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    207|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2695|    207|        return;
 2696|    207|    }
 2697|       |
 2698|       |    /* Copy the attribute value so we can split it */
 2699|  1.25k|    if (attval->value) {
  ------------------
  |  Branch (2699:9): [True: 1.25k, False: 0]
  ------------------
 2700|  1.25k|        tmbstr t, tPtr ;
 2701|       |
 2702|  1.25k|        uint prefixCount = 0;
 2703|       |        /* isPrefix toggles - start at 1 and change to 0 as we
 2704|       |         * iterate over the components of the value */
 2705|  1.25k|        uint isPrefix = 1;
 2706|       |
 2707|       |        /* Copy it over */
 2708|       |
 2709|  1.25k|        uint len = TY_(tmbstrlen)(attval->value);
  ------------------
  |  |   23|  1.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2710|  1.25k|        tmbstr s = (tmbstr) TidyDocAlloc( doc, len + 1 );
  ------------------
  |  |  157|  1.25k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  1.25k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 2711|  1.25k|        s[0] = '\0';
 2712|  1.25k|        TY_(tmbstrcpy)( s, attval->value );
  ------------------
  |  |   23|  1.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2713|       |
 2714|       |        /* iterate over value */
 2715|  1.25k|        tPtr = s;
 2716|       |
 2717|  64.8k|        while ( ( t = strtok(tPtr, " ") ) != NULL ) {
  ------------------
  |  Branch (2717:17): [True: 63.5k, False: 1.25k]
  ------------------
 2718|  63.5k|            tPtr = NULL;
 2719|  63.5k|            if (isPrefix) {
  ------------------
  |  Branch (2719:17): [True: 32.1k, False: 31.4k]
  ------------------
 2720|       |                /* this piece should be a prefix */
 2721|       |                /* prefix rules are that it can have any
 2722|       |                 * character except a colon - that one must be
 2723|       |                 * at the end */
 2724|  32.1k|                tmbstr i = strchr(t, ':') ;
 2725|  32.1k|                if (i == NULL) {
  ------------------
  |  Branch (2725:21): [True: 31.2k, False: 850]
  ------------------
 2726|       |                    /* no colon - bad! */
 2727|  31.2k|                    TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  31.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2728|  31.2k|                } else if (i != ( t + TY_(tmbstrlen)(t) - 1) ) {
  ------------------
  |  |   23|    850|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    850|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2728:28): [True: 194, False: 656]
  ------------------
 2729|       |                    /* not at the end - also bad */
 2730|    194|                    TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2731|    194|                }
 2732|  32.1k|            } else {
 2733|       |                /* this piece should be a URL */
 2734|  31.4k|                prefixCount ++;
 2735|  31.4k|            }
 2736|  63.5k|            isPrefix = !isPrefix;
 2737|  63.5k|        }
 2738|  1.25k|        TidyDocFree( doc, s ) ;
  ------------------
  |  |  159|  1.25k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  1.25k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2739|  1.25k|    }
 2740|  1.25k|}
attrs.c:CheckLoading:
 2234|    208|{
 2235|       |    ctmbstr const values[] = {"lazy", "eager", NULL};
 2236|    208|    CheckAttrValidity( doc, node, attval, values );
 2237|    208|}
attrs.c:CheckSvgAttr:
 2335|  5.13k|{
 2336|  5.13k|    if (!nodeIsSVG(node))
  ------------------
  |  |  460|  5.13k|#define nodeIsSVG( node )        TagIsId( node, TidyTag_SVG )
  |  |  ------------------
  |  |  |  |  275|  5.13k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.13k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.13k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.93k, False: 197]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2337|    197|    {
 2338|    197|        TY_(ReportAttrError)(doc, node, attval, ATTRIBUTE_IS_NOT_ALLOWED);
  ------------------
  |  |   23|    197|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    197|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2339|    197|        return;
 2340|    197|    }
 2341|       |
 2342|       |    /* Issue #903 - check SVG paint attributes */
 2343|  4.93k|    if (IsSvgPaintAttr(attval))
  ------------------
  |  Branch (2343:9): [True: 4.93k, False: 0]
  ------------------
 2344|  4.93k|    {
 2345|       |        /* all valid paint attributes have values */
 2346|  4.93k|        if (!AttrHasValue(attval))
  ------------------
  |  |  171|  4.93k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 4.93k, False: 0]
  |  |  |  Branch (171:44): [True: 4.69k, False: 235]
  |  |  ------------------
  ------------------
 2347|    235|        {
 2348|    235|            TY_(ReportAttrError)(doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    235|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    235|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2349|    235|            return;
 2350|    235|        }
 2351|       |        /* all paint attributes support an 'inherit' value,
 2352|       |        per https://dev.w3.org/SVG/profiles/1.1F2/publish/painting.html#SpecifyingPaint */
 2353|  4.69k|        if (AttrValueIs(attval, "inherit"))
  ------------------
  |  |  172|  4.69k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  9.39k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 4.69k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 4.69k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  4.69k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  4.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  4.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 4.69k]
  |  |  ------------------
  ------------------
 2354|      0|        {
 2355|      0|            return;
 2356|      0|        }
 2357|       |
 2358|       |        /* check paint datatypes
 2359|       |        see https://dev.w3.org/SVG/profiles/1.1F2/publish/painting.html#SpecifyingPaint
 2360|       |        */
 2361|  4.69k|        if (attrIsSVG_FILL(attval) || attrIsSVG_STROKE(attval))
  ------------------
  |  |  378|  4.69k|#define attrIsSVG_FILL(av)              AttrIsId( av,  TidyAttr_FILL  )
  |  |  ------------------
  |  |  |  |  169|  9.39k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.69k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.69k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 197, False: 4.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (attrIsSVG_FILL(attval) || attrIsSVG_STROKE(attval))
  ------------------
  |  |  380|  4.50k|#define attrIsSVG_STROKE(av)            AttrIsId( av,  TidyAttr_STROKE  )
  |  |  ------------------
  |  |  |  |  169|  4.50k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.50k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.50k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 404, False: 4.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2362|    601|        {
 2363|       |            /* TODO: support funciri */
 2364|    601|            static ctmbstr const values[] = {
 2365|    601|                "none", "currentColor", NULL};
 2366|       |
 2367|    601|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2367:17): [True: 322, False: 279]
  ------------------
 2368|    322|                CheckLowerCaseAttrValue(doc, node, attval);
 2369|    279|            else
 2370|    279|                CheckColor(doc, node, attval);
 2371|    601|        } 
 2372|  4.09k|        else if (attrIsSVG_FILLRULE(attval))
  ------------------
  |  |  379|  4.09k|#define attrIsSVG_FILLRULE(av)          AttrIsId( av,  TidyAttr_FILLRULE  )
  |  |  ------------------
  |  |  |  |  169|  4.09k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.09k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.09k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 409, False: 3.68k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2373|    409|        {
 2374|    409|            static ctmbstr const values[] = {"nonzero", "evenodd", NULL};
 2375|       |
 2376|    409|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2376:17): [True: 199, False: 210]
  ------------------
 2377|    199|                CheckLowerCaseAttrValue(doc, node, attval);
 2378|    210|            else
 2379|    210|                TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    210|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    210|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2380|    409|        }
 2381|  3.68k|        else if (attrIsSVG_STROKEDASHARRAY(attval))
  ------------------
  |  |  381|  3.68k|#define attrIsSVG_STROKEDASHARRAY(av)   AttrIsId( av,  TidyAttr_STROKEDASHARRAY  )
  |  |  ------------------
  |  |  |  |  169|  3.68k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.68k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.68k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 420, False: 3.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2382|    420|        {
 2383|    420|            static ctmbstr const values[] = {"none", NULL};
 2384|       |
 2385|    420|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2385:17): [True: 82, False: 338]
  ------------------
 2386|     82|                CheckLowerCaseAttrValue(doc, node, attval);
 2387|    338|            else
 2388|    338|            {
 2389|       |                /* TODO: process dash arrays */
 2390|    338|            }
 2391|    420|        }
 2392|  3.26k|        else if (attrIsSVG_STROKEDASHOFFSET(attval))
  ------------------
  |  |  382|  3.26k|#define attrIsSVG_STROKEDASHOFFSET(av)  AttrIsId( av,  TidyAttr_STROKEDASHOFFSET  )
  |  |  ------------------
  |  |  |  |  169|  3.26k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.26k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.26k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 198, False: 3.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2393|    198|        {
 2394|    198|            CheckLength(doc, node, attval);
 2395|    198|        }
 2396|  3.07k|        else if (attrIsSVG_STROKELINECAP(attval))
  ------------------
  |  |  383|  3.07k|#define attrIsSVG_STROKELINECAP(av)     AttrIsId( av,  TidyAttr_STROKELINECAP  )
  |  |  ------------------
  |  |  |  |  169|  3.07k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.07k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.07k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 548, False: 2.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2397|    548|        {
 2398|    548|            static ctmbstr const values[] = {"butt", "round", "square", NULL};
 2399|       |
 2400|    548|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2400:17): [True: 289, False: 259]
  ------------------
 2401|    289|                CheckLowerCaseAttrValue(doc, node, attval);
 2402|    259|            else
 2403|    259|                TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    259|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    259|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2404|    548|        }
 2405|  2.52k|        else if (attrIsSVG_STROKELINEJOIN(attval))
  ------------------
  |  |  384|  2.52k|#define attrIsSVG_STROKELINEJOIN(av)    AttrIsId( av,  TidyAttr_STROKELINEJOIN  )
  |  |  ------------------
  |  |  |  |  169|  2.52k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.52k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.52k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 624, False: 1.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2406|    624|        {
 2407|    624|            static ctmbstr const values[] = {"miter", "round", "bevel", NULL};
 2408|       |
 2409|    624|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2409:17): [True: 382, False: 242]
  ------------------
 2410|    382|                CheckLowerCaseAttrValue(doc, node, attval);
 2411|    242|            else
 2412|    242|                TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    242|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    242|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2413|    624|        }
 2414|  1.89k|        else if (attrIsSVG_STROKEMITERLIMIT(attval))
  ------------------
  |  |  385|  1.89k|#define attrIsSVG_STROKEMITERLIMIT(av)  AttrIsId( av,  TidyAttr_STROKEMITERLIMIT  )
  |  |  ------------------
  |  |  |  |  169|  1.89k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.89k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.89k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 419, False: 1.47k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2415|    419|        {
 2416|    419|            CheckNumber(doc, node, attval);
 2417|    419|        }
 2418|  1.47k|        else if (attrIsSVG_STROKEWIDTH(attval))
  ------------------
  |  |  386|  1.47k|#define attrIsSVG_STROKEWIDTH(av)       AttrIsId( av,  TidyAttr_STROKEWIDTH  )
  |  |  ------------------
  |  |  |  |  169|  1.47k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.47k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.47k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 79, False: 1.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2419|     79|        {
 2420|     79|            CheckLength(doc, node, attval);
 2421|     79|        }
 2422|  1.40k|        else if (attrIsSVG_COLORINTERPOLATION(attval))
  ------------------
  |  |  387|  1.40k|#define attrIsSVG_COLORINTERPOLATION(a) AttrIsId(  a,  TidyAttr_COLORINTERPOLATION  )
  |  |  ------------------
  |  |  |  |  169|  1.40k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.40k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.40k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2423|      0|        {
 2424|      0|            static ctmbstr const values[] = {"auto", "sRGB", "linearRGB", NULL};
 2425|       |
 2426|      0|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2426:17): [True: 0, False: 0]
  ------------------
 2427|      0|                CheckLowerCaseAttrValue(doc, node, attval);
 2428|      0|            else
 2429|      0|                TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2430|      0|        }
 2431|  1.40k|        else if (attrIsSVG_COLORRENDERING(attval))
  ------------------
  |  |  388|  1.40k|#define attrIsSVG_COLORRENDERING(av)    AttrIsId( av,  TidyAttr_COLORRENDERING  )
  |  |  ------------------
  |  |  |  |  169|  1.40k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.40k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.40k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2432|      0|        {
 2433|      0|            static ctmbstr const values[] = {
 2434|      0|                "auto", "optimizeSpeed", "optimizeQuality", NULL};
 2435|       |
 2436|      0|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2436:17): [True: 0, False: 0]
  ------------------
 2437|      0|                CheckLowerCaseAttrValue(doc, node, attval);
 2438|      0|            else
 2439|      0|                TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2440|      0|        }
 2441|  1.40k|        else if(attrIsSVG_OPACITY(attval))
  ------------------
  |  |  389|  1.40k|#define attrIsSVG_OPACITY(av)           AttrIsId( av,  TidyAttr_OPACITY  )
  |  |  ------------------
  |  |  |  |  169|  1.40k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.40k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.40k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 801, False: 599]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2442|    801|        {
 2443|    801|            CheckDecimal(doc, node, attval);
 2444|    801|        }
 2445|    599|        else if(attrIsSVG_STROKEOPACITY(attval))
  ------------------
  |  |  390|    599|#define attrIsSVG_STROKEOPACITY(av)     AttrIsId( av,  TidyAttr_STROKEOPACITY  )
  |  |  ------------------
  |  |  |  |  169|    599|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 599, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 599, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 290, False: 309]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2446|    290|        {
 2447|    290|            CheckDecimal(doc, node, attval);
 2448|    290|        }
 2449|    309|        else if(attrIsSVG_FILLOPACITY(attval))
  ------------------
  |  |  391|    309|#define attrIsSVG_FILLOPACITY(av)       AttrIsId( av,  TidyAttr_FILLOPACITY  )
  |  |  ------------------
  |  |  |  |  169|    309|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 309, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 309, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 309, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2450|    309|        {
 2451|    309|            CheckDecimal(doc, node, attval);
 2452|    309|        }
 2453|  4.69k|    }
 2454|  4.93k|}
attrs.c:IsSvgPaintAttr:
 2315|  4.93k|{
 2316|  4.93k|    return attrIsCOLOR(attval)
  ------------------
  |  |  212|  4.93k|#define attrIsCOLOR(av)             AttrIsId( av, TidyAttr_COLOR  )
  |  |  ------------------
  |  |  |  |  169|  9.86k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.93k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.93k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 4.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2317|  4.93k|        || attrIsSVG_FILL(attval)
  ------------------
  |  |  378|  4.93k|#define attrIsSVG_FILL(av)              AttrIsId( av,  TidyAttr_FILL  )
  |  |  ------------------
  |  |  |  |  169|  9.86k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.93k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.93k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 400, False: 4.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2318|  4.93k|        || attrIsSVG_FILLRULE(attval)
  ------------------
  |  |  379|  4.53k|#define attrIsSVG_FILLRULE(av)          AttrIsId( av,  TidyAttr_FILLRULE  )
  |  |  ------------------
  |  |  |  |  169|  9.46k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.53k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.53k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 410, False: 4.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2319|  4.93k|        || attrIsSVG_STROKE(attval)
  ------------------
  |  |  380|  4.12k|#define attrIsSVG_STROKE(av)            AttrIsId( av,  TidyAttr_STROKE  )
  |  |  ------------------
  |  |  |  |  169|  9.05k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.12k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.12k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 414, False: 3.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2320|  4.93k|        || attrIsSVG_STROKEDASHARRAY(attval)
  ------------------
  |  |  381|  3.70k|#define attrIsSVG_STROKEDASHARRAY(av)   AttrIsId( av,  TidyAttr_STROKEDASHARRAY  )
  |  |  ------------------
  |  |  |  |  169|  8.64k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.70k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.70k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 420, False: 3.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2321|  4.93k|        || attrIsSVG_STROKEDASHOFFSET(attval)
  ------------------
  |  |  382|  3.28k|#define attrIsSVG_STROKEDASHOFFSET(av)  AttrIsId( av,  TidyAttr_STROKEDASHOFFSET  )
  |  |  ------------------
  |  |  |  |  169|  8.22k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.28k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.28k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 199, False: 3.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2322|  4.93k|        || attrIsSVG_STROKELINECAP(attval)
  ------------------
  |  |  383|  3.09k|#define attrIsSVG_STROKELINECAP(av)     AttrIsId( av,  TidyAttr_STROKELINECAP  )
  |  |  ------------------
  |  |  |  |  169|  8.02k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.09k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.09k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 552, False: 2.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2323|  4.93k|        || attrIsSVG_STROKELINEJOIN(attval)
  ------------------
  |  |  384|  2.53k|#define attrIsSVG_STROKELINEJOIN(av)    AttrIsId( av,  TidyAttr_STROKELINEJOIN  )
  |  |  ------------------
  |  |  |  |  169|  7.47k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.53k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.53k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 625, False: 1.91k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2324|  4.93k|        || attrIsSVG_STROKEMITERLIMIT(attval)
  ------------------
  |  |  385|  1.91k|#define attrIsSVG_STROKEMITERLIMIT(av)  AttrIsId( av,  TidyAttr_STROKEMITERLIMIT  )
  |  |  ------------------
  |  |  |  |  169|  6.84k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.91k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.91k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 419, False: 1.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2325|  4.93k|        || attrIsSVG_STROKEWIDTH(attval)
  ------------------
  |  |  386|  1.49k|#define attrIsSVG_STROKEWIDTH(av)       AttrIsId( av,  TidyAttr_STROKEWIDTH  )
  |  |  ------------------
  |  |  |  |  169|  6.42k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.49k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.49k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 79, False: 1.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2326|  4.93k|        || attrIsSVG_COLORINTERPOLATION(attval)
  ------------------
  |  |  387|  1.41k|#define attrIsSVG_COLORINTERPOLATION(a) AttrIsId(  a,  TidyAttr_COLORINTERPOLATION  )
  |  |  ------------------
  |  |  |  |  169|  6.34k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.41k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.41k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2327|  4.93k|        || attrIsSVG_COLORRENDERING(attval)
  ------------------
  |  |  388|  1.41k|#define attrIsSVG_COLORRENDERING(av)    AttrIsId( av,  TidyAttr_COLORRENDERING  )
  |  |  ------------------
  |  |  |  |  169|  6.34k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.41k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.41k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2328|  4.93k|        || attrIsSVG_OPACITY(attval)
  ------------------
  |  |  389|  1.41k|#define attrIsSVG_OPACITY(av)           AttrIsId( av,  TidyAttr_OPACITY  )
  |  |  ------------------
  |  |  |  |  169|  6.34k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.41k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.41k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 804, False: 611]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2329|  4.93k|        || attrIsSVG_STROKEOPACITY(attval)
  ------------------
  |  |  390|    611|#define attrIsSVG_STROKEOPACITY(av)     AttrIsId( av,  TidyAttr_STROKEOPACITY  )
  |  |  ------------------
  |  |  |  |  169|  5.54k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 611, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 611, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 290, False: 321]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2330|  4.93k|        || attrIsSVG_FILLOPACITY(attval);
  ------------------
  |  |  391|    321|#define attrIsSVG_FILLOPACITY(av)       AttrIsId( av,  TidyAttr_FILLOPACITY  )
  |  |  ------------------
  |  |  |  |  169|  5.25k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 321, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 321, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 321, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2331|  4.93k|}
attrs.c:CheckDecimal:
 2283|  1.40k|{
 2284|  1.40k|    tmbstr p;
 2285|  1.40k|    Bool hasPoint = no;
 2286|       |
 2287|  1.40k|    p  = attval->value;
 2288|       |
 2289|       |    /* Allow leading sign */
 2290|  1.40k|    if (*p == '+' || *p == '-')
  ------------------
  |  Branch (2290:9): [True: 669, False: 731]
  |  Branch (2290:22): [True: 233, False: 498]
  ------------------
 2291|    902|        ++p;
 2292|       |
 2293|  2.01k|    while (*p)
  ------------------
  |  Branch (2293:12): [True: 1.70k, False: 304]
  ------------------
 2294|  1.70k|    {
 2295|       |        /* Allow a single decimal point */
 2296|  1.70k|        if (*p == '.')
  ------------------
  |  Branch (2296:13): [True: 196, False: 1.51k]
  ------------------
 2297|    196|        {
 2298|    196|            if (!hasPoint)
  ------------------
  |  Branch (2298:17): [True: 196, False: 0]
  ------------------
 2299|    196|                hasPoint = yes;
 2300|      0|            else
 2301|      0|                TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2302|    196|                break;
 2303|    196|        }
 2304|       |        
 2305|  1.51k|        if (!TY_(IsDigit)(*p))
  ------------------
  |  |   23|  1.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2305:13): [True: 900, False: 612]
  ------------------
 2306|    900|        {
 2307|    900|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    900|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    900|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2308|    900|            break;
 2309|    900|        }
 2310|    612|        ++p;
 2311|    612|    }
 2312|  1.40k|}
attrs.c:attrsInstall:
  775|  69.2k|{
  776|  69.2k|    AttrHash *np;
  777|  69.2k|    uint hashval;
  778|       |
  779|  69.2k|    if (old)
  ------------------
  |  Branch (779:9): [True: 69.2k, False: 0]
  ------------------
  780|  69.2k|    {
  781|  69.2k|        np = (AttrHash *)TidyDocAlloc(doc, sizeof(*np));
  ------------------
  |  |  157|  69.2k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  69.2k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  782|  69.2k|        np->attr = old;
  783|       |
  784|  69.2k|        hashval = attrsHash(old->name);
  785|  69.2k|        np->next = attribs->hashtab[hashval];
  786|  69.2k|        attribs->hashtab[hashval] = np;
  787|  69.2k|    }
  788|       |
  789|  69.2k|    return old;
  790|  69.2k|}
attrs.c:CheckAttrType:
 1018|  16.5k|{
 1019|  16.5k|    const Attribute* np = attrsLookup( doc, &doc->attribs, attrname );
 1020|  16.5k|    return (Bool)( np && np->attrchk == type );
  ------------------
  |  Branch (1020:20): [True: 6.33k, False: 10.2k]
  |  Branch (1020:26): [True: 4.93k, False: 1.39k]
  ------------------
 1021|  16.5k|}
attrs.c:anchorNameHash:
 1114|   124k|{
 1115|   124k|    uint hashval = 0;
 1116|       |    /* Issue #149 - an inferred name can be null. avoid crash */
 1117|   124k|    if (s) 
  ------------------
  |  Branch (1117:9): [True: 121k, False: 2.43k]
  ------------------
 1118|   121k|    {
 1119|  3.79M|        for ( ; *s != '\0'; s++) {
  ------------------
  |  Branch (1119:17): [True: 3.67M, False: 121k]
  ------------------
 1120|  3.67M|            tmbchar c = TY_(ToLower)( *s );
  ------------------
  |  |   23|  3.67M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.67M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1121|  3.67M|            hashval = c + 31*hashval;
 1122|  3.67M|        }
 1123|   121k|    }
 1124|   124k|    return hashval % ANCHOR_HASH_SIZE;
 1125|   124k|}
attrs.c:FreeAnchor:
 1107|  50.2k|{
 1108|  50.2k|    if ( a )
  ------------------
  |  Branch (1108:10): [True: 39.1k, False: 11.0k]
  ------------------
 1109|  50.2k|        TidyDocFree( doc, a->name );
  ------------------
  |  |  159|  39.1k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  39.1k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1110|  50.2k|    TidyDocFree( doc, a );
  ------------------
  |  |  159|  50.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  50.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1111|  50.2k|}
attrs.c:attrsEmptyHash:
  814|  20.2k|{
  815|  20.2k|    AttrHash *dict, *next;
  816|  20.2k|    uint i;
  817|       |
  818|  3.61M|    for (i = 0; i < ATTRIBUTE_HASH_SIZE; ++i)
  ------------------
  |  Branch (818:17): [True: 3.59M, False: 20.2k]
  ------------------
  819|  3.59M|    {
  820|  3.59M|        dict = attribs->hashtab[i];
  821|       |
  822|  3.66M|        while(dict)
  ------------------
  |  Branch (822:15): [True: 69.2k, False: 3.59M]
  ------------------
  823|  69.2k|        {
  824|  69.2k|            next = dict->next;
  825|  69.2k|            TidyDocFree(doc, dict);
  ------------------
  |  |  159|  69.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  69.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  826|  69.2k|            dict = next;
  827|  69.2k|        }
  828|       |
  829|       |        attribs->hashtab[i] = NULL;
  830|  3.59M|    }
  831|  20.2k|}
attrs.c:FreeDeclaredAttributes:
 1288|  20.2k|{
 1289|  20.2k|    TidyAttribImpl* attribs = &doc->attribs;
 1290|  20.2k|    Attribute* dict;
 1291|  20.2k|    while ( NULL != (dict = attribs->declared_attr_list) )
  ------------------
  |  Branch (1291:13): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|}
attrs.c:AttrsHaveSameName:
 1373|  39.4k|{
 1374|  39.4k|    TidyAttrId id1, id2;
 1375|       |
 1376|  39.4k|    id1 = AttrId(av1);
  ------------------
  |  |  168|  39.4k|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 39.4k, False: 0]
  |  |  |  Branch (168:29): [True: 20.6k, False: 18.8k]
  |  |  ------------------
  ------------------
 1377|  39.4k|    id2 = AttrId(av2);
  ------------------
  |  |  168|  39.4k|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 39.4k, False: 0]
  |  |  |  Branch (168:29): [True: 22.4k, False: 17.0k]
  |  |  ------------------
  ------------------
 1378|  39.4k|    if (id1 != TidyAttr_UNKNOWN && id2 != TidyAttr_UNKNOWN)
  ------------------
  |  Branch (1378:9): [True: 20.6k, False: 18.8k]
  |  Branch (1378:36): [True: 15.1k, False: 5.48k]
  ------------------
 1379|  15.1k|        return AttrsHaveSameId(av1, av2);
  ------------------
  |  |  178|  15.1k|#define AttrsHaveSameId(a, b) (a && b && a->dict && b->dict && a->dict->id && \
  |  |  ------------------
  |  |  |  Branch (178:32): [True: 15.1k, False: 0]
  |  |  |  Branch (178:37): [True: 15.1k, False: 0]
  |  |  |  Branch (178:42): [True: 15.1k, False: 0]
  |  |  |  Branch (178:53): [True: 15.1k, False: 0]
  |  |  |  Branch (178:64): [True: 15.1k, False: 0]
  |  |  ------------------
  |  |  179|  15.1k|                               b->dict->id && a->dict->id == b->dict->id)
  |  |  ------------------
  |  |  |  Branch (179:32): [True: 15.1k, False: 0]
  |  |  |  Branch (179:47): [True: 5.88k, False: 9.26k]
  |  |  ------------------
  ------------------
 1380|  24.3k|    if (id1 != TidyAttr_UNKNOWN || id2 != TidyAttr_UNKNOWN)
  ------------------
  |  Branch (1380:9): [True: 5.48k, False: 18.8k]
  |  Branch (1380:36): [True: 7.30k, False: 11.5k]
  ------------------
 1381|  12.7k|        return no;
 1382|  11.5k|    if (av1->attribute && av2->attribute)
  ------------------
  |  Branch (1382:9): [True: 10.9k, False: 596]
  |  Branch (1382:27): [True: 10.9k, False: 0]
  ------------------
 1383|  10.9k|        return TY_(tmbstrcmp)(av1->attribute, av2->attribute) == 0;
  ------------------
  |  |   23|  10.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1384|    596|     return no;
 1385|  11.5k|}
attrs.c:AppendToStyleAttr:
 1326|  1.46k|{
 1327|       |    /*
 1328|       |    this doesn't handle CSS comments and
 1329|       |    leading/trailing white-space very well
 1330|       |    see https://www.w3.org/TR/css-style-attr/
 1331|       |    */
 1332|  1.46k|    uint end = TY_(tmbstrlen)(styleattr->value);
  ------------------
  |  |   23|  1.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1333|       |
 1334|  1.46k|    if (end >0 && styleattr->value[end - 1] == ';')
  ------------------
  |  Branch (1334:9): [True: 1.23k, False: 231]
  |  Branch (1334:19): [True: 200, False: 1.03k]
  ------------------
 1335|    200|    {
 1336|       |        /* attribute ends with declaration separator */
 1337|       |
 1338|    200|        styleattr->value = (tmbstr) TidyDocRealloc(doc, styleattr->value,
  ------------------
  |  |  158|    200|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|    200|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
 1339|    200|            end + TY_(tmbstrlen)(styleprop) + 2);
 1340|       |
 1341|    200|        TY_(tmbstrcat)(styleattr->value, " ");
  ------------------
  |  |   23|    200|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    200|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1342|    200|        TY_(tmbstrcat)(styleattr->value, styleprop);
  ------------------
  |  |   23|    200|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    200|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1343|    200|    }
 1344|  1.26k|    else if (end >0 && styleattr->value[end - 1] == '}')
  ------------------
  |  Branch (1344:14): [True: 1.03k, False: 231]
  |  Branch (1344:24): [True: 265, False: 771]
  ------------------
 1345|    265|    {
 1346|       |        /* attribute ends with rule set */
 1347|       |
 1348|    265|        styleattr->value = (tmbstr) TidyDocRealloc(doc, styleattr->value,
  ------------------
  |  |  158|    265|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|    265|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
 1349|    265|            end + TY_(tmbstrlen)(styleprop) + 6);
 1350|       |
 1351|    265|        TY_(tmbstrcat)(styleattr->value, " { ");
  ------------------
  |  |   23|    265|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    265|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1352|    265|        TY_(tmbstrcat)(styleattr->value, styleprop);
  ------------------
  |  |   23|    265|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    265|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1353|    265|        TY_(tmbstrcat)(styleattr->value, " }");
  ------------------
  |  |   23|    265|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    265|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1354|    265|    }
 1355|  1.00k|    else
 1356|  1.00k|    {
 1357|       |        /* attribute ends with property value */
 1358|       |
 1359|  1.00k|        styleattr->value = (tmbstr) TidyDocRealloc(doc, styleattr->value,
  ------------------
  |  |  158|  1.00k|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|  1.00k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
 1360|  1.00k|            end + TY_(tmbstrlen)(styleprop) + 3);
 1361|       |
 1362|  1.00k|        if (end > 0)
  ------------------
  |  Branch (1362:13): [True: 771, False: 231]
  ------------------
 1363|    771|            TY_(tmbstrcat)(styleattr->value, "; ");
  ------------------
  |  |   23|    771|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    771|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1364|  1.00k|        TY_(tmbstrcat)(styleattr->value, styleprop);
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1365|  1.00k|    }
 1366|  1.46k|}
attrs.c:IsURLCodePoint:
 1572|  3.12M|{
 1573|  3.12M|    uint c;
 1574|  3.12M|    *increment = TY_(GetUTF8)( p, &c ) + 1;
  ------------------
  |  |   23|  3.12M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.12M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1575|       |
 1576|  3.12M|    return ISALNUM( c ) ||
  ------------------
  |  | 1569|  6.24M|#define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1566|  6.24M|#define ISUPPER(a) ((a >= 'A') && (a <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1566:21): [True: 1.55M, False: 1.56M]
  |  |  |  |  |  Branch (1566:35): [True: 452k, False: 1.10M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1567|  5.79M|#define ISLOWER(a) ((a >= 'a') && (a <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1567:21): [True: 1.02M, False: 1.64M]
  |  |  |  |  |  Branch (1567:35): [True: 34.4k, False: 992k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1568|  2.63M|#define ISNUMERIC(a) ((a >= '0') && (a <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1568:23): [True: 1.15M, False: 1.48M]
  |  |  |  |  |  Branch (1568:37): [True: 4.78k, False: 1.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1577|  2.63M|        c == '%' ||    /* not a valid codepoint, but an escape sequence */
  ------------------
  |  Branch (1577:9): [True: 1.46k, False: 2.62M]
  ------------------
 1578|  2.62M|        c == '#' ||    /* not a valid codepoint, but a delimiter */
  ------------------
  |  Branch (1578:9): [True: 5.62k, False: 2.62M]
  ------------------
 1579|  2.62M|        c == '!' ||
  ------------------
  |  Branch (1579:9): [True: 6.72k, False: 2.61M]
  ------------------
 1580|  2.61M|        c == '$' ||
  ------------------
  |  Branch (1580:9): [True: 411, False: 2.61M]
  ------------------
 1581|  2.61M|        c == '&' ||
  ------------------
  |  Branch (1581:9): [True: 5.76k, False: 2.61M]
  ------------------
 1582|  2.61M|        c == '\'' ||
  ------------------
  |  Branch (1582:9): [True: 845, False: 2.60M]
  ------------------
 1583|  2.60M|        c == '(' ||
  ------------------
  |  Branch (1583:9): [True: 361, False: 2.60M]
  ------------------
 1584|  2.60M|        c == ')' ||
  ------------------
  |  Branch (1584:9): [True: 450, False: 2.60M]
  ------------------
 1585|  2.60M|        c == '*' ||
  ------------------
  |  Branch (1585:9): [True: 260, False: 2.60M]
  ------------------
 1586|  2.60M|        c == '+' ||
  ------------------
  |  Branch (1586:9): [True: 450, False: 2.60M]
  ------------------
 1587|  2.60M|        c == ',' ||
  ------------------
  |  Branch (1587:9): [True: 557, False: 2.60M]
  ------------------
 1588|  2.60M|        c == '-' ||
  ------------------
  |  Branch (1588:9): [True: 579, False: 2.60M]
  ------------------
 1589|  2.60M|        c == '.' ||
  ------------------
  |  Branch (1589:9): [True: 717, False: 2.60M]
  ------------------
 1590|  2.60M|        c == '/' ||
  ------------------
  |  Branch (1590:9): [True: 30.0k, False: 2.57M]
  ------------------
 1591|  2.57M|        c == ':' ||
  ------------------
  |  Branch (1591:9): [True: 1.26k, False: 2.57M]
  ------------------
 1592|  2.57M|        c == ';' ||
  ------------------
  |  Branch (1592:9): [True: 26.3k, False: 2.54M]
  ------------------
 1593|  2.54M|        c == '=' ||
  ------------------
  |  Branch (1593:9): [True: 4.52k, False: 2.54M]
  ------------------
 1594|  2.54M|        c == '?' ||
  ------------------
  |  Branch (1594:9): [True: 1.00k, False: 2.54M]
  ------------------
 1595|  2.54M|        c == '@' ||
  ------------------
  |  Branch (1595:9): [True: 26.8k, False: 2.51M]
  ------------------
 1596|  2.51M|        c == '_' ||
  ------------------
  |  Branch (1596:9): [True: 26.9k, False: 2.48M]
  ------------------
 1597|  2.48M|        c == '~' ||
  ------------------
  |  Branch (1597:9): [True: 314, False: 2.48M]
  ------------------
 1598|  2.48M|        (c >= 0x00A0 && c <= 0xD7FF) ||
  ------------------
  |  Branch (1598:10): [True: 991k, False: 1.49M]
  |  Branch (1598:25): [True: 2.94k, False: 988k]
  ------------------
 1599|  2.48M|        (c >= 0xE000 && c <= 0xFDCF) ||
  ------------------
  |  Branch (1599:10): [True: 988k, False: 1.49M]
  |  Branch (1599:25): [True: 389, False: 988k]
  ------------------
 1600|  2.48M|        (c >= 0xFDF0 && c <= 0xFFEF) ||
  ------------------
  |  Branch (1600:10): [True: 988k, False: 1.49M]
  |  Branch (1600:25): [True: 224, False: 987k]
  ------------------
 1601|  2.48M|        (c >= 0x10000 && c <= 0x1FFFD) ||
  ------------------
  |  Branch (1601:10): [True: 7.68k, False: 2.47M]
  |  Branch (1601:26): [True: 389, False: 7.29k]
  ------------------
 1602|  2.48M|        (c >= 0x20000 && c <= 0x2FFFD) ||
  ------------------
  |  Branch (1602:10): [True: 7.29k, False: 2.47M]
  |  Branch (1602:26): [True: 212, False: 7.07k]
  ------------------
 1603|  2.48M|        (c >= 0x30000 && c <= 0x3FFFD) ||
  ------------------
  |  Branch (1603:10): [True: 7.07k, False: 2.47M]
  |  Branch (1603:26): [True: 815, False: 6.26k]
  ------------------
 1604|  2.48M|        (c >= 0x40000 && c <= 0x4FFFD) ||
  ------------------
  |  Branch (1604:10): [True: 6.26k, False: 2.47M]
  |  Branch (1604:26): [True: 347, False: 5.91k]
  ------------------
 1605|  2.48M|        (c >= 0x50000 && c <= 0x5FFFD) ||
  ------------------
  |  Branch (1605:10): [True: 5.91k, False: 2.47M]
  |  Branch (1605:26): [True: 252, False: 5.66k]
  ------------------
 1606|  2.48M|        (c >= 0x60000 && c <= 0x6FFFD) ||
  ------------------
  |  Branch (1606:10): [True: 5.66k, False: 2.47M]
  |  Branch (1606:26): [True: 203, False: 5.45k]
  ------------------
 1607|  2.48M|        (c >= 0x70000 && c <= 0x7FFFD) ||
  ------------------
  |  Branch (1607:10): [True: 5.45k, False: 2.47M]
  |  Branch (1607:26): [True: 242, False: 5.21k]
  ------------------
 1608|  2.48M|        (c >= 0x80000 && c <= 0x8FFFD) ||
  ------------------
  |  Branch (1608:10): [True: 5.21k, False: 2.47M]
  |  Branch (1608:26): [True: 80, False: 5.13k]
  ------------------
 1609|  2.48M|        (c >= 0x90000 && c <= 0x9FFFD) ||
  ------------------
  |  Branch (1609:10): [True: 5.13k, False: 2.47M]
  |  Branch (1609:26): [True: 1.71k, False: 3.41k]
  ------------------
 1610|  2.48M|        (c >= 0xA0000 && c <= 0xAFFFD) ||
  ------------------
  |  Branch (1610:10): [True: 3.41k, False: 2.47M]
  |  Branch (1610:26): [True: 336, False: 3.08k]
  ------------------
 1611|  2.48M|        (c >= 0xB0000 && c <= 0xBFFFD) ||
  ------------------
  |  Branch (1611:10): [True: 3.08k, False: 2.47M]
  |  Branch (1611:26): [True: 336, False: 2.74k]
  ------------------
 1612|  2.48M|        (c >= 0xC0000 && c <= 0xCFFFD) ||
  ------------------
  |  Branch (1612:10): [True: 2.74k, False: 2.47M]
  |  Branch (1612:26): [True: 246, False: 2.49k]
  ------------------
 1613|  2.47M|        (c >= 0xD0000 && c <= 0xDFFFD) ||
  ------------------
  |  Branch (1613:10): [True: 2.49k, False: 2.47M]
  |  Branch (1613:26): [True: 268, False: 2.23k]
  ------------------
 1614|  2.47M|        (c >= 0xE0000 && c <= 0xEFFFD) ||
  ------------------
  |  Branch (1614:10): [True: 2.22k, False: 2.47M]
  |  Branch (1614:26): [True: 1.17k, False: 1.05k]
  ------------------
 1615|  2.47M|        (c >= 0xF0000 && c <= 0xFFFFD) ||
  ------------------
  |  Branch (1615:10): [True: 1.04k, False: 2.47M]
  |  Branch (1615:26): [True: 515, False: 534]
  ------------------
 1616|  2.47M|        (c >= 0x100000 && c <= 0x10FFFD);
  ------------------
  |  Branch (1616:10): [True: 529, False: 2.47M]
  |  Branch (1616:27): [True: 477, False: 52]
  ------------------
 1617|  3.12M|}
attrs.c:CheckScript:
 1729|    896|{
 1730|    896|}
attrs.c:CheckBool:
 1918|  2.17k|{
 1919|  2.17k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  2.17k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 2.17k, False: 0]
  |  |  |  Branch (171:44): [True: 1.22k, False: 946]
  |  |  ------------------
  ------------------
 1920|    946|        return;
 1921|       |
 1922|  1.22k|    CheckLowerCaseAttrValue( doc, node, attval );
 1923|  1.22k|}
attrs.c:SortAttVal:
 2592|  2.73M|{
 2593|       |    /* Get the list from the passed-in tidyDoc. */
 2594|  2.73M|    ctmbstr* priorityList = (ctmbstr*)doc->attribs.priorityAttribs.list;
 2595|       |
 2596|  2.73M|    ptAttValComparator ptComparator = GetAttValComparator(strat, priorityList);
 2597|  2.73M|    AttVal *p, *q, *e, *tail;
 2598|  2.73M|    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|  2.73M|    if (!list)
  ------------------
  |  Branch (2604:9): [True: 2.50M, False: 233k]
  ------------------
 2605|  2.50M|        return NULL;
 2606|       |
 2607|       |    /* If no comparator, return the list as-is */
 2608|   233k|    if (ptComparator == 0)
  ------------------
  |  Branch (2608:9): [True: 233k, False: 0]
  ------------------
 2609|   233k|        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|  2.73M|{
 2577|  2.73M|    switch (strat)
  ------------------
  |  Branch (2577:13): [True: 2.73M, False: 0]
  ------------------
 2578|  2.73M|    {
 2579|      0|    case TidySortAttrAlpha:
  ------------------
  |  Branch (2579:5): [True: 0, False: 2.73M]
  ------------------
 2580|      0|        return AlphaComparator;
 2581|  2.73M|    case TidySortAttrNone:
  ------------------
  |  Branch (2581:5): [True: 2.73M, False: 0]
  ------------------
 2582|  2.73M|        if ( list && list[0] )
  ------------------
  |  Branch (2582:14): [True: 0, False: 2.73M]
  |  Branch (2582:22): [True: 0, False: 0]
  ------------------
 2583|      0|            return PriorityComparator;
 2584|  2.73M|        break;
 2585|  2.73M|    }
 2586|  2.73M|    return 0;
 2587|  2.73M|}

tidyInitOutputBuffer:
   50|  40.4k|{
   51|  40.4k|  outp->putByte  = outsink_putByte;
   52|  40.4k|  outp->sinkData = buf;
   53|  40.4k|}
tidyBufInit:
   57|  60.6k|{
   58|  60.6k|    assert( buf != NULL );
  ------------------
  |  Branch (58:5): [True: 0, False: 60.6k]
  |  Branch (58:5): [True: 60.6k, False: 0]
  ------------------
   59|  60.6k|    tidyBufInitWithAllocator( buf, NULL );
   60|  60.6k|}
tidyBufInitWithAllocator:
   69|   121k|{
   70|   121k|    assert( buf != NULL );
  ------------------
  |  Branch (70:5): [True: 0, False: 121k]
  |  Branch (70:5): [True: 121k, False: 0]
  ------------------
   71|   121k|    TidyClearMemory( buf, sizeof(TidyBuffer) );
  ------------------
  |  |   70|   121k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
   72|   121k|    buf->allocator = allocator ? allocator : &TY_(g_default_allocator);
  ------------------
  |  |   23|  60.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (72:22): [True: 60.6k, False: 60.6k]
  ------------------
   73|   121k|}
tidyBufFree:
   85|  60.6k|{
   86|  60.6k|    assert( buf != NULL );
  ------------------
  |  Branch (86:5): [True: 0, False: 60.6k]
  |  Branch (86:5): [True: 60.6k, False: 0]
  ------------------
   87|  60.6k|    TidyFree(  buf->allocator, buf->bp );
  ------------------
  |  |   68|  60.6k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
   88|  60.6k|    tidyBufInitWithAllocator( buf, buf->allocator );
   89|  60.6k|}
tidyBufClear:
   92|  20.2k|{
   93|  20.2k|    assert( buf != NULL );
  ------------------
  |  Branch (93:5): [True: 0, False: 20.2k]
  |  Branch (93:5): [True: 20.2k, False: 0]
  ------------------
   94|  20.2k|    if ( buf->bp )
  ------------------
  |  Branch (94:10): [True: 0, False: 20.2k]
  ------------------
   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|  20.2k|    buf->next = 0;
  100|  20.2k|}
tidyBufCheckAlloc:
  116|   656M|{
  117|   656M|    assert( buf != NULL );
  ------------------
  |  Branch (117:5): [True: 0, False: 656M]
  |  Branch (117:5): [True: 656M, False: 0]
  ------------------
  118|       |
  119|   656M|    if ( !buf->allocator )
  ------------------
  |  Branch (119:10): [True: 0, False: 656M]
  ------------------
  120|      0|        setDefaultAllocator( buf );
  121|       |        
  122|   656M|    if ( 0 == chunkSize )
  ------------------
  |  Branch (122:10): [True: 656M, False: 0]
  ------------------
  123|   656M|        chunkSize = 256;
  124|   656M|    if ( allocSize+1 > buf->allocated )
  ------------------
  |  Branch (124:10): [True: 138k, False: 656M]
  ------------------
  125|   138k|    {
  126|   138k|        byte* bp;
  127|   138k|        uint allocAmt = chunkSize;
  128|   138k|        if ( buf->allocated > 0 )
  ------------------
  |  Branch (128:14): [True: 77.6k, False: 60.6k]
  ------------------
  129|  77.6k|            allocAmt = buf->allocated;
  130|   215k|        while ( allocAmt < allocSize+1 )
  ------------------
  |  Branch (130:17): [True: 77.6k, False: 138k]
  ------------------
  131|  77.6k|            allocAmt *= 2;
  132|       |
  133|   138k|        bp = (byte*)TidyRealloc( buf->allocator, buf->bp, allocAmt );
  ------------------
  |  |   67|   138k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  134|   138k|        if ( bp != NULL )
  ------------------
  |  Branch (134:14): [True: 138k, False: 0]
  ------------------
  135|   138k|        {
  136|   138k|            TidyClearMemory( bp + buf->allocated, allocAmt - buf->allocated );
  ------------------
  |  |   70|   138k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  137|   138k|            buf->bp = bp;
  138|   138k|            buf->allocated = allocAmt;
  139|   138k|        }
  140|   138k|    }
  141|   656M|}
tidyBufAppend:
  166|  60.6k|{
  167|  60.6k|    assert( buf != NULL );
  ------------------
  |  Branch (167:5): [True: 0, False: 60.6k]
  |  Branch (167:5): [True: 60.6k, False: 0]
  ------------------
  168|  60.6k|    if ( vp != NULL && size > 0 )
  ------------------
  |  Branch (168:10): [True: 60.6k, False: 0]
  |  Branch (168:24): [True: 60.6k, False: 0]
  ------------------
  169|  60.6k|    {
  170|  60.6k|        tidyBufCheckAlloc( buf, buf->size + size, 0 );
  171|  60.6k|        memcpy( buf->bp + buf->size, vp, size );
  172|  60.6k|        buf->size += size;
  173|  60.6k|    }
  174|  60.6k|}
tidyBufPutByte:
  177|   656M|{
  178|   656M|    assert( buf != NULL );
  ------------------
  |  Branch (178:5): [True: 0, False: 656M]
  |  Branch (178:5): [True: 656M, False: 0]
  ------------------
  179|   656M|    tidyBufCheckAlloc( buf, buf->size + 1, 0 );
  180|   656M|    buf->bp[ buf->size++ ] = bv;
  181|   656M|}
buffio.c:outsink_putByte:
   44|   656M|{
   45|   656M|  TidyBuffer* buf = (TidyBuffer*) appData;
   46|   656M|  tidyBufPutByte( buf, bv );
   47|   656M|}

prvTidyFreeStyles:
  267|  20.2k|{
  268|  20.2k|    Lexer* lexer = doc->lexer;
  269|  20.2k|    if ( lexer )
  ------------------
  |  Branch (269:10): [True: 20.2k, False: 0]
  ------------------
  270|  20.2k|    {
  271|  20.2k|        TagStyle *style, *next;
  272|  20.2k|        for ( style = lexer->styles; style; style = next )
  ------------------
  |  Branch (272:38): [True: 0, False: 20.2k]
  ------------------
  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|  20.2k|    }
  281|  20.2k|}
prvTidyFixNodeLinks:
  559|  1.55k|{
  560|  1.55k|    Node *child;
  561|       |
  562|  1.55k|    if (node->prev)
  ------------------
  |  Branch (562:9): [True: 355, False: 1.19k]
  ------------------
  563|    355|        node->prev->next = node;
  564|  1.19k|    else
  565|  1.19k|        node->parent->content = node;
  566|       |
  567|  1.55k|    if (node->next)
  ------------------
  |  Branch (567:9): [True: 222, False: 1.32k]
  ------------------
  568|    222|        node->next->prev = node;
  569|  1.32k|    else
  570|  1.32k|        node->parent->last = node;
  571|       |
  572|  2.95k|    for (child = node->content; child; child = child->next)
  ------------------
  |  Branch (572:33): [True: 1.40k, False: 1.55k]
  ------------------
  573|  1.40k|        child->parent = node;
  574|  1.55k|}
prvTidyAddStyleProperty:
  661|  46.2k|{
  662|  46.2k|    AttVal *av = TY_(AttrGetById)(node, TidyAttr_STYLE);
  ------------------
  |  |   23|  46.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  663|       |
  664|       |    /* if style attribute already exists then insert property */
  665|       |
  666|  46.2k|    if ( av )
  ------------------
  |  Branch (666:10): [True: 1.08k, False: 45.1k]
  ------------------
  667|  1.08k|    {
  668|  1.08k|        if (av->value != NULL)
  ------------------
  |  Branch (668:13): [True: 1.06k, False: 21]
  ------------------
  669|  1.06k|        {
  670|  1.06k|            tmbstr s = MergeProperties( doc, av->value, property );
  671|  1.06k|            TidyDocFree( doc, av->value );
  ------------------
  |  |  159|  1.06k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  1.06k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  672|  1.06k|            av->value = s;
  673|  1.06k|        }
  674|     21|        else
  675|     21|        {
  676|     21|            av->value = TY_(tmbstrdup)( doc->allocator, property );
  ------------------
  |  |   23|     21|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     21|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  677|     21|        }
  678|  1.08k|    }
  679|  45.1k|    else /* else create new style attribute */
  680|  45.1k|    {
  681|  45.1k|        av = TY_(NewAttributeEx)( doc, "style", property, '"' );
  ------------------
  |  |   23|  45.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  682|  45.1k|        TY_(InsertAttributeAtStart)( node, av );
  ------------------
  |  |   23|  45.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  683|  45.1k|    }
  684|  46.2k|}
prvTidyNestedEmphasis:
 1507|  2.18M|{
 1508|  2.18M|    Node *next;
 1509|       |
 1510|  4.96M|    while (node)
  ------------------
  |  Branch (1510:12): [True: 2.77M, False: 2.18M]
  ------------------
 1511|  2.77M|    {
 1512|  2.77M|        next = node->next;
 1513|       |
 1514|  2.77M|        if ( (nodeIsB(node) || nodeIsI(node))
  ------------------
  |  |  403|  2.77M|#define nodeIsB( node )          TagIsId( node, TidyTag_B )
  |  |  ------------------
  |  |  |  |  275|  5.55M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.77M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.29M, False: 481k]
  |  |  |  |  |  Branch (275:54): [True: 52.9k, False: 2.24M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( (nodeIsB(node) || nodeIsI(node))
  ------------------
  |  |  404|  2.72M|#define nodeIsI( node )          TagIsId( node, TidyTag_I )
  |  |  ------------------
  |  |  |  |  275|  2.72M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.72M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.24M, False: 481k]
  |  |  |  |  |  Branch (275:54): [True: 13.5k, False: 2.23M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1515|  66.4k|             && node->parent && node->parent->tag == node->tag)
  ------------------
  |  Branch (1515:17): [True: 66.4k, False: 0]
  |  Branch (1515:33): [True: 2.30k, False: 64.1k]
  ------------------
 1516|  2.30k|        {
 1517|       |            /* strip redundant inner element */
 1518|  2.30k|            DiscardContainer( doc, node, &next );
 1519|  2.30k|            node = next;
 1520|  2.30k|            continue;
 1521|  2.30k|        }
 1522|       |
 1523|  2.77M|        if ( node->content )
  ------------------
  |  Branch (1523:14): [True: 2.16M, False: 615k]
  ------------------
 1524|  2.16M|            TY_(NestedEmphasis)( doc, node->content );
  ------------------
  |  |   23|  2.16M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.16M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1525|       |
 1526|  2.77M|        node = next;
 1527|  2.77M|    }
 1528|  2.18M|}
prvTidyList2BQ:
 1562|  2.18M|{
 1563|  4.95M|    while (node)
  ------------------
  |  Branch (1563:12): [True: 2.77M, False: 2.18M]
  ------------------
 1564|  2.77M|    {
 1565|  2.77M|        if (node->content)
  ------------------
  |  Branch (1565:13): [True: 2.16M, False: 616k]
  ------------------
 1566|  2.16M|            TY_(List2BQ)( doc, node->content );
  ------------------
  |  |   23|  2.16M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.16M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1567|       |
 1568|  2.77M|        if ( node->tag && node->tag->parser == TY_(ParseList) &&
  ------------------
  |  |   23|  2.29M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.29M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1568:14): [True: 2.29M, False: 481k]
  |  Branch (1568:27): [True: 53.1k, False: 2.24M]
  ------------------
 1569|  53.1k|             HasOneChild(node) && node->content->implicit )
  ------------------
  |  Branch (1569:14): [True: 49.1k, False: 4.02k]
  |  Branch (1569:35): [True: 41.5k, False: 7.60k]
  ------------------
 1570|  41.5k|        {
 1571|  41.5k|            StripOnlyChild( doc, node );
 1572|  41.5k|            RenameElem( doc, node, TidyTag_BLOCKQUOTE );
 1573|  41.5k|            node->implicit = yes;
 1574|  41.5k|        }
 1575|       |
 1576|  2.77M|        node = node->next;
 1577|  2.77M|    }
 1578|  2.18M|}
prvTidyBQ2Div:
 1587|  20.2k|{
 1588|  20.2k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1589|  20.2k|    Node *next;
 1590|       |    
 1591|  20.2k|    tmbchar indent_buf[ 32 ];
 1592|  20.2k|    uint indent;
 1593|       |
 1594|  2.71M|    while (node)
  ------------------
  |  Branch (1594:12): [True: 2.69M, False: 20.2k]
  ------------------
 1595|  2.69M|    {
 1596|  2.69M|        next = node->next;
 1597|       |        
 1598|  2.69M|        if ( nodeIsBLOCKQUOTE(node) && node->implicit )
  ------------------
  |  |  426|  2.69M|#define nodeIsBLOCKQUOTE( node ) TagIsId( node, TidyTag_BLOCKQUOTE )
  |  |  ------------------
  |  |  |  |  275|  5.39M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.69M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.21M, False: 481k]
  |  |  |  |  |  Branch (275:54): [True: 4.72k, False: 2.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1598:40): [True: 4.47k, False: 256]
  ------------------
 1599|  4.47k|        {
 1600|  4.47k|            indent = 1;
 1601|       |
 1602|  40.8k|            while( HasOneChild(node) &&
  ------------------
  |  Branch (1602:20): [True: 37.0k, False: 3.86k]
  ------------------
 1603|  40.8k|                   nodeIsBLOCKQUOTE(node->content) &&
  ------------------
  |  |  426|  37.0k|#define nodeIsBLOCKQUOTE( node ) TagIsId( node, TidyTag_BLOCKQUOTE )
  |  |  ------------------
  |  |  |  |  275|  77.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 37.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 36.6k, False: 354]
  |  |  |  |  |  Branch (275:54): [True: 36.3k, False: 257]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|  36.3k|                   node->implicit)
  ------------------
  |  Branch (1604:20): [True: 36.3k, False: 0]
  ------------------
 1605|  36.3k|            {
 1606|  36.3k|                ++indent;
 1607|  36.3k|                StripOnlyChild( doc, node );
 1608|  36.3k|            }
 1609|       |
 1610|  4.47k|            TY_(tmbsnprintf)(indent_buf, sizeof(indent_buf), "margin-left: %dem",
  ------------------
  |  |   23|  4.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1611|  4.47k|                             2*indent);
 1612|       |
 1613|  4.47k|            RenameElem( doc, node, TidyTag_DIV );
 1614|  4.47k|            TY_(AddStyleProperty)(doc, node, indent_buf );
  ------------------
  |  |   23|  4.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1615|       |
 1616|  4.47k|            if (node->content)
  ------------------
  |  Branch (1616:17): [True: 4.46k, False: 11]
  ------------------
 1617|  4.46k|            {
 1618|  4.46k|                TY_(push)(stack, next);
  ------------------
  |  |   23|  4.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1619|  4.46k|                node = node->content;
 1620|  4.46k|                continue;
 1621|  4.46k|            }
 1622|  4.47k|        }
 1623|  2.69M|        else if (node->content)
  ------------------
  |  Branch (1623:18): [True: 2.07M, False: 616k]
  ------------------
 1624|  2.07M|        {
 1625|  2.07M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.07M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.07M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1626|  2.07M|            node = node->content;
 1627|  2.07M|            continue;
 1628|  2.07M|        }
 1629|       |
 1630|   616k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   151k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   151k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1630:16): [True: 464k, False: 151k]
  ------------------
 1631|   616k|    }
 1632|  20.2k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1633|  20.2k|}
prvTidyNormalizeSpaces:
 1811|  14.8k|{
 1812|  45.0k|    while ( node )
  ------------------
  |  Branch (1812:13): [True: 30.1k, False: 14.8k]
  ------------------
 1813|  30.1k|    {
 1814|  30.1k|        if ( node->content )
  ------------------
  |  Branch (1814:14): [True: 8.48k, False: 21.6k]
  ------------------
 1815|  8.48k|            TY_(NormalizeSpaces)( lexer, node->content );
  ------------------
  |  |   23|  8.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1816|       |
 1817|  30.1k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  30.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  30.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1817:13): [True: 14.3k, False: 15.8k]
  ------------------
 1818|  14.3k|        {
 1819|  14.3k|            uint i, c;
 1820|  14.3k|            tmbstr p = lexer->lexbuf + node->start;
 1821|       |
 1822|  8.03M|            for (i = node->start; i < node->end; ++i)
  ------------------
  |  Branch (1822:35): [True: 8.01M, False: 14.3k]
  ------------------
 1823|  8.01M|            {
 1824|  8.01M|                c = (byte) lexer->lexbuf[i];
 1825|       |
 1826|       |                /* look for UTF-8 multibyte character */
 1827|  8.01M|                if ( c > 0x7F )
  ------------------
  |  Branch (1827:22): [True: 42.5k, False: 7.97M]
  ------------------
 1828|  42.5k|                    i += TY_(GetUTF8)( lexer->lexbuf + i, &c );
  ------------------
  |  |   23|  42.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1829|       |
 1830|  8.01M|                if ( c == 160 )
  ------------------
  |  Branch (1830:22): [True: 3.01k, False: 8.01M]
  ------------------
 1831|  3.01k|                    c = ' ';
 1832|       |
 1833|  8.01M|                p = TY_(PutUTF8)(p, c);
  ------------------
  |  |   23|  8.01M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.01M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1834|  8.01M|            }
 1835|  14.3k|            node->end = p - lexer->lexbuf;
 1836|  14.3k|        }
 1837|       |
 1838|  30.1k|        node = node->next;
 1839|  30.1k|    }
 1840|  14.8k|}
prvTidyBumpObject:
 2138|  64.2k|{
 2139|  64.2k|    Node *node, *next, *head = NULL, *body = NULL;
 2140|       |
 2141|  64.2k|    if (!html)
  ------------------
  |  Branch (2141:9): [True: 487, False: 63.7k]
  ------------------
 2142|    487|        return;
 2143|       |
 2144|   471k|    for ( node = html->content; node != NULL; node = node->next )
  ------------------
  |  Branch (2144:33): [True: 408k, False: 63.7k]
  ------------------
 2145|   408k|    {
 2146|   408k|        if ( nodeIsHEAD(node) )
  ------------------
  |  |  371|   408k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|   408k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 408k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 397k, False: 11.0k]
  |  |  |  |  |  Branch (275:54): [True: 44.6k, False: 352k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2147|  44.6k|            head = node;
 2148|       |
 2149|   408k|        if ( nodeIsBODY(node) )
  ------------------
  |  |  375|   408k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   408k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 408k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 397k, False: 11.0k]
  |  |  |  |  |  Branch (275:54): [True: 155k, False: 242k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2150|   155k|            body = node;
 2151|   408k|    }
 2152|       |
 2153|  63.7k|    if ( head != NULL && body != NULL )
  ------------------
  |  Branch (2153:10): [True: 44.6k, False: 19.0k]
  |  Branch (2153:26): [True: 44.6k, False: 0]
  ------------------
 2154|  44.6k|    {
 2155|  51.9k|        for (node = head->content; node != NULL; node = next)
  ------------------
  |  Branch (2155:36): [True: 7.32k, False: 44.6k]
  ------------------
 2156|  7.32k|        {
 2157|  7.32k|            next = node->next;
 2158|       |
 2159|  7.32k|            if ( nodeIsOBJECT(node) )
  ------------------
  |  |  428|  7.32k|#define nodeIsOBJECT( node )     TagIsId( node, TidyTag_OBJECT )
  |  |  ------------------
  |  |  |  |  275|  7.32k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.32k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.21k, False: 1.11k]
  |  |  |  |  |  Branch (275:54): [True: 1.58k, False: 4.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2160|  1.58k|            {
 2161|  1.58k|                Node *child;
 2162|  1.58k|                Bool bump = no;
 2163|       |
 2164|  2.14k|                for (child = node->content; child != NULL; child = child->next)
  ------------------
  |  Branch (2164:45): [True: 1.60k, False: 542]
  ------------------
 2165|  1.60k|                {
 2166|       |                    /* bump to body unless content is param */
 2167|  1.60k|                    if ( (TY_(nodeIsText)(child) && !TY_(IsBlank)(doc->lexer, node))
  ------------------
  |  |   23|  1.60k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.60k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( (TY_(nodeIsText)(child) && !TY_(IsBlank)(doc->lexer, node))
  ------------------
  |  |   23|    477|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    477|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2167:27): [True: 477, False: 1.12k]
  |  Branch (2167:53): [True: 477, False: 0]
  ------------------
 2168|  1.12k|                         || !nodeIsPARAM(child) )
  ------------------
  |  |  409|  1.12k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|  1.12k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.12k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 882, False: 242]
  |  |  |  |  |  Branch (275:54): [True: 559, False: 323]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2169|  1.04k|                    {
 2170|  1.04k|                            bump = yes;
 2171|  1.04k|                            break;
 2172|  1.04k|                    }
 2173|  1.60k|                }
 2174|       |
 2175|  1.58k|                if ( bump )
  ------------------
  |  Branch (2175:22): [True: 1.04k, False: 542]
  ------------------
 2176|  1.04k|                {
 2177|  1.04k|                    TY_(RemoveNode)( node );
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2178|  1.04k|                    TY_(InsertNodeAtStart)( body, node );
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2179|  1.04k|                }
 2180|  1.58k|            }
 2181|  7.32k|        }
 2182|  44.6k|    }
 2183|  63.7k|}
prvTidyTidyMetaCharset:
 2194|  20.2k|{
 2195|  20.2k|    AttVal *charsetAttr;
 2196|  20.2k|    AttVal *contentAttr;
 2197|  20.2k|    AttVal *httpEquivAttr;
 2198|  20.2k|    Bool charsetFound = no;
 2199|  20.2k|    uint outenc = cfg(doc, TidyOutCharEncoding);
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 2200|  20.2k|    ctmbstr enc = TY_(GetEncodingNameFromTidyId)(outenc);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2201|  20.2k|    Node *currentNode;
 2202|  20.2k|    Node *head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2203|  20.2k|    Node *metaTag;
 2204|  20.2k|    Node *prevNode;
 2205|  20.2k|    TidyBuffer buf;
 2206|  20.2k|    TidyBuffer charsetString;
 2207|       |    /* tmbstr httpEquivAttrValue; */
 2208|       |    /* tmbstr lcontent; */
 2209|  20.2k|    tmbstr newValue;
 2210|  20.2k|    Bool add_meta = cfgBool(doc, TidyMetaCharset);
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2211|       |
 2212|       |    /* We can't do anything we don't have a head or encoding is NULL */
 2213|  20.2k|    if (!head || !enc || !TY_(tmbstrlen)(enc))
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2213:9): [True: 0, False: 20.2k]
  |  Branch (2213:18): [True: 0, False: 20.2k]
  |  Branch (2213:26): [True: 0, False: 20.2k]
  ------------------
 2214|      0|        return no;
 2215|  20.2k|    if (outenc == RAW)
  ------------------
  |  |  133|  20.2k|#define RAW         0
  ------------------
  |  Branch (2215:9): [True: 0, False: 20.2k]
  ------------------
 2216|      0|        return no;
 2217|  20.2k|#ifndef NO_NATIVE_ISO2022_SUPPORT
 2218|  20.2k|    if (outenc == ISO2022)
  ------------------
  |  |  138|  20.2k|#define ISO2022     5
  ------------------
  |  Branch (2218:9): [True: 0, False: 20.2k]
  ------------------
 2219|      0|        return no;
 2220|  20.2k|#endif
 2221|  20.2k|    if (cfgAutoBool(doc, TidyBodyOnly) == TidyYesState)
  ------------------
  |  |  421|  20.2k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2221:9): [True: 0, False: 20.2k]
  ------------------
 2222|      0|        return no; /* nothing to do here if showing body only */
 2223|       |
 2224|  20.2k|    tidyBufInit(&charsetString);
 2225|       |    /* Set up the content test 'charset=value' */
 2226|  20.2k|    tidyBufClear(&charsetString);
 2227|  20.2k|    tidyBufAppend(&charsetString, "charset=", 8);
 2228|  20.2k|    tidyBufAppend(&charsetString, (char*)enc, TY_(tmbstrlen)(enc));
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2229|  20.2k|    tidyBufAppend(&charsetString, "\0", 1); /* zero terminate the buffer */
 2230|       |    /* process the children of the head */
 2231|       |    /* Issue #656 - guard against 'currentNode' being set NULL in loop */
 2232|  49.1k|    for (currentNode = head->content; currentNode; 
  ------------------
  |  Branch (2232:39): [True: 28.9k, False: 20.2k]
  ------------------
 2233|  28.9k|        currentNode = (currentNode ? currentNode->next : NULL))
  ------------------
  |  Branch (2233:24): [True: 28.9k, False: 0]
  ------------------
 2234|  28.9k|    {
 2235|  28.9k|        if (!nodeIsMETA(currentNode))
  ------------------
  |  |  374|  28.9k|#define nodeIsMETA( node )       TagIsId( node, TidyTag_META )
  |  |  ------------------
  |  |  |  |  275|  28.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 28.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 27.8k, False: 1.09k]
  |  |  |  |  |  Branch (275:54): [True: 94, False: 27.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2236|  28.8k|            continue;   /* not a meta node */
 2237|     94|        charsetAttr = attrGetCHARSET(currentNode);
  ------------------
  |  |  415|     94|#define attrGetCHARSET( nod )     TY_(AttrGetById)( nod, TidyAttr_CHARSET  )
  |  |  ------------------
  |  |  |  |   23|     94|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     94|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2238|     94|        httpEquivAttr = attrGetHTTP_EQUIV(currentNode);
  ------------------
  |  |  419|     94|#define attrGetHTTP_EQUIV( nod )  TY_(AttrGetById)( nod, TidyAttr_HTTP_EQUIV  )
  |  |  ------------------
  |  |  |  |   23|     94|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     94|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2239|     94|        if (!charsetAttr && !httpEquivAttr)
  ------------------
  |  Branch (2239:13): [True: 94, False: 0]
  |  Branch (2239:29): [True: 94, False: 0]
  ------------------
 2240|     94|            continue;   /* has no charset attribute */
 2241|       |                        /*
 2242|       |                        Meta charset comes in quite a few flavors:
 2243|       |                        1. <meta charset="value"> - expected for (X)HTML5.
 2244|       |                        */
 2245|      0|        if (charsetAttr && !httpEquivAttr)
  ------------------
  |  Branch (2245:13): [True: 0, False: 0]
  |  Branch (2245:28): [True: 0, False: 0]
  ------------------
 2246|      0|        {
 2247|       |            /* we already found one, so remove the rest. */
 2248|      0|            if (charsetFound || !charsetAttr->value)
  ------------------
  |  Branch (2248:17): [True: 0, False: 0]
  |  Branch (2248:33): [True: 0, False: 0]
  ------------------
 2249|      0|            {
 2250|      0|                prevNode = currentNode->prev;
 2251|      0|                TY_(Report)(doc, head, currentNode, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2252|      0|                TY_(DiscardElement)(doc, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2253|      0|                currentNode = prevNode;
 2254|      0|                continue;
 2255|      0|            }
 2256|      0|            charsetFound = yes;
 2257|       |            /* Fix mismatched attribute value */
 2258|      0|            if (TY_(tmbstrcasecmp)(charsetAttr->value, enc) != 0)
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2258:17): [True: 0, False: 0]
  ------------------
 2259|      0|            {
 2260|      0|                newValue = (tmbstr)TidyDocAlloc(doc, TY_(tmbstrlen)(enc) + 1);   /* allocate + 1 for 0 */
  ------------------
  |  |  157|      0|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|      0|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 2261|      0|                TY_(tmbstrcpy)(newValue, enc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2262|       |                /* Note: previously http-equiv had been modified, without warning
 2263|       |                in void TY_(VerifyHTTPEquiv)(TidyDocImpl* doc, Node *head)
 2264|       |                */
 2265|      0|                TY_(ReportAttrError)(doc, currentNode, charsetAttr, ATTRIBUTE_VALUE_REPLACED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2266|      0|                TidyDocFree(doc, charsetAttr->value);   /* free current value */
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2267|      0|                charsetAttr->value = newValue;
 2268|      0|            }
 2269|       |            /* Make sure it's the first element. */
 2270|      0|            if (currentNode != head->content->next) {
  ------------------
  |  Branch (2270:17): [True: 0, False: 0]
  ------------------
 2271|      0|                TY_(RemoveNode)(currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2272|      0|                TY_(InsertNodeAtStart)(head, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2273|      0|            }
 2274|      0|            continue;
 2275|      0|        }
 2276|       |        /*
 2277|       |        2. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 2278|       |        expected for HTML4. This is normally ok - but can clash.
 2279|       |        */
 2280|      0|        if (httpEquivAttr && !charsetAttr)
  ------------------
  |  Branch (2280:13): [True: 0, False: 0]
  |  Branch (2280:30): [True: 0, False: 0]
  ------------------
 2281|      0|        {
 2282|      0|            contentAttr = TY_(AttrGetById)(currentNode, TidyAttr_CONTENT);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2283|      0|            if (!contentAttr)
  ------------------
  |  Branch (2283:17): [True: 0, False: 0]
  ------------------
 2284|      0|                continue;   /* has no 'content' attribute */
 2285|      0|            if (!httpEquivAttr->value)
  ------------------
  |  Branch (2285:17): [True: 0, False: 0]
  ------------------
 2286|      0|            {
 2287|      0|                prevNode = currentNode->prev;
 2288|      0|                TY_(Report)(doc, head, currentNode, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2289|      0|                TY_(DiscardElement)(doc, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2290|      0|                currentNode = prevNode;
 2291|      0|                continue;
 2292|      0|            }
 2293|       |            /* httpEquivAttrValue = TY_(tmbstrtolower)(httpEquivAttr->value); */
 2294|      0|            if (TY_(tmbstrcasecmp)(httpEquivAttr->value, (tmbstr) "content-type") != 0)
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2294:17): [True: 0, False: 0]
  ------------------
 2295|      0|                continue;   /* is not 'content-type' */
 2296|      0|            if (!contentAttr->value)
  ------------------
  |  Branch (2296:17): [True: 0, False: 0]
  ------------------
 2297|      0|            {
 2298|      0|                continue; /* has no 'content' attribute has NO VALUE! */
 2299|      0|            }
 2300|       |            /* check encoding matches
 2301|       |            If a miss-match found here, fix it. previous silently done
 2302|       |            in void TY_(VerifyHTTPEquiv)(TidyDocImpl* doc, Node *head)
 2303|       |            lcontent = TY_(tmbstrtolower)(contentAttr->value);
 2304|       |            */
 2305|      0|            if (TY_(tmbstrcasecmp)(contentAttr->value, (ctmbstr)charsetString.bp) == 0)
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2305:17): [True: 0, False: 0]
  ------------------
 2306|      0|            {
 2307|       |                /* we already found one, so remove the rest. */
 2308|      0|                if (charsetFound)
  ------------------
  |  Branch (2308:21): [True: 0, False: 0]
  ------------------
 2309|      0|                {
 2310|      0|                    prevNode = currentNode->prev;
 2311|      0|                    TY_(Report)(doc, head, currentNode, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2312|      0|                    TY_(DiscardElement)(doc, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2313|      0|                    currentNode = prevNode;
 2314|      0|                    continue;
 2315|      0|                }
 2316|      0|                charsetFound = yes;
 2317|      0|            }
 2318|      0|            else
 2319|      0|            {
 2320|       |                /* fix a mismatch */
 2321|      0|                if (charsetFound)
  ------------------
  |  Branch (2321:21): [True: 0, False: 0]
  ------------------
 2322|      0|                {
 2323|      0|                    prevNode = currentNode->prev;
 2324|      0|                    TY_(Report)(doc, head, currentNode, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2325|      0|                    TY_(DiscardElement)(doc, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2326|      0|                    currentNode = prevNode;
 2327|      0|                }
 2328|      0|                else
 2329|      0|                {
 2330|       |                    /* correct the content */
 2331|      0|                    newValue = (tmbstr)TidyDocAlloc(doc, 19 + TY_(tmbstrlen)(enc) + 1);
  ------------------
  |  |  157|      0|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|      0|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 2332|      0|                    TY_(tmbstrcpy)(newValue, "text/html; charset=");
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2333|      0|                    TY_(tmbstrcpy)(newValue + 19, enc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2334|      0|                    if (cfgBool(doc, TidyShowMetaChange))   /* Issue #456 - backward compatibility only */
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
 2335|      0|                        TY_(ReportAttrError)(doc, currentNode, contentAttr, ATTRIBUTE_VALUE_REPLACED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2336|      0|                    TidyDocFree(doc, contentAttr->value);
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2337|      0|                    contentAttr->value = newValue;
 2338|      0|                    charsetFound = yes;
 2339|      0|                }
 2340|      0|            }
 2341|      0|            continue;
 2342|      0|        }
 2343|       |        /*
 2344|       |        3. <meta charset="utf-8" http-equiv="Content-Type" content="...">
 2345|       |        This is generally bad. Discard and warn.
 2346|       |        */
 2347|      0|        if (httpEquivAttr && charsetAttr)
  ------------------
  |  Branch (2347:13): [True: 0, False: 0]
  |  Branch (2347:30): [True: 0, False: 0]
  ------------------
 2348|      0|        {
 2349|       |            /* printf("WARN ABOUT HTTP EQUIV AND CHARSET ATTR! \n"); */
 2350|      0|            prevNode = currentNode->prev;
 2351|      0|            TY_(Report)(doc, head, currentNode, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2352|      0|            TY_(DiscardElement)(doc, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2353|      0|            currentNode = prevNode;
 2354|      0|        }
 2355|      0|    }
 2356|       |
 2357|       |    /* completed head scan - add appropriate meta - if 'yes' and none exists */
 2358|  20.2k|    if (add_meta && !charsetFound)
  ------------------
  |  Branch (2358:9): [True: 0, False: 20.2k]
  |  Branch (2358:21): [True: 0, False: 0]
  ------------------
 2359|      0|    {
 2360|       |        /* add appropriate meta charset tag - no warning */
 2361|      0|        metaTag = TY_(InferredTag)(doc, TidyTag_META);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2362|      0|        switch (TY_(HTMLVersion)(doc))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2363|      0|        {
 2364|      0|        case HT50:
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
  |  Branch (2364:9): [True: 0, False: 0]
  ------------------
 2365|      0|        case XH50:
  ------------------
  |  |  201|      0|#define XH50              262144u
  ------------------
  |  Branch (2365:9): [True: 0, False: 0]
  ------------------
 2366|      0|            TY_(AddAttribute)(doc, metaTag, "charset", enc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2367|      0|            break;
 2368|      0|        default:
  ------------------
  |  Branch (2368:9): [True: 0, False: 0]
  ------------------
 2369|      0|            tidyBufInit(&buf);
 2370|      0|            tidyBufAppend(&buf, "text/html; ", 11);
 2371|      0|            tidyBufAppend(&buf, charsetString.bp, TY_(tmbstrlen)((ctmbstr)charsetString.bp));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2372|      0|            tidyBufAppend(&buf, "\0", 1);   /* zero terminate the buffer */
 2373|      0|            TY_(AddAttribute)(doc, metaTag, "http-equiv", "Content-Type"); /* add 'http-equiv' const. */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2374|      0|            TY_(AddAttribute)(doc, metaTag, "content", (char*)buf.bp);  /* add 'content="<enc>"' */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2375|      0|            tidyBufFree(&buf);
 2376|      0|        }
 2377|      0|        TY_(InsertNodeAtStart)(head, metaTag);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2378|      0|        TY_(Report)(doc, metaTag, head, ADDED_MISSING_CHARSET); /* actually just 'Info:' */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2379|      0|    }
 2380|  20.2k|    tidyBufFree(&charsetString);
 2381|  20.2k|    return yes;
 2382|  20.2k|}
prvTidyReplacePreformattedSpaces:
 2547|  2.08M|{
 2548|  2.08M|    Node* next;
 2549|       |
 2550|  4.79M|    while (node)
  ------------------
  |  Branch (2550:12): [True: 2.70M, False: 2.08M]
  ------------------
 2551|  2.70M|    {
 2552|  2.70M|        next = node->next;
 2553|       |
 2554|  2.70M|        if (node->tag && node->tag->parser == TY_(ParsePre))
  ------------------
  |  |   23|  2.22M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.22M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2554:13): [True: 2.22M, False: 483k]
  |  Branch (2554:26): [True: 6.38k, False: 2.21M]
  ------------------
 2555|  6.38k|        {
 2556|  6.38k|            TY_(NormalizeSpaces)(doc->lexer, node->content);
  ------------------
  |  |   23|  6.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2557|  6.38k|            node = next;
 2558|  6.38k|            continue;
 2559|  6.38k|        }
 2560|       |
 2561|  2.69M|        if (node->content)
  ------------------
  |  Branch (2561:13): [True: 2.06M, False: 629k]
  ------------------
 2562|  2.06M|            TY_(ReplacePreformattedSpaces)(doc, node->content);
  ------------------
  |  |   23|  2.06M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.06M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2563|       |
 2564|  2.69M|        node = next;
 2565|  2.69M|    }
 2566|  2.08M|}
prvTidyFixLanguageInformation:
 2594|  20.2k|{
 2595|  20.2k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2596|  20.2k|    Node* next;
 2597|       |
 2598|  2.73M|    while (node)
  ------------------
  |  Branch (2598:12): [True: 2.71M, False: 20.2k]
  ------------------
 2599|  2.71M|    {
 2600|  2.71M|        next = node->next;
 2601|       |
 2602|       |        /* todo: report modifications made here to the report system */
 2603|       |
 2604|  2.71M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  2.71M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.71M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2604:13): [True: 2.22M, False: 494k]
  ------------------
 2605|  2.22M|        {
 2606|  2.22M|            AttVal* lang = TY_(AttrGetById)(node, TidyAttr_LANG);
  ------------------
  |  |   23|  2.22M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.22M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2607|  2.22M|            AttVal* xmlLang = TY_(AttrGetById)(node, TidyAttr_XML_LANG);
  ------------------
  |  |   23|  2.22M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.22M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2608|       |
 2609|  2.22M|            if (lang && xmlLang)
  ------------------
  |  Branch (2609:17): [True: 815, False: 2.22M]
  |  Branch (2609:25): [True: 353, False: 462]
  ------------------
 2610|    353|            {
 2611|       |                /*
 2612|       |                  todo: check whether both attributes are in sync,
 2613|       |                  here or elsewhere, where elsewhere is probably
 2614|       |                  preferable.
 2615|       |                  AD - March 2005: not mandatory according the standards.
 2616|       |                */
 2617|    353|            }
 2618|  2.22M|            else if (lang && wantXmlLang)
  ------------------
  |  Branch (2618:22): [True: 462, False: 2.22M]
  |  Branch (2618:30): [True: 462, False: 0]
  ------------------
 2619|    462|            {
 2620|    462|                if (TY_(NodeAttributeVersions)( node, TidyAttr_XML_LANG )
  ------------------
  |  |   23|    462|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    462|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2620:21): [True: 241, False: 221]
  ------------------
 2621|    462|                    & doc->lexer->versionEmitted)
 2622|    241|                    TY_(RepairAttrValue)(doc, node, "xml:lang", lang->value);
  ------------------
  |  |   23|    241|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    241|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2623|    462|            }
 2624|  2.22M|            else if (xmlLang && wantLang)
  ------------------
  |  Branch (2624:22): [True: 34.5k, False: 2.18M]
  |  Branch (2624:33): [True: 34.5k, False: 0]
  ------------------
 2625|  34.5k|            {
 2626|  34.5k|                if (TY_(NodeAttributeVersions)( node, TidyAttr_LANG )
  ------------------
  |  |   23|  34.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2626:21): [True: 32.5k, False: 1.96k]
  ------------------
 2627|  34.5k|                    & doc->lexer->versionEmitted)
 2628|  32.5k|                    TY_(RepairAttrValue)(doc, node, "lang", xmlLang->value);
  ------------------
  |  |   23|  32.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2629|  34.5k|            }
 2630|       |
 2631|  2.22M|            if (lang && !wantLang)
  ------------------
  |  Branch (2631:17): [True: 815, False: 2.22M]
  |  Branch (2631:25): [True: 0, False: 815]
  ------------------
 2632|      0|                TY_(RemoveAttribute)(doc, node, lang);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2633|       |            
 2634|  2.22M|            if (xmlLang && !wantXmlLang)
  ------------------
  |  Branch (2634:17): [True: 34.8k, False: 2.18M]
  |  Branch (2634:28): [True: 0, False: 34.8k]
  ------------------
 2635|      0|                TY_(RemoveAttribute)(doc, node, xmlLang);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2636|  2.22M|        }
 2637|       |
 2638|  2.71M|        if (node->content)
  ------------------
  |  Branch (2638:13): [True: 2.08M, False: 634k]
  ------------------
 2639|  2.08M|        {
 2640|  2.08M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.08M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.08M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2641|  2.08M|            node = node->content;
 2642|  2.08M|            continue;
 2643|  2.08M|        }
 2644|       |
 2645|   634k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   151k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   151k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2645:16): [True: 482k, False: 151k]
  ------------------
 2646|   634k|    }
 2647|  20.2k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2648|  20.2k|}
prvTidyFixXhtmlNamespace:
 2654|  20.2k|{
 2655|  20.2k|    Node* html = TY_(FindHTML)(doc);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2656|  20.2k|    AttVal* xmlns;
 2657|       |
 2658|  20.2k|    if (!html)
  ------------------
  |  Branch (2658:9): [True: 0, False: 20.2k]
  ------------------
 2659|      0|        return;
 2660|       |
 2661|  20.2k|    xmlns = TY_(AttrGetById)(html, TidyAttr_XMLNS);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2662|       |
 2663|  20.2k|    if (wantXmlns)
  ------------------
  |  Branch (2663:9): [True: 20.2k, False: 0]
  ------------------
 2664|  20.2k|    {
 2665|  20.2k|        if (!AttrValueIs(xmlns, XHTML_NAMESPACE))
  ------------------
  |  |  172|  20.2k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  40.4k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 0, False: 20.2k]
  |  |  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  20.2k|                                 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]
  |  |  ------------------
  ------------------
 2666|  20.2k|            TY_(RepairAttrValue)(doc, html, "xmlns", XHTML_NAMESPACE);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, html, "xmlns", XHTML_NAMESPACE);
  ------------------
  |  |   80|  20.2k|#define XHTML_NAMESPACE "http://www.w3.org/1999/xhtml"
  ------------------
 2667|  20.2k|    }
 2668|      0|    else if (xmlns)
  ------------------
  |  Branch (2668:14): [True: 0, False: 0]
  ------------------
 2669|      0|    {
 2670|      0|        TY_(RemoveAttribute)(doc, html, xmlns);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2671|      0|    }
 2672|  20.2k|}
prvTidyFixAnchors:
 2678|  20.2k|{
 2679|  20.2k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2680|  20.2k|    Node* next;
 2681|       |
 2682|  2.73M|    while (node)
  ------------------
  |  Branch (2682:12): [True: 2.71M, False: 20.2k]
  ------------------
 2683|  2.71M|    {
 2684|  2.71M|        next = node->next;
 2685|       |
 2686|  2.71M|        if (TY_(IsAnchorElement)(doc, node))
  ------------------
  |  |   23|  2.71M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.71M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2686:13): [True: 73.8k, False: 2.64M]
  ------------------
 2687|  73.8k|        {
 2688|  73.8k|            AttVal *name = TY_(AttrGetById)(node, TidyAttr_NAME);
  ------------------
  |  |   23|  73.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2689|  73.8k|            AttVal *id = TY_(AttrGetById)(node, TidyAttr_ID);
  ------------------
  |  |   23|  73.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2690|  73.8k|            Bool hadName = name!=NULL;
 2691|  73.8k|            Bool hadId = id!=NULL;
 2692|  73.8k|            Bool IdEmitted = no;
 2693|  73.8k|            Bool NameEmitted = no;
 2694|       |
 2695|       |            /* todo: how are empty name/id attributes handled? */
 2696|       |
 2697|  73.8k|            if (name && id)
  ------------------
  |  Branch (2697:17): [True: 5.50k, False: 68.3k]
  |  Branch (2697:25): [True: 576, False: 4.92k]
  ------------------
 2698|    576|            {
 2699|    576|                Bool NameHasValue = AttrHasValue(name);
  ------------------
  |  |  171|    576|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 576, False: 0]
  |  |  |  Branch (171:44): [True: 363, False: 213]
  |  |  ------------------
  ------------------
 2700|    576|                Bool IdHasValue = AttrHasValue(id);
  ------------------
  |  |  171|    576|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 576, False: 0]
  |  |  |  Branch (171:44): [True: 167, False: 409]
  |  |  ------------------
  ------------------
 2701|    576|                if ( (NameHasValue != IdHasValue) ||
  ------------------
  |  Branch (2701:22): [True: 218, False: 358]
  ------------------
 2702|    358|                     (NameHasValue && IdHasValue &&
  ------------------
  |  Branch (2702:23): [True: 156, False: 202]
  |  Branch (2702:39): [True: 156, False: 0]
  ------------------
 2703|    156|                     TY_(tmbstrcmp)(name->value, id->value) != 0 ) )
  ------------------
  |  |   23|    156|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    156|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2703:22): [True: 74, False: 82]
  ------------------
 2704|    292|                    TY_(ReportAttrError)( doc, node, name, ID_NAME_MISMATCH);
  ------------------
  |  |   23|    292|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    292|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2705|    576|            }
 2706|  73.2k|            else if (name && wantId)
  ------------------
  |  Branch (2706:22): [True: 4.92k, False: 68.3k]
  |  Branch (2706:30): [True: 4.92k, False: 0]
  ------------------
 2707|  4.92k|            {
 2708|  4.92k|                if (TY_(NodeAttributeVersions)( node, TidyAttr_ID )
  ------------------
  |  |   23|  4.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2708:21): [True: 4.43k, False: 489]
  ------------------
 2709|  4.92k|                    & doc->lexer->versionEmitted)
 2710|  4.43k|                {
 2711|  4.43k|                    if (TY_(IsValidHTMLID)(name->value))
  ------------------
  |  |   23|  4.43k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.43k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2711:25): [True: 4.00k, False: 435]
  ------------------
 2712|  4.00k|                    {
 2713|  4.00k|                        TY_(RepairAttrValue)(doc, node, "id", name->value);
  ------------------
  |  |   23|  4.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2714|  4.00k|                        IdEmitted = yes;
 2715|  4.00k|                    }
 2716|    435|                    else
 2717|    435|                        TY_(ReportAttrError)(doc, node, name, INVALID_XML_ID);
  ------------------
  |  |   23|    435|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    435|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2718|  4.43k|                 }
 2719|  4.92k|            }
 2720|  68.3k|            else if (id && wantName)
  ------------------
  |  Branch (2720:22): [True: 1.63k, False: 66.7k]
  |  Branch (2720:28): [True: 1.63k, False: 0]
  ------------------
 2721|  1.63k|            {
 2722|  1.63k|                if (TY_(NodeAttributeVersions)( node, TidyAttr_NAME )
  ------------------
  |  |   23|  1.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2722:21): [True: 378, False: 1.25k]
  ------------------
 2723|  1.63k|                    & doc->lexer->versionEmitted)
 2724|    378|                {
 2725|       |                    /* todo: do not assume id is valid */
 2726|    378|                    TY_(RepairAttrValue)(doc, node, "name", id->value);
  ------------------
  |  |   23|    378|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    378|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2727|    378|                    NameEmitted = yes;
 2728|    378|                }
 2729|  1.63k|            }
 2730|       |
 2731|  73.8k|            if (id && !wantId
  ------------------
  |  Branch (2731:17): [True: 2.20k, False: 71.6k]
  |  Branch (2731:23): [True: 0, False: 2.20k]
  ------------------
 2732|       |                /* make sure that Name has been emitted if requested */
 2733|      0|                && (hadName || !wantName || NameEmitted) ) {
  ------------------
  |  Branch (2733:21): [True: 0, False: 0]
  |  Branch (2733:32): [True: 0, False: 0]
  |  Branch (2733:45): [True: 0, False: 0]
  ------------------
 2734|      0|                if (!wantId && !wantName)
  ------------------
  |  Branch (2734:21): [True: 0, False: 0]
  |  Branch (2734:32): [True: 0, False: 0]
  ------------------
 2735|      0|                    TY_(RemoveAnchorByNode)(doc, id->value, node);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2736|      0|                TY_(RemoveAttribute)(doc, node, id);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2737|      0|            }
 2738|       |
 2739|  73.8k|            if (name && !wantName
  ------------------
  |  Branch (2739:17): [True: 5.50k, False: 68.3k]
  |  Branch (2739:25): [True: 0, False: 5.50k]
  ------------------
 2740|       |                /* make sure that Id has been emitted if requested */
 2741|      0|                && (hadId || !wantId || IdEmitted) ) {
  ------------------
  |  Branch (2741:21): [True: 0, False: 0]
  |  Branch (2741:30): [True: 0, False: 0]
  |  Branch (2741:41): [True: 0, False: 0]
  ------------------
 2742|      0|                if (!wantId && !wantName)
  ------------------
  |  Branch (2742:21): [True: 0, False: 0]
  |  Branch (2742:32): [True: 0, False: 0]
  ------------------
 2743|      0|                    TY_(RemoveAnchorByNode)(doc, name->value, node);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2744|      0|                TY_(RemoveAttribute)(doc, node, name);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2745|      0|            }
 2746|  73.8k|        }
 2747|       |
 2748|  2.71M|        if (node->content)
  ------------------
  |  Branch (2748:13): [True: 2.08M, False: 634k]
  ------------------
 2749|  2.08M|        {
 2750|  2.08M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.08M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.08M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2751|  2.08M|            node = node->content;
 2752|  2.08M|            continue;
 2753|  2.08M|        }
 2754|       |
 2755|   634k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   151k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   151k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2755:16): [True: 482k, False: 151k]
  ------------------
 2756|   634k|    }
 2757|  20.2k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2758|  20.2k|}
prvTidyCleanStyle:
 2806|  20.2k|{
 2807|  20.2k|    Node *head = NULL, *body = NULL;
 2808|  20.2k|    Bool fix = cfgBool(doc, TidyStyleTags);
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2809|       |
 2810|  20.2k|    if (!html)
  ------------------
  |  Branch (2810:9): [True: 0, False: 20.2k]
  ------------------
 2811|      0|        return; /* oops, not given a start node */
 2812|       |
 2813|  20.2k|    head = TY_(FindHEAD)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2814|  20.2k|    body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2815|       |
 2816|  20.2k|    if ((head != NULL) && (body != NULL))
  ------------------
  |  Branch (2816:9): [True: 20.2k, False: 0]
  |  Branch (2816:27): [True: 19.9k, False: 230]
  ------------------
 2817|  19.9k|    {
 2818|  19.9k|		StyleToHead(doc, head, body, fix, 0); /* found head and body */
 2819|  19.9k|    }
 2820|  20.2k|}
prvTidyCleanHead:
 2830|  20.2k|{
 2831|  20.2k|    Node *head, *node, *next;
 2832|  20.2k|    uint titles = 0;
 2833|  20.2k|    if (cfgAutoBool(doc, TidyBodyOnly) == TidyYesState)
  ------------------
  |  |  421|  20.2k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2833:9): [True: 0, False: 20.2k]
  ------------------
 2834|      0|        return; /* not going to show head, so forget it */
 2835|  20.2k|    head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2836|  20.2k|    if (!head)
  ------------------
  |  Branch (2836:9): [True: 0, False: 20.2k]
  ------------------
 2837|      0|        return;
 2838|  20.2k|    node = head->content;
 2839|  69.3k|    while (node)
  ------------------
  |  Branch (2839:12): [True: 49.1k, False: 20.2k]
  ------------------
 2840|  49.1k|    {
 2841|  49.1k|        next = node->next;  /* get any 'next' */
 2842|  49.1k|        if (nodeIsTITLE(node))
  ------------------
  |  |  372|  49.1k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  49.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 49.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 48.0k, False: 1.09k]
  |  |  |  |  |  Branch (275:54): [True: 22.4k, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2843|  22.4k|        {
 2844|  22.4k|            titles++;
 2845|  22.4k|            if (titles > 1)
  ------------------
  |  Branch (2845:17): [True: 2.28k, False: 20.2k]
  ------------------
 2846|  2.28k|            {
 2847|  2.28k|                TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2848|  2.28k|                TY_(DiscardElement)(doc, node); /* delete this node */
  ------------------
  |  |   23|  2.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2849|  2.28k|            }
 2850|  22.4k|        }
 2851|  49.1k|        node = next;
 2852|  49.1k|    }
 2853|  20.2k|}
clean.c:MergeProperties:
  645|  1.06k|{
  646|  1.06k|    tmbstr s;
  647|  1.06k|    StyleProp *prop;
  648|       |
  649|       |    prop = CreateProps(doc, NULL, s1);
  650|  1.06k|    prop = CreateProps(doc, prop, s2);
  651|  1.06k|    s = CreatePropString(doc, prop);
  652|  1.06k|    FreeStyleProps(doc, prop);
  653|  1.06k|    return s;
  654|  1.06k|}
clean.c:CreateProps:
  140|  2.12k|{
  141|  2.12k|    tmbstr name, value = NULL, name_end, value_end, line;
  142|  2.12k|    Bool more;
  143|       |
  144|  2.12k|    line = TY_(tmbstrdup)(doc->allocator, style);
  ------------------
  |  |   23|  2.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  145|  2.12k|    name = line;
  146|       |
  147|  3.38k|    while (*name)
  ------------------
  |  Branch (147:12): [True: 3.02k, False: 359]
  ------------------
  148|  3.02k|    {
  149|  3.28k|        while (*name == ' ')
  ------------------
  |  Branch (149:16): [True: 263, False: 3.02k]
  ------------------
  150|    263|            ++name;
  151|       |
  152|  3.02k|        name_end = name;
  153|       |
  154|  22.5k|        while (*name_end)
  ------------------
  |  Branch (154:16): [True: 22.2k, False: 370]
  ------------------
  155|  22.2k|        {
  156|  22.2k|            if (*name_end == ':')
  ------------------
  |  Branch (156:17): [True: 2.65k, False: 19.5k]
  ------------------
  157|  2.65k|            {
  158|  2.65k|                value = name_end + 1;
  159|  2.65k|                break;
  160|  2.65k|            }
  161|       |
  162|  19.5k|            ++name_end;
  163|  19.5k|        }
  164|       |
  165|  3.02k|        if (*name_end != ':')
  ------------------
  |  Branch (165:13): [True: 370, False: 2.65k]
  ------------------
  166|    370|            break;
  167|       |
  168|  3.71k|        while ( value && *value == ' ')
  ------------------
  |  Branch (168:17): [True: 3.71k, False: 0]
  |  Branch (168:26): [True: 1.06k, False: 2.65k]
  ------------------
  169|  1.06k|            ++value;
  170|       |
  171|  2.65k|        value_end = value;
  172|  2.65k|        more = no;
  173|       |
  174|  33.4k|        while (*value_end)
  ------------------
  |  Branch (174:16): [True: 32.0k, False: 1.39k]
  ------------------
  175|  32.0k|        {
  176|  32.0k|            if (*value_end == ';')
  ------------------
  |  Branch (176:17): [True: 1.26k, False: 30.7k]
  ------------------
  177|  1.26k|            {
  178|  1.26k|                more = yes;
  179|  1.26k|                break;
  180|  1.26k|            }
  181|       |
  182|  30.7k|            ++value_end;
  183|  30.7k|        }
  184|       |
  185|  2.65k|        *name_end = '\0';
  186|  2.65k|        *value_end = '\0';
  187|       |
  188|  2.65k|        prop = InsertProperty(doc, prop, name, value);
  189|  2.65k|        *name_end = ':';
  190|       |
  191|  2.65k|        if (more)
  ------------------
  |  Branch (191:13): [True: 1.26k, False: 1.39k]
  ------------------
  192|  1.26k|        {
  193|  1.26k|            *value_end = ';';
  194|  1.26k|            name = value_end + 1;
  195|  1.26k|            continue;
  196|  1.26k|        }
  197|       |
  198|  1.39k|        break;
  199|  2.65k|    }
  200|       |
  201|  2.12k|    TidyDocFree(doc, line);  /* free temporary copy */
  ------------------
  |  |  159|  2.12k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  2.12k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  202|  2.12k|    return prop;
  203|  2.12k|}
clean.c:InsertProperty:
   81|  2.65k|{
   82|  2.65k|    StyleProp *first, *prev, *prop;
   83|  2.65k|    int cmp;
   84|       |
   85|  2.65k|    prev = NULL;
   86|  2.65k|    first = props;
   87|       |
   88|  3.88k|    while (props)
  ------------------
  |  Branch (88:12): [True: 2.48k, False: 1.39k]
  ------------------
   89|  2.48k|    {
   90|  2.48k|        cmp = TY_(tmbstrcmp)(props->name, name);
  ------------------
  |  |   23|  2.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   91|       |
   92|  2.48k|        if (cmp == 0)
  ------------------
  |  Branch (92:13): [True: 778, False: 1.70k]
  ------------------
   93|    778|        {
   94|       |            /* this property is already defined, ignore new value */
   95|    778|            return first;
   96|    778|        }
   97|       |
   98|  1.70k|        if (cmp > 0)
  ------------------
  |  Branch (98:13): [True: 482, False: 1.22k]
  ------------------
   99|    482|        {
  100|       |            /* insert before this */
  101|       |
  102|    482|            prop = (StyleProp *)TidyDocAlloc(doc, sizeof(StyleProp));
  ------------------
  |  |  157|    482|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|    482|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  103|    482|            prop->name = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|    482|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    482|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  104|    482|            prop->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|    482|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    482|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  105|    482|            prop->next = props;
  106|       |
  107|    482|            if (prev)
  ------------------
  |  Branch (107:17): [True: 110, False: 372]
  ------------------
  108|    110|                prev->next = prop;
  109|    372|            else
  110|    372|                first = prop;
  111|       |
  112|    482|            return first;
  113|    482|        }
  114|       |
  115|  1.22k|        prev = props;
  116|  1.22k|        props = props->next;
  117|  1.22k|    }
  118|       |
  119|  1.39k|    prop = (StyleProp *)TidyDocAlloc(doc, sizeof(StyleProp));
  ------------------
  |  |  157|  1.39k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  1.39k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  120|  1.39k|    prop->name = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|  1.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  121|  1.39k|    prop->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|  1.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  122|  1.39k|    prop->next = NULL;
  123|       |
  124|  1.39k|    if (prev)
  ------------------
  |  Branch (124:9): [True: 333, False: 1.06k]
  ------------------
  125|    333|        prev->next = prop;
  126|  1.06k|    else
  127|  1.06k|        first = prop;
  128|       |
  129|  1.39k|    return first;
  130|  2.65k|}
clean.c:CreatePropString:
  206|  1.06k|{
  207|  1.06k|    tmbstr style, p, s;
  208|  1.06k|    uint len;
  209|  1.06k|    StyleProp *prop;
  210|       |
  211|       |    /* compute length */
  212|       |
  213|  2.93k|    for (len = 0, prop = props; prop; prop = prop->next)
  ------------------
  |  Branch (213:33): [True: 1.87k, False: 1.06k]
  ------------------
  214|  1.87k|    {
  215|  1.87k|        len += TY_(tmbstrlen)(prop->name) + 2;
  ------------------
  |  |   23|  1.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  216|  1.87k|        if (prop->value)
  ------------------
  |  Branch (216:13): [True: 1.87k, False: 0]
  ------------------
  217|  1.87k|            len += TY_(tmbstrlen)(prop->value) + 2;
  ------------------
  |  |   23|  1.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  218|  1.87k|    }
  219|       |
  220|  1.06k|    style = (tmbstr) TidyDocAlloc(doc, len+1);
  ------------------
  |  |  157|  1.06k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  1.06k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  221|  1.06k|    style[0] = '\0';
  222|       |
  223|  1.87k|    for (p = style, prop = props; prop; prop = prop->next)
  ------------------
  |  Branch (223:35): [True: 1.87k, False: 0]
  ------------------
  224|  1.87k|    {
  225|  1.87k|        s = prop->name;
  226|       |
  227|  18.0k|        while((*p++ = *s++))
  ------------------
  |  Branch (227:15): [True: 16.1k, False: 1.87k]
  ------------------
  228|  16.1k|            continue;
  229|       |
  230|  1.87k|        if (prop->value)
  ------------------
  |  Branch (230:13): [True: 1.87k, False: 0]
  ------------------
  231|  1.87k|        {
  232|  1.87k|            *--p = ':';
  233|  1.87k|            *++p = ' ';
  234|  1.87k|            ++p;
  235|       |
  236|  1.87k|            s = prop->value;
  237|  26.0k|            while((*p++ = *s++))
  ------------------
  |  Branch (237:19): [True: 24.2k, False: 1.87k]
  ------------------
  238|  24.2k|                continue;
  239|  1.87k|        }
  240|  1.87k|        if (prop->next == NULL)
  ------------------
  |  Branch (240:13): [True: 1.06k, False: 815]
  ------------------
  241|  1.06k|            break;
  242|       |
  243|    815|        *--p = ';';
  244|    815|        *++p = ' ';
  245|    815|        ++p;
  246|    815|    }
  247|       |
  248|  1.06k|    return style;
  249|  1.06k|}
clean.c:FreeStyleProps:
   67|  1.06k|{
   68|  1.06k|    StyleProp *next;
   69|       |
   70|  2.93k|    while (props)
  ------------------
  |  Branch (70:12): [True: 1.87k, False: 1.06k]
  ------------------
   71|  1.87k|    {
   72|  1.87k|        next = props->next;
   73|  1.87k|        TidyDocFree(doc, props->name);
  ------------------
  |  |  159|  1.87k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  1.87k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   74|  1.87k|        TidyDocFree(doc, props->value);
  ------------------
  |  |  159|  1.87k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  1.87k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   75|  1.87k|        TidyDocFree(doc, props);
  ------------------
  |  |  159|  1.87k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  1.87k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   76|  1.87k|        props = next;
   77|  1.87k|    }
   78|  1.06k|}
clean.c:DiscardContainer:
  599|  2.30k|{
  600|  2.30k|    if (element->content)
  ------------------
  |  Branch (600:9): [True: 1.91k, False: 390]
  ------------------
  601|  1.91k|    {
  602|  1.91k|        Node *node, *parent = element->parent;
  603|       |
  604|  1.91k|        element->last->next = element->next;
  605|       |
  606|  1.91k|        if (element->next)
  ------------------
  |  Branch (606:13): [True: 445, False: 1.46k]
  ------------------
  607|    445|        {
  608|    445|            element->next->prev = element->last;
  609|    445|        }
  610|  1.46k|        else
  611|  1.46k|            parent->last = element->last;
  612|       |
  613|  1.91k|        if (element->prev)
  ------------------
  |  Branch (613:13): [True: 824, False: 1.08k]
  ------------------
  614|    824|        {
  615|    824|            element->content->prev = element->prev;
  616|    824|            element->prev->next = element->content;
  617|    824|        }
  618|  1.08k|        else
  619|  1.08k|            parent->content = element->content;
  620|       |
  621|  7.79k|        for (node = element->content; node; node = node->next)
  ------------------
  |  Branch (621:39): [True: 5.88k, False: 1.91k]
  ------------------
  622|  5.88k|            node->parent = parent;
  623|       |
  624|  1.91k|        *pnode = element->content;
  625|       |
  626|  1.91k|        element->next = element->content = NULL;
  627|  1.91k|        TY_(FreeNode)(doc, element);
  ------------------
  |  |   23|  1.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  628|  1.91k|    }
  629|    390|    else
  630|    390|    {
  631|    390|        *pnode = TY_(DiscardElement)(doc, element);
  ------------------
  |  |   23|    390|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    390|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  632|    390|    }
  633|  2.30k|}
clean.c:RenameElem:
   59|  45.9k|{
   60|  45.9k|    const Dict* dict = TY_(LookupTagDef)( tid );
  ------------------
  |  |   23|  45.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   61|  45.9k|    TidyDocFree( doc, node->element );
  ------------------
  |  |  159|  45.9k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  45.9k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   62|  45.9k|    node->element = TY_(tmbstrdup)( doc->allocator, dict->name );
  ------------------
  |  |   23|  45.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   63|  45.9k|    node->tag = dict;
   64|  45.9k|}
clean.c:HasOneChild:
 1550|  94.0k|{
 1551|  94.0k|    return (node->content && node->content->next == NULL);
  ------------------
  |  Branch (1551:13): [True: 93.7k, False: 204]
  |  Branch (1551:30): [True: 86.1k, False: 7.68k]
  ------------------
 1552|  94.0k|}
clean.c:StripOnlyChild:
  581|  77.9k|{
  582|  77.9k|    Node *child;
  583|       |
  584|  77.9k|    child = node->content;
  585|  77.9k|    node->content = child->content;
  586|  77.9k|    node->last = child->last;
  587|  77.9k|    child->content = NULL;
  588|  77.9k|    TY_(FreeNode)(doc, child);
  ------------------
  |  |   23|  77.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  77.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  589|       |
  590|   165k|    for (child = node->content; child; child = child->next)
  ------------------
  |  Branch (590:33): [True: 87.6k, False: 77.9k]
  ------------------
  591|  87.6k|        child->parent = node;
  592|  77.9k|}
clean.c:StyleToHead:
 2764|  19.9k|{
 2765|  19.9k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  19.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2766|  19.9k|    Node *next;
 2767|       |    
 2768|  2.55M|    while (node)
  ------------------
  |  Branch (2768:12): [True: 2.53M, False: 19.9k]
  ------------------
 2769|  2.53M|    {
 2770|  2.53M|        next = node->next;
 2771|       |        
 2772|  2.53M|        if (nodeIsSTYLE(node))
  ------------------
  |  |  421|  2.53M|#define nodeIsSTYLE( node )      TagIsId( node, TidyTag_STYLE )
  |  |  ------------------
  |  |  |  |  275|  2.53M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.53M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.17M, False: 362k]
  |  |  |  |  |  Branch (275:54): [True: 758, False: 2.17M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2773|    758|        {
 2774|    758|            if (fix)
  ------------------
  |  Branch (2774:17): [True: 758, False: 0]
  ------------------
 2775|    758|            {
 2776|    758|                TY_(RemoveNode)(node); /* unhook style node from body */
  ------------------
  |  |   23|    758|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    758|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2777|    758|                TY_(InsertNodeAtEnd)(head, node);   /* add to end of head */
  ------------------
  |  |   23|    758|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    758|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2778|    758|                TY_(Report)(doc, node, head, MOVED_STYLE_TO_HEAD); /* report move */
  ------------------
  |  |   23|    758|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    758|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2779|    758|            }
 2780|      0|            else
 2781|      0|            {
 2782|      0|                TY_(Report)(doc, node, head, FOUND_STYLE_IN_BODY);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2783|      0|            }
 2784|    758|        }
 2785|  2.53M|        else if (node->content)
  ------------------
  |  Branch (2785:18): [True: 2.05M, False: 485k]
  ------------------
 2786|  2.05M|        {
 2787|  2.05M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.05M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.05M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2788|  2.05M|            node = node->content;
 2789|  2.05M|            indent++;
 2790|  2.05M|            continue;
 2791|  2.05M|        }
 2792|       |        
 2793|   486k|        if (next)
  ------------------
  |  Branch (2793:13): [True: 366k, False: 120k]
  ------------------
 2794|   366k|            node = next;
 2795|   120k|        else
 2796|   120k|        {
 2797|   120k|            node = TY_(pop)(stack);
  ------------------
  |  |   23|   120k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   120k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2798|   120k|            indent--;
 2799|   120k|        }
 2800|   486k|    }
 2801|  19.9k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  19.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2802|  19.9k|}

prvTidyInitConfig:
  311|  20.2k|{
  312|  20.2k|    TidyClearMemory( &doc->config, sizeof(TidyConfigImpl) );
  ------------------
  |  |   70|  20.2k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  313|  20.2k|    TY_(ResetConfigToDefault)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  314|  20.2k|}
prvTidyFreeConfig:
  318|  20.2k|{
  319|  20.2k|    doc->pConfigChangeCallback = NULL;
  320|  20.2k|    TY_(ResetConfigToDefault)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  321|  20.2k|    TY_(TakeConfigSnapshot)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  322|  20.2k|}
prvTidySetOptionInt:
  482|  87.8k|{
  483|  87.8k|    Bool status = ( optId < N_TIDY_OPTIONS );
  484|  87.8k|    if ( status )
  ------------------
  |  Branch (484:10): [True: 87.8k, False: 0]
  ------------------
  485|  87.8k|    {
  486|  87.8k|        assert( option_defs[ optId ].type == TidyInteger );
  ------------------
  |  Branch (486:9): [True: 0, False: 87.8k]
  |  Branch (486:9): [True: 87.8k, False: 0]
  ------------------
  487|  87.8k|        SetOptionInteger( doc, optId, val );
  488|  87.8k|    }
  489|  87.8k|    return status;
  490|  87.8k|}
prvTidySetOptionBool:
  494|   303k|{
  495|   303k|    Bool status = ( optId < N_TIDY_OPTIONS );
  496|   303k|    if ( status )
  ------------------
  |  Branch (496:10): [True: 303k, False: 0]
  ------------------
  497|   303k|    {
  498|   303k|        assert( option_defs[ optId ].type == TidyBoolean );
  ------------------
  |  Branch (498:9): [True: 0, False: 303k]
  |  Branch (498:9): [True: 303k, False: 0]
  ------------------
  499|   303k|        SetOptionInteger( doc, optId, (ulong)val );
  500|   303k|    }
  501|   303k|    return status;
  502|   303k|}
prvTidyResetConfigToDefault:
  693|  40.4k|{
  694|  40.4k|    uint ixVal;
  695|  40.4k|    const TidyOptionImpl* option = option_defs;
  696|  40.4k|    TidyOptionValue* value = &doc->config.value[ 0 ];
  697|  4.24M|    for ( ixVal=0; ixVal < N_TIDY_OPTIONS; ++option, ++ixVal )
  ------------------
  |  Branch (697:20): [True: 4.20M, False: 40.4k]
  ------------------
  698|  4.20M|    {
  699|  4.20M|        TidyOptionValue dflt;
  700|  4.20M|        assert( ixVal == (uint) option->id );
  ------------------
  |  Branch (700:9): [True: 0, False: 4.20M]
  |  Branch (700:9): [True: 4.20M, False: 0]
  ------------------
  701|  4.20M|        GetOptionDefault( option, &dflt );
  702|  4.20M|        CopyOptionValue( doc, option, &value[ixVal], &dflt );
  703|  4.20M|    }
  704|  40.4k|    TY_(FreeDeclaredTags)( doc, tagtype_null );
  ------------------
  |  |   23|  40.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  705|  40.4k|}
prvTidyTakeConfigSnapshot:
  709|  40.4k|{
  710|  40.4k|    uint ixVal;
  711|  40.4k|    const TidyOptionImpl* option = option_defs;
  712|  40.4k|    const TidyOptionValue* value = &doc->config.value[ 0 ];
  713|  40.4k|    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|  4.24M|    for ( ixVal=0; ixVal < N_TIDY_OPTIONS; ++option, ++ixVal )
  ------------------
  |  Branch (720:20): [True: 4.20M, False: 40.4k]
  ------------------
  721|  4.20M|    {
  722|  4.20M|        assert( ixVal == (uint) option->id );
  ------------------
  |  Branch (722:9): [True: 0, False: 4.20M]
  |  Branch (722:9): [True: 4.20M, False: 0]
  ------------------
  723|  4.20M|        CopyOptionValue( doc, option, &snap[ixVal], &value[ixVal] );
  724|  4.20M|    }
  725|  40.4k|}
prvTidyAdjustConfig:
 1230|  20.2k|{
 1231|  20.2k|    if ( cfgBool(doc, TidyEncloseBlockText) )
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.2k]
  |  |  ------------------
  ------------------
 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|  20.2k|    if ( cfgAutoBool(doc, TidyIndentContent) == TidyNoState )
  ------------------
  |  |  421|  20.2k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1234:10): [True: 20.2k, False: 0]
  ------------------
 1235|  20.2k|        TY_(SetOptionInt)( doc, TidyIndentSpaces, 0 );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1236|       |
 1237|       |    /* disable wrapping */
 1238|  20.2k|    if ( cfg(doc, TidyWrapLen) == 0 )
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1238:10): [True: 0, False: 20.2k]
  ------------------
 1239|      0|        TY_(SetOptionInt)( doc, TidyWrapLen, 0x7FFFFFFF );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1240|       |
 1241|       |    /* Word 2000 needs o:p to be declared as inline */
 1242|  20.2k|    if ( cfgBool(doc, TidyWord2000) )
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.2k]
  |  |  ------------------
  ------------------
 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|  20.2k|    if ( cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.2k]
  |  |  ------------------
  ------------------
 1250|      0|        TY_(SetOptionBool)( doc, TidyXhtmlOut, no );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1251|       |
 1252|       |    /* XHTML is written in lower case */
 1253|  20.2k|    if ( cfgBool(doc, TidyXhtmlOut) )
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 20.2k, False: 0]
  |  |  ------------------
  ------------------
 1254|  20.2k|    {
 1255|  20.2k|        TY_(SetOptionBool)( doc, TidyXmlOut, yes );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1256|  20.2k|        TY_(SetOptionBool)( doc, TidyUpperCaseTags, no );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1257|  20.2k|        TY_(SetOptionInt)( doc, TidyUpperCaseAttrs, no );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1258|       |        /* TY_(SetOptionBool)( doc, TidyXmlPIs, yes ); */
 1259|  20.2k|    }
 1260|       |
 1261|       |    /* if XML in, then XML out */
 1262|  20.2k|    if ( cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.2k]
  |  |  ------------------
  ------------------
 1263|      0|    {
 1264|      0|        TY_(SetOptionBool)( doc, TidyXmlOut, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1265|      0|        TY_(SetOptionBool)( doc, TidyXmlPIs, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1266|      0|    }
 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|  20.2k|    if ( cfg(doc, TidyOutCharEncoding) != ASCII &&
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                  if ( cfg(doc, TidyOutCharEncoding) != ASCII &&
  ------------------
  |  |  134|  40.4k|#define ASCII       1
  ------------------
  |  Branch (1272:10): [True: 20.2k, False: 0]
  ------------------
 1273|  20.2k|         cfg(doc, TidyOutCharEncoding) != UTF8 &&
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != UTF8 &&
  ------------------
  |  |  137|  40.4k|#define UTF8        4
  ------------------
  |  Branch (1273:10): [True: 0, False: 20.2k]
  ------------------
 1274|      0|         cfg(doc, TidyOutCharEncoding) != UTF16 &&
  ------------------
  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != UTF16 &&
  ------------------
  |  |  144|  20.2k|#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|  20.2k|#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|  20.2k|#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|  20.2k|#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|  20.2k|    if ( cfgBool(doc, TidyXmlOut) )
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 20.2k, False: 0]
  |  |  ------------------
  ------------------
 1285|  20.2k|    {
 1286|       |        /* XML requires a BOM on output if using UTF-16 encoding */
 1287|  20.2k|        ulong enc = cfg( doc, TidyOutCharEncoding );
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1288|  20.2k|        if ( enc == UTF16LE || enc == UTF16BE || enc == UTF16 )
  ------------------
  |  |  142|  40.4k|#define UTF16LE     9
  ------------------
                      if ( enc == UTF16LE || enc == UTF16BE || enc == UTF16 )
  ------------------
  |  |  143|  40.4k|#define UTF16BE     10
  ------------------
                      if ( enc == UTF16LE || enc == UTF16BE || enc == UTF16 )
  ------------------
  |  |  144|  20.2k|#define UTF16       11
  ------------------
  |  Branch (1288:14): [True: 0, False: 20.2k]
  |  Branch (1288:32): [True: 0, False: 20.2k]
  |  Branch (1288:50): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|        TY_(SetOptionBool)( doc, TidyQuoteAmpersand, yes );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1292|  20.2k|        TY_(SetOptionBool)( doc, TidyOmitOptionalTags, no );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1293|  20.2k|    }
 1294|       |    
 1295|       |    /* Setup the indent character. */
 1296|  20.2k|    if cfgBool(doc, TidyPPrintTabs) 
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:34): [True: 0, False: 20.2k]
  |  |  ------------------
  ------------------
 1297|      0|        doc->indent_char = '\t';
 1298|  20.2k|    else
 1299|  20.2k|        doc->indent_char = ' ';
 1300|  20.2k|}
prvTidyCharEncodingName:
 1714|    356|{
 1715|    356|    ctmbstr encodingName = TY_(GetEncodingNameFromTidyId)(encoding);
  ------------------
  |  |   23|    356|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    356|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1716|       |
 1717|    356|    if (!encodingName)
  ------------------
  |  Branch (1717:9): [True: 0, False: 356]
  ------------------
 1718|      0|        encodingName = "unknown";
 1719|       |
 1720|    356|    return encodingName;
 1721|    356|}
config.c:SetOptionInteger:
  470|   391k|{
  471|   391k|    const TidyOptionImpl* option = &option_defs[ optId ];
  472|   391k|    ulong* optVal = &(doc->config.value[ optId ].v);
  473|   391k|    Bool fire_callback = doc->pConfigChangeCallback && *optVal != val;
  ------------------
  |  Branch (473:26): [True: 0, False: 391k]
  |  Branch (473:56): [True: 0, False: 0]
  ------------------
  474|       |
  475|   391k|    *optVal = val;
  476|       |
  477|   391k|    if ( fire_callback )
  ------------------
  |  Branch (477:10): [True: 0, False: 391k]
  ------------------
  478|      0|        PerformOptionChangedCallback( doc, option );
  479|   391k|}
config.c:GetOptionDefault:
  507|  4.20M|{
  508|  4.20M|    if ( option->type == TidyString )
  ------------------
  |  Branch (508:10): [True: 525k, False: 3.67M]
  ------------------
  509|   525k|        dflt->p = (char*)option->pdflt;
  510|  3.67M|    else
  511|  3.67M|        dflt->v = option->dflt;
  512|  4.20M|}
config.c:CopyOptionValue:
  386|  8.40M|{
  387|  8.40M|    Bool fire_callback = no;
  388|  8.40M|    assert( oldval != NULL );
  ------------------
  |  Branch (388:5): [True: 0, False: 8.40M]
  |  Branch (388:5): [True: 8.40M, False: 0]
  ------------------
  389|       |
  390|       |    /* Compare the old and new values. */
  391|  8.40M|    if ( doc->pConfigChangeCallback )
  ------------------
  |  Branch (391:10): [True: 0, False: 8.40M]
  ------------------
  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|  8.40M|    FreeOptionValue( doc, option, oldval );
  400|       |
  401|  8.40M|    if ( option->type == TidyString )
  ------------------
  |  Branch (401:10): [True: 1.05M, False: 7.35M]
  ------------------
  402|  1.05M|    {
  403|  1.05M|        if ( newval->p && newval->p != option->pdflt )
  ------------------
  |  Branch (403:14): [True: 80.8k, False: 969k]
  |  Branch (403:27): [True: 0, False: 80.8k]
  ------------------
  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|  1.05M|        else
  406|  1.05M|            oldval->p = newval->p;
  407|  1.05M|    }
  408|  7.35M|    else
  409|  7.35M|        oldval->v = newval->v;
  410|       |
  411|  8.40M|    if ( fire_callback )
  ------------------
  |  Branch (411:10): [True: 0, False: 8.40M]
  ------------------
  412|      0|        PerformOptionChangedCallback( doc, option );
  413|  8.40M|}
config.c:FreeOptionValue:
  378|  8.40M|{
  379|  8.40M|    if ( option->type == TidyString && value->p && value->p != option->pdflt )
  ------------------
  |  Branch (379:10): [True: 1.05M, False: 7.35M]
  |  Branch (379:40): [True: 40.4k, False: 1.01M]
  |  Branch (379:52): [True: 0, False: 40.4k]
  ------------------
  380|  8.40M|        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|  8.40M|}

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

prvTidyDupAttrs:
   16|  2.31M|{
   17|  2.31M|    AttVal *newattrs;
   18|       |
   19|  2.31M|    if (attrs == NULL)
  ------------------
  |  Branch (19:9): [True: 2.08M, False: 222k]
  ------------------
   20|  2.08M|        return attrs;
   21|       |
   22|   222k|    newattrs = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|   222k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   222k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   23|   222k|    *newattrs = *attrs;
   24|   222k|    newattrs->next = TY_(DupAttrs)( doc, attrs->next );
  ------------------
  |  |   23|   222k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   222k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   25|   222k|    newattrs->attribute = TY_(tmbstrdup)(doc->allocator, attrs->attribute);
  ------------------
  |  |   23|   222k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   222k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   26|   222k|    newattrs->value = TY_(tmbstrdup)(doc->allocator, attrs->value);
  ------------------
  |  |   23|   222k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   222k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   27|   222k|    newattrs->dict = TY_(FindAttribute)(doc, newattrs);
  ------------------
  |  |   23|   222k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   222k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   28|   222k|    newattrs->asp = attrs->asp ? TY_(CloneNode)(doc, attrs->asp) : NULL;
  ------------------
  |  |   23|  3.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (28:21): [True: 3.44k, False: 219k]
  ------------------
   29|   222k|    newattrs->php = attrs->php ? TY_(CloneNode)(doc, attrs->php) : NULL;
  ------------------
  |  |   23|  4.32k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.32k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (29:21): [True: 4.32k, False: 218k]
  ------------------
   30|   222k|    return newattrs;
   31|  2.31M|}
prvTidyPushInline:
   70|  2.09M|{
   71|  2.09M|    Lexer* lexer = doc->lexer;
   72|  2.09M|    IStack *istack;
   73|       |
   74|  2.09M|    if (node->implicit)
  ------------------
  |  Branch (74:9): [True: 1.92M, False: 175k]
  ------------------
   75|  1.92M|        return;
   76|       |
   77|   175k|    if ( !IsNodePushable(node) )
  ------------------
  |  Branch (77:10): [True: 1.30k, False: 173k]
  ------------------
   78|  1.30k|        return;
   79|       |
   80|   173k|    if ( !nodeIsFONT(node) && TY_(IsPushed)(doc, node) )
  ------------------
  |  |  417|   173k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|   347k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 173k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 173k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 142k, False: 31.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( !nodeIsFONT(node) && TY_(IsPushed)(doc, node) )
  ------------------
  |  |   23|  31.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (80:31): [True: 17.5k, False: 14.1k]
  ------------------
   81|  17.5k|        return;
   82|       |
   83|       |    /* make sure there is enough space for the stack */
   84|   156k|    if (lexer->istacksize + 1 > lexer->istacklength)
  ------------------
  |  Branch (84:9): [True: 7.99k, False: 148k]
  ------------------
   85|  7.99k|    {
   86|  7.99k|        if (lexer->istacklength == 0)
  ------------------
  |  Branch (86:13): [True: 6.72k, False: 1.27k]
  ------------------
   87|  6.72k|            lexer->istacklength = 6;   /* this is perhaps excessive */
   88|       |
   89|  7.99k|        lexer->istacklength = lexer->istacklength * 2;
   90|  7.99k|        lexer->istack = (IStack *)TidyDocRealloc(doc, lexer->istack,
  ------------------
  |  |  158|  7.99k|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|  7.99k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
   91|  7.99k|                            sizeof(IStack)*(lexer->istacklength));
   92|  7.99k|    }
   93|       |
   94|   156k|    istack = &(lexer->istack[lexer->istacksize]);
   95|   156k|    istack->tag = node->tag;
   96|       |
   97|   156k|    istack->element = TY_(tmbstrdup)(doc->allocator, node->element);
  ------------------
  |  |   23|   156k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   156k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   98|   156k|    istack->attributes = TY_(DupAttrs)( doc, node->attributes );
  ------------------
  |  |   23|   156k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   156k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   99|   156k|    ++(lexer->istacksize);
  100|   156k|}
prvTidyPopInline:
  137|  97.7k|{
  138|  97.7k|    Lexer* lexer = doc->lexer;
  139|       |
  140|  97.7k|    if (node)
  ------------------
  |  Branch (140:9): [True: 27.3k, False: 70.3k]
  ------------------
  141|  27.3k|    {
  142|  27.3k|        if ( !IsNodePushable(node) )
  ------------------
  |  Branch (142:14): [True: 820, False: 26.5k]
  ------------------
  143|    820|            return;
  144|       |
  145|       |        /* if node is </a> then pop until we find an <a> */
  146|  26.5k|        if ( nodeIsA(node) )
  ------------------
  |  |  401|  26.5k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  26.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 26.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 26.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.07k, False: 23.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  147|  3.07k|        {
  148|  3.07k|            PopIStackUntil( doc, TidyTag_A );
  149|  3.07k|            return;
  150|  3.07k|        }
  151|  26.5k|    }
  152|       |
  153|  93.8k|    if (lexer->istacksize > 0)
  ------------------
  |  Branch (153:9): [True: 90.9k, False: 2.88k]
  ------------------
  154|  90.9k|    {
  155|  90.9k|        PopIStack( doc );
  156|       |
  157|       |        /* #427822 - fix by Randy Waki 7 Aug 00 */
  158|  90.9k|        if (lexer->insert >= lexer->istack + lexer->istacksize)
  ------------------
  |  Branch (158:13): [True: 246, False: 90.6k]
  ------------------
  159|    246|            lexer->insert = NULL;
  160|  90.9k|    }
  161|  93.8k|}
prvTidyIsPushed:
  164|  5.06M|{
  165|  5.06M|    Lexer* lexer = doc->lexer;
  166|  5.06M|    int i;
  167|       |
  168|   355M|    for (i = lexer->istacksize - 1; i >= 0; --i)
  ------------------
  |  Branch (168:37): [True: 354M, False: 1.08M]
  ------------------
  169|   354M|    {
  170|   354M|        if (lexer->istack[i].tag == node->tag)
  ------------------
  |  Branch (170:13): [True: 3.97M, False: 350M]
  ------------------
  171|  3.97M|            return yes;
  172|   354M|    }
  173|       |
  174|  1.08M|    return no;
  175|  5.06M|}
prvTidyIsPushedLast:
  181|  30.1k|{
  182|  30.1k|    Lexer* lexer = doc->lexer;
  183|       |
  184|  30.1k|    if ( element && !IsNodePushable(element) )
  ------------------
  |  Branch (184:10): [True: 30.1k, False: 0]
  |  Branch (184:21): [True: 746, False: 29.4k]
  ------------------
  185|    746|        return no;
  186|       |
  187|  29.4k|    if (lexer->istacksize > 0) {
  ------------------
  |  Branch (187:9): [True: 29.1k, False: 213]
  ------------------
  188|  29.1k|        if (lexer->istack[lexer->istacksize - 1].tag == node->tag) {
  ------------------
  |  Branch (188:13): [True: 0, False: 29.1k]
  ------------------
  189|      0|            return yes;
  190|      0|        }
  191|  29.1k|    }
  192|       |
  193|  29.4k|    return no;
  194|  29.4k|}
prvTidyInlineDup:
  214|   422k|{
  215|   422k|    Lexer* lexer = doc->lexer;
  216|   422k|    int n;
  217|       |
  218|   422k|    if ((n = lexer->istacksize - lexer->istackbase) > 0)
  ------------------
  |  Branch (218:9): [True: 165k, False: 257k]
  ------------------
  219|   165k|    {
  220|   165k|        lexer->insert = &(lexer->istack[lexer->istackbase]);
  221|   165k|        lexer->inode = node;
  222|   165k|    }
  223|       |
  224|   422k|    return n;
  225|   422k|}
prvTidyDeferDup:
  232|  39.1k|{
  233|  39.1k|    doc->lexer->insert = NULL;
  234|       |    doc->lexer->inode = NULL;
  235|  39.1k|}
prvTidyInsertedToken:
  238|  1.92M|{
  239|  1.92M|    Lexer* lexer = doc->lexer;
  240|  1.92M|    Node *node;
  241|  1.92M|    IStack *istack;
  242|  1.92M|    uint n;
  243|       |
  244|       |    /* this will only be NULL if inode != NULL */
  245|  1.92M|    if (lexer->insert == NULL)
  ------------------
  |  Branch (245:9): [True: 4.27k, False: 1.92M]
  ------------------
  246|  4.27k|    {
  247|  4.27k|        node = lexer->inode;
  248|  4.27k|        lexer->inode = NULL;
  249|  4.27k|        return node;
  250|  4.27k|    }
  251|       |
  252|       |    /*
  253|       |      If this is the "latest" node then update
  254|       |      the position, otherwise use current values
  255|       |    */
  256|       |
  257|  1.92M|    if (lexer->inode == NULL)
  ------------------
  |  Branch (257:9): [True: 1.85M, False: 65.0k]
  ------------------
  258|  1.85M|    {
  259|  1.85M|        lexer->lines = doc->docIn->curline;
  260|  1.85M|        lexer->columns = doc->docIn->curcol;
  261|  1.85M|    }
  262|       |
  263|  1.92M|    node = TY_(NewNode)(doc->allocator, lexer);
  ------------------
  |  |   23|  1.92M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.92M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  264|  1.92M|    node->type = StartTag;
  265|  1.92M|    node->implicit = yes;
  266|  1.92M|    node->start = lexer->txtstart;
  267|       |    /* #431734 [JTidy bug #226261 (was 126261)] - fix by Gary Peskin 20 Dec 00 */ 
  268|  1.92M|    node->end = lexer->txtend; /* was : lexer->txtstart; */
  269|  1.92M|    istack = lexer->insert;
  270|       |
  271|       |/* #if 0 && defined(_DEBUG) */
  272|       |#if definedENABLE_DEBUG_LOG
  273|       |    if ( lexer->istacksize == 0 )
  274|       |    {
  275|       |        SPRTF( "WARNING: ZERO sized istack!\n" );
  276|       |    }
  277|       |#endif
  278|       |
  279|  1.92M|    node->element = TY_(tmbstrdup)(doc->allocator, istack->element);
  ------------------
  |  |   23|  1.92M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.92M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  280|  1.92M|    node->tag = istack->tag;
  281|  1.92M|    node->attributes = TY_(DupAttrs)( doc, istack->attributes );
  ------------------
  |  |   23|  1.92M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.92M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  282|       |
  283|       |    /* advance lexer to next item on the stack */
  284|  1.92M|    n = (uint)(lexer->insert - &(lexer->istack[0]));
  285|       |
  286|       |    /* and recover state if we have reached the end */
  287|  1.92M|    if (++n < lexer->istacksize)
  ------------------
  |  Branch (287:9): [True: 1.76M, False: 154k]
  ------------------
  288|  1.76M|        lexer->insert = &(lexer->istack[n]);
  289|   154k|    else
  290|   154k|        lexer->insert = NULL;
  291|       |
  292|  1.92M|    return node;
  293|  1.92M|}
prvTidySwitchInline:
  304|  15.4k|{
  305|  15.4k|    Lexer* lexer = doc->lexer;
  306|  15.4k|    if ( lexer
  ------------------
  |  Branch (306:10): [True: 15.4k, False: 0]
  ------------------
  307|  15.4k|         && element && element->tag
  ------------------
  |  Branch (307:13): [True: 15.4k, False: 0]
  |  Branch (307:24): [True: 15.4k, False: 0]
  ------------------
  308|  15.4k|         && node && node->tag
  ------------------
  |  Branch (308:13): [True: 15.4k, False: 0]
  |  Branch (308:21): [True: 15.4k, False: 0]
  ------------------
  309|  15.4k|         && TY_(IsPushed)( doc, element )
  ------------------
  |  |   23|  15.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (309:13): [True: 15.4k, False: 0]
  ------------------
  310|  15.4k|         && TY_(IsPushed)( doc, node ) 
  ------------------
  |  |   23|  15.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (310:13): [True: 15.4k, False: 0]
  ------------------
  311|  15.4k|         && ((lexer->istacksize - lexer->istackbase) >= 2) )
  ------------------
  |  Branch (311:13): [True: 15.2k, False: 204]
  ------------------
  312|  15.2k|    {
  313|       |        /* we have a chance of succeeding ... */
  314|  15.2k|        int i;
  315|  26.0k|        for (i = (lexer->istacksize - lexer->istackbase - 1); i >= 0; --i)
  ------------------
  |  Branch (315:63): [True: 24.8k, False: 1.22k]
  ------------------
  316|  24.8k|        {
  317|  24.8k|            if (lexer->istack[i].tag == element->tag) {
  ------------------
  |  Branch (317:17): [True: 14.8k, False: 9.93k]
  ------------------
  318|       |                /* found the element tag - phew */
  319|  14.8k|                IStack *istack1 = &lexer->istack[i];
  320|  14.8k|                IStack *istack2 = NULL;
  321|  14.8k|                --i; /* back one more, and continue */
  322|   122k|                for ( ; i >= 0; --i)
  ------------------
  |  Branch (322:25): [True: 121k, False: 890]
  ------------------
  323|   121k|                {
  324|   121k|                    if (lexer->istack[i].tag == node->tag)
  ------------------
  |  Branch (324:25): [True: 13.9k, False: 107k]
  ------------------
  325|  13.9k|                    {
  326|       |                        /* found the element tag - phew */
  327|  13.9k|                        istack2 = &lexer->istack[i];
  328|  13.9k|                        break;
  329|  13.9k|                    }
  330|   121k|                }
  331|  14.8k|                if ( istack2 )
  ------------------
  |  Branch (331:22): [True: 13.9k, False: 890]
  ------------------
  332|  13.9k|                {
  333|       |                    /* perform the swap */
  334|  13.9k|                    IStack tmp_istack = *istack2;
  335|  13.9k|                    *istack2 = *istack1;
  336|  13.9k|                    *istack1 = tmp_istack;
  337|  13.9k|                    return yes;
  338|  13.9k|                }
  339|  14.8k|            }
  340|  24.8k|        }
  341|  15.2k|    }
  342|  1.43k|    return no;
  343|  15.4k|}
prvTidyInlineDup1:
  351|  13.9k|{
  352|  13.9k|    Lexer* lexer = doc->lexer;
  353|  13.9k|    int n, i;
  354|  13.9k|    if ( element
  ------------------
  |  Branch (354:10): [True: 13.9k, False: 0]
  ------------------
  355|  13.9k|         && (element->tag != NULL)
  ------------------
  |  Branch (355:13): [True: 13.9k, False: 0]
  ------------------
  356|  13.9k|         && ((n = lexer->istacksize - lexer->istackbase) > 0) )
  ------------------
  |  Branch (356:13): [True: 13.9k, False: 0]
  ------------------
  357|  13.9k|    {
  358|  54.0k|        for ( i = n - 1; i >=0; --i ) {
  ------------------
  |  Branch (358:26): [True: 54.0k, False: 0]
  ------------------
  359|  54.0k|            if (lexer->istack[i].tag == element->tag) {
  ------------------
  |  Branch (359:17): [True: 13.9k, False: 40.1k]
  ------------------
  360|       |                /* found our element tag - insert it */
  361|  13.9k|                lexer->insert = &(lexer->istack[i]);
  362|  13.9k|                lexer->inode = node;
  363|  13.9k|                return yes;
  364|  13.9k|            }
  365|  54.0k|        }
  366|  13.9k|    }
  367|      0|    return no;
  368|  13.9k|}
istack.c:IsNodePushable:
   34|   232k|{
   35|   232k|    if (node->tag == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 232k]
  ------------------
   36|      0|        return no;
   37|       |
   38|   232k|    if (!(node->tag->model & CM_INLINE))
  ------------------
  |  |  143|   232k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (38:9): [True: 321, False: 232k]
  ------------------
   39|    321|        return no;
   40|       |
   41|   232k|    if (node->tag->model & CM_OBJECT)
  ------------------
  |  |  150|   232k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (41:9): [True: 204, False: 232k]
  ------------------
   42|    204|        return no;
   43|       |
   44|       |    /*\ Issue #92: OLD problem of ins and del which are marked as both
   45|       |     *  inline and block, thus should NOT ever be 'inserted'
   46|       |    \*/
   47|   232k|    if (nodeIsINS(node) || nodeIsDEL(node))
  ------------------
  |  |  457|   232k|#define nodeIsINS( node )        TagIsId( node, TidyTag_INS )
  |  |  ------------------
  |  |  |  |  275|   464k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 232k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 232k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.02k, False: 231k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (nodeIsINS(node) || nodeIsDEL(node))
  ------------------
  |  |  458|   231k|#define nodeIsDEL( node )        TagIsId( node, TidyTag_DEL )
  |  |  ------------------
  |  |  |  |  275|   231k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 231k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 231k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.31k, False: 229k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|  2.34k|        return no;
   49|       |
   50|   229k|    return yes;
   51|   232k|}
istack.c:PopIStackUntil:
  122|  3.07k|{
  123|  3.07k|    Lexer* lexer = doc->lexer;
  124|  3.07k|    IStack *istack;
  125|       |
  126|  67.7k|    while (lexer->istacksize > 0)
  ------------------
  |  Branch (126:12): [True: 65.4k, False: 2.26k]
  ------------------
  127|  65.4k|    {
  128|  65.4k|        PopIStack( doc );
  129|  65.4k|        istack = &(lexer->istack[lexer->istacksize]);
  130|  65.4k|        if ( istack->tag->id == tid )
  ------------------
  |  Branch (130:14): [True: 807, False: 64.6k]
  ------------------
  131|    807|            break;
  132|  65.4k|    }
  133|  3.07k|}
istack.c:PopIStack:
  103|   156k|{
  104|   156k|    Lexer* lexer = doc->lexer;
  105|   156k|    IStack *istack;
  106|   156k|    AttVal *av;
  107|       |
  108|   156k|    --(lexer->istacksize);
  109|   156k|    istack = &(lexer->istack[lexer->istacksize]);
  110|       |
  111|   166k|    while (istack->attributes)
  ------------------
  |  Branch (111:12): [True: 9.94k, False: 156k]
  ------------------
  112|  9.94k|    {
  113|  9.94k|        av = istack->attributes;
  114|  9.94k|        istack->attributes = av->next;
  115|  9.94k|        TY_(FreeAttribute)( doc, av );
  ------------------
  |  |   23|  9.94k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.94k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  116|  9.94k|    }
  117|   156k|    TidyDocFree(doc, istack->element);
  ------------------
  |  |  159|   156k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   156k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  118|       |    istack->element = NULL; /* remove the freed element */
  119|   156k|}

prvTidytidyLocalizedStringN:
  263|  74.2M|{
  264|  74.2M|    ctmbstr result;
  265|       |    
  266|  74.2M|    result  = tidyLocalizedStringImpl( messageType, tidyLanguages.currentLanguage, quantity);
  267|       |    
  268|  74.2M|    if (!result && tidyLanguages.fallbackLanguage )
  ------------------
  |  Branch (268:9): [True: 0, False: 74.2M]
  |  Branch (268:20): [True: 0, False: 0]
  ------------------
  269|      0|    {
  270|      0|        result = tidyLocalizedStringImpl( messageType, tidyLanguages.fallbackLanguage, quantity);
  271|      0|    }
  272|       |    
  273|  74.2M|    if (!result)
  ------------------
  |  Branch (273:9): [True: 0, False: 74.2M]
  ------------------
  274|      0|    {
  275|       |        /* Fallback to en which is built in. */
  276|      0|        result = tidyLocalizedStringImpl( messageType, &language_en, quantity);
  277|      0|    }
  278|       |    
  279|  74.2M|    if (!result)
  ------------------
  |  Branch (279:9): [True: 0, False: 74.2M]
  ------------------
  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|  74.2M|    return result;
  286|  74.2M|}
prvTidytidyLocalizedString:
  298|  53.5M|{
  299|  53.5M|    return TY_(tidyLocalizedStringN)( messageType, 1 );
  ------------------
  |  |   23|  53.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  53.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  300|  53.5M|}
prvTidytidySetLanguage:
  399|  40.4k|{
  400|  40.4k|    languageDefinition *dict1 = NULL;
  401|  40.4k|    languageDefinition *dict2 = NULL;
  402|  40.4k|    tmbstr wantCode = NULL;
  403|  40.4k|    char lang[3] = "";
  404|       |    
  405|  40.4k|    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: 40.4k, False: 0]
  |  Branch (405:27): [True: 0, False: 0]
  ------------------
  406|  40.4k|    {
  407|  40.4k|        return no;
  408|  40.4k|    }
  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|  40.4k|}
prvTidytidyGetLanguageSetByUser:
  464|  20.2k|{
  465|  20.2k|    return tidyLanguages.manually_set;
  466|  20.2k|}
prvTidytidyDefaultStringN:
  484|  20.6M|{
  485|  20.6M|    return tidyLocalizedStringImpl( messageType, &language_en, quantity);
  486|  20.6M|}
prvTidytidyDefaultString:
  494|  62.0M|{
  495|  62.0M|    return tidyLocalizedStringImpl( messageType, &language_en, 1);
  496|  62.0M|}
language.c:tidyLocalizedStringImpl:
  237|   156M|{
  238|   156M|    int i;
  239|   156M|    languageDictionary *dictionary = &definition->messages;
  240|   156M|    uint pluralForm = definition->whichPluralForm(plural);
  241|       |    
  242|  21.2G|    for (i = 0; (*dictionary)[i].value; ++i)
  ------------------
  |  Branch (242:17): [True: 21.2G, False: 0]
  ------------------
  243|  21.2G|    {
  244|  21.2G|        if ( (*dictionary)[i].key == messageType && (*dictionary)[i].pluralForm == pluralForm )
  ------------------
  |  Branch (244:14): [True: 197M, False: 21.0G]
  |  Branch (244:53): [True: 156M, False: 40.5M]
  ------------------
  245|   156M|        {
  246|   156M|            return (*dictionary)[i].value;
  247|   156M|        }
  248|  21.2G|    }
  249|      0|    return NULL;
  250|   156M|}

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

prvTidyHTMLVersion:
  257|  3.75M|{
  258|  3.75M|    uint i;
  259|  3.75M|    uint j = 0;
  260|  3.75M|    uint score = 0;
  261|  3.75M|    uint vers = doc->lexer->versions;
  262|  3.75M|    uint dtver = doc->lexer->doctype;
  263|  3.75M|    TidyDoctypeModes dtmode = (TidyDoctypeModes)cfg(doc, TidyDoctypeMode);
  ------------------
  |  |  415|  3.75M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  264|  3.75M|    Bool xhtml = (cfgBool(doc, TidyXmlOut) || doc->lexer->isvoyager) &&
  ------------------
  |  |  418|  7.50M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.75M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 3.75M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (264:47): [True: 0, False: 0]
  ------------------
  265|  3.75M|                 !cfgBool(doc, TidyHtmlOut);
  ------------------
  |  |  418|  7.50M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.75M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (265:18): [True: 3.75M, False: 0]
  ------------------
  266|  3.75M|    Bool html4 = ((dtmode == TidyDoctypeStrict) || (dtmode == TidyDoctypeLoose) ||
  ------------------
  |  Branch (266:19): [True: 0, False: 3.75M]
  |  Branch (266:52): [True: 0, False: 3.75M]
  ------------------
  267|  3.75M|                  (VERS_HMTL40PX & dtver) ? yes : no);
  ------------------
  |  |  254|  3.75M|#define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  216|  3.75M|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  207|  3.75M|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  179|  3.75M|#define H40S                   4u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  182|  3.75M|#define H41S                  32u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  185|  3.75M|#define X10S                 256u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  3.75M|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  3.75M|#define H40T                   8u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  3.75M|#define H41T                  64u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|  3.75M|#define X10T                 512u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  209|  3.75M|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|  3.75M|#define H40F                  16u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|  3.75M|#define H41F                 128u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|  3.75M|#define X10F                1024u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  210|  3.75M|#define VERS_XHTML11       (XH11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  188|  3.75M|#define XH11                2048u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  211|  3.75M|#define VERS_BASIC         (XB10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|  3.75M|#define XB10                4096u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (267:19): [True: 30.8k, False: 3.71M]
  ------------------
  268|  3.75M|    Bool html5 = (!html4 && ((dtmode == TidyDoctypeAuto) ||
  ------------------
  |  Branch (268:19): [True: 3.71M, False: 30.8k]
  |  Branch (268:30): [True: 3.71M, False: 0]
  ------------------
  269|  3.71M|                  (dtmode == TidyDoctypeHtml5)) ? yes : no);
  ------------------
  |  Branch (269:19): [True: 0, False: 0]
  ------------------
  270|       |
  271|  3.75M|    if (xhtml && dtver == VERS_UNKNOWN) return XH50;
  ------------------
  |  |  204|  3.75M|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  3.75M|#define xxxx                   0u
  |  |  ------------------
  ------------------
                  if (xhtml && dtver == VERS_UNKNOWN) return XH50;
  ------------------
  |  |  201|  3.64M|#define XH50              262144u
  ------------------
  |  Branch (271:9): [True: 3.75M, False: 0]
  |  Branch (271:18): [True: 3.64M, False: 105k]
  ------------------
  272|   105k|    if (dtver == VERS_UNKNOWN) return HT50;
  ------------------
  |  |  204|   105k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|   105k|#define xxxx                   0u
  |  |  ------------------
  ------------------
                  if (dtver == VERS_UNKNOWN) return HT50;
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
  |  Branch (272:9): [True: 0, False: 105k]
  ------------------
  273|       |    /* Issue #167 - if NOT XHTML, and doctype is default VERS_HTML5, then return HT50 */
  274|   105k|    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: 105k]
  |  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|   105k|    if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  213|  74.5k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  74.5k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  74.5k|#define XH50              262144u
  |  |  ------------------
  ------------------
                  if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  201|  74.5k|#define XH50              262144u
  ------------------
                  if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  201|    956|#define XH50              262144u
  ------------------
  |  Branch (277:9): [True: 105k, False: 0]
  |  Branch (277:18): [True: 74.5k, False: 30.8k]
  |  Branch (277:27): [True: 956, False: 73.5k]
  ------------------
  278|       |
  279|  2.08M|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (279:17): [True: 1.98M, False: 104k]
  ------------------
  280|  1.98M|    {
  281|  1.98M|        if ((xhtml && !(VERS_XHTML & W3C_Doctypes[i].vers)) ||
  ------------------
  |  |  222|  1.98M|#define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  185|  1.98M|#define X10S                 256u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  186|  1.98M|#define X10T                 512u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  187|  1.98M|#define X10F                1024u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  188|  1.98M|#define XH11                2048u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  189|  1.98M|#define XB10                4096u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  201|  1.98M|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (281:14): [True: 1.98M, False: 0]
  |  Branch (281:23): [True: 1.35M, False: 626k]
  ------------------
  282|   626k|            (html4 && !(VERS_HMTL40PX & W3C_Doctypes[i].vers)))
  ------------------
  |  |  254|   185k|#define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  216|   185k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  207|   185k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  179|   185k|#define H40S                   4u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  182|   185k|#define H41S                  32u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  185|   185k|#define X10S                 256u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|   185k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|   185k|#define H40T                   8u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|   185k|#define H41T                  64u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|   185k|#define X10T                 512u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  209|   185k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|   185k|#define H40F                  16u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|   185k|#define H41F                 128u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|   185k|#define X10F                1024u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  210|   185k|#define VERS_XHTML11       (XH11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  188|   185k|#define XH11                2048u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  211|   185k|#define VERS_BASIC         (XB10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|   185k|#define XB10                4096u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (282:14): [True: 185k, False: 441k]
  |  Branch (282:23): [True: 30.8k, False: 154k]
  ------------------
  283|  1.38M|            continue;
  284|       |
  285|   595k|        if (vers & W3C_Doctypes[i].vers &&
  ------------------
  |  Branch (285:13): [True: 321k, False: 273k]
  ------------------
  286|   321k|            (W3C_Doctypes[i].score < score || !score))
  ------------------
  |  Branch (286:14): [True: 794, False: 321k]
  |  Branch (286:47): [True: 97.2k, False: 223k]
  ------------------
  287|  97.9k|        {
  288|  97.9k|            score = W3C_Doctypes[i].score;
  289|  97.9k|            j = i;
  290|  97.9k|        }
  291|   595k|    }
  292|       |
  293|   104k|    if (score)
  ------------------
  |  Branch (293:9): [True: 97.2k, False: 7.21k]
  ------------------
  294|  97.2k|        return W3C_Doctypes[j].vers;
  295|       |
  296|  7.21k|    return VERS_UNKNOWN;
  ------------------
  |  |  204|  7.21k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  7.21k|#define xxxx                   0u
  |  |  ------------------
  ------------------
  297|   104k|}
prvTidyConstrainVersion:
  442|  1.15M|{
  443|  1.15M|    doc->lexer->versions &= (vers | VERS_PROPRIETARY);
  ------------------
  |  |  231|  1.15M|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  1.15M|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  1.15M|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  1.15M|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  444|  1.15M|}
prvTidyIsWhite:
  448|   323M|{
  449|   323M|    uint map = MAP(c);
  ------------------
  |  |  206|   323M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 319M, False: 4.08M]
  |  |  ------------------
  ------------------
  450|       |
  451|   323M|    return (map & white)!=0;
  ------------------
  |  |   71|   323M|#define white       8u
  ------------------
  452|   323M|}
prvTidyIsDigit:
  461|  40.7k|{
  462|  40.7k|    uint map;
  463|       |
  464|  40.7k|    map = MAP(c);
  ------------------
  |  |  206|  40.7k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 35.7k, False: 4.94k]
  |  |  ------------------
  ------------------
  465|       |
  466|  40.7k|    return (map & digit)!=0;
  ------------------
  |  |   68|  40.7k|#define digit       1u
  ------------------
  467|  40.7k|}
prvTidyIsLetter:
  479|  1.70M|{
  480|  1.70M|    uint map;
  481|       |
  482|  1.70M|    map = MAP(c);
  ------------------
  |  |  206|  1.70M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 1.65M, False: 55.7k]
  |  |  ------------------
  ------------------
  483|       |
  484|  1.70M|    return (map & letter)!=0;
  ------------------
  |  |   69|  1.70M|#define letter      2u
  ------------------
  485|  1.70M|}
prvTidyIsHTMLSpace:
  488|  2.01M|{
  489|  2.01M|    return c == 0x020 || c == 0x009 || c == 0x00a || c == 0x00c || c == 0x00d;
  ------------------
  |  Branch (489:12): [True: 21.5k, False: 1.99M]
  |  Branch (489:26): [True: 672, False: 1.99M]
  |  Branch (489:40): [True: 1.22k, False: 1.99M]
  |  Branch (489:54): [True: 30.4k, False: 1.96M]
  |  Branch (489:68): [True: 581, False: 1.96M]
  ------------------
  490|  2.01M|}
prvTidyIsNamechar:
  493|  9.99M|{
  494|  9.99M|    uint map = MAP(c);
  ------------------
  |  |  206|  9.99M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 9.91M, False: 82.6k]
  |  |  ------------------
  ------------------
  495|  9.99M|    return (map & namechar)!=0;
  ------------------
  |  |   70|  9.99M|#define namechar    4u
  ------------------
  496|  9.99M|}
prvTidyIsXMLLetter:
  499|   900k|{
  500|   900k|    return ((c >= 0x41 && c <= 0x5a) ||
  ------------------
  |  Branch (500:14): [True: 872k, False: 28.3k]
  |  Branch (500:27): [True: 42.2k, False: 830k]
  ------------------
  501|   858k|        (c >= 0x61 && c <= 0x7a) ||
  ------------------
  |  Branch (501:10): [True: 828k, False: 30.2k]
  |  Branch (501:23): [True: 587k, False: 240k]
  ------------------
  502|   271k|        (c >= 0xc0 && c <= 0xd6) ||
  ------------------
  |  Branch (502:10): [True: 239k, False: 31.0k]
  |  Branch (502:23): [True: 343, False: 239k]
  ------------------
  503|   270k|        (c >= 0xd8 && c <= 0xf6) ||
  ------------------
  |  Branch (503:10): [True: 239k, False: 31.0k]
  |  Branch (503:23): [True: 540, False: 239k]
  ------------------
  504|   270k|        (c >= 0xf8 && c <= 0xff) ||
  ------------------
  |  Branch (504:10): [True: 239k, False: 31.0k]
  |  Branch (504:23): [True: 336, False: 238k]
  ------------------
  505|   269k|        (c >= 0x100 && c <= 0x131) ||
  ------------------
  |  Branch (505:10): [True: 238k, False: 31.0k]
  |  Branch (505:24): [True: 230, False: 238k]
  ------------------
  506|   269k|        (c >= 0x134 && c <= 0x13e) ||
  ------------------
  |  Branch (506:10): [True: 238k, False: 31.0k]
  |  Branch (506:24): [True: 312, False: 238k]
  ------------------
  507|   269k|        (c >= 0x141 && c <= 0x148) ||
  ------------------
  |  Branch (507:10): [True: 238k, False: 31.0k]
  |  Branch (507:24): [True: 88, False: 238k]
  ------------------
  508|   269k|        (c >= 0x14a && c <= 0x17e) ||
  ------------------
  |  Branch (508:10): [True: 238k, False: 31.0k]
  |  Branch (508:24): [True: 763, False: 237k]
  ------------------
  509|   268k|        (c >= 0x180 && c <= 0x1c3) ||
  ------------------
  |  Branch (509:10): [True: 237k, False: 31.0k]
  |  Branch (509:24): [True: 647, False: 236k]
  ------------------
  510|   267k|        (c >= 0x1cd && c <= 0x1f0) ||
  ------------------
  |  Branch (510:10): [True: 236k, False: 31.0k]
  |  Branch (510:24): [True: 714, False: 235k]
  ------------------
  511|   267k|        (c >= 0x1f4 && c <= 0x1f5) ||
  ------------------
  |  Branch (511:10): [True: 235k, False: 31.0k]
  |  Branch (511:24): [True: 198, False: 235k]
  ------------------
  512|   266k|        (c >= 0x1fa && c <= 0x217) ||
  ------------------
  |  Branch (512:10): [True: 235k, False: 31.0k]
  |  Branch (512:24): [True: 710, False: 235k]
  ------------------
  513|   266k|        (c >= 0x250 && c <= 0x2a8) ||
  ------------------
  |  Branch (513:10): [True: 235k, False: 31.1k]
  |  Branch (513:24): [True: 671, False: 234k]
  ------------------
  514|   265k|        (c >= 0x2bb && c <= 0x2c1) ||
  ------------------
  |  Branch (514:10): [True: 234k, False: 31.1k]
  |  Branch (514:24): [True: 1.00k, False: 233k]
  ------------------
  515|   264k|        c == 0x386 ||
  ------------------
  |  Branch (515:9): [True: 597, False: 263k]
  ------------------
  516|   263k|        (c >= 0x388 && c <= 0x38a) ||
  ------------------
  |  Branch (516:10): [True: 229k, False: 34.5k]
  |  Branch (516:24): [True: 281, False: 229k]
  ------------------
  517|   263k|        c == 0x38c ||
  ------------------
  |  Branch (517:9): [True: 200, False: 263k]
  ------------------
  518|   263k|        (c >= 0x38e && c <= 0x3a1) ||
  ------------------
  |  Branch (518:10): [True: 228k, False: 34.5k]
  |  Branch (518:24): [True: 1.27k, False: 227k]
  ------------------
  519|   262k|        (c >= 0x3a3 && c <= 0x3ce) ||
  ------------------
  |  Branch (519:10): [True: 227k, False: 34.5k]
  |  Branch (519:24): [True: 1.00k, False: 226k]
  ------------------
  520|   261k|        (c >= 0x3d0 && c <= 0x3d6) ||
  ------------------
  |  Branch (520:10): [True: 226k, False: 34.5k]
  |  Branch (520:24): [True: 1.04k, False: 225k]
  ------------------
  521|   260k|        c == 0x3da ||
  ------------------
  |  Branch (521:9): [True: 332, False: 259k]
  ------------------
  522|   259k|        c == 0x3dc ||
  ------------------
  |  Branch (522:9): [True: 206, False: 259k]
  ------------------
  523|   259k|        c == 0x3de ||
  ------------------
  |  Branch (523:9): [True: 561, False: 258k]
  ------------------
  524|   258k|        c == 0x3e0 ||
  ------------------
  |  Branch (524:9): [True: 384, False: 258k]
  ------------------
  525|   258k|        (c >= 0x3e2 && c <= 0x3f3) ||
  ------------------
  |  Branch (525:10): [True: 224k, False: 34.5k]
  |  Branch (525:24): [True: 422, False: 223k]
  ------------------
  526|   258k|        (c >= 0x401 && c <= 0x40c) ||
  ------------------
  |  Branch (526:10): [True: 223k, False: 34.5k]
  |  Branch (526:24): [True: 831, False: 222k]
  ------------------
  527|   257k|        (c >= 0x40e && c <= 0x44f) ||
  ------------------
  |  Branch (527:10): [True: 222k, False: 34.5k]
  |  Branch (527:24): [True: 251, False: 222k]
  ------------------
  528|   257k|        (c >= 0x451 && c <= 0x45c) ||
  ------------------
  |  Branch (528:10): [True: 222k, False: 34.5k]
  |  Branch (528:24): [True: 332, False: 222k]
  ------------------
  529|   256k|        (c >= 0x45e && c <= 0x481) ||
  ------------------
  |  Branch (529:10): [True: 222k, False: 34.5k]
  |  Branch (529:24): [True: 429, False: 221k]
  ------------------
  530|   256k|        (c >= 0x490 && c <= 0x4c4) ||
  ------------------
  |  Branch (530:10): [True: 221k, False: 34.8k]
  |  Branch (530:24): [True: 1.50k, False: 219k]
  ------------------
  531|   254k|        (c >= 0x4c7 && c <= 0x4c8) ||
  ------------------
  |  Branch (531:10): [True: 219k, False: 34.8k]
  |  Branch (531:24): [True: 225, False: 219k]
  ------------------
  532|   254k|        (c >= 0x4cb && c <= 0x4cc) ||
  ------------------
  |  Branch (532:10): [True: 219k, False: 34.8k]
  |  Branch (532:24): [True: 199, False: 219k]
  ------------------
  533|   254k|        (c >= 0x4d0 && c <= 0x4eb) ||
  ------------------
  |  Branch (533:10): [True: 219k, False: 34.8k]
  |  Branch (533:24): [True: 318, False: 219k]
  ------------------
  534|   254k|        (c >= 0x4ee && c <= 0x4f5) ||
  ------------------
  |  Branch (534:10): [True: 219k, False: 34.8k]
  |  Branch (534:24): [True: 250, False: 218k]
  ------------------
  535|   253k|        (c >= 0x4f8 && c <= 0x4f9) ||
  ------------------
  |  Branch (535:10): [True: 218k, False: 34.8k]
  |  Branch (535:24): [True: 284, False: 218k]
  ------------------
  536|   253k|        (c >= 0x531 && c <= 0x556) ||
  ------------------
  |  Branch (536:10): [True: 218k, False: 34.8k]
  |  Branch (536:24): [True: 1.10k, False: 217k]
  ------------------
  537|   252k|        c == 0x559 ||
  ------------------
  |  Branch (537:9): [True: 645, False: 251k]
  ------------------
  538|   251k|        (c >= 0x561 && c <= 0x586) ||
  ------------------
  |  Branch (538:10): [True: 216k, False: 34.8k]
  |  Branch (538:24): [True: 349, False: 216k]
  ------------------
  539|   251k|        (c >= 0x5d0 && c <= 0x5ea) ||
  ------------------
  |  Branch (539:10): [True: 212k, False: 38.7k]
  |  Branch (539:24): [True: 683, False: 212k]
  ------------------
  540|   250k|        (c >= 0x5f0 && c <= 0x5f2) ||
  ------------------
  |  Branch (540:10): [True: 212k, False: 38.7k]
  |  Branch (540:24): [True: 485, False: 211k]
  ------------------
  541|   250k|        (c >= 0x621 && c <= 0x63a) ||
  ------------------
  |  Branch (541:10): [True: 211k, False: 38.7k]
  |  Branch (541:24): [True: 1.69k, False: 209k]
  ------------------
  542|   248k|        (c >= 0x641 && c <= 0x64a) ||
  ------------------
  |  Branch (542:10): [True: 209k, False: 38.9k]
  |  Branch (542:24): [True: 249, False: 209k]
  ------------------
  543|   248k|        (c >= 0x671 && c <= 0x6b7) ||
  ------------------
  |  Branch (543:10): [True: 207k, False: 41.0k]
  |  Branch (543:24): [True: 1.38k, False: 205k]
  ------------------
  544|   246k|        (c >= 0x6ba && c <= 0x6be) ||
  ------------------
  |  Branch (544:10): [True: 205k, False: 41.0k]
  |  Branch (544:24): [True: 1.39k, False: 204k]
  ------------------
  545|   245k|        (c >= 0x6c0 && c <= 0x6ce) ||
  ------------------
  |  Branch (545:10): [True: 204k, False: 41.0k]
  |  Branch (545:24): [True: 309, False: 204k]
  ------------------
  546|   245k|        (c >= 0x6d0 && c <= 0x6d3) ||
  ------------------
  |  Branch (546:10): [True: 204k, False: 41.1k]
  |  Branch (546:24): [True: 606, False: 203k]
  ------------------
  547|   244k|        c == 0x6d5 ||
  ------------------
  |  Branch (547:9): [True: 574, False: 244k]
  ------------------
  548|   244k|        (c >= 0x6e5 && c <= 0x6e6) ||
  ------------------
  |  Branch (548:10): [True: 199k, False: 44.5k]
  |  Branch (548:24): [True: 254, False: 199k]
  ------------------
  549|   243k|        (c >= 0x905 && c <= 0x939) ||
  ------------------
  |  Branch (549:10): [True: 193k, False: 50.0k]
  |  Branch (549:24): [True: 504, False: 193k]
  ------------------
  550|   243k|        c == 0x93d ||
  ------------------
  |  Branch (550:9): [True: 427, False: 242k]
  ------------------
  551|   242k|        (c >= 0x958 && c <= 0x961) ||
  ------------------
  |  Branch (551:10): [True: 190k, False: 52.3k]
  |  Branch (551:24): [True: 511, False: 190k]
  ------------------
  552|   242k|        (c >= 0x985 && c <= 0x98c) ||
  ------------------
  |  Branch (552:10): [True: 188k, False: 53.5k]
  |  Branch (552:24): [True: 607, False: 188k]
  ------------------
  553|   241k|        (c >= 0x98f && c <= 0x990) ||
  ------------------
  |  Branch (553:10): [True: 188k, False: 53.5k]
  |  Branch (553:24): [True: 402, False: 187k]
  ------------------
  554|   241k|        (c >= 0x993 && c <= 0x9a8) ||
  ------------------
  |  Branch (554:10): [True: 187k, False: 53.5k]
  |  Branch (554:24): [True: 872, False: 186k]
  ------------------
  555|   240k|        (c >= 0x9aa && c <= 0x9b0) ||
  ------------------
  |  Branch (555:10): [True: 186k, False: 53.5k]
  |  Branch (555:24): [True: 1.15k, False: 185k]
  ------------------
  556|   239k|        c == 0x9b2 ||
  ------------------
  |  Branch (556:9): [True: 206, False: 239k]
  ------------------
  557|   239k|        (c >= 0x9b6 && c <= 0x9b9) ||
  ------------------
  |  Branch (557:10): [True: 185k, False: 53.5k]
  |  Branch (557:24): [True: 643, False: 184k]
  ------------------
  558|   238k|        (c >= 0x9dc && c <= 0x9dd) ||
  ------------------
  |  Branch (558:10): [True: 181k, False: 56.7k]
  |  Branch (558:24): [True: 525, False: 181k]
  ------------------
  559|   237k|        (c >= 0x9df && c <= 0x9e1) ||
  ------------------
  |  Branch (559:10): [True: 181k, False: 56.7k]
  |  Branch (559:24): [True: 729, False: 180k]
  ------------------
  560|   237k|        (c >= 0x9f0 && c <= 0x9f1) ||
  ------------------
  |  Branch (560:10): [True: 179k, False: 57.7k]
  |  Branch (560:24): [True: 508, False: 178k]
  ------------------
  561|   236k|        (c >= 0xa05 && c <= 0xa0a) ||
  ------------------
  |  Branch (561:10): [True: 177k, False: 58.9k]
  |  Branch (561:24): [True: 2.73k, False: 174k]
  ------------------
  562|   233k|        (c >= 0xa0f && c <= 0xa10) ||
  ------------------
  |  Branch (562:10): [True: 174k, False: 58.9k]
  |  Branch (562:24): [True: 534, False: 174k]
  ------------------
  563|   233k|        (c >= 0xa13 && c <= 0xa28) ||
  ------------------
  |  Branch (563:10): [True: 174k, False: 58.9k]
  |  Branch (563:24): [True: 211, False: 174k]
  ------------------
  564|   233k|        (c >= 0xa2a && c <= 0xa30) ||
  ------------------
  |  Branch (564:10): [True: 174k, False: 58.9k]
  |  Branch (564:24): [True: 1.06k, False: 173k]
  ------------------
  565|   232k|        (c >= 0xa32 && c <= 0xa33) ||
  ------------------
  |  Branch (565:10): [True: 173k, False: 58.9k]
  |  Branch (565:24): [True: 282, False: 172k]
  ------------------
  566|   231k|        (c >= 0xa35 && c <= 0xa36) ||
  ------------------
  |  Branch (566:10): [True: 172k, False: 58.9k]
  |  Branch (566:24): [True: 926, False: 171k]
  ------------------
  567|   230k|        (c >= 0xa38 && c <= 0xa39) ||
  ------------------
  |  Branch (567:10): [True: 171k, False: 58.9k]
  |  Branch (567:24): [True: 1.00k, False: 170k]
  ------------------
  568|   229k|        (c >= 0xa59 && c <= 0xa5c) ||
  ------------------
  |  Branch (568:10): [True: 168k, False: 61.7k]
  |  Branch (568:24): [True: 1.39k, False: 166k]
  ------------------
  569|   228k|        c == 0xa5e ||
  ------------------
  |  Branch (569:9): [True: 430, False: 228k]
  ------------------
  570|   228k|        (c >= 0xa72 && c <= 0xa74) ||
  ------------------
  |  Branch (570:10): [True: 164k, False: 63.1k]
  |  Branch (570:24): [True: 557, False: 164k]
  ------------------
  571|   227k|        (c >= 0xa85 && c <= 0xa8b) ||
  ------------------
  |  Branch (571:10): [True: 163k, False: 63.7k]
  |  Branch (571:24): [True: 1.00k, False: 162k]
  ------------------
  572|   226k|        c == 0xa8d ||
  ------------------
  |  Branch (572:9): [True: 271, False: 226k]
  ------------------
  573|   226k|        (c >= 0xa8f && c <= 0xa91) ||
  ------------------
  |  Branch (573:10): [True: 162k, False: 63.7k]
  |  Branch (573:24): [True: 563, False: 162k]
  ------------------
  574|   225k|        (c >= 0xa93 && c <= 0xaa8) ||
  ------------------
  |  Branch (574:10): [True: 162k, False: 63.7k]
  |  Branch (574:24): [True: 1.25k, False: 160k]
  ------------------
  575|   224k|        (c >= 0xaaa && c <= 0xab0) ||
  ------------------
  |  Branch (575:10): [True: 160k, False: 63.7k]
  |  Branch (575:24): [True: 2.09k, False: 158k]
  ------------------
  576|   222k|        (c >= 0xab2 && c <= 0xab3) ||
  ------------------
  |  Branch (576:10): [True: 158k, False: 63.7k]
  |  Branch (576:24): [True: 824, False: 157k]
  ------------------
  577|   221k|        (c >= 0xab5 && c <= 0xab9) ||
  ------------------
  |  Branch (577:10): [True: 157k, False: 63.7k]
  |  Branch (577:24): [True: 1.21k, False: 156k]
  ------------------
  578|   220k|        c == 0xabd ||
  ------------------
  |  Branch (578:9): [True: 196, False: 220k]
  ------------------
  579|   220k|        c == 0xae0 ||
  ------------------
  |  Branch (579:9): [True: 206, False: 219k]
  ------------------
  580|   219k|        (c >= 0xb05 && c <= 0xb0c) ||
  ------------------
  |  Branch (580:10): [True: 152k, False: 67.3k]
  |  Branch (580:24): [True: 1.18k, False: 151k]
  ------------------
  581|   218k|        (c >= 0xb0f && c <= 0xb10) ||
  ------------------
  |  Branch (581:10): [True: 151k, False: 67.3k]
  |  Branch (581:24): [True: 323, False: 151k]
  ------------------
  582|   218k|        (c >= 0xb13 && c <= 0xb28) ||
  ------------------
  |  Branch (582:10): [True: 151k, False: 67.3k]
  |  Branch (582:24): [True: 351, False: 150k]
  ------------------
  583|   218k|        (c >= 0xb2a && c <= 0xb30) ||
  ------------------
  |  Branch (583:10): [True: 150k, False: 67.3k]
  |  Branch (583:24): [True: 1.56k, False: 149k]
  ------------------
  584|   216k|        (c >= 0xb32 && c <= 0xb33) ||
  ------------------
  |  Branch (584:10): [True: 149k, False: 67.3k]
  |  Branch (584:24): [True: 724, False: 148k]
  ------------------
  585|   215k|        (c >= 0xb36 && c <= 0xb39) ||
  ------------------
  |  Branch (585:10): [True: 148k, False: 67.3k]
  |  Branch (585:24): [True: 1.40k, False: 147k]
  ------------------
  586|   214k|        c == 0xb3d ||
  ------------------
  |  Branch (586:9): [True: 467, False: 213k]
  ------------------
  587|   213k|        (c >= 0xb5c && c <= 0xb5d) ||
  ------------------
  |  Branch (587:10): [True: 143k, False: 70.1k]
  |  Branch (587:24): [True: 529, False: 143k]
  ------------------
  588|   213k|        (c >= 0xb5f && c <= 0xb61) ||
  ------------------
  |  Branch (588:10): [True: 143k, False: 70.1k]
  |  Branch (588:24): [True: 1.18k, False: 142k]
  ------------------
  589|   212k|        (c >= 0xb85 && c <= 0xb8a) ||
  ------------------
  |  Branch (589:10): [True: 141k, False: 71.0k]
  |  Branch (589:24): [True: 1.16k, False: 140k]
  ------------------
  590|   211k|        (c >= 0xb8e && c <= 0xb90) ||
  ------------------
  |  Branch (590:10): [True: 140k, False: 71.0k]
  |  Branch (590:24): [True: 1.58k, False: 138k]
  ------------------
  591|   209k|        (c >= 0xb92 && c <= 0xb95) ||
  ------------------
  |  Branch (591:10): [True: 138k, False: 71.0k]
  |  Branch (591:24): [True: 654, False: 137k]
  ------------------
  592|   208k|        (c >= 0xb99 && c <= 0xb9a) ||
  ------------------
  |  Branch (592:10): [True: 137k, False: 71.0k]
  |  Branch (592:24): [True: 694, False: 137k]
  ------------------
  593|   208k|        c == 0xb9c ||
  ------------------
  |  Branch (593:9): [True: 1.26k, False: 206k]
  ------------------
  594|   206k|        (c >= 0xb9e && c <= 0xb9f) ||
  ------------------
  |  Branch (594:10): [True: 135k, False: 71.0k]
  |  Branch (594:24): [True: 694, False: 135k]
  ------------------
  595|   206k|        (c >= 0xba3 && c <= 0xba4) ||
  ------------------
  |  Branch (595:10): [True: 135k, False: 71.0k]
  |  Branch (595:24): [True: 332, False: 134k]
  ------------------
  596|   205k|        (c >= 0xba8 && c <= 0xbaa) ||
  ------------------
  |  Branch (596:10): [True: 134k, False: 71.0k]
  |  Branch (596:24): [True: 203, False: 134k]
  ------------------
  597|   205k|        (c >= 0xbae && c <= 0xbb5) ||
  ------------------
  |  Branch (597:10): [True: 134k, False: 71.0k]
  |  Branch (597:24): [True: 292, False: 134k]
  ------------------
  598|   205k|        (c >= 0xbb7 && c <= 0xbb9) ||
  ------------------
  |  Branch (598:10): [True: 134k, False: 71.0k]
  |  Branch (598:24): [True: 1.55k, False: 132k]
  ------------------
  599|   203k|        (c >= 0xc05 && c <= 0xc0c) ||
  ------------------
  |  Branch (599:10): [True: 127k, False: 75.8k]
  |  Branch (599:24): [True: 251, False: 127k]
  ------------------
  600|   203k|        (c >= 0xc0e && c <= 0xc10) ||
  ------------------
  |  Branch (600:10): [True: 127k, False: 75.8k]
  |  Branch (600:24): [True: 606, False: 127k]
  ------------------
  601|   202k|        (c >= 0xc12 && c <= 0xc28) ||
  ------------------
  |  Branch (601:10): [True: 127k, False: 75.8k]
  |  Branch (601:24): [True: 702, False: 126k]
  ------------------
  602|   202k|        (c >= 0xc2a && c <= 0xc33) ||
  ------------------
  |  Branch (602:10): [True: 126k, False: 75.8k]
  |  Branch (602:24): [True: 219, False: 126k]
  ------------------
  603|   202k|        (c >= 0xc35 && c <= 0xc39) ||
  ------------------
  |  Branch (603:10): [True: 126k, False: 75.8k]
  |  Branch (603:24): [True: 199, False: 125k]
  ------------------
  604|   201k|        (c >= 0xc60 && c <= 0xc61) ||
  ------------------
  |  Branch (604:10): [True: 122k, False: 79.1k]
  |  Branch (604:24): [True: 250, False: 122k]
  ------------------
  605|   201k|        (c >= 0xc85 && c <= 0xc8c) ||
  ------------------
  |  Branch (605:10): [True: 120k, False: 80.5k]
  |  Branch (605:24): [True: 1.02k, False: 119k]
  ------------------
  606|   200k|        (c >= 0xc8e && c <= 0xc90) ||
  ------------------
  |  Branch (606:10): [True: 119k, False: 80.5k]
  |  Branch (606:24): [True: 205, False: 119k]
  ------------------
  607|   200k|        (c >= 0xc92 && c <= 0xca8) ||
  ------------------
  |  Branch (607:10): [True: 119k, False: 80.5k]
  |  Branch (607:24): [True: 1.48k, False: 118k]
  ------------------
  608|   198k|        (c >= 0xcaa && c <= 0xcb3) ||
  ------------------
  |  Branch (608:10): [True: 118k, False: 80.5k]
  |  Branch (608:24): [True: 3.10k, False: 115k]
  ------------------
  609|   195k|        (c >= 0xcb5 && c <= 0xcb9) ||
  ------------------
  |  Branch (609:10): [True: 115k, False: 80.6k]
  |  Branch (609:24): [True: 1.44k, False: 113k]
  ------------------
  610|   194k|        c == 0xcde ||
  ------------------
  |  Branch (610:9): [True: 281, False: 194k]
  ------------------
  611|   194k|        (c >= 0xce0 && c <= 0xce1) ||
  ------------------
  |  Branch (611:10): [True: 108k, False: 85.2k]
  |  Branch (611:24): [True: 890, False: 107k]
  ------------------
  612|   193k|        (c >= 0xd05 && c <= 0xd0c) ||
  ------------------
  |  Branch (612:10): [True: 106k, False: 86.4k]
  |  Branch (612:24): [True: 194, False: 106k]
  ------------------
  613|   192k|        (c >= 0xd0e && c <= 0xd10) ||
  ------------------
  |  Branch (613:10): [True: 106k, False: 86.4k]
  |  Branch (613:24): [True: 392, False: 106k]
  ------------------
  614|   192k|        (c >= 0xd12 && c <= 0xd28) ||
  ------------------
  |  Branch (614:10): [True: 106k, False: 86.4k]
  |  Branch (614:24): [True: 256, False: 105k]
  ------------------
  615|   192k|        (c >= 0xd2a && c <= 0xd39) ||
  ------------------
  |  Branch (615:10): [True: 105k, False: 86.4k]
  |  Branch (615:24): [True: 724, False: 105k]
  ------------------
  616|   191k|        (c >= 0xd60 && c <= 0xd61) ||
  ------------------
  |  Branch (616:10): [True: 101k, False: 90.0k]
  |  Branch (616:24): [True: 273, False: 101k]
  ------------------
  617|   191k|        (c >= 0xe01 && c <= 0xe2e) ||
  ------------------
  |  Branch (617:10): [True: 100k, False: 90.5k]
  |  Branch (617:24): [True: 503, False: 100k]
  ------------------
  618|   190k|        c == 0xe30 ||
  ------------------
  |  Branch (618:9): [True: 476, False: 190k]
  ------------------
  619|   190k|        (c >= 0xe32 && c <= 0xe33) ||
  ------------------
  |  Branch (619:10): [True: 99.4k, False: 90.8k]
  |  Branch (619:24): [True: 2.83k, False: 96.5k]
  ------------------
  620|   187k|        (c >= 0xe40 && c <= 0xe45) ||
  ------------------
  |  Branch (620:10): [True: 94.8k, False: 92.6k]
  |  Branch (620:24): [True: 773, False: 94.1k]
  ------------------
  621|   186k|        (c >= 0xe81 && c <= 0xe82) ||
  ------------------
  |  Branch (621:10): [True: 92.0k, False: 94.6k]
  |  Branch (621:24): [True: 421, False: 91.6k]
  ------------------
  622|   186k|        c == 0xe84 ||
  ------------------
  |  Branch (622:9): [True: 237, False: 186k]
  ------------------
  623|   186k|        (c >= 0xe87 && c <= 0xe88) ||
  ------------------
  |  Branch (623:10): [True: 91.2k, False: 94.7k]
  |  Branch (623:24): [True: 440, False: 90.8k]
  ------------------
  624|   185k|        c == 0xe8a ||
  ------------------
  |  Branch (624:9): [True: 423, False: 185k]
  ------------------
  625|   185k|        c == 0xe8d ||
  ------------------
  |  Branch (625:9): [True: 369, False: 184k]
  ------------------
  626|   184k|        (c >= 0xe94 && c <= 0xe97) ||
  ------------------
  |  Branch (626:10): [True: 90.0k, False: 94.7k]
  |  Branch (626:24): [True: 144, False: 89.8k]
  ------------------
  627|   184k|        (c >= 0xe99 && c <= 0xe9f) ||
  ------------------
  |  Branch (627:10): [True: 89.8k, False: 94.7k]
  |  Branch (627:24): [True: 2.77k, False: 87.1k]
  ------------------
  628|   181k|        (c >= 0xea1 && c <= 0xea3) ||
  ------------------
  |  Branch (628:10): [True: 87.1k, False: 94.7k]
  |  Branch (628:24): [True: 948, False: 86.1k]
  ------------------
  629|   180k|        c == 0xea5 ||
  ------------------
  |  Branch (629:9): [True: 207, False: 180k]
  ------------------
  630|   180k|        c == 0xea7 ||
  ------------------
  |  Branch (630:9): [True: 232, False: 180k]
  ------------------
  631|   180k|        (c >= 0xeaa && c <= 0xeab) ||
  ------------------
  |  Branch (631:10): [True: 85.7k, False: 94.7k]
  |  Branch (631:24): [True: 555, False: 85.1k]
  ------------------
  632|   179k|        (c >= 0xead && c <= 0xeae) ||
  ------------------
  |  Branch (632:10): [True: 85.1k, False: 94.7k]
  |  Branch (632:24): [True: 309, False: 84.8k]
  ------------------
  633|   179k|        c == 0xeb0 ||
  ------------------
  |  Branch (633:9): [True: 269, False: 179k]
  ------------------
  634|   179k|        (c >= 0xeb2 && c <= 0xeb3) ||
  ------------------
  |  Branch (634:10): [True: 84.3k, False: 95.0k]
  |  Branch (634:24): [True: 1.44k, False: 82.8k]
  ------------------
  635|   177k|        c == 0xebd ||
  ------------------
  |  Branch (635:9): [True: 1.06k, False: 176k]
  ------------------
  636|   176k|        (c >= 0xec0 && c <= 0xec4) ||
  ------------------
  |  Branch (636:10): [True: 80.7k, False: 96.1k]
  |  Branch (636:24): [True: 261, False: 80.4k]
  ------------------
  637|   176k|        (c >= 0xf40 && c <= 0xf47) ||
  ------------------
  |  Branch (637:10): [True: 75.8k, False: 100k]
  |  Branch (637:24): [True: 482, False: 75.4k]
  ------------------
  638|   176k|        (c >= 0xf49 && c <= 0xf69) ||
  ------------------
  |  Branch (638:10): [True: 75.4k, False: 100k]
  |  Branch (638:24): [True: 327, False: 75.0k]
  ------------------
  639|   175k|        (c >= 0x10a0 && c <= 0x10c5) ||
  ------------------
  |  Branch (639:10): [True: 69.2k, False: 106k]
  |  Branch (639:25): [True: 466, False: 68.7k]
  ------------------
  640|   175k|        (c >= 0x10d0 && c <= 0x10f6) ||
  ------------------
  |  Branch (640:10): [True: 68.7k, False: 106k]
  |  Branch (640:25): [True: 600, False: 68.1k]
  ------------------
  641|   174k|        c == 0x1100 ||
  ------------------
  |  Branch (641:9): [True: 979, False: 173k]
  ------------------
  642|   173k|        (c >= 0x1102 && c <= 0x1103) ||
  ------------------
  |  Branch (642:10): [True: 67.2k, False: 106k]
  |  Branch (642:25): [True: 1.39k, False: 65.8k]
  ------------------
  643|   172k|        (c >= 0x1105 && c <= 0x1107) ||
  ------------------
  |  Branch (643:10): [True: 65.8k, False: 106k]
  |  Branch (643:25): [True: 1.69k, False: 64.1k]
  ------------------
  644|   170k|        c == 0x1109 ||
  ------------------
  |  Branch (644:9): [True: 202, False: 170k]
  ------------------
  645|   170k|        (c >= 0x110b && c <= 0x110c) ||
  ------------------
  |  Branch (645:10): [True: 63.9k, False: 106k]
  |  Branch (645:25): [True: 245, False: 63.6k]
  ------------------
  646|   170k|        (c >= 0x110e && c <= 0x1112) ||
  ------------------
  |  Branch (646:10): [True: 63.6k, False: 106k]
  |  Branch (646:25): [True: 1.81k, False: 61.8k]
  ------------------
  647|   168k|        c == 0x113c ||
  ------------------
  |  Branch (647:9): [True: 205, False: 168k]
  ------------------
  648|   168k|        c == 0x113e ||
  ------------------
  |  Branch (648:9): [True: 504, False: 167k]
  ------------------
  649|   167k|        c == 0x1140 ||
  ------------------
  |  Branch (649:9): [True: 151, False: 167k]
  ------------------
  650|   167k|        c == 0x114c ||
  ------------------
  |  Branch (650:9): [True: 271, False: 167k]
  ------------------
  651|   167k|        c == 0x114e ||
  ------------------
  |  Branch (651:9): [True: 1.61k, False: 165k]
  ------------------
  652|   165k|        c == 0x1150 ||
  ------------------
  |  Branch (652:9): [True: 321, False: 165k]
  ------------------
  653|   165k|        (c >= 0x1154 && c <= 0x1155) ||
  ------------------
  |  Branch (653:10): [True: 58.7k, False: 106k]
  |  Branch (653:25): [True: 1.49k, False: 57.2k]
  ------------------
  654|   163k|        c == 0x1159 ||
  ------------------
  |  Branch (654:9): [True: 200, False: 163k]
  ------------------
  655|   163k|        (c >= 0x115f && c <= 0x1161) ||
  ------------------
  |  Branch (655:10): [True: 57.0k, False: 106k]
  |  Branch (655:25): [True: 272, False: 56.8k]
  ------------------
  656|   163k|        c == 0x1163 ||
  ------------------
  |  Branch (656:9): [True: 238, False: 163k]
  ------------------
  657|   163k|        c == 0x1165 ||
  ------------------
  |  Branch (657:9): [True: 204, False: 162k]
  ------------------
  658|   162k|        c == 0x1167 ||
  ------------------
  |  Branch (658:9): [True: 709, False: 162k]
  ------------------
  659|   162k|        c == 0x1169 ||
  ------------------
  |  Branch (659:9): [True: 209, False: 162k]
  ------------------
  660|   162k|        (c >= 0x116d && c <= 0x116e) ||
  ------------------
  |  Branch (660:10): [True: 55.4k, False: 106k]
  |  Branch (660:25): [True: 419, False: 55.0k]
  ------------------
  661|   161k|        (c >= 0x1172 && c <= 0x1173) ||
  ------------------
  |  Branch (661:10): [True: 55.0k, False: 106k]
  |  Branch (661:25): [True: 697, False: 54.3k]
  ------------------
  662|   160k|        c == 0x1175 ||
  ------------------
  |  Branch (662:9): [True: 561, False: 160k]
  ------------------
  663|   160k|        c == 0x119e ||
  ------------------
  |  Branch (663:9): [True: 277, False: 160k]
  ------------------
  664|   160k|        c == 0x11a8 ||
  ------------------
  |  Branch (664:9): [True: 693, False: 159k]
  ------------------
  665|   159k|        c == 0x11ab ||
  ------------------
  |  Branch (665:9): [True: 263, False: 159k]
  ------------------
  666|   159k|        (c >= 0x11ae && c <= 0x11af) ||
  ------------------
  |  Branch (666:10): [True: 52.5k, False: 106k]
  |  Branch (666:25): [True: 196, False: 52.3k]
  ------------------
  667|   158k|        (c >= 0x11b7 && c <= 0x11b8) ||
  ------------------
  |  Branch (667:10): [True: 52.3k, False: 106k]
  |  Branch (667:25): [True: 632, False: 51.7k]
  ------------------
  668|   158k|        c == 0x11ba ||
  ------------------
  |  Branch (668:9): [True: 195, False: 158k]
  ------------------
  669|   158k|        (c >= 0x11bc && c <= 0x11c2) ||
  ------------------
  |  Branch (669:10): [True: 51.5k, False: 106k]
  |  Branch (669:25): [True: 248, False: 51.2k]
  ------------------
  670|   157k|        c == 0x11eb ||
  ------------------
  |  Branch (670:9): [True: 197, False: 157k]
  ------------------
  671|   157k|        c == 0x11f0 ||
  ------------------
  |  Branch (671:9): [True: 670, False: 156k]
  ------------------
  672|   156k|        c == 0x11f9 ||
  ------------------
  |  Branch (672:9): [True: 552, False: 156k]
  ------------------
  673|   156k|        (c >= 0x1e00 && c <= 0x1e9b) ||
  ------------------
  |  Branch (673:10): [True: 49.7k, False: 106k]
  |  Branch (673:25): [True: 707, False: 49.0k]
  ------------------
  674|   155k|        (c >= 0x1ea0 && c <= 0x1ef9) ||
  ------------------
  |  Branch (674:10): [True: 49.0k, False: 106k]
  |  Branch (674:25): [True: 599, False: 48.4k]
  ------------------
  675|   155k|        (c >= 0x1f00 && c <= 0x1f15) ||
  ------------------
  |  Branch (675:10): [True: 48.4k, False: 106k]
  |  Branch (675:25): [True: 821, False: 47.6k]
  ------------------
  676|   154k|        (c >= 0x1f18 && c <= 0x1f1d) ||
  ------------------
  |  Branch (676:10): [True: 47.6k, False: 106k]
  |  Branch (676:25): [True: 388, False: 47.2k]
  ------------------
  677|   153k|        (c >= 0x1f20 && c <= 0x1f45) ||
  ------------------
  |  Branch (677:10): [True: 47.2k, False: 106k]
  |  Branch (677:25): [True: 1.13k, False: 46.1k]
  ------------------
  678|   152k|        (c >= 0x1f48 && c <= 0x1f4d) ||
  ------------------
  |  Branch (678:10): [True: 46.1k, False: 106k]
  |  Branch (678:25): [True: 474, False: 45.6k]
  ------------------
  679|   152k|        (c >= 0x1f50 && c <= 0x1f57) ||
  ------------------
  |  Branch (679:10): [True: 45.6k, False: 106k]
  |  Branch (679:25): [True: 196, False: 45.4k]
  ------------------
  680|   152k|        c == 0x1f59 ||
  ------------------
  |  Branch (680:9): [True: 463, False: 151k]
  ------------------
  681|   151k|        c == 0x1f5b ||
  ------------------
  |  Branch (681:9): [True: 265, False: 151k]
  ------------------
  682|   151k|        c == 0x1f5d ||
  ------------------
  |  Branch (682:9): [True: 205, False: 151k]
  ------------------
  683|   151k|        (c >= 0x1f5f && c <= 0x1f7d) ||
  ------------------
  |  Branch (683:10): [True: 44.5k, False: 106k]
  |  Branch (683:25): [True: 406, False: 44.1k]
  ------------------
  684|   150k|        (c >= 0x1f80 && c <= 0x1fb4) ||
  ------------------
  |  Branch (684:10): [True: 44.1k, False: 106k]
  |  Branch (684:25): [True: 839, False: 43.2k]
  ------------------
  685|   149k|        (c >= 0x1fb6 && c <= 0x1fbc) ||
  ------------------
  |  Branch (685:10): [True: 43.2k, False: 106k]
  |  Branch (685:25): [True: 694, False: 42.5k]
  ------------------
  686|   149k|        c == 0x1fbe ||
  ------------------
  |  Branch (686:9): [True: 813, False: 148k]
  ------------------
  687|   148k|        (c >= 0x1fc2 && c <= 0x1fc4) ||
  ------------------
  |  Branch (687:10): [True: 41.7k, False: 106k]
  |  Branch (687:25): [True: 624, False: 41.1k]
  ------------------
  688|   147k|        (c >= 0x1fc6 && c <= 0x1fcc) ||
  ------------------
  |  Branch (688:10): [True: 41.1k, False: 106k]
  |  Branch (688:25): [True: 346, False: 40.7k]
  ------------------
  689|   147k|        (c >= 0x1fd0 && c <= 0x1fd3) ||
  ------------------
  |  Branch (689:10): [True: 40.7k, False: 106k]
  |  Branch (689:25): [True: 435, False: 40.3k]
  ------------------
  690|   147k|        (c >= 0x1fd6 && c <= 0x1fdb) ||
  ------------------
  |  Branch (690:10): [True: 40.3k, False: 106k]
  |  Branch (690:25): [True: 619, False: 39.6k]
  ------------------
  691|   146k|        (c >= 0x1fe0 && c <= 0x1fec) ||
  ------------------
  |  Branch (691:10): [True: 39.6k, False: 106k]
  |  Branch (691:25): [True: 456, False: 39.2k]
  ------------------
  692|   145k|        (c >= 0x1ff2 && c <= 0x1ff4) ||
  ------------------
  |  Branch (692:10): [True: 39.2k, False: 106k]
  |  Branch (692:25): [True: 219, False: 38.9k]
  ------------------
  693|   145k|        (c >= 0x1ff6 && c <= 0x1ffc) ||
  ------------------
  |  Branch (693:10): [True: 38.9k, False: 106k]
  |  Branch (693:25): [True: 1.62k, False: 37.3k]
  ------------------
  694|   144k|        c == 0x2126 ||
  ------------------
  |  Branch (694:9): [True: 210, False: 143k]
  ------------------
  695|   143k|        (c >= 0x212a && c <= 0x212b) ||
  ------------------
  |  Branch (695:10): [True: 36.1k, False: 107k]
  |  Branch (695:25): [True: 204, False: 35.9k]
  ------------------
  696|   143k|        c == 0x212e ||
  ------------------
  |  Branch (696:9): [True: 210, False: 143k]
  ------------------
  697|   143k|        (c >= 0x2180 && c <= 0x2182) ||
  ------------------
  |  Branch (697:10): [True: 35.7k, False: 107k]
  |  Branch (697:25): [True: 491, False: 35.2k]
  ------------------
  698|   142k|        (c >= 0x3041 && c <= 0x3094) ||
  ------------------
  |  Branch (698:10): [True: 33.4k, False: 109k]
  |  Branch (698:25): [True: 435, False: 33.0k]
  ------------------
  699|   142k|        (c >= 0x30a1 && c <= 0x30fa) ||
  ------------------
  |  Branch (699:10): [True: 29.7k, False: 112k]
  |  Branch (699:25): [True: 762, False: 28.9k]
  ------------------
  700|   141k|        (c >= 0x3105 && c <= 0x312c) ||
  ------------------
  |  Branch (700:10): [True: 28.7k, False: 113k]
  |  Branch (700:25): [True: 650, False: 28.0k]
  ------------------
  701|   141k|        (c >= 0xac00 && c <= 0xd7a3) ||
  ------------------
  |  Branch (701:10): [True: 26.5k, False: 114k]
  |  Branch (701:25): [True: 859, False: 25.6k]
  ------------------
  702|   140k|        (c >= 0x4e00 && c <= 0x9fa5) ||
  ------------------
  |  Branch (702:10): [True: 27.2k, False: 113k]
  |  Branch (702:25): [True: 1.51k, False: 25.6k]
  ------------------
  703|   138k|        c == 0x3007 ||
  ------------------
  |  Branch (703:9): [True: 198, False: 138k]
  ------------------
  704|   138k|        (c >= 0x3021 && c <= 0x3029) ||
  ------------------
  |  Branch (704:10): [True: 30.5k, False: 108k]
  |  Branch (704:25): [True: 255, False: 30.2k]
  ------------------
  705|   138k|        (c >= 0x4e00 && c <= 0x9fa5) ||
  ------------------
  |  Branch (705:10): [True: 25.6k, False: 112k]
  |  Branch (705:25): [True: 0, False: 25.6k]
  ------------------
  706|   138k|        c == 0x3007 ||
  ------------------
  |  Branch (706:9): [True: 0, False: 138k]
  ------------------
  707|   138k|        (c >= 0x3021 && c <= 0x3029));
  ------------------
  |  Branch (707:10): [True: 30.2k, False: 108k]
  |  Branch (707:25): [True: 0, False: 30.2k]
  ------------------
  708|   900k|}
prvTidyIsXMLNamechar:
  711|   834k|{
  712|   834k|    return (TY_(IsXMLLetter)(c) ||
  ------------------
  |  |   23|   834k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   834k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (712:13): [True: 705k, False: 128k]
  ------------------
  713|   128k|        c == '.' || c == '_' ||
  ------------------
  |  Branch (713:9): [True: 433, False: 128k]
  |  Branch (713:21): [True: 1.32k, False: 127k]
  ------------------
  714|   127k|        c == ':' || c == '-' ||
  ------------------
  |  Branch (714:9): [True: 724, False: 126k]
  |  Branch (714:21): [True: 1.49k, False: 124k]
  ------------------
  715|   124k|        (c >= 0x300 && c <= 0x345) ||
  ------------------
  |  Branch (715:10): [True: 104k, False: 20.2k]
  |  Branch (715:24): [True: 866, False: 103k]
  ------------------
  716|   124k|        (c >= 0x360 && c <= 0x361) ||
  ------------------
  |  Branch (716:10): [True: 103k, False: 20.3k]
  |  Branch (716:24): [True: 760, False: 103k]
  ------------------
  717|   123k|        (c >= 0x483 && c <= 0x486) ||
  ------------------
  |  Branch (717:10): [True: 102k, False: 20.5k]
  |  Branch (717:24): [True: 269, False: 102k]
  ------------------
  718|   123k|        (c >= 0x591 && c <= 0x5a1) ||
  ------------------
  |  Branch (718:10): [True: 102k, False: 20.6k]
  |  Branch (718:24): [True: 1.09k, False: 101k]
  ------------------
  719|   121k|        (c >= 0x5a3 && c <= 0x5b9) ||
  ------------------
  |  Branch (719:10): [True: 101k, False: 20.6k]
  |  Branch (719:24): [True: 1.02k, False: 100k]
  ------------------
  720|   120k|        (c >= 0x5bb && c <= 0x5bd) ||
  ------------------
  |  Branch (720:10): [True: 100k, False: 20.6k]
  |  Branch (720:24): [True: 301, False: 100k]
  ------------------
  721|   120k|        c == 0x5bf ||
  ------------------
  |  Branch (721:9): [True: 68, False: 120k]
  ------------------
  722|   120k|        (c >= 0x5c1 && c <= 0x5c2) ||
  ------------------
  |  Branch (722:10): [True: 99.9k, False: 20.6k]
  |  Branch (722:24): [True: 834, False: 99.1k]
  ------------------
  723|   119k|        c == 0x5c4 ||
  ------------------
  |  Branch (723:9): [True: 550, False: 119k]
  ------------------
  724|   119k|        (c >= 0x64b && c <= 0x652) ||
  ------------------
  |  Branch (724:10): [True: 98.3k, False: 20.8k]
  |  Branch (724:24): [True: 1.12k, False: 97.2k]
  ------------------
  725|   118k|        c == 0x670 ||
  ------------------
  |  Branch (725:9): [True: 452, False: 117k]
  ------------------
  726|   117k|        (c >= 0x6d6 && c <= 0x6dc) ||
  ------------------
  |  Branch (726:10): [True: 96.1k, False: 21.4k]
  |  Branch (726:24): [True: 1.22k, False: 94.9k]
  ------------------
  727|   116k|        (c >= 0x6dd && c <= 0x6df) ||
  ------------------
  |  Branch (727:10): [True: 94.9k, False: 21.4k]
  |  Branch (727:24): [True: 820, False: 94.1k]
  ------------------
  728|   115k|        (c >= 0x6e0 && c <= 0x6e4) ||
  ------------------
  |  Branch (728:10): [True: 94.1k, False: 21.4k]
  |  Branch (728:24): [True: 1.36k, False: 92.7k]
  ------------------
  729|   114k|        (c >= 0x6e7 && c <= 0x6e8) ||
  ------------------
  |  Branch (729:10): [True: 92.7k, False: 21.4k]
  |  Branch (729:24): [True: 556, False: 92.2k]
  ------------------
  730|   113k|        (c >= 0x6ea && c <= 0x6ed) ||
  ------------------
  |  Branch (730:10): [True: 92.2k, False: 21.4k]
  |  Branch (730:24): [True: 2.66k, False: 89.5k]
  ------------------
  731|   110k|        (c >= 0x901 && c <= 0x903) ||
  ------------------
  |  Branch (731:10): [True: 88.2k, False: 22.6k]
  |  Branch (731:24): [True: 964, False: 87.2k]
  ------------------
  732|   109k|        c == 0x93c ||
  ------------------
  |  Branch (732:9): [True: 375, False: 109k]
  ------------------
  733|   109k|        (c >= 0x93e && c <= 0x94c) ||
  ------------------
  |  Branch (733:10): [True: 86.9k, False: 22.6k]
  |  Branch (733:24): [True: 431, False: 86.4k]
  ------------------
  734|   109k|        c == 0x94d ||
  ------------------
  |  Branch (734:9): [True: 598, False: 108k]
  ------------------
  735|   108k|        (c >= 0x951 && c <= 0x954) ||
  ------------------
  |  Branch (735:10): [True: 85.8k, False: 22.6k]
  |  Branch (735:24): [True: 926, False: 84.9k]
  ------------------
  736|   107k|        (c >= 0x962 && c <= 0x963) ||
  ------------------
  |  Branch (736:10): [True: 84.9k, False: 22.6k]
  |  Branch (736:24): [True: 284, False: 84.6k]
  ------------------
  737|   107k|        (c >= 0x981 && c <= 0x983) ||
  ------------------
  |  Branch (737:10): [True: 84.4k, False: 22.9k]
  |  Branch (737:24): [True: 712, False: 83.7k]
  ------------------
  738|   106k|        c == 0x9bc ||
  ------------------
  |  Branch (738:9): [True: 500, False: 106k]
  ------------------
  739|   106k|        c == 0x9be ||
  ------------------
  |  Branch (739:9): [True: 510, False: 105k]
  ------------------
  740|   105k|        c == 0x9bf ||
  ------------------
  |  Branch (740:9): [True: 427, False: 105k]
  ------------------
  741|   105k|        (c >= 0x9c0 && c <= 0x9c4) ||
  ------------------
  |  Branch (741:10): [True: 82.2k, False: 22.9k]
  |  Branch (741:24): [True: 496, False: 81.7k]
  ------------------
  742|   104k|        (c >= 0x9c7 && c <= 0x9c8) ||
  ------------------
  |  Branch (742:10): [True: 81.7k, False: 22.9k]
  |  Branch (742:24): [True: 604, False: 81.1k]
  ------------------
  743|   104k|        (c >= 0x9cb && c <= 0x9cd) ||
  ------------------
  |  Branch (743:10): [True: 81.1k, False: 22.9k]
  |  Branch (743:24): [True: 246, False: 80.9k]
  ------------------
  744|   103k|        c == 0x9d7 ||
  ------------------
  |  Branch (744:9): [True: 374, False: 103k]
  ------------------
  745|   103k|        (c >= 0x9e2 && c <= 0x9e3) ||
  ------------------
  |  Branch (745:10): [True: 80.5k, False: 22.9k]
  |  Branch (745:24): [True: 457, False: 80.0k]
  ------------------
  746|   103k|        c == 0xa02 ||
  ------------------
  |  Branch (746:9): [True: 1.22k, False: 101k]
  ------------------
  747|   101k|        c == 0xa3c ||
  ------------------
  |  Branch (747:9): [True: 197, False: 101k]
  ------------------
  748|   101k|        c == 0xa3e ||
  ------------------
  |  Branch (748:9): [True: 664, False: 100k]
  ------------------
  749|   100k|        c == 0xa3f ||
  ------------------
  |  Branch (749:9): [True: 210, False: 100k]
  ------------------
  750|   100k|        (c >= 0xa40 && c <= 0xa42) ||
  ------------------
  |  Branch (750:10): [True: 77.2k, False: 23.5k]
  |  Branch (750:24): [True: 521, False: 76.7k]
  ------------------
  751|   100k|        (c >= 0xa47 && c <= 0xa48) ||
  ------------------
  |  Branch (751:10): [True: 76.7k, False: 23.5k]
  |  Branch (751:24): [True: 609, False: 76.1k]
  ------------------
  752|  99.6k|        (c >= 0xa4b && c <= 0xa4d) ||
  ------------------
  |  Branch (752:10): [True: 76.1k, False: 23.5k]
  |  Branch (752:24): [True: 542, False: 75.5k]
  ------------------
  753|  99.0k|        (c >= 0xa70 && c <= 0xa71) ||
  ------------------
  |  Branch (753:10): [True: 74.9k, False: 24.1k]
  |  Branch (753:24): [True: 817, False: 74.1k]
  ------------------
  754|  98.2k|        (c >= 0xa81 && c <= 0xa83) ||
  ------------------
  |  Branch (754:10): [True: 74.1k, False: 24.1k]
  |  Branch (754:24): [True: 564, False: 73.6k]
  ------------------
  755|  97.7k|        c == 0xabc ||
  ------------------
  |  Branch (755:9): [True: 267, False: 97.4k]
  ------------------
  756|  97.4k|        (c >= 0xabe && c <= 0xac5) ||
  ------------------
  |  Branch (756:10): [True: 73.3k, False: 24.1k]
  |  Branch (756:24): [True: 1.31k, False: 72.0k]
  ------------------
  757|  96.1k|        (c >= 0xac7 && c <= 0xac9) ||
  ------------------
  |  Branch (757:10): [True: 72.0k, False: 24.1k]
  |  Branch (757:24): [True: 700, False: 71.3k]
  ------------------
  758|  95.4k|        (c >= 0xacb && c <= 0xacd) ||
  ------------------
  |  Branch (758:10): [True: 71.3k, False: 24.1k]
  |  Branch (758:24): [True: 601, False: 70.7k]
  ------------------
  759|  94.8k|        (c >= 0xb01 && c <= 0xb03) ||
  ------------------
  |  Branch (759:10): [True: 70.4k, False: 24.3k]
  |  Branch (759:24): [True: 501, False: 69.9k]
  ------------------
  760|  94.3k|        c == 0xb3c ||
  ------------------
  |  Branch (760:9): [True: 661, False: 93.6k]
  ------------------
  761|  93.6k|        (c >= 0xb3e && c <= 0xb43) ||
  ------------------
  |  Branch (761:10): [True: 69.3k, False: 24.3k]
  |  Branch (761:24): [True: 1.08k, False: 68.2k]
  ------------------
  762|  92.5k|        (c >= 0xb47 && c <= 0xb48) ||
  ------------------
  |  Branch (762:10): [True: 68.2k, False: 24.3k]
  |  Branch (762:24): [True: 434, False: 67.8k]
  ------------------
  763|  92.1k|        (c >= 0xb4b && c <= 0xb4d) ||
  ------------------
  |  Branch (763:10): [True: 67.8k, False: 24.3k]
  |  Branch (763:24): [True: 397, False: 67.4k]
  ------------------
  764|  91.7k|        (c >= 0xb56 && c <= 0xb57) ||
  ------------------
  |  Branch (764:10): [True: 67.4k, False: 24.3k]
  |  Branch (764:24): [True: 260, False: 67.1k]
  ------------------
  765|  91.4k|        (c >= 0xb82 && c <= 0xb83) ||
  ------------------
  |  Branch (765:10): [True: 66.7k, False: 24.7k]
  |  Branch (765:24): [True: 434, False: 66.2k]
  ------------------
  766|  91.0k|        (c >= 0xbbe && c <= 0xbc2) ||
  ------------------
  |  Branch (766:10): [True: 66.2k, False: 24.7k]
  |  Branch (766:24): [True: 1.76k, False: 64.5k]
  ------------------
  767|  89.2k|        (c >= 0xbc6 && c <= 0xbc8) ||
  ------------------
  |  Branch (767:10): [True: 64.5k, False: 24.7k]
  |  Branch (767:24): [True: 603, False: 63.9k]
  ------------------
  768|  88.6k|        (c >= 0xbca && c <= 0xbcd) ||
  ------------------
  |  Branch (768:10): [True: 63.9k, False: 24.7k]
  |  Branch (768:24): [True: 635, False: 63.2k]
  ------------------
  769|  88.0k|        c == 0xbd7 ||
  ------------------
  |  Branch (769:9): [True: 643, False: 87.4k]
  ------------------
  770|  87.4k|        (c >= 0xc01 && c <= 0xc03) ||
  ------------------
  |  Branch (770:10): [True: 62.0k, False: 25.4k]
  |  Branch (770:24): [True: 563, False: 61.4k]
  ------------------
  771|  86.8k|        (c >= 0xc3e && c <= 0xc44) ||
  ------------------
  |  Branch (771:10): [True: 61.4k, False: 25.4k]
  |  Branch (771:24): [True: 1.16k, False: 60.2k]
  ------------------
  772|  85.6k|        (c >= 0xc46 && c <= 0xc48) ||
  ------------------
  |  Branch (772:10): [True: 60.2k, False: 25.4k]
  |  Branch (772:24): [True: 1.19k, False: 59.0k]
  ------------------
  773|  84.4k|        (c >= 0xc4a && c <= 0xc4d) ||
  ------------------
  |  Branch (773:10): [True: 59.0k, False: 25.4k]
  |  Branch (773:24): [True: 625, False: 58.4k]
  ------------------
  774|  83.8k|        (c >= 0xc55 && c <= 0xc56) ||
  ------------------
  |  Branch (774:10): [True: 58.4k, False: 25.4k]
  |  Branch (774:24): [True: 306, False: 58.1k]
  ------------------
  775|  83.5k|        (c >= 0xc82 && c <= 0xc83) ||
  ------------------
  |  Branch (775:10): [True: 57.7k, False: 25.8k]
  |  Branch (775:24): [True: 1.01k, False: 56.7k]
  ------------------
  776|  82.5k|        (c >= 0xcbe && c <= 0xcc4) ||
  ------------------
  |  Branch (776:10): [True: 56.7k, False: 25.8k]
  |  Branch (776:24): [True: 1.36k, False: 55.3k]
  ------------------
  777|  81.1k|        (c >= 0xcc6 && c <= 0xcc8) ||
  ------------------
  |  Branch (777:10): [True: 55.3k, False: 25.8k]
  |  Branch (777:24): [True: 1.73k, False: 53.6k]
  ------------------
  778|  79.4k|        (c >= 0xcca && c <= 0xccd) ||
  ------------------
  |  Branch (778:10): [True: 53.6k, False: 25.8k]
  |  Branch (778:24): [True: 719, False: 52.8k]
  ------------------
  779|  78.7k|        (c >= 0xcd5 && c <= 0xcd6) ||
  ------------------
  |  Branch (779:10): [True: 52.8k, False: 25.8k]
  |  Branch (779:24): [True: 863, False: 52.0k]
  ------------------
  780|  77.8k|        (c >= 0xd02 && c <= 0xd03) ||
  ------------------
  |  Branch (780:10): [True: 51.5k, False: 26.3k]
  |  Branch (780:24): [True: 709, False: 50.8k]
  ------------------
  781|  77.1k|        (c >= 0xd3e && c <= 0xd43) ||
  ------------------
  |  Branch (781:10): [True: 50.8k, False: 26.3k]
  |  Branch (781:24): [True: 806, False: 50.0k]
  ------------------
  782|  76.3k|        (c >= 0xd46 && c <= 0xd48) ||
  ------------------
  |  Branch (782:10): [True: 50.0k, False: 26.3k]
  |  Branch (782:24): [True: 1.78k, False: 48.2k]
  ------------------
  783|  74.5k|        (c >= 0xd4a && c <= 0xd4d) ||
  ------------------
  |  Branch (783:10): [True: 48.2k, False: 26.3k]
  |  Branch (783:24): [True: 719, False: 47.5k]
  ------------------
  784|  73.8k|        c == 0xd57 ||
  ------------------
  |  Branch (784:9): [True: 194, False: 73.6k]
  ------------------
  785|  73.6k|        c == 0xe31 ||
  ------------------
  |  Branch (785:9): [True: 328, False: 73.3k]
  ------------------
  786|  73.3k|        (c >= 0xe34 && c <= 0xe3a) ||
  ------------------
  |  Branch (786:10): [True: 46.4k, False: 26.9k]
  |  Branch (786:24): [True: 1.71k, False: 44.7k]
  ------------------
  787|  71.6k|        (c >= 0xe47 && c <= 0xe4e) ||
  ------------------
  |  Branch (787:10): [True: 44.2k, False: 27.3k]
  |  Branch (787:24): [True: 1.29k, False: 42.9k]
  ------------------
  788|  70.3k|        c == 0xeb1 ||
  ------------------
  |  Branch (788:9): [True: 255, False: 70.0k]
  ------------------
  789|  70.0k|        (c >= 0xeb4 && c <= 0xeb9) ||
  ------------------
  |  Branch (789:10): [True: 42.2k, False: 27.8k]
  |  Branch (789:24): [True: 822, False: 41.4k]
  ------------------
  790|  69.2k|        (c >= 0xebb && c <= 0xebc) ||
  ------------------
  |  Branch (790:10): [True: 41.4k, False: 27.8k]
  |  Branch (790:24): [True: 273, False: 41.1k]
  ------------------
  791|  68.9k|        (c >= 0xec8 && c <= 0xecd) ||
  ------------------
  |  Branch (791:10): [True: 40.8k, False: 28.1k]
  |  Branch (791:24): [True: 1.22k, False: 39.6k]
  ------------------
  792|  67.7k|        (c >= 0xf18 && c <= 0xf19) ||
  ------------------
  |  Branch (792:10): [True: 39.2k, False: 28.5k]
  |  Branch (792:24): [True: 479, False: 38.7k]
  ------------------
  793|  67.2k|        c == 0xf35 ||
  ------------------
  |  Branch (793:9): [True: 277, False: 66.9k]
  ------------------
  794|  66.9k|        c == 0xf37 ||
  ------------------
  |  Branch (794:9): [True: 510, False: 66.4k]
  ------------------
  795|  66.4k|        c == 0xf39 ||
  ------------------
  |  Branch (795:9): [True: 264, False: 66.2k]
  ------------------
  796|  66.2k|        c == 0xf3e ||
  ------------------
  |  Branch (796:9): [True: 272, False: 65.9k]
  ------------------
  797|  65.9k|        c == 0xf3f ||
  ------------------
  |  Branch (797:9): [True: 496, False: 65.4k]
  ------------------
  798|  65.4k|        (c >= 0xf71 && c <= 0xf84) ||
  ------------------
  |  Branch (798:10): [True: 36.5k, False: 28.8k]
  |  Branch (798:24): [True: 505, False: 36.0k]
  ------------------
  799|  64.9k|        (c >= 0xf86 && c <= 0xf8b) ||
  ------------------
  |  Branch (799:10): [True: 36.0k, False: 28.8k]
  |  Branch (799:24): [True: 351, False: 35.7k]
  ------------------
  800|  64.5k|        (c >= 0xf90 && c <= 0xf95) ||
  ------------------
  |  Branch (800:10): [True: 35.7k, False: 28.8k]
  |  Branch (800:24): [True: 793, False: 34.9k]
  ------------------
  801|  63.8k|        c == 0xf97 ||
  ------------------
  |  Branch (801:9): [True: 488, False: 63.3k]
  ------------------
  802|  63.3k|        (c >= 0xf99 && c <= 0xfad) ||
  ------------------
  |  Branch (802:10): [True: 34.4k, False: 28.8k]
  |  Branch (802:24): [True: 526, False: 33.9k]
  ------------------
  803|  62.7k|        (c >= 0xfb1 && c <= 0xfb7) ||
  ------------------
  |  Branch (803:10): [True: 33.8k, False: 28.9k]
  |  Branch (803:24): [True: 2.73k, False: 31.0k]
  ------------------
  804|  60.0k|        c == 0xfb9 ||
  ------------------
  |  Branch (804:9): [True: 279, False: 59.7k]
  ------------------
  805|  59.7k|        (c >= 0x20d0 && c <= 0x20dc) ||
  ------------------
  |  Branch (805:10): [True: 30.1k, False: 29.6k]
  |  Branch (805:25): [True: 332, False: 29.8k]
  ------------------
  806|  59.4k|        c == 0x20e1 ||
  ------------------
  |  Branch (806:9): [True: 197, False: 59.2k]
  ------------------
  807|  59.2k|        (c >= 0x302a && c <= 0x302f) ||
  ------------------
  |  Branch (807:10): [True: 29.2k, False: 29.9k]
  |  Branch (807:25): [True: 223, False: 29.0k]
  ------------------
  808|  59.0k|        c == 0x3099 ||
  ------------------
  |  Branch (808:9): [True: 195, False: 58.8k]
  ------------------
  809|  58.8k|        c == 0x309a ||
  ------------------
  |  Branch (809:9): [True: 1.16k, False: 57.6k]
  ------------------
  810|  57.6k|        (c >= 0x30 && c <= 0x39) ||
  ------------------
  |  Branch (810:10): [True: 46.2k, False: 11.3k]
  |  Branch (810:23): [True: 3.67k, False: 42.6k]
  ------------------
  811|  53.9k|        (c >= 0x660 && c <= 0x669) ||
  ------------------
  |  Branch (811:10): [True: 36.8k, False: 17.1k]
  |  Branch (811:24): [True: 538, False: 36.2k]
  ------------------
  812|  53.4k|        (c >= 0x6f0 && c <= 0x6f9) ||
  ------------------
  |  Branch (812:10): [True: 36.2k, False: 17.2k]
  |  Branch (812:24): [True: 1.09k, False: 35.1k]
  ------------------
  813|  52.3k|        (c >= 0x966 && c <= 0x96f) ||
  ------------------
  |  Branch (813:10): [True: 34.9k, False: 17.3k]
  |  Branch (813:24): [True: 242, False: 34.7k]
  ------------------
  814|  52.1k|        (c >= 0x9e6 && c <= 0x9ef) ||
  ------------------
  |  Branch (814:10): [True: 34.6k, False: 17.4k]
  |  Branch (814:24): [True: 526, False: 34.1k]
  ------------------
  815|  51.5k|        (c >= 0xa66 && c <= 0xa6f) ||
  ------------------
  |  Branch (815:10): [True: 34.1k, False: 17.4k]
  |  Branch (815:24): [True: 579, False: 33.5k]
  ------------------
  816|  51.0k|        (c >= 0xae6 && c <= 0xaef) ||
  ------------------
  |  Branch (816:10): [True: 33.5k, False: 17.4k]
  |  Branch (816:24): [True: 236, False: 33.3k]
  ------------------
  817|  50.7k|        (c >= 0xb66 && c <= 0xb6f) ||
  ------------------
  |  Branch (817:10): [True: 33.2k, False: 17.4k]
  |  Branch (817:24): [True: 412, False: 32.8k]
  ------------------
  818|  50.3k|        (c >= 0xbe7 && c <= 0xbef) ||
  ------------------
  |  Branch (818:10): [True: 32.8k, False: 17.4k]
  |  Branch (818:24): [True: 617, False: 32.2k]
  ------------------
  819|  49.7k|        (c >= 0xc66 && c <= 0xc6f) ||
  ------------------
  |  Branch (819:10): [True: 32.2k, False: 17.5k]
  |  Branch (819:24): [True: 350, False: 31.8k]
  ------------------
  820|  49.3k|        (c >= 0xce6 && c <= 0xcef) ||
  ------------------
  |  Branch (820:10): [True: 31.8k, False: 17.5k]
  |  Branch (820:24): [True: 460, False: 31.3k]
  ------------------
  821|  48.9k|        (c >= 0xd66 && c <= 0xd6f) ||
  ------------------
  |  Branch (821:10): [True: 31.2k, False: 17.6k]
  |  Branch (821:24): [True: 543, False: 30.7k]
  ------------------
  822|  48.3k|        (c >= 0xe50 && c <= 0xe59) ||
  ------------------
  |  Branch (822:10): [True: 30.2k, False: 18.1k]
  |  Branch (822:24): [True: 286, False: 29.9k]
  ------------------
  823|  48.1k|        (c >= 0xed0 && c <= 0xed9) ||
  ------------------
  |  Branch (823:10): [True: 29.5k, False: 18.5k]
  |  Branch (823:24): [True: 402, False: 29.1k]
  ------------------
  824|  47.7k|        (c >= 0xf20 && c <= 0xf29) ||
  ------------------
  |  Branch (824:10): [True: 29.1k, False: 18.5k]
  |  Branch (824:24): [True: 303, False: 28.8k]
  ------------------
  825|  47.3k|        c == 0xb7 ||
  ------------------
  |  Branch (825:9): [True: 414, False: 46.9k]
  ------------------
  826|  46.9k|        c == 0x2d0 ||
  ------------------
  |  Branch (826:9): [True: 957, False: 46.0k]
  ------------------
  827|  46.0k|        c == 0x2d1 ||
  ------------------
  |  Branch (827:9): [True: 575, False: 45.4k]
  ------------------
  828|  45.4k|        c == 0x387 ||
  ------------------
  |  Branch (828:9): [True: 246, False: 45.2k]
  ------------------
  829|  45.2k|        c == 0x640 ||
  ------------------
  |  Branch (829:9): [True: 223, False: 44.9k]
  ------------------
  830|  44.9k|        c == 0xe46 ||
  ------------------
  |  Branch (830:9): [True: 463, False: 44.5k]
  ------------------
  831|  44.5k|        c == 0xec6 ||
  ------------------
  |  Branch (831:9): [True: 326, False: 44.1k]
  ------------------
  832|  44.1k|        c == 0x3005 ||
  ------------------
  |  Branch (832:9): [True: 280, False: 43.9k]
  ------------------
  833|  43.9k|        (c >= 0x3031 && c <= 0x3035) ||
  ------------------
  |  Branch (833:10): [True: 27.7k, False: 16.2k]
  |  Branch (833:25): [True: 782, False: 26.9k]
  ------------------
  834|  43.1k|        (c >= 0x309d && c <= 0x309e) ||
  ------------------
  |  Branch (834:10): [True: 26.9k, False: 16.2k]
  |  Branch (834:25): [True: 1.94k, False: 24.9k]
  ------------------
  835|  41.1k|        (c >= 0x30fc && c <= 0x30fe));
  ------------------
  |  Branch (835:10): [True: 24.9k, False: 16.2k]
  |  Branch (835:25): [True: 250, False: 24.7k]
  ------------------
  836|   834k|}
prvTidyIsUpper:
  839|  9.09M|{
  840|  9.09M|    uint map = MAP(c);
  ------------------
  |  |  206|  9.09M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 8.96M, False: 133k]
  |  |  ------------------
  ------------------
  841|       |
  842|  9.09M|    return (map & uppercase)!=0;
  ------------------
  |  |   74|  9.09M|#define uppercase   64u
  ------------------
  843|  9.09M|}
prvTidyToLower:
  846|   138M|{
  847|   138M|    uint map = MAP(c);
  ------------------
  |  |  206|   138M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 131M, False: 7.77M]
  |  |  ------------------
  ------------------
  848|       |
  849|   138M|    if (map & uppercase)
  ------------------
  |  |   74|   138M|#define uppercase   64u
  ------------------
  |  Branch (849:9): [True: 13.3M, False: 125M]
  ------------------
  850|  13.3M|        c += 'a' - 'A';
  851|       |
  852|   138M|    return c;
  853|   138M|}
prvTidyToUpper:
  856|   248k|{
  857|   248k|    uint map = MAP(c);
  ------------------
  |  |  206|   248k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 239k, False: 9.41k]
  |  |  ------------------
  ------------------
  858|       |
  859|   248k|    if (map & lowercase)
  ------------------
  |  |   73|   248k|#define lowercase   32u
  ------------------
  |  Branch (859:9): [True: 11.5k, False: 237k]
  ------------------
  860|  11.5k|        c += (uint) ('A' - 'a' );
  861|       |
  862|   248k|    return c;
  863|   248k|}
prvTidyNewLexer:
  881|  20.2k|{
  882|  20.2k|    Lexer* lexer = (Lexer*) TidyDocAlloc( doc, sizeof(Lexer) );
  ------------------
  |  |  157|  20.2k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  20.2k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  883|       |
  884|  20.2k|    if ( lexer != NULL )
  ------------------
  |  Branch (884:10): [True: 20.2k, False: 0]
  ------------------
  885|  20.2k|    {
  886|  20.2k|        TidyClearMemory( lexer, sizeof(Lexer) );
  ------------------
  |  |   70|  20.2k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  887|       |
  888|  20.2k|        lexer->allocator = doc->allocator;
  889|  20.2k|        lexer->lines = 1;
  890|  20.2k|        lexer->columns = 1;
  891|  20.2k|        lexer->state = LEX_CONTENT;
  892|       |
  893|  20.2k|        lexer->versions = (VERS_ALL|VERS_PROPRIETARY);
  ------------------
  |  |  228|  20.2k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|  20.2k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|  20.2k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|  20.2k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  20.2k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|  20.2k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|  20.2k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|  20.2k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|  20.2k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|  20.2k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|  20.2k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|  20.2k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|  20.2k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  20.2k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|  20.2k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|  20.2k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|  20.2k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|  20.2k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|  20.2k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|  20.2k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|  20.2k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|  20.2k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|  20.2k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|  20.2k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|  20.2k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|  20.2k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|  20.2k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|  20.2k|#define HT50              131072u
  |  |  ------------------
  ------------------
                      lexer->versions = (VERS_ALL|VERS_PROPRIETARY);
  ------------------
  |  |  231|  20.2k|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  20.2k|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  20.2k|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  20.2k|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  894|  20.2k|        lexer->doctype = VERS_UNKNOWN;
  ------------------
  |  |  204|  20.2k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  20.2k|#define xxxx                   0u
  |  |  ------------------
  ------------------
  895|  20.2k|        lexer->root = &doc->root;
  896|  20.2k|    }
  897|  20.2k|    return lexer;
  898|  20.2k|}
prvTidyFreeLexer:
  907|  40.4k|{
  908|  40.4k|    Lexer *lexer = doc->lexer;
  909|  40.4k|    if ( lexer )
  ------------------
  |  Branch (909:10): [True: 20.2k, False: 20.2k]
  ------------------
  910|  20.2k|    {
  911|  20.2k|        TY_(FreeStyles)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  912|       |
  913|       |        /* See GetToken() */
  914|  20.2k|        if ( lexer->pushed || lexer->itoken )
  ------------------
  |  Branch (914:14): [True: 0, False: 20.2k]
  |  Branch (914:31): [True: 0, False: 20.2k]
  ------------------
  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|  63.4k|        while ( lexer->istacksize > 0 )
  ------------------
  |  Branch (921:17): [True: 43.2k, False: 20.2k]
  ------------------
  922|  43.2k|            TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|  43.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  43.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  923|       |
  924|  20.2k|        TidyDocFree( doc, lexer->istack );
  ------------------
  |  |  159|  20.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  925|  20.2k|        TidyDocFree( doc, lexer->lexbuf );
  ------------------
  |  |  159|  20.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  926|  20.2k|        TidyDocFree( doc, lexer );
  ------------------
  |  |  159|  20.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  927|       |        doc->lexer = NULL;
  928|  20.2k|    }
  929|  40.4k|}
prvTidyAddCharToLexer:
  975|   312M|{
  976|   312M|    int i, err, count = 0;
  977|   312M|    tmbchar buf[10] = {0};
  978|       |    
  979|   312M|    err = TY_(EncodeCharToUTF8Bytes)( c, buf, NULL, &count );
  ------------------
  |  |   23|   312M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   312M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  980|   312M|    if (err)
  ------------------
  |  Branch (980:9): [True: 5.86k, False: 312M]
  ------------------
  981|  5.86k|    {
  982|       |        /* replacement character 0xFFFD encoded as UTF-8 */
  983|  5.86k|        buf[0] = (byte) 0xEF;
  984|  5.86k|        buf[1] = (byte) 0xBF;
  985|  5.86k|        buf[2] = (byte) 0xBD;
  986|  5.86k|        count = 3;
  987|  5.86k|    }
  988|       |    
  989|   629M|    for ( i = 0; i < count; ++i )
  ------------------
  |  Branch (989:18): [True: 317M, False: 312M]
  ------------------
  990|   317M|        AddByte( lexer, buf[i] );
  991|   312M|}
prvTidyNewNode:
 1425|  3.87M|{
 1426|  3.87M|    Node* node = (Node*) TidyAlloc( allocator, sizeof(Node) );
  ------------------
  |  |   66|  3.87M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 1427|  3.87M|    TidyClearMemory( node, sizeof(Node) );
  ------------------
  |  |   70|  3.87M|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1428|  3.87M|    if ( lexer )
  ------------------
  |  Branch (1428:10): [True: 3.85M, False: 18.0k]
  ------------------
 1429|  3.85M|    {
 1430|  3.85M|        node->line = lexer->lines;
 1431|  3.85M|        node->column = lexer->columns;
 1432|  3.85M|    }
 1433|  3.87M|    node->type = TextNode;
 1434|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_ALLOCATION)
 1435|       |    SPRTF("Allocated node %p\n", node );
 1436|       |#endif
 1437|  3.87M|    return node;
 1438|  3.87M|}
prvTidyCloneNode:
 1442|  10.1k|{
 1443|  10.1k|    Lexer* lexer = doc->lexer;
 1444|  10.1k|    Node *node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|  10.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1445|       |
 1446|  10.1k|    node->start = lexer->lexsize;
 1447|  10.1k|    node->end   = lexer->lexsize;
 1448|       |
 1449|  10.1k|    if ( element )
  ------------------
  |  Branch (1449:10): [True: 10.1k, False: 0]
  ------------------
 1450|  10.1k|    {
 1451|  10.1k|        node->parent     = element->parent;
 1452|  10.1k|        node->type       = element->type;
 1453|  10.1k|        node->closed     = element->closed;
 1454|  10.1k|        node->implicit   = element->implicit;
 1455|  10.1k|        node->tag        = element->tag;
 1456|  10.1k|        node->element    = TY_(tmbstrdup)( doc->allocator, element->element );
  ------------------
  |  |   23|  10.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1457|  10.1k|        node->attributes = TY_(DupAttrs)( doc, element->attributes );
  ------------------
  |  |   23|  10.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1458|  10.1k|    }
 1459|  10.1k|    return node;
 1460|  10.1k|}
prvTidyFreeAttrs:
 1464|  3.71M|{
 1465|  4.21M|    while ( node->attributes )
  ------------------
  |  Branch (1465:13): [True: 508k, False: 3.71M]
  ------------------
 1466|   508k|    {
 1467|   508k|        AttVal *av = node->attributes;
 1468|       |
 1469|   508k|        if ( av->attribute )
  ------------------
  |  Branch (1469:14): [True: 489k, False: 18.3k]
  ------------------
 1470|   489k|        {
 1471|   489k|            if ( (attrIsID(av) || attrIsNAME(av)) &&
  ------------------
  |  |  243|   489k|#define attrIsID(av)                AttrIsId( av, TidyAttr_ID  )
  |  |  ------------------
  |  |  |  |  169|   979k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 489k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 355k, False: 134k]
  |  |  |  |  |  Branch (169:51): [True: 75.3k, False: 280k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( (attrIsID(av) || attrIsNAME(av)) &&
  ------------------
  |  |  265|   414k|#define attrIsNAME(av)              AttrIsId( av, TidyAttr_NAME  )
  |  |  ------------------
  |  |  |  |  169|   414k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 414k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 280k, False: 134k]
  |  |  |  |  |  Branch (169:51): [True: 26.6k, False: 253k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1472|   102k|                 TY_(IsAnchorElement)(doc, node) )
  ------------------
  |  |   23|   102k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   102k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1472:18): [True: 12.1k, False: 89.9k]
  ------------------
 1473|  12.1k|            {
 1474|  12.1k|                TY_(RemoveAnchorByNode)( doc, av->value, node );
  ------------------
  |  |   23|  12.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1475|  12.1k|            }
 1476|   489k|        }
 1477|       |
 1478|   508k|        node->attributes = av->next;
 1479|   508k|        TY_(FreeAttribute)( doc, av );
  ------------------
  |  |   23|   508k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   508k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1480|   508k|    }
 1481|  3.71M|}
prvTidyFreeAttribute:
 1485|   583k|{
 1486|   583k|    TY_(FreeNode)( doc, av->asp );
  ------------------
  |  |   23|   583k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   583k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1487|   583k|    TY_(FreeNode)( doc, av->php );
  ------------------
  |  |   23|   583k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   583k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1488|   583k|    TidyDocFree( doc, av->attribute );
  ------------------
  |  |  159|   583k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   583k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1489|   583k|    TidyDocFree( doc, av->value );
  ------------------
  |  |  159|   583k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   583k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1490|   583k|    TidyDocFree( doc, av );
  ------------------
  |  |  159|   583k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   583k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1491|   583k|}
prvTidyDetachAttribute:
 1496|  7.85k|{
 1497|  7.85k|    AttVal *av, *prev = NULL;
 1498|       |
 1499|  17.9k|    for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (1499:34): [True: 17.9k, False: 0]
  ------------------
 1500|  17.9k|    {
 1501|  17.9k|        if ( av == attr )
  ------------------
  |  Branch (1501:14): [True: 7.85k, False: 10.1k]
  ------------------
 1502|  7.85k|        {
 1503|  7.85k|            if ( prev )
  ------------------
  |  Branch (1503:18): [True: 4.71k, False: 3.14k]
  ------------------
 1504|  4.71k|                prev->next = attr->next;
 1505|  3.14k|            else
 1506|  3.14k|                node->attributes = attr->next;
 1507|  7.85k|            break;
 1508|  7.85k|        }
 1509|  10.1k|        prev = av;
 1510|  10.1k|    }
 1511|  7.85k|}
prvTidyRemoveAttribute:
 1516|  7.85k|{
 1517|  7.85k|    TY_(DetachAttribute)( node, attr );
  ------------------
  |  |   23|  7.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1518|  7.85k|    TY_(FreeAttribute)( doc, attr );
  ------------------
  |  |   23|  7.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1519|  7.85k|}
prvTidyFreeNode:
 1527|  5.84M|{
 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|  9.54M|    while ( node )
  ------------------
  |  Branch (1540:13): [True: 3.70M, False: 5.84M]
  ------------------
 1541|  3.70M|    {
 1542|  3.70M|        Node* next = node->next;
 1543|       |
 1544|  3.70M|        TY_(FreeAttrs)( doc, node );
  ------------------
  |  |   23|  3.70M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.70M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1545|  3.70M|        TY_(FreeNode)( doc, node->content );
  ------------------
  |  |   23|  3.70M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.70M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1546|  3.70M|        TidyDocFree( doc, node->element );
  ------------------
  |  |  159|  3.70M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.70M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1547|  3.70M|        if (RootNode != node->type)
  ------------------
  |  Branch (1547:13): [True: 3.66M, False: 40.4k]
  ------------------
 1548|  3.70M|            TidyDocFree( doc, node );
  ------------------
  |  |  159|  3.66M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.66M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1549|  40.4k|        else
 1550|  40.4k|            node->content = NULL;
 1551|       |
 1552|  3.70M|        node = next;
 1553|  3.70M|    }
 1554|  5.84M|}
prvTidyTextToken:
 1557|   246k|{
 1558|   246k|    Node *node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|   246k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   246k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1559|   246k|    node->start = lexer->txtstart;
 1560|   246k|    node->end = lexer->txtend;
 1561|   246k|    return node;
 1562|   246k|}
prvTidyFindDocType:
 1649|  62.0k|{
 1650|  62.0k|    Node* node;
 1651|  62.0k|    for ( node = (doc ? doc->root.content : NULL);
  ------------------
  |  Branch (1651:19): [True: 62.0k, False: 0]
  ------------------
 1652|   109k|          node && node->type != DocTypeTag; 
  ------------------
  |  Branch (1652:11): [True: 55.4k, False: 54.3k]
  |  Branch (1652:19): [True: 47.6k, False: 7.77k]
  ------------------
 1653|  62.0k|          node = node->next )
 1654|  47.6k|        /**/;
 1655|  62.0k|    return node;
 1656|  62.0k|}
prvTidyFindHTML:
 1672|   183k|{
 1673|   183k|    Node *node;
 1674|   183k|    for ( node = (doc ? doc->root.content : NULL);
  ------------------
  |  Branch (1674:19): [True: 183k, False: 0]
  ------------------
 1675|   321k|          node && !nodeIsHTML(node); 
  ------------------
  |  |  370|   318k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   318k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 318k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 180k, False: 137k]
  |  |  |  |  |  Branch (275:54): [True: 180k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1675:11): [True: 318k, False: 3.31k]
  ------------------
 1676|   183k|          node = node->next )
 1677|   137k|        /**/;
 1678|       |
 1679|   183k|    return node;
 1680|   183k|}
prvTidyFindXmlDecl:
 1684|  1.00k|{
 1685|  1.00k|    Node *node;
 1686|  1.00k|    for ( node = (doc ? doc->root.content : NULL);
  ------------------
  |  Branch (1686:19): [True: 1.00k, False: 0]
  ------------------
 1687|  1.22k|          node && !(node->type == XmlDecl);
  ------------------
  |  Branch (1687:11): [True: 1.09k, False: 134]
  |  Branch (1687:19): [True: 221, False: 872]
  ------------------
 1688|  1.00k|          node = node->next )
 1689|    221|        /**/;
 1690|       |
 1691|  1.00k|    return node;
 1692|  1.00k|}
prvTidyFindHEAD:
 1696|   124k|{
 1697|   124k|    Node *node = TY_(FindHTML)( doc );
  ------------------
  |  |   23|   124k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   124k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1698|       |
 1699|   124k|    if ( node )
  ------------------
  |  Branch (1699:10): [True: 124k, False: 0]
  ------------------
 1700|   124k|    {
 1701|   124k|        for ( node = node->content;
 1702|   128k|              node && !nodeIsHEAD(node); 
  ------------------
  |  |  371|   128k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|   128k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 128k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 124k, False: 3.35k]
  |  |  |  |  |  Branch (275:54): [True: 124k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1702:15): [True: 128k, False: 0]
  ------------------
 1703|   124k|              node = node->next )
 1704|  3.35k|            /**/;
 1705|   124k|    }
 1706|       |
 1707|   124k|    return node;
 1708|   124k|}
prvTidyFindTITLE:
 1711|  20.2k|{
 1712|  20.2k|    Node *node = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1713|       |
 1714|  20.2k|    if (node)
  ------------------
  |  Branch (1714:9): [True: 20.2k, False: 0]
  ------------------
 1715|  20.2k|        for (node = node->content;
 1716|  26.4k|             node && !nodeIsTITLE(node);
  ------------------
  |  |  372|  6.36k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  6.36k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.36k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.27k, False: 1.09k]
  |  |  |  |  |  Branch (275:54): [True: 119, False: 5.15k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1716:14): [True: 6.36k, False: 20.0k]
  ------------------
 1717|  20.2k|             node = node->next) {}
 1718|       |
 1719|  20.2k|    return node;
 1720|  20.2k|}
prvTidyFindBody:
 1723|  66.7k|{
 1724|  66.7k|    Node *node = ( doc ? doc->root.content : NULL );
  ------------------
  |  Branch (1724:20): [True: 66.7k, False: 0]
  ------------------
 1725|       |
 1726|   109k|    while ( node && !nodeIsHTML(node) )
  ------------------
  |  |  370|   109k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   109k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 109k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 66.7k, False: 42.5k]
  |  |  |  |  |  Branch (275:54): [True: 66.7k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1726:13): [True: 109k, False: 0]
  ------------------
 1727|  42.5k|        node = node->next;
 1728|       |
 1729|  66.7k|    if (node == NULL)
  ------------------
  |  Branch (1729:9): [True: 0, False: 66.7k]
  ------------------
 1730|      0|        return NULL;
 1731|       |
 1732|  66.7k|    node = node->content;
 1733|   340k|    while ( node && !nodeIsBODY(node) && !nodeIsFRAMESET(node) )
  ------------------
  |  |  375|   329k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   670k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 329k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 169k, False: 159k]
  |  |  |  |  |  Branch (275:54): [True: 46.5k, False: 123k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  while ( node && !nodeIsBODY(node) && !nodeIsFRAMESET(node) )
  ------------------
  |  |  376|   282k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|   282k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 282k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 123k, False: 159k]
  |  |  |  |  |  Branch (275:54): [True: 9.00k, False: 114k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1733:13): [True: 329k, False: 11.2k]
  ------------------
 1734|   273k|        node = node->next;
 1735|       |
 1736|  66.7k|    if ( node && nodeIsFRAMESET(node) )
  ------------------
  |  |  376|  55.5k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  55.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 55.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 55.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 9.00k, False: 46.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1736:10): [True: 55.5k, False: 11.2k]
  ------------------
 1737|  9.00k|    {
 1738|  9.00k|        node = node->content;
 1739|  11.5k|        while ( node && !nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|  10.7k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  10.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 10.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 9.86k, False: 832]
  |  |  |  |  |  Branch (275:54): [True: 8.12k, False: 1.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1739:17): [True: 10.7k, False: 877]
  ------------------
 1740|  2.57k|            node = node->next;
 1741|       |
 1742|  9.00k|        if ( node )
  ------------------
  |  Branch (1742:14): [True: 8.12k, False: 877]
  ------------------
 1743|  8.12k|        {
 1744|  8.12k|            node = node->content;
 1745|   196k|            while ( node && !nodeIsBODY(node) )
  ------------------
  |  |  375|   194k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   194k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 194k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 185k, False: 9.52k]
  |  |  |  |  |  Branch (275:54): [True: 6.52k, False: 178k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1745:21): [True: 194k, False: 1.59k]
  ------------------
 1746|   188k|                node = node->next;
 1747|  8.12k|        }
 1748|  9.00k|    }
 1749|       |
 1750|  66.7k|    return node;
 1751|  66.7k|}
prvTidyAddGenerator:
 1755|  20.2k|{
 1756|  20.2k|    AttVal *attval;
 1757|  20.2k|    Node *node;
 1758|  20.2k|    Node *head = TY_(FindHEAD)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1759|  20.2k|    tmbchar buf[256];
 1760|       |    
 1761|  20.2k|    if (head)
  ------------------
  |  Branch (1761:9): [True: 20.2k, False: 0]
  ------------------
 1762|  20.2k|    {
 1763|  20.2k|#ifdef PLATFORM_NAME
 1764|  20.2k|        TY_(tmbsnprintf)(buf, sizeof(buf), "HTML Tidy for HTML5 for "PLATFORM_NAME" version %s",
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1765|  20.2k|                         tidyLibraryVersion());
 1766|       |#else
 1767|       |        TY_(tmbsnprintf)(buf, sizeof(buf), "HTML Tidy for HTML5 version %s", tidyLibraryVersion());
 1768|       |#endif
 1769|       |
 1770|  49.1k|        for ( node = head->content; node; node = node->next )
  ------------------
  |  Branch (1770:37): [True: 28.9k, False: 20.2k]
  ------------------
 1771|  28.9k|        {
 1772|  28.9k|            if ( nodeIsMETA(node) )
  ------------------
  |  |  374|  28.9k|#define nodeIsMETA( node )       TagIsId( node, TidyTag_META )
  |  |  ------------------
  |  |  |  |  275|  28.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 28.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 27.8k, False: 1.09k]
  |  |  |  |  |  Branch (275:54): [True: 94, False: 27.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1773|     94|            {
 1774|     94|                attval = TY_(AttrGetById)(node, TidyAttr_NAME);
  ------------------
  |  |   23|     94|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     94|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1775|       |
 1776|     94|                if (AttrValueIs(attval, "generator"))
  ------------------
  |  |  172|     94|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|    188|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 22, False: 72]
  |  |  |  |  |  Branch (171:44): [True: 12, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|     94|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|     12|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     12|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 12]
  |  |  ------------------
  ------------------
 1777|      0|                {
 1778|      0|                    attval = TY_(AttrGetById)(node, TidyAttr_CONTENT);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1779|       |
 1780|      0|                    if (AttrHasValue(attval) &&
  ------------------
  |  |  171|      0|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 0, False: 0]
  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1781|      0|                        TY_(tmbstrncasecmp)(attval->value, "HTML Tidy", 9) == 0)
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1781:25): [True: 0, False: 0]
  ------------------
 1782|      0|                    {
 1783|       |                        /* update the existing content to reflect the */
 1784|       |                        /* actual version of Tidy currently being used */
 1785|       |                        
 1786|      0|                        TidyDocFree(doc, attval->value);
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1787|      0|                        attval->value = TY_(tmbstrdup)(doc->allocator, buf);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1788|      0|                        return no;
 1789|      0|                    }
 1790|      0|                }
 1791|     94|            }
 1792|  28.9k|        }
 1793|       |
 1794|  20.2k|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1794:14): [True: 20.2k, False: 0]
  ------------------
 1795|  20.2k|        {
 1796|  20.2k|            node = TY_(InferredTag)(doc, TidyTag_META);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1797|  20.2k|            TY_(AddAttribute)( doc, node, "name", "generator" );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1798|  20.2k|            TY_(AddAttribute)( doc, node, "content", buf );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1799|  20.2k|            TY_(InsertNodeAtStart)( head, node );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1800|  20.2k|            return yes;
 1801|  20.2k|        }
 1802|  20.2k|    }
 1803|       |
 1804|      0|    return no;
 1805|  20.2k|}
prvTidyApparentVersion:
 1850|  40.4k|{
 1851|  40.4k|    if ((doc->lexer->doctype == XH11 ||
  ------------------
  |  |  188|  80.8k|#define XH11                2048u
  ------------------
  |  Branch (1851:10): [True: 88, False: 40.3k]
  ------------------
 1852|  40.3k|         doc->lexer->doctype == XB10) &&
  ------------------
  |  |  189|  40.3k|#define XB10                4096u
  ------------------
  |  Branch (1852:10): [True: 0, False: 40.3k]
  ------------------
 1853|     88|        (doc->lexer->versions & doc->lexer->doctype))
  ------------------
  |  Branch (1853:9): [True: 78, False: 10]
  ------------------
 1854|     78|        return doc->lexer->doctype;
 1855|  40.3k|    else
 1856|  40.3k|        return TY_(HTMLVersion)(doc);
  ------------------
  |  |   23|  40.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1857|  40.4k|}
prvTidyHTMLVersionNameFromCode:
 1860|  50.6k|{
 1861|  50.6k|    ctmbstr name = GetNameFromVers(vers);
 1862|  50.6k|    return name;
 1863|  50.6k|}
prvTidyWarnMissingSIInEmittedDocType:
 1877|  20.2k|{
 1878|  20.2k|    Bool isXhtml = doc->lexer->isvoyager;
 1879|  20.2k|    Node* doctype;
 1880|       |    
 1881|       |    /* Do not warn in XHTML mode */
 1882|  20.2k|    if ( isXhtml )
  ------------------
  |  Branch (1882:10): [True: 1.44k, False: 18.7k]
  ------------------
 1883|  1.44k|        return no;
 1884|       |
 1885|       |    /* Do not warn if emitted doctype is proprietary */
 1886|  18.7k|    if ( TY_(HTMLVersionNameFromCode)(doc->lexer->versionEmitted, isXhtml ) == NULL )
  ------------------
  |  |   23|  18.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1886:10): [True: 0, False: 18.7k]
  ------------------
 1887|      0|        return no;
 1888|       |
 1889|       |    /* Do not warn if no SI is possible */
 1890|  18.7k|    if ( GetSIFromVers(doc->lexer->versionEmitted) == NULL )
  ------------------
  |  Branch (1890:10): [True: 18.7k, False: 0]
  ------------------
 1891|  18.7k|        return no;
 1892|       |
 1893|      0|    if ( (doctype = TY_(FindDocType)( doc )) != NULL
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1893:10): [True: 0, False: 0]
  ------------------
 1894|      0|         && TY_(GetAttrByName)(doctype, "SYSTEM") == NULL )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1894:13): [True: 0, False: 0]
  ------------------
 1895|      0|        return yes;
 1896|       |
 1897|      0|    return no;
 1898|      0|}
prvTidySetXHTMLDocType:
 1922|  20.2k|{
 1923|  20.2k|    Lexer *lexer = doc->lexer;
 1924|  20.2k|    Node *doctype = TY_(FindDocType)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1925|  20.2k|    TidyDoctypeModes dtmode = (TidyDoctypeModes)cfg(doc, TidyDoctypeMode);
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1926|  20.2k|    ctmbstr pub = "PUBLIC";
 1927|  20.2k|    ctmbstr sys = "SYSTEM";
 1928|       |
 1929|  20.2k|    lexer->versionEmitted = TY_(ApparentVersion)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1930|       |
 1931|  20.2k|    if (dtmode == TidyDoctypeOmit)
  ------------------
  |  Branch (1931:9): [True: 0, False: 20.2k]
  ------------------
 1932|      0|    {
 1933|      0|        if (doctype)
  ------------------
  |  Branch (1933:13): [True: 0, False: 0]
  ------------------
 1934|      0|            TY_(DiscardElement)(doc, doctype);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1935|      0|        return yes;
 1936|      0|    }
 1937|       |
 1938|  20.2k|    if (dtmode == TidyDoctypeUser && !cfgStr(doc, TidyDoctype))
  ------------------
  |  |  424|      0|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  ------------------
  |  Branch (1938:9): [True: 0, False: 20.2k]
  |  Branch (1938:38): [True: 0, False: 0]
  ------------------
 1939|      0|        return no;
 1940|       |
 1941|  20.2k|    if (!doctype)
  ------------------
  |  Branch (1941:9): [True: 18.0k, False: 2.19k]
  ------------------
 1942|  18.0k|    {
 1943|  18.0k|        doctype = NewDocTypeNode(doc);
 1944|  18.0k|        doctype->element = TY_(tmbstrdup)(doc->allocator, "html");
  ------------------
  |  |   23|  18.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1945|  18.0k|    }
 1946|  2.19k|    else
 1947|  2.19k|    {
 1948|  2.19k|        doctype->element = TY_(tmbstrtolower)(doctype->element);
  ------------------
  |  |   23|  2.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1949|  2.19k|    }
 1950|       |
 1951|  20.2k|    switch(dtmode)
  ------------------
  |  Branch (1951:12): [True: 20.2k, False: 0]
  ------------------
 1952|  20.2k|    {
 1953|      0|    case TidyDoctypeHtml5:
  ------------------
  |  Branch (1953:5): [True: 0, False: 20.2k]
  ------------------
 1954|       |        /* HTML5 */
 1955|      0|        TY_(RepairAttrValue)(doc, doctype, pub, NULL);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1956|      0|        TY_(RepairAttrValue)(doc, doctype, sys, NULL);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1957|      0|        lexer->versionEmitted = XH50;
  ------------------
  |  |  201|      0|#define XH50              262144u
  ------------------
 1958|      0|        break;
 1959|      0|    case TidyDoctypeStrict:
  ------------------
  |  Branch (1959:5): [True: 0, False: 20.2k]
  ------------------
 1960|       |        /* XHTML 1.0 Strict */
 1961|      0|        TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10S));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10S));
  ------------------
  |  |  185|      0|#define X10S                 256u
  ------------------
 1962|      0|        TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10S));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10S));
  ------------------
  |  |  185|      0|#define X10S                 256u
  ------------------
 1963|      0|        lexer->versionEmitted = X10S;
  ------------------
  |  |  185|      0|#define X10S                 256u
  ------------------
 1964|      0|        break;
 1965|      0|    case TidyDoctypeLoose:
  ------------------
  |  Branch (1965:5): [True: 0, False: 20.2k]
  ------------------
 1966|       |        /* XHTML 1.0 Transitional */
 1967|      0|        TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10T));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10T));
  ------------------
  |  |  186|      0|#define X10T                 512u
  ------------------
 1968|      0|        TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10T));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10T));
  ------------------
  |  |  186|      0|#define X10T                 512u
  ------------------
 1969|      0|        lexer->versionEmitted = X10T;
  ------------------
  |  |  186|      0|#define X10T                 512u
  ------------------
 1970|      0|        break;
 1971|      0|    case TidyDoctypeUser:
  ------------------
  |  Branch (1971:5): [True: 0, False: 20.2k]
  ------------------
 1972|       |        /* user defined document type declaration */
 1973|      0|        TY_(RepairAttrValue)(doc, doctype, pub, cfgStr(doc, TidyDoctype));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(RepairAttrValue)(doc, doctype, pub, cfgStr(doc, TidyDoctype));
  ------------------
  |  |  424|      0|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  ------------------
 1974|      0|        TY_(RepairAttrValue)(doc, doctype, sys, "");
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1975|      0|        break;
 1976|  20.2k|    case TidyDoctypeAuto:
  ------------------
  |  Branch (1976:5): [True: 20.2k, False: 0]
  ------------------
 1977|  20.2k|        if (lexer->doctype == VERS_UNKNOWN || lexer->doctype == VERS_HTML5) {
  ------------------
  |  |  204|  40.4k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  20.2k|#define xxxx                   0u
  |  |  ------------------
  ------------------
                      if (lexer->doctype == VERS_UNKNOWN || lexer->doctype == VERS_HTML5) {
  ------------------
  |  |  213|    348|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|    348|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|    348|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (1977:13): [True: 19.8k, False: 348]
  |  Branch (1977:47): [True: 184, False: 164]
  ------------------
 1978|  20.0k|          lexer->versionEmitted = XH50;
  ------------------
  |  |  201|  20.0k|#define XH50              262144u
  ------------------
 1979|  20.0k|          return yes;
 1980|  20.0k|        }
 1981|    164|        else if (lexer->versions & XH11 && lexer->doctype == XH11)
  ------------------
  |  |  188|    328|#define XH11                2048u
  ------------------
                      else if (lexer->versions & XH11 && lexer->doctype == XH11)
  ------------------
  |  |  188|    140|#define XH11                2048u
  ------------------
  |  Branch (1981:18): [True: 140, False: 24]
  |  Branch (1981:44): [True: 39, False: 101]
  ------------------
 1982|     39|        {
 1983|     39|            if (!TY_(GetAttrByName)(doctype, sys))
  ------------------
  |  |   23|     39|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     39|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1983:17): [True: 29, False: 10]
  ------------------
 1984|     29|                TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |   23|     29|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     29|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |  188|     29|#define XH11                2048u
  ------------------
 1985|     39|            lexer->versionEmitted = XH11;
  ------------------
  |  |  188|     39|#define XH11                2048u
  ------------------
 1986|     39|            return yes;
 1987|     39|        }
 1988|    125|        else if (lexer->versions & XH11 && !(lexer->versions & VERS_HTML40))
  ------------------
  |  |  188|    250|#define XH11                2048u
  ------------------
                      else if (lexer->versions & XH11 && !(lexer->versions & VERS_HTML40))
  ------------------
  |  |  216|    101|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  ------------------
  |  |  |  |  207|    101|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|    101|#define H40S                   4u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|    101|#define H41S                  32u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  185|    101|#define X10S                 256u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  ------------------
  |  |  |  |  208|    101|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|    101|#define H40T                   8u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|    101|#define H41T                  64u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  ------------------
  |  |  |  |  |  |  186|    101|#define X10T                 512u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  ------------------
  |  |  |  |  209|    101|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|    101|#define H40F                  16u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|    101|#define H41F                 128u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  ------------------
  |  |  |  |  |  |  187|    101|#define X10F                1024u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1988:18): [True: 101, False: 24]
  |  Branch (1988:44): [True: 21, False: 80]
  ------------------
 1989|     21|        {
 1990|     21|            TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(XH11));
  ------------------
  |  |   23|     21|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     21|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(XH11));
  ------------------
  |  |  188|     21|#define XH11                2048u
  ------------------
 1991|     21|            TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |   23|     21|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     21|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |  188|     21|#define XH11                2048u
  ------------------
 1992|     21|            lexer->versionEmitted = XH11;
  ------------------
  |  |  188|     21|#define XH11                2048u
  ------------------
 1993|     21|        }
 1994|    104|        else if (lexer->versions & XB10 && lexer->doctype == XB10)
  ------------------
  |  |  189|    208|#define XB10                4096u
  ------------------
                      else if (lexer->versions & XB10 && lexer->doctype == XB10)
  ------------------
  |  |  189|     33|#define XB10                4096u
  ------------------
  |  Branch (1994:18): [True: 33, False: 71]
  |  Branch (1994:44): [True: 0, False: 33]
  ------------------
 1995|      0|        {
 1996|      0|            if (!TY_(GetAttrByName)(doctype, sys))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1996:17): [True: 0, False: 0]
  ------------------
 1997|      0|                TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XB10));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XB10));
  ------------------
  |  |  189|      0|#define XB10                4096u
  ------------------
 1998|      0|            lexer->versionEmitted = XB10;
  ------------------
  |  |  189|      0|#define XB10                4096u
  ------------------
 1999|      0|            return yes;
 2000|      0|        }
 2001|    104|        else if (lexer->versions & VERS_HTML40_STRICT)
  ------------------
  |  |  207|    104|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|    104|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|    104|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|    104|#define X10S                 256u
  |  |  ------------------
  ------------------
  |  Branch (2001:18): [True: 3, False: 101]
  ------------------
 2002|      3|        {
 2003|      3|            TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10S));
  ------------------
  |  |   23|      3|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      3|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10S));
  ------------------
  |  |  185|      3|#define X10S                 256u
  ------------------
 2004|      3|            TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10S));
  ------------------
  |  |   23|      3|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      3|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10S));
  ------------------
  |  |  185|      3|#define X10S                 256u
  ------------------
 2005|      3|            lexer->versionEmitted = X10S;
  ------------------
  |  |  185|      3|#define X10S                 256u
  ------------------
 2006|      3|        }
 2007|    101|        else if (lexer->versions & VERS_FRAMESET)
  ------------------
  |  |  209|    101|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|    101|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|    101|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|    101|#define X10F                1024u
  |  |  ------------------
  ------------------
  |  Branch (2007:18): [True: 2, False: 99]
  ------------------
 2008|      2|        {
 2009|      2|            TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10F));
  ------------------
  |  |   23|      2|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      2|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10F));
  ------------------
  |  |  187|      2|#define X10F                1024u
  ------------------
 2010|      2|            TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10F));
  ------------------
  |  |   23|      2|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      2|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10F));
  ------------------
  |  |  187|      2|#define X10F                1024u
  ------------------
 2011|      2|            lexer->versionEmitted = X10F;
  ------------------
  |  |  187|      2|#define X10F                1024u
  ------------------
 2012|      2|        }
 2013|     99|        else if (lexer->versions & VERS_LOOSE)
  ------------------
  |  |  218|     99|#define VERS_LOOSE         (VERS_HTML20|VERS_HTML32|VERS_IFRAME)
  |  |  ------------------
  |  |  |  |  205|     99|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|     99|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_LOOSE         (VERS_HTML20|VERS_HTML32|VERS_IFRAME)
  |  |  ------------------
  |  |  |  |  206|     99|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|     99|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_LOOSE         (VERS_HTML20|VERS_HTML32|VERS_IFRAME)
  |  |  ------------------
  |  |  |  |  217|     99|#define VERS_IFRAME        (VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|     99|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|     99|#define H40T                   8u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|     99|#define H41T                  64u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|     99|#define X10T                 512u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_IFRAME        (VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  209|     99|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|     99|#define H40F                  16u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|     99|#define H41F                 128u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|     99|#define X10F                1024u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2013:18): [True: 81, False: 18]
  ------------------
 2014|     81|        {
 2015|     81|            TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10T));
  ------------------
  |  |   23|     81|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     81|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10T));
  ------------------
  |  |  186|     81|#define X10T                 512u
  ------------------
 2016|     81|            TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10T));
  ------------------
  |  |   23|     81|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     81|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10T));
  ------------------
  |  |  186|     81|#define X10T                 512u
  ------------------
 2017|     81|            lexer->versionEmitted = X10T;
  ------------------
  |  |  186|     81|#define X10T                 512u
  ------------------
 2018|     81|        }
 2019|     18|        else if (lexer->versions & VERS_HTML5)
  ------------------
  |  |  213|     18|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|     18|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|     18|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (2019:18): [True: 3, False: 15]
  ------------------
 2020|      3|        {
 2021|       |            /*\
 2022|       |             *  Issue #273 - If still a html5/xhtml5 bit
 2023|       |             *  existing, that is the 'ConstrainVersion' has
 2024|       |             *  not eliminated all HTML5, then nothing to do here.
 2025|       |             *  Certainly do **not** delete the DocType node!
 2026|       |             *  see: http://www.w3.org/QA/Tips/Doctype
 2027|       |            \*/
 2028|      3|        }
 2029|     15|        else
 2030|     15|        {
 2031|     15|            if (doctype)
  ------------------
  |  Branch (2031:17): [True: 15, False: 0]
  ------------------
 2032|     15|                TY_(DiscardElement)(doc, doctype);
  ------------------
  |  |   23|     15|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     15|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2033|     15|            return no;
 2034|     15|        }
 2035|    110|        break;
 2036|    110|    case TidyDoctypeOmit:
  ------------------
  |  Branch (2036:5): [True: 0, False: 20.2k]
  ------------------
 2037|      0|        assert(0);
  ------------------
  |  Branch (2037:9): [Folded, False: 0]
  |  Branch (2037:9): [Folded, False: 0]
  ------------------
 2038|      0|        break;
 2039|  20.2k|    }
 2040|       |
 2041|    110|    return no;
 2042|  20.2k|}
prvTidyInferredTag:
 2174|   350k|{
 2175|   350k|    Lexer *lexer = doc->lexer;
 2176|   350k|    Node *node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|   350k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   350k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2177|   350k|    const Dict* dict = TY_(LookupTagDef)(id);
  ------------------
  |  |   23|   350k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   350k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2178|       |
 2179|   350k|    assert( dict != NULL );
  ------------------
  |  Branch (2179:5): [True: 0, False: 350k]
  |  Branch (2179:5): [True: 350k, False: 0]
  ------------------
 2180|       |
 2181|   350k|    node->type = StartTag;
 2182|   350k|    node->implicit = yes;
 2183|   350k|    node->element = TY_(tmbstrdup)(doc->allocator, dict->name);
  ------------------
  |  |   23|   350k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   350k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2184|   350k|    node->tag = dict;
 2185|   350k|    node->start = lexer->txtstart;
 2186|   350k|    node->end = lexer->txtend;
 2187|       |
 2188|   350k|    return node;
 2189|   350k|}
prvTidyUngetToken:
 2409|  1.11M|{
 2410|  1.11M|    doc->lexer->pushed = yes;
 2411|  1.11M|}
prvTidyGetToken:
 2441|  6.32M|{
 2442|  6.32M|    Node *node;
 2443|  6.32M|    Lexer* lexer = doc->lexer;
 2444|       |
 2445|  6.32M|    if (lexer->pushed || lexer->itoken)
  ------------------
  |  Branch (2445:9): [True: 1.11M, False: 5.20M]
  |  Branch (2445:26): [True: 10.9k, False: 5.19M]
  ------------------
 2446|  1.13M|    {
 2447|       |        /* Deal with previously returned duplicate inline token */
 2448|  1.13M|        if (lexer->itoken)
  ------------------
  |  Branch (2448:13): [True: 11.0k, False: 1.11M]
  ------------------
 2449|  11.0k|        {
 2450|       |            /* itoken rejected */
 2451|  11.0k|            if (lexer->pushed)
  ------------------
  |  Branch (2451:17): [True: 30, False: 10.9k]
  ------------------
 2452|     30|            {
 2453|     30|                lexer->pushed = no;
 2454|     30|                node = lexer->itoken;
 2455|     30|                GTDBG(doc,"lex-itoken", node);
 2456|     30|                return node;
 2457|     30|            }
 2458|       |            /* itoken has been accepted */
 2459|  10.9k|            lexer->itoken = NULL;
 2460|  10.9k|        }
 2461|       |            
 2462|       |        /* duplicate inlines in preference to pushed text nodes when appropriate */
 2463|  1.12M|        lexer->pushed = no;
 2464|  1.12M|        if (lexer->token->type != TextNode
  ------------------
  |  Branch (2464:13): [True: 1.08M, False: 49.7k]
  ------------------
 2465|  1.11M|            || !(lexer->insert || lexer->inode)) {
  ------------------
  |  Branch (2465:18): [True: 10.9k, False: 38.7k]
  |  Branch (2465:35): [True: 0, False: 38.7k]
  ------------------
 2466|  1.11M|            node = lexer->token;
 2467|  1.11M|            GTDBG(doc,"lex-token", node);
 2468|  1.11M|            return node;
 2469|  1.11M|        }
 2470|  10.9k|        lexer->itoken = TY_(InsertedToken)( doc );
  ------------------
  |  |   23|  10.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2471|  10.9k|        node = lexer->itoken;
 2472|  10.9k|        GTDBG(doc,"lex-inserted", node);
 2473|  10.9k|        return node;
 2474|  1.12M|    }
 2475|       |
 2476|  6.32M|    assert( !(lexer->pushed || lexer->itoken) );
  ------------------
  |  Branch (2476:5): [True: 5.19M, False: 0]
  |  Branch (2476:5): [True: 0, False: 0]
  |  Branch (2476:5): [True: 0, False: 5.19M]
  |  Branch (2476:5): [True: 0, False: 5.19M]
  ------------------
 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|  5.19M|    if ((lexer->insert || lexer->inode) && lexer->istacksize)
  ------------------
  |  Branch (2482:10): [True: 1.91M, False: 3.27M]
  |  Branch (2482:27): [True: 4.27k, False: 3.27M]
  |  Branch (2482:44): [True: 1.91M, False: 1.94k]
  ------------------
 2483|  1.91M|    {
 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|  1.91M|        lexer->token = TY_(InsertedToken)( doc );
  ------------------
  |  |   23|  1.91M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.91M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2488|  1.91M|        node = lexer->token;
 2489|  1.91M|        GTDBG(doc,"lex-inserted2", node);
 2490|  1.91M|        return node;
 2491|  1.91M|    }
 2492|       |
 2493|  3.27M|    if (mode == CdataContent)
  ------------------
  |  Branch (2493:9): [True: 3.73k, False: 3.27M]
  ------------------
 2494|  3.73k|    {
 2495|  3.73k|        assert( lexer->parent != NULL );
  ------------------
  |  Branch (2495:9): [True: 0, False: 3.73k]
  |  Branch (2495:9): [True: 3.73k, False: 0]
  ------------------
 2496|  3.73k|        node = GetCDATA(doc, lexer->parent);
 2497|  3.73k|        GTDBG(doc,"lex-cdata", node);
 2498|  3.73k|        return node;
 2499|  3.73k|    }
 2500|       |
 2501|  3.27M|    return GetTokenFromStream( doc, mode );
 2502|  3.27M|}
prvTidyInitMap:
 3480|  20.2k|{
 3481|  20.2k|    MapStr("\r\n\f", newline|white);
  ------------------
  |  |   72|  20.2k|#define newline     16u
  ------------------
                  MapStr("\r\n\f", newline|white);
  ------------------
  |  |   71|  20.2k|#define white       8u
  ------------------
 3482|  20.2k|    MapStr(" \t", white);
  ------------------
  |  |   71|  20.2k|#define white       8u
  ------------------
 3483|  20.2k|    MapStr("-.:_", namechar);
  ------------------
  |  |   70|  20.2k|#define namechar    4u
  ------------------
 3484|  20.2k|    MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   68|  20.2k|#define digit       1u
  ------------------
                  MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   75|  20.2k|#define digithex    128u
  ------------------
                  MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   70|  20.2k|#define namechar    4u
  ------------------
 3485|  20.2k|    MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   73|  20.2k|#define lowercase   32u
  ------------------
                  MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   69|  20.2k|#define letter      2u
  ------------------
                  MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   70|  20.2k|#define namechar    4u
  ------------------
 3486|  20.2k|    MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   74|  20.2k|#define uppercase   64u
  ------------------
                  MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   69|  20.2k|#define letter      2u
  ------------------
                  MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   70|  20.2k|#define namechar    4u
  ------------------
 3487|  20.2k|    MapStr("abcdefABCDEF", digithex);
  ------------------
  |  |   75|  20.2k|#define digithex    128u
  ------------------
 3488|  20.2k|}
prvTidyNewAttribute:
 4155|   587k|{
 4156|   587k|    AttVal *av = (AttVal*) TidyDocAlloc( doc, sizeof(AttVal) );
  ------------------
  |  |  157|   587k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   587k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 4157|   587k|    TidyClearMemory( av, sizeof(AttVal) );
  ------------------
  |  |   70|   587k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 4158|   587k|    return av;
 4159|   587k|}
prvTidyNewAttributeEx:
 4164|  45.1k|{
 4165|  45.1k|    AttVal *av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  45.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4166|  45.1k|    av->attribute = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|  45.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4167|  45.1k|    av->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|  45.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4168|  45.1k|    av->delim = delim;
 4169|  45.1k|    av->dict = TY_(FindAttribute)( doc, av );
  ------------------
  |  |   23|  45.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4170|  45.1k|    return av;
 4171|  45.1k|}
prvTidyInsertAttributeAtEnd:
 4187|   127k|{
 4188|   127k|    AddAttrToList(&node->attributes, av);
 4189|   127k|}
prvTidyInsertAttributeAtStart:
 4192|  45.1k|{
 4193|  45.1k|    av->next = node->attributes;
 4194|  45.1k|    node->attributes = av;
 4195|  45.1k|}
prvTidynewStack:
 4461|   141k|{
 4462|   141k|    Stack *stack = (Stack *)TidyAlloc(doc->allocator, sizeof(Stack));
  ------------------
  |  |   66|   141k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 4463|   141k|    stack->top = -1;
 4464|   141k|    stack->capacity = capacity;
 4465|   141k|    stack->firstNode = (Node **)TidyAlloc(doc->allocator, stack->capacity * sizeof(Node**));
  ------------------
  |  |   66|   141k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 4466|   141k|    stack->allocator = doc->allocator;
 4467|   141k|    return stack;
 4468|   141k|}
prvTidygrowStack:
 4477|    494|{
 4478|    494|    uint new_capacity = stack->capacity * 2;
 4479|       |    
 4480|    494|    Node **firstNode = (Node **)TidyAlloc(stack->allocator, new_capacity * sizeof(Node**));
  ------------------
  |  |   66|    494|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 4481|       |    
 4482|    494|    memcpy( firstNode, stack->firstNode, sizeof(Node**) * (stack->top + 1) );
 4483|    494|    TidyFree(stack->allocator, stack->firstNode);
  ------------------
  |  |   68|    494|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 4484|       |
 4485|    494|    stack->firstNode = firstNode;
 4486|    494|    stack->capacity = new_capacity;
 4487|    494|}
prvTidystackFull:
 4494|  14.6M|{
 4495|  14.6M|    return stack->top == stack->capacity - 1;
 4496|  14.6M|}
prvTidystackEmpty:
 4503|  1.02M|{
 4504|  1.02M|    return stack->top == -1;
 4505|  1.02M|}
prvTidypush:
 4512|  14.6M|{
 4513|  14.6M|    if (TY_(stackFull)(stack))
  ------------------
  |  |   23|  14.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4513:9): [True: 494, False: 14.6M]
  ------------------
 4514|    494|        TY_(growStack)(stack);
  ------------------
  |  |   23|    494|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    494|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4515|       |    
 4516|  14.6M|    if (node)
  ------------------
  |  Branch (4516:9): [True: 886k, False: 13.7M]
  ------------------
 4517|   886k|        stack->firstNode[++stack->top] = node;
 4518|  14.6M|}
prvTidypop:
 4525|  1.02M|{
 4526|  1.02M|    return TY_(stackEmpty)(stack) ? NULL : stack->firstNode[stack->top--];
  ------------------
  |  |   23|  1.02M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4526:12): [True: 141k, False: 886k]
  ------------------
 4527|  1.02M|}
prvTidyfreeStack:
 4542|   141k|{
 4543|   141k|    TidyFree( stack->allocator, stack->firstNode );
  ------------------
  |  |   68|   141k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 4544|   141k|    stack->top = -1;
 4545|   141k|    stack->capacity = 0;
 4546|   141k|    stack->firstNode = NULL;
 4547|       |    stack->allocator = NULL;
 4548|   141k|}
lexer.c:AddByte:
  936|   317M|{
  937|   317M|    if ( lexer->lexsize + 2 >= lexer->lexlength )
  ------------------
  |  Branch (937:10): [True: 22.1k, False: 317M]
  ------------------
  938|  22.1k|    {
  939|  22.1k|        tmbstr buf = NULL;
  940|  22.1k|        uint allocAmt = lexer->lexlength;
  941|  22.1k|        uint prev = allocAmt; /* Is. #761 */
  942|  44.2k|        while ( lexer->lexsize + 2 >= allocAmt )
  ------------------
  |  Branch (942:17): [True: 22.1k, False: 22.1k]
  ------------------
  943|  22.1k|        {
  944|  22.1k|            if ( allocAmt == 0 )
  ------------------
  |  Branch (944:18): [True: 20.1k, False: 1.96k]
  ------------------
  945|  20.1k|                allocAmt = 8192;
  946|  1.96k|            else
  947|  1.96k|                allocAmt *= 2;
  948|  22.1k|            if (allocAmt < prev) /* Is. #761 - watch for wrap - and */
  ------------------
  |  Branch (948:17): [True: 0, False: 22.1k]
  ------------------
  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|  22.1k|        }
  951|  22.1k|        buf = (tmbstr) TidyRealloc( lexer->allocator, lexer->lexbuf, allocAmt );
  ------------------
  |  |   67|  22.1k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  952|  22.1k|        if ( buf )
  ------------------
  |  Branch (952:14): [True: 22.1k, False: 0]
  ------------------
  953|  22.1k|        {
  954|  22.1k|          TidyClearMemory( buf + lexer->lexlength, 
  ------------------
  |  |   70|  22.1k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  955|  22.1k|                           allocAmt - lexer->lexlength );
  956|  22.1k|          lexer->lexbuf = buf;
  957|  22.1k|          lexer->lexlength = allocAmt;
  958|  22.1k|        }
  959|  22.1k|    }
  960|       |
  961|   317M|    lexer->lexbuf[ lexer->lexsize++ ] = ch;
  962|   317M|    lexer->lexbuf[ lexer->lexsize ]   = '\0';  /* debug */
  963|   317M|}
lexer.c:GetNameFromVers:
  322|  50.6k|{
  323|  50.6k|    uint i;
  324|       |
  325|   961k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (325:17): [True: 961k, False: 72]
  ------------------
  326|   961k|        if (W3C_Doctypes[i].vers == vers)
  ------------------
  |  Branch (326:13): [True: 50.5k, False: 910k]
  ------------------
  327|  50.5k|            return W3C_Doctypes[i].name;
  328|       |
  329|     72|    return NULL;
  330|  50.6k|}
lexer.c:GetSIFromVers:
  311|  18.9k|{
  312|  18.9k|    uint i;
  313|       |
  314|   358k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (314:17): [True: 358k, False: 0]
  ------------------
  315|   358k|        if (W3C_Doctypes[i].vers == vers)
  ------------------
  |  Branch (315:13): [True: 18.9k, False: 339k]
  ------------------
  316|  18.9k|            return W3C_Doctypes[i].si;
  317|       |
  318|      0|    return NULL;
  319|  18.9k|}
lexer.c:NewDocTypeNode:
 1908|  18.0k|{
 1909|  18.0k|    Node* doctype = NULL;
 1910|  18.0k|    Node* html = TY_(FindHTML)( doc );
  ------------------
  |  |   23|  18.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1911|       |
 1912|  18.0k|    if ( !html )
  ------------------
  |  Branch (1912:10): [True: 0, False: 18.0k]
  ------------------
 1913|      0|        return NULL;
 1914|       |
 1915|  18.0k|    doctype = TY_(NewNode)( doc->allocator, NULL );
  ------------------
  |  |   23|  18.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1916|  18.0k|    doctype->type = DocTypeTag;
 1917|  18.0k|    TY_(InsertNodeBeforeElement)(html, doctype);
  ------------------
  |  |   23|  18.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1918|  18.0k|    return doctype;
 1919|  18.0k|}
lexer.c:GetFPIFromVers:
  300|  4.46k|{
  301|  4.46k|    uint i;
  302|       |
  303|  87.6k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (303:17): [True: 83.4k, False: 4.19k]
  ------------------
  304|  83.4k|        if (W3C_Doctypes[i].vers == vers)
  ------------------
  |  Branch (304:13): [True: 271, False: 83.1k]
  ------------------
  305|    271|            return W3C_Doctypes[i].fpi;
  306|       |
  307|  4.19k|    return NULL;
  308|  4.46k|}
lexer.c:GetCDATA:
 2220|  3.73k|{
 2221|  3.73k|    Lexer* lexer = doc->lexer;
 2222|  3.73k|    uint start = 0;
 2223|  3.73k|    int nested = 0;
 2224|  3.73k|    CDATAState state = CDATA_INTERMEDIATE;
 2225|  3.73k|    uint i;
 2226|  3.73k|    Bool isEmpty = yes;
 2227|  3.73k|    Bool matches = no;
 2228|  3.73k|    uint c;
 2229|  3.73k|    Bool hasSrc = (TY_(AttrGetById)(container, TidyAttr_SRC) != NULL) ? yes : no;
  ------------------
  |  |   23|  3.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2229:19): [True: 1.21k, False: 2.52k]
  ------------------
 2230|       |    /*\ Issue #65 (1642186) and #280 - is script or style, and the option on
 2231|       |     *  If yes, then avoid incrementing nested...
 2232|       |    \*/
 2233|  3.73k|    Bool nonested = ((nodeIsSCRIPT(container) || (nodeIsSTYLE(container))) && 
  ------------------
  |  |  422|  3.73k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  7.47k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.73k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.73k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.48k, False: 2.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  Bool nonested = ((nodeIsSCRIPT(container) || (nodeIsSTYLE(container))) && 
  ------------------
  |  |  421|  2.24k|#define nodeIsSTYLE( node )      TagIsId( node, TidyTag_STYLE )
  |  |  ------------------
  |  |  |  |  275|  2.24k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.24k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.24k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.01k, False: 230]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2234|  3.50k|        cfgBool(doc, TidySkipNested)) ? yes : no;
  ------------------
  |  |  418|  3.50k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.50k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 3.50k, False: 0]
  |  |  ------------------
  ------------------
 2235|       |
 2236|  3.73k|    SetLexerLocus( doc, lexer );
 2237|  3.73k|    lexer->waswhite = no;
 2238|  3.73k|    lexer->txtstart = lexer->txtend = lexer->lexsize;
 2239|       |
 2240|       |    /* seen start tag, look for matching end tag */
 2241|  12.9M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|  12.9M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.9M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|  12.9M|#define EndOfStream (~0u)
  ------------------
  |  Branch (2241:12): [True: 12.9M, False: 532]
  ------------------
 2242|  12.9M|    {
 2243|  12.9M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  12.9M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.9M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2244|  12.9M|        lexer->txtend = lexer->lexsize;
 2245|       |
 2246|  12.9M|        if (state == CDATA_INTERMEDIATE)
  ------------------
  |  Branch (2246:13): [True: 12.6M, False: 346k]
  ------------------
 2247|  12.6M|        {
 2248|  12.6M|            if (c != '<')
  ------------------
  |  Branch (2248:17): [True: 12.5M, False: 22.0k]
  ------------------
 2249|  12.5M|            {
 2250|  12.5M|                if (isEmpty && !TY_(IsWhite)(c))
  ------------------
  |  |   23|  11.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2250:21): [True: 11.0k, False: 12.5M]
  |  Branch (2250:32): [True: 1.36k, False: 9.66k]
  ------------------
 2251|  1.36k|                    isEmpty = no;
 2252|  12.5M|                continue;
 2253|  12.5M|            }
 2254|       |
 2255|  22.0k|            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  22.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2256|       |
 2257|  22.0k|            if (TY_(IsLetter)(c))
  ------------------
  |  |   23|  22.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2257:17): [True: 8.75k, False: 13.3k]
  ------------------
 2258|  8.75k|            {
 2259|       |                /* <head><script src=foo><meta name=foo content=bar>*/
 2260|  8.75k|                if (hasSrc && isEmpty && nodeIsSCRIPT(container))
  ------------------
  |  |  422|  1.42k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  1.42k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.42k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.42k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.18k, False: 243]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2260:21): [True: 1.62k, False: 7.12k]
  |  Branch (2260:31): [True: 1.42k, False: 195]
  ------------------
 2261|  1.18k|                {
 2262|       |                    /* ReportError(doc, container, NULL, MISSING_ENDTAG_FOR); */
 2263|  1.18k|                    lexer->lexsize = lexer->txtstart;
 2264|  1.18k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2265|  1.18k|                    TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|  1.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2266|  1.18k|                    return NULL;
 2267|  1.18k|                }
 2268|  7.56k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  7.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2269|  7.56k|                start = lexer->lexsize - 1;
 2270|  7.56k|                state = CDATA_STARTTAG;
 2271|  7.56k|            }
 2272|  13.3k|            else if (c == '/')
  ------------------
  |  Branch (2272:22): [True: 5.79k, False: 7.52k]
  ------------------
 2273|  5.79k|            {
 2274|  5.79k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  5.79k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.79k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2275|       |
 2276|  5.79k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  5.79k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.79k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2277|       |                
 2278|  5.79k|                if (!TY_(IsLetter)(c))
  ------------------
  |  |   23|  5.79k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.79k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2278:21): [True: 676, False: 5.11k]
  ------------------
 2279|    676|                {
 2280|    676|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    676|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    676|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2281|    676|                    continue;
 2282|    676|                }
 2283|  5.11k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  5.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2284|       |
 2285|  5.11k|                start = lexer->lexsize;
 2286|  5.11k|                state = CDATA_ENDTAG;
 2287|  5.11k|            }
 2288|  7.52k|            else if (c == '\\')
  ------------------
  |  Branch (2288:22): [True: 1.29k, False: 6.22k]
  ------------------
 2289|  1.29k|            {
 2290|       |                /* recognize document.write("<script><\/script>") */
 2291|  1.29k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  1.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2292|       |
 2293|  1.29k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2294|       |
 2295|  1.29k|                if (c != '/')
  ------------------
  |  Branch (2295:21): [True: 274, False: 1.02k]
  ------------------
 2296|    274|                {
 2297|    274|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    274|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    274|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2298|    274|                    continue;
 2299|    274|                }
 2300|       |
 2301|  1.02k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  1.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2302|       |
 2303|  1.02k|                if (nonested) {
  ------------------
  |  Branch (2303:21): [True: 249, False: 775]
  ------------------
 2304|       |                    /*\ 
 2305|       |                     *  Issue #65 - for version 5.1.14.EXP2
 2306|       |                     *  If the nonested option is ON then the <script> 
 2307|       |                     *  tag did not bump nested, so no need to treat this as 
 2308|       |                     *  an end tag just to decrease nested, just continue!
 2309|       |                    \*/
 2310|    249|                    continue;
 2311|    249|                }
 2312|       |
 2313|    775|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    775|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    775|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2314|       |                
 2315|    775|                if (!TY_(IsLetter)(c))
  ------------------
  |  |   23|    775|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    775|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2315:21): [True: 411, False: 364]
  ------------------
 2316|    411|                {
 2317|    411|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    411|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    411|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2318|    411|                    continue;
 2319|    411|                }
 2320|    364|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    364|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    364|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2321|       |
 2322|    364|                start = lexer->lexsize;
 2323|    364|                state = CDATA_ENDTAG;
 2324|    364|            }
 2325|  6.22k|            else
 2326|  6.22k|            {
 2327|  6.22k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  6.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2328|  6.22k|            }
 2329|  22.0k|        }
 2330|       |        /* '<' + Letter found */
 2331|   346k|        else if (state == CDATA_STARTTAG)
  ------------------
  |  Branch (2331:18): [True: 22.6k, False: 323k]
  ------------------
 2332|  22.6k|        {
 2333|  22.6k|            if (TY_(IsLetter)(c))
  ------------------
  |  |   23|  22.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2333:17): [True: 15.0k, False: 7.52k]
  ------------------
 2334|  15.0k|                continue;
 2335|       |
 2336|  7.52k|            matches = TY_(tmbstrncasecmp)(container->element, lexer->lexbuf + start,
  ------------------
  |  |   23|  7.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2337|  7.52k|                                          TY_(tmbstrlen)(container->element)) == 0;
  ------------------
  |  |   23|  7.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2338|  7.52k|            if (matches && !nonested)
  ------------------
  |  Branch (2338:17): [True: 1.91k, False: 5.61k]
  |  Branch (2338:28): [True: 590, False: 1.32k]
  ------------------
 2339|    590|                nested++;
 2340|       |
 2341|  7.52k|            state = CDATA_INTERMEDIATE;
 2342|  7.52k|        }
 2343|       |        /* '<' + '/' + Letter found */
 2344|   323k|        else if (state == CDATA_ENDTAG)
  ------------------
  |  Branch (2344:18): [True: 323k, False: 0]
  ------------------
 2345|   323k|        {
 2346|   323k|            if (TY_(IsLetter)(c))
  ------------------
  |  |   23|   323k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   323k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2346:17): [True: 318k, False: 5.47k]
  ------------------
 2347|   318k|                continue;
 2348|       |
 2349|  5.47k|            matches = TY_(tmbstrncasecmp)(container->element, lexer->lexbuf + start,
  ------------------
  |  |   23|  5.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2350|  5.47k|                                          TY_(tmbstrlen)(container->element)) == 0;
  ------------------
  |  |   23|  5.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2351|       |
 2352|  5.47k|            if (isEmpty && !matches)
  ------------------
  |  Branch (2352:17): [True: 1.13k, False: 4.34k]
  |  Branch (2352:28): [True: 603, False: 528]
  ------------------
 2353|    603|            {
 2354|       |                /* ReportError(doc, container, NULL, MISSING_ENDTAG_FOR); */
 2355|       |
 2356|   129k|                for (i = lexer->lexsize - 1; i >= start; --i)
  ------------------
  |  Branch (2356:46): [True: 129k, False: 603]
  ------------------
 2357|   129k|                    TY_(UngetChar)((uint)lexer->lexbuf[i], doc->docIn);
  ------------------
  |  |   23|   129k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   129k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2358|    603|                TY_(UngetChar)('/', doc->docIn);
  ------------------
  |  |   23|    603|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    603|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2359|    603|                TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|    603|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    603|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2360|    603|                break;
 2361|    603|            }
 2362|       |
 2363|  4.87k|            if (matches && nested-- <= 0)
  ------------------
  |  Branch (2363:17): [True: 1.61k, False: 3.25k]
  |  Branch (2363:28): [True: 1.41k, False: 198]
  ------------------
 2364|  1.41k|            {
 2365|  46.1k|                for (i = lexer->lexsize - 1; i >= start; --i)
  ------------------
  |  Branch (2365:46): [True: 44.7k, False: 1.41k]
  ------------------
 2366|  44.7k|                    TY_(UngetChar)((uint)lexer->lexbuf[i], doc->docIn);
  ------------------
  |  |   23|  44.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2367|  1.41k|                TY_(UngetChar)('/', doc->docIn);
  ------------------
  |  |   23|  1.41k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.41k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2368|  1.41k|                TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|  1.41k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.41k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2369|  1.41k|                lexer->lexsize -= (lexer->lexsize - start) + 2;
 2370|  1.41k|                break;
 2371|  1.41k|            }
 2372|  3.45k|            else if (lexer->lexbuf[start - 2] != '\\')
  ------------------
  |  Branch (2372:22): [True: 3.09k, False: 363]
  ------------------
 2373|  3.09k|            {
 2374|       |                /* if the end tag is not already escaped using backslash */
 2375|  3.09k|                SetLexerLocus( doc, lexer );
 2376|  3.09k|                lexer->columns -= 3;
 2377|       |
 2378|       |                /*\ if javascript insert backslash before / 
 2379|       |                 *  Issue #348 - Add option, escape-scripts, to skip
 2380|       |                \*/
 2381|  3.09k|                if ((TY_(IsJavaScript)(container)) && cfgBool(doc, TidyEscapeScripts) &&
  ------------------
  |  |   23|  3.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ((TY_(IsJavaScript)(container)) && cfgBool(doc, TidyEscapeScripts) &&
  ------------------
  |  |  418|  4.61k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.52k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 1.52k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2381:21): [True: 1.52k, False: 1.57k]
  ------------------
 2382|  1.52k|                    !TY_(IsHTML5Mode)(doc) )    /* Is #700 - This only applies to legacy html4 mode */
  ------------------
  |  |   23|  1.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2382:21): [True: 361, False: 1.16k]
  ------------------
 2383|    361|                {
 2384|       |                    /* Issue #281 - only warn if adding the escape! */
 2385|    361|                    TY_(Report)(doc, NULL, NULL, BAD_CDATA_CONTENT);
  ------------------
  |  |   23|    361|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    361|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2386|       |
 2387|   142k|                    for (i = lexer->lexsize; i > start-1; --i)
  ------------------
  |  Branch (2387:46): [True: 142k, False: 361]
  ------------------
 2388|   142k|                        lexer->lexbuf[i] = lexer->lexbuf[i-1];
 2389|       |
 2390|    361|                    lexer->lexbuf[start-1] = '\\';
 2391|    361|                    lexer->lexsize++;
 2392|    361|                }
 2393|  3.09k|            }
 2394|  3.45k|            state = CDATA_INTERMEDIATE;
 2395|  3.45k|        }
 2396|  12.9M|    }
 2397|  2.55k|    if (isEmpty)
  ------------------
  |  Branch (2397:9): [True: 1.18k, False: 1.36k]
  ------------------
 2398|  1.18k|        lexer->lexsize = lexer->txtstart = lexer->txtend;
 2399|  1.36k|    else
 2400|  1.36k|        lexer->txtend = lexer->lexsize;
 2401|       |
 2402|  2.55k|    if (c == EndOfStream)
  ------------------
  |  | 1064|  2.55k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2402:9): [True: 532, False: 2.02k]
  ------------------
 2403|    532|        TY_(Report)(doc, container, NULL, MISSING_ENDTAG_FOR );
  ------------------
  |  |   23|    532|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    532|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2404|       |
 2405|  2.55k|    return TY_(TextToken)(lexer);
  ------------------
  |  |   23|  2.55k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.55k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2406|  3.73k|}
lexer.c:SetLexerLocus:
 1007|  7.85M|{
 1008|  7.85M|    lexer->lines = doc->docIn->curline;
 1009|  7.85M|    lexer->columns = doc->docIn->curcol;
 1010|  7.85M|}
lexer.c:GetTokenFromStream:
 2512|  3.27M|{
 2513|  3.27M|    Lexer* lexer = doc->lexer;
 2514|  3.27M|    uint c, lexdump, badcomment = 0;
 2515|  3.27M|    Bool isempty = no;
 2516|  3.27M|    AttVal *attributes = NULL;
 2517|  3.27M|    Node *node;
 2518|  3.27M|    Bool fixComments;
 2519|       |    
 2520|  3.27M|    switch ( cfgAutoBool(doc, TidyFixComments) )
  ------------------
  |  |  421|  3.27M|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.27M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2521|  3.27M|    {
 2522|      0|        case TidyYesState:
  ------------------
  |  Branch (2522:9): [True: 0, False: 3.27M]
  ------------------
 2523|      0|            fixComments = yes;
 2524|      0|            break;
 2525|       |
 2526|      0|        case TidyNoState:
  ------------------
  |  Branch (2526:9): [True: 0, False: 3.27M]
  ------------------
 2527|      0|            fixComments = no;
 2528|      0|            break;
 2529|       |
 2530|  3.27M|        default:
  ------------------
  |  Branch (2530:9): [True: 3.27M, False: 0]
  ------------------
 2531|  3.27M|            fixComments = (TY_(HTMLVersion)(doc) & HT50) == 0;
  ------------------
  |  |   23|  3.27M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.27M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          fixComments = (TY_(HTMLVersion)(doc) & HT50) == 0;
  ------------------
  |  |  200|  3.27M|#define HT50              131072u
  ------------------
 2532|  3.27M|            break;
 2533|  3.27M|    }
 2534|       |
 2535|       |    /* Lexer->token must be set on return. Nullify it for safety. */
 2536|  3.27M|    lexer->token = NULL;
 2537|       |
 2538|  3.27M|    SetLexerLocus( doc, lexer );
 2539|  3.27M|    lexer->waswhite = no;
 2540|       |
 2541|  3.27M|    lexer->txtstart = lexer->txtend = lexer->lexsize;
 2542|       |
 2543|   253M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|   253M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   253M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|   253M|#define EndOfStream (~0u)
  ------------------
  |  Branch (2543:12): [True: 252M, False: 1.72M]
  ------------------
 2544|   252M|    {
 2545|   252M|        if (lexer->insertspace)
  ------------------
  |  Branch (2545:13): [True: 4.36k, False: 252M]
  ------------------
 2546|  4.36k|        {
 2547|  4.36k|            TY_(AddCharToLexer)(lexer, ' ');
  ------------------
  |  |   23|  4.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2548|  4.36k|            lexer->waswhite = yes;
 2549|  4.36k|            lexer->insertspace = no;
 2550|  4.36k|        }
 2551|       |
 2552|   252M|        if (c == 160 && (mode == Preformatted))
  ------------------
  |  Branch (2552:13): [True: 691, False: 252M]
  |  Branch (2552:25): [True: 211, False: 480]
  ------------------
 2553|    211|            c = ' ';
 2554|       |
 2555|   252M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   252M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   252M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2556|       |
 2557|   252M|        switch (lexer->state)
  ------------------
  |  Branch (2557:17): [True: 252M, False: 0]
  ------------------
 2558|   252M|        {
 2559|   157M|            case LEX_CONTENT:  /* element content */
  ------------------
  |  Branch (2559:13): [True: 157M, False: 95.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|   157M|                if (TY_(IsWhite)(c) && (mode == IgnoreWhitespace) 
  ------------------
  |  |   23|   157M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   157M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2566:21): [True: 143M, False: 13.6M]
  |  Branch (2566:40): [True: 1.14M, False: 142M]
  ------------------
 2567|  1.14M|                      && lexer->lexsize == lexer->txtstart + 1)
  ------------------
  |  Branch (2567:26): [True: 1.06M, False: 79.6k]
  ------------------
 2568|  1.06M|                {
 2569|  1.06M|                    --(lexer->lexsize);
 2570|  1.06M|                    lexer->waswhite = no;
 2571|  1.06M|                    SetLexerLocus( doc, lexer );
 2572|  1.06M|                    continue;
 2573|  1.06M|                }
 2574|       |
 2575|   156M|                if (c == '<')
  ------------------
  |  Branch (2575:21): [True: 1.46M, False: 154M]
  ------------------
 2576|  1.46M|                {
 2577|  1.46M|                    lexer->state = LEX_GT;
 2578|  1.46M|                    continue;
 2579|  1.46M|                }
 2580|       |
 2581|   154M|                if (TY_(IsWhite)(c))
  ------------------
  |  |   23|   154M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   154M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2581:21): [True: 142M, False: 12.2M]
  ------------------
 2582|   142M|                {
 2583|       |                    /* was previous character white? */
 2584|   142M|                    if (lexer->waswhite)
  ------------------
  |  Branch (2584:25): [True: 142M, False: 262k]
  ------------------
 2585|   142M|                    {
 2586|   142M|                        if (mode != Preformatted && mode != IgnoreMarkup)
  ------------------
  |  Branch (2586:29): [True: 3.27M, False: 138M]
  |  Branch (2586:53): [True: 3.27M, False: 0]
  ------------------
 2587|  3.27M|                        {
 2588|  3.27M|                            --(lexer->lexsize);
 2589|  3.27M|                            SetLexerLocus( doc, lexer );
 2590|  3.27M|                        }
 2591|   142M|                    }
 2592|   262k|                    else /* prev character wasn't white */
 2593|   262k|                    {
 2594|   262k|                        lexer->waswhite = yes;
 2595|       |
 2596|   262k|                        if (mode != Preformatted && mode != IgnoreMarkup && c != ' ')
  ------------------
  |  Branch (2596:29): [True: 83.2k, False: 179k]
  |  Branch (2596:53): [True: 83.2k, False: 0]
  |  Branch (2596:77): [True: 36.8k, False: 46.3k]
  ------------------
 2597|  36.8k|                            ChangeChar(lexer, ' ');
 2598|   262k|                    }
 2599|       |
 2600|   142M|                    continue;
 2601|   142M|                }
 2602|  12.2M|                else if (c == '&' && mode != IgnoreMarkup)
  ------------------
  |  Branch (2602:26): [True: 215k, False: 12.0M]
  |  Branch (2602:38): [True: 215k, False: 0]
  ------------------
 2603|   215k|                    ParseEntity( doc, mode );
 2604|       |
 2605|       |                /* this is needed to avoid trimming trailing whitespace */
 2606|  12.2M|                if (mode == IgnoreWhitespace)
  ------------------
  |  Branch (2606:21): [True: 101k, False: 12.1M]
  ------------------
 2607|   101k|                    mode = MixedContent;
 2608|       |
 2609|  12.2M|                lexer->waswhite = no;
 2610|  12.2M|                continue;
 2611|       |
 2612|  1.46M|            case LEX_GT:  /* < */
  ------------------
  |  Branch (2612:13): [True: 1.46M, False: 250M]
  ------------------
 2613|       |
 2614|       |                /* check for endtag */
 2615|  1.46M|                if (c == '/')
  ------------------
  |  Branch (2615:21): [True: 98.4k, False: 1.36M]
  ------------------
 2616|  98.4k|                {
 2617|  98.4k|                    if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  98.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  98.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  98.4k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2617:25): [True: 30, False: 98.4k]
  ------------------
 2618|     30|                    {
 2619|     30|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     30|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     30|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2620|     30|                        continue;
 2621|     30|                    }
 2622|       |
 2623|  98.4k|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  98.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  98.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2624|       |
 2625|  98.4k|                    if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|  98.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  98.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |  418|  33.7k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  16.8k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 16.8k]
  |  |  ------------------
  ------------------
                                  if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2625:25): [True: 81.5k, False: 16.8k]
  |  Branch (2625:75): [True: 0, False: 0]
  ------------------
 2626|  81.5k|                    {
 2627|  81.5k|                        lexer->lexsize -= 3;
 2628|  81.5k|                        lexer->txtend = lexer->lexsize;
 2629|  81.5k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  81.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  81.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2630|  81.5k|                        lexer->state = LEX_ENDTAG;
 2631|  81.5k|                        lexer->lexbuf[lexer->lexsize] = '\0';  /* debug */
 2632|  81.5k|                        doc->docIn->curcol -= 2;
 2633|       |
 2634|       |                        /* if some text before the </ return it now */
 2635|  81.5k|                        if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (2635:29): [True: 11.7k, False: 69.8k]
  ------------------
 2636|  11.7k|                        {
 2637|       |                            /* trim space character before end tag */
 2638|  11.7k|                            if (mode == IgnoreWhitespace && lexer->lexbuf[lexer->lexsize - 1] == ' ')
  ------------------
  |  Branch (2638:33): [True: 1.52k, False: 10.2k]
  |  Branch (2638:61): [True: 750, False: 777]
  ------------------
 2639|    750|                            {
 2640|    750|                                lexer->lexsize -= 1;
 2641|    750|                                lexer->txtend = lexer->lexsize;
 2642|    750|                            }
 2643|  11.7k|                            lexer->token = TY_(TextToken)(lexer);
  ------------------
  |  |   23|  11.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2644|  11.7k|                            node = lexer->token;
 2645|  11.7k|                            GTDBG(doc,"text", node);
 2646|  11.7k|                            return node;
 2647|  11.7k|                        }
 2648|       |
 2649|  69.8k|                        continue;       /* no text so keep going */
 2650|  81.5k|                    }
 2651|       |
 2652|       |                    /* otherwise treat as CDATA */
 2653|  16.8k|                    lexer->waswhite = no;
 2654|  16.8k|                    lexer->state = LEX_CONTENT;
 2655|  16.8k|                    continue;
 2656|  98.4k|                }
 2657|       |
 2658|  1.36M|                if (mode == IgnoreMarkup)
  ------------------
  |  Branch (2658:21): [True: 0, False: 1.36M]
  ------------------
 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.36M|                if (c == '!')
  ------------------
  |  Branch (2670:21): [True: 180k, False: 1.18M]
  ------------------
 2671|   180k|                {
 2672|   180k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   180k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   180k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2673|       |
 2674|   180k|                    if (c == '-')
  ------------------
  |  Branch (2674:25): [True: 98.3k, False: 82.4k]
  ------------------
 2675|  98.3k|                    {
 2676|  98.3k|                        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  98.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  98.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2677|       |
 2678|  98.3k|                        if (c == '-')
  ------------------
  |  Branch (2678:29): [True: 95.9k, False: 2.42k]
  ------------------
 2679|  95.9k|                        {
 2680|  95.9k|                            lexer->state = LEX_COMMENT;  /* comment */
 2681|  95.9k|                            lexer->lexsize -= 2;
 2682|  95.9k|                            lexer->txtend = lexer->lexsize;
 2683|       |
 2684|  95.9k|                            CondReturnTextNode(doc, 4)
  ------------------
  |  | 2424|  95.9k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 4.83k, False: 91.1k]
  |  |  ------------------
  |  | 2425|  95.9k|            { \
  |  | 2426|  4.83k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  4.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  4.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  4.83k|                return lexer->token; \
  |  | 2428|  4.83k|            }
  ------------------
 2685|       |
 2686|  91.1k|                            lexer->txtstart = lexer->lexsize;
 2687|  91.1k|                            continue;
 2688|  95.9k|                        }
 2689|       |
 2690|       |                        /*
 2691|       |                           TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_DROPPING );
 2692|       |                           Warning now done later - see issue #487
 2693|       |                         */
 2694|  98.3k|                    }
 2695|  82.4k|                    else if (c == 'd' || c == 'D')
  ------------------
  |  Branch (2695:30): [True: 24.8k, False: 57.5k]
  |  Branch (2695:42): [True: 34.6k, False: 22.9k]
  ------------------
 2696|  59.4k|                    {
 2697|       |                        /* todo: check for complete "<!DOCTYPE" not just <!D */
 2698|       |
 2699|  59.4k|                        uint skip = 0;
 2700|       |
 2701|  59.4k|                        lexer->state = LEX_DOCTYPE; /* doctype */
 2702|  59.4k|                        lexer->lexsize -= 2;
 2703|  59.4k|                        lexer->txtend = lexer->lexsize;
 2704|  59.4k|                        mode = IgnoreWhitespace;
 2705|       |
 2706|       |                        /* skip until white space or '>' */
 2707|       |
 2708|  59.4k|                        for (;;)
 2709|  82.3k|                        {
 2710|  82.3k|                            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  82.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  82.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2711|  82.3k|                            ++skip;
 2712|       |
 2713|  82.3k|                            if (c == EndOfStream || c == '>')
  ------------------
  |  | 1064|   164k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2713:33): [True: 74, False: 82.2k]
  |  Branch (2713:53): [True: 26.7k, False: 55.4k]
  ------------------
 2714|  26.8k|                            {
 2715|  26.8k|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  26.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2716|  26.8k|                                break;
 2717|  26.8k|                            }
 2718|       |
 2719|       |
 2720|  55.4k|                            if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|  55.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2720:33): [True: 22.8k, False: 32.6k]
  ------------------
 2721|  22.8k|                                continue;
 2722|       |
 2723|       |                            /* and skip to end of whitespace */
 2724|       |
 2725|  32.6k|                            for (;;)
 2726|   103k|                            {
 2727|   103k|                                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   103k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   103k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2728|   103k|                                ++skip;
 2729|       |
 2730|   103k|                                if (c == EndOfStream || c == '>')
  ------------------
  |  | 1064|   206k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2730:37): [True: 44, False: 103k]
  |  Branch (2730:57): [True: 1.19k, False: 102k]
  ------------------
 2731|  1.23k|                                {
 2732|  1.23k|                                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2733|  1.23k|                                    break;
 2734|  1.23k|                                }
 2735|       |
 2736|       |
 2737|   102k|                                if (TY_(IsWhite)(c))
  ------------------
  |  |   23|   102k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   102k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2737:37): [True: 70.6k, False: 31.3k]
  ------------------
 2738|  70.6k|                                    continue;
 2739|       |
 2740|  31.3k|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  31.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2741|  31.3k|                                break;
 2742|   102k|                            }
 2743|       |
 2744|  32.6k|                            break;
 2745|  55.4k|                        }
 2746|       |
 2747|  59.4k|                        CondReturnTextNode(doc, (skip + 3))
  ------------------
  |  | 2424|  59.4k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 14.9k, False: 44.4k]
  |  |  ------------------
  |  | 2425|  59.4k|            { \
  |  | 2426|  14.9k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  14.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  14.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  14.9k|                return lexer->token; \
  |  | 2428|  14.9k|            }
  ------------------
 2748|       |
 2749|  44.4k|                        lexer->txtstart = lexer->lexsize;
 2750|  44.4k|                        continue;
 2751|  59.4k|                    }
 2752|  22.9k|                    else if (c == '[')
  ------------------
  |  Branch (2752:30): [True: 17.2k, False: 5.69k]
  ------------------
 2753|  17.2k|                    {
 2754|       |                        /* Word 2000 embeds <![if ...]> ... <![endif]> sequences */
 2755|  17.2k|                        lexer->lexsize -= 2;
 2756|  17.2k|                        lexer->state = LEX_SECTION;
 2757|  17.2k|                        lexer->txtend = lexer->lexsize;
 2758|       |
 2759|  17.2k|                        CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  17.2k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 12.9k, False: 4.34k]
  |  |  ------------------
  |  | 2425|  17.2k|            { \
  |  | 2426|  12.9k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  12.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  12.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  12.9k|                return lexer->token; \
  |  | 2428|  12.9k|            }
  ------------------
 2760|       |
 2761|  4.34k|                        lexer->txtstart = lexer->lexsize;
 2762|  4.34k|                        continue;
 2763|  17.2k|                    }
 2764|       |
 2765|       |
 2766|       |                    /*
 2767|       |                       We only print this message if there's a missing
 2768|       |                       starting hyphen; this comment will be dropped.
 2769|       |                     */
 2770|  8.11k|                    TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_DROPPING ); /* Is. #487 */
  ------------------
  |  |   23|  8.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2771|       |
 2772|       |                    /* else swallow characters up to and including next '>' */
 2773|   311k|                    while ((c = TY_(ReadChar)(doc->docIn)) != '>')
  ------------------
  |  |   23|   311k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   311k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2773:28): [True: 303k, False: 7.97k]
  ------------------
 2774|   303k|                    {
 2775|   303k|                        if (c == EndOfStream)
  ------------------
  |  | 1064|   303k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2775:29): [True: 142, False: 303k]
  ------------------
 2776|    142|                        {
 2777|    142|                            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    142|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    142|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2778|    142|                            break;
 2779|    142|                        }
 2780|   303k|                    }
 2781|       |
 2782|  8.11k|                    lexer->lexsize -= 2;
 2783|  8.11k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 2784|  8.11k|                    lexer->state = LEX_CONTENT;
 2785|  8.11k|                    continue;
 2786|   180k|                }
 2787|       |
 2788|       |                /*
 2789|       |                   processing instructions
 2790|       |                */
 2791|       |
 2792|  1.18M|                if (c == '?')
  ------------------
  |  Branch (2792:21): [True: 116k, False: 1.06M]
  ------------------
 2793|   116k|                {
 2794|   116k|                    lexer->lexsize -= 2;
 2795|   116k|                    lexer->state = LEX_PROCINSTR;
 2796|   116k|                    lexer->txtend = lexer->lexsize;
 2797|       |
 2798|   116k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|   116k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 86.5k, False: 29.8k]
  |  |  ------------------
  |  | 2425|   116k|            { \
  |  | 2426|  86.5k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  86.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  86.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  86.5k|                return lexer->token; \
  |  | 2428|  86.5k|            }
  ------------------
 2799|       |
 2800|  29.8k|                    lexer->txtstart = lexer->lexsize;
 2801|  29.8k|                    continue;
 2802|   116k|                }
 2803|       |
 2804|       |                /* Microsoft ASP's e.g. <% ... server-code ... %> */
 2805|  1.06M|                if (c == '%')
  ------------------
  |  Branch (2805:21): [True: 2.55k, False: 1.06M]
  ------------------
 2806|  2.55k|                {
 2807|  2.55k|                    lexer->lexsize -= 2;
 2808|  2.55k|                    lexer->state = LEX_ASP;
 2809|  2.55k|                    lexer->txtend = lexer->lexsize;
 2810|       |
 2811|  2.55k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  2.55k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 758, False: 1.79k]
  |  |  ------------------
  |  | 2425|  2.55k|            { \
  |  | 2426|    758|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|    758|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    758|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|    758|                return lexer->token; \
  |  | 2428|    758|            }
  ------------------
 2812|       |
 2813|  1.79k|                    lexer->txtstart = lexer->lexsize;
 2814|  1.79k|                    continue;
 2815|  2.55k|                }
 2816|       |
 2817|       |                /* Netscapes JSTE e.g. <# ... server-code ... #> */
 2818|  1.06M|                if (c == '#')
  ------------------
  |  Branch (2818:21): [True: 4.20k, False: 1.06M]
  ------------------
 2819|  4.20k|                {
 2820|  4.20k|                    lexer->lexsize -= 2;
 2821|  4.20k|                    lexer->state = LEX_JSTE;
 2822|  4.20k|                    lexer->txtend = lexer->lexsize;
 2823|       |
 2824|  4.20k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  4.20k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 1.48k, False: 2.72k]
  |  |  ------------------
  |  | 2425|  4.20k|            { \
  |  | 2426|  1.48k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  1.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  1.48k|                return lexer->token; \
  |  | 2428|  1.48k|            }
  ------------------
 2825|       |
 2826|  2.72k|                    lexer->txtstart = lexer->lexsize;
 2827|  2.72k|                    continue;
 2828|  4.20k|                }
 2829|       |
 2830|       |                /* check for start tag */
 2831|  1.06M|                if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|  1.06M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.06M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |  418|   245k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   122k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 122k]
  |  |  ------------------
  ------------------
                              if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2831:21): [True: 938k, False: 122k]
  |  Branch (2831:71): [True: 0, False: 0]
  ------------------
 2832|   938k|                {
 2833|   938k|                    TY_(UngetChar)(c, doc->docIn);     /* push back letter */
  ------------------
  |  |   23|   938k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   938k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2834|   938k|                    TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|   938k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   938k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2835|   938k|                    lexer->lexsize -= 2;      /* discard "<" + letter */
 2836|   938k|                    lexer->txtend = lexer->lexsize;
 2837|   938k|                    lexer->state = LEX_STARTTAG;         /* ready to read tag name */
 2838|       |
 2839|   938k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|   938k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 104k, False: 833k]
  |  |  ------------------
  |  | 2425|   938k|            { \
  |  | 2426|   104k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|   104k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   104k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|   104k|                return lexer->token; \
  |  | 2428|   104k|            }
  ------------------
 2840|       |
 2841|       |                    /* lexer->txtstart = lexer->lexsize; missing here? */
 2842|   833k|                    continue;       /* no text so keep going */
 2843|   938k|                }
 2844|       |
 2845|       |                /* otherwise treat as CDATA */
 2846|       |                /* fix for bug 762102 (486) */
 2847|       |                /* Issue #384 - Fix skipping parsing character, particularly '<<' */
 2848|   122k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   122k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   122k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2849|   122k|                lexer->lexsize -= 1;
 2850|   122k|                lexer->state = LEX_CONTENT;
 2851|   122k|                lexer->waswhite = no;
 2852|   122k|                continue;
 2853|       |
 2854|  82.1k|            case LEX_ENDTAG:  /* </letter */
  ------------------
  |  Branch (2854:13): [True: 82.1k, False: 252M]
  ------------------
 2855|  82.1k|                lexer->txtstart = lexer->lexsize - 1;
 2856|  82.1k|                doc->docIn->curcol += 2;
 2857|  82.1k|                c = ParseTagName( doc );
 2858|  82.1k|                lexer->token = TagToken( doc, EndTag );  /* create endtag token */
 2859|  82.1k|                lexer->lexsize = lexer->txtend = lexer->txtstart;
 2860|       |
 2861|       |                /* skip to '>' */
 2862|   622k|                while ( c != '>' && c != EndOfStream )
  ------------------
  |  | 1064|   540k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2862:25): [True: 540k, False: 81.2k]
  |  Branch (2862:37): [True: 539k, False: 927]
  ------------------
 2863|   539k|                {
 2864|   539k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   539k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   539k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2865|   539k|                }
 2866|       |
 2867|  82.1k|                if (c == EndOfStream)
  ------------------
  |  | 1064|  82.1k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2867:21): [True: 927, False: 81.2k]
  ------------------
 2868|    927|                {
 2869|    927|                    TY_(FreeNode)( doc, lexer->token );
  ------------------
  |  |   23|    927|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    927|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2870|    927|                    continue;
 2871|    927|                }
 2872|       |
 2873|  81.2k|                lexer->state = LEX_CONTENT;
 2874|  81.2k|                lexer->waswhite = no;
 2875|  81.2k|                node = lexer->token;
 2876|  81.2k|                GTDBG(doc,"endtag", node);
 2877|  81.2k|                return node;  /* the endtag token */
 2878|       |
 2879|   938k|            case LEX_STARTTAG: /* first letter of tagname */
  ------------------
  |  Branch (2879:13): [True: 938k, False: 251M]
  ------------------
 2880|   938k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   938k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   938k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2881|   938k|                ChangeChar(lexer, (tmbchar)c);
 2882|   938k|                lexer->txtstart = lexer->lexsize - 1; /* set txtstart to first letter */
 2883|   938k|                c = ParseTagName( doc );
 2884|   938k|                isempty = no;
 2885|   938k|                attributes = NULL;
 2886|   938k|                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|   938k|                if (c != '>')
  ------------------
  |  Branch (2889:21): [True: 347k, False: 590k]
  ------------------
 2890|   347k|                {
 2891|   347k|                    if (c == '/')
  ------------------
  |  Branch (2891:25): [True: 11.0k, False: 336k]
  ------------------
 2892|  11.0k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  11.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2893|       |
 2894|   347k|                    attributes = ParseAttrs( doc, &isempty );
 2895|   347k|                }
 2896|       |
 2897|   938k|                if (isempty)
  ------------------
  |  Branch (2897:21): [True: 13.2k, False: 925k]
  ------------------
 2898|  13.2k|                    lexer->token->type = StartEndTag;
 2899|       |
 2900|   938k|                lexer->token->attributes = attributes;
 2901|   938k|                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|   938k|                if ( nodeIsPRE(lexer->token) )
  ------------------
  |  |  383|   938k|#define nodeIsPRE( node )        TagIsId( node, TidyTag_PRE )
  |  |  ------------------
  |  |  |  |  275|   938k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 938k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 776k, False: 161k]
  |  |  |  |  |  Branch (275:54): [True: 72.3k, False: 704k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2914|  72.3k|                {
 2915|  72.3k|                    mode = Preformatted;
 2916|  72.3k|                }
 2917|       |
 2918|   938k|                if ((mode != Preformatted && ExpectsContent(lexer->token))
  ------------------
  |  Branch (2918:22): [True: 811k, False: 126k]
  |  Branch (2918:46): [True: 763k, False: 48.3k]
  ------------------
 2919|   938k|                    || nodeIsBR(lexer->token) || nodeIsHR(lexer->token))
  ------------------
  |  |  400|   174k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  1.11M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 174k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 157k, False: 17.2k]
  |  |  |  |  |  Branch (275:54): [True: 5.44k, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  || nodeIsBR(lexer->token) || nodeIsHR(lexer->token))
  ------------------
  |  |  380|   169k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|   169k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 169k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 152k, False: 17.2k]
  |  |  |  |  |  Branch (275:54): [True: 7.70k, False: 144k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2920|   776k|                {
 2921|   776k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   776k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   776k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2922|       |
 2923|   776k|                    if ((c == '\n') && (mode != IgnoreWhitespace)) /* Issue #329 - Can NOT afford to lose this newline */
  ------------------
  |  Branch (2923:25): [True: 4.60k, False: 771k]
  |  Branch (2923:40): [True: 4.20k, False: 396]
  ------------------
 2924|  4.20k|                        TY_(UngetChar)(c, doc->docIn);  /* Issue #329 - make sure the newline is maintained for now */
  ------------------
  |  |   23|  4.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.20k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2925|   772k|                    else if (c != '\n' && c != '\f')
  ------------------
  |  Branch (2925:30): [True: 771k, False: 396]
  |  Branch (2925:43): [True: 771k, False: 0]
  ------------------
 2926|   771k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   771k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   771k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2927|       |
 2928|   776k|                    lexer->waswhite = yes;  /* to swallow leading whitespace */
 2929|   776k|                }
 2930|   161k|                else
 2931|   161k|                    lexer->waswhite = no;
 2932|       |
 2933|   938k|                lexer->state = LEX_CONTENT;
 2934|   938k|                if (lexer->token->tag == NULL) 
  ------------------
  |  Branch (2934:21): [True: 161k, False: 776k]
  ------------------
 2935|   161k|                {
 2936|   161k|                    if (mode != OtherNamespace) /* [i_a]2 only issue warning if NOT 'OtherNamespace', and tag null */
  ------------------
  |  Branch (2936:25): [True: 156k, False: 4.73k]
  ------------------
 2937|   156k|                    {
 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|   156k|                        if ( (doc->lexer->doctype & VERS_HTML5) > 0 && TY_(elementIsAutonomousCustomFormat)( lexer->token->element ) )
  ------------------
  |  |  213|   156k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|   156k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|   156k|#define XH50              262144u
  |  |  ------------------
  ------------------
                                      if ( (doc->lexer->doctype & VERS_HTML5) > 0 && TY_(elementIsAutonomousCustomFormat)( lexer->token->element ) )
  ------------------
  |  |   23|  56.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  56.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2943:30): [True: 56.6k, False: 99.8k]
  |  Branch (2943:72): [True: 55.4k, False: 1.18k]
  ------------------
 2944|  55.4k|                            TY_(Report)( doc, NULL, lexer->token, UNKNOWN_ELEMENT_LOOKS_CUSTOM );
  ------------------
  |  |   23|  55.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2945|   101k|                        else
 2946|   101k|                            TY_(Report)( doc, NULL, lexer->token, UNKNOWN_ELEMENT );
  ------------------
  |  |   23|   101k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   101k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2947|   156k|                    }
 2948|   161k|                }
 2949|   776k|                else if ( !cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|   776k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   776k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2949:27): [True: 776k, False: 0]
  ------------------
 2950|   776k|                {
 2951|   776k|                    TY_(ConstrainVersion)( doc, lexer->token->tag->versions );
  ------------------
  |  |   23|   776k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   776k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2952|   776k|                    TY_(RepairDuplicateAttributes)( doc, lexer->token, no );
  ------------------
  |  |   23|   776k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   776k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2953|   776k|                } else 
 2954|      0|                    TY_(RepairDuplicateAttributes)( doc, lexer->token, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2955|   938k|                node = lexer->token;
 2956|   938k|                GTDBG(doc,"starttag", node);
 2957|   938k|                return node;  /* return start tag */
 2958|       |
 2959|  2.34M|            case LEX_COMMENT:  /* seen <!-- so look for --> */
  ------------------
  |  Branch (2959:13): [True: 2.34M, False: 249M]
  ------------------
 2960|       |
 2961|  2.34M|                if (c != '-')
  ------------------
  |  Branch (2961:21): [True: 2.16M, False: 178k]
  ------------------
 2962|  2.16M|                    continue;
 2963|       |
 2964|   178k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   178k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   178k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2965|       |
 2966|       |                /* Fix hyphens at beginning of tag */
 2967|   178k|                if ( c != '-' && fixComments && lexer->lexsize - lexer->txtstart == 1 )
  ------------------
  |  Branch (2967:22): [True: 55.9k, False: 122k]
  |  Branch (2967:34): [True: 55.9k, False: 0]
  |  Branch (2967:49): [True: 53.3k, False: 2.57k]
  ------------------
 2968|  53.3k|                {
 2969|  53.3k|                    lexer->lexbuf[lexer->lexsize - 1] = '=';
 2970|  53.3k|                }
 2971|       |
 2972|   178k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   178k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   178k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2973|       |
 2974|   178k|                if (c != '-')
  ------------------
  |  Branch (2974:21): [True: 55.9k, False: 122k]
  ------------------
 2975|  55.9k|                    continue;
 2976|       |
 2977|   727k|            end_comment:
 2978|   727k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   727k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   727k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2979|       |
 2980|   727k|                if (c == '>')
  ------------------
  |  Branch (2980:21): [True: 95.7k, False: 631k]
  ------------------
 2981|  95.7k|                {
 2982|  95.7k|                    if (badcomment)
  ------------------
  |  Branch (2982:25): [True: 17.9k, False: 77.8k]
  ------------------
 2983|  17.9k|                    {
 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|  17.9k|                        if ( (TY_(HTMLVersion)(doc) & HT50) )
  ------------------
  |  |   23|  17.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                      if ( (TY_(HTMLVersion)(doc) & HT50) )
  ------------------
  |  |  200|  17.9k|#define HT50              131072u
  ------------------
  |  Branch (2989:30): [True: 0, False: 17.9k]
  ------------------
 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|  17.9k|                        else
 2996|  17.9k|                        {
 2997|  17.9k|                            if ( fixComments )
  ------------------
  |  Branch (2997:34): [True: 17.9k, False: 0]
  ------------------
 2998|  17.9k|                                TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT );
  ------------------
  |  |   23|  17.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.9k|#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|  17.9k|                        }
 3002|  17.9k|                    }
 3003|       |
 3004|       |                    /* do not store closing -- in lexbuf */
 3005|  95.7k|                    lexer->lexsize -= 2;
 3006|  95.7k|                    lexer->txtend = lexer->lexsize;
 3007|  95.7k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3008|  95.7k|                    lexer->state = LEX_CONTENT;
 3009|  95.7k|                    lexer->waswhite = no;
 3010|  95.7k|                    lexer->token = CommentToken(doc);
  ------------------
  |  | 1611|  95.7k|#define CommentToken(doc) NewToken(doc, CommentTag)
  ------------------
 3011|       |
 3012|       |                    /* now look for a line break */
 3013|       |
 3014|  95.7k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  95.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  95.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3015|       |
 3016|  95.7k|                    if (c == '\n')
  ------------------
  |  Branch (3016:25): [True: 749, False: 95.0k]
  ------------------
 3017|    749|                        lexer->token->linebreak = yes;
 3018|  95.0k|                    else
 3019|  95.0k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  95.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  95.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3020|       |
 3021|  95.7k|                    node = lexer->token;
 3022|  95.7k|                    GTDBG(doc,"comment", node);
 3023|  95.7k|                    return node;
 3024|  95.7k|                }
 3025|       |
 3026|       |                /* note position of first such error in the comment */
 3027|   631k|                if (!badcomment)
  ------------------
  |  Branch (3027:21): [True: 18.0k, False: 613k]
  ------------------
 3028|  18.0k|                {
 3029|  18.0k|                    SetLexerLocus( doc, lexer );
 3030|  18.0k|                    lexer->columns -= 3;
 3031|  18.0k|                }
 3032|       |
 3033|   631k|                badcomment++;
 3034|       |
 3035|       |                /* fix hyphens in the middle */
 3036|   631k|                if ( fixComments )
  ------------------
  |  Branch (3036:22): [True: 631k, False: 0]
  ------------------
 3037|   631k|                    lexer->lexbuf[lexer->lexsize - 2] = '=';
 3038|       |
 3039|       |                /* if '-' then look for '>' to end the comment */
 3040|   631k|                if (c == '-')
  ------------------
  |  Branch (3040:21): [True: 605k, False: 26.3k]
  ------------------
 3041|   605k|                {
 3042|   605k|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   605k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   605k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3043|   605k|                    goto end_comment;
 3044|   605k|                }
 3045|       |
 3046|       |                /* fix hyphens end, and continue to look for --> */
 3047|  26.3k|                if ( fixComments )
  ------------------
  |  Branch (3047:22): [True: 26.3k, False: 0]
  ------------------
 3048|  26.3k|                    lexer->lexbuf[lexer->lexsize - 1] = '=';
 3049|       |
 3050|       |                /* http://tidy.sf.net/bug/1266647 */
 3051|  26.3k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  26.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3052|       |
 3053|  26.3k|                continue; 
 3054|       |
 3055|  59.3k|            case LEX_DOCTYPE:  /* seen <!d so look for '>' munging whitespace */
  ------------------
  |  Branch (3055:13): [True: 59.3k, False: 252M]
  ------------------
 3056|       |
 3057|       |                /* use ParseDocTypeDecl() to tokenize doctype declaration */
 3058|  59.3k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  59.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  59.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3059|  59.3k|                lexer->lexsize -= 1;
 3060|  59.3k|                lexer->token = ParseDocTypeDecl(doc);
 3061|       |
 3062|  59.3k|                lexer->txtend = lexer->lexsize;
 3063|  59.3k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3064|  59.3k|                lexer->state = LEX_CONTENT;
 3065|  59.3k|                lexer->waswhite = no;
 3066|       |
 3067|       |                /* make a note of the version named by the 1st doctype */
 3068|  59.3k|                if (lexer->doctype == VERS_UNKNOWN && lexer->token && !cfgBool(doc, TidyXmlTags))
  ------------------
  |  |  204|   118k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  59.3k|#define xxxx                   0u
  |  |  ------------------
  ------------------
                              if (lexer->doctype == VERS_UNKNOWN && lexer->token && !cfgBool(doc, TidyXmlTags))
  ------------------
  |  |  418|  16.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  16.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (3068:21): [True: 47.7k, False: 11.5k]
  |  Branch (3068:55): [True: 16.2k, False: 31.5k]
  |  Branch (3068:71): [True: 16.2k, False: 0]
  ------------------
 3069|  16.2k|                {
 3070|  16.2k|                    lexer->doctype = FindGivenVersion(doc, lexer->token);
 3071|  16.2k|                    if (lexer->doctype != VERS_HTML5)
  ------------------
  |  |  213|  16.2k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  16.2k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  16.2k|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (3071:25): [True: 16.0k, False: 184]
  ------------------
 3072|  16.0k|                    {
 3073|       |                        /*\
 3074|       |                         *  Back to legacy HTML4 mode for -
 3075|       |                         *  Issue #167 & #169 - TidyTag_A
 3076|       |                         *  Issue #196        - TidyTag_CAPTION
 3077|       |                         *  others?
 3078|       |                        \*/ 
 3079|  16.0k|                        TY_(AdjustTags)(doc); /* Dynamically modify the tags table  */
  ------------------
  |  |   23|  16.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3080|  16.0k|                    }
 3081|  16.2k|                }
 3082|  59.3k|                node = lexer->token;
 3083|  59.3k|                GTDBG(doc,"doctype", node);
 3084|  59.3k|                return node;
 3085|       |
 3086|  37.5M|            case LEX_PROCINSTR:  /* seen <? so look for '>' */
  ------------------
  |  Branch (3086:13): [True: 37.5M, False: 214M]
  ------------------
 3087|       |                /* check for PHP preprocessor instructions <?php ... ?> */
 3088|       |
 3089|  37.5M|                if  (lexer->lexsize - lexer->txtstart == 3)
  ------------------
  |  Branch (3089:22): [True: 26.5k, False: 37.5M]
  ------------------
 3090|  26.5k|                {
 3091|  26.5k|                    if (TY_(tmbstrncmp)(lexer->lexbuf + lexer->txtstart, "php", 3) == 0)
  ------------------
  |  |   23|  26.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3091:25): [True: 404, False: 26.1k]
  ------------------
 3092|    404|                    {
 3093|    404|                        lexer->state = LEX_PHP;
 3094|    404|                        continue;
 3095|    404|                    }
 3096|  26.5k|                }
 3097|       |
 3098|  37.5M|                if  (lexer->lexsize - lexer->txtstart == 4)
  ------------------
  |  Branch (3098:22): [True: 24.6k, False: 37.5M]
  ------------------
 3099|  24.6k|                {
 3100|  24.6k|                    if (TY_(tmbstrncmp)(lexer->lexbuf + lexer->txtstart, "xml", 3) == 0 &&
  ------------------
  |  |   23|  24.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3100:25): [True: 22.0k, False: 2.64k]
  ------------------
 3101|  22.0k|                        TY_(IsWhite)(lexer->lexbuf[lexer->txtstart + 3]))
  ------------------
  |  |   23|  22.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3101:25): [True: 20.6k, False: 1.34k]
  ------------------
 3102|  20.6k|                    {
 3103|  20.6k|                        lexer->state = LEX_XMLDECL;
 3104|  20.6k|                        attributes = NULL;
 3105|  20.6k|                        continue;
 3106|  20.6k|                    }
 3107|  24.6k|                }
 3108|       |
 3109|  37.5M|                if (cfgBool(doc, TidyXmlPIs) || lexer->isvoyager) /* insist on ?> as terminator */
  ------------------
  |  |  418|  75.1M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  37.5M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 37.5M]
  |  |  ------------------
  ------------------
  |  Branch (3109:49): [True: 3.43k, False: 37.5M]
  ------------------
 3110|  3.43k|                {
 3111|  3.43k|                    if (c != '?')
  ------------------
  |  Branch (3111:25): [True: 3.13k, False: 299]
  ------------------
 3112|  3.13k|                        continue;
 3113|       |
 3114|       |                    /* now look for '>' */
 3115|    299|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    299|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    299|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3116|       |
 3117|    299|                    if (c == EndOfStream)
  ------------------
  |  | 1064|    299|#define EndOfStream (~0u)
  ------------------
  |  Branch (3117:25): [True: 5, False: 294]
  ------------------
 3118|      5|                    {
 3119|      5|                        TY_(Report)(doc, NULL, NULL, UNEXPECTED_END_OF_FILE );
  ------------------
  |  |   23|      5|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      5|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3120|      5|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      5|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      5|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3121|      5|                        continue;
 3122|      5|                    }
 3123|       |
 3124|    294|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|    294|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    294|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3125|    294|                }
 3126|       |
 3127|       |
 3128|  37.5M|                if (c != '>')
  ------------------
  |  Branch (3128:21): [True: 37.4M, False: 95.1k]
  ------------------
 3129|  37.4M|                    continue;
 3130|       |
 3131|  95.1k|                lexer->lexsize -= 1;
 3132|       |
 3133|  95.1k|                if (lexer->lexsize)
  ------------------
  |  Branch (3133:21): [True: 93.1k, False: 1.98k]
  ------------------
 3134|  93.1k|                {
 3135|  93.1k|                    uint i;
 3136|  93.1k|                    Bool closed;
 3137|       |
 3138|   177k|                    for (i = 0; i < lexer->lexsize - lexer->txtstart &&
  ------------------
  |  Branch (3138:33): [True: 86.0k, False: 91.0k]
  ------------------
 3139|  86.0k|                        !TY_(IsWhite)(lexer->lexbuf[i + lexer->txtstart]); ++i)
  ------------------
  |  |   23|  86.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  86.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3139:25): [True: 83.9k, False: 2.10k]
  ------------------
 3140|  83.9k|                        /**/;
 3141|       |
 3142|  93.1k|                    closed = lexer->lexbuf[lexer->lexsize - 1] == '?';
 3143|       |
 3144|  93.1k|                    if (closed)
  ------------------
  |  Branch (3144:25): [True: 3.61k, False: 89.5k]
  ------------------
 3145|  3.61k|                        lexer->lexsize -= 1;
 3146|       |
 3147|  93.1k|                    lexer->txtstart += i;
 3148|  93.1k|                    lexer->txtend = lexer->lexsize;
 3149|  93.1k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3150|       |
 3151|  93.1k|                    lexer->token = PIToken(doc);
  ------------------
  |  | 1613|  93.1k|#define PIToken(doc)      NewToken(doc, ProcInsTag)
  ------------------
 3152|  93.1k|                    lexer->token->closed = closed;
 3153|  93.1k|                    lexer->token->element = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  93.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  93.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3154|  93.1k|                                                            lexer->lexbuf +
 3155|  93.1k|                                                            lexer->txtstart - i, i);
 3156|  93.1k|                }
 3157|  1.98k|                else
 3158|  1.98k|                {
 3159|  1.98k|                    lexer->txtend = lexer->lexsize;
 3160|  1.98k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3161|  1.98k|                    lexer->token = PIToken(doc);
  ------------------
  |  | 1613|  1.98k|#define PIToken(doc)      NewToken(doc, ProcInsTag)
  ------------------
 3162|  1.98k|                }
 3163|       |
 3164|  95.1k|                lexer->state = LEX_CONTENT;
 3165|  95.1k|                lexer->waswhite = no;
 3166|  95.1k|                node = lexer->token;
 3167|  95.1k|                GTDBG(doc,"procinstr", node);
 3168|  95.1k|                return node;
 3169|       |
 3170|  1.08M|            case LEX_ASP:  /* seen <% so look for "%>" */
  ------------------
  |  Branch (3170:13): [True: 1.08M, False: 251M]
  ------------------
 3171|  1.08M|                if (c != '%')
  ------------------
  |  Branch (3171:21): [True: 1.08M, False: 3.58k]
  ------------------
 3172|  1.08M|                    continue;
 3173|       |
 3174|       |                /* now look for '>' */
 3175|  3.58k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  3.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3176|       |
 3177|       |
 3178|  3.58k|                if (c != '>')
  ------------------
  |  Branch (3178:21): [True: 1.13k, False: 2.45k]
  ------------------
 3179|  1.13k|                {
 3180|  1.13k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3181|  1.13k|                    continue;
 3182|  1.13k|                }
 3183|       |
 3184|  2.45k|                lexer->lexsize -= 1;
 3185|  2.45k|                lexer->txtend = lexer->lexsize;
 3186|  2.45k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3187|  2.45k|                lexer->state = LEX_CONTENT;
 3188|  2.45k|                lexer->waswhite = no;
 3189|  2.45k|                lexer->token = AspToken(doc);
  ------------------
  |  | 1614|  2.45k|#define AspToken(doc)     NewToken(doc, AspTag)
  ------------------
 3190|  2.45k|                node = lexer->token;
 3191|  2.45k|                GTDBG(doc,"ASP", node);
 3192|  2.45k|                return node;  /* the endtag token */
 3193|       |
 3194|       |
 3195|       |
 3196|  2.96M|            case LEX_JSTE:  /* seen <# so look for "#>" */
  ------------------
  |  Branch (3196:13): [True: 2.96M, False: 249M]
  ------------------
 3197|  2.96M|                if (c != '#')
  ------------------
  |  Branch (3197:21): [True: 2.95M, False: 4.57k]
  ------------------
 3198|  2.95M|                    continue;
 3199|       |
 3200|       |                /* now look for '>' */
 3201|  4.57k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  4.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3202|       |
 3203|       |
 3204|  4.57k|                if (c != '>')
  ------------------
  |  Branch (3204:21): [True: 469, False: 4.11k]
  ------------------
 3205|    469|                {
 3206|    469|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    469|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    469|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3207|    469|                    continue;
 3208|    469|                }
 3209|       |
 3210|  4.11k|                lexer->lexsize -= 1;
 3211|  4.11k|                lexer->txtend = lexer->lexsize;
 3212|  4.11k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3213|  4.11k|                lexer->state = LEX_CONTENT;
 3214|  4.11k|                lexer->waswhite = no;
 3215|  4.11k|                lexer->token = JsteToken(doc);
  ------------------
  |  | 1615|  4.11k|#define JsteToken(doc)    NewToken(doc, JsteTag)
  ------------------
 3216|  4.11k|                node = lexer->token;
 3217|  4.11k|                GTDBG(doc,"JSTE", node);
 3218|  4.11k|                return node;  /* the JSTE token */
 3219|       |
 3220|       |
 3221|  2.37k|            case LEX_PHP: /* seen "<?php" so look for "?>" */
  ------------------
  |  Branch (3221:13): [True: 2.37k, False: 252M]
  ------------------
 3222|  2.37k|                if (c != '?')
  ------------------
  |  Branch (3222:21): [True: 1.54k, False: 835]
  ------------------
 3223|  1.54k|                    continue;
 3224|       |
 3225|       |                /* now look for '>' */
 3226|    835|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    835|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    835|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3227|       |
 3228|    835|                if (c != '>')
  ------------------
  |  Branch (3228:21): [True: 464, False: 371]
  ------------------
 3229|    464|                {
 3230|    464|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    464|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    464|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3231|    464|                    continue;
 3232|    464|                }
 3233|       |
 3234|    371|                lexer->lexsize -= 1;
 3235|    371|                lexer->txtend = lexer->lexsize;
 3236|    371|                lexer->lexbuf[lexer->lexsize] = '\0';
 3237|    371|                lexer->state = LEX_CONTENT;
 3238|    371|                lexer->waswhite = no;
 3239|    371|                lexer->token = PhpToken(doc);
  ------------------
  |  | 1616|    371|#define PhpToken(doc)     NewToken(doc, PhpTag)
  ------------------
 3240|    371|                node = lexer->token;
 3241|    371|                GTDBG(doc,"PHP", node);
 3242|    371|                return node;  /* the PHP token */
 3243|       |
 3244|  56.7k|            case LEX_XMLDECL: /* seen "<?xml" so look for "?>" */
  ------------------
  |  Branch (3244:13): [True: 56.7k, False: 252M]
  ------------------
 3245|       |
 3246|  56.7k|                if (TY_(IsWhite)(c) && c != '?')
  ------------------
  |  |   23|  56.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  56.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3246:21): [True: 28.6k, False: 28.0k]
  |  Branch (3246:40): [True: 28.6k, False: 0]
  ------------------
 3247|  28.6k|                    continue;
 3248|       |
 3249|       |                /* get pseudo-attribute */
 3250|  28.0k|                if (c != '?')
  ------------------
  |  Branch (3250:21): [True: 27.3k, False: 755]
  ------------------
 3251|  27.3k|                {
 3252|  27.3k|                    tmbstr name;
 3253|  27.3k|                    Node *asp, *php;
 3254|  27.3k|                    AttVal *av = NULL;
 3255|  27.3k|                    int pdelim = 0;
 3256|  27.3k|                    isempty = no;
 3257|       |
 3258|  27.3k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  27.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3259|       |
 3260|  27.3k|                    name = ParseAttribute( doc, &isempty, &asp, &php );
 3261|       |
 3262|  27.3k|                    if (!name)
  ------------------
  |  Branch (3262:25): [True: 19.5k, False: 7.81k]
  ------------------
 3263|  19.5k|                    {
 3264|       |                        /* check if attributes are created by ASP markup */
 3265|  19.5k|                        if (asp)
  ------------------
  |  Branch (3265:29): [True: 3.75k, False: 15.7k]
  ------------------
 3266|  3.75k|                        {
 3267|  3.75k|                            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  3.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3268|  3.75k|                            av->asp = asp;
 3269|  3.75k|                            AddAttrToList( &attributes, av ); 
 3270|  3.75k|                        }
 3271|       |
 3272|       |                        /* check if attributes are created by PHP markup */
 3273|  19.5k|                        if (php)
  ------------------
  |  Branch (3273:29): [True: 3.06k, False: 16.4k]
  ------------------
 3274|  3.06k|                        {
 3275|  3.06k|                            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  3.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3276|  3.06k|                            av->php = php;
 3277|  3.06k|                            AddAttrToList( &attributes, av ); 
 3278|  3.06k|                        }
 3279|       |                      
 3280|       |                        /* fix for http://tidy.sf.net/bug/788031 */
 3281|  19.5k|                        lexer->lexsize -= 1;
 3282|  19.5k|                        lexer->txtend = lexer->txtstart;
 3283|  19.5k|                        lexer->lexbuf[lexer->txtend] = '\0';
 3284|  19.5k|                        lexer->state = LEX_CONTENT;
 3285|  19.5k|                        lexer->waswhite = no;
 3286|  19.5k|                        lexer->token = XmlDeclToken(doc);
  ------------------
  |  | 1617|  19.5k|#define XmlDeclToken(doc) NewToken(doc, XmlDecl)
  ------------------
 3287|  19.5k|                        lexer->token->attributes = attributes;
 3288|  19.5k|                        node = lexer->token;
 3289|  19.5k|                        GTDBG(doc,"xml", node);
 3290|  19.5k|                        return node;  /* the xml token */
 3291|  19.5k|                    }
 3292|       |
 3293|  7.81k|                    av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  7.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3294|  7.81k|                    av->attribute = name;
 3295|  7.81k|                    av->value = ParseValue( doc, name, yes, &isempty, &pdelim );
 3296|  7.81k|                    av->delim = pdelim;
 3297|  7.81k|                    av->dict = TY_(FindAttribute)( doc, av );
  ------------------
  |  |   23|  7.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3298|       |
 3299|  7.81k|                    AddAttrToList( &attributes, av );
 3300|       |                    /* continue; */
 3301|  7.81k|                }
 3302|       |
 3303|       |                /* now look for '>' */
 3304|  8.56k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  8.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3305|       |
 3306|  8.56k|                if (c != '>')
  ------------------
  |  Branch (3306:21): [True: 7.48k, False: 1.07k]
  ------------------
 3307|  7.48k|                {
 3308|  7.48k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  7.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3309|  7.48k|                    continue;
 3310|  7.48k|                }
 3311|  1.07k|                lexer->lexsize -= 1;
 3312|  1.07k|                lexer->txtend = lexer->txtstart;
 3313|  1.07k|                lexer->lexbuf[lexer->txtend] = '\0';
 3314|  1.07k|                lexer->state = LEX_CONTENT;
 3315|  1.07k|                lexer->waswhite = no;
 3316|  1.07k|                lexer->token = XmlDeclToken(doc);
  ------------------
  |  | 1617|  1.07k|#define XmlDeclToken(doc) NewToken(doc, XmlDecl)
  ------------------
 3317|  1.07k|                lexer->token->attributes = attributes;
 3318|  1.07k|                node = lexer->token;
 3319|  1.07k|                GTDBG(doc,"XML", node);
 3320|  1.07k|                return node;  /* the XML token */
 3321|       |
 3322|  48.3M|            case LEX_SECTION: /* seen "<![" so look for "]>" */
  ------------------
  |  Branch (3322:13): [True: 48.3M, False: 203M]
  ------------------
 3323|  48.3M|                if (c == '[')
  ------------------
  |  Branch (3323:21): [True: 17.2k, False: 48.3M]
  ------------------
 3324|  17.2k|                {
 3325|  17.2k|                    if (lexer->lexsize == (lexer->txtstart + 6) &&
  ------------------
  |  Branch (3325:25): [True: 13.1k, False: 4.11k]
  ------------------
 3326|  13.1k|                        TY_(tmbstrncmp)(lexer->lexbuf+lexer->txtstart, "CDATA[", 6) == 0)
  ------------------
  |  |   23|  13.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3326:25): [True: 1.86k, False: 11.2k]
  ------------------
 3327|  1.86k|                    {
 3328|  1.86k|                        lexer->state = LEX_CDATA;
 3329|  1.86k|                        lexer->lexsize -= 6;
 3330|  1.86k|                        continue;
 3331|  1.86k|                    }
 3332|  17.2k|                }
 3333|       |
 3334|  48.3M|                if (c == '>')
  ------------------
  |  Branch (3334:21): [True: 4.10k, False: 48.3M]
  ------------------
 3335|  4.10k|                {
 3336|       |                    /* Is. #462 - reached '>' before ']' */
 3337|  4.10k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  4.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3338|  48.3M|                } else if (c != ']')
  ------------------
  |  Branch (3338:28): [True: 48.3M, False: 14.2k]
  ------------------
 3339|  48.3M|                    continue;
 3340|       |
 3341|       |                /* now look for '>' */
 3342|  18.3k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  18.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3343|       |
 3344|  18.3k|                lexdump = 1;
 3345|  18.3k|                if (c != '>')
  ------------------
  |  Branch (3345:21): [True: 3.27k, False: 15.0k]
  ------------------
 3346|  3.27k|                {
 3347|       |                    /* Issue #153 - can also be ]'-->' */
 3348|  3.27k|                    if (c == '-') 
  ------------------
  |  Branch (3348:25): [True: 940, False: 2.33k]
  ------------------
 3349|    940|                    {
 3350|    940|                        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    940|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    940|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3351|    940|                        if (c == '-')
  ------------------
  |  Branch (3351:29): [True: 456, False: 484]
  ------------------
 3352|    456|                        {
 3353|    456|                            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    456|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    456|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3354|    456|                            if (c != '>')
  ------------------
  |  Branch (3354:33): [True: 236, False: 220]
  ------------------
 3355|    236|                            {
 3356|    236|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    236|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    236|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3357|    236|                                TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|    236|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    236|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3358|    236|                                TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|    236|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    236|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3359|    236|                                continue;
 3360|    236|                            }
 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|    456|                        }
 3366|    484|                        else
 3367|    484|                        {
 3368|    484|                            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    484|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    484|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3369|    484|                            TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|    484|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    484|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3370|    484|                            continue;
 3371|    484|                        }
 3372|    940|                    } 
 3373|  2.33k|                    else 
 3374|  2.33k|                    {
 3375|  2.33k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  2.33k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.33k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3376|  2.33k|                        continue;
 3377|  2.33k|                    }
 3378|  3.27k|                }
 3379|       | 
 3380|  15.2k|                lexer->lexsize -= lexdump;
 3381|  15.2k|                lexer->txtend = lexer->lexsize;
 3382|  15.2k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3383|  15.2k|                lexer->state = LEX_CONTENT;
 3384|  15.2k|                lexer->waswhite = no;
 3385|  15.2k|                lexer->token = SectionToken(doc);
  ------------------
  |  | 1618|  15.2k|#define SectionToken(doc) NewToken(doc, SectionTag)
  ------------------
 3386|  15.2k|                node = lexer->token;
 3387|  15.2k|                GTDBG(doc,"SECTION", node);
 3388|  15.2k|                return node;  /* the SECTION token */
 3389|       |
 3390|  67.4k|            case LEX_CDATA: /* seen "<![CDATA[" so look for "]]>" */
  ------------------
  |  Branch (3390:13): [True: 67.4k, False: 252M]
  ------------------
 3391|  67.4k|                if (c != ']')
  ------------------
  |  Branch (3391:21): [True: 64.3k, False: 3.09k]
  ------------------
 3392|  64.3k|                    continue;
 3393|       |
 3394|       |                /* now look for ']' */
 3395|  3.09k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  3.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3396|       |
 3397|  3.09k|                if (c != ']')
  ------------------
  |  Branch (3397:21): [True: 360, False: 2.73k]
  ------------------
 3398|    360|                {
 3399|    360|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    360|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    360|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3400|    360|                    continue;
 3401|    360|                }
 3402|       |
 3403|       |                /* now look for '>' */
 3404|  2.73k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  2.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3405|       |
 3406|  2.73k|                if (c != '>')
  ------------------
  |  Branch (3406:21): [True: 914, False: 1.81k]
  ------------------
 3407|    914|                {
 3408|    914|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    914|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    914|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3409|    914|                    TY_(UngetChar)(']', doc->docIn);
  ------------------
  |  |   23|    914|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    914|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3410|    914|                    continue;
 3411|    914|                }
 3412|       |
 3413|  1.81k|                lexer->lexsize -= 1;
 3414|  1.81k|                lexer->txtend = lexer->lexsize;
 3415|  1.81k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3416|  1.81k|                lexer->state = LEX_CONTENT;
 3417|  1.81k|                lexer->waswhite = no;
 3418|  1.81k|                lexer->token = CDATAToken(doc);
  ------------------
  |  | 1619|  1.81k|#define CDATAToken(doc)   NewToken(doc, CDATATag)
  ------------------
 3419|  1.81k|                node = lexer->token;
 3420|  1.81k|                GTDBG(doc,"CDATA", node);
 3421|  1.81k|                return node;  /* the CDATA token */
 3422|   252M|        }
 3423|   252M|    }
 3424|       |
 3425|  1.72M|    if (lexer->state == LEX_CONTENT)  /* text string */
  ------------------
  |  Branch (3425:9): [True: 1.63M, False: 85.3k]
  ------------------
 3426|  1.63M|    {
 3427|  1.63M|        lexer->txtend = lexer->lexsize;
 3428|       |
 3429|  1.63M|        if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3429:13): [True: 4.04k, False: 1.63M]
  ------------------
 3430|  4.04k|        {
 3431|  4.04k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  4.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3432|       |
 3433|  4.04k|            if (lexer->lexbuf[lexer->lexsize - 1] == ' ')
  ------------------
  |  Branch (3433:17): [True: 345, False: 3.70k]
  ------------------
 3434|    345|            {
 3435|    345|                lexer->lexsize -= 1;
 3436|    345|                lexer->txtend = lexer->lexsize;
 3437|    345|            }
 3438|  4.04k|            lexer->token = TY_(TextToken)(lexer);
  ------------------
  |  |   23|  4.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3439|  4.04k|            node = lexer->token;
 3440|  4.04k|            GTDBG(doc,"textstring", node);
 3441|  4.04k|            return node;  /* the textstring token */
 3442|  4.04k|        }
 3443|  1.63M|    }
 3444|  85.3k|    else if (lexer->state == LEX_COMMENT) /* comment */
  ------------------
  |  Branch (3444:14): [True: 159, False: 85.1k]
  ------------------
 3445|    159|    {
 3446|    159|        if (c == EndOfStream)
  ------------------
  |  | 1064|    159|#define EndOfStream (~0u)
  ------------------
  |  Branch (3446:13): [True: 159, False: 0]
  ------------------
 3447|    159|        {
 3448|       |            /* We print this if we reached end of the stream mid-comment. */
 3449|    159|            TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_EOS );
  ------------------
  |  |   23|    159|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    159|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3450|    159|        }
 3451|       |
 3452|    159|        lexer->txtend = lexer->lexsize;
 3453|    159|        lexer->lexbuf[lexer->lexsize] = '\0';
 3454|    159|        lexer->state = LEX_CONTENT;
 3455|    159|        lexer->waswhite = no;
 3456|    159|        lexer->token = CommentToken(doc);
  ------------------
  |  | 1611|    159|#define CommentToken(doc) NewToken(doc, CommentTag)
  ------------------
 3457|    159|        node = lexer->token;
 3458|    159|        GTDBG(doc,"COMMENT", node);
 3459|    159|        return node;  /* the COMMENT token */
 3460|    159|    }
 3461|       |
 3462|       |    /* check attributes before return NULL */
 3463|  1.71M|    if (attributes)
  ------------------
  |  Branch (3463:9): [True: 55, False: 1.71M]
  ------------------
 3464|     55|        TY_(FreeAttribute)( doc, attributes );
  ------------------
  |  |   23|     55|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     55|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3465|       |
 3466|  1.71M|    DEBUG_LOG(SPRTF("Returning NULL...\n"));
 3467|       |    return NULL;
 3468|  1.72M|}
lexer.c:ChangeChar:
  966|   976k|{
  967|   976k|    if ( lexer->lexsize > 0 )
  ------------------
  |  Branch (967:10): [True: 976k, False: 0]
  ------------------
  968|   976k|    {
  969|   976k|        lexer->lexbuf[ lexer->lexsize-1 ] = c;
  970|   976k|    }
  971|   976k|}
lexer.c:ParseEntity:
 1157|   220k|{
 1158|   220k|    typedef enum
 1159|   220k|    {
 1160|   220k|        ENT_default,
 1161|   220k|        ENT_numdec,
 1162|   220k|        ENT_numhex
 1163|   220k|    } ENTState;
 1164|       |    
 1165|   220k|    typedef Bool (*ENTfn)(uint);
 1166|   220k|    const ENTfn entFn[] = {
 1167|   220k|        TY_(IsNamechar),
  ------------------
  |  |   23|   220k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   220k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1168|   220k|        TY_(IsDigit),
  ------------------
  |  |   23|   220k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   220k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1169|   220k|        IsDigitHex
 1170|   220k|    };
 1171|   220k|    uint start;
 1172|   220k|    ENTState entState = ENT_default;
 1173|   220k|    uint charRead = 0;
 1174|   220k|    Bool semicolon = no, found = no;
 1175|   220k|    Bool isXml = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|   220k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   220k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1176|   220k|    Bool preserveEntities = cfgBool( doc, TidyPreserveEntities );
  ------------------
  |  |  418|   220k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   220k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1177|   220k|    uint c, ch, startcol, entver = 0;
 1178|   220k|    Lexer* lexer = doc->lexer;
 1179|       |
 1180|   220k|    start = lexer->lexsize - 1;  /* to start at "&" */
 1181|   220k|    startcol = doc->docIn->curcol - 1;
 1182|       |
 1183|  2.78M|    while ( (c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  |   23|  2.78M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.78M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ( (c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  | 1064|  2.78M|#define EndOfStream (~0u)
  ------------------
  |  Branch (1183:13): [True: 2.78M, False: 498]
  ------------------
 1184|  2.78M|    {
 1185|  2.78M|        if ( c == ';' )
  ------------------
  |  Branch (1185:14): [True: 7.49k, False: 2.77M]
  ------------------
 1186|  7.49k|        {
 1187|  7.49k|            semicolon = yes;
 1188|  7.49k|            break;
 1189|  7.49k|        }
 1190|  2.77M|        ++charRead;
 1191|       |
 1192|  2.77M|        if (charRead == 1 && c == '#')
  ------------------
  |  Branch (1192:13): [True: 219k, False: 2.55M]
  |  Branch (1192:30): [True: 155k, False: 63.6k]
  ------------------
 1193|   155k|        {
 1194|   155k|            if ( !cfgBool(doc, TidyNCR) ||
  ------------------
  |  |  418|   310k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   155k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1194:18): [True: 0, False: 155k]
  ------------------
 1195|   155k|                 cfg(doc, TidyInCharEncoding) == BIG5 ||
  ------------------
  |  |  415|   155k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                               cfg(doc, TidyInCharEncoding) == BIG5 ||
  ------------------
  |  |  145|   310k|#define BIG5        12
  ------------------
  |  Branch (1195:18): [True: 0, False: 155k]
  ------------------
 1196|   155k|                 cfg(doc, TidyInCharEncoding) == SHIFTJIS )
  ------------------
  |  |  415|   155k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                               cfg(doc, TidyInCharEncoding) == SHIFTJIS )
  ------------------
  |  |  146|   155k|#define SHIFTJIS    13
  ------------------
  |  Branch (1196:18): [True: 0, False: 155k]
  ------------------
 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|   155k|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|   155k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   155k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1203|   155k|            entState = ENT_numdec;
 1204|   155k|            continue;
 1205|   155k|        }
 1206|  2.62M|        else if (charRead == 2 && entState == ENT_numdec
  ------------------
  |  Branch (1206:18): [True: 171k, False: 2.44M]
  |  Branch (1206:35): [True: 155k, False: 16.5k]
  ------------------
 1207|   155k|                 && (c == 'x' || (!isXml && c == 'X')) )
  ------------------
  |  Branch (1207:22): [True: 32.2k, False: 123k]
  |  Branch (1207:35): [True: 123k, False: 0]
  |  Branch (1207:45): [True: 117k, False: 5.74k]
  ------------------
 1208|   149k|        {
 1209|   149k|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|   149k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   149k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1210|   149k|            entState = ENT_numhex;
 1211|   149k|            continue;
 1212|   149k|        }
 1213|       |
 1214|  2.47M|        if ( entFn[entState](c) )
  ------------------
  |  Branch (1214:14): [True: 2.25M, False: 212k]
  ------------------
 1215|  2.25M|        {
 1216|  2.25M|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|  2.25M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.25M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1217|  2.25M|            continue;
 1218|  2.25M|        }
 1219|       |
 1220|       |        /* otherwise put it back */
 1221|   212k|        TY_(UngetChar)( c, doc->docIn );
  ------------------
  |  |   23|   212k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   212k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1222|   212k|        break;
 1223|  2.47M|    }
 1224|       |
 1225|       |    /* make sure entity is NULL terminated */
 1226|   220k|    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|   220k|    if ( TY_(tmbstrcmp)(lexer->lexbuf+start, "&apos") == 0
  ------------------
  |  |   23|   220k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   220k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1232:10): [True: 212, False: 220k]
  ------------------
 1233|    212|         && !cfgBool(doc, TidyXmlOut)
  ------------------
  |  |  418|   220k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    212|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1233:13): [True: 0, False: 212]
  ------------------
 1234|      0|         && !lexer->isvoyager
  ------------------
  |  Branch (1234:13): [True: 0, False: 0]
  ------------------
 1235|      0|         && !cfgBool(doc, TidyXhtmlOut)
  ------------------
  |  |  418|   220k|#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|   220k|    if (( mode == OtherNamespace ) && ( c == ';' ))
  ------------------
  |  Branch (1239:9): [True: 2.25k, False: 218k]
  |  Branch (1239:39): [True: 1.07k, False: 1.17k]
  ------------------
 1240|  1.07k|    {
 1241|       |        /* #130 MathML attr and entity fix! */
 1242|  1.07k|        found = yes;
 1243|  1.07k|        ch = 255;
 1244|  1.07k|        entver = XH50|HT50;
  ------------------
  |  |  201|  1.07k|#define XH50              262144u
  ------------------
                      entver = XH50|HT50;
  ------------------
  |  |  200|  1.07k|#define HT50              131072u
  ------------------
 1245|  1.07k|        preserveEntities = yes;
 1246|  1.07k|    }
 1247|   219k|    else
 1248|   219k|    {
 1249|       |        /* Lookup entity code and version
 1250|       |        */
 1251|   219k|        found = TY_(EntityInfo)( lexer->lexbuf+start, isXml, &ch, &entver );
  ------------------
  |  |   23|   219k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   219k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1252|   219k|    }
 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|   220k|    if (!preserveEntities && found && TY_(IsLowSurrogate)(ch))
  ------------------
  |  |   23|  54.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  54.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1258:9): [True: 219k, False: 1.07k]
  |  Branch (1258:30): [True: 54.8k, False: 164k]
  |  Branch (1258:39): [True: 38.0k, False: 16.7k]
  ------------------
 1259|  38.0k|    {
 1260|  38.0k|        uint c1;
 1261|  38.0k|        if ((c1 = TY_(ReadChar)(doc->docIn)) == '&')
  ------------------
  |  |   23|  38.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1261:13): [True: 36.8k, False: 1.23k]
  ------------------
 1262|  36.8k|        {
 1263|  36.8k|            SPStatus status;
 1264|       |            /* Have a following entity, 
 1265|       |               so there is a chance of having a valid surrogate pair */
 1266|  36.8k|            c1 = ch;    /* keep first value, in case of error */
 1267|  36.8k|            status = GetSurrogatePair(doc, isXml, &ch);
 1268|  36.8k|            if (status == SP_error)
  ------------------
  |  Branch (1268:17): [True: 36.4k, False: 390]
  ------------------
 1269|  36.4k|            {
 1270|  36.4k|                TY_(ReportSurrogateError)(doc, BAD_SURROGATE_TAIL, c1, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|  36.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1271|  36.4k|                TY_(UngetChar)('&', doc->docIn);  /* otherwise put it back */
  ------------------
  |  |   23|  36.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1272|  36.4k|            }
 1273|  36.8k|        }
 1274|  1.23k|        else
 1275|  1.23k|        {
 1276|       |            /* put this non-entity lead char back */
 1277|  1.23k|            TY_(UngetChar)(c1, doc->docIn);
  ------------------
  |  |   23|  1.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1278|       |            /* Have leading surrogate pair, with no tail */
 1279|  1.23k|            TY_(ReportSurrogateError)(doc, BAD_SURROGATE_TAIL, ch, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|  1.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1280|  1.23k|            ch = 0xFFFD;
 1281|  1.23k|        }
 1282|  38.0k|    } 
 1283|   182k|    else if (!preserveEntities && found && TY_(IsHighSurrogate)(ch))
  ------------------
  |  |   23|  16.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1283:14): [True: 181k, False: 1.07k]
  |  Branch (1283:35): [True: 16.7k, False: 164k]
  |  Branch (1283:44): [True: 455, False: 16.3k]
  ------------------
 1284|    455|    {
 1285|       |        /* Have trailing surrogate pair, with no lead */
 1286|    455|        TY_(ReportSurrogateError)(doc, BAD_SURROGATE_LEAD, ch, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|    455|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    455|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1287|    455|        ch = 0xFFFD;
 1288|    455|    }
 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|   220k|    if ( !found || (ch >= 128 && ch <= 159) || (ch >= 256 && c != ';') )
  ------------------
  |  Branch (1293:10): [True: 164k, False: 55.9k]
  |  Branch (1293:21): [True: 50.6k, False: 5.27k]
  |  Branch (1293:34): [True: 814, False: 49.8k]
  |  Branch (1293:49): [True: 42.9k, False: 12.1k]
  |  Branch (1293:62): [True: 39.8k, False: 3.13k]
  ------------------
 1294|   205k|    {
 1295|       |        /* set error position just before offending character */
 1296|   205k|        SetLexerLocus( doc, lexer );
 1297|   205k|        lexer->columns = startcol;
 1298|       |
 1299|   205k|        if (lexer->lexsize > start + 1)
  ------------------
  |  Branch (1299:13): [True: 157k, False: 47.2k]
  ------------------
 1300|   157k|        {
 1301|   157k|            if (ch >= 128 && ch <= 159)
  ------------------
  |  Branch (1301:17): [True: 40.6k, False: 117k]
  |  Branch (1301:30): [True: 814, False: 39.8k]
  ------------------
 1302|    814|            {
 1303|       |                /* invalid numeric character reference */
 1304|       |                
 1305|    814|                uint c1 = 0;
 1306|    814|                int replaceMode = DISCARDED_CHAR;
  ------------------
  |  |  314|    814|#define DISCARDED_CHAR          1
  ------------------
 1307|       |            
 1308|       |                /* Always assume Win1252 in this circumstance. */
 1309|    814|                c1 = TY_(DecodeWin1252)( ch );
  ------------------
  |  |   23|    814|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    814|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1310|       |
 1311|    814|                if ( c1 )
  ------------------
  |  Branch (1311:22): [True: 496, False: 318]
  ------------------
 1312|    496|                    replaceMode = REPLACED_CHAR;
  ------------------
  |  |  313|    496|#define REPLACED_CHAR           0
  ------------------
 1313|       |                
 1314|    814|                if ( c != ';' )  /* issue warning if not terminated by ';' */
  ------------------
  |  Branch (1314:22): [True: 620, False: 194]
  ------------------
 1315|    620|                    TY_(ReportEntityError)( doc, MISSING_SEMICOLON_NCR,
  ------------------
  |  |   23|    620|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    620|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1316|    620|                                            lexer->lexbuf+start, c );
 1317|       | 
 1318|    814|                TY_(ReportEncodingError)(doc, INVALID_NCR, ch, replaceMode == DISCARDED_CHAR);
  ------------------
  |  |   23|    814|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    814|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportEncodingError)(doc, INVALID_NCR, ch, replaceMode == DISCARDED_CHAR);
  ------------------
  |  |  314|    814|#define DISCARDED_CHAR          1
  ------------------
 1319|       |                
 1320|    814|                if ( c1 )
  ------------------
  |  Branch (1320:22): [True: 496, False: 318]
  ------------------
 1321|    496|                {
 1322|       |                    /* make the replacement */
 1323|    496|                    lexer->lexsize = start;
 1324|    496|                    TY_(AddCharToLexer)( lexer, c1 );
  ------------------
  |  |   23|    496|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    496|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1325|    496|                    semicolon = no;
 1326|    496|                }
 1327|    318|                else
 1328|    318|                {
 1329|       |                    /* discard */
 1330|    318|                    lexer->lexsize = start;
 1331|    318|                    semicolon = no;
 1332|    318|               }
 1333|       |               
 1334|    814|            }
 1335|   157k|            else
 1336|   157k|                TY_(ReportEntityError)( doc, UNKNOWN_ENTITY,
  ------------------
  |  |   23|   157k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   157k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1337|   157k|                                        lexer->lexbuf+start, ch );
 1338|       |
 1339|   157k|            if (semicolon)
  ------------------
  |  Branch (1339:17): [True: 465, False: 157k]
  ------------------
 1340|    465|                TY_(AddCharToLexer)( lexer, ';' );
  ------------------
  |  |   23|    465|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    465|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1341|   157k|        }
 1342|  47.2k|        else
 1343|  47.2k|        {
 1344|       |            /*\ 
 1345|       |             *  Issue #207 - A naked & is allowed in HTML5, as an unambiguous ampersand!
 1346|       |            \*/
 1347|  47.2k|            if (TY_(HTMLVersion)(doc) != HT50) 
  ------------------
  |  |   23|  47.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  47.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(HTMLVersion)(doc) != HT50) 
  ------------------
  |  |  200|  47.2k|#define HT50              131072u
  ------------------
  |  Branch (1347:17): [True: 47.2k, False: 0]
  ------------------
 1348|  47.2k|            {
 1349|  47.2k|                TY_(ReportEntityError)( doc, UNESCAPED_AMPERSAND,
  ------------------
  |  |   23|  47.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  47.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1350|  47.2k|                                    lexer->lexbuf+start, ch );
 1351|  47.2k|            }
 1352|  47.2k|        }
 1353|   205k|    }
 1354|  15.3k|    else
 1355|  15.3k|    {
 1356|  15.3k|        if ( c != ';' )    /* issue warning if not terminated by ';' */
  ------------------
  |  Branch (1356:14): [True: 8.86k, False: 6.44k]
  ------------------
 1357|  8.86k|        {
 1358|       |            /* set error position just before offending character */
 1359|  8.86k|            SetLexerLocus( doc, lexer );
 1360|  8.86k|            lexer->columns = startcol;
 1361|  8.86k|            TY_(ReportEntityError)( doc, MISSING_SEMICOLON, lexer->lexbuf+start, c );
  ------------------
  |  |   23|  8.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1362|  8.86k|        }
 1363|       |
 1364|  15.3k|        if (preserveEntities)
  ------------------
  |  Branch (1364:13): [True: 1.07k, False: 14.2k]
  ------------------
 1365|  1.07k|            TY_(AddCharToLexer)( lexer, ';' );
  ------------------
  |  |   23|  1.07k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.07k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1366|  14.2k|        else
 1367|  14.2k|        {
 1368|  14.2k|            lexer->lexsize = start;
 1369|  14.2k|            if ( ch == 160 && (mode == Preformatted) )
  ------------------
  |  Branch (1369:18): [True: 5.70k, False: 8.53k]
  |  Branch (1369:31): [True: 225, False: 5.47k]
  ------------------
 1370|    225|                ch = ' ';
 1371|  14.2k|            TY_(AddCharToLexer)( lexer, ch );
  ------------------
  |  |   23|  14.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1372|       |
 1373|  14.2k|            if ( ch == '&' && !cfgBool(doc, TidyQuoteAmpersand) )
  ------------------
  |  |  418|    212|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    212|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1373:18): [True: 212, False: 14.0k]
  |  Branch (1373:31): [True: 0, False: 212]
  ------------------
 1374|      0|                AddStringToLexer( lexer, "amp;" );
 1375|  14.2k|        }
 1376|       |
 1377|       |        /* Detect extended vs. basic entities */
 1378|  15.3k|        TY_(ConstrainVersion)( doc, entver );
  ------------------
  |  |   23|  15.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1379|  15.3k|    }
 1380|   220k|}
lexer.c:IsDigitHex:
  470|   731k|{
  471|   731k|    uint map;
  472|       |
  473|   731k|    map = MAP(c);
  ------------------
  |  |  206|   731k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 727k, False: 3.48k]
  |  |  ------------------
  ------------------
  474|       |
  475|   731k|    return (map & digithex)!=0;
  ------------------
  |  |   75|   731k|#define digithex    128u
  ------------------
  476|   731k|}
lexer.c:GetSurrogatePair:
 1026|  36.8k|{
 1027|  36.8k|    Lexer* lexer = doc->lexer;
 1028|  36.8k|    uint bufSize = 32;
 1029|  36.8k|    uint c, ch = 0, offset = 0;
 1030|  36.8k|    tmbstr buf = 0;
 1031|  36.8k|    SPStatus status = SP_error;  /* assume failed */
 1032|  36.8k|    int type = 0;   /* assume numeric */
 1033|  36.8k|    uint fch = *pch;
 1034|  36.8k|    int i;  /* has to be signed due to for i >= 0 */
 1035|  36.8k|    if (!lexer)
  ------------------
  |  Branch (1035:9): [True: 0, False: 36.8k]
  ------------------
 1036|      0|        return status;
 1037|  36.8k|    buf = (tmbstr)TidyRealloc(lexer->allocator, buf, bufSize);
  ------------------
  |  |   67|  36.8k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
 1038|  36.8k|    if (!buf)
  ------------------
  |  Branch (1038:9): [True: 0, False: 36.8k]
  ------------------
 1039|      0|        return status;
 1040|   358k|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  |   23|   358k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   358k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  | 1064|   358k|#define EndOfStream (~0u)
  ------------------
  |  Branch (1040:12): [True: 358k, False: 88]
  ------------------
 1041|   358k|    {
 1042|   358k|        if (c == ';')
  ------------------
  |  Branch (1042:13): [True: 839, False: 357k]
  ------------------
 1043|    839|        {
 1044|    839|            break;  /* reached end of entity */
 1045|    839|        }
 1046|   357k|        if ((offset + 2) > bufSize)
  ------------------
  |  Branch (1046:13): [True: 371, False: 357k]
  ------------------
 1047|    371|        {
 1048|    371|            bufSize *= 2;
 1049|    371|            buf = (tmbstr)TidyRealloc(lexer->allocator, buf, bufSize);
  ------------------
  |  |   67|    371|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
 1050|    371|            if (!buf)
  ------------------
  |  Branch (1050:17): [True: 0, False: 371]
  ------------------
 1051|      0|            {
 1052|      0|                break;
 1053|      0|            }
 1054|    371|        }
 1055|   357k|        buf[offset++] = c;  /* add char to buffer */
 1056|   357k|        if (offset == 1)
  ------------------
  |  Branch (1056:13): [True: 36.6k, False: 320k]
  ------------------
 1057|  36.6k|        {
 1058|  36.6k|            if (c != '#')   /* is a numeric entity */
  ------------------
  |  Branch (1058:17): [True: 1.10k, False: 35.5k]
  ------------------
 1059|  1.10k|                break;
 1060|  36.6k|        }
 1061|   320k|        else if (offset == 2 && ((c == 'x') || (!isXml && c == 'X')))
  ------------------
  |  Branch (1061:18): [True: 35.5k, False: 285k]
  |  Branch (1061:34): [True: 20.1k, False: 15.3k]
  |  Branch (1061:49): [True: 15.3k, False: 0]
  |  Branch (1061:59): [True: 13.6k, False: 1.70k]
  ------------------
 1062|  33.8k|        {
 1063|  33.8k|            type = 1;   /* set hex digits */
 1064|  33.8k|        }
 1065|   287k|        else
 1066|   287k|        {
 1067|   287k|            if (type)   /* if hex digits */
  ------------------
  |  Branch (1067:17): [True: 283k, False: 3.79k]
  ------------------
 1068|   283k|            {
 1069|   283k|                if (!IsDigitHex(c))
  ------------------
  |  Branch (1069:21): [True: 33.1k, False: 250k]
  ------------------
 1070|  33.1k|                    break;
 1071|   283k|            }
 1072|  3.79k|            else    /* if numeric */
 1073|  3.79k|            {
 1074|  3.79k|                if (!TY_(IsDigit)(c))
  ------------------
  |  |   23|  3.79k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.79k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1074:21): [True: 1.69k, False: 2.09k]
  ------------------
 1075|  1.69k|                    break;
 1076|  3.79k|            }
 1077|   287k|        }
 1078|   357k|    }
 1079|       |
 1080|  36.8k|    if (c == ';')
  ------------------
  |  Branch (1080:9): [True: 839, False: 35.9k]
  ------------------
 1081|    839|    {
 1082|    839|        int scanned;
 1083|       |
 1084|    839|        buf[offset] = 0;
 1085|    839|        if (type)
  ------------------
  |  Branch (1085:13): [True: 644, False: 195]
  ------------------
 1086|    644|            scanned = sscanf(buf + 2, "%x", &ch);
 1087|    195|        else
 1088|    195|            scanned = sscanf(buf + 1, "%d", &ch);
 1089|       |
 1090|    839|        if (scanned == 1 && TY_(IsHighSurrogate)(ch))
  ------------------
  |  |   23|    637|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    637|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1090:13): [True: 637, False: 202]
  |  Branch (1090:29): [True: 390, False: 247]
  ------------------
 1091|    390|        {
 1092|    390|            ch = TY_(CombineSurrogatePair)(ch, fch);
  ------------------
  |  |   23|    390|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    390|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1093|    390|            if (TY_(IsValidCombinedChar)(ch))
  ------------------
  |  |   23|    390|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    390|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1093:17): [True: 194, False: 196]
  ------------------
 1094|    194|            {
 1095|    194|                *pch = ch;  /* return combined pair value */
 1096|    194|                status = SP_ok; /* full success - pair used */
 1097|    194|            }
 1098|    196|            else
 1099|    196|            {
 1100|    196|                status = SP_failed; /* is one of the 32 out-of-range pairs */
 1101|    196|                *pch = 0xFFFD;  /* return substitute character */
 1102|    196|                TY_(ReportSurrogateError)(doc, BAD_SURROGATE_PAIR, fch, ch); /* SP WARNING: -  */
  ------------------
  |  |   23|    196|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    196|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1103|    196|            }
 1104|    390|        }
 1105|    839|    }
 1106|       |
 1107|  36.8k|    if (status == SP_error)
  ------------------
  |  Branch (1107:9): [True: 36.4k, False: 390]
  ------------------
 1108|  36.4k|    {
 1109|       |        /* Error condition - can only put back all the chars */
 1110|  36.4k|        if (c == ';') /* if last, not added to buffer */
  ------------------
  |  Branch (1110:13): [True: 449, False: 35.9k]
  ------------------
 1111|    449|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    449|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    449|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1112|  36.4k|        if (buf && offset)
  ------------------
  |  Branch (1112:13): [True: 36.4k, False: 0]
  |  Branch (1112:20): [True: 36.2k, False: 212]
  ------------------
 1113|  36.2k|        {
 1114|       |            /* correct the order for unget - last first */
 1115|   391k|            for (i = offset - 1; i >= 0; i--)
  ------------------
  |  Branch (1115:34): [True: 355k, False: 36.2k]
  ------------------
 1116|   355k|            {
 1117|   355k|                c = buf[i];
 1118|   355k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   355k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   355k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1119|   355k|            }
 1120|  36.2k|        }
 1121|  36.4k|    }
 1122|       |
 1123|  36.8k|    if (buf)
  ------------------
  |  Branch (1123:9): [True: 36.8k, False: 0]
  ------------------
 1124|  36.8k|        TidyFree(lexer->allocator, buf);
  ------------------
  |  |   68|  36.8k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 1125|       |
 1126|  36.8k|    return status;
 1127|  36.8k|}
lexer.c:ParseTagName:
 1383|  1.02M|{
 1384|  1.02M|    Lexer *lexer = doc->lexer;
 1385|  1.02M|    uint c = lexer->lexbuf[ lexer->txtstart ];
 1386|  1.02M|    Bool xml = cfgBool(doc, TidyXmlTags);
  ------------------
  |  |  418|  1.02M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.02M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1387|       |
 1388|       |    /* fold case of first character in buffer */
 1389|  1.02M|    if (!xml && TY_(IsUpper)(c))
  ------------------
  |  |   23|  1.02M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1389:9): [True: 1.02M, False: 0]
  |  Branch (1389:17): [True: 491k, False: 528k]
  ------------------
 1390|   491k|        lexer->lexbuf[lexer->txtstart] = (tmbchar) TY_(ToLower)(c);
  ------------------
  |  |   23|   491k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   491k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1391|       |
 1392|  7.29M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|  7.29M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.29M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|  7.29M|#define EndOfStream (~0u)
  ------------------
  |  Branch (1392:12): [True: 7.29M, False: 4.83k]
  ------------------
 1393|  7.29M|    {
 1394|  7.29M|        if ((!xml && !TY_(IsNamechar)(c)) ||
  ------------------
  |  |   23|  7.29M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.29M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1394:14): [True: 7.29M, False: 0]
  |  Branch (1394:22): [True: 1.01M, False: 6.27M]
  ------------------
 1395|  6.27M|            (xml && !TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1395:14): [True: 0, False: 6.27M]
  |  Branch (1395:21): [True: 0, False: 0]
  ------------------
 1396|  1.01M|            break;
 1397|       |
 1398|       |        /* fold case of subsequent characters */
 1399|  6.27M|        if (!xml && TY_(IsUpper)(c))
  ------------------
  |  |   23|  6.27M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.27M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1399:13): [True: 6.27M, False: 0]
  |  Branch (1399:21): [True: 1.25M, False: 5.01M]
  ------------------
 1400|  1.25M|             c = TY_(ToLower)(c);
  ------------------
  |  |   23|  1.25M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.25M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1401|       |
 1402|  6.27M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  6.27M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.27M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1403|  6.27M|    }
 1404|       |
 1405|  1.02M|    lexer->txtend = lexer->lexsize;
 1406|  1.02M|    return (tmbchar) c;
 1407|  1.02M|}
lexer.c:TagToken:
 1585|  1.02M|{
 1586|  1.02M|    Lexer* lexer = doc->lexer;
 1587|  1.02M|    Node* node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|  1.02M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1588|  1.02M|    node->type = type;
 1589|  1.02M|    node->element = TY_(tmbstrndup)( doc->allocator,
  ------------------
  |  |   23|  1.02M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1590|  1.02M|                                     lexer->lexbuf + lexer->txtstart,
 1591|  1.02M|                                     lexer->txtend - lexer->txtstart );
 1592|  1.02M|    node->start = lexer->txtstart;
 1593|  1.02M|    node->end = lexer->txtstart;
 1594|       |
 1595|  1.02M|    if ( type == StartTag || type == StartEndTag || type == EndTag )
  ------------------
  |  Branch (1595:10): [True: 938k, False: 82.1k]
  |  Branch (1595:30): [True: 0, False: 82.1k]
  |  Branch (1595:53): [True: 82.1k, False: 0]
  ------------------
 1596|  1.02M|        TY_(FindTag)(doc, node);
  ------------------
  |  |   23|  1.02M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1597|       |
 1598|  1.02M|    return node;
 1599|  1.02M|}
lexer.c:ParseAttrs:
 4200|   347k|{
 4201|   347k|    Lexer* lexer = doc->lexer;
 4202|   347k|    AttVal *av, *list;
 4203|   347k|    tmbstr value;
 4204|   347k|    int delim;
 4205|   347k|    Node *asp, *php;
 4206|       |
 4207|   347k|    list = NULL;
 4208|       |
 4209|   524k|    while ( !EndOfInput(doc) )
  ------------------
  |  Branch (4209:13): [True: 516k, False: 8.31k]
  ------------------
 4210|   516k|    {
 4211|   516k|        tmbstr attribute = ParseAttribute( doc, isempty, &asp, &php );
 4212|       |
 4213|   516k|        if (attribute == NULL)
  ------------------
  |  Branch (4213:13): [True: 344k, False: 171k]
  ------------------
 4214|   344k|        {
 4215|       |            /* check if attributes are created by ASP markup */
 4216|   344k|            if (asp)
  ------------------
  |  Branch (4216:17): [True: 1.32k, False: 343k]
  ------------------
 4217|  1.32k|            {
 4218|  1.32k|                av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  1.32k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.32k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4219|  1.32k|                av->asp = asp;
 4220|  1.32k|                AddAttrToList( &list, av ); 
 4221|  1.32k|                continue;
 4222|  1.32k|            }
 4223|       |
 4224|       |            /* check if attributes are created by PHP markup */
 4225|   343k|            if (php)
  ------------------
  |  Branch (4225:17): [True: 4.18k, False: 339k]
  ------------------
 4226|  4.18k|            {
 4227|  4.18k|                av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  4.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4228|  4.18k|                av->php = php;
 4229|  4.18k|                AddAttrToList( &list, av ); 
 4230|  4.18k|                continue;
 4231|  4.18k|            }
 4232|       |
 4233|   339k|            break;
 4234|   343k|        }
 4235|       |
 4236|   171k|        value = ParseValue( doc, attribute, no, isempty, &delim );
 4237|       |
 4238|   171k|        if (attribute && (IsValidAttrName(attribute) ||
  ------------------
  |  Branch (4238:13): [True: 171k, False: 0]
  |  Branch (4238:27): [True: 114k, False: 57.0k]
  ------------------
 4239|  57.0k|            (cfgBool(doc, TidyXmlTags) && IsValidXMLAttrName(attribute))))
  ------------------
  |  |  418|   114k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  57.0k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 57.0k]
  |  |  ------------------
  ------------------
                          (cfgBool(doc, TidyXmlTags) && IsValidXMLAttrName(attribute))))
  ------------------
  |  |  209|      0|#define IsValidXMLAttrName(name) TY_(IsValidXMLID)(name)
  |  |  ------------------
  |  |  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (209:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 4240|   114k|        {
 4241|   114k|            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|   114k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   114k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4242|   114k|            av->delim = delim ? delim : '"';
  ------------------
  |  Branch (4242:25): [True: 73.6k, False: 40.5k]
  ------------------
 4243|   114k|            av->attribute = attribute;
 4244|   114k|            av->value = value;
 4245|   114k|            av->dict = TY_(FindAttribute)( doc, av );
  ------------------
  |  |   23|   114k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   114k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4246|   114k|            AddAttrToList( &list, av );
 4247|   114k|            if ( !delim && value )
  ------------------
  |  Branch (4247:18): [True: 40.5k, False: 73.6k]
  |  Branch (4247:28): [True: 39.9k, False: 575]
  ------------------
 4248|  39.9k|                TY_(ReportAttrError)( doc, lexer->token, av, MISSING_QUOTEMARK_OPEN);
  ------------------
  |  |   23|  39.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4249|   114k|        }
 4250|  57.0k|        else
 4251|  57.0k|        {
 4252|  57.0k|            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  57.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4253|  57.0k|            av->attribute = attribute;
 4254|  57.0k|            av->value = value;
 4255|       |
 4256|  57.0k|            if (LastChar(attribute) == '"')
  ------------------
  |  Branch (4256:17): [True: 1.38k, False: 55.7k]
  ------------------
 4257|  1.38k|                TY_(ReportAttrError)( doc, lexer->token, av, MISSING_QUOTEMARK);
  ------------------
  |  |   23|  1.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4258|  55.7k|            else if (value == NULL)
  ------------------
  |  Branch (4258:22): [True: 51.0k, False: 4.64k]
  ------------------
 4259|  51.0k|                TY_(ReportAttrError)(doc, lexer->token, av, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  51.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4260|  4.64k|            else
 4261|  4.64k|                TY_(ReportAttrError)(doc, lexer->token, av, INVALID_ATTRIBUTE);
  ------------------
  |  |   23|  4.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4262|       |
 4263|  57.0k|            TY_(FreeAttribute)( doc, av );
  ------------------
  |  |   23|  57.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4264|  57.0k|        }
 4265|   171k|    }
 4266|       |
 4267|   347k|    return list;
 4268|   347k|}
lexer.c:EndOfInput:
  901|   524k|{
  902|   524k|    assert( doc->docIn != NULL );
  ------------------
  |  Branch (902:5): [True: 0, False: 524k]
  |  Branch (902:5): [True: 524k, False: 0]
  ------------------
  903|   524k|    return ( !doc->docIn->pushed && TY_(IsEOF)(doc->docIn) );
  ------------------
  |  |   23|   361k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   361k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (903:14): [True: 361k, False: 162k]
  |  Branch (903:37): [True: 8.31k, False: 353k]
  ------------------
  904|   524k|}
lexer.c:IsValidAttrName:
 4132|   171k|{
 4133|   171k|    uint i, c = attr[0];
 4134|       |
 4135|       |    /* first character should be a letter */
 4136|   171k|    if (!TY_(IsLetter)(c))
  ------------------
  |  |   23|   171k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   171k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4136:9): [True: 44.3k, False: 126k]
  ------------------
 4137|  44.3k|        return no;
 4138|       |
 4139|       |    /* remaining characters should be namechars */
 4140|   811k|    for( i = 1; i < TY_(tmbstrlen)(attr); i++)
  ------------------
  |  |   23|   811k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   811k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4140:17): [True: 697k, False: 114k]
  ------------------
 4141|   697k|    {
 4142|   697k|        c = attr[i];
 4143|       |
 4144|   697k|        if (TY_(IsNamechar)(c))
  ------------------
  |  |   23|   697k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   697k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4144:13): [True: 684k, False: 12.7k]
  ------------------
 4145|   684k|            continue;
 4146|       |
 4147|  12.7k|        return no;
 4148|   697k|    }
 4149|       |
 4150|   114k|    return yes;
 4151|   126k|}
lexer.c:LastChar:
  871|  57.0k|{
  872|  57.0k|    if ( str && *str )
  ------------------
  |  Branch (872:10): [True: 57.0k, False: 0]
  |  Branch (872:17): [True: 56.7k, False: 355]
  ------------------
  873|  56.7k|    {
  874|  56.7k|        int n = TY_(tmbstrlen)(str);
  ------------------
  |  |   23|  56.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  56.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  875|  56.7k|        return str[n-1];
  876|  56.7k|    }
  877|    355|    return 0;
  878|  57.0k|}
lexer.c:ExpectsContent:
 2192|   811k|{
 2193|   811k|    if (node->type != StartTag)
  ------------------
  |  Branch (2193:9): [True: 13.1k, False: 798k]
  ------------------
 2194|  13.1k|        return no;
 2195|       |
 2196|       |    /* unknown element? */
 2197|   798k|    if (node->tag == NULL)
  ------------------
  |  Branch (2197:9): [True: 144k, False: 654k]
  ------------------
 2198|   144k|        return yes;
 2199|       |
 2200|   654k|    if (node->tag->model & CM_EMPTY)
  ------------------
  |  |  139|   654k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (2200:9): [True: 35.1k, False: 619k]
  ------------------
 2201|  35.1k|        return no;
 2202|       |
 2203|   619k|    return yes;
 2204|   654k|}
lexer.c:NewToken:
 1602|   248k|{
 1603|   248k|    Lexer* lexer = doc->lexer;
 1604|   248k|    Node* node = TY_(NewNode)(lexer->allocator, lexer);
  ------------------
  |  |   23|   248k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   248k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1605|   248k|    node->type = type;
 1606|   248k|    node->start = lexer->txtstart;
 1607|   248k|    node->end = lexer->txtend;
 1608|   248k|    return node;
 1609|   248k|}
lexer.c:ParseDocTypeDecl:
 4284|  59.3k|{
 4285|  59.3k|    Lexer *lexer = doc->lexer;
 4286|  59.3k|    int start = lexer->lexsize;
 4287|  59.3k|    ParseDocTypeDeclState state = DT_DOCTYPENAME;
 4288|  59.3k|    uint c;
 4289|  59.3k|    uint delim = 0;
 4290|  59.3k|    Bool hasfpi = yes;
 4291|       |
 4292|  59.3k|    Node* node = TY_(NewNode)(lexer->allocator, lexer);
  ------------------
  |  |   23|  59.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  59.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4293|  59.3k|    node->type = DocTypeTag;
 4294|  59.3k|    node->start = lexer->txtstart;
 4295|  59.3k|    node->end = lexer->txtend;
 4296|       |
 4297|  59.3k|    lexer->waswhite = no;
 4298|       |
 4299|       |    /* todo: reset lexer->lexsize when appropriate to avoid wasting memory */
 4300|       |
 4301|  3.19M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|  3.19M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.19M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|  3.19M|#define EndOfStream (~0u)
  ------------------
  |  Branch (4301:12): [True: 3.19M, False: 274]
  ------------------
 4302|  3.19M|    {
 4303|       |        /* convert newlines to spaces */
 4304|  3.19M|        if (state != DT_INTSUBSET)
  ------------------
  |  Branch (4304:13): [True: 3.08M, False: 105k]
  ------------------
 4305|  3.08M|            c = c == '\n' ? ' ' : c;
  ------------------
  |  Branch (4305:17): [True: 1.13k, False: 3.08M]
  ------------------
 4306|       |
 4307|       |        /* convert white-space sequences to single space character */
 4308|  3.19M|        if (TY_(IsWhite)(c) && state != DT_INTSUBSET)
  ------------------
  |  |   23|  3.19M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.19M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4308:13): [True: 2.20M, False: 991k]
  |  Branch (4308:32): [True: 2.11M, False: 84.1k]
  ------------------
 4309|  2.11M|        {
 4310|  2.11M|            if (!lexer->waswhite)
  ------------------
  |  Branch (4310:17): [True: 48.1k, False: 2.06M]
  ------------------
 4311|  48.1k|            {
 4312|  48.1k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  48.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  48.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4313|  48.1k|                lexer->waswhite = yes;
 4314|  48.1k|            }
 4315|  2.06M|            else
 4316|  2.06M|            {
 4317|       |                /* discard space */
 4318|  2.06M|                continue;
 4319|  2.06M|            }
 4320|  2.11M|        }
 4321|  1.07M|        else
 4322|  1.07M|        {
 4323|  1.07M|            TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  1.07M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.07M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4324|  1.07M|            lexer->waswhite = no;
 4325|  1.07M|        }
 4326|       |
 4327|  1.12M|        switch(state)
  ------------------
  |  Branch (4327:16): [True: 1.12M, False: 0]
  ------------------
 4328|  1.12M|        {
 4329|   121k|        case DT_INTERMEDIATE:
  ------------------
  |  Branch (4329:9): [True: 121k, False: 1.00M]
  ------------------
 4330|       |            /* determine what's next */
 4331|   121k|            if (TY_(ToUpper)(c) == 'P' || TY_(ToUpper)(c) == 'S')
  ------------------
  |  |   23|   121k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   121k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(ToUpper)(c) == 'P' || TY_(ToUpper)(c) == 'S')
  ------------------
  |  |   23|   119k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   119k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4331:17): [True: 1.52k, False: 119k]
  |  Branch (4331:43): [True: 516, False: 119k]
  ------------------
 4332|  2.03k|            {
 4333|  2.03k|                start = lexer->lexsize - 1;
 4334|  2.03k|                state = DT_PUBLICSYSTEM;
 4335|  2.03k|                continue;
 4336|  2.03k|            }
 4337|   119k|            else if (c == '[')
  ------------------
  |  Branch (4337:22): [True: 1.37k, False: 117k]
  ------------------
 4338|  1.37k|            {
 4339|  1.37k|                start = lexer->lexsize;
 4340|  1.37k|                state = DT_INTSUBSET;
 4341|  1.37k|                continue;
 4342|  1.37k|            }
 4343|   117k|            else if (c == '\'' || c == '"')
  ------------------
  |  Branch (4343:22): [True: 29.0k, False: 88.5k]
  |  Branch (4343:35): [True: 922, False: 87.6k]
  ------------------
 4344|  30.0k|            {
 4345|  30.0k|                start = lexer->lexsize;
 4346|  30.0k|                delim = c;
 4347|  30.0k|                state = DT_QUOTEDSTRING;
 4348|  30.0k|                continue;
 4349|  30.0k|            }
 4350|  87.6k|            else if (c == '>')
  ------------------
  |  Branch (4350:22): [True: 59.0k, False: 28.5k]
  ------------------
 4351|  59.0k|            {
 4352|  59.0k|                AttVal* si;
 4353|       |
 4354|  59.0k|                node->end = --(lexer->lexsize);
 4355|       |
 4356|  59.0k|                si = TY_(GetAttrByName)(node, "SYSTEM");
  ------------------
  |  |   23|  59.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  59.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4357|  59.0k|                if (si)
  ------------------
  |  Branch (4357:21): [True: 8.66k, False: 50.4k]
  ------------------
 4358|  8.66k|                    TY_(CheckUrl)(doc, node, si);
  ------------------
  |  |   23|  8.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4359|       |
 4360|  59.0k|                if (!node->element || !IsValidXMLElemName(node->element))
  ------------------
  |  |  210|  31.1k|#define IsValidXMLElemName(name) TY_(IsValidXMLID)(name)
  |  |  ------------------
  |  |  |  |   23|  31.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  31.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4360:21): [True: 27.9k, False: 31.1k]
  |  Branch (4360:39): [True: 4.55k, False: 26.5k]
  ------------------
 4361|  32.5k|                {
 4362|  32.5k|                    TY_(Report)(doc, NULL, NULL, MALFORMED_DOCTYPE);
  ------------------
  |  |   23|  32.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4363|  32.5k|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  32.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4364|  32.5k|                    return NULL;
 4365|  32.5k|                }
 4366|  26.5k|                return node;
 4367|  59.0k|            }
 4368|  28.5k|            else
 4369|  28.5k|            {
 4370|       |                /* error */
 4371|  28.5k|            }
 4372|  28.5k|            break;
 4373|   664k|        case DT_DOCTYPENAME:
  ------------------
  |  Branch (4373:9): [True: 664k, False: 458k]
  ------------------
 4374|       |            /* read document type name */
 4375|   664k|            if (TY_(IsWhite)(c) || c == '>' || c == '[')
  ------------------
  |  |   23|   664k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   664k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4375:17): [True: 18.6k, False: 646k]
  |  Branch (4375:36): [True: 39.8k, False: 606k]
  |  Branch (4375:48): [True: 779, False: 605k]
  ------------------
 4376|  59.2k|            {
 4377|  59.2k|                node->element = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  59.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  59.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4378|  59.2k|                                                lexer->lexbuf + start,
 4379|  59.2k|                                                lexer->lexsize - start - 1);
 4380|  59.2k|                if (c == '>' || c == '[')
  ------------------
  |  Branch (4380:21): [True: 39.8k, False: 19.4k]
  |  Branch (4380:33): [True: 779, False: 18.6k]
  ------------------
 4381|  40.6k|                {
 4382|  40.6k|                    --(lexer->lexsize);
 4383|  40.6k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  40.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4384|  40.6k|                }
 4385|       |
 4386|  59.2k|                state = DT_INTERMEDIATE;
 4387|  59.2k|                continue;
 4388|  59.2k|            }
 4389|   605k|            break;
 4390|   605k|        case DT_PUBLICSYSTEM:
  ------------------
  |  Branch (4390:9): [True: 16.0k, False: 1.10M]
  ------------------
 4391|       |            /* read PUBLIC/SYSTEM */
 4392|  16.0k|            if (TY_(IsWhite)(c) || c == '>')
  ------------------
  |  |   23|  16.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4392:17): [True: 1.38k, False: 14.6k]
  |  Branch (4392:36): [True: 622, False: 14.0k]
  ------------------
 4393|  2.00k|            {
 4394|  2.00k|                char *attname = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  2.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4395|  2.00k|                                                lexer->lexbuf + start,
 4396|  2.00k|                                                lexer->lexsize - start - 1);
 4397|  2.00k|                hasfpi = !(TY_(tmbstrcasecmp)(attname, "SYSTEM") == 0);
  ------------------
  |  |   23|  2.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4398|       |
 4399|  2.00k|                TidyDocFree(doc, attname);
  ------------------
  |  |  159|  2.00k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  2.00k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 4400|       |
 4401|       |                /* todo: report an error if SYSTEM/PUBLIC not uppercase */
 4402|       |
 4403|  2.00k|                if (c == '>')
  ------------------
  |  Branch (4403:21): [True: 622, False: 1.38k]
  ------------------
 4404|    622|                {
 4405|    622|                    --(lexer->lexsize);
 4406|    622|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    622|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    622|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4407|    622|                }
 4408|       |
 4409|  2.00k|                state = DT_INTERMEDIATE;
 4410|  2.00k|                continue;
 4411|  2.00k|            }
 4412|  14.0k|            break;
 4413|   215k|        case DT_QUOTEDSTRING:
  ------------------
  |  Branch (4413:9): [True: 215k, False: 907k]
  ------------------
 4414|       |            /* read quoted string */
 4415|   215k|            if (c == delim)
  ------------------
  |  Branch (4415:17): [True: 29.9k, False: 185k]
  ------------------
 4416|  29.9k|            {
 4417|  29.9k|                char *value = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  29.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4418|  29.9k|                                              lexer->lexbuf + start,
 4419|  29.9k|                                              lexer->lexsize - start - 1);
 4420|  29.9k|                AttVal* att = TY_(AddAttribute)(doc, node, hasfpi ? "PUBLIC" : "SYSTEM", value);
  ------------------
  |  |   23|  29.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4420:60): [True: 17.6k, False: 12.2k]
  ------------------
 4421|  29.9k|                TidyDocFree(doc, value);
  ------------------
  |  |  159|  29.9k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  29.9k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 4422|  29.9k|                att->delim = delim;
 4423|  29.9k|                hasfpi = no;
 4424|  29.9k|                state = DT_INTERMEDIATE;
 4425|  29.9k|                delim = 0;
 4426|  29.9k|                continue;
 4427|  29.9k|            }
 4428|   185k|            break;
 4429|   185k|        case DT_INTSUBSET:
  ------------------
  |  Branch (4429:9): [True: 105k, False: 1.01M]
  ------------------
 4430|       |            /* read internal subset */
 4431|   105k|            if (c == ']')
  ------------------
  |  Branch (4431:17): [True: 1.33k, False: 104k]
  ------------------
 4432|  1.33k|            {
 4433|  1.33k|                Node* subset;
 4434|  1.33k|                lexer->txtstart = start;
 4435|  1.33k|                lexer->txtend = lexer->lexsize - 1;
 4436|  1.33k|                subset = TY_(TextToken)(lexer);
  ------------------
  |  |   23|  1.33k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.33k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4437|  1.33k|                TY_(InsertNodeAtEnd)(node, subset);
  ------------------
  |  |   23|  1.33k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.33k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4438|  1.33k|                state = DT_INTERMEDIATE;
 4439|  1.33k|            }
 4440|   105k|            break;
 4441|  1.12M|        }
 4442|  1.12M|    }
 4443|       |
 4444|       |    /* document type declaration not finished */
 4445|    274|    TY_(Report)(doc, NULL, NULL, MALFORMED_DOCTYPE);
  ------------------
  |  |   23|    274|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    274|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4446|    274|    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    274|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    274|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4447|       |    return NULL;
 4448|  59.3k|}
lexer.c:FindGivenVersion:
 1815|  16.2k|{
 1816|  16.2k|    AttVal * fpi = TY_(GetAttrByName)(doctype, "PUBLIC");
  ------------------
  |  |   23|  16.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1817|  16.2k|    uint vers;
 1818|       |
 1819|  16.2k|    if (!fpi || !fpi->value) 
  ------------------
  |  Branch (1819:9): [True: 8.65k, False: 7.55k]
  |  Branch (1819:17): [True: 3.19k, False: 4.35k]
  ------------------
 1820|  11.8k|    {
 1821|       |        /*\
 1822|       |         * Is. #815 - change to case-insensitive test
 1823|       |         * See REC: https://www.w3.org/TR/html5/syntax.html#the-doctype
 1824|       |        \*/
 1825|  11.8k|        if (doctype->element && (TY_(tmbstrcasecmp)(doctype->element,"html") == 0))
  ------------------
  |  |   23|  11.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1825:13): [True: 11.8k, False: 0]
  |  Branch (1825:33): [True: 184, False: 11.6k]
  ------------------
 1826|    184|        {
 1827|    184|            return VERS_HTML5;  /* TODO: do we need to check MORE? */
  ------------------
  |  |  213|    184|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|    184|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|    184|#define XH50              262144u
  |  |  ------------------
  ------------------
 1828|    184|        }
 1829|       |        /* TODO: Consider warning, error message */
 1830|  11.6k|        return VERS_UNKNOWN;
  ------------------
  |  |  204|  11.6k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  11.6k|#define xxxx                   0u
  |  |  ------------------
  ------------------
 1831|  11.8k|    }
 1832|  4.35k|    vers = GetVersFromFPI(fpi->value);
 1833|       |
 1834|  4.35k|    if (VERS_XHTML & vers)
  ------------------
  |  |  222|  4.35k|#define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  185|  4.35k|#define X10S                 256u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  186|  4.35k|#define X10T                 512u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  187|  4.35k|#define X10F                1024u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  188|  4.35k|#define XH11                2048u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  189|  4.35k|#define XB10                4096u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  201|  4.35k|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (1834:9): [True: 164, False: 4.19k]
  ------------------
 1835|    164|    {
 1836|    164|        TY_(SetOptionBool)(doc, TidyXmlOut, yes);
  ------------------
  |  |   23|    164|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    164|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1837|    164|        TY_(SetOptionBool)(doc, TidyXhtmlOut, yes);
  ------------------
  |  |   23|    164|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    164|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1838|    164|        doc->lexer->isvoyager = yes;
 1839|    164|    }
 1840|       |
 1841|       |    /* todo: add a warning if case does not match? */
 1842|  4.35k|    TidyDocFree(doc, fpi->value);
  ------------------
  |  |  159|  4.35k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  4.35k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1843|  4.35k|    fpi->value = TY_(tmbstrdup)(doc->allocator, GetFPIFromVers(vers));
  ------------------
  |  |   23|  4.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1844|       |
 1845|  4.35k|    return vers;
 1846|  16.2k|}
lexer.c:GetVersFromFPI:
  333|  4.35k|{
  334|  4.35k|    uint i;
  335|       |
  336|  86.0k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (336:17): [True: 81.8k, False: 4.19k]
  ------------------
  337|  81.8k|        if (W3C_Doctypes[i].fpi != NULL && TY_(tmbstrcasecmp)(W3C_Doctypes[i].fpi, fpi) == 0)
  ------------------
  |  |   23|  73.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (337:13): [True: 73.5k, False: 8.38k]
  |  Branch (337:44): [True: 164, False: 73.3k]
  ------------------
  338|    164|            return W3C_Doctypes[i].vers;
  339|       |
  340|  4.19k|    return 0;
  341|  4.35k|}
lexer.c:ParseAttribute:
 3594|   543k|{
 3595|   543k|    Lexer* lexer = doc->lexer;
 3596|   543k|    int start, len = 0;
 3597|   543k|    tmbstr attr = NULL;
 3598|   543k|    uint c, lastc;
 3599|       |
 3600|   543k|    *asp = NULL;  /* clear asp pointer */
 3601|   543k|    *php = NULL;  /* clear php pointer */
 3602|       |
 3603|       | /* skip white space before the attribute */
 3604|       |
 3605|   543k|    for (;;)
 3606|   625k|    {
 3607|   625k|        c = TY_(ReadChar)( doc->docIn );
  ------------------
  |  |   23|   625k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   625k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3608|       |
 3609|       |
 3610|   625k|        if (c == '/')
  ------------------
  |  Branch (3610:13): [True: 24.9k, False: 600k]
  ------------------
 3611|  24.9k|        {
 3612|  24.9k|            c = TY_(ReadChar)( doc->docIn );
  ------------------
  |  |   23|  24.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3613|       |
 3614|  24.9k|            if (c == '>')
  ------------------
  |  Branch (3614:17): [True: 12.8k, False: 12.0k]
  ------------------
 3615|  12.8k|            {
 3616|  12.8k|                *isempty = yes;
 3617|  12.8k|                return NULL;
 3618|  12.8k|            }
 3619|       |
 3620|  12.0k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  12.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3621|  12.0k|            c = '/';
 3622|  12.0k|            break;
 3623|  24.9k|        }
 3624|       |
 3625|   600k|        if (c == '>')
  ------------------
  |  Branch (3625:13): [True: 83.6k, False: 516k]
  ------------------
 3626|  83.6k|            return NULL;
 3627|       |
 3628|   516k|        if (c =='<')
  ------------------
  |  Branch (3628:13): [True: 267k, False: 249k]
  ------------------
 3629|   267k|        {
 3630|   267k|            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   267k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   267k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3631|       |
 3632|   267k|            if (c == '%')
  ------------------
  |  Branch (3632:17): [True: 5.29k, False: 261k]
  ------------------
 3633|  5.29k|            {
 3634|  5.29k|                *asp = ParseAsp( doc );
 3635|  5.29k|                return NULL;
 3636|  5.29k|            }
 3637|   261k|            else if (c == '?')
  ------------------
  |  Branch (3637:22): [True: 7.44k, False: 254k]
  ------------------
 3638|  7.44k|            {
 3639|  7.44k|                *php = ParsePhp( doc );
 3640|  7.44k|                return NULL;
 3641|  7.44k|            }
 3642|       |
 3643|   254k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   254k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   254k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3644|   254k|            TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|   254k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   254k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3645|   254k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|   254k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   254k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3646|   254k|            return NULL;
 3647|   267k|        }
 3648|       |
 3649|   249k|        if (c == '=')
  ------------------
  |  Branch (3649:13): [True: 2.55k, False: 247k]
  ------------------
 3650|  2.55k|        {
 3651|  2.55k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_EQUALSIGN );
  ------------------
  |  |   23|  2.55k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.55k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3652|  2.55k|            continue;
 3653|  2.55k|        }
 3654|       |
 3655|   247k|        if (c == '"' || c == '\'')
  ------------------
  |  Branch (3655:13): [True: 1.39k, False: 245k]
  |  Branch (3655:25): [True: 421, False: 245k]
  ------------------
 3656|  1.81k|        {
 3657|  1.81k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_QUOTEMARK );
  ------------------
  |  |   23|  1.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3658|  1.81k|            continue;
 3659|  1.81k|        }
 3660|       |
 3661|   245k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   245k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3661:13): [True: 53, False: 245k]
  ------------------
 3662|     53|        {
 3663|     53|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|     53|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     53|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3664|     53|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     53|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     53|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3665|     53|            return NULL;
 3666|     53|        }
 3667|       |
 3668|       |
 3669|   245k|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|   245k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   245k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3669:13): [True: 167k, False: 77.7k]
  ------------------
 3670|   167k|           break;
 3671|   245k|    }
 3672|       |
 3673|   179k|    start = lexer->lexsize;
 3674|   179k|    lastc = c;
 3675|       |
 3676|   179k|    for (;;)
 3677|  1.91M|    {
 3678|       |     /* but push back '=' for parseValue() */
 3679|  1.91M|        if (c == '=' || c == '>')
  ------------------
  |  Branch (3679:13): [True: 54.4k, False: 1.85M]
  |  Branch (3679:25): [True: 30.9k, False: 1.82M]
  ------------------
 3680|  85.3k|        {
 3681|  85.3k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  85.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  85.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3682|  85.3k|            break;
 3683|  85.3k|        }
 3684|       |
 3685|  1.82M|        if (c == '<' || c == EndOfStream)
  ------------------
  |  | 1064|  1.76M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3685:13): [True: 65.1k, False: 1.76M]
  |  Branch (3685:25): [True: 1.26k, False: 1.75M]
  ------------------
 3686|  66.4k|        {
 3687|  66.4k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  66.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  66.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3688|  66.4k|            break;
 3689|  66.4k|        }
 3690|       |
 3691|  1.75M|        if (lastc == '-' && (c == '"' || c == '\''))
  ------------------
  |  Branch (3691:13): [True: 17.8k, False: 1.74M]
  |  Branch (3691:30): [True: 207, False: 17.6k]
  |  Branch (3691:42): [True: 748, False: 16.9k]
  ------------------
 3692|    955|        {
 3693|    955|            lexer->lexsize--;
 3694|    955|            --len;
 3695|    955|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    955|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    955|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3696|    955|            break;
 3697|    955|        }
 3698|       |
 3699|  1.75M|        if (TY_(IsWhite)(c))
  ------------------
  |  |   23|  1.75M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.75M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3699:13): [True: 26.4k, False: 1.73M]
  ------------------
 3700|  26.4k|            break;
 3701|       |
 3702|  1.73M|        if (c == '/') /* Issue #395 - potential self closing tag */
  ------------------
  |  Branch (3702:13): [True: 14.2k, False: 1.71M]
  ------------------
 3703|  14.2k|        {
 3704|  14.2k|            c = TY_(ReadChar)(doc->docIn);  /* read next */
  ------------------
  |  |   23|  14.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3705|  14.2k|            if (c == '>')
  ------------------
  |  Branch (3705:17): [True: 630, False: 13.6k]
  ------------------
 3706|    630|            {
 3707|       |                /* got a self closing tag - put is back and continue... */
 3708|    630|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    630|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    630|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3709|    630|                break;
 3710|    630|            }
 3711|  13.6k|            else
 3712|  13.6k|            {
 3713|       |                /* Not '/>' - put it back */
 3714|  13.6k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  13.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3715|  13.6k|                c = '/';  /* restore original char */
 3716|  13.6k|            }
 3717|  14.2k|        }
 3718|       |
 3719|       |        /* what should be done about non-namechar characters? */
 3720|       |        /* currently these are incorporated into the attr name */
 3721|       |
 3722|  1.73M|        if ( cfg(doc, TidyUpperCaseAttrs) != TidyUppercasePreserve )
  ------------------
  |  |  415|  1.73M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (3722:14): [True: 1.73M, False: 0]
  ------------------
 3723|  1.73M|        {
 3724|  1.73M|            if ( !cfgBool(doc, TidyXmlTags) && TY_(IsUpper)(c) )
  ------------------
  |  |  418|  3.46M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.73M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                          if ( !cfgBool(doc, TidyXmlTags) && TY_(IsUpper)(c) )
  ------------------
  |  |   23|  1.73M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.73M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3724:18): [True: 1.73M, False: 0]
  |  Branch (3724:48): [True: 174k, False: 1.55M]
  ------------------
 3725|   174k|                c = TY_(ToLower)(c);
  ------------------
  |  |   23|   174k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   174k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3726|  1.73M|        }
 3727|       |
 3728|  1.73M|        TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|  1.73M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.73M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3729|  1.73M|        lastc = c;
 3730|  1.73M|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.73M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.73M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3731|  1.73M|    }
 3732|       |
 3733|       |    /* handle attribute names with multibyte chars */
 3734|   179k|    len = lexer->lexsize - start;
 3735|   179k|    attr = (len > 0 ? TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|   179k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   179k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3735:13): [True: 179k, False: 655]
  ------------------
 3736|   179k|                                      lexer->lexbuf+start, len) : NULL);
 3737|   179k|    lexer->lexsize = start;
 3738|   179k|    return attr;
 3739|   543k|}
lexer.c:ParseAsp:
 3508|  5.29k|{
 3509|  5.29k|    Lexer* lexer = doc->lexer;
 3510|  5.29k|    uint c;
 3511|  5.29k|    Node *asp = NULL;
 3512|       |
 3513|  5.29k|    lexer->txtstart = lexer->lexsize;
 3514|       |
 3515|  5.29k|    for (;;)
 3516|  5.34M|    {
 3517|  5.34M|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  5.34M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.34M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  5.34M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3517:13): [True: 119, False: 5.34M]
  ------------------
 3518|    119|            break;
 3519|       |
 3520|  5.34M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  5.34M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.34M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3521|       |
 3522|       |
 3523|  5.34M|        if (c != '%')
  ------------------
  |  Branch (3523:13): [True: 5.33M, False: 8.12k]
  ------------------
 3524|  5.33M|            continue;
 3525|       |
 3526|  8.12k|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  8.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  8.12k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3526:13): [True: 4, False: 8.11k]
  ------------------
 3527|      4|            break;
 3528|       |
 3529|  8.11k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  8.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3530|       |
 3531|  8.11k|        if (c == '>')
  ------------------
  |  Branch (3531:13): [True: 5.17k, False: 2.94k]
  ------------------
 3532|  5.17k|        {
 3533|  5.17k|            lexer->lexsize -= 2;
 3534|  5.17k|            break;
 3535|  5.17k|        }
 3536|  8.11k|    }
 3537|       |
 3538|  5.29k|    lexer->txtend = lexer->lexsize;
 3539|  5.29k|    if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3539:9): [True: 5.07k, False: 224]
  ------------------
 3540|  5.07k|        asp = AspToken(doc);
  ------------------
  |  | 1614|  5.07k|#define AspToken(doc)     NewToken(doc, AspTag)
  ------------------
 3541|       |
 3542|  5.29k|    lexer->txtstart = lexer->txtend;
 3543|  5.29k|    return asp;
 3544|  5.29k|}   
lexer.c:ParsePhp:
 3552|  7.44k|{
 3553|  7.44k|    Lexer* lexer = doc->lexer;
 3554|  7.44k|    uint c;
 3555|  7.44k|    Node *php = NULL;
 3556|       |
 3557|  7.44k|    lexer->txtstart = lexer->lexsize;
 3558|       |
 3559|  7.44k|    for (;;)
 3560|  23.5M|    {
 3561|  23.5M|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  23.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  23.5M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3561:13): [True: 156, False: 23.5M]
  ------------------
 3562|    156|            break;
 3563|       |
 3564|  23.5M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  23.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3565|       |
 3566|       |
 3567|  23.5M|        if (c != '?')
  ------------------
  |  Branch (3567:13): [True: 23.5M, False: 11.2k]
  ------------------
 3568|  23.5M|            continue;
 3569|       |
 3570|  11.2k|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  11.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  11.2k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3570:13): [True: 16, False: 11.2k]
  ------------------
 3571|     16|            break;
 3572|       |
 3573|  11.2k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  11.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3574|       |
 3575|  11.2k|        if (c == '>')
  ------------------
  |  Branch (3575:13): [True: 7.26k, False: 3.94k]
  ------------------
 3576|  7.26k|        {
 3577|  7.26k|            lexer->lexsize -= 2;
 3578|  7.26k|            break;
 3579|  7.26k|        }
 3580|  11.2k|    }
 3581|       |
 3582|  7.44k|    lexer->txtend = lexer->lexsize;
 3583|  7.44k|    if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3583:9): [True: 7.24k, False: 201]
  ------------------
 3584|  7.24k|        php = PhpToken(doc);
  ------------------
  |  | 1616|  7.24k|#define PhpToken(doc)     NewToken(doc, PhpTag)
  ------------------
 3585|       |
 3586|  7.44k|    lexer->txtstart = lexer->txtend;
 3587|  7.44k|    return php;
 3588|  7.44k|}   
lexer.c:ParseValue:
 3842|   179k|{
 3843|   179k|    Lexer* lexer = doc->lexer;
 3844|   179k|    int len = 0, start;
 3845|   179k|    Bool seen_gt = no;
 3846|   179k|    Bool munge = yes;
 3847|   179k|    uint c, lastc, delim, quotewarning;
 3848|   179k|    tmbstr value;
 3849|       |
 3850|   179k|    delim = (tmbchar) 0;
 3851|   179k|    *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|   179k|    if ( cfgBool(doc, TidyLiteralAttribs) )
  ------------------
  |  |  418|   179k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   179k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 179k]
  |  |  ------------------
  ------------------
 3859|      0|        munge = no;
 3860|       |
 3861|       | /* skip white space before the '=' */
 3862|       |
 3863|   179k|    for (;;)
 3864|   918k|    {
 3865|   918k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   918k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   918k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3866|       |
 3867|   918k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   918k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3867:13): [True: 1.33k, False: 916k]
  ------------------
 3868|  1.33k|        {
 3869|  1.33k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.33k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.33k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3870|  1.33k|            break;
 3871|  1.33k|        }
 3872|       |
 3873|   916k|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|   916k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   916k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3873:13): [True: 177k, False: 738k]
  ------------------
 3874|   177k|           break;
 3875|   916k|    }
 3876|       |
 3877|       |/*
 3878|       |  c should be '=' if there is a value
 3879|       |  other legal possibilities are white
 3880|       |  space, '/' and '>'
 3881|       |*/
 3882|       |
 3883|   179k|    if (c != '=' && c != '"' && c != '\'')
  ------------------
  |  Branch (3883:9): [True: 124k, False: 54.4k]
  |  Branch (3883:21): [True: 124k, False: 235]
  |  Branch (3883:33): [True: 123k, False: 739]
  ------------------
 3884|   123k|    {
 3885|   123k|        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   123k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   123k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3886|   123k|        return NULL;
 3887|   123k|    }
 3888|       |
 3889|       | /* skip white space after '=' */
 3890|       |
 3891|  55.4k|    for (;;)
 3892|  60.2k|    {
 3893|  60.2k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  60.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3894|       |
 3895|  60.2k|        if (c == EndOfStream)
  ------------------
  |  | 1064|  60.2k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3895:13): [True: 80, False: 60.1k]
  ------------------
 3896|     80|        {
 3897|     80|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     80|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     80|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3898|     80|            break;
 3899|     80|        }
 3900|       |
 3901|  60.1k|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|  60.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3901:13): [True: 55.3k, False: 4.83k]
  ------------------
 3902|  55.3k|           break;
 3903|  60.1k|    }
 3904|       |
 3905|       | /* check for quote marks */
 3906|       |
 3907|  55.4k|    if (c == '"' || c == '\'')
  ------------------
  |  Branch (3907:9): [True: 7.89k, False: 47.5k]
  |  Branch (3907:21): [True: 704, False: 46.8k]
  ------------------
 3908|  8.59k|        delim = c;
 3909|  46.8k|    else if (c == '<')
  ------------------
  |  Branch (3909:14): [True: 3.22k, False: 43.5k]
  ------------------
 3910|  3.22k|    {
 3911|  3.22k|        start = lexer->lexsize;
 3912|  3.22k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  3.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3913|  3.22k|        *pdelim = ParseServerInstruction( doc );
 3914|  3.22k|        len = lexer->lexsize - start;
 3915|  3.22k|        lexer->lexsize = start;
 3916|  3.22k|        return (len > 0 ? TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  3.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3916:17): [True: 3.22k, False: 0]
  ------------------
 3917|  3.22k|                                          lexer->lexbuf+start, len) : NULL);
 3918|  3.22k|    }
 3919|  43.5k|    else
 3920|  43.5k|        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  43.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  43.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3921|       |
 3922|       | /*
 3923|       |   and read the value string
 3924|       |   check for quote mark if needed
 3925|       | */
 3926|       |
 3927|  52.1k|    quotewarning = 0;
 3928|  52.1k|    start = lexer->lexsize;
 3929|  52.1k|    c = '\0';
 3930|       |
 3931|  52.1k|    for (;;)
 3932|   612k|    {
 3933|   612k|        lastc = c;  /* track last character */
 3934|   612k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   612k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   612k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3935|       |
 3936|   612k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   612k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3936:13): [True: 1.24k, False: 610k]
  ------------------
 3937|  1.24k|        {
 3938|  1.24k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3939|  1.24k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3940|  1.24k|            break;
 3941|  1.24k|        }
 3942|       |
 3943|   610k|        if (delim == (tmbchar)0)
  ------------------
  |  Branch (3943:13): [True: 416k, False: 194k]
  ------------------
 3944|   416k|        {
 3945|   416k|            if (c == '>')
  ------------------
  |  Branch (3945:17): [True: 7.73k, False: 408k]
  ------------------
 3946|  7.73k|            {
 3947|  7.73k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  7.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3948|  7.73k|                break;
 3949|  7.73k|            }
 3950|       |
 3951|   408k|            if (c == '"' || c == '\'')
  ------------------
  |  Branch (3951:17): [True: 1.60k, False: 407k]
  |  Branch (3951:29): [True: 1.26k, False: 405k]
  ------------------
 3952|  2.87k|            {
 3953|  2.87k|                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|  2.87k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  2.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3960|  2.87k|                if (c == '>')
  ------------------
  |  Branch (3960:21): [True: 525, False: 2.34k]
  ------------------
 3961|    525|                {
 3962|    525|                    TY_(AddCharToLexer)(lexer, q);
  ------------------
  |  |   23|    525|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    525|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3963|    525|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    525|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    525|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3964|    525|                    break;
 3965|    525|                }
 3966|  2.34k|                else
 3967|  2.34k|                {
 3968|  2.34k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  2.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3969|  2.34k|                    c = q;
 3970|  2.34k|                }
 3971|  2.87k|            }
 3972|       |
 3973|   408k|            if (c == '<')
  ------------------
  |  Branch (3973:17): [True: 24.9k, False: 383k]
  ------------------
 3974|  24.9k|            {
 3975|  24.9k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  24.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3976|  24.9k|                c = '>';
 3977|  24.9k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  24.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3978|  24.9k|                TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|  24.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3979|  24.9k|                break;
 3980|  24.9k|            }
 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|   383k|            if (c == '/')
  ------------------
  |  Branch (3988:17): [True: 1.61k, False: 381k]
  ------------------
 3989|  1.61k|            {
 3990|       |                /* peek ahead in case of /> */
 3991|  1.61k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3992|       |
 3993|  1.61k|                if ( c == '>' && !TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|    539|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    539|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3993:22): [True: 539, False: 1.07k]
  |  Branch (3993:34): [True: 326, False: 213]
  ------------------
 3994|    326|                {
 3995|    326|                    *isempty = yes;
 3996|    326|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    326|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    326|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3997|    326|                    break;
 3998|    326|                }
 3999|       |
 4000|       |                /* unget peeked character */
 4001|  1.28k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4002|  1.28k|                c = '/';
 4003|  1.28k|            }
 4004|   383k|        }
 4005|   194k|        else  /* delim is '\'' or '"' */
 4006|   194k|        {
 4007|   194k|            if (c == delim)
  ------------------
  |  Branch (4007:17): [True: 8.37k, False: 186k]
  ------------------
 4008|  8.37k|                break;
 4009|       |
 4010|   186k|            if (c == '\n' || c == '<' || c == '>')
  ------------------
  |  Branch (4010:17): [True: 5.12k, False: 181k]
  |  Branch (4010:30): [True: 8.61k, False: 172k]
  |  Branch (4010:42): [True: 7.60k, False: 164k]
  ------------------
 4011|  21.3k|                ++quotewarning;
 4012|       |
 4013|   186k|            if (c == '>')
  ------------------
  |  Branch (4013:17): [True: 7.60k, False: 178k]
  ------------------
 4014|  7.60k|                seen_gt = yes;
 4015|   186k|        }
 4016|       |
 4017|   569k|        if (c == '&')
  ------------------
  |  Branch (4017:13): [True: 5.26k, False: 563k]
  ------------------
 4018|  5.26k|        {
 4019|  5.26k|            TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  5.26k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.26k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4020|  5.26k|            ParseEntity( doc, IgnoreWhitespace );
 4021|  5.26k|            if (lexer->lexbuf[lexer->lexsize - 1] == '\n' && munge)
  ------------------
  |  Branch (4021:17): [True: 1.42k, False: 3.84k]
  |  Branch (4021:62): [True: 1.42k, False: 0]
  ------------------
 4022|  1.42k|                ChangeChar(lexer, ' ');
 4023|  5.26k|            continue;
 4024|  5.26k|        }
 4025|       |
 4026|       |        /*
 4027|       |         kludge for JavaScript attribute values
 4028|       |         with line continuations in string literals
 4029|       |        */
 4030|   563k|        if (c == '\\')
  ------------------
  |  Branch (4030:13): [True: 1.13k, False: 562k]
  ------------------
 4031|  1.13k|        {
 4032|  1.13k|            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4033|       |
 4034|  1.13k|            if (c != '\n')
  ------------------
  |  Branch (4034:17): [True: 498, False: 640]
  ------------------
 4035|    498|            {
 4036|    498|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    498|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    498|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4037|    498|                c = '\\';
 4038|    498|            }
 4039|  1.13k|        }
 4040|       |
 4041|   563k|        if (TY_(IsWhite)(c))
  ------------------
  |  |   23|   563k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   563k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4041:13): [True: 30.5k, False: 533k]
  ------------------
 4042|  30.5k|        {
 4043|  30.5k|            if ( delim == 0 )
  ------------------
  |  Branch (4043:18): [True: 9.02k, False: 21.5k]
  ------------------
 4044|  9.02k|                break;
 4045|       |
 4046|  21.5k|            if (munge)
  ------------------
  |  Branch (4046:17): [True: 21.5k, False: 0]
  ------------------
 4047|  21.5k|            {
 4048|       |                /* discard line breaks in quoted URLs */ 
 4049|       |                /* #438650 - fix by Randy Waki */
 4050|  21.5k|                if ( c == '\n' && TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|  5.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4050:22): [True: 5.12k, False: 16.4k]
  |  Branch (4050:35): [True: 870, False: 4.25k]
  ------------------
 4051|    870|                {
 4052|       |                    /* warn that we discard this newline */
 4053|    870|                    TY_(ReportAttrError)( doc, lexer->token, NULL, NEWLINE_IN_URI);
  ------------------
  |  |   23|    870|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    870|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4054|    870|                    continue;
 4055|    870|                }
 4056|       |                
 4057|  20.6k|                c = ' ';
 4058|       |
 4059|  20.6k|                if (lastc == ' ')
  ------------------
  |  Branch (4059:21): [True: 9.04k, False: 11.6k]
  ------------------
 4060|  9.04k|                {
 4061|  9.04k|                    if (TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|  9.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4061:25): [True: 3.51k, False: 5.53k]
  ------------------
 4062|  3.51k|                        TY_(ReportAttrError)( doc, lexer->token, NULL, WHITE_IN_URI);
  ------------------
  |  |   23|  3.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4063|  9.04k|                    continue;
 4064|  9.04k|                }
 4065|  20.6k|            }
 4066|  21.5k|        }
 4067|   533k|        else if (foldCase && TY_(IsUpper)(c))
  ------------------
  |  |   23|  1.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4067:18): [True: 1.29k, False: 531k]
  |  Branch (4067:30): [True: 324, False: 974]
  ------------------
 4068|    324|            c = TY_(ToLower)(c);
  ------------------
  |  |   23|    324|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    324|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4069|       |
 4070|   544k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   544k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   544k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4071|   544k|    }
 4072|       |
 4073|  52.1k|    if (quotewarning > 10 && seen_gt && munge)
  ------------------
  |  Branch (4073:9): [True: 1.19k, False: 50.9k]
  |  Branch (4073:30): [True: 970, False: 224]
  |  Branch (4073:41): [True: 970, False: 0]
  ------------------
 4074|    970|    {
 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|    970|        if ( !TY_(IsScript)(doc, name) &&
  ------------------
  |  |   23|    970|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    970|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4084:14): [True: 894, False: 76]
  ------------------
 4085|    894|             !(TY_(IsUrl)(doc, name) && TY_(tmbstrncmp)(lexer->lexbuf+start, "javascript:", 11) == 0) &&
  ------------------
  |  |   23|    894|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    894|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           !(TY_(IsUrl)(doc, name) && TY_(tmbstrncmp)(lexer->lexbuf+start, "javascript:", 11) == 0) &&
  ------------------
  |  |   23|    262|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    262|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4085:16): [True: 262, False: 632]
  |  Branch (4085:41): [True: 66, False: 196]
  ------------------
 4086|    828|             !(TY_(tmbstrncmp)(lexer->lexbuf+start, "<xml ", 5) == 0)
  ------------------
  |  |   23|    828|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    828|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4086:14): [True: 578, False: 250]
  ------------------
 4087|    970|           )
 4088|    578|            TY_(Report)( doc, NULL, NULL, SUSPECTED_MISSING_QUOTE ); 
  ------------------
  |  |   23|    578|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    578|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4089|    970|    }
 4090|       |
 4091|  52.1k|    len = lexer->lexsize - start;
 4092|  52.1k|    lexer->lexsize = start;
 4093|       |
 4094|       |
 4095|  52.1k|    if (len > 0 || delim)
  ------------------
  |  Branch (4095:9): [True: 49.9k, False: 2.18k]
  |  Branch (4095:20): [True: 695, False: 1.49k]
  ------------------
 4096|  50.6k|    {
 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|  50.6k|        if ((len > 0) && munge &&
  ------------------
  |  Branch (4102:13): [True: 49.9k, False: 695]
  |  Branch (4102:26): [True: 49.9k, False: 0]
  ------------------
 4103|  49.9k|            TY_(tmbstrcasecmp)(name, "alt") &&
  ------------------
  |  |   23|  49.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4103:13): [True: 49.7k, False: 203]
  ------------------
 4104|  49.7k|            TY_(tmbstrcasecmp)(name, "title") &&
  ------------------
  |  |   23|  49.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4104:13): [True: 49.7k, False: 76]
  ------------------
 4105|  49.7k|            TY_(tmbstrcasecmp)(name, "value") &&
  ------------------
  |  |   23|  49.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4105:13): [True: 49.4k, False: 225]
  ------------------
 4106|  49.4k|            TY_(tmbstrcasecmp)(name, "prompt"))
  ------------------
  |  |   23|  49.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4106:13): [True: 49.2k, False: 194]
  ------------------
 4107|  49.2k|        {
 4108|  50.1k|            while (TY_(IsWhite)(lexer->lexbuf[start+len-1]) && (len > 0))
  ------------------
  |  |   23|  50.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  50.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4108:20): [True: 843, False: 49.2k]
  |  Branch (4108:64): [True: 843, False: 0]
  ------------------
 4109|    843|                --len;
 4110|       |
 4111|       |            /* Issue #497 - Fix leading space trimming */
 4112|  49.8k|            while (TY_(IsWhite)(lexer->lexbuf[start]) && (len > 0))
  ------------------
  |  |   23|  49.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4112:20): [True: 723, False: 49.1k]
  |  Branch (4112:58): [True: 543, False: 180]
  ------------------
 4113|    543|            {
 4114|    543|                ++start;
 4115|    543|                --len;
 4116|    543|            }
 4117|  49.2k|        }
 4118|       |
 4119|  50.6k|        value = TY_(tmbstrndup)(doc->allocator, lexer->lexbuf + start, len);
  ------------------
  |  |   23|  50.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  50.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4120|  50.6k|    }
 4121|  1.49k|    else
 4122|  1.49k|        value = NULL;
 4123|       |
 4124|       |    /* note delimiter if given */
 4125|  52.1k|    *pdelim = delim;
 4126|       |
 4127|  52.1k|    return value;
 4128|  55.4k|}
lexer.c:ParseServerInstruction:
 3747|  3.22k|{
 3748|  3.22k|    Lexer* lexer = doc->lexer;
 3749|  3.22k|    uint c;
 3750|  3.22k|    int delim = '"';
 3751|  3.22k|    Bool isrule = no;
 3752|       |
 3753|  3.22k|    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  3.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3754|  3.22k|    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  3.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3755|       |
 3756|       |    /* check for ASP, PHP or Tango */
 3757|  3.22k|    if (c == '%' || c == '?' || c == '@')
  ------------------
  |  Branch (3757:9): [True: 256, False: 2.96k]
  |  Branch (3757:21): [True: 713, False: 2.25k]
  |  Branch (3757:33): [True: 225, False: 2.03k]
  ------------------
 3758|  1.19k|        isrule = yes;
 3759|       |
 3760|  3.22k|    for (;;)
 3761|  5.07M|    {
 3762|  5.07M|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  5.07M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.07M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3763|       |
 3764|  5.07M|        if (c == EndOfStream)
  ------------------
  |  | 1064|  5.07M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3764:13): [True: 171, False: 5.07M]
  ------------------
 3765|    171|            break;
 3766|       |
 3767|  5.07M|        if (c == '>')
  ------------------
  |  Branch (3767:13): [True: 1.70k, False: 5.06M]
  ------------------
 3768|  1.70k|        {
 3769|  1.70k|            if (isrule)
  ------------------
  |  Branch (3769:17): [True: 1.15k, False: 554]
  ------------------
 3770|  1.15k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  1.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3771|    554|            else
 3772|    554|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    554|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    554|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3773|       |
 3774|  1.70k|            break;
 3775|  1.70k|        }
 3776|       |
 3777|       |        /* if not recognized as ASP, PHP or Tango */
 3778|       |        /* then also finish value on whitespace */
 3779|  5.06M|        if (!isrule)
  ------------------
  |  Branch (3779:13): [True: 3.71M, False: 1.35M]
  ------------------
 3780|  3.71M|        {
 3781|  3.71M|            if (TY_(IsWhite)(c))
  ------------------
  |  |   23|  3.71M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.71M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3781:17): [True: 713, False: 3.71M]
  ------------------
 3782|    713|                break;
 3783|  3.71M|        }
 3784|       |
 3785|  5.06M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  5.06M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.06M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3786|       |
 3787|  5.06M|        if (c == '"')
  ------------------
  |  Branch (3787:13): [True: 859, False: 5.06M]
  ------------------
 3788|    859|        {
 3789|    859|            do
 3790|  6.73k|            {
 3791|  6.73k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  6.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3792|  6.73k|                if (c == EndOfStream) /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  | 1064|  6.73k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3792:21): [True: 26, False: 6.70k]
  ------------------
 3793|     26|                {
 3794|     26|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|     26|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     26|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3795|     26|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     26|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     26|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3796|     26|                    return 0;
 3797|     26|                }
 3798|  6.70k|                if (c == '>') /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  Branch (3798:21): [True: 234, False: 6.47k]
  ------------------
 3799|    234|                {
 3800|    234|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    234|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    234|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3801|    234|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|    234|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    234|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3802|    234|                    return 0;
 3803|    234|                }
 3804|  6.47k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  6.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3805|  6.47k|            }
 3806|  6.47k|            while (c != '"');
  ------------------
  |  Branch (3806:20): [True: 5.87k, False: 599]
  ------------------
 3807|    599|            delim = '\'';
 3808|    599|            continue;
 3809|    859|        }
 3810|       |
 3811|  5.06M|        if (c == '\'')
  ------------------
  |  Branch (3811:13): [True: 699, False: 5.06M]
  ------------------
 3812|    699|        {
 3813|    699|            do
 3814|   134k|            {
 3815|   134k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   134k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   134k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3816|   134k|                if (c == EndOfStream) /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  | 1064|   134k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3816:21): [True: 19, False: 134k]
  ------------------
 3817|     19|                {
 3818|     19|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|     19|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     19|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3819|     19|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     19|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     19|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3820|     19|                    return 0;
 3821|     19|                }
 3822|   134k|                if (c == '>') /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  Branch (3822:21): [True: 357, False: 134k]
  ------------------
 3823|    357|                {
 3824|    357|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    357|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    357|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3825|    357|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|    357|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    357|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3826|    357|                    return 0;
 3827|    357|                }
 3828|   134k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   134k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   134k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3829|   134k|            }
 3830|   134k|            while (c != '\'');
  ------------------
  |  Branch (3830:20): [True: 134k, False: 323]
  ------------------
 3831|    699|        }
 3832|  5.06M|    }
 3833|       |
 3834|  2.58k|    return delim;
 3835|  3.22k|}
lexer.c:MapStr:
 3471|   141k|{
 3472|  1.81M|    while ( *str )
  ------------------
  |  Branch (3472:13): [True: 1.67M, False: 141k]
  ------------------
 3473|  1.67M|    {
 3474|  1.67M|        uint i = (byte) *str++;
 3475|  1.67M|        lexmap[i] |= code;
 3476|  1.67M|    }
 3477|   141k|}
lexer.c:AddAttrToList:
 4174|   262k|{
 4175|   262k|  if ( *list == NULL )
  ------------------
  |  Branch (4175:8): [True: 159k, False: 102k]
  ------------------
 4176|   159k|    *list = av;
 4177|   102k|  else
 4178|   102k|  {
 4179|   102k|    AttVal* here = *list;
 4180|   517k|    while ( here->next )
  ------------------
  |  Branch (4180:13): [True: 414k, False: 102k]
  ------------------
 4181|   414k|      here = here->next;
 4182|   102k|    here->next = av;
 4183|   102k|  }
 4184|   262k|}

prvTidyinitFileSource:
   52|  20.2k|{
   53|  20.2k|    MappedFileSource* fin;
   54|  20.2k|    struct stat sbuf;
   55|  20.2k|    int fd;
   56|       |
   57|  20.2k|    fin = (MappedFileSource*) TidyAlloc( allocator, sizeof(MappedFileSource) );
  ------------------
  |  |   66|  20.2k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
   58|  20.2k|    if ( !fin )
  ------------------
  |  Branch (58:10): [True: 0, False: 20.2k]
  ------------------
   59|      0|        return -1;
   60|       |
   61|  20.2k|    fd = fileno(fp);
   62|  20.2k|    if ( fstat(fd, &sbuf) == -1
  ------------------
  |  Branch (62:10): [True: 0, False: 20.2k]
  ------------------
   63|  20.2k|         || sbuf.st_size == 0
  ------------------
  |  Branch (63:13): [True: 0, False: 20.2k]
  ------------------
   64|  20.2k|         || (fin->base = mmap(0, fin->size = sbuf.st_size, PROT_READ,
  ------------------
  |  Branch (64:13): [True: 0, False: 20.2k]
  ------------------
   65|  20.2k|                              MAP_SHARED, fd, 0)) == MAP_FAILED)
   66|      0|    {
   67|      0|        TidyFree( allocator, fin );
  ------------------
  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
   68|       |        /* Fallback on standard I/O */
   69|      0|        return TY_(initStdIOFileSource)( allocator, inp, fp );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   70|      0|    }
   71|       |
   72|  20.2k|    fin->pos = 0;
   73|  20.2k|    fin->allocator = allocator;
   74|  20.2k|    fclose(fp);
   75|       |
   76|  20.2k|    inp->getByte    = mapped_getByte;
   77|  20.2k|    inp->eof        = mapped_eof;
   78|  20.2k|    inp->ungetByte  = mapped_ungetByte;
   79|  20.2k|    inp->sourceData = fin;
   80|       |
   81|  20.2k|    return 0;
   82|  20.2k|}
prvTidyfreeFileSource:
   85|  20.2k|{
   86|  20.2k|    if ( inp->getByte == mapped_getByte )
  ------------------
  |  Branch (86:10): [True: 20.2k, False: 0]
  ------------------
   87|  20.2k|    {
   88|  20.2k|        MappedFileSource* fin = (MappedFileSource*) inp->sourceData;
   89|  20.2k|        munmap( (void*)fin->base, fin->size );
   90|  20.2k|        TidyFree( fin->allocator, fin );
  ------------------
  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
   91|  20.2k|    }
   92|      0|    else
   93|      0|        TY_(freeStdIOFileSource)( inp, closeIt );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   94|  20.2k|}
mappedio.c:mapped_getByte:
   34|  75.6M|{
   35|  75.6M|    MappedFileSource* fin = (MappedFileSource*) sourceData;
   36|  75.6M|    return fin->base[fin->pos++];
   37|  75.6M|}
mappedio.c:mapped_eof:
   40|  77.2M|{
   41|  77.2M|    MappedFileSource* fin = (MappedFileSource*) sourceData;
   42|  77.2M|    return (fin->pos >= fin->size);
   43|  77.2M|}
mappedio.c:mapped_ungetByte:
   46|   683k|{
   47|   683k|    MappedFileSource* fin = (MappedFileSource*) sourceData;
   48|   683k|    fin->pos--;
   49|   683k|}

prvTidytidyLibraryVersion:
   31|  20.2k|{
   32|  20.2k|  return TY_(library_version);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   33|  20.2k|}
prvTidyReport:
  943|  10.1M|{
  944|  10.1M|    va_list args;
  945|  10.1M|    va_start(args, code);
  946|  10.1M|    vReport(doc, element, node, code, args);
  947|       |    va_end(args);
  948|  10.1M|}
prvTidyReportAttrError:
  965|   760k|{
  966|   760k|    TY_(Report)( doc, NULL, node, code, av );
  ------------------
  |  |   23|   760k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   760k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  967|   760k|}
prvTidyReportEntityError:
  978|   213k|{
  979|       |    /* Note that the report formatter currently doesn't use argument c */
  980|   213k|    TY_(Report)( doc, NULL, NULL, code, entity, c );
  ------------------
  |  |   23|   213k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   213k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  981|   213k|}
prvTidyReportEncodingError:
  991|  1.78M|{
  992|  1.78M|    TY_(Report)( doc, NULL, NULL, code, c, discarded );
  ------------------
  |  |   23|  1.78M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.78M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  993|  1.78M|}
prvTidyReportEncodingWarning:
  996|    178|{
  997|       |    /* va_list in formatter expects trailing `no` argument */
  998|    178|    TY_(Report)( doc, NULL, NULL, code, encoding, no );
  ------------------
  |  |   23|    178|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    178|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  999|    178|}
prvTidyReportMissingAttr:
 1003|  8.42k|{
 1004|  8.42k|    TY_(Report)( doc, NULL, node, MISSING_ATTRIBUTE, name );
  ------------------
  |  |   23|  8.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1005|  8.42k|}
prvTidyReportSurrogateError:
 1009|  38.3k|{
 1010|  38.3k|    TY_(Report)( doc, NULL, NULL, code, c1,c2 );
  ------------------
  |  |   23|  38.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1011|  38.3k|}
prvTidyDialogue:
 1130|  25.5k|{
 1131|  25.5k|    int i = 0;
 1132|  25.5k|    va_list args;
 1133|       |
 1134|   125k|    while ( dialogueDispatchTable[i].code != 0 )
  ------------------
  |  Branch (1134:13): [True: 125k, False: 0]
  ------------------
 1135|   125k|    {
 1136|   125k|        if ( dialogueDispatchTable[i].code == code )
  ------------------
  |  Branch (1136:14): [True: 25.5k, False: 99.5k]
  ------------------
 1137|  25.5k|        {
 1138|  25.5k|            TidyMessageImpl *message;
 1139|  25.5k|            TidyReportLevel level = dialogueDispatchTable[i].level;
 1140|  25.5k|            va_start(args, code);
 1141|  25.5k|            message = formatDialogue( doc, code, level, args );
 1142|  25.5k|            va_end(args);
 1143|  25.5k|            messageOut( message );
 1144|  25.5k|            break;
 1145|  25.5k|        }
 1146|  99.5k|        i++;
 1147|  99.5k|    }
 1148|  25.5k|}
prvTidyReportMarkupVersion:
 1274|  20.2k|{
 1275|  20.2k|    if ( doc->givenDoctype )
  ------------------
  |  Branch (1275:10): [True: 134, False: 20.0k]
  ------------------
 1276|    134|        TY_(Report)( doc, NULL, NULL, STRING_DOCTYPE_GIVEN, doc->givenDoctype );
  ------------------
  |  |   23|    134|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    134|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1277|       |
 1278|  20.2k|    if ( ! cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1278:10): [True: 20.2k, False: 0]
  ------------------
 1279|  20.2k|    {
 1280|  20.2k|        Bool isXhtml = doc->lexer->isvoyager;
 1281|  20.2k|        uint apparentVers = TY_(ApparentVersion)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1282|  20.2k|        ctmbstr vers = TY_(HTMLVersionNameFromCode)( apparentVers, isXhtml );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1283|       |
 1284|  20.2k|        if ( !vers )
  ------------------
  |  Branch (1284:14): [True: 72, False: 20.1k]
  ------------------
 1285|     72|            vers = tidyLocalizedString(STRING_HTML_PROPRIETARY);
 1286|       |
 1287|  20.2k|        TY_(Report)( doc, NULL, NULL, STRING_CONTENT_LOOKS, vers );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1288|       |
 1289|       |        /* Warn about missing system identifier (SI) in emitted doctype */
 1290|  20.2k|        if ( TY_(WarnMissingSIInEmittedDocType)( doc ) )
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1290:14): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|    }
 1293|  20.2k|}
prvTidyReportNumWarnings:
 1300|  20.2k|{
 1301|  20.2k|    if ( doc->warnings > 0 || doc->errors > 0 )
  ------------------
  |  Branch (1301:10): [True: 20.2k, False: 1]
  |  Branch (1301:31): [True: 0, False: 1]
  ------------------
 1302|  20.2k|    {
 1303|  20.2k|        if ( doc->errors > cfg(doc, TidyShowErrors) || !cfgBool(doc, TidyShowWarnings) )
  ------------------
  |  |  415|  40.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                      if ( doc->errors > cfg(doc, TidyShowErrors) || !cfgBool(doc, TidyShowWarnings) )
  ------------------
  |  |  418|  18.8k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  18.8k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1303:14): [True: 1.36k, False: 18.8k]
  |  Branch (1303:56): [True: 0, False: 18.8k]
  ------------------
 1304|  1.36k|        {
 1305|  1.36k|            TY_(Dialogue)( doc, STRING_NOT_ALL_SHOWN );
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1306|  1.36k|        }
 1307|  18.8k|        else
 1308|  18.8k|        {
 1309|  18.8k|            TY_(Dialogue)( doc, STRING_ERROR_COUNT );
  ------------------
  |  |   23|  18.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1310|  18.8k|        }
 1311|       |
 1312|  20.2k|    }
 1313|      1|    else
 1314|      1|    {
 1315|      1|        TY_(Dialogue)( doc, STRING_NO_ERRORS );
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1316|      1|    }
 1317|  20.2k|}
prvTidyFreeMutedMessageList:
 1326|  20.2k|{
 1327|  20.2k|    TidyMutedMessages *list = &(doc->muted);
 1328|       |
 1329|  20.2k|    if ( list->list )
  ------------------
  |  Branch (1329:10): [True: 0, False: 20.2k]
  ------------------
 1330|      0|        TidyFree( doc->allocator, list->list );
  ------------------
  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 1331|  20.2k|}
prvTidytidyErrorCodeAsKey:
 1436|  10.3M|{
 1437|  10.3M|    uint i = 0;
 1438|  1.17G|    while (tidyStringsKeys[i].key) {
  ------------------
  |  Branch (1438:12): [True: 1.17G, False: 0]
  ------------------
 1439|  1.17G|        if ( tidyStringsKeys[i].value == code )
  ------------------
  |  Branch (1439:14): [True: 10.3M, False: 1.16G]
  ------------------
 1440|  10.3M|            return tidyStringsKeys[i].key;
 1441|  1.16G|        i++;
 1442|  1.16G|    }
 1443|      0|    return "UNDEFINED";
 1444|  10.3M|}
message.c:vReport:
  903|  10.3M|{
  904|  10.3M|    int i = 0;
  905|  10.3M|    va_list args_copy;
  906|       |
  907|   599M|    while ( dispatchTable[i].code != 0 )
  ------------------
  |  Branch (907:13): [True: 599M, False: 0]
  ------------------
  908|   599M|    {
  909|   599M|        if ( dispatchTable[i].code == code )
  ------------------
  |  Branch (909:14): [True: 10.3M, False: 588M]
  ------------------
  910|  10.3M|        {
  911|  10.3M|            TidyMessageImpl *message;
  912|  10.3M|            messageFormatter *handler = dispatchTable[i].handler;
  913|  10.3M|            TidyReportLevel level = dispatchTable[i].level;
  914|       |
  915|  10.3M|            va_copy(args_copy, args);
  916|  10.3M|            message = handler( doc, element, node, code, level, args_copy );
  917|  10.3M|            va_end(args_copy);
  918|       |
  919|  10.3M|            messageOut( message );
  920|       |
  921|  10.3M|            if ( dispatchTable[i].next )
  ------------------
  |  Branch (921:18): [True: 126k, False: 10.1M]
  ------------------
  922|   126k|            {
  923|   126k|                va_copy(args_copy, args);
  924|   126k|                vReport(doc, element, node, dispatchTable[i].next, args_copy);
  925|   126k|                va_end(args_copy);
  926|   126k|            }
  927|  10.3M|            break;
  928|  10.3M|        }
  929|   588M|        i++;
  930|   588M|    }
  931|  10.3M|}
message.c:formatStandard:
  673|  7.53M|{
  674|  7.53M|    char nodedesc[ 256 ] = {0};
  675|  7.53M|    char elemdesc[ 256 ] = {0};
  676|  7.53M|    Node* rpt = ( element ? element : node );
  ------------------
  |  Branch (676:19): [True: 7.01M, False: 515k]
  ------------------
  677|       |
  678|  7.53M|    TagToString(node, nodedesc, sizeof(nodedesc));
  679|       |
  680|  7.53M|    if ( element )
  ------------------
  |  Branch (680:10): [True: 7.01M, False: 515k]
  ------------------
  681|  7.01M|        TagToString(element, elemdesc, sizeof(elemdesc));
  682|       |
  683|  7.53M|    switch ( code )
  ------------------
  |  Branch (683:14): [True: 7.53M, False: 0]
  ------------------
  684|  7.53M|    {
  685|      0|        case CUSTOM_TAG_DETECTED:
  ------------------
  |  Branch (685:9): [True: 0, False: 7.53M]
  ------------------
  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: 7.53M]
  ------------------
  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: 7.53M]
  ------------------
  711|      0|        case FILE_CANT_OPEN_CFG:
  ------------------
  |  Branch (711:9): [True: 0, False: 7.53M]
  ------------------
  712|      0|        case FILE_NOT_FILE:
  ------------------
  |  Branch (712:9): [True: 0, False: 7.53M]
  ------------------
  713|  20.2k|        case STRING_CONTENT_LOOKS:
  ------------------
  |  Branch (713:9): [True: 20.2k, False: 7.51M]
  ------------------
  714|  20.3k|        case STRING_DOCTYPE_GIVEN:
  ------------------
  |  Branch (714:9): [True: 134, False: 7.53M]
  ------------------
  715|  20.3k|        case STRING_MISSING_MALFORMED:
  ------------------
  |  Branch (715:9): [True: 0, False: 7.53M]
  ------------------
  716|  20.3k|        case STRING_MUTING_TYPE:
  ------------------
  |  Branch (716:9): [True: 0, False: 7.53M]
  ------------------
  717|  20.3k|        {
  718|  20.3k|            ctmbstr str;
  719|  20.3k|            if ( (str = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (719:18): [True: 20.3k, False: 0]
  ------------------
  720|  20.3k|                return TY_(tidyMessageCreate)( doc, code, level, str );
  ------------------
  |  |   23|  20.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  721|       |
  722|  20.3k|        } break;
  723|       |
  724|      0|        case APOS_UNDEFINED:
  ------------------
  |  Branch (724:9): [True: 0, False: 7.53M]
  ------------------
  725|    620|        case MISSING_SEMICOLON_NCR:
  ------------------
  |  Branch (725:9): [True: 620, False: 7.53M]
  ------------------
  726|  9.48k|        case MISSING_SEMICOLON:
  ------------------
  |  Branch (726:9): [True: 8.86k, False: 7.52M]
  ------------------
  727|  56.7k|        case UNESCAPED_AMPERSAND:
  ------------------
  |  Branch (727:9): [True: 47.2k, False: 7.48M]
  ------------------
  728|   213k|        case UNKNOWN_ENTITY:
  ------------------
  |  Branch (728:9): [True: 157k, False: 7.37M]
  ------------------
  729|   213k|        {
  730|   213k|            ctmbstr entityname;
  731|   213k|            if ( !(entityname = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (731:18): [True: 0, False: 213k]
  ------------------
  732|      0|            {
  733|      0|                entityname = "NULL";
  734|      0|            }
  735|   213k|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, entityname);
  ------------------
  |  |   23|   213k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   213k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  736|  56.7k|        }
  737|       |
  738|  8.42k|        case MISSING_ATTRIBUTE:
  ------------------
  |  Branch (738:9): [True: 8.42k, False: 7.52M]
  ------------------
  739|  8.42k|        {
  740|  8.42k|            ctmbstr name;
  741|  8.42k|            if ( (name = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (741:18): [True: 8.42k, False: 0]
  ------------------
  742|  8.42k|                return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc, name );
  ------------------
  |  |   23|  8.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  743|  8.42k|        } break;
  744|       |
  745|      0|        case STRING_UNKNOWN_OPTION:
  ------------------
  |  Branch (745:9): [True: 0, False: 7.53M]
  ------------------
  746|      0|        case OPTION_REMOVED:
  ------------------
  |  Branch (746:9): [True: 0, False: 7.53M]
  ------------------
  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: 7.53M]
  ------------------
  754|      0|        case STRING_ARGUMENT_BAD:
  ------------------
  |  Branch (754:9): [True: 0, False: 7.53M]
  ------------------
  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: 7.53M]
  ------------------
  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|    455|        case BAD_SURROGATE_LEAD:
  ------------------
  |  Branch (770:9): [True: 455, False: 7.53M]
  ------------------
  771|    651|        case BAD_SURROGATE_PAIR:
  ------------------
  |  Branch (771:9): [True: 196, False: 7.53M]
  ------------------
  772|  38.3k|        case BAD_SURROGATE_TAIL:
  ------------------
  |  Branch (772:9): [True: 37.6k, False: 7.49M]
  ------------------
  773|  38.3k|        {
  774|  38.3k|            uint c1 = va_arg( args, uint );
  775|  38.3k|            uint c2 = va_arg( args, uint );
  776|  38.3k|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, c1, c2);
  ------------------
  |  |   23|  38.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  777|    651|        }
  778|       |
  779|     65|        case SPACE_PRECEDING_XMLDECL:
  ------------------
  |  Branch (779:9): [True: 65, False: 7.53M]
  ------------------
  780|       |            /* @TODO: Should this be a TidyInfo "silent" fix? */
  781|     65|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level );
  ------------------
  |  |   23|     65|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     65|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  782|       |
  783|  5.48k|        case CANT_BE_NESTED:
  ------------------
  |  Branch (783:9): [True: 5.48k, False: 7.52M]
  ------------------
  784|  6.35k|        case NOFRAMES_CONTENT:
  ------------------
  |  Branch (784:9): [True: 878, False: 7.53M]
  ------------------
  785|  11.2k|        case USING_BR_INPLACE_OF:
  ------------------
  |  Branch (785:9): [True: 4.90k, False: 7.52M]
  ------------------
  786|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  787|  11.2k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc );
  ------------------
  |  |   23|  11.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  788|       |
  789|      0|        case ELEMENT_VERS_MISMATCH_ERROR:
  ------------------
  |  Branch (789:9): [True: 0, False: 7.53M]
  ------------------
  790|      0|        case ELEMENT_VERS_MISMATCH_WARN:
  ------------------
  |  Branch (790:9): [True: 0, False: 7.53M]
  ------------------
  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|   124k|        case TAG_NOT_ALLOWED_IN:
  ------------------
  |  Branch (793:9): [True: 124k, False: 7.40M]
  ------------------
  794|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  795|   124k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc, element ? element->element : NULL );
  ------------------
  |  |   23|   124k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   124k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (795:85): [True: 124k, False: 0]
  ------------------
  796|       |
  797|  2.06M|        case INSERTING_TAG:
  ------------------
  |  Branch (797:9): [True: 2.06M, False: 5.46M]
  ------------------
  798|  2.13M|        case MISSING_STARTTAG:
  ------------------
  |  Branch (798:9): [True: 71.8k, False: 7.45M]
  ------------------
  799|  2.13M|        case TOO_MANY_ELEMENTS:
  ------------------
  |  Branch (799:9): [True: 0, False: 7.53M]
  ------------------
  800|  2.13M|        case UNEXPECTED_ENDTAG:
  ------------------
  |  Branch (800:9): [True: 0, False: 7.53M]
  ------------------
  801|  2.13M|        case UNEXPECTED_ENDTAG_ERR:  /* generated by XML docs */
  ------------------
  |  Branch (801:9): [True: 0, False: 7.53M]
  ------------------
  802|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  803|  2.13M|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, node->element );
  ------------------
  |  |   23|  2.13M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.13M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  804|       |
  805|      0|        case UNEXPECTED_ENDTAG_IN:
  ------------------
  |  Branch (805:9): [True: 0, False: 7.53M]
  ------------------
  806|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  807|      0|            return TY_(tidyMessageCreateWithNode)(doc, node, 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 (807:90): [True: 0, False: 0]
  ------------------
  808|       |
  809|    361|        case BAD_CDATA_CONTENT:
  ------------------
  |  Branch (809:9): [True: 361, False: 7.53M]
  ------------------
  810|  8.75k|        case CONTENT_AFTER_BODY:
  ------------------
  |  Branch (810:9): [True: 8.39k, False: 7.52M]
  ------------------
  811|  10.6k|        case DOCTYPE_AFTER_TAGS:
  ------------------
  |  Branch (811:9): [True: 1.87k, False: 7.52M]
  ------------------
  812|  11.9k|        case DUPLICATE_FRAMESET:
  ------------------
  |  Branch (812:9): [True: 1.35k, False: 7.52M]
  ------------------
  813|  29.9k|        case MALFORMED_COMMENT:
  ------------------
  |  Branch (813:9): [True: 17.9k, False: 7.51M]
  ------------------
  814|  38.0k|        case MALFORMED_COMMENT_DROPPING:
  ------------------
  |  Branch (814:9): [True: 8.11k, False: 7.52M]
  ------------------
  815|  38.1k|        case MALFORMED_COMMENT_EOS:
  ------------------
  |  Branch (815:9): [True: 159, False: 7.53M]
  ------------------
  816|  38.1k|        case MALFORMED_COMMENT_WARN:
  ------------------
  |  Branch (816:9): [True: 0, False: 7.53M]
  ------------------
  817|  70.9k|        case MALFORMED_DOCTYPE:
  ------------------
  |  Branch (817:9): [True: 32.7k, False: 7.49M]
  ------------------
  818|  87.4k|        case MISSING_DOCTYPE:
  ------------------
  |  Branch (818:9): [True: 16.4k, False: 7.51M]
  ------------------
  819|   107k|        case MISSING_TITLE_ELEMENT:
  ------------------
  |  Branch (819:9): [True: 20.0k, False: 7.51M]
  ------------------
  820|   128k|        case NESTED_QUOTATION:
  ------------------
  |  Branch (820:9): [True: 21.4k, False: 7.50M]
  ------------------
  821|   129k|        case SUSPECTED_MISSING_QUOTE:
  ------------------
  |  Branch (821:9): [True: 578, False: 7.53M]
  ------------------
  822|   129k|        case XML_DECLARATION_DETECTED:
  ------------------
  |  Branch (822:9): [True: 133, False: 7.53M]
  ------------------
  823|   129k|        case BLANK_TITLE_ELEMENT:
  ------------------
  |  Branch (823:9): [True: 69, False: 7.53M]
  ------------------
  824|   129k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level );
  ------------------
  |  |   23|   129k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   129k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  825|       |
  826|      0|        case ELEMENT_NOT_EMPTY:
  ------------------
  |  Branch (826:9): [True: 0, False: 7.53M]
  ------------------
  827|      0|        case FOUND_STYLE_IN_BODY:
  ------------------
  |  Branch (827:9): [True: 0, False: 7.53M]
  ------------------
  828|  8.37k|        case ILLEGAL_NESTING:
  ------------------
  |  Branch (828:9): [True: 8.37k, False: 7.52M]
  ------------------
  829|  9.13k|        case MOVED_STYLE_TO_HEAD:
  ------------------
  |  Branch (829:9): [True: 758, False: 7.53M]
  ------------------
  830|   512k|        case TRIM_EMPTY_ELEMENT:
  ------------------
  |  Branch (830:9): [True: 503k, False: 7.02M]
  ------------------
  831|   512k|        case UNEXPECTED_END_OF_FILE:
  ------------------
  |  Branch (831:9): [True: 5, False: 7.53M]
  ------------------
  832|   512k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, elemdesc );
  ------------------
  |  |   23|   512k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   512k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  833|       |
  834|  3.03k|        case OBSOLETE_ELEMENT:
  ------------------
  |  Branch (834:9): [True: 3.03k, False: 7.52M]
  ------------------
  835|  11.1k|        case REPLACING_ELEMENT:
  ------------------
  |  Branch (835:9): [True: 8.08k, False: 7.52M]
  ------------------
  836|  11.1k|        case REPLACING_UNEX_ELEMENT:
  ------------------
  |  Branch (836:9): [True: 0, False: 7.53M]
  ------------------
  837|  11.1k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, elemdesc, nodedesc );
  ------------------
  |  |   23|  11.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  838|       |
  839|      0|        case ADDED_MISSING_CHARSET:
  ------------------
  |  Branch (839:9): [True: 0, False: 7.53M]
  ------------------
  840|    194|        case BAD_SUMMARY_HTML5:
  ------------------
  |  Branch (840:9): [True: 194, False: 7.53M]
  ------------------
  841|  5.60k|        case NESTED_EMPHASIS:
  ------------------
  |  Branch (841:9): [True: 5.40k, False: 7.52M]
  ------------------
  842|  6.64k|        case PROPRIETARY_ELEMENT:
  ------------------
  |  Branch (842:9): [True: 1.04k, False: 7.53M]
  ------------------
  843|  1.63M|        case REMOVED_HTML5:
  ------------------
  |  Branch (843:9): [True: 1.62M, False: 5.90M]
  ------------------
  844|  1.73M|        case UNKNOWN_ELEMENT:
  ------------------
  |  Branch (844:9): [True: 101k, False: 7.43M]
  ------------------
  845|  1.78M|        case UNKNOWN_ELEMENT_LOOKS_CUSTOM:
  ------------------
  |  Branch (845:9): [True: 55.4k, False: 7.47M]
  ------------------
  846|  1.78M|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, nodedesc );
  ------------------
  |  |   23|  1.78M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.78M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  847|       |
  848|  1.59M|        case MISSING_ENDTAG_FOR:
  ------------------
  |  Branch (848:9): [True: 1.59M, False: 5.93M]
  ------------------
  849|  1.61M|        case MISSING_ENDTAG_OPTIONAL:
  ------------------
  |  Branch (849:9): [True: 17.3k, False: 7.51M]
  ------------------
  850|  1.74M|        case PREVIOUS_LOCATION:
  ------------------
  |  Branch (850:9): [True: 126k, False: 7.40M]
  ------------------
  851|  1.74M|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, element? element->element : NULL );
  ------------------
  |  |   23|  1.74M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.74M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (851:74): [True: 1.74M, False: 537]
  ------------------
  852|       |
  853|   769k|        case MISSING_ENDTAG_BEFORE:
  ------------------
  |  Branch (853:9): [True: 769k, False: 6.76M]
  ------------------
  854|   769k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, element? element->element : NULL, nodedesc );
  ------------------
  |  |   23|   769k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   769k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (854:74): [True: 769k, False: 0]
  ------------------
  855|       |
  856|  6.09k|        case COERCE_TO_ENDTAG:
  ------------------
  |  Branch (856:9): [True: 6.09k, False: 7.52M]
  ------------------
  857|  22.7k|        case NON_MATCHING_ENDTAG:
  ------------------
  |  Branch (857:9): [True: 16.6k, False: 7.51M]
  ------------------
  858|  22.7k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, node->element, node->element );
  ------------------
  |  |   23|  22.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  859|  2.13k|        case TOO_MANY_ELEMENTS_IN:
  ------------------
  |  Branch (859:9): [True: 2.13k, False: 7.52M]
  ------------------
  860|  2.13k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, node->element, element ? element->element : NULL);
  ------------------
  |  |   23|  2.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (860:89): [True: 2.13k, False: 0]
  ------------------
  861|       |
  862|  7.53M|    }
  863|       |
  864|      0|    return NULL;
  865|  7.53M|}
message.c:TagToString:
   42|  15.5M|{
   43|  15.5M|    *buf = 0;
   44|  15.5M|    if (tag)
  ------------------
  |  Branch (44:9): [True: 13.0M, False: 2.47M]
  ------------------
   45|  13.0M|    {
   46|  13.0M|        if (TY_(nodeIsElement)(tag))
  ------------------
  |  |   23|  13.0M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.0M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (46:13): [True: 12.7M, False: 332k]
  ------------------
   47|  12.7M|            TY_(tmbsnprintf)(buf, count, "<%s>", tag->element);
  ------------------
  |  |   23|  12.7M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.7M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   48|   332k|        else if (tag->type == EndTag)
  ------------------
  |  Branch (48:18): [True: 101k, False: 230k]
  ------------------
   49|   101k|            TY_(tmbsnprintf)(buf, count, "</%s>", tag->element);
  ------------------
  |  |   23|   101k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   101k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   50|   230k|        else if (tag->type == DocTypeTag)
  ------------------
  |  Branch (50:18): [True: 26.8k, False: 203k]
  ------------------
   51|  26.8k|            TY_(tmbsnprintf)(buf, count, "<!DOCTYPE>");
  ------------------
  |  |   23|  26.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   52|   203k|        else if (tag->type == TextNode)
  ------------------
  |  Branch (52:18): [True: 184k, False: 19.1k]
  ------------------
   53|   184k|            TY_(tmbsnprintf)(buf, count, "%s", "STRING_PLAIN_TEXT");
  ------------------
  |  |   23|   184k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   184k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   54|  19.1k|        else if (tag->type == XmlDecl)
  ------------------
  |  Branch (54:18): [True: 17.7k, False: 1.33k]
  ------------------
   55|  17.7k|            TY_(tmbsnprintf)(buf, count, "%s", "STRING_XML_DECLARATION");
  ------------------
  |  |   23|  17.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   56|  1.33k|        else if (tag->element)
  ------------------
  |  Branch (56:18): [True: 1.19k, False: 139]
  ------------------
   57|  1.19k|            TY_(tmbsnprintf)(buf, count, "%s", tag->element);
  ------------------
  |  |   23|  1.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   58|  13.0M|    }
   59|  15.5M|    return buf + TY_(tmbstrlen)(buf);
  ------------------
  |  |   23|  15.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   60|  15.5M|}
message.c:HTMLVersion:
   93|  11.6k|{
   94|  11.6k|    uint versionEmitted = doc->lexer->versionEmitted;
   95|  11.6k|    uint declared = doc->lexer->doctype;
   96|  11.6k|    uint version = versionEmitted == 0 ? declared : versionEmitted;
  ------------------
  |  Branch (96:20): [True: 0, False: 11.6k]
  ------------------
   97|  11.6k|    ctmbstr result = TY_(HTMLVersionNameFromCode)(version, 0);
  ------------------
  |  |   23|  11.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   98|  11.6k|    if (!result)
  ------------------
  |  Branch (98:9): [True: 0, False: 11.6k]
  ------------------
   99|      0|        result = tidyLocalizedString(STRING_HTML_PROPRIETARY);
  100|  11.6k|    return result;
  101|  11.6k|}
message.c:formatAttributeReport:
  533|   760k|{
  534|   760k|    AttVal *av = NULL;
  535|   760k|    char const *name = "NULL";
  536|   760k|    char const *value = "NULL";
  537|   760k|    char tagdesc[64];
  538|       |
  539|   760k|    TagToString(node, tagdesc, sizeof(tagdesc));
  540|       |
  541|   760k|    if ( ( av = va_arg(args, AttVal*) ) )
  ------------------
  |  Branch (541:10): [True: 470k, False: 290k]
  ------------------
  542|   470k|    {
  543|   470k|        if (av->attribute)
  ------------------
  |  Branch (543:13): [True: 462k, False: 8.32k]
  ------------------
  544|   462k|            name = av->attribute;
  545|   470k|        if (av->value)
  ------------------
  |  Branch (545:13): [True: 348k, False: 121k]
  ------------------
  546|   348k|            value = av->value;
  547|   470k|    }
  548|       |
  549|   760k|    switch (code)
  ------------------
  |  Branch (549:13): [True: 760k, False: 0]
  ------------------
  550|   760k|    {
  551|  39.9k|        case MISSING_QUOTEMARK_OPEN:
  ------------------
  |  Branch (551:9): [True: 39.9k, False: 720k]
  ------------------
  552|  39.9k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, name );
  ------------------
  |  |   23|  39.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  553|       |		
  554|    250|        case BACKSLASH_IN_URI:
  ------------------
  |  Branch (554:9): [True: 250, False: 760k]
  ------------------
  555|  38.5k|        case ESCAPED_ILLEGAL_URI:
  ------------------
  |  Branch (555:9): [True: 38.2k, False: 722k]
  ------------------
  556|  65.0k|        case FIXED_BACKSLASH:
  ------------------
  |  Branch (556:9): [True: 26.5k, False: 734k]
  ------------------
  557|  65.3k|        case ID_NAME_MISMATCH:
  ------------------
  |  Branch (557:9): [True: 292, False: 760k]
  ------------------
  558|   102k|        case ILLEGAL_URI_CODEPOINT:
  ------------------
  |  Branch (558:9): [True: 37.1k, False: 723k]
  ------------------
  559|   102k|        case ILLEGAL_URI_REFERENCE:
  ------------------
  |  Branch (559:9): [True: 0, False: 760k]
  ------------------
  560|   102k|        case INVALID_XML_ID:
  ------------------
  |  Branch (560:9): [True: 435, False: 760k]
  ------------------
  561|   103k|        case MISSING_IMAGEMAP:
  ------------------
  |  Branch (561:9): [True: 201, False: 760k]
  ------------------
  562|   104k|        case MISSING_QUOTEMARK:
  ------------------
  |  Branch (562:9): [True: 1.38k, False: 759k]
  ------------------
  563|   105k|        case NEWLINE_IN_URI:
  ------------------
  |  Branch (563:9): [True: 870, False: 759k]
  ------------------
  564|   107k|        case UNEXPECTED_EQUALSIGN:
  ------------------
  |  Branch (564:9): [True: 2.55k, False: 758k]
  ------------------
  565|   387k|        case UNEXPECTED_GT:
  ------------------
  |  Branch (565:9): [True: 279k, False: 480k]
  ------------------
  566|   389k|        case UNEXPECTED_QUOTEMARK:
  ------------------
  |  Branch (566:9): [True: 1.81k, False: 758k]
  ------------------
  567|   393k|        case WHITE_IN_URI:
  ------------------
  |  Branch (567:9): [True: 3.51k, False: 757k]
  ------------------
  568|   393k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc );
  ------------------
  |  |   23|   393k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   393k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  569|       |
  570|    197|        case ATTRIBUTE_IS_NOT_ALLOWED:
  ------------------
  |  Branch (570:9): [True: 197, False: 760k]
  ------------------
  571|  1.66k|        case JOINING_ATTRIBUTE:
  ------------------
  |  Branch (571:9): [True: 1.46k, False: 759k]
  ------------------
  572|  65.6k|        case MISSING_ATTR_VALUE:
  ------------------
  |  Branch (572:9): [True: 63.9k, False: 696k]
  ------------------
  573|   159k|        case PROPRIETARY_ATTRIBUTE:
  ------------------
  |  Branch (573:9): [True: 94.0k, False: 666k]
  ------------------
  574|   159k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name );
  ------------------
  |  |   23|   159k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   159k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  575|       |
  576|      0|        case ATTRIBUTE_VALUE_REPLACED:
  ------------------
  |  Branch (576:9): [True: 0, False: 760k]
  ------------------
  577|   107k|        case BAD_ATTRIBUTE_VALUE:
  ------------------
  |  Branch (577:9): [True: 107k, False: 653k]
  ------------------
  578|   108k|        case BAD_ATTRIBUTE_VALUE_REPLACED:
  ------------------
  |  Branch (578:9): [True: 847, False: 759k]
  ------------------
  579|   108k|        case INSERTING_AUTO_ATTRIBUTE:
  ------------------
  |  Branch (579:9): [True: 0, False: 760k]
  ------------------
  580|   113k|        case INVALID_ATTRIBUTE:
  ------------------
  |  Branch (580:9): [True: 4.64k, False: 756k]
  ------------------
  581|   113k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name, value );
  ------------------
  |  |   23|   113k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   113k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  582|       |
  583|      0|        case MISMATCHED_ATTRIBUTE_ERROR:
  ------------------
  |  Branch (583:9): [True: 0, False: 760k]
  ------------------
  584|  11.6k|        case MISMATCHED_ATTRIBUTE_WARN:
  ------------------
  |  Branch (584:9): [True: 11.6k, False: 749k]
  ------------------
  585|  11.6k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name, HTMLVersion(doc));
  ------------------
  |  |   23|  11.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  586|       |
  587|  2.80k|        case ANCHOR_NOT_UNIQUE:
  ------------------
  |  Branch (587:9): [True: 2.80k, False: 757k]
  ------------------
  588|  33.6k|        case ANCHOR_DUPLICATED:
  ------------------
  |  Branch (588:9): [True: 30.8k, False: 729k]
  ------------------
  589|  34.8k|        case ATTR_VALUE_NOT_LCASE:
  ------------------
  |  Branch (589:9): [True: 1.20k, False: 759k]
  ------------------
  590|  35.2k|        case PROPRIETARY_ATTR_VALUE:
  ------------------
  |  Branch (590:9): [True: 413, False: 760k]
  ------------------
  591|  35.2k|        case XML_ID_SYNTAX:
  ------------------
  |  Branch (591:9): [True: 0, False: 760k]
  ------------------
  592|  35.2k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, value );
  ------------------
  |  |   23|  35.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  593|       |
  594|  6.39k|        case REPEATED_ATTRIBUTE:
  ------------------
  |  Branch (594:9): [True: 6.39k, False: 754k]
  ------------------
  595|  6.39k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, value, name );
  ------------------
  |  |   23|  6.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  596|       |
  597|  1.34k|        case UNEXPECTED_END_OF_FILE_ATTR:
  ------------------
  |  Branch (597:9): [True: 1.34k, False: 759k]
  ------------------
  598|       |            /* on end of file adjust reported position to end of input */
  599|  1.34k|            doc->lexer->lines   = doc->docIn->curline;
  600|  1.34k|            doc->lexer->columns = doc->docIn->curcol;
  601|  1.34k|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, tagdesc );
  ------------------
  |  |   23|  1.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  602|   760k|    }
  603|       |
  604|      0|    return NULL;
  605|   760k|}
message.c:formatStandardDynamic:
  872|   246k|{
  873|   246k|    char nodedesc[ 256 ] = {0};
  874|       |
  875|   246k|    TagToString(node, nodedesc, sizeof(nodedesc));
  876|       |
  877|   246k|    switch (code)
  ------------------
  |  Branch (877:13): [True: 246k, False: 0]
  ------------------
  878|   246k|    {
  879|   246k|        case DISCARDING_UNEXPECTED:
  ------------------
  |  Branch (879:9): [True: 246k, 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|   246k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, doc->badForm ? TidyError : TidyWarning, nodedesc );
  ------------------
  |  |   23|   246k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   246k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (882:68): [True: 24.9k, False: 221k]
  ------------------
  883|      0|            break;
  884|   246k|    }
  885|       |
  886|      0|    return NULL;
  887|   246k|}
message.c:formatEncodingReport:
  616|  1.78M|{
  617|  1.78M|    char buf[ 32 ] = {'\0'};
  618|  1.78M|    uint c = va_arg( args, uint );
  619|  1.78M|    Bool discarded = va_arg( args, Bool );
  620|  1.78M|    ctmbstr action = tidyLocalizedString(discarded ? STRING_DISCARDING : STRING_REPLACING);
  ------------------
  |  Branch (620:42): [True: 7.49k, False: 1.77M]
  ------------------
  621|       |
  622|  1.78M|    switch (code)
  ------------------
  |  Branch (622:13): [True: 1.78M, False: 0]
  ------------------
  623|  1.78M|    {
  624|    814|        case INVALID_NCR:
  ------------------
  |  Branch (624:9): [True: 814, False: 1.78M]
  ------------------
  625|    814|            NtoS(c, buf);
  626|    814|            doc->badChars |= BC_INVALID_NCR;
  ------------------
  |  |  305|    814|#define BC_INVALID_NCR             64
  ------------------
  627|    814|            break;
  628|       |
  629|    923|        case INVALID_SGML_CHARS:
  ------------------
  |  Branch (629:9): [True: 923, False: 1.78M]
  ------------------
  630|    923|            NtoS(c, buf);
  631|    923|            doc->badChars |= BC_INVALID_SGML_CHARS;
  ------------------
  |  |  300|    923|#define BC_INVALID_SGML_CHARS      2
  ------------------
  632|    923|            break;
  633|       |
  634|  1.77M|        case INVALID_UTF8:
  ------------------
  |  Branch (634:9): [True: 1.77M, False: 8.66k]
  ------------------
  635|  1.77M|            TY_(tmbsnprintf)(buf, sizeof(buf), "U+%04X", c);
  ------------------
  |  |   23|  1.77M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.77M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  636|  1.77M|            doc->badChars |= BC_INVALID_UTF8;
  ------------------
  |  |  301|  1.77M|#define BC_INVALID_UTF8            4
  ------------------
  637|  1.77M|            break;
  638|       |
  639|  6.75k|        case INVALID_UTF16:
  ------------------
  |  Branch (639:9): [True: 6.75k, False: 1.77M]
  ------------------
  640|  6.75k|            TY_(tmbsnprintf)(buf, sizeof(buf), "U+%04X", c);
  ------------------
  |  |   23|  6.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  641|  6.75k|            doc->badChars |= BC_INVALID_UTF16;
  ------------------
  |  |  302|  6.75k|#define BC_INVALID_UTF16           8
  ------------------
  642|  6.75k|            break;
  643|       |
  644|      0|        case VENDOR_SPECIFIC_CHARS:
  ------------------
  |  Branch (644:9): [True: 0, False: 1.78M]
  ------------------
  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|    178|        case ENCODING_MISMATCH:
  ------------------
  |  Branch (649:9): [True: 178, False: 1.78M]
  ------------------
  650|    178|            doc->badChars |= BC_ENCODING_MISMATCH;
  ------------------
  |  |  303|    178|#define BC_ENCODING_MISMATCH       16 /* fatal error */
  ------------------
  651|    178|            return TY_(tidyMessageCreateWithLexer)(doc,
  ------------------
  |  |   23|    178|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    178|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  652|    178|                                                   code,
  653|    178|                                                   level,
  654|    178|                                                   TY_(CharEncodingName)(doc->docIn->encoding),
  ------------------
  |  |   23|    178|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    178|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  655|    178|                                                   TY_(CharEncodingName)(c));
  ------------------
  |  |   23|    178|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    178|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  656|      0|            break;
  657|  1.78M|    }
  658|       |
  659|  1.78M|    return TY_(tidyMessageCreateWithLexer)(doc, code, level, action, buf );
  ------------------
  |  |   23|  1.78M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.78M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  660|       |
  661|  1.78M|}
message.c:NtoS:
   65|  1.73k|{
   66|  1.73k|    tmbchar buf[40];
   67|  1.73k|    int i;
   68|       |    
   69|  3.47k|    for (i = 0;; ++i)
   70|  5.21k|    {
   71|  5.21k|        buf[i] = (tmbchar)( (n % 10) + '0' );
   72|       |        
   73|  5.21k|        n = n / 10;
   74|       |        
   75|  5.21k|        if (n == 0)
  ------------------
  |  Branch (75:13): [True: 1.73k, False: 3.47k]
  ------------------
   76|  1.73k|            break;
   77|  5.21k|    }
   78|       |    
   79|  1.73k|    n = i;
   80|       |    
   81|  6.94k|    while (i >= 0)
  ------------------
  |  Branch (81:12): [True: 5.21k, False: 1.73k]
  ------------------
   82|  5.21k|    {
   83|  5.21k|        str[n-i] = buf[i];
   84|  5.21k|        --i;
   85|  5.21k|    }
   86|       |    
   87|  1.73k|    str[n+1] = '\0';
   88|  1.73k|}
message.c:formatDialogue:
 1077|  25.5k|{
 1078|  25.5k|    switch (code)
 1079|  25.5k|    {
 1080|      0|        case TEXT_SGML_CHARS:
  ------------------
  |  Branch (1080:9): [True: 0, False: 25.5k]
  ------------------
 1081|      0|        case TEXT_VENDOR_CHARS:
  ------------------
  |  Branch (1081:9): [True: 0, False: 25.5k]
  ------------------
 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|  18.8k|        case STRING_ERROR_COUNT:
  ------------------
  |  Branch (1087:9): [True: 18.8k, False: 6.70k]
  ------------------
 1088|  20.2k|        case STRING_NOT_ALL_SHOWN:
  ------------------
  |  Branch (1088:9): [True: 1.36k, False: 24.1k]
  ------------------
 1089|  20.2k|            return TY_(tidyMessageCreate)( doc, code, level,
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1090|  20.2k|                                           doc->warnings, "STRING_ERROR_COUNT_WARNING",
 1091|  20.2k|                                           doc->errors, "STRING_ERROR_COUNT_ERROR" );
 1092|       |
 1093|      0|        case FOOTNOTE_TRIM_EMPTY_ELEMENT:
  ------------------
  |  Branch (1093:9): [True: 0, False: 25.5k]
  ------------------
 1094|      0|        case STRING_HELLO_ACCESS:
  ------------------
  |  Branch (1094:9): [True: 0, False: 25.5k]
  ------------------
 1095|  5.34k|        case STRING_NEEDS_INTERVENTION:
  ------------------
  |  Branch (1095:9): [True: 5.34k, False: 20.2k]
  ------------------
 1096|  5.34k|        case STRING_NO_ERRORS:
  ------------------
  |  Branch (1096:9): [True: 1, False: 25.5k]
  ------------------
 1097|  5.34k|        case TEXT_ACCESS_ADVICE1:
  ------------------
  |  Branch (1097:9): [True: 0, False: 25.5k]
  ------------------
 1098|  5.34k|        case TEXT_ACCESS_ADVICE2:
  ------------------
  |  Branch (1098:9): [True: 0, False: 25.5k]
  ------------------
 1099|  5.34k|        case TEXT_BAD_FORM:
  ------------------
  |  Branch (1099:9): [True: 0, False: 25.5k]
  ------------------
 1100|  5.34k|        case TEXT_BAD_MAIN:
  ------------------
  |  Branch (1100:9): [True: 0, False: 25.5k]
  ------------------
 1101|  5.34k|        case TEXT_GENERAL_INFO:
  ------------------
  |  Branch (1101:9): [True: 0, False: 25.5k]
  ------------------
 1102|  5.34k|        case TEXT_GENERAL_INFO_PLEA:
  ------------------
  |  Branch (1102:9): [True: 0, False: 25.5k]
  ------------------
 1103|  5.34k|        case TEXT_HTML_T_ALGORITHM:
  ------------------
  |  Branch (1103:9): [True: 0, False: 25.5k]
  ------------------
 1104|  5.34k|        case TEXT_INVALID_URI:
  ------------------
  |  Branch (1104:9): [True: 0, False: 25.5k]
  ------------------
 1105|  5.34k|        case TEXT_INVALID_UTF8:
  ------------------
  |  Branch (1105:9): [True: 0, False: 25.5k]
  ------------------
 1106|  5.34k|        case TEXT_INVALID_UTF16:
  ------------------
  |  Branch (1106:9): [True: 0, False: 25.5k]
  ------------------
 1107|  5.34k|        case TEXT_M_IMAGE_ALT:
  ------------------
  |  Branch (1107:9): [True: 0, False: 25.5k]
  ------------------
 1108|  5.34k|        case TEXT_M_IMAGE_MAP:
  ------------------
  |  Branch (1108:9): [True: 0, False: 25.5k]
  ------------------
 1109|  5.34k|        case TEXT_M_LINK_ALT:
  ------------------
  |  Branch (1109:9): [True: 0, False: 25.5k]
  ------------------
 1110|  5.34k|        case TEXT_M_SUMMARY:
  ------------------
  |  Branch (1110:9): [True: 0, False: 25.5k]
  ------------------
 1111|  5.34k|        case TEXT_USING_BODY:
  ------------------
  |  Branch (1111:9): [True: 0, False: 25.5k]
  ------------------
 1112|  5.34k|        case TEXT_USING_FONT:
  ------------------
  |  Branch (1112:9): [True: 0, False: 25.5k]
  ------------------
 1113|  5.34k|        case TEXT_USING_FRAMES:
  ------------------
  |  Branch (1113:9): [True: 0, False: 25.5k]
  ------------------
 1114|  5.34k|        case TEXT_USING_LAYER:
  ------------------
  |  Branch (1114:9): [True: 0, False: 25.5k]
  ------------------
 1115|  5.34k|        case TEXT_USING_NOBR:
  ------------------
  |  Branch (1115:9): [True: 0, False: 25.5k]
  ------------------
 1116|  5.34k|        case TEXT_USING_SPACER:
  ------------------
  |  Branch (1116:9): [True: 0, False: 25.5k]
  ------------------
 1117|  5.34k|        default:
  ------------------
  |  Branch (1117:9): [True: 0, False: 25.5k]
  ------------------
 1118|  5.34k|            return TY_(tidyMessageCreate)( doc, code, level );
  ------------------
  |  |   23|  5.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1119|  25.5k|    }
 1120|       |    
 1121|      0|    return NULL;
 1122|  25.5k|}
message.c:messageOut:
  116|  10.3M|{
  117|  10.3M|    TidyDocImpl *doc;
  118|  10.3M|    Bool go = yes;
  119|       |
  120|  10.3M|    if ( !message )
  ------------------
  |  Branch (120:10): [True: 0, False: 10.3M]
  ------------------
  121|      0|        return;
  122|       |
  123|  10.3M|    doc = message->tidyDoc;
  124|       |
  125|       |    /* The filter has had a chance to suppress *any* message from output. */
  126|  10.3M|    go = message->allowMessage;
  127|       |
  128|       |    /* Update the count of each report type. */
  129|  10.3M|    switch ( message->level )
  130|  10.3M|    {
  131|   222k|        case TidyInfo:
  ------------------
  |  Branch (131:9): [True: 222k, False: 10.1M]
  ------------------
  132|   222k|            doc->infoMessages++;
  133|   222k|            break;
  134|  9.91M|        case TidyWarning:
  ------------------
  |  Branch (134:9): [True: 9.91M, False: 430k]
  ------------------
  135|  9.91M|            doc->warnings++;
  136|  9.91M|            break;
  137|      0|        case TidyConfig:
  ------------------
  |  Branch (137:9): [True: 0, False: 10.3M]
  ------------------
  138|      0|            doc->optionErrors++;
  139|      0|            break;
  140|      0|        case TidyAccess:
  ------------------
  |  Branch (140:9): [True: 0, False: 10.3M]
  ------------------
  141|      0|            doc->accessErrors++;
  142|      0|            break;
  143|   182k|        case TidyError:
  ------------------
  |  Branch (143:9): [True: 182k, False: 10.1M]
  ------------------
  144|   182k|            doc->errors++;
  145|   182k|            break;
  146|      0|        case TidyBadDocument:
  ------------------
  |  Branch (146:9): [True: 0, False: 10.3M]
  ------------------
  147|      0|            doc->docErrors++;
  148|      0|            break;
  149|      0|        case TidyFatal:
  ------------------
  |  Branch (149:9): [True: 0, False: 10.3M]
  ------------------
  150|       |            /* Ack! */
  151|      0|            break;
  152|  25.5k|        default:
  ------------------
  |  Branch (152:9): [True: 25.5k, False: 10.3M]
  ------------------
  153|  25.5k|            break;
  154|  10.3M|    }
  155|       |
  156|       |    /* Suppress report messages if they've been muted. */
  157|  10.3M|    go = go & !message->muted;
  158|       |
  159|       |    /* Suppress report messages if we've already reached the reporting limit. */
  160|  10.3M|    if ( message->level <= TidyFatal )
  ------------------
  |  Branch (160:10): [True: 10.3M, False: 25.5k]
  ------------------
  161|  10.3M|    {
  162|  10.3M|        go = go & ( doc->errors < cfg(doc, TidyShowErrors) );
  ------------------
  |  |  415|  10.3M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  163|  10.3M|    }
  164|       |
  165|       |    /* Let TidyQuiet silence a lot of things. */
  166|  10.3M|    if ( cfgBool( doc, TidyQuiet ) == yes )
  ------------------
  |  |  418|  10.3M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  10.3M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (166:10): [True: 0, False: 10.3M]
  ------------------
  167|      0|    {
  168|      0|        go = go && message->code != STRING_DOCTYPE_GIVEN;
  ------------------
  |  Branch (168:14): [True: 0, False: 0]
  |  Branch (168:20): [True: 0, False: 0]
  ------------------
  169|      0|        go = go && message->code != STRING_CONTENT_LOOKS;
  ------------------
  |  Branch (169:14): [True: 0, False: 0]
  |  Branch (169:20): [True: 0, False: 0]
  ------------------
  170|      0|        go = go && message->code != STRING_NO_SYSID;
  ------------------
  |  Branch (170:14): [True: 0, False: 0]
  |  Branch (170:20): [True: 0, False: 0]
  ------------------
  171|      0|        go = go && message->level != TidyDialogueInfo;
  ------------------
  |  Branch (171:14): [True: 0, False: 0]
  |  Branch (171:20): [True: 0, False: 0]
  ------------------
  172|      0|        go = go && message->level != TidyConfig;
  ------------------
  |  Branch (172:14): [True: 0, False: 0]
  |  Branch (172:20): [True: 0, False: 0]
  ------------------
  173|      0|        go = go && message->level != TidyInfo;
  ------------------
  |  Branch (173:14): [True: 0, False: 0]
  |  Branch (173:20): [True: 0, False: 0]
  ------------------
  174|      0|        go = go && !(message->level >= TidyDialogueSummary &&
  ------------------
  |  Branch (174:14): [True: 0, False: 0]
  |  Branch (174:22): [True: 0, False: 0]
  ------------------
  175|      0|                            message->code != STRING_NEEDS_INTERVENTION);
  ------------------
  |  Branch (175:29): [True: 0, False: 0]
  ------------------
  176|      0|    }
  177|       |
  178|       |    /* Let !TidyShowInfo silence some things. */
  179|  10.3M|    if ( cfgBool( doc, TidyShowInfo ) == no )
  ------------------
  |  |  418|  10.3M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  10.3M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (179:10): [True: 0, False: 10.3M]
  ------------------
  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|  10.3M|    if ( cfgBool( doc, TidyShowWarnings ) == no )
  ------------------
  |  |  418|  10.3M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  10.3M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (190:10): [True: 0, False: 10.3M]
  ------------------
  191|      0|    {
  192|      0|        go = go && message->level != TidyWarning;
  ------------------
  |  Branch (192:14): [True: 0, False: 0]
  |  Branch (192:20): [True: 0, False: 0]
  ------------------
  193|      0|    }
  194|       |
  195|       |    /* Output the message if applicable. */
  196|  10.3M|    if ( go )
  ------------------
  |  Branch (196:10): [True: 4.30M, False: 6.03M]
  ------------------
  197|  4.30M|    {
  198|  4.30M|        TidyOutputSink *outp = &doc->errout->sink;
  199|  4.30M|        ctmbstr cp;
  200|  4.30M|        byte b = '\0';
  201|   329M|        for ( cp = message->messageOutput; *cp; ++cp )
  ------------------
  |  Branch (201:44): [True: 325M, False: 4.30M]
  ------------------
  202|   325M|        {
  203|   325M|            b = (*cp & 0xff);
  204|   325M|            if (b == (byte)'\n')
  ------------------
  |  Branch (204:17): [True: 52.3k, False: 325M]
  ------------------
  205|  52.3k|                TY_(WriteChar)( b, doc->errout );   /* for EOL translation */
  ------------------
  |  |   23|  52.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  52.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  206|   325M|            else
  207|   325M|                outp->putByte( outp->sinkData, b ); /* #383 - no encoding */
  208|   325M|        }
  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|  4.30M|        TY_(WriteChar)( '\n', doc->errout );
  ------------------
  |  |   23|  4.30M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.30M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  214|  4.30M|    }
  215|       |
  216|  10.3M|    TY_(tidyMessageRelease)(message);
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  217|  10.3M|}

prvTidytidyMessageCreate:
  245|  45.8k|{
  246|  45.8k|    TidyMessageImpl *result;
  247|  45.8k|    va_list args;
  248|  45.8k|    va_start(args, level);
  249|  45.8k|    result = tidyMessageCreateInitV(doc, NULL, code, 0, 0, level, args);
  250|  45.8k|    va_end(args);
  251|       |    
  252|  45.8k|    return result;
  253|  45.8k|}
prvTidytidyMessageCreateWithNode:
  261|  8.26M|{
  262|  8.26M|    TidyMessageImpl *result;
  263|  8.26M|    va_list args_copy;
  264|  8.26M|    int line = ( node ? node->line :
  ------------------
  |  Branch (264:18): [True: 8.18M, False: 77.0k]
  ------------------
  265|  8.26M|                ( doc->lexer ? doc->lexer->lines : 0 ) );
  ------------------
  |  Branch (265:19): [True: 77.0k, False: 0]
  ------------------
  266|  8.26M|    int col  = ( node ? node->column :
  ------------------
  |  Branch (266:18): [True: 8.18M, False: 77.0k]
  ------------------
  267|  8.26M|                ( doc->lexer ? doc->lexer->columns : 0 ) );
  ------------------
  |  Branch (267:19): [True: 77.0k, False: 0]
  ------------------
  268|       |    
  269|  8.26M|    va_start(args_copy, level);
  270|  8.26M|    result = tidyMessageCreateInitV(doc, node, code, line, col, level, args_copy);
  271|  8.26M|    va_end(args_copy);
  272|       |    
  273|  8.26M|    return result;
  274|  8.26M|}
prvTidytidyMessageCreateWithLexer:
  281|  2.03M|{
  282|  2.03M|    TidyMessageImpl *result;
  283|  2.03M|    va_list args_copy;
  284|  2.03M|    int line = ( doc->lexer ? doc->lexer->lines : 0 );
  ------------------
  |  Branch (284:18): [True: 2.03M, False: 0]
  ------------------
  285|  2.03M|    int col  = ( doc->lexer ? doc->lexer->columns : 0 );
  ------------------
  |  Branch (285:18): [True: 2.03M, False: 0]
  ------------------
  286|       |    
  287|  2.03M|    va_start(args_copy, level);
  288|  2.03M|    result = tidyMessageCreateInitV(doc, NULL, code, line, col, level, args_copy);
  289|  2.03M|    va_end(args_copy);
  290|       |    
  291|  2.03M|    return result;
  292|  2.03M|}
prvTidytidyMessageRelease:
  296|  10.3M|{
  297|  10.3M|    if ( !message )
  ------------------
  |  Branch (297:10): [True: 0, False: 10.3M]
  ------------------
  298|      0|        return;
  299|  10.3M|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->arguments );
  ------------------
  |  |  159|  10.3M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  10.3M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  300|  10.3M|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->messageDefault );
  ------------------
  |  |  159|  10.3M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  10.3M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  301|  10.3M|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->message );
  ------------------
  |  |  159|  10.3M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  10.3M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  302|  10.3M|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->messagePosDefault );
  ------------------
  |  |  159|  10.3M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  10.3M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  303|  10.3M|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->messagePos );
  ------------------
  |  |  159|  10.3M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  10.3M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  304|  10.3M|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->messageOutputDefault );
  ------------------
  |  |  159|  10.3M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  10.3M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  305|  10.3M|    TidyDocFree( tidyDocToImpl(message->tidyDoc), message->messageOutput );
  ------------------
  |  |  159|  10.3M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  10.3M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  306|  10.3M|    TidyDocFree(tidyDocToImpl(message->tidyDoc), message); /* Issue #597 - and discard the message structure */
  ------------------
  |  |  159|  10.3M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  10.3M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  307|  10.3M|}
messageobj.c:tidyMessageCreateInitV:
   81|  10.3M|{
   82|  10.3M|    TidyMessageImpl *result = TidyDocAlloc(doc, sizeof(TidyMessageImpl));
  ------------------
  |  |  157|  10.3M|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  10.3M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
   83|  10.3M|    TidyDoc tdoc = tidyImplToDoc(doc);
  ------------------
  |  |  141|  10.3M|#define tidyImplToDoc( doc )            ((TidyDoc)(doc))
  ------------------
   84|  10.3M|    va_list args_copy;
   85|  10.3M|    enum { sizeMessageBuf=2048 };
   86|  10.3M|    ctmbstr pattern;
   87|  10.3M|    uint i = 0;
   88|       |
   89|       |
   90|       |    /* Things we know... */
   91|       |
   92|  10.3M|    result->tidyDoc = doc;
   93|  10.3M|    result->tidyNode = node;
   94|  10.3M|    result->code = code;
   95|  10.3M|    result->line = line;
   96|  10.3M|    result->column = column;
   97|  10.3M|    result->level = level;
   98|       |    /* Is #719 - set 'muted' before any callbacks. */
   99|  10.3M|    result->muted = no;
  100|  10.3M|    i = 0;
  101|  10.3M|    while ((doc->muted.list) && (doc->muted.list[i] != 0))
  ------------------
  |  Branch (101:12): [True: 0, False: 10.3M]
  |  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|  10.3M|    va_copy(args_copy, args);
  114|  10.3M|    result->arguments = BuildArgArray(doc, tidyDefaultString(code), args_copy, &result->argcount);
  115|  10.3M|    va_end(args_copy);
  116|       |
  117|  10.3M|    result->messageKey = TY_(tidyErrorCodeAsKey)(code);
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  118|       |
  119|  10.3M|    result->messageFormatDefault = tidyDefaultString(code);
  120|  10.3M|    result->messageFormat = tidyLocalizedString(code);
  121|       |
  122|  10.3M|    result->messageDefault = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|  10.3M|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  10.3M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  123|  10.3M|    va_copy(args_copy, args);
  124|  10.3M|    TY_(tmbvsnprintf)(result->messageDefault, sizeMessageBuf, result->messageFormatDefault, args_copy);
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  125|  10.3M|    va_end(args_copy);
  126|       |
  127|  10.3M|    result->message = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|  10.3M|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  10.3M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  128|  10.3M|    va_copy(args_copy, args);
  129|  10.3M|    TY_(tmbvsnprintf)(result->message, sizeMessageBuf, result->messageFormat, args_copy);
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  130|  10.3M|    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|  10.3M|    TY_(strrep)(result->messageDefault, "STRING_PLAIN_TEXT",      tidyDefaultString(STRING_PLAIN_TEXT));
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  136|  10.3M|    TY_(strrep)(result->message,        "STRING_PLAIN_TEXT",      tidyLocalizedString(STRING_PLAIN_TEXT));
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  137|       |
  138|  10.3M|    TY_(strrep)(result->messageDefault, "STRING_XML_DECLARATION", tidyDefaultString(STRING_XML_DECLARATION));
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  139|  10.3M|    TY_(strrep)(result->message,        "STRING_XML_DECLARATION", tidyLocalizedString(STRING_XML_DECLARATION));
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  140|       |
  141|  10.3M|    TY_(strrep)(result->messageDefault, "STRING_ERROR_COUNT_WARNING", tidyDefaultStringN(STRING_ERROR_COUNT_WARNING, doc->warnings));
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  142|  10.3M|    TY_(strrep)(result->message,        "STRING_ERROR_COUNT_WARNING", tidyLocalizedStringN(STRING_ERROR_COUNT_WARNING, doc->warnings));
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  143|       |
  144|  10.3M|    TY_(strrep)(result->messageDefault, "STRING_ERROR_COUNT_ERROR", tidyDefaultStringN(STRING_ERROR_COUNT_ERROR, doc->errors));
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  145|  10.3M|    TY_(strrep)(result->message,        "STRING_ERROR_COUNT_ERROR", tidyLocalizedStringN(STRING_ERROR_COUNT_ERROR, doc->errors));
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  146|       |
  147|       |
  148|  10.3M|    result->messagePosDefault = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|  10.3M|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  10.3M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  149|  10.3M|    result->messagePos = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|  10.3M|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  10.3M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  150|       |
  151|  10.3M|    if ( cfgBool(doc, TidyEmacs) && cfgStr(doc, TidyEmacsFile) )
  ------------------
  |  |  418|  20.6M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  10.3M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 10.3M]
  |  |  ------------------
  ------------------
                  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|  10.3M|    else if ( cfgBool(doc, TidyShowFilename) && cfgStr(doc, TidyEmacsFile) )
  ------------------
  |  |  418|  20.6M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  10.3M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 10.3M]
  |  |  ------------------
  ------------------
                  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|  10.3M|    else
  166|  10.3M|    {
  167|       |        /* traditional format */
  168|  10.3M|        TY_(tmbsnprintf)(result->messagePosDefault, sizeMessageBuf, tidyDefaultString(LINE_COLUMN_STRING), line, column);
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  169|  10.3M|        TY_(tmbsnprintf)(result->messagePos, sizeMessageBuf, tidyLocalizedString(LINE_COLUMN_STRING), line, column);
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  170|  10.3M|    }
  171|       |
  172|  10.3M|    result->messagePrefixDefault = tidyDefaultString(level);
  173|       |
  174|  10.3M|    result->messagePrefix = tidyLocalizedString(level);
  175|       |
  176|  10.3M|    if ( line > 0 && column > 0 )
  ------------------
  |  Branch (176:10): [True: 10.3M, False: 46.1k]
  |  Branch (176:22): [True: 10.3M, False: 375]
  ------------------
  177|  10.3M|        pattern = "%s%s%s";      /* pattern if there's location information */
  178|  46.5k|    else
  179|  46.5k|        pattern = "%.0s%s%s";    /* otherwise if there isn't */
  180|       |
  181|  10.3M|    if ( level > TidyFatal )
  ------------------
  |  Branch (181:10): [True: 25.5k, False: 10.3M]
  ------------------
  182|  25.5k|        pattern = "%.0s%.0s%s";  /* dialog doesn't have pos or prefix */
  183|       |
  184|  10.3M|    result->messageOutputDefault = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|  10.3M|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  10.3M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  185|  10.3M|    TY_(tmbsnprintf)(result->messageOutputDefault, sizeMessageBuf, pattern,
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  186|  10.3M|                     result->messagePosDefault, result->messagePrefixDefault,
  187|  10.3M|                     result->messageDefault);
  188|       |
  189|  10.3M|    result->messageOutput = TidyDocAlloc(doc, sizeMessageBuf);
  ------------------
  |  |  157|  10.3M|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  10.3M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  190|  10.3M|    TY_(tmbsnprintf)(result->messageOutput, sizeMessageBuf, pattern,
  ------------------
  |  |   23|  10.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  191|  10.3M|                     result->messagePos, result->messagePrefix,
  192|  10.3M|                     result->message);
  193|       |
  194|  10.3M|    if ( ( cfgBool(doc, TidyMuteShow) == yes ) && level <= TidyFatal )
  ------------------
  |  |  418|  10.3M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  10.3M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (194:10): [True: 0, False: 10.3M]
  |  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|  10.3M|    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|  10.3M|    if ( (result->level <= TidyFatal) && doc->reportFilter )
  ------------------
  |  Branch (214:10): [True: 10.3M, False: 25.5k]
  |  Branch (214:42): [True: 0, False: 10.3M]
  ------------------
  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|  10.3M|    if ( (result->level <= TidyFatal) && doc->reportCallback )
  ------------------
  |  Branch (222:10): [True: 10.3M, False: 25.5k]
  |  Branch (222:42): [True: 0, False: 10.3M]
  ------------------
  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|  10.3M|    if ( doc->messageCallback )
  ------------------
  |  Branch (232:10): [True: 0, False: 10.3M]
  ------------------
  233|      0|    {
  234|      0|        result->allowMessage = result->allowMessage & doc->messageCallback( tidyImplToMessage(result) );
  ------------------
  |  |  144|      0|#define tidyImplToMessage( message )    ((TidyMessage)(message))
  ------------------
  235|      0|    }
  236|       |
  237|  10.3M|    return result;
  238|  10.3M|}
messageobj.c:BuildArgArray:
  517|  10.3M|{
  518|  10.3M|    int number = 0; /* the quantity of valid arguments found; returned as rv. */
  519|  10.3M|    int cn = -1;    /* keeps track of which parameter index is current. */
  520|  10.3M|    int i = 0;      /* typical index. */
  521|  10.3M|    int pos = -1;   /* starting position of current argument. */
  522|  10.3M|    const char* p;  /* current position in format string. */
  523|  10.3M|    char c;         /* current character. */
  524|  10.3M|    struct printfArg* nas;
  525|       |    
  526|       |    /* first pass: determine number of valid % to allocate space. */
  527|       |    
  528|  10.3M|    p = fmt;
  529|  10.3M|    *rv = 0;
  530|       |    
  531|   271M|    while( ( c = *p++ ) != 0 )
  ------------------
  |  Branch (531:12): [True: 261M, False: 10.3M]
  ------------------
  532|   261M|    {
  533|   261M|        if( c != '%' )
  ------------------
  |  Branch (533:13): [True: 247M, False: 13.4M]
  ------------------
  534|   247M|            continue;
  535|       |        
  536|  13.4M|        if( ( c = *p++ ) == '%' )	/* skip %% case */
  ------------------
  |  Branch (536:13): [True: 0, False: 13.4M]
  ------------------
  537|      0|            continue;
  538|  13.4M|        else
  539|  13.4M|            number++;
  540|  13.4M|    }
  541|       |        
  542|       |
  543|  10.3M|    if( number == 0 )
  ------------------
  |  Branch (543:9): [True: 183k, False: 10.1M]
  ------------------
  544|   183k|        return NULL;
  545|       |
  546|       |    
  547|  10.1M|    nas = (struct printfArg*)TidyDocAlloc( doc, number * sizeof( struct printfArg ) );
  ------------------
  |  |  157|  10.1M|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  10.1M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  548|  10.1M|    if( !nas )
  ------------------
  |  Branch (548:9): [True: 0, False: 10.1M]
  ------------------
  549|      0|    {
  550|      0|        *rv = -1;
  551|      0|        return NULL;
  552|      0|    }
  553|       |
  554|       |
  555|  23.5M|    for( i = 0; i < number; i++ )
  ------------------
  |  Branch (555:17): [True: 13.4M, False: 10.1M]
  ------------------
  556|  13.4M|    {
  557|  13.4M|        nas[i].type = tidyFormatType_UNKNOWN;
  558|  13.4M|    }
  559|       |    
  560|       |    
  561|       |    /* second pass: set nas[].type and location. */
  562|       |    
  563|  10.1M|    p = fmt;
  564|   264M|    while( ( c = *p++ ) != 0 )
  ------------------
  |  Branch (564:12): [True: 254M, False: 10.1M]
  ------------------
  565|   254M|    {
  566|   254M|        if( c != '%' )
  ------------------
  |  Branch (566:13): [True: 240M, False: 13.4M]
  ------------------
  567|   240M|            continue;
  568|       |        
  569|  13.4M|        if( ( c = *p++ ) == '%' )
  ------------------
  |  Branch (569:13): [True: 0, False: 13.4M]
  ------------------
  570|      0|            continue; /* skip %% case */
  571|       |
  572|  13.4M|        pos = p - fmt - 2; /* p already incremented twice */
  573|       |
  574|       |        /* width -- width via parameter */
  575|  13.4M|        if (c == '*')
  ------------------
  |  Branch (575:13): [True: 0, False: 13.4M]
  ------------------
  576|      0|        {
  577|       |            /* not supported feature */
  578|      0|            *rv = -1;
  579|      0|            break;
  580|      0|        }
  581|       |        
  582|       |        /* width field -- skip */
  583|  13.4M|        while ((c >= '0') && (c <= '9'))
  ------------------
  |  Branch (583:16): [True: 13.4M, False: 0]
  |  Branch (583:30): [True: 77.0k, False: 13.4M]
  ------------------
  584|  77.0k|        {
  585|  77.0k|            c = *p++;
  586|  77.0k|        }
  587|       |        
  588|       |        /* precision */
  589|  13.4M|        if (c == '.')
  ------------------
  |  Branch (589:13): [True: 0, False: 13.4M]
  ------------------
  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|  13.4M|        cn++;
  606|       |        
  607|       |        /* size and format */
  608|  13.4M|        nas[cn].type = tidyFormatType_UINT;
  609|  13.4M|        switch (c)
  610|  13.4M|        {
  611|      0|            case 'c': /* unsigned int (char) */
  ------------------
  |  Branch (611:13): [True: 0, False: 13.4M]
  ------------------
  612|  40.4k|            case 'u': /* unsigned int */
  ------------------
  |  Branch (612:13): [True: 40.4k, False: 13.3M]
  ------------------
  613|  78.9k|            case 'X': /* unsigned int as hex */
  ------------------
  |  Branch (613:13): [True: 38.5k, False: 13.3M]
  ------------------
  614|  78.9k|            case 'x': /* unsigned int as hex */
  ------------------
  |  Branch (614:13): [True: 0, False: 13.4M]
  ------------------
  615|  78.9k|            case 'o': /* octal */
  ------------------
  |  Branch (615:13): [True: 0, False: 13.4M]
  ------------------
  616|  78.9k|                nas[cn].u.ui = va_arg( ap, unsigned int );
  617|  78.9k|                break;
  618|       |
  619|      0|            case 'd': /* signed int */
  ------------------
  |  Branch (619:13): [True: 0, False: 13.4M]
  ------------------
  620|      0|            case 'i': /* signed int */
  ------------------
  |  Branch (620:13): [True: 0, False: 13.4M]
  ------------------
  621|      0|                nas[cn].type = tidyFormatType_INT;
  622|      0|                nas[cn].u.i = va_arg( ap, int );
  623|      0|                break;
  624|       |
  625|       |
  626|  13.3M|            case 's': /* string */
  ------------------
  |  Branch (626:13): [True: 13.3M, False: 78.9k]
  ------------------
  627|  13.3M|                nas[cn].type = tidyFormatType_STRING;
  628|  13.3M|                nas[cn].u.s = va_arg( ap, char* );
  629|  13.3M|                break;
  630|       |
  631|      0|            case 'e': /* double */
  ------------------
  |  Branch (631:13): [True: 0, False: 13.4M]
  ------------------
  632|      0|            case 'E': /* double */
  ------------------
  |  Branch (632:13): [True: 0, False: 13.4M]
  ------------------
  633|      0|            case 'f': /* double */
  ------------------
  |  Branch (633:13): [True: 0, False: 13.4M]
  ------------------
  634|      0|            case 'F': /* double */
  ------------------
  |  Branch (634:13): [True: 0, False: 13.4M]
  ------------------
  635|      0|            case 'g': /* double */
  ------------------
  |  Branch (635:13): [True: 0, False: 13.4M]
  ------------------
  636|      0|            case 'G': /* double */
  ------------------
  |  Branch (636:13): [True: 0, False: 13.4M]
  ------------------
  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: 13.4M]
  ------------------
  642|      0|                nas[cn].type = tidyFormatType_UNKNOWN;
  643|      0|                *rv = -1;
  644|      0|                break;
  645|  13.4M|        }
  646|       |
  647|       |        /* position and format */
  648|  13.4M|        nas[cn].formatStart = pos;
  649|  13.4M|        nas[cn].formatLength = (p - fmt) - pos;
  650|       |        
  651|       |        /* the format string exceeds the buffer length */
  652|  13.4M|        if ( nas[cn].formatLength >= FORMAT_LENGTH )
  ------------------
  |  |   27|  13.4M|#define FORMAT_LENGTH 21
  ------------------
  |  Branch (652:14): [True: 0, False: 13.4M]
  ------------------
  653|      0|        {
  654|      0|            *rv = -1;
  655|      0|            break;
  656|      0|        }
  657|  13.4M|        else
  658|  13.4M|        {
  659|  13.4M|            strncpy(nas[cn].format, fmt + nas[cn].formatStart, nas[cn].formatLength);
  660|  13.4M|            nas[cn].format[nas[cn].formatLength] = 0; /* Is. #800 - If count <= srcLen, no 0 added! */
  661|  13.4M|        }
  662|       |        
  663|       |
  664|       |        /* Something's not right. */
  665|  13.4M|        if( nas[cn].type == tidyFormatType_UNKNOWN )
  ------------------
  |  Branch (665:13): [True: 0, False: 13.4M]
  ------------------
  666|      0|        {
  667|      0|            *rv = -1;
  668|      0|            break;
  669|      0|        }
  670|  13.4M|    }
  671|       |    
  672|       |    
  673|       |    /* third pass: fill the nas[cn].ap */
  674|       |    
  675|  10.1M|    if( *rv < 0 )
  ------------------
  |  Branch (675:9): [True: 0, False: 10.1M]
  ------------------
  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|  10.1M|    *rv = number;
  682|  10.1M|    return nas;
  683|  10.1M|}

prvTidyInitParserStack:
  843|  20.2k|{
  844|  20.2k|    enum { default_size = 32 };
  845|  20.2k|    TidyParserMemory *content = (TidyParserMemory *) TidyAlloc( doc->allocator, sizeof(TidyParserMemory) * default_size );
  ------------------
  |  |   66|  20.2k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  846|       |
  847|  20.2k|    doc->stack.content = content;
  848|  20.2k|    doc->stack.size = default_size;
  849|  20.2k|    doc->stack.top = -1;
  850|  20.2k|}
prvTidyFreeParserStack:
  857|  20.2k|{
  858|  20.2k|    TidyFree( doc->allocator, doc->stack.content );
  ------------------
  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  859|       |
  860|       |    doc->stack.content = NULL;
  861|  20.2k|    doc->stack.size = 0;
  862|  20.2k|    doc->stack.top = -1;
  863|  20.2k|}
prvTidyisEmptyParserStack:
  886|  5.34M|{
  887|  5.34M|    return doc->stack.top < 0;
  888|  5.34M|}
prvTidypeekMemoryIdentity:
  905|  2.66M|{
  906|  2.66M|    return doc->stack.content[doc->stack.top].identity;
  907|  2.66M|}
prvTidypeekMemoryMode:
  915|  21.1k|{
  916|  21.1k|    return doc->stack.content[doc->stack.top].mode;
  917|  21.1k|}
prvTidypopMemory:
  924|  2.66M|{
  925|  2.66M|    if ( !TY_(isEmptyParserStack)( doc ) )
  ------------------
  |  |   23|  2.66M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.66M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (925:10): [True: 2.66M, False: 0]
  ------------------
  926|  2.66M|    {
  927|  2.66M|        TidyParserMemory data = doc->stack.content[doc->stack.top];
  928|  2.66M|        DEBUG_LOG(SPRTF("\n"
  929|  2.66M|                        "<--POP  original: %s @ %p\n"
  930|  2.66M|                        "         reentry: %s @ %p\n"
  931|  2.66M|                        "     stack depth: %lu @ %p\n"
  932|  2.66M|                        "            mode: %u\n"
  933|  2.66M|                        "      register 1: %i\n"
  934|  2.66M|                        "      register 2: %i\n\n",
  935|  2.66M|                        data.original_node ? data.original_node->element : "none", data.original_node,
  936|  2.66M|                        data.reentry_node ? data.reentry_node->element : "none", data.reentry_node,
  937|  2.66M|                        doc->stack.top, &doc->stack.content[doc->stack.top],
  938|  2.66M|                        data.mode,
  939|  2.66M|                        data.register_1,
  940|  2.66M|                        data.register_2
  941|  2.66M|                        ));
  942|  2.66M|        doc->stack.top = doc->stack.top - 1;
  943|  2.66M|        return data;
  944|  2.66M|    }
  945|      0|    TidyParserMemory blank = { NULL };
  946|      0|    return blank;
  947|  2.66M|}
prvTidypushMemory:
  954|  2.86M|{
  955|  2.86M|    if ( doc->stack.top == doc->stack.size - 1 )
  ------------------
  |  Branch (955:10): [True: 4.24k, False: 2.85M]
  ------------------
  956|  4.24k|        growParserStack( doc );
  957|       |
  958|  2.86M|    doc->stack.top++;
  959|       |    
  960|  2.86M|    doc->stack.content[doc->stack.top] = data;
  961|  2.86M|    DEBUG_LOG(SPRTF("\n"
  962|  2.86M|                    "-->PUSH original: %s @ %p\n"
  963|  2.86M|                    "         reentry: %s @ %p\n"
  964|  2.86M|                    "     stack depth: %lu @ %p\n"
  965|  2.86M|                    "            mode: %u\n"
  966|  2.86M|                    "      register 1: %i\n"
  967|  2.86M|                    "      register 2: %i\n\n",
  968|  2.86M|                    data.original_node ? data.original_node->element : "none", data.original_node,
  969|  2.86M|                    data.reentry_node ? data.reentry_node->element : "none", data.reentry_node,
  970|  2.86M|                    doc->stack.top, &doc->stack.content[doc->stack.top],
  971|  2.86M|                    data.mode,
  972|  2.86M|                    data.register_1,
  973|  2.86M|                    data.register_2
  974|  2.86M|                    ));
  975|  2.86M|}
ParseHTMLWithNode:
 1064|  20.2k|{
 1065|  20.2k|    GetTokenMode mode = IgnoreWhitespace;
 1066|  20.2k|    Parser* parser = GetParserForNode( doc, node );
 1067|  20.2k|    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|  5.55M|    while (something_to_do)
  ------------------
  |  Branch (1075:12): [True: 5.53M, False: 20.2k]
  ------------------
 1076|  5.53M|    {
 1077|  5.53M|        node = parser ? parser( doc, node, mode ) : NULL;
  ------------------
  |  Branch (1077:16): [True: 5.52M, False: 15.1k]
  ------------------
 1078|       |        
 1079|       |        /*
 1080|       |         We have a node, so anything deferred was already pushed to the stack
 1081|       |         to be dealt with later.
 1082|       |         */
 1083|  5.53M|        if ( node )
  ------------------
  |  Branch (1083:14): [True: 2.86M, False: 2.67M]
  ------------------
 1084|  2.86M|        {
 1085|  2.86M|            parser = GetParserForNode( doc, node );
 1086|  2.86M|            continue;
 1087|  2.86M|        }
 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|  2.67M|        if ( !TY_(isEmptyParserStack)(doc))
  ------------------
  |  |   23|  2.67M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.67M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1093:14): [True: 2.66M, False: 8.49k]
  ------------------
 1094|  2.66M|        {
 1095|  2.66M|            parser = TY_(peekMemoryIdentity)(doc);
  ------------------
  |  |   23|  2.66M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.66M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1096|  2.66M|            if (parser)
  ------------------
  |  Branch (1096:17): [True: 2.64M, False: 21.1k]
  ------------------
 1097|  2.64M|            {
 1098|  2.64M|                continue;
 1099|  2.64M|            }
 1100|  21.1k|            else
 1101|  21.1k|            {
 1102|       |                /* No parser means we're only passing back a parsing mode. */
 1103|  21.1k|                mode = TY_(peekMemoryMode)( doc );
  ------------------
  |  |   23|  21.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1104|  21.1k|                TY_(popMemory)( doc );
  ------------------
  |  |   23|  21.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1105|  21.1k|            }
 1106|  2.66M|        }
 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|  29.6k|        node = TY_(GetToken)( doc, mode );
  ------------------
  |  |   23|  29.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1113|  29.6k|        DEBUG_LOG_GOT_TOKEN(node);
 1114|       |
 1115|  29.6k|        if (node)
  ------------------
  |  Branch (1115:13): [True: 9.39k, False: 20.2k]
  ------------------
 1116|  9.39k|            parser = GetParserForNode( doc, node );
 1117|  20.2k|        else
 1118|  20.2k|            something_to_do = no;
 1119|  29.6k|    }
 1120|  20.2k|}
prvTidyParseBlock:
 1138|   336k|{
 1139|   336k|    Lexer* lexer = doc->lexer;
 1140|   336k|    Node *node = NULL;
 1141|   336k|    Bool checkstack = yes;
 1142|   336k|    uint istackbase = 0;
 1143|   336k|    DEBUG_LOG_COUNTERS;
 1144|       |    
 1145|   336k|    if ( element == NULL )
  ------------------
  |  Branch (1145:10): [True: 162k, False: 174k]
  ------------------
 1146|   162k|    {
 1147|   162k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|   162k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   162k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1148|   162k|        node = memory.reentry_node; /* Throwaway, because the loop overwrites this immediately. */
 1149|   162k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 1150|   162k|        element = memory.original_node;
 1151|   162k|        DEBUG_LOG_GET_OLD_MODE;
 1152|   162k|        mode = memory.reentry_mode;
 1153|   162k|        DEBUG_LOG_CHANGE_MODE;
 1154|   162k|    }
 1155|   174k|    else
 1156|   174k|    {
 1157|   174k|        DEBUG_LOG_ENTER_WITH_NODE(element);
 1158|       |
 1159|   174k|        if ( element->tag->model & CM_EMPTY )
  ------------------
  |  |  139|   174k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (1159:14): [True: 979, False: 173k]
  ------------------
 1160|    979|        {
 1161|    979|            DEBUG_LOG_EXIT;
 1162|    979|            return NULL;
 1163|    979|        }
 1164|       |
 1165|   173k|        if ( nodeIsDIV(element) && nodeIsDL(element->parent) && TY_(IsHTML5Mode)(doc) )
  ------------------
  |  |  429|   173k|#define nodeIsDIV( node )        TagIsId( node, TidyTag_DIV )
  |  |  ------------------
  |  |  |  |  275|   346k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 173k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 173k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.20k, False: 172k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsDIV(element) && nodeIsDL(element->parent) && TY_(IsHTML5Mode)(doc) )
  ------------------
  |  |  388|  1.20k|#define nodeIsDL( node )         TagIsId( node, TidyTag_DL )
  |  |  ------------------
  |  |  |  |  275|   174k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 992, False: 215]
  |  |  |  |  |  Branch (275:39): [True: 992, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 261, False: 731]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsDIV(element) && nodeIsDL(element->parent) && TY_(IsHTML5Mode)(doc) )
  ------------------
  |  |   23|    261|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    261|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1165:65): [True: 261, False: 0]
  ------------------
 1166|    261|        {
 1167|    261|            DEBUG_LOG_EXIT;
 1168|    261|            return TY_(ParseDefList)(doc, element, mode); /* @warning: possible recursion! */
  ------------------
  |  |   23|    261|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    261|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1169|    261|        }
 1170|       |        
 1171|   173k|        if ( nodeIsFORM(element) && DescendantOf(element, TidyTag_FORM) )
  ------------------
  |  |  424|   173k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|   346k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 173k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 173k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 9.62k, False: 163k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1171:37): [True: 8.37k, False: 1.25k]
  ------------------
 1172|  8.37k|        {
 1173|  8.37k|            TY_(Report)(doc, element, NULL, ILLEGAL_NESTING );
  ------------------
  |  |   23|  8.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1174|  8.37k|        }
 1175|       |
 1176|       |        /*
 1177|       |         InlineDup() asks the lexer to insert inline emphasis tags
 1178|       |         currently pushed on the istack, but take care to avoid
 1179|       |         propagating inline emphasis inside OBJECT or APPLET.
 1180|       |         For these elements a fresh inline stack context is created
 1181|       |         and disposed of upon reaching the end of the element.
 1182|       |         They thus behave like table cells in this respect.
 1183|       |        */
 1184|   173k|        if (element->tag->model & CM_OBJECT)
  ------------------
  |  |  150|   173k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1184:13): [True: 4.41k, False: 168k]
  ------------------
 1185|  4.41k|        {
 1186|  4.41k|            istackbase = lexer->istackbase;
 1187|  4.41k|            lexer->istackbase = lexer->istacksize;
 1188|  4.41k|        }
 1189|       |
 1190|   173k|        if (!(element->tag->model & CM_MIXED))
  ------------------
  |  |  156|   173k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (1190:13): [True: 166k, False: 6.62k]
  ------------------
 1191|   166k|        {
 1192|   166k|            TY_(InlineDup)( doc, NULL );
  ------------------
  |  |   23|   166k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   166k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1193|   166k|        }
 1194|       |
 1195|       |        /*\
 1196|       |         *  Issue #212 - If it is likely that it may be necessary
 1197|       |         *  to move a leading space into a text node before this
 1198|       |         *  element, then keep the mode MixedContent to keep any
 1199|       |         *  leading space
 1200|       |        \*/
 1201|   173k|        if ( !(element->tag->model & CM_INLINE) ||
  ------------------
  |  |  143|   173k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1201:14): [True: 108k, False: 64.6k]
  ------------------
 1202|  64.6k|              (element->tag->model & CM_FIELD ) )
  ------------------
  |  |  149|  64.6k|#define CM_FIELD        (1 << 10)  /**< Elements whose content must be protected against white space movement. Includes some elements that can found in forms. */
  ------------------
  |  Branch (1202:15): [True: 0, False: 64.6k]
  ------------------
 1203|   108k|        {
 1204|   108k|            DEBUG_LOG_GET_OLD_MODE;
 1205|   108k|            mode = IgnoreWhitespace;
 1206|   108k|            DEBUG_LOG_CHANGE_MODE;
 1207|   108k|        }
 1208|  64.6k|        else if (mode == IgnoreWhitespace)
  ------------------
  |  Branch (1208:18): [True: 64.6k, False: 0]
  ------------------
 1209|  64.6k|        {
 1210|       |            /* Issue #212 - Further fix in case ParseBlock() is called with 'IgnoreWhitespace'
 1211|       |               when such a leading space may need to be inserted before this element to
 1212|       |               preserve the browser view */
 1213|  64.6k|            DEBUG_LOG_GET_OLD_MODE;
 1214|  64.6k|            mode = MixedContent;
 1215|  64.6k|            DEBUG_LOG_CHANGE_MODE;
 1216|  64.6k|        }
 1217|   173k|    } /* Re-Entering */
 1218|       |    
 1219|       |    /*
 1220|       |     Main Loop
 1221|       |     */
 1222|       |    
 1223|   367k|    while ((node = TY_(GetToken)(doc, mode /*MixedContent*/)) != NULL)
  ------------------
  |  |   23|   367k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   367k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1223:12): [True: 242k, False: 124k]
  ------------------
 1224|   242k|    {
 1225|   242k|        DEBUG_LOG_GOT_TOKEN(node);
 1226|       |        /* end tag for this element */
 1227|   242k|        if (node->type == EndTag && node->tag &&
  ------------------
  |  Branch (1227:13): [True: 13.4k, False: 229k]
  |  Branch (1227:37): [True: 12.8k, False: 561]
  ------------------
 1228|  12.8k|            (node->tag == element->tag || element->was == node->tag))
  ------------------
  |  Branch (1228:14): [True: 4.03k, False: 8.81k]
  |  Branch (1228:43): [True: 0, False: 8.81k]
  ------------------
 1229|  4.03k|        {
 1230|  4.03k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  4.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1231|       |
 1232|  4.03k|            if (element->tag->model & CM_OBJECT)
  ------------------
  |  |  150|  4.03k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1232:17): [True: 1.18k, False: 2.85k]
  ------------------
 1233|  1.18k|            {
 1234|       |                /* pop inline stack */
 1235|  21.2k|                while (lexer->istacksize > lexer->istackbase)
  ------------------
  |  Branch (1235:24): [True: 20.0k, False: 1.18k]
  ------------------
 1236|  20.0k|                    TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|  20.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1237|  1.18k|                lexer->istackbase = istackbase;
 1238|  1.18k|            }
 1239|       |
 1240|  4.03k|            element->closed = yes;
 1241|  4.03k|            TrimSpaces( doc, element );
 1242|  4.03k|            DEBUG_LOG_EXIT;
 1243|  4.03k|            return NULL;
 1244|  4.03k|        }
 1245|       |
 1246|   238k|        if ( nodeIsHTML(node) || nodeIsHEAD(node) || nodeIsBODY(node) )
  ------------------
  |  |  370|   238k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   477k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 238k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 218k, False: 20.2k]
  |  |  |  |  |  Branch (275:54): [True: 219, False: 218k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsHTML(node) || nodeIsHEAD(node) || nodeIsBODY(node) )
  ------------------
  |  |  371|   238k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|   477k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 238k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 218k, False: 20.2k]
  |  |  |  |  |  Branch (275:54): [True: 459, False: 217k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsHTML(node) || nodeIsHEAD(node) || nodeIsBODY(node) )
  ------------------
  |  |  375|   238k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   238k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 238k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 217k, False: 20.2k]
  |  |  |  |  |  Branch (275:54): [True: 472, False: 217k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1247|  1.15k|        {
 1248|  1.15k|            if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1248:18): [True: 744, False: 406]
  ------------------
 1249|    744|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    744|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    744|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1250|  1.15k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  1.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1251|  1.15k|            continue;
 1252|  1.15k|        }
 1253|       |
 1254|       |
 1255|   237k|        if (node->type == EndTag)
  ------------------
  |  Branch (1255:13): [True: 8.97k, False: 228k]
  ------------------
 1256|  8.97k|        {
 1257|  8.97k|            if (node->tag == NULL)
  ------------------
  |  Branch (1257:17): [True: 561, False: 8.41k]
  ------------------
 1258|    561|            {
 1259|    561|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    561|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    561|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1260|    561|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    561|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    561|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1261|    561|                continue;
 1262|    561|            }
 1263|  8.41k|            else if ( nodeIsBR(node) )
  ------------------
  |  |  400|  8.41k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  8.41k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.41k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.41k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 198, False: 8.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1264|    198|            {
 1265|    198|                node->type = StartTag;
 1266|    198|            }
 1267|  8.21k|            else if ( nodeIsP(node) )
  ------------------
  |  |  385|  8.21k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  8.21k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.21k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.21k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 318, False: 7.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1268|    318|            {
 1269|       |                /* Cannot have a block inside a paragraph, so no checking
 1270|       |                   for an ancestor is necessary -- but we _can_ have
 1271|       |                   paragraphs inside a block, so change it to an implicit
 1272|       |                   empty paragraph, to be dealt with according to the user's
 1273|       |                   options
 1274|       |                */
 1275|    318|                node->type = StartEndTag;
 1276|    318|                node->implicit = yes;
 1277|    318|            }
 1278|  7.89k|            else if (DescendantOf( element, node->tag->id ))
  ------------------
  |  Branch (1278:22): [True: 3.66k, False: 4.23k]
  ------------------
 1279|  3.66k|            {
 1280|       |                /*
 1281|       |                  if this is the end tag for an ancestor element
 1282|       |                  then infer end tag for this element
 1283|       |                */
 1284|  3.66k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  3.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1285|  3.66k|                break;
 1286|  3.66k|            }
 1287|  4.23k|            else
 1288|  4.23k|            {
 1289|       |                /* special case </tr> etc. for stuff moved in front of table */
 1290|  4.23k|                if ( lexer->exiled
  ------------------
  |  Branch (1290:22): [True: 1.88k, False: 2.35k]
  ------------------
 1291|  1.88k|                     && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |   23|  1.88k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.88k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  146|  1.88k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  393|  1.60k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  1.60k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.60k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.60k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 465, False: 1.13k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1291:26): [True: 278, False: 1.60k]
  ------------------
 1292|    743|                {
 1293|    743|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    743|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    743|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1294|    743|                    TrimSpaces( doc, element );
 1295|    743|                    DEBUG_LOG_EXIT;
 1296|    743|                    return NULL;
 1297|    743|                }
 1298|  4.23k|            }
 1299|  8.97k|        }
 1300|       |
 1301|       |        /* mixed content model permits text */
 1302|   232k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|   232k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   232k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1302:13): [True: 10.7k, False: 221k]
  ------------------
 1303|  10.7k|        {
 1304|  10.7k|            if ( checkstack )
  ------------------
  |  Branch (1304:18): [True: 8.01k, False: 2.71k]
  ------------------
 1305|  8.01k|            {
 1306|  8.01k|                checkstack = no;
 1307|  8.01k|                if (!(element->tag->model & CM_MIXED))
  ------------------
  |  |  156|  8.01k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (1307:21): [True: 6.48k, False: 1.52k]
  ------------------
 1308|  6.48k|                {
 1309|  6.48k|                    if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  6.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1309:26): [True: 1.12k, False: 5.36k]
  ------------------
 1310|  1.12k|                        continue;
 1311|  6.48k|                }
 1312|  8.01k|            }
 1313|       |
 1314|  9.59k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  9.59k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.59k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1315|  9.59k|            DEBUG_LOG_GET_OLD_MODE
 1316|  9.59k|            mode = MixedContent;
 1317|  9.59k|            DEBUG_LOG_CHANGE_MODE;
 1318|       |            /*
 1319|       |              HTML4 strict doesn't allow mixed content for
 1320|       |              elements with %block; as their content model
 1321|       |            */
 1322|       |            /*
 1323|       |              But only body, map, blockquote, form and
 1324|       |              noscript have content model %block;
 1325|       |            */
 1326|  9.59k|            if ( nodeIsBODY(element)       ||
  ------------------
  |  |  375|  9.59k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  19.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 9.59k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 9.59k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 9.59k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1327|  9.59k|                 nodeIsMAP(element)        ||
  ------------------
  |  |  413|  9.59k|#define nodeIsMAP( node )        TagIsId( node, TidyTag_MAP )
  |  |  ------------------
  |  |  |  |  275|  19.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 9.59k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 9.59k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 702, False: 8.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1328|  9.59k|                 nodeIsBLOCKQUOTE(element) ||
  ------------------
  |  |  426|  8.89k|#define nodeIsBLOCKQUOTE( node ) TagIsId( node, TidyTag_BLOCKQUOTE )
  |  |  ------------------
  |  |  |  |  275|  18.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.89k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.89k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 513, False: 8.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1329|  9.59k|                 nodeIsFORM(element)       ||
  ------------------
  |  |  424|  8.38k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  17.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.38k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.38k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 347, False: 8.03k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1330|  8.03k|                 nodeIsNOSCRIPT(element) )
  ------------------
  |  |  423|  8.03k|#define nodeIsNOSCRIPT( node )   TagIsId( node, TidyTag_NOSCRIPT )
  |  |  ------------------
  |  |  |  |  275|  8.03k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.03k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.03k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 210, False: 7.82k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1331|  1.77k|                TY_(ConstrainVersion)( doc, ~VERS_HTML40_STRICT );
  ------------------
  |  |   23|  1.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ConstrainVersion)( doc, ~VERS_HTML40_STRICT );
  ------------------
  |  |  207|  1.77k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  1.77k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  1.77k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  1.77k|#define X10S                 256u
  |  |  ------------------
  ------------------
 1332|  9.59k|            continue;
 1333|  10.7k|        }
 1334|       |
 1335|   221k|        if ( InsertMisc(element, node) )
  ------------------
  |  Branch (1335:14): [True: 1.29k, False: 220k]
  ------------------
 1336|  1.29k|            continue;
 1337|       |
 1338|       |        /* allow PARAM elements? */
 1339|   220k|        if ( nodeIsPARAM(node) )
  ------------------
  |  |  409|   220k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|   220k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 220k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 212k, False: 7.64k]
  |  |  |  |  |  Branch (275:54): [True: 1.66k, False: 211k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1340|  1.66k|        {
 1341|  1.66k|            if ( TY_(nodeHasCM)(element, CM_PARAM) && TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if ( TY_(nodeHasCM)(element, CM_PARAM) && TY_(nodeIsElement)(node) )
  ------------------
  |  |  151|  1.66k|#define CM_PARAM        (1 << 12)  /**< Elements that allows "PARAM". */
  ------------------
                          if ( TY_(nodeHasCM)(element, CM_PARAM) && TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1341:18): [True: 1.37k, False: 291]
  |  Branch (1341:55): [True: 1.17k, False: 195]
  ------------------
 1342|  1.17k|            {
 1343|  1.17k|                TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  1.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1344|  1.17k|                continue;
 1345|  1.17k|            }
 1346|       |
 1347|       |            /* otherwise discard it */
 1348|    486|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    486|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    486|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1349|    486|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    486|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    486|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1350|    486|            continue;
 1351|  1.66k|        }
 1352|       |
 1353|       |        /* allow AREA elements? */
 1354|   218k|        if ( nodeIsAREA(node) )
  ------------------
  |  |  414|   218k|#define nodeIsAREA( node )       TagIsId( node, TidyTag_AREA )
  |  |  ------------------
  |  |  |  |  275|   218k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 218k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 211k, False: 7.64k]
  |  |  |  |  |  Branch (275:54): [True: 1.14k, False: 210k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1355|  1.14k|        {
 1356|  1.14k|            if ( nodeIsMAP(element) && TY_(nodeIsElement)(node) )
  ------------------
  |  |  413|  1.14k|#define nodeIsMAP( node )        TagIsId( node, TidyTag_MAP )
  |  |  ------------------
  |  |  |  |  275|  2.28k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.14k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.14k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 933, False: 207]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsMAP(element) && TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|    933|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    933|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1356:40): [True: 487, False: 446]
  ------------------
 1357|    487|            {
 1358|    487|                TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|    487|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    487|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1359|    487|                continue;
 1360|    487|            }
 1361|       |
 1362|       |            /* otherwise discard it */
 1363|    653|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    653|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    653|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1364|    653|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    653|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    653|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1365|    653|            continue;
 1366|  1.14k|        }
 1367|       |
 1368|       |        /* ignore unknown start/end tags */
 1369|   217k|        if ( node->tag == NULL )
  ------------------
  |  Branch (1369:14): [True: 7.64k, False: 210k]
  ------------------
 1370|  7.64k|        {
 1371|  7.64k|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  7.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1372|  7.64k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  7.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1373|  7.64k|            continue;
 1374|  7.64k|        }
 1375|       |
 1376|       |        /*
 1377|       |          Allow CM_INLINE elements here.
 1378|       |
 1379|       |          Allow CM_BLOCK elements here unless
 1380|       |          lexer->excludeBlocks is yes.
 1381|       |
 1382|       |          LI and DD are special cased.
 1383|       |
 1384|       |          Otherwise infer end tag for this element.
 1385|       |        */
 1386|       |
 1387|   210k|        if ( !TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|   210k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   210k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( !TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|   210k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1387:14): [True: 134k, False: 76.1k]
  ------------------
 1388|   134k|        {
 1389|   134k|            if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|   134k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   134k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1389:18): [True: 846, False: 133k]
  ------------------
 1390|    846|            {
 1391|    846|                if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    846|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    846|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 846, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 846, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 207, False: 639]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1392|    207|                    BadForm( doc );
 1393|       |
 1394|    846|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    846|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    846|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1395|    846|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    846|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    846|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1396|    846|                continue;
 1397|    846|            }
 1398|       |            
 1399|       |            /* #427671 - Fix by Randy Waki - 10 Aug 00 */
 1400|       |            /*
 1401|       |             If an LI contains an illegal FRAME, FRAMESET, OPTGROUP, or OPTION
 1402|       |             start tag, discard the start tag and let the subsequent content get
 1403|       |             parsed as content of the enclosing LI.  This seems to mimic IE and
 1404|       |             Netscape, and avoids an infinite loop: without this check,
 1405|       |             ParseBlock (which is parsing the LI's content) and ParseList (which
 1406|       |             is parsing the LI's parent's content) repeatedly defer to each
 1407|       |             other to parse the illegal start tag, each time inferring a missing
 1408|       |             </li> or <li> respectively.
 1409|       |
 1410|       |             NOTE: This check is a bit fragile.  It specifically checks for the
 1411|       |             four tags that happen to weave their way through the current series
 1412|       |             of tests performed by ParseBlock and ParseList to trigger the
 1413|       |             infinite loop.
 1414|       |            */
 1415|   133k|            if ( nodeIsLI(element) )
  ------------------
  |  |  390|   133k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|   133k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 133k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 133k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 48.5k, False: 84.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1416|  48.5k|            {
 1417|  48.5k|                if ( nodeIsFRAME(node)    ||
  ------------------
  |  |  377|  48.5k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|  97.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 48.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 48.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 195, False: 48.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1418|  48.5k|                     nodeIsFRAMESET(node) ||
  ------------------
  |  |  376|  48.3k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  96.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 48.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 48.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 200, False: 48.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1419|  48.5k|                     nodeIsOPTGROUP(node) ||
  ------------------
  |  |  411|  48.1k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  96.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 48.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 48.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 277, False: 47.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1420|  47.8k|                     nodeIsOPTION(node) )
  ------------------
  |  |  410|  47.8k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  47.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 47.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 47.8k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 312, False: 47.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1421|    984|                {
 1422|    984|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    984|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    984|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1423|    984|                    TY_(FreeNode)( doc, node );  /* DSR - 27Apr02 avoid memory leak */
  ------------------
  |  |   23|    984|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    984|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1424|    984|                    continue;
 1425|    984|                }
 1426|  48.5k|            }
 1427|       |
 1428|   132k|            if ( nodeIsTD(element) || nodeIsTH(element) )
  ------------------
  |  |  395|   132k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|   264k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 132k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 132k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 10.9k, False: 121k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsTD(element) || nodeIsTH(element) )
  ------------------
  |  |  396|   121k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|   121k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 121k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 121k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 11.8k, False: 109k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1429|  22.7k|            {
 1430|       |                /* if parent is a table cell, avoid inferring the end of the cell */
 1431|       |
 1432|  22.7k|                if ( TY_(nodeHasCM)(node, CM_HEAD) )
  ------------------
  |  |   23|  22.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_HEAD) )
  ------------------
  |  |  141|  22.7k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1432:22): [True: 296, False: 22.5k]
  ------------------
 1433|    296|                {
 1434|    296|                    MoveToHead( doc, element, node );
 1435|    296|                    continue;
 1436|    296|                }
 1437|       |
 1438|  22.5k|                if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |   23|  22.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |  144|  22.5k|#define CM_LIST         (1 << 5)   /**< Elements that mark list item ("LI"). */
  ------------------
  |  Branch (1438:22): [True: 250, False: 22.2k]
  ------------------
 1439|    250|                {
 1440|    250|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    250|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    250|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1441|    250|                    node = TY_(InferredTag)(doc, TidyTag_UL);
  ------------------
  |  |   23|    250|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    250|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1442|    250|                    AddClassNoIndent(doc, node);
 1443|    250|                    lexer->excludeBlocks = yes;
 1444|    250|                }
 1445|  22.2k|                else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |   23|  22.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |  145|  22.2k|#define CM_DEFLIST      (1 << 6)   /**< Elements that mark definition list item ("DL", "DT"). */
  ------------------
  |  Branch (1445:27): [True: 10.7k, False: 11.5k]
  ------------------
 1446|  10.7k|                {
 1447|  10.7k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  10.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1448|  10.7k|                    node = TY_(InferredTag)(doc, TidyTag_DL);
  ------------------
  |  |   23|  10.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1449|  10.7k|                    lexer->excludeBlocks = yes;
 1450|  10.7k|                }
 1451|       |
 1452|       |                /* infer end of current table cell */
 1453|  22.5k|                if ( !TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |   23|  22.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( !TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |  142|  22.5k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (1453:22): [True: 3.10k, False: 19.3k]
  ------------------
 1454|  3.10k|                {
 1455|  3.10k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  3.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1456|  3.10k|                    TrimSpaces( doc, element );
 1457|  3.10k|                    DEBUG_LOG_EXIT;
 1458|  3.10k|                    return NULL;
 1459|  3.10k|                }
 1460|  22.5k|            }
 1461|   109k|            else if ( TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |   23|   109k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   109k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |  142|   109k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (1461:23): [True: 65.4k, False: 43.9k]
  ------------------
 1462|  65.4k|            {
 1463|  65.4k|                if ( lexer->excludeBlocks )
  ------------------
  |  Branch (1463:22): [True: 3.02k, False: 62.4k]
  ------------------
 1464|  3.02k|                {
 1465|  3.02k|                    if ( !TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |   23|  3.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( !TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |  154|  3.02k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1465:26): [True: 1.54k, False: 1.47k]
  ------------------
 1466|  1.54k|                        TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|  1.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1467|       |
 1468|  3.02k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  3.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1469|       |
 1470|  3.02k|                    if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |   23|  3.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |  150|  3.02k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1470:26): [True: 201, False: 2.82k]
  ------------------
 1471|    201|                        lexer->istackbase = istackbase;
 1472|       |
 1473|  3.02k|                    TrimSpaces( doc, element );
 1474|  3.02k|                    DEBUG_LOG_EXIT;
 1475|  3.02k|                    return NULL;
 1476|  3.02k|                }
 1477|  65.4k|            }
 1478|  43.9k|            else if ( ! nodeIsTEMPLATE( element ) )/* things like list items */
  ------------------
  |  |  466|  43.9k|#define nodeIsTEMPLATE( node )   TagIsId( node, TidyTag_TEMPLATE )
  |  |  ------------------
  |  |  |  |  275|  43.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 43.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 43.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 659, False: 43.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1479|  43.2k|            {
 1480|  43.2k|                if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  43.2k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1480:21): [True: 292, False: 42.9k]
  ------------------
 1481|    292|                {
 1482|    292|                    MoveToHead( doc, element, node );
 1483|    292|                    continue;
 1484|    292|                }
 1485|       |
 1486|       |                /*
 1487|       |                 special case where a form start tag
 1488|       |                 occurs in a tr and is followed by td or th
 1489|       |                */
 1490|       |
 1491|  42.9k|                if ( nodeIsFORM(element) &&
  ------------------
  |  |  424|  42.9k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  85.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 42.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 42.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 8.39k, False: 34.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1492|  42.9k|                     nodeIsTD(element->parent) &&
  ------------------
  |  |  395|  8.39k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  51.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.82k, False: 564]
  |  |  |  |  |  Branch (275:39): [True: 7.82k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 6.55k, False: 1.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1493|  6.55k|                     element->parent->implicit )
  ------------------
  |  Branch (1493:22): [True: 6.33k, False: 224]
  ------------------
 1494|  6.33k|                {
 1495|  6.33k|                    if ( nodeIsTD(node) )
  ------------------
  |  |  395|  6.33k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  6.33k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.33k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.33k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 262, False: 6.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1496|    262|                    {
 1497|    262|                        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    262|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    262|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1498|    262|                        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    262|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    262|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1499|    262|                        continue;
 1500|    262|                    }
 1501|       |
 1502|  6.06k|                    if ( nodeIsTH(node) )
  ------------------
  |  |  396|  6.06k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  6.06k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.06k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.06k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 240, False: 5.82k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1503|    240|                    {
 1504|    240|                        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    240|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    240|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1505|    240|                        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    240|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    240|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1506|    240|                        node = element->parent;
 1507|    240|                        TidyDocFree(doc, node->element);
  ------------------
  |  |  159|    240|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|    240|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1508|    240|                        node->element = TY_(tmbstrdup)(doc->allocator, "th");
  ------------------
  |  |   23|    240|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    240|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1509|    240|                        node->tag = TY_(LookupTagDef)( TidyTag_TH );
  ------------------
  |  |   23|    240|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    240|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1510|    240|                        continue;
 1511|    240|                    }
 1512|  6.06k|                }
 1513|       |
 1514|  42.4k|                if ( !TY_(nodeHasCM)(element, CM_OPT) && !element->implicit )
  ------------------
  |  |   23|  42.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( !TY_(nodeHasCM)(element, CM_OPT) && !element->implicit )
  ------------------
  |  |  154|  42.4k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1514:22): [True: 25.0k, False: 17.3k]
  |  Branch (1514:58): [True: 24.7k, False: 331]
  ------------------
 1515|  24.7k|                    TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|  24.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1516|       |
 1517|       |                /* #521, warn on missing optional end-tags if not omitting them. */
 1518|  42.4k|                if ( cfgBool( doc, TidyOmitOptionalTags ) == no && TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |  418|  42.4k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  42.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                              if ( cfgBool( doc, TidyOmitOptionalTags ) == no && TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |   23|  42.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( cfgBool( doc, TidyOmitOptionalTags ) == no && TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |  154|  42.4k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1518:22): [True: 42.4k, False: 0]
  |  Branch (1518:68): [True: 17.3k, False: 25.0k]
  ------------------
 1519|  17.3k|                    TY_(Report)(doc, element, node, MISSING_ENDTAG_OPTIONAL );
  ------------------
  |  |   23|  17.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1520|       |
 1521|       |
 1522|  42.4k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  42.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1523|       |
 1524|  42.4k|                if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |   23|  42.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |  144|  42.4k|#define CM_LIST         (1 << 5)   /**< Elements that mark list item ("LI"). */
  ------------------
  |  Branch (1524:22): [True: 2.97k, False: 39.4k]
  ------------------
 1525|  2.97k|                {
 1526|  2.97k|                    if ( element->parent && element->parent->tag &&
  ------------------
  |  Branch (1526:26): [True: 2.77k, False: 200]
  |  Branch (1526:45): [True: 2.77k, False: 0]
  ------------------
 1527|  2.77k|                         element->parent->tag->parser == TY_(ParseList) )
  ------------------
  |  |   23|  2.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1527:26): [True: 1.81k, False: 959]
  ------------------
 1528|  1.81k|                    {
 1529|  1.81k|                        TrimSpaces( doc, element );
 1530|  1.81k|                        DEBUG_LOG_EXIT;
 1531|  1.81k|                        return NULL;
 1532|  1.81k|                    }
 1533|       |
 1534|  1.15k|                    node = TY_(InferredTag)(doc, TidyTag_UL);
  ------------------
  |  |   23|  1.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1535|  1.15k|                    AddClassNoIndent(doc, node);
 1536|  1.15k|                }
 1537|  39.4k|                else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |   23|  39.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |  145|  39.4k|#define CM_DEFLIST      (1 << 6)   /**< Elements that mark definition list item ("DL", "DT"). */
  ------------------
  |  Branch (1537:27): [True: 2.10k, False: 37.3k]
  ------------------
 1538|  2.10k|                {
 1539|  2.10k|                    if ( nodeIsDL(element->parent) )
  ------------------
  |  |  388|  2.10k|#define nodeIsDL( node )         TagIsId( node, TidyTag_DL )
  |  |  ------------------
  |  |  |  |  275|  2.10k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.81k, False: 292]
  |  |  |  |  |  Branch (275:39): [True: 1.81k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 742, False: 1.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1540|    742|                    {
 1541|    742|                        TrimSpaces( doc, element );
 1542|    742|                        DEBUG_LOG_EXIT;
 1543|    742|                        return NULL;
 1544|    742|                    }
 1545|       |
 1546|  1.36k|                    node = TY_(InferredTag)(doc, TidyTag_DL);
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1547|  1.36k|                }
 1548|  37.3k|                else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |   23|  37.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |  146|  37.3k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |  148|  16.8k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (1548:27): [True: 20.4k, False: 16.8k]
  |  Branch (1548:61): [True: 11.3k, False: 5.56k]
  ------------------
 1549|  31.8k|                {
 1550|       |                    /* http://tidy.sf.net/issue/1316307 */
 1551|       |                    /* In exiled mode, return so table processing can
 1552|       |                       continue. */
 1553|  31.8k|                    if (lexer->exiled)
  ------------------
  |  Branch (1553:25): [True: 2.97k, False: 28.8k]
  ------------------
 1554|  2.97k|                    {
 1555|  2.97k|                        DEBUG_LOG_EXIT;
 1556|  2.97k|                        return NULL;
 1557|  2.97k|                    }
 1558|  28.8k|                    node = TY_(InferredTag)(doc, TidyTag_TABLE);
  ------------------
  |  |   23|  28.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1559|  28.8k|                }
 1560|  5.56k|                else if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |   23|  5.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |  150|  5.56k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1560:27): [True: 1.47k, False: 4.09k]
  ------------------
 1561|  1.47k|                {
 1562|       |                    /* pop inline stack */
 1563|  2.18k|                    while ( lexer->istacksize > lexer->istackbase )
  ------------------
  |  Branch (1563:29): [True: 714, False: 1.47k]
  ------------------
 1564|    714|                        TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|    714|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    714|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1565|  1.47k|                    lexer->istackbase = istackbase;
 1566|  1.47k|                    TrimSpaces( doc, element );
 1567|  1.47k|                    DEBUG_LOG_EXIT;
 1568|  1.47k|                    return NULL;
 1569|       |
 1570|  1.47k|                }
 1571|  4.09k|                else
 1572|  4.09k|                {
 1573|  4.09k|                    TrimSpaces( doc, element );
 1574|  4.09k|                    DEBUG_LOG_EXIT;
 1575|  4.09k|                    return NULL;
 1576|  4.09k|                }
 1577|  42.4k|            }
 1578|   132k|        }
 1579|       |
 1580|       |        /*\
 1581|       |         *  Issue #307 - an <A> tag to ends any open <A> element
 1582|       |         *  Like #427827 - fixed by Randy Waki and Bjoern Hoehrmann 23 Aug 00
 1583|       |         *  in ParseInline(), fix copied HERE to ParseBlock()
 1584|       |         *  href: http://www.w3.org/TR/html-markup/a.html
 1585|       |         *  The interactive element a must not appear as a descendant of the a element.
 1586|       |        \*/
 1587|   189k|        if ( nodeIsA(node) && !node->implicit &&
  ------------------
  |  |  401|   189k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|   379k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 189k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 189k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 11.3k, False: 178k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1587:31): [True: 8.08k, False: 3.25k]
  ------------------
 1588|  8.08k|             (nodeIsA(element) || DescendantOf(element, TidyTag_A)) )
  ------------------
  |  |  401|  8.08k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  16.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.08k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.08k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.29k, False: 3.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1588:35): [True: 1.71k, False: 2.07k]
  ------------------
 1589|  6.00k|        {
 1590|  6.00k|            if (node->type != EndTag && node->attributes == NULL
  ------------------
  |  Branch (1590:17): [True: 6.00k, False: 0]
  |  Branch (1590:41): [True: 2.51k, False: 3.49k]
  ------------------
 1591|  2.51k|                && cfgBool(doc, TidyCoerceEndTags) )
  ------------------
  |  |  418|  2.51k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.51k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 2.51k, False: 0]
  |  |  ------------------
  ------------------
 1592|  2.51k|            {
 1593|  2.51k|                node->type = EndTag;
 1594|  2.51k|                TY_(Report)(doc, element, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|  2.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1595|  2.51k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1596|  2.51k|                continue;
 1597|  2.51k|            }
 1598|       |
 1599|  3.49k|            if (nodeIsA(element))
  ------------------
  |  |  401|  3.49k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  3.49k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.49k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.49k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.02k, False: 471]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1600|  3.02k|            {
 1601|  3.02k|                TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  3.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1602|  3.02k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  3.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1603|  3.02k|            }
 1604|    471|            else
 1605|    471|            {
 1606|       |                /* Issue #597 - if we not 'UngetToken' then it is being discarded.
 1607|       |                   Add message, and 'FreeNode' - thanks @ralfjunker */
 1608|    471|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    471|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    471|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1609|    471|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    471|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    471|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1610|    471|            }
 1611|       |
 1612|  3.49k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (1612:17): [True: 3.49k, False: 0]
  ------------------
 1613|  3.49k|                TrimSpaces(doc, element);
 1614|       |
 1615|  3.49k|            DEBUG_LOG_EXIT;
 1616|  3.49k|            return NULL;
 1617|  6.00k|        }
 1618|       |
 1619|       |        /* parse known element */
 1620|   183k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|   183k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   183k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1620:13): [True: 182k, False: 1.89k]
  ------------------
 1621|   182k|        {
 1622|   182k|            if (node->tag->model & CM_INLINE)
  ------------------
  |  |  143|   182k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1622:17): [True: 68.2k, False: 113k]
  ------------------
 1623|  68.2k|            {
 1624|  68.2k|                if (checkstack && !node->implicit)
  ------------------
  |  Branch (1624:21): [True: 65.1k, False: 3.06k]
  |  Branch (1624:35): [True: 8.20k, False: 56.9k]
  ------------------
 1625|  8.20k|                {
 1626|  8.20k|                    checkstack = no;
 1627|       |
 1628|  8.20k|                    if (!(element->tag->model & CM_MIXED)) /* #431731 - fix by Randy Waki 25 Dec 00 */
  ------------------
  |  |  156|  8.20k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (1628:25): [True: 7.24k, False: 957]
  ------------------
 1629|  7.24k|                    {
 1630|  7.24k|                        if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  7.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1630:30): [True: 651, False: 6.59k]
  ------------------
 1631|    651|                            continue;
 1632|  7.24k|                    }
 1633|  8.20k|                }
 1634|       |
 1635|  67.5k|                DEBUG_LOG_GET_OLD_MODE;
 1636|  67.5k|                mode = MixedContent;
 1637|  67.5k|                DEBUG_LOG_CHANGE_MODE;
 1638|  67.5k|            }
 1639|   113k|            else
 1640|   113k|            {
 1641|   113k|                checkstack = yes;
 1642|   113k|                DEBUG_LOG_GET_OLD_MODE;
 1643|   113k|                mode = IgnoreWhitespace;
 1644|   113k|                DEBUG_LOG_CHANGE_MODE;
 1645|   113k|            }
 1646|       |
 1647|       |            /* trim white space before <br> */
 1648|   181k|            if ( nodeIsBR(node) )
  ------------------
  |  |  400|   181k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   181k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 181k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 181k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 618, False: 180k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1649|    618|                TrimSpaces( doc, element );
 1650|       |
 1651|   181k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|   181k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   181k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1652|       |
 1653|   181k|            if (node->implicit)
  ------------------
  |  Branch (1653:17): [True: 101k, False: 80.0k]
  ------------------
 1654|   101k|                TY_(Report)(doc, element, node, INSERTING_TAG );
  ------------------
  |  |   23|   101k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   101k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1655|       |
 1656|       |            /* Issue #212 - WHY is this hard coded to 'IgnoreWhitespace' while an
 1657|       |               effort has been made above to set a 'MixedContent' mode in some cases?
 1658|       |               WHY IS THE 'mode' VARIABLE NOT USED HERE???? */
 1659|       |
 1660|   181k|            {
 1661|   181k|                TidyParserMemory memory = {0};
 1662|   181k|                memory.identity = TY_(ParseBlock);
  ------------------
  |  |   23|   181k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   181k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1663|   181k|                memory.reentry_node = node;
 1664|   181k|                memory.reentry_mode = mode;
 1665|   181k|                memory.original_node = element;
 1666|   181k|                TY_(pushMemory)(doc, memory);
  ------------------
  |  |   23|   181k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   181k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1667|   181k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 1668|   181k|            }
 1669|   181k|            return node;
 1670|   182k|        }
 1671|       |
 1672|       |        /* discard unexpected tags */
 1673|  1.89k|        if (node->type == EndTag)
  ------------------
  |  Branch (1673:13): [True: 1.89k, False: 0]
  ------------------
 1674|  1.89k|            TY_(PopInline)( doc, node );  /* if inline end tag */
  ------------------
  |  |   23|  1.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1675|       |
 1676|  1.89k|        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  1.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1677|  1.89k|        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  1.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1678|  1.89k|        continue;
 1679|   183k|    }
 1680|       |
 1681|   128k|    if (!(element->tag->model & CM_OPT))
  ------------------
  |  |  154|   128k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1681:9): [True: 72.5k, False: 56.0k]
  ------------------
 1682|  72.5k|        TY_(Report)(doc, element, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  72.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  72.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1683|       |
 1684|   128k|    if (element->tag->model & CM_OBJECT)
  ------------------
  |  |  150|   128k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1684:9): [True: 1.52k, False: 127k]
  ------------------
 1685|  1.52k|    {
 1686|       |        /* pop inline stack */
 1687|  3.04k|        while ( lexer->istacksize > lexer->istackbase )
  ------------------
  |  Branch (1687:17): [True: 1.52k, False: 1.52k]
  ------------------
 1688|  1.52k|            TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|  1.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1689|  1.52k|        lexer->istackbase = istackbase;
 1690|  1.52k|    }
 1691|       |
 1692|   128k|    TrimSpaces( doc, element );
 1693|       |
 1694|   128k|    DEBUG_LOG_EXIT;
 1695|       |    return NULL;
 1696|   335k|}
prvTidyParseBody:
 1708|   201k|{
 1709|   201k|    Lexer* lexer = doc->lexer;
 1710|   201k|    Node *node = NULL;
 1711|   201k|    Bool checkstack = no;
 1712|   201k|    Bool iswhitenode = no;
 1713|   201k|    DEBUG_LOG_COUNTERS;
 1714|       |
 1715|   201k|    mode = IgnoreWhitespace;
 1716|   201k|    checkstack = yes;
 1717|       |
 1718|       |    /*
 1719|       |     If we're re-entering, then we need to setup from a previous state,
 1720|       |     instead of starting fresh. We can pull what we need from the document's
 1721|       |     stack.
 1722|       |     */
 1723|   201k|    if ( body == NULL )
  ------------------
  |  Branch (1723:10): [True: 137k, False: 64.2k]
  ------------------
 1724|   137k|    {
 1725|   137k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|   137k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   137k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1726|   137k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 1727|   137k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 1728|   137k|        body = memory.original_node;
 1729|   137k|        checkstack = memory.register_1;
 1730|   137k|        iswhitenode = memory.register_2;
 1731|   137k|        DEBUG_LOG_GET_OLD_MODE;
 1732|   137k|        mode = memory.mode;
 1733|   137k|        DEBUG_LOG_CHANGE_MODE;
 1734|   137k|    }
 1735|  64.2k|    else
 1736|  64.2k|    {
 1737|  64.2k|        DEBUG_LOG_ENTER_WITH_NODE(body);
 1738|  64.2k|        TY_(BumpObject)( doc, body->parent );
  ------------------
  |  |   23|  64.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  64.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1739|  64.2k|    }
 1740|       |    
 1741|   399k|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|   399k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   399k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1741:12): [True: 365k, False: 33.8k]
  ------------------
 1742|   365k|    {
 1743|   365k|        DEBUG_LOG_GOT_TOKEN(node);
 1744|       |        /* find and discard multiple <body> elements */
 1745|   365k|        if (node->tag == body->tag && node->type == StartTag)
  ------------------
  |  Branch (1745:13): [True: 8.35k, False: 357k]
  |  Branch (1745:39): [True: 2.75k, False: 5.59k]
  ------------------
 1746|  2.75k|        {
 1747|  2.75k|            TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1748|  2.75k|            TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  2.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1749|  2.75k|            continue;
 1750|  2.75k|        }
 1751|       |
 1752|       |        /* #538536 Extra endtags not detected */
 1753|   362k|        if ( nodeIsHTML(node) )
  ------------------
  |  |  370|   362k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   362k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 362k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 177k, False: 184k]
  |  |  |  |  |  Branch (275:54): [True: 799, False: 177k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1754|    799|        {
 1755|    799|            if (TY_(nodeIsElement)(node) || lexer->seenEndHtml)
  ------------------
  |  |   23|    799|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    799|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1755:17): [True: 505, False: 294]
  |  Branch (1755:45): [True: 262, False: 32]
  ------------------
 1756|    767|                TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    767|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    767|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1757|     32|            else
 1758|     32|                lexer->seenEndHtml = 1;
 1759|       |
 1760|    799|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    799|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    799|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1761|    799|            continue;
 1762|    799|        }
 1763|       |
 1764|   361k|        if ( lexer->seenEndBody &&
  ------------------
  |  Branch (1764:14): [True: 7.14k, False: 354k]
  ------------------
 1765|  7.14k|             ( node->type == StartTag ||
  ------------------
  |  Branch (1765:16): [True: 1.93k, False: 5.20k]
  ------------------
 1766|  5.20k|               node->type == EndTag   ||
  ------------------
  |  Branch (1766:16): [True: 3.45k, False: 1.75k]
  ------------------
 1767|  1.75k|               node->type == StartEndTag ) )
  ------------------
  |  Branch (1767:16): [True: 365, False: 1.38k]
  ------------------
 1768|  5.75k|        {
 1769|  5.75k|            TY_(Report)(doc, body, node, CONTENT_AFTER_BODY );
  ------------------
  |  |   23|  5.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1770|  5.75k|        }
 1771|       |
 1772|   361k|        if ( node->tag == body->tag && node->type == EndTag )
  ------------------
  |  Branch (1772:14): [True: 5.59k, False: 356k]
  |  Branch (1772:40): [True: 3.40k, False: 2.19k]
  ------------------
 1773|  3.40k|        {
 1774|  3.40k|            body->closed = yes;
 1775|  3.40k|            TrimSpaces(doc, body);
 1776|  3.40k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  3.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1777|  3.40k|            lexer->seenEndBody = 1;
 1778|  3.40k|            DEBUG_LOG_GET_OLD_MODE;
 1779|  3.40k|            mode = IgnoreWhitespace;
 1780|  3.40k|            DEBUG_LOG_CHANGE_MODE;
 1781|       |
 1782|  3.40k|            if ( nodeIsNOFRAMES(body->parent) )
  ------------------
  |  |  379|  3.40k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  3.40k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.16k, False: 237]
  |  |  |  |  |  Branch (275:39): [True: 3.16k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.17k, False: 989]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1783|  2.17k|                break;
 1784|       |
 1785|  1.22k|            continue;
 1786|  3.40k|        }
 1787|       |
 1788|   358k|        if ( nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|   358k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|   358k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 358k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 173k, False: 184k]
  |  |  |  |  |  Branch (275:54): [True: 11.8k, False: 161k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1789|  11.8k|        {
 1790|  11.8k|            if (node->type == StartTag)
  ------------------
  |  Branch (1790:17): [True: 11.0k, False: 879]
  ------------------
 1791|  11.0k|            {
 1792|  11.0k|                TidyParserMemory memory = {0};
 1793|       |
 1794|  11.0k|                TY_(InsertNodeAtEnd)(body, node);
  ------------------
  |  |   23|  11.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1795|       |                
 1796|  11.0k|                memory.identity = TY_(ParseBody);
  ------------------
  |  |   23|  11.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1797|  11.0k|                memory.original_node = body;
 1798|  11.0k|                memory.reentry_node = node;
 1799|  11.0k|                memory.register_1 = checkstack;
 1800|  11.0k|                memory.register_2 = iswhitenode;
 1801|  11.0k|                memory.mode = mode;
 1802|  11.0k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  11.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1803|  11.0k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 1804|  11.0k|                return node;
 1805|  11.0k|            }
 1806|       |
 1807|    879|            if (node->type == EndTag && nodeIsNOFRAMES(body->parent) )
  ------------------
  |  |  379|    601|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|    601|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 400, False: 201]
  |  |  |  |  |  Branch (275:39): [True: 400, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 204, False: 196]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1807:17): [True: 601, False: 278]
  ------------------
 1808|    204|            {
 1809|    204|                TrimSpaces(doc, body);
 1810|    204|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    204|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    204|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1811|    204|                break;
 1812|    204|            }
 1813|    879|        }
 1814|       |
 1815|   347k|        if ( (nodeIsFRAME(node) || nodeIsFRAMESET(node))
  ------------------
  |  |  377|   347k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|   694k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 347k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 162k, False: 184k]
  |  |  |  |  |  Branch (275:54): [True: 2.66k, False: 159k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( (nodeIsFRAME(node) || nodeIsFRAMESET(node))
  ------------------
  |  |  376|   344k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|   344k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 344k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 159k, False: 184k]
  |  |  |  |  |  Branch (275:54): [True: 1.59k, False: 158k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1816|  4.26k|             && nodeIsNOFRAMES(body->parent) )
  ------------------
  |  |  379|  4.26k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  4.26k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.03k, False: 223]
  |  |  |  |  |  Branch (275:39): [True: 4.03k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 939, False: 3.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1817|    939|        {
 1818|    939|            TrimSpaces(doc, body);
 1819|    939|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    939|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    939|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1820|    939|            break;
 1821|    939|        }
 1822|       |
 1823|   346k|        iswhitenode = no;
 1824|       |
 1825|   346k|        if ( TY_(nodeIsText)(node) &&
  ------------------
  |  |   23|   346k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   346k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1825:14): [True: 42.2k, False: 304k]
  ------------------
 1826|  42.2k|             node->end <= node->start + 1 &&
  ------------------
  |  Branch (1826:14): [True: 14.2k, False: 27.9k]
  ------------------
 1827|  14.2k|             lexer->lexbuf[node->start] == ' ' )
  ------------------
  |  Branch (1827:14): [True: 1.05k, False: 13.2k]
  ------------------
 1828|  1.05k|            iswhitenode = yes;
 1829|       |
 1830|       |        /* deal with comments etc. */
 1831|   346k|        if (InsertMisc(body, node))
  ------------------
  |  Branch (1831:13): [True: 65.4k, False: 280k]
  ------------------
 1832|  65.4k|            continue;
 1833|       |
 1834|       |        /* mixed content model permits text */
 1835|   280k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|   280k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   280k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1835:13): [True: 42.2k, False: 238k]
  ------------------
 1836|  42.2k|        {
 1837|  42.2k|            if (iswhitenode && mode == IgnoreWhitespace)
  ------------------
  |  Branch (1837:17): [True: 1.05k, False: 41.2k]
  |  Branch (1837:32): [True: 278, False: 781]
  ------------------
 1838|    278|            {
 1839|    278|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    278|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    278|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1840|    278|                continue;
 1841|    278|            }
 1842|       |
 1843|       |            /* HTML 2 and HTML4 strict don't allow text here */
 1844|  41.9k|            TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT | VERS_HTML20));
  ------------------
  |  |   23|  41.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT | VERS_HTML20));
  ------------------
  |  |  207|  41.9k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  41.9k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  41.9k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  41.9k|#define X10S                 256u
  |  |  ------------------
  ------------------
                          TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT | VERS_HTML20));
  ------------------
  |  |  205|  41.9k|#define VERS_HTML20        (HT20)
  |  |  ------------------
  |  |  |  |  177|  41.9k|#define HT20                   1u
  |  |  ------------------
  ------------------
 1845|       |
 1846|  41.9k|            if (checkstack)
  ------------------
  |  Branch (1846:17): [True: 14.9k, False: 27.0k]
  ------------------
 1847|  14.9k|            {
 1848|  14.9k|                checkstack = no;
 1849|       |
 1850|  14.9k|                if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  14.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1850:22): [True: 1.54k, False: 13.3k]
  ------------------
 1851|  1.54k|                    continue;
 1852|  14.9k|            }
 1853|       |
 1854|  40.4k|            TY_(InsertNodeAtEnd)(body, node);
  ------------------
  |  |   23|  40.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1855|  40.4k|            DEBUG_LOG_GET_OLD_MODE;
 1856|  40.4k|            mode = MixedContent;
 1857|  40.4k|            DEBUG_LOG_CHANGE_MODE;
 1858|  40.4k|            continue;
 1859|  41.9k|        }
 1860|       |
 1861|   238k|        if (node->type == DocTypeTag)
  ------------------
  |  Branch (1861:13): [True: 3.59k, False: 235k]
  ------------------
 1862|  3.59k|        {
 1863|  3.59k|            InsertDocType(doc, body, node);
 1864|  3.59k|            continue;
 1865|  3.59k|        }
 1866|       |        /* discard unknown  and PARAM tags */
 1867|   235k|        if ( node->tag == NULL || nodeIsPARAM(node) )
  ------------------
  |  |  409|   161k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|   161k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 161k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 161k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 258, False: 161k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1867:14): [True: 73.4k, False: 161k]
  ------------------
 1868|  73.7k|        {
 1869|  73.7k|            TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  73.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1870|  73.7k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  73.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1871|  73.7k|            continue;
 1872|  73.7k|        }
 1873|       |
 1874|       |        /*
 1875|       |          Netscape allows LI and DD directly in BODY
 1876|       |          We infer UL or DL respectively and use this
 1877|       |          Bool to exclude block-level elements so as
 1878|       |          to match Netscape's observed behaviour.
 1879|       |        */
 1880|   161k|        lexer->excludeBlocks = no;
 1881|       |
 1882|   161k|        if ((( nodeIsINPUT(node) ||
  ------------------
  |  |  431|   161k|#define nodeIsINPUT( node )      TagIsId( node, TidyTag_INPUT )
  |  |  ------------------
  |  |  |  |  275|   322k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 161k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 161k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 749, False: 160k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1883|   160k|             (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |   23|   160k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   160k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |  142|   160k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                           (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |   23|  45.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |  143|  45.5k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1883:15): [True: 45.5k, False: 115k]
  |  Branch (1883:50): [True: 26.5k, False: 18.9k]
  ------------------
 1884|   161k|           ) && !TY_(IsHTML5Mode)(doc)) || nodeIsLI(node) )
  ------------------
  |  |   23|  27.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                         ) && !TY_(IsHTML5Mode)(doc)) || nodeIsLI(node) )
  ------------------
  |  |  390|   157k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|   157k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 157k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 157k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 580, False: 156k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1884:17): [True: 4.01k, False: 23.3k]
  ------------------
 1885|  4.59k|        {
 1886|       |            /* avoid this error message being issued twice */
 1887|  4.59k|            if (!(node->tag->model & CM_HEAD))
  ------------------
  |  |  141|  4.59k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1887:17): [True: 4.13k, False: 467]
  ------------------
 1888|  4.13k|                TY_(Report)(doc, body, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  4.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1889|       |
 1890|  4.59k|            if (node->tag->model & CM_HTML)
  ------------------
  |  |  140|  4.59k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
  |  Branch (1890:17): [True: 1.37k, False: 3.22k]
  ------------------
 1891|  1.37k|            {
 1892|       |                /* copy body attributes if current body was inferred */
 1893|  1.37k|                if ( nodeIsBODY(node) && body->implicit
  ------------------
  |  |  375|  1.37k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  2.75k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.37k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.37k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 592, False: 787]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1893:42): [True: 398, False: 194]
  ------------------
 1894|    398|                     && body->attributes == NULL )
  ------------------
  |  Branch (1894:25): [True: 204, False: 194]
  ------------------
 1895|    204|                {
 1896|    204|                    body->attributes = node->attributes;
 1897|    204|                    node->attributes = NULL;
 1898|    204|                }
 1899|       |
 1900|  1.37k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1901|  1.37k|                continue;
 1902|  1.37k|            }
 1903|       |
 1904|  3.22k|            if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  3.22k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1904:17): [True: 467, False: 2.75k]
  ------------------
 1905|    467|            {
 1906|    467|                MoveToHead(doc, body, node);
 1907|    467|                continue;
 1908|    467|            }
 1909|       |
 1910|  2.75k|            if (node->tag->model & CM_LIST)
  ------------------
  |  |  144|  2.75k|#define CM_LIST         (1 << 5)   /**< Elements that mark list item ("LI"). */
  ------------------
  |  Branch (1910:17): [True: 727, False: 2.02k]
  ------------------
 1911|    727|            {
 1912|    727|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    727|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    727|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1913|    727|                node = TY_(InferredTag)(doc, TidyTag_UL);
  ------------------
  |  |   23|    727|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    727|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1914|    727|                AddClassNoIndent(doc, node);
 1915|    727|                lexer->excludeBlocks = yes;
 1916|    727|            }
 1917|  2.02k|            else if (node->tag->model & CM_DEFLIST)
  ------------------
  |  |  145|  2.02k|#define CM_DEFLIST      (1 << 6)   /**< Elements that mark definition list item ("DL", "DT"). */
  ------------------
  |  Branch (1917:22): [True: 187, False: 1.83k]
  ------------------
 1918|    187|            {
 1919|    187|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    187|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    187|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1920|    187|                node = TY_(InferredTag)(doc, TidyTag_DL);
  ------------------
  |  |   23|    187|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    187|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1921|    187|                lexer->excludeBlocks = yes;
 1922|    187|            }
 1923|  1.83k|            else if (node->tag->model & (CM_TABLE | CM_ROWGRP | CM_ROW))
  ------------------
  |  |  146|  1.83k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                          else if (node->tag->model & (CM_TABLE | CM_ROWGRP | CM_ROW))
  ------------------
  |  |  147|  1.83k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
                          else if (node->tag->model & (CM_TABLE | CM_ROWGRP | CM_ROW))
  ------------------
  |  |  148|  1.83k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (1923:22): [True: 630, False: 1.20k]
  ------------------
 1924|    630|            {
 1925|       |                /* http://tidy.sf.net/issue/2855621 */
 1926|    630|                if (node->type != EndTag) {
  ------------------
  |  Branch (1926:21): [True: 414, False: 216]
  ------------------
 1927|    414|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    414|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    414|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1928|    414|                    node = TY_(InferredTag)(doc, TidyTag_TABLE);
  ------------------
  |  |   23|    414|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    414|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1929|    414|                }
 1930|    630|                lexer->excludeBlocks = yes;
 1931|    630|            }
 1932|  1.20k|            else if ( nodeIsINPUT(node) )
  ------------------
  |  |  431|  1.20k|#define nodeIsINPUT( node )      TagIsId( node, TidyTag_INPUT )
  |  |  ------------------
  |  |  |  |  275|  1.20k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.20k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.20k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 338, False: 871]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1933|    338|            {
 1934|    338|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    338|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    338|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1935|    338|                node = TY_(InferredTag)(doc, TidyTag_FORM);
  ------------------
  |  |   23|    338|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    338|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1936|    338|                lexer->excludeBlocks = yes;
 1937|    338|            }
 1938|    871|            else
 1939|    871|            {
 1940|    871|                if ( !TY_(nodeHasCM)(node, CM_ROW | CM_FIELD) )
  ------------------
  |  |   23|    871|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    871|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( !TY_(nodeHasCM)(node, CM_ROW | CM_FIELD) )
  ------------------
  |  |  148|    871|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
                              if ( !TY_(nodeHasCM)(node, CM_ROW | CM_FIELD) )
  ------------------
  |  |  149|    871|#define CM_FIELD        (1 << 10)  /**< Elements whose content must be protected against white space movement. Includes some elements that can found in forms. */
  ------------------
  |  Branch (1940:22): [True: 663, False: 208]
  ------------------
 1941|    663|                {
 1942|    663|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    663|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    663|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1943|    663|                    DEBUG_LOG_EXIT;
 1944|    663|                    return NULL;
 1945|    663|                }
 1946|       |
 1947|       |                /* ignore </td> </th> <option> etc. */
 1948|    208|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    208|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    208|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1949|    208|                continue;
 1950|    871|            }
 1951|  2.75k|        }
 1952|       |
 1953|   158k|        if (node->type == EndTag)
  ------------------
  |  Branch (1953:13): [True: 6.20k, False: 152k]
  ------------------
 1954|  6.20k|        {
 1955|  6.20k|            if ( nodeIsBR(node) )
  ------------------
  |  |  400|  6.20k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  6.20k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.20k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.20k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 336, False: 5.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1956|    336|            {
 1957|    336|                node->type = StartTag;
 1958|    336|            }
 1959|  5.86k|            else if ( nodeIsP(node) )
  ------------------
  |  |  385|  5.86k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  5.86k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.86k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.86k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.13k, False: 4.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1960|  1.13k|            {
 1961|  1.13k|                node->type = StartEndTag;
 1962|  1.13k|                node->implicit = yes;
 1963|  1.13k|            }
 1964|  4.73k|            else if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|  4.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|  4.73k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1964:23): [True: 2.71k, False: 2.01k]
  ------------------
 1965|  2.71k|                TY_(PopInline)( doc, node );
  ------------------
  |  |   23|  2.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1966|  6.20k|        }
 1967|       |
 1968|   158k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|   158k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   158k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1968:13): [True: 153k, False: 4.73k]
  ------------------
 1969|   153k|        {
 1970|   153k|            if (nodeIsMAIN(node))
  ------------------
  |  |  452|   153k|#define nodeIsMAIN( node )       TagIsId( node, TidyTag_MAIN )
  |  |  ------------------
  |  |  |  |  275|   153k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 153k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 153k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 451, False: 153k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1971|    451|            {
 1972|       |                /*\ Issue #166 - repeated <main> element
 1973|       |                 *  How to efficiently search for a previous main element?
 1974|       |                \*/
 1975|    451|                if ( findNodeById(doc, TidyTag_MAIN) )
  ------------------
  |  Branch (1975:22): [True: 384, False: 67]
  ------------------
 1976|    384|                {
 1977|    384|                    doc->badForm |= flg_BadMain; /* this is an ERROR in format */
  ------------------
  |  |   35|    384|#define flg_BadMain     0x00000002
  ------------------
 1978|    384|                    TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    384|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    384|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1979|    384|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    384|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    384|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1980|    384|                    continue;
 1981|    384|                }
 1982|    451|            }
 1983|       |            /* Issue #20 - merging from Ger Hobbelt fork put back CM_MIXED, which had been
 1984|       |               removed to fix this issue - reverting to fix 880221e
 1985|       |             */
 1986|   153k|            if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|   153k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   153k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|   153k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1986:18): [True: 25.1k, False: 128k]
  ------------------
 1987|  25.1k|            {
 1988|       |                /* HTML4 strict doesn't allow inline content here */
 1989|       |                /* but HTML2 does allow img elements as children of body */
 1990|  25.1k|                if ( nodeIsIMG(node) )
  ------------------
  |  |  412|  25.1k|#define nodeIsIMG( node )        TagIsId( node, TidyTag_IMG )
  |  |  ------------------
  |  |  |  |  275|  25.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 25.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 25.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.85k, False: 23.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1991|  1.85k|                    TY_(ConstrainVersion)(doc, ~VERS_HTML40_STRICT);
  ------------------
  |  |   23|  1.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~VERS_HTML40_STRICT);
  ------------------
  |  |  207|  1.85k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  1.85k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  1.85k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  1.85k|#define X10S                 256u
  |  |  ------------------
  ------------------
 1992|  23.2k|                else
 1993|  23.2k|                    TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT|VERS_HTML20));
  ------------------
  |  |   23|  23.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT|VERS_HTML20));
  ------------------
  |  |  207|  23.2k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  23.2k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  23.2k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  23.2k|#define X10S                 256u
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT|VERS_HTML20));
  ------------------
  |  |  205|  23.2k|#define VERS_HTML20        (HT20)
  |  |  ------------------
  |  |  |  |  177|  23.2k|#define HT20                   1u
  |  |  ------------------
  ------------------
 1994|       |
 1995|  25.1k|                if (checkstack && !node->implicit)
  ------------------
  |  Branch (1995:21): [True: 7.32k, False: 17.8k]
  |  Branch (1995:35): [True: 7.06k, False: 266]
  ------------------
 1996|  7.06k|                {
 1997|  7.06k|                    checkstack = no;
 1998|       |
 1999|  7.06k|                    if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  7.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1999:26): [True: 948, False: 6.11k]
  ------------------
 2000|    948|                        continue;
 2001|  7.06k|                }
 2002|       |                
 2003|  24.2k|                DEBUG_LOG_GET_OLD_MODE;
 2004|  24.2k|                mode = MixedContent;
 2005|  24.2k|                DEBUG_LOG_CHANGE_MODE;
 2006|  24.2k|            }
 2007|   128k|            else
 2008|   128k|            {
 2009|   128k|                checkstack = yes;
 2010|   128k|                DEBUG_LOG_GET_OLD_MODE;
 2011|   128k|                mode = IgnoreWhitespace;
 2012|   128k|                DEBUG_LOG_CHANGE_MODE;
 2013|   128k|            }
 2014|       |
 2015|   152k|            if (node->implicit)
  ------------------
  |  Branch (2015:17): [True: 5.63k, False: 146k]
  ------------------
 2016|  5.63k|            {
 2017|  5.63k|                TY_(Report)(doc, body, node, INSERTING_TAG);
  ------------------
  |  |   23|  5.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2018|  5.63k|            }
 2019|       |
 2020|   152k|            TY_(InsertNodeAtEnd)(body, node);
  ------------------
  |  |   23|   152k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   152k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2021|       |            
 2022|   152k|            {
 2023|   152k|                TidyParserMemory memory = {0};
 2024|   152k|                memory.identity = TY_(ParseBody);
  ------------------
  |  |   23|   152k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   152k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2025|   152k|                memory.original_node = body;
 2026|   152k|                memory.reentry_node = node;
 2027|   152k|                memory.register_1 = checkstack;
 2028|   152k|                memory.register_2 = iswhitenode;
 2029|   152k|                memory.mode = mode;
 2030|   152k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|   152k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   152k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2031|   152k|            }
 2032|   152k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2033|   152k|            return node;
 2034|   153k|        }
 2035|       |
 2036|       |        /* discard unexpected tags */
 2037|  4.73k|        TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  4.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2038|  4.73k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  4.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2039|  4.73k|    }
 2040|  37.1k|    DEBUG_LOG_EXIT;
 2041|       |    return NULL;
 2042|   201k|}
prvTidyParseColGroup:
 2054|  10.4k|{
 2055|  10.4k|    Node *node, *parent;
 2056|  10.4k|    DEBUG_LOG_COUNTERS;
 2057|       |
 2058|       |    /*
 2059|       |     If we're re-entering, then we need to setup from a previous state,
 2060|       |     instead of starting fresh. We can pull what we need from the document's
 2061|       |     stack.
 2062|       |     */
 2063|  10.4k|    if ( colgroup == NULL )
  ------------------
  |  Branch (2063:10): [True: 5.05k, False: 5.40k]
  ------------------
 2064|  5.05k|    {
 2065|  5.05k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  5.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2066|  5.05k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2067|  5.05k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2068|  5.05k|        colgroup = memory.original_node;
 2069|  5.05k|        DEBUG_LOG_GET_OLD_MODE;
 2070|  5.05k|        mode = memory.mode;
 2071|  5.05k|        DEBUG_LOG_CHANGE_MODE;
 2072|  5.05k|    }
 2073|  5.40k|    else
 2074|  5.40k|    {
 2075|  5.40k|        DEBUG_LOG_ENTER_WITH_NODE(colgroup);
 2076|  5.40k|        if (colgroup->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  5.40k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (2076:13): [True: 0, False: 5.40k]
  ------------------
 2077|      0|            return NULL;
 2078|  5.40k|    }
 2079|       |
 2080|  14.3k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  14.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2080:12): [True: 13.9k, False: 348]
  ------------------
 2081|  13.9k|    {
 2082|  13.9k|        DEBUG_LOG_GOT_TOKEN(node);
 2083|       |
 2084|  13.9k|        if (node->tag == colgroup->tag && node->type == EndTag)
  ------------------
  |  Branch (2084:13): [True: 3.70k, False: 10.2k]
  |  Branch (2084:43): [True: 66, False: 3.64k]
  ------------------
 2085|     66|        {
 2086|     66|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|     66|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     66|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2087|     66|            colgroup->closed = yes;
 2088|     66|            return NULL;
 2089|     66|        }
 2090|       |
 2091|       |        /*
 2092|       |          if this is the end tag for an ancestor element
 2093|       |          then infer end tag for this element
 2094|       |        */
 2095|  13.9k|        if (node->type == EndTag)
  ------------------
  |  Branch (2095:13): [True: 897, False: 13.0k]
  ------------------
 2096|    897|        {
 2097|    897|            if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    897|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    897|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 897, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 608, False: 289]
  |  |  |  |  |  Branch (275:54): [True: 223, False: 385]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2098|    223|            {
 2099|    223|                BadForm( doc );
 2100|    223|                TY_(Report)(doc, colgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    223|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    223|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2101|    223|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    223|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    223|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2102|    223|                continue;
 2103|    223|            }
 2104|       |
 2105|    674|            for ( parent = colgroup->parent;
 2106|  8.21k|                  parent != NULL;
  ------------------
  |  Branch (2106:19): [True: 7.80k, False: 411]
  ------------------
 2107|  7.54k|                  parent = parent->parent )
 2108|  7.80k|            {
 2109|  7.80k|                if (node->tag == parent->tag)
  ------------------
  |  Branch (2109:21): [True: 263, False: 7.54k]
  ------------------
 2110|    263|                {
 2111|    263|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    263|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    263|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2112|    263|                    DEBUG_LOG_EXIT;
 2113|    263|                    return NULL;
 2114|    263|                }
 2115|  7.80k|            }
 2116|    674|        }
 2117|       |
 2118|  13.4k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  13.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2118:13): [True: 406, False: 13.0k]
  ------------------
 2119|    406|        {
 2120|    406|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    406|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    406|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2121|    406|            DEBUG_LOG_EXIT;
 2122|    406|            return NULL;
 2123|    406|        }
 2124|       |
 2125|       |        /* deal with comments etc. */
 2126|  13.0k|        if (InsertMisc(colgroup, node))
  ------------------
  |  Branch (2126:13): [True: 226, False: 12.8k]
  ------------------
 2127|    226|            continue;
 2128|       |
 2129|       |        /* discard unknown tags */
 2130|  12.8k|        if (node->tag == NULL)
  ------------------
  |  Branch (2130:13): [True: 3.05k, False: 9.75k]
  ------------------
 2131|  3.05k|        {
 2132|  3.05k|            TY_(Report)(doc, colgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  3.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2133|  3.05k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  3.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2134|  3.05k|            continue;
 2135|  3.05k|        }
 2136|       |
 2137|  9.75k|        if ( !nodeIsCOL(node) )
  ------------------
  |  |  398|  9.75k|#define nodeIsCOL( node )        TagIsId( node, TidyTag_COL )
  |  |  ------------------
  |  |  |  |  275|  9.75k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 9.75k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 9.75k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.43k, False: 4.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2138|  4.31k|        {
 2139|  4.31k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  4.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2140|  4.31k|            DEBUG_LOG_EXIT;
 2141|  4.31k|            return NULL;
 2142|  4.31k|        }
 2143|       |
 2144|  5.43k|        if (node->type == EndTag)
  ------------------
  |  Branch (2144:13): [True: 383, False: 5.05k]
  ------------------
 2145|    383|        {
 2146|    383|            TY_(Report)(doc, colgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    383|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    383|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2147|    383|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    383|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    383|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2148|    383|            continue;
 2149|    383|        }
 2150|       |
 2151|       |        /* node should be <COL> */
 2152|  5.05k|        TY_(InsertNodeAtEnd)(colgroup, node);
  ------------------
  |  |   23|  5.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2153|       |        
 2154|  5.05k|        {
 2155|  5.05k|            TidyParserMemory memory = {0};
 2156|  5.05k|            memory.identity = TY_(ParseColGroup);
  ------------------
  |  |   23|  5.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2157|  5.05k|            memory.original_node = colgroup;
 2158|  5.05k|            memory.reentry_node = node;
 2159|  5.05k|            memory.mode = mode;
 2160|  5.05k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  5.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2161|  5.05k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2162|  5.05k|        }
 2163|  5.05k|        DEBUG_LOG_EXIT;
 2164|  5.05k|        return node;
 2165|  5.43k|    }
 2166|    348|    DEBUG_LOG_EXIT;
 2167|       |    return NULL;
 2168|  10.4k|}
prvTidyParseDatalist:
 2180|  33.6k|{
 2181|  33.6k|    Lexer* lexer = doc->lexer;
 2182|  33.6k|    Node *node;
 2183|  33.6k|    DEBUG_LOG_COUNTERS;
 2184|       |
 2185|  33.6k|    if ( field == NULL )
  ------------------
  |  Branch (2185:10): [True: 17.0k, False: 16.6k]
  ------------------
 2186|  17.0k|    {
 2187|  17.0k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  17.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2188|  17.0k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2189|  17.0k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2190|  17.0k|        field = memory.original_node;
 2191|  17.0k|        DEBUG_LOG_GET_OLD_MODE;
 2192|  17.0k|        mode = memory.mode;
 2193|  17.0k|        DEBUG_LOG_CHANGE_MODE;
 2194|  17.0k|    }
 2195|  16.6k|    else
 2196|  16.6k|    {
 2197|  16.6k|        DEBUG_LOG_ENTER_WITH_NODE(field);
 2198|  16.6k|    }
 2199|       |    
 2200|  33.6k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 2201|       |
 2202|  36.4k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  36.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2202:12): [True: 19.9k, False: 16.4k]
  ------------------
 2203|  19.9k|    {
 2204|  19.9k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (2204:13): [True: 16.3k, False: 3.57k]
  |  Branch (2204:40): [True: 194, False: 16.1k]
  ------------------
 2205|    194|        {
 2206|    194|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2207|    194|            field->closed = yes;
 2208|    194|            TrimSpaces(doc, field);
 2209|       |
 2210|    194|            DEBUG_LOG_EXIT;
 2211|    194|            return NULL;
 2212|    194|        }
 2213|       |
 2214|       |        /* deal with comments etc. */
 2215|  19.7k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (2215:13): [True: 292, False: 19.4k]
  ------------------
 2216|    292|            continue;
 2217|       |
 2218|  19.4k|        if ( node->type == StartTag &&
  ------------------
  |  Branch (2218:14): [True: 18.7k, False: 713]
  ------------------
 2219|  18.7k|             ( nodeIsOPTION(node)   ||
  ------------------
  |  |  410|  18.7k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  37.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 18.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.5k, False: 1.13k]
  |  |  |  |  |  Branch (275:54): [True: 391, False: 17.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2220|  18.7k|               nodeIsOPTGROUP(node) ||
  ------------------
  |  |  411|  18.3k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  37.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 18.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.2k, False: 1.13k]
  |  |  |  |  |  Branch (275:54): [True: 231, False: 16.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2221|  18.7k|               nodeIsDATALIST(node) ||
  ------------------
  |  |  463|  18.1k|#define nodeIsDATALIST( node )   TagIsId( node, TidyTag_DATALIST )
  |  |  ------------------
  |  |  |  |  275|  36.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 18.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 16.9k, False: 1.13k]
  |  |  |  |  |  Branch (275:54): [True: 16.1k, False: 817]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2222|  18.7k|               nodeIsSCRIPT(node))
  ------------------
  |  |  422|  1.95k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  1.95k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.95k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 817, False: 1.13k]
  |  |  |  |  |  Branch (275:54): [True: 238, False: 579]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2223|  19.4k|           )
 2224|  17.0k|        {
 2225|  17.0k|            TidyParserMemory memory = {0};
 2226|  17.0k|            memory.identity = TY_(ParseDatalist);
  ------------------
  |  |   23|  17.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2227|  17.0k|            memory.original_node = field;
 2228|  17.0k|            memory.reentry_node = node;
 2229|  17.0k|            memory.reentry_mode = IgnoreWhitespace;
 2230|       |
 2231|  17.0k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  17.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2232|  17.0k|            TY_(pushMemory)(doc, memory);
  ------------------
  |  |   23|  17.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2233|  17.0k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2234|  17.0k|            return node;
 2235|  17.0k|        }
 2236|       |
 2237|       |        /* discard unexpected tags */
 2238|  2.42k|        TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2239|  2.42k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2240|  2.42k|    }
 2241|       |
 2242|  16.4k|    TY_(Report)(doc, field, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  16.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2243|       |
 2244|  16.4k|    DEBUG_LOG_EXIT;
 2245|       |    return NULL;
 2246|  33.6k|}
prvTidyParseDefList:
 2258|  32.2k|{
 2259|  32.2k|    Lexer* lexer = doc->lexer;
 2260|  32.2k|    Node *node = NULL;
 2261|  32.2k|    Node *parent = NULL;
 2262|  32.2k|    DEBUG_LOG_COUNTERS;
 2263|       |
 2264|  32.2k|    enum parserState {
 2265|  32.2k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 2266|  32.2k|        STATE_POST_NODEISCENTER,      /* To-do after re-entering after checks. */
 2267|  32.2k|        STATE_COMPLETE,               /* Done with the switch. */
 2268|  32.2k|    } state = STATE_INITIAL;
 2269|       |
 2270|  32.2k|    if ( list == NULL )
  ------------------
  |  Branch (2270:10): [True: 13.7k, False: 18.5k]
  ------------------
 2271|  13.7k|    {
 2272|  13.7k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  13.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2273|  13.7k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2274|  13.7k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2275|  13.7k|        list = memory.original_node;
 2276|  13.7k|        state = memory.reentry_state;
 2277|  13.7k|        DEBUG_LOG_GET_OLD_MODE;
 2278|  13.7k|        mode = memory.mode;
 2279|  13.7k|        DEBUG_LOG_CHANGE_MODE;
 2280|  13.7k|    }
 2281|  18.5k|    else
 2282|  18.5k|    {
 2283|  18.5k|        DEBUG_LOG_ENTER_WITH_NODE(list);
 2284|  18.5k|    }
 2285|       |
 2286|  32.2k|    if (list->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  32.2k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (2286:9): [True: 0, False: 32.2k]
  ------------------
 2287|      0|        return NULL;
 2288|       |
 2289|  32.2k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 2290|       |
 2291|  43.1k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (2291:13): [True: 38.1k, False: 4.93k]
  ------------------
 2292|  38.1k|    {
 2293|  38.1k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (2293:14): [True: 36.6k, False: 1.51k]
  ------------------
 2294|  36.6k|            node = TY_(GetToken)( doc, IgnoreWhitespace);
  ------------------
  |  |   23|  36.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2295|       |        
 2296|  38.1k|        switch ( state)
 2297|  38.1k|        {
 2298|  36.6k|            case STATE_INITIAL:
  ------------------
  |  Branch (2298:13): [True: 36.6k, False: 1.51k]
  ------------------
 2299|  36.6k|            {
 2300|  36.6k|                if ( node == NULL)
  ------------------
  |  Branch (2300:22): [True: 4.93k, False: 31.7k]
  ------------------
 2301|  4.93k|                {
 2302|  4.93k|                    state = STATE_COMPLETE;
 2303|  4.93k|                    continue;
 2304|  4.93k|                }
 2305|       |
 2306|  31.7k|                if (node->tag == list->tag && node->type == EndTag)
  ------------------
  |  Branch (2306:21): [True: 4.88k, False: 26.8k]
  |  Branch (2306:47): [True: 645, False: 4.23k]
  ------------------
 2307|    645|                {
 2308|    645|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    645|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    645|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2309|    645|                    list->closed = yes;
 2310|    645|                    DEBUG_LOG_EXIT;
 2311|    645|                    return NULL;
 2312|    645|                }
 2313|       |
 2314|       |                /* deal with comments etc. */
 2315|  31.1k|                if (InsertMisc(list, node))
  ------------------
  |  Branch (2315:21): [True: 297, False: 30.8k]
  ------------------
 2316|    297|                    continue;
 2317|       |
 2318|  30.8k|                if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  30.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  30.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2318:21): [True: 2.78k, False: 28.0k]
  ------------------
 2319|  2.78k|                {
 2320|  2.78k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2321|  2.78k|                    node = TY_(InferredTag)(doc, TidyTag_DT);
  ------------------
  |  |   23|  2.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2322|  2.78k|                    TY_(Report)(doc, list, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  2.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2323|  2.78k|                }
 2324|       |
 2325|  30.8k|                if (node->tag == NULL)
  ------------------
  |  Branch (2325:21): [True: 1.00k, False: 29.8k]
  ------------------
 2326|  1.00k|                {
 2327|  1.00k|                    TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2328|  1.00k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2329|  1.00k|                    continue;
 2330|  1.00k|                }
 2331|       |
 2332|       |                /*
 2333|       |                  if this is the end tag for an ancestor element
 2334|       |                  then infer end tag for this element
 2335|       |                */
 2336|  29.8k|                if (node->type == EndTag)
  ------------------
  |  Branch (2336:21): [True: 4.40k, False: 25.4k]
  ------------------
 2337|  4.40k|                {
 2338|  4.40k|                    Bool discardIt = no;
 2339|  4.40k|                    if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  4.40k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  4.40k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.40k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.40k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.01k, False: 2.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2340|  2.01k|                    {
 2341|  2.01k|                        BadForm( doc );
 2342|  2.01k|                        TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.01k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.01k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2343|  2.01k|                        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  2.01k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.01k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2344|  2.01k|                        continue;
 2345|  2.01k|                    }
 2346|       |
 2347|  2.38k|                    for (parent = list->parent;
 2348|   222k|                            parent != NULL; parent = parent->parent)
  ------------------
  |  Branch (2348:29): [True: 221k, False: 831]
  ------------------
 2349|   221k|                    {
 2350|       |                       /* Do not match across BODY to avoid infinite loop
 2351|       |                          between ParseBody and this parser,
 2352|       |                          See http://tidy.sf.net/bug/1098012. */
 2353|   221k|                        if (nodeIsBODY(parent))
  ------------------
  |  |  375|   221k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   221k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 221k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 220k, False: 829]
  |  |  |  |  |  Branch (275:54): [True: 762, False: 219k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2354|    762|                        {
 2355|    762|                            discardIt = yes;
 2356|    762|                            break;
 2357|    762|                        }
 2358|   220k|                        if (node->tag == parent->tag)
  ------------------
  |  Branch (2358:29): [True: 793, False: 219k]
  ------------------
 2359|    793|                        {
 2360|    793|                            TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|    793|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    793|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2361|    793|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    793|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    793|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2362|       |
 2363|    793|                            DEBUG_LOG_EXIT;
 2364|    793|                            return NULL;
 2365|    793|                        }
 2366|   220k|                    }
 2367|  1.59k|                    if (discardIt)
  ------------------
  |  Branch (2367:25): [True: 762, False: 831]
  ------------------
 2368|    762|                    {
 2369|    762|                        TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    762|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    762|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2370|    762|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    762|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    762|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2371|    762|                        continue;
 2372|    762|                    }
 2373|  1.59k|                }
 2374|       |
 2375|       |                /* center in a dt or a dl breaks the dl list in two */
 2376|  26.2k|                if ( nodeIsCENTER(node) )
  ------------------
  |  |  420|  26.2k|#define nodeIsCENTER( node )     TagIsId( node, TidyTag_CENTER )
  |  |  ------------------
  |  |  |  |  275|  26.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 26.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 26.2k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.51k, False: 24.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2377|  1.51k|                {
 2378|  1.51k|                    if (list->content)
  ------------------
  |  Branch (2378:25): [True: 1.20k, False: 310]
  ------------------
 2379|  1.20k|                        TY_(InsertNodeAfterElement)(list, node);
  ------------------
  |  |   23|  1.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.20k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2380|    310|                    else /* trim empty dl list */
 2381|    310|                    {
 2382|    310|                        TY_(InsertNodeBeforeElement)(list, node);
  ------------------
  |  |   23|    310|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    310|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2383|    310|                    }
 2384|       |
 2385|       |                    /* #426885 - fix by Glenn Carroll 19 Apr 00, and
 2386|       |                                 Gary Dechaines 11 Aug 00 */
 2387|       |                    /* ParseTag can destroy node, if it finds that
 2388|       |                     * this <center> is followed immediately by </center>.
 2389|       |                     * It's awkward but necessary to determine if this
 2390|       |                     * has happened.
 2391|       |                     */
 2392|  1.51k|                    parent = node->parent;
 2393|       |
 2394|       |                    /* and parse contents of center */
 2395|  1.51k|                    lexer->excludeBlocks = no;
 2396|       |
 2397|  1.51k|                    {
 2398|  1.51k|                        TidyParserMemory memory = {0};
 2399|  1.51k|                        memory.identity = TY_(ParseDefList);
  ------------------
  |  |   23|  1.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2400|  1.51k|                        memory.original_node = list;
 2401|  1.51k|                        memory.reentry_node = node;
 2402|  1.51k|                        memory.reentry_state = STATE_POST_NODEISCENTER;
 2403|  1.51k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2404|  1.51k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 2405|  1.51k|                        return node;
 2406|  1.51k|                    }
 2407|  1.51k|                }
 2408|       |
 2409|  24.7k|                if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |  391|  24.7k|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  275|  49.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 24.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 24.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.01k, False: 20.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |  392|  20.7k|#define nodeIsDD( node )         TagIsId( node, TidyTag_DD )
  |  |  ------------------
  |  |  |  |  275|  45.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 20.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 20.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 12.4k, False: 8.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |  429|  8.23k|#define nodeIsDIV( node )        TagIsId( node, TidyTag_DIV )
  |  |  ------------------
  |  |  |  |  275|  16.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.23k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.23k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 681, False: 7.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |   23|    681|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    681|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2409:82): [True: 414, False: 267]
  ------------------
 2410|  7.81k|                {
 2411|  7.81k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  7.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2412|       |
 2413|  7.81k|                    if (!(node->tag->model & (CM_BLOCK | CM_INLINE)))
  ------------------
  |  |  142|  7.81k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                  if (!(node->tag->model & (CM_BLOCK | CM_INLINE)))
  ------------------
  |  |  143|  7.81k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2413:25): [True: 1.57k, False: 6.24k]
  ------------------
 2414|  1.57k|                    {
 2415|  1.57k|                        TY_(Report)(doc, list, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2416|  1.57k|                        DEBUG_LOG_EXIT;
 2417|  1.57k|                        return NULL;
 2418|  1.57k|                    }
 2419|       |
 2420|       |                    /* if DD appeared directly in BODY then exclude blocks */
 2421|  6.24k|                    if (!(node->tag->model & CM_INLINE) && lexer->excludeBlocks)
  ------------------
  |  |  143|  6.24k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2421:25): [True: 4.90k, False: 1.34k]
  |  Branch (2421:60): [True: 1.35k, False: 3.54k]
  ------------------
 2422|  1.35k|                    {
 2423|  1.35k|                        DEBUG_LOG_EXIT;
 2424|  1.35k|                        return NULL;
 2425|  1.35k|                    }
 2426|       |
 2427|  4.89k|                    node = TY_(InferredTag)(doc, TidyTag_DD);
  ------------------
  |  |   23|  4.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2428|  4.89k|                    TY_(Report)(doc, list, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  4.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2429|  4.89k|                }
 2430|       |
 2431|  21.7k|                if (node->type == EndTag)
  ------------------
  |  Branch (2431:21): [True: 314, False: 21.4k]
  ------------------
 2432|    314|                {
 2433|    314|                    TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    314|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    314|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2434|    314|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    314|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    314|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2435|    314|                    continue;
 2436|    314|                }
 2437|       |
 2438|       |                /* node should be <DT> or <DD> or <DIV>*/
 2439|  21.4k|                TY_(InsertNodeAtEnd)(list, node);
  ------------------
  |  |   23|  21.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2440|  21.4k|                {
 2441|  21.4k|                    TidyParserMemory memory = {0};
 2442|  21.4k|                    memory.identity = TY_(ParseDefList);
  ------------------
  |  |   23|  21.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2443|  21.4k|                    memory.original_node = list;
 2444|  21.4k|                    memory.reentry_node = node;
 2445|  21.4k|                    memory.reentry_state = STATE_INITIAL;
 2446|  21.4k|                    TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  21.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2447|  21.4k|                    DEBUG_LOG_EXIT;
 2448|  21.4k|                    return node;
 2449|  21.7k|                }
 2450|  21.7k|            } break;
 2451|       |
 2452|       |
 2453|  1.51k|            case STATE_POST_NODEISCENTER:
  ------------------
  |  Branch (2453:13): [True: 1.51k, False: 36.6k]
  ------------------
 2454|  1.51k|            {
 2455|  1.51k|                lexer->excludeBlocks = yes;
 2456|       |
 2457|       |                /* now create a new dl element,
 2458|       |                 * unless node has been blown away because the
 2459|       |                 * center was empty, as above.
 2460|       |                 */
 2461|  1.51k|                if (parent && parent->last == node)
  ------------------
  |  Branch (2461:21): [True: 0, False: 1.51k]
  |  Branch (2461:31): [True: 0, False: 0]
  ------------------
 2462|      0|                {
 2463|      0|                    list = TY_(InferredTag)(doc, TidyTag_DL);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2464|      0|                    TY_(InsertNodeAfterElement)(node, list);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2465|      0|                }
 2466|  1.51k|                state = STATE_INITIAL;
 2467|  1.51k|                continue;
 2468|  21.7k|            } break;
 2469|       |
 2470|       |
 2471|      0|            default:
  ------------------
  |  Branch (2471:13): [True: 0, False: 38.1k]
  ------------------
 2472|      0|                break;
 2473|  38.1k|        } /* switch */
 2474|  38.1k|    } /* while */
 2475|       |
 2476|  4.93k|    TY_(Report)(doc, list, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  4.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2477|  4.93k|    DEBUG_LOG_EXIT;
 2478|       |    return NULL;
 2479|  32.2k|}
prvTidyParseEmpty:
 2491|  29.4k|{
 2492|  29.4k|    Lexer* lexer = doc->lexer;
 2493|  29.4k|    if ( lexer->isvoyager )
  ------------------
  |  Branch (2493:10): [True: 1.49k, False: 27.9k]
  ------------------
 2494|  1.49k|    {
 2495|  1.49k|        Node *node = TY_(GetToken)( doc, mode);
  ------------------
  |  |   23|  1.49k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.49k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2496|  1.49k|        if ( node )
  ------------------
  |  Branch (2496:14): [True: 1.24k, False: 250]
  ------------------
 2497|  1.24k|        {
 2498|  1.24k|            if ( !(node->type == EndTag && node->tag == element->tag) )
  ------------------
  |  Branch (2498:20): [True: 725, False: 521]
  |  Branch (2498:44): [True: 253, False: 472]
  ------------------
 2499|    993|            {
 2500|       |                /* TY_(Report)(doc, element, node, ELEMENT_NOT_EMPTY); */
 2501|    993|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    993|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    993|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2502|    993|            }
 2503|    253|            else
 2504|    253|            {
 2505|    253|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    253|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    253|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2506|    253|            }
 2507|  1.24k|        }
 2508|  1.49k|    }
 2509|       |    return NULL;
 2510|  29.4k|}
prvTidyParseFrameSet:
 2522|  43.8k|{
 2523|  43.8k|    Lexer* lexer = doc->lexer;
 2524|  43.8k|    Node *node;
 2525|  43.8k|    DEBUG_LOG_COUNTERS;
 2526|       |
 2527|       |    /*
 2528|       |     If we're re-entering, then we need to setup from a previous state,
 2529|       |     instead of starting fresh. We can pull what we need from the document's
 2530|       |     stack.
 2531|       |     */
 2532|  43.8k|    if ( frameset == NULL )
  ------------------
  |  Branch (2532:10): [True: 19.1k, False: 24.7k]
  ------------------
 2533|  19.1k|    {
 2534|  19.1k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  19.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2535|  19.1k|        node = memory.reentry_node; /* Throwaway, because we replace it entering the loop. */
 2536|  19.1k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2537|  19.1k|        frameset = memory.original_node;
 2538|  19.1k|        DEBUG_LOG_GET_OLD_MODE;
 2539|  19.1k|        mode = memory.mode;
 2540|  19.1k|        DEBUG_LOG_CHANGE_MODE;
 2541|  19.1k|    }
 2542|  24.7k|    else
 2543|  24.7k|    {
 2544|  24.7k|        DEBUG_LOG_ENTER_WITH_NODE(frameset);
 2545|  24.7k|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  24.7k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (2545:14): [True: 24.7k, False: 0]
  ------------------
 2546|  24.7k|        {
 2547|  24.7k|            doc->badAccess |= BA_USING_FRAMES;
  ------------------
  |  |  284|  24.7k|#define BA_USING_FRAMES            16
  ------------------
 2548|  24.7k|        }
 2549|  24.7k|    }
 2550|       |
 2551|  51.4k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  51.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2551:12): [True: 27.0k, False: 24.4k]
  ------------------
 2552|  27.0k|    {
 2553|  27.0k|        if (node->tag == frameset->tag && node->type == EndTag)
  ------------------
  |  Branch (2553:13): [True: 17.6k, False: 9.30k]
  |  Branch (2553:43): [True: 248, False: 17.4k]
  ------------------
 2554|    248|        {
 2555|    248|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    248|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    248|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2556|    248|            frameset->closed = yes;
 2557|    248|            TrimSpaces(doc, frameset);
 2558|    248|            DEBUG_LOG_EXIT;
 2559|    248|            return NULL;
 2560|    248|        }
 2561|       |
 2562|       |        /* deal with comments etc. */
 2563|  26.7k|        if (InsertMisc(frameset, node))
  ------------------
  |  Branch (2563:13): [True: 523, False: 26.2k]
  ------------------
 2564|    523|            continue;
 2565|       |
 2566|  26.2k|        if (node->tag == NULL)
  ------------------
  |  Branch (2566:13): [True: 3.96k, False: 22.2k]
  ------------------
 2567|  3.96k|        {
 2568|  3.96k|            TY_(Report)(doc, frameset, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  3.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2569|  3.96k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  3.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2570|  3.96k|            continue;
 2571|  3.96k|        }
 2572|       |
 2573|  22.2k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  22.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2573:13): [True: 21.9k, False: 307]
  ------------------
 2574|  21.9k|        {
 2575|  21.9k|            if (node->tag && node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  21.9k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (2575:17): [True: 21.9k, False: 0]
  |  Branch (2575:30): [True: 195, False: 21.7k]
  ------------------
 2576|    195|            {
 2577|    195|                MoveToHead(doc, frameset, node);
 2578|    195|                continue;
 2579|    195|            }
 2580|  21.9k|        }
 2581|       |
 2582|  22.0k|        if ( nodeIsBODY(node) )
  ------------------
  |  |  375|  22.0k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  22.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 22.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 22.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 989, False: 21.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2583|    989|        {
 2584|    989|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    989|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    989|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2585|    989|            node = TY_(InferredTag)(doc, TidyTag_NOFRAMES);
  ------------------
  |  |   23|    989|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    989|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2586|    989|            TY_(Report)(doc, frameset, node, INSERTING_TAG);
  ------------------
  |  |   23|    989|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    989|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2587|    989|        }
 2588|       |
 2589|  22.0k|        if (node->type == StartTag && (node->tag && node->tag->model & CM_FRAMES))
  ------------------
  |  |  152|  20.3k|#define CM_FRAMES       (1 << 13)  /**< "FRAME", "FRAMESET", "NOFRAMES". Used in ParseFrameSet. */
  ------------------
  |  Branch (2589:13): [True: 20.3k, False: 1.75k]
  |  Branch (2589:40): [True: 20.3k, False: 0]
  |  Branch (2589:53): [True: 19.2k, False: 1.10k]
  ------------------
 2590|  19.2k|        {
 2591|  19.2k|            TY_(InsertNodeAtEnd)(frameset, node);
  ------------------
  |  |   23|  19.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2592|  19.2k|            lexer->excludeBlocks = no;
 2593|       |            
 2594|       |            /*
 2595|       |             * We don't really have to do anything when re-entering, except
 2596|       |             * setting up the state when we left. No post-processing means
 2597|       |             * this stays simple.
 2598|       |             */
 2599|  19.2k|            TidyParserMemory memory = {0};
 2600|  19.2k|            memory.identity = TY_(ParseFrameSet);
  ------------------
  |  |   23|  19.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2601|  19.2k|            memory.original_node = frameset;
 2602|  19.2k|            memory.reentry_node = node;
 2603|  19.2k|            memory.mode = MixedContent;
 2604|  19.2k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  19.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2605|  19.2k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2606|  19.2k|            return node;
 2607|  19.2k|        }
 2608|  2.86k|        else if (node->type == StartEndTag && (node->tag && node->tag->model & CM_FRAMES))
  ------------------
  |  |  152|  1.46k|#define CM_FRAMES       (1 << 13)  /**< "FRAME", "FRAMESET", "NOFRAMES". Used in ParseFrameSet. */
  ------------------
  |  Branch (2608:18): [True: 1.46k, False: 1.39k]
  |  Branch (2608:48): [True: 1.46k, False: 0]
  |  Branch (2608:61): [True: 1.25k, False: 212]
  ------------------
 2609|  1.25k|        {
 2610|  1.25k|            TY_(InsertNodeAtEnd)(frameset, node);
  ------------------
  |  |   23|  1.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2611|  1.25k|            continue;
 2612|  1.25k|        }
 2613|       |
 2614|       |        /* discard unexpected tags */
 2615|       |        /* WAI [6.5.1.4] link is being discarded outside of NOFRAME */
 2616|  1.61k|        if ( nodeIsA(node) )
  ------------------
  |  |  401|  1.61k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  1.61k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.61k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.61k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 233, False: 1.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2617|    233|           doc->badAccess |= BA_INVALID_LINK_NOFRAMES;
  ------------------
  |  |  286|    233|#define BA_INVALID_LINK_NOFRAMES   64  /* WAI [6.5.1.4] */  
  ------------------
 2618|       |
 2619|  1.61k|        TY_(Report)(doc, frameset, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2620|  1.61k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2621|  1.61k|    }
 2622|       |
 2623|  24.4k|    TY_(Report)(doc, frameset, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  24.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2624|  24.4k|    DEBUG_LOG_EXIT;
 2625|       |    return NULL;
 2626|  43.8k|}
prvTidyParseHead:
 2638|  57.8k|{
 2639|  57.8k|    Lexer* lexer = doc->lexer;
 2640|  57.8k|    Node *node;
 2641|  57.8k|    int HasTitle = 0;
 2642|  57.8k|    int HasBase = 0;
 2643|  57.8k|    DEBUG_LOG_COUNTERS;
 2644|       |
 2645|  57.8k|    if ( head == NULL )
  ------------------
  |  Branch (2645:10): [True: 6.76k, False: 51.1k]
  ------------------
 2646|  6.76k|    {
 2647|  6.76k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  6.76k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.76k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2648|  6.76k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2649|  6.76k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2650|  6.76k|        head = memory.original_node;
 2651|  6.76k|        HasTitle = memory.register_1;
 2652|  6.76k|        HasBase = memory.register_2;
 2653|  6.76k|        DEBUG_LOG_GET_OLD_MODE;
 2654|  6.76k|        mode = memory.mode;
 2655|  6.76k|        DEBUG_LOG_CHANGE_MODE;
 2656|  6.76k|    }
 2657|  51.1k|    else
 2658|  51.1k|    {
 2659|  51.1k|        DEBUG_LOG_ENTER_WITH_NODE(head);
 2660|  51.1k|    }
 2661|       |    
 2662|  72.7k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  72.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  72.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2662:12): [True: 65.5k, False: 7.20k]
  ------------------
 2663|  65.5k|    {
 2664|  65.5k|        if (node->tag == head->tag && node->type == EndTag)
  ------------------
  |  Branch (2664:13): [True: 1.04k, False: 64.4k]
  |  Branch (2664:39): [True: 223, False: 825]
  ------------------
 2665|    223|        {
 2666|    223|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    223|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    223|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2667|    223|            head->closed = yes;
 2668|    223|            break;
 2669|    223|        }
 2670|       |
 2671|       |        /* find and discard multiple <head> elements */
 2672|       |        /* find and discard <html> in <head> elements */
 2673|  65.2k|        if ((node->tag == head->tag || nodeIsHTML(node)) && node->type == StartTag)
  ------------------
  |  |  370|  64.4k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  64.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 64.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 43.7k, False: 20.7k]
  |  |  |  |  |  Branch (275:54): [True: 996, False: 42.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2673:14): [True: 825, False: 64.4k]
  |  Branch (2673:61): [True: 1.56k, False: 256]
  ------------------
 2674|  1.56k|        {
 2675|  1.56k|            TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2676|  1.56k|            TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2677|  1.56k|            continue;
 2678|  1.56k|        }
 2679|       |
 2680|  63.7k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  63.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  63.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2680:13): [True: 8.17k, False: 55.5k]
  ------------------
 2681|  8.17k|        {
 2682|       |            /*\ Issue #132 - avoid warning for missing body tag,
 2683|       |             *  if configured to --omit-otpional-tags yes
 2684|       |             *  Issue #314 - and if --show-body-only
 2685|       |            \*/
 2686|  8.17k|            if (!cfgBool( doc, TidyOmitOptionalTags ) &&
  ------------------
  |  |  418|  16.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  8.17k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2686:17): [True: 8.17k, False: 0]
  |  Branch (2686:17): [True: 8.17k, False: 0]
  ------------------
 2687|  8.17k|                !showingBodyOnly(doc) )
  ------------------
  |  |   28|  8.17k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  8.17k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  8.17k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2687:17): [True: 8.17k, False: 0]
  ------------------
 2688|  8.17k|            {
 2689|  8.17k|                TY_(Report)(doc, head, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  8.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2690|  8.17k|            }
 2691|  8.17k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  8.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2692|  8.17k|            break;
 2693|  8.17k|        }
 2694|       |
 2695|  55.5k|        if (node->type == ProcInsTag && node->element &&
  ------------------
  |  Branch (2695:13): [True: 1.60k, False: 53.9k]
  |  Branch (2695:41): [True: 1.16k, False: 448]
  ------------------
 2696|  1.16k|            TY_(tmbstrcmp)(node->element, "xml-stylesheet") == 0)
  ------------------
  |  |   23|  1.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2696:13): [True: 596, False: 564]
  ------------------
 2697|    596|        {
 2698|    596|            TY_(Report)(doc, head, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|    596|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    596|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2699|    596|            TY_(InsertNodeBeforeElement)(TY_(FindHTML)(doc), node);
  ------------------
  |  |   23|    596|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    596|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(InsertNodeBeforeElement)(TY_(FindHTML)(doc), node);
  ------------------
  |  |   23|    596|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    596|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2700|    596|            continue;
 2701|    596|        }
 2702|       |
 2703|       |        /* deal with comments etc. */
 2704|  54.9k|        if (InsertMisc(head, node))
  ------------------
  |  Branch (2704:13): [True: 1.11k, False: 53.8k]
  ------------------
 2705|  1.11k|            continue;
 2706|       |
 2707|  53.8k|        if (node->type == DocTypeTag)
  ------------------
  |  Branch (2707:13): [True: 1.18k, False: 52.6k]
  ------------------
 2708|  1.18k|        {
 2709|  1.18k|            InsertDocType(doc, head, node);
 2710|  1.18k|            continue;
 2711|  1.18k|        }
 2712|       |
 2713|       |        /* discard unknown tags */
 2714|  52.6k|        if (node->tag == NULL)
  ------------------
  |  Branch (2714:13): [True: 9.65k, False: 42.9k]
  ------------------
 2715|  9.65k|        {
 2716|  9.65k|            TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  9.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2717|  9.65k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  9.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2718|  9.65k|            continue;
 2719|  9.65k|        }
 2720|       |
 2721|       |        /*
 2722|       |         if it doesn't belong in the head then
 2723|       |         treat as implicit end of head and deal
 2724|       |         with as part of the body
 2725|       |        */
 2726|  42.9k|        if (!(node->tag->model & CM_HEAD))
  ------------------
  |  |  141|  42.9k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (2726:13): [True: 35.5k, False: 7.49k]
  ------------------
 2727|  35.5k|        {
 2728|       |            /* #545067 Implicit closing of head broken - warn only for XHTML input */
 2729|  35.5k|            if ( lexer->isvoyager )
  ------------------
  |  Branch (2729:18): [True: 368, False: 35.1k]
  ------------------
 2730|    368|                TY_(Report)(doc, head, node, TAG_NOT_ALLOWED_IN );
  ------------------
  |  |   23|    368|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    368|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2731|  35.5k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  35.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2732|  35.5k|            break;
 2733|  35.5k|        }
 2734|       |
 2735|  7.49k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  7.49k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.49k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2735:13): [True: 6.76k, False: 735]
  ------------------
 2736|  6.76k|        {
 2737|  6.76k|            if ( nodeIsTITLE(node) )
  ------------------
  |  |  372|  6.76k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  6.76k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.76k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.76k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.03k, False: 4.72k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2738|  2.03k|            {
 2739|  2.03k|                ++HasTitle;
 2740|       |
 2741|  2.03k|                if (HasTitle > 1)
  ------------------
  |  Branch (2741:21): [True: 1.73k, False: 306]
  ------------------
 2742|  1.73k|                    TY_(Report)(doc, head, node,
  ------------------
  |  |   23|  1.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2743|  1.73k|                                     head ?
  ------------------
  |  Branch (2743:38): [True: 1.73k, False: 0]
  ------------------
 2744|  1.73k|                                     TOO_MANY_ELEMENTS_IN : TOO_MANY_ELEMENTS);
 2745|  2.03k|            }
 2746|  4.72k|            else if ( nodeIsBASE(node) )
  ------------------
  |  |  373|  4.72k|#define nodeIsBASE( node )       TagIsId( node, TidyTag_BASE )
  |  |  ------------------
  |  |  |  |  275|  4.72k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.72k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.72k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.46k, False: 3.25k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2747|  1.46k|            {
 2748|  1.46k|                ++HasBase;
 2749|       |
 2750|  1.46k|                if (HasBase > 1)
  ------------------
  |  Branch (2750:21): [True: 406, False: 1.06k]
  ------------------
 2751|    406|                    TY_(Report)(doc, head, node,
  ------------------
  |  |   23|    406|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    406|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2752|    406|                                     head ?
  ------------------
  |  Branch (2752:38): [True: 406, False: 0]
  ------------------
 2753|    406|                                     TOO_MANY_ELEMENTS_IN : TOO_MANY_ELEMENTS);
 2754|  1.46k|            }
 2755|       |
 2756|  6.76k|            TY_(InsertNodeAtEnd)(head, node);
  ------------------
  |  |   23|  6.76k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.76k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2757|       |
 2758|  6.76k|            {
 2759|  6.76k|                TidyParserMemory memory = {0};
 2760|  6.76k|                memory.identity = TY_(ParseHead);
  ------------------
  |  |   23|  6.76k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.76k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2761|  6.76k|                memory.original_node = head;
 2762|  6.76k|                memory.reentry_node = node;
 2763|  6.76k|                memory.register_1 = HasTitle;
 2764|  6.76k|                memory.register_2 = HasBase;
 2765|  6.76k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  6.76k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.76k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2766|  6.76k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 2767|  6.76k|                return node;
 2768|  6.76k|            }
 2769|  6.76k|        }
 2770|       |
 2771|       |        /* discard unexpected text nodes and end tags */
 2772|    735|        TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    735|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    735|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2773|    735|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    735|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    735|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2774|    735|    }
 2775|  51.1k|    DEBUG_LOG_EXIT;
 2776|       |    return NULL;
 2777|  57.8k|}
prvTidyParseHTML:
 2791|   109k|{
 2792|   109k|    Node *node = NULL;
 2793|   109k|    Node *head = NULL;
 2794|   109k|    Node *frameset = NULL;
 2795|   109k|    Node *noframes = NULL;
 2796|   109k|    DEBUG_LOG_COUNTERS;
 2797|       |
 2798|   109k|    enum parserState {
 2799|   109k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 2800|   109k|        STATE_COMPLETE,               /* Complete! */
 2801|   109k|        STATE_PRE_BODY,               /* In this state, we'll consider frames vs. body. */
 2802|   109k|        STATE_PARSE_BODY,             /* In this state, we can parse the body. */
 2803|   109k|        STATE_PARSE_HEAD,             /* In this state, we will setup head for parsing. */
 2804|   109k|        STATE_PARSE_HEAD_REENTER,     /* Resume here after parsing head. */
 2805|   109k|        STATE_PARSE_NOFRAMES,         /* In this state, we can parse noframes content. */
 2806|   109k|        STATE_PARSE_NOFRAMES_REENTER, /* In this state, we can restore more state. */
 2807|   109k|        STATE_PARSE_FRAMESET,         /* In this state, we will parse frameset content. */
 2808|   109k|        STATE_PARSE_FRAMESET_REENTER, /* We need to cleanup some things after parsing frameset. */
 2809|   109k|    } state = STATE_INITIAL;
 2810|       |
 2811|   109k|    TY_(SetOptionBool)( doc, TidyXmlTags, no );
  ------------------
  |  |   23|   109k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   109k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2812|       |
 2813|   109k|    if ( html == NULL )
  ------------------
  |  Branch (2813:10): [True: 60.1k, False: 49.8k]
  ------------------
 2814|  60.1k|    {
 2815|  60.1k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  60.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2816|  60.1k|        node = memory.reentry_node;
 2817|  60.1k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2818|  60.1k|        html = memory.original_node;
 2819|  60.1k|        state = memory.reentry_state;
 2820|  60.1k|        DEBUG_LOG_GET_OLD_MODE;
 2821|  60.1k|        mode = memory.reentry_mode;
 2822|  60.1k|        DEBUG_LOG_CHANGE_MODE;
 2823|  60.1k|    }
 2824|  49.8k|    else
 2825|  49.8k|    {
 2826|  49.8k|        DEBUG_LOG_ENTER_WITH_NODE(html);
 2827|  49.8k|    }
 2828|       |
 2829|       |    /*
 2830|       |     This main loop pulls tokens from the lexer until we're out of tokens,
 2831|       |     or until there's no more work to do.
 2832|       |     */
 2833|   286k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (2833:13): [True: 284k, False: 1.44k]
  ------------------
 2834|   284k|    {
 2835|   284k|        if ( state == STATE_INITIAL || state == STATE_PRE_BODY )
  ------------------
  |  Branch (2835:14): [True: 52.7k, False: 232k]
  |  Branch (2835:40): [True: 63.5k, False: 168k]
  ------------------
 2836|   116k|        {
 2837|   116k|            node = TY_(GetToken)( doc, IgnoreWhitespace );
  ------------------
  |  |   23|   116k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   116k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2838|   116k|            DEBUG_LOG_GOT_TOKEN(node);
 2839|   116k|        }
 2840|       |
 2841|   284k|        switch ( state )
 2842|   284k|        {
 2843|       |            /**************************************************************
 2844|       |             This case is all about finding a head tag and dealing with
 2845|       |             cases were we don't, so that we can move on to parsing a head
 2846|       |             tag.
 2847|       |             **************************************************************/
 2848|  52.7k|            case STATE_INITIAL:
  ------------------
  |  Branch (2848:13): [True: 52.7k, False: 232k]
  ------------------
 2849|  52.7k|            {
 2850|       |                /*
 2851|       |                 The only way we can possibly be here is if the lexer
 2852|       |                 had nothing to give us. Thus we'll create our own
 2853|       |                 head, and set the signal to start parsing it.
 2854|       |                 */
 2855|  52.7k|                if (node == NULL)
  ------------------
  |  Branch (2855:21): [True: 3.71k, False: 49.0k]
  ------------------
 2856|  3.71k|                {
 2857|  3.71k|                    node = TY_(InferredTag)(doc, TidyTag_HEAD);
  ------------------
  |  |   23|  3.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2858|  3.71k|                    state = STATE_PARSE_HEAD;
 2859|  3.71k|                    continue;
 2860|  3.71k|                }
 2861|       |
 2862|       |                /* We found exactly what we expected: head. */
 2863|  49.0k|                if ( nodeIsHEAD(node) )
  ------------------
  |  |  371|  49.0k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|  49.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 49.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 37.1k, False: 11.8k]
  |  |  |  |  |  Branch (275:54): [True: 300, False: 36.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2864|    300|                {
 2865|    300|                    state = STATE_PARSE_HEAD;
 2866|    300|                    continue;
 2867|    300|                }
 2868|       |
 2869|       |                /* We did not expect to find an html closing tag here! */
 2870|  48.7k|                if (html && (node->tag == html->tag) && (node->type == EndTag))
  ------------------
  |  Branch (2870:21): [True: 48.7k, False: 0]
  |  Branch (2870:29): [True: 2.42k, False: 46.3k]
  |  Branch (2870:57): [True: 252, False: 2.16k]
  ------------------
 2871|    252|                {
 2872|    252|                    TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    252|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    252|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2873|    252|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    252|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    252|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2874|    252|                    continue;
 2875|    252|                }
 2876|       |
 2877|       |                /* Find and discard multiple <html> elements. */
 2878|  48.4k|                if (html && (node->tag == html->tag) && (node->type == StartTag))
  ------------------
  |  Branch (2878:21): [True: 48.4k, False: 0]
  |  Branch (2878:29): [True: 2.16k, False: 46.3k]
  |  Branch (2878:57): [True: 1.92k, False: 240]
  ------------------
 2879|  1.92k|                {
 2880|  1.92k|                    TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2881|  1.92k|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  1.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2882|  1.92k|                    continue;
 2883|  1.92k|                }
 2884|       |
 2885|       |                /* Deal with comments, etc. */
 2886|  46.5k|                if (InsertMisc(html, node))
  ------------------
  |  Branch (2886:21): [True: 756, False: 45.7k]
  ------------------
 2887|    756|                    continue;
 2888|       |
 2889|       |                /*
 2890|       |                 At this point, we didn't find a head tag, so put the
 2891|       |                 token back and create our own head tag, so we can
 2892|       |                 move on.
 2893|       |                 */
 2894|  45.7k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  45.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2895|  45.7k|                node = TY_(InferredTag)(doc, TidyTag_HEAD);
  ------------------
  |  |   23|  45.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2896|  45.7k|                state = STATE_PARSE_HEAD;
 2897|  45.7k|                continue;
 2898|  46.5k|            } break;
 2899|       |
 2900|       |
 2901|       |            /**************************************************************
 2902|       |             This case determines whether we're dealing with body or
 2903|       |             frameset + noframes, and sets things up accordingly.
 2904|       |             **************************************************************/
 2905|  63.5k|            case STATE_PRE_BODY:
  ------------------
  |  Branch (2905:13): [True: 63.5k, False: 221k]
  ------------------
 2906|  63.5k|            {
 2907|  63.5k|                if (node == NULL )
  ------------------
  |  Branch (2907:21): [True: 6.26k, False: 57.2k]
  ------------------
 2908|  6.26k|                {
 2909|  6.26k|                    if (frameset == NULL) /* Implied body. */
  ------------------
  |  Branch (2909:25): [True: 4.81k, False: 1.44k]
  ------------------
 2910|  4.81k|                    {
 2911|  4.81k|                        node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|  4.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2912|  4.81k|                        state = STATE_PARSE_BODY;
 2913|  4.81k|                    } else {
 2914|  1.44k|                        state = STATE_COMPLETE;
 2915|  1.44k|                    }
 2916|       |
 2917|  6.26k|                    continue;
 2918|  6.26k|                }
 2919|       |
 2920|       |                /* Robustly handle html tags. */
 2921|  57.2k|                if (node->tag == html->tag)
  ------------------
  |  Branch (2921:21): [True: 1.53k, False: 55.7k]
  ------------------
 2922|  1.53k|                {
 2923|  1.53k|                    if (node->type != StartTag && frameset == NULL)
  ------------------
  |  Branch (2923:25): [True: 857, False: 675]
  |  Branch (2923:51): [True: 595, False: 262]
  ------------------
 2924|    595|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    595|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    595|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2925|       |
 2926|  1.53k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2927|  1.53k|                    continue;
 2928|  1.53k|                }
 2929|       |
 2930|       |                /* Deal with comments, etc. */
 2931|  55.7k|                if (InsertMisc(html, node))
  ------------------
  |  Branch (2931:21): [True: 459, False: 55.2k]
  ------------------
 2932|    459|                    continue;
 2933|       |
 2934|       |                /* If frameset document, coerce <body> to <noframes> */
 2935|  55.2k|                if ( nodeIsBODY(node) )
  ------------------
  |  |  375|  55.2k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  55.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 55.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 44.3k, False: 10.9k]
  |  |  |  |  |  Branch (275:54): [True: 4.36k, False: 39.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2936|  4.36k|                {
 2937|  4.36k|                    if (node->type != StartTag)
  ------------------
  |  Branch (2937:25): [True: 243, False: 4.11k]
  ------------------
 2938|    243|                    {
 2939|    243|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    243|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    243|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2940|    243|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    243|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    243|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2941|    243|                        continue;
 2942|    243|                    }
 2943|       |
 2944|  4.11k|                    if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  4.11k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (2944:26): [True: 4.11k, False: 0]
  ------------------
 2945|  4.11k|                    {
 2946|  4.11k|                        if (frameset != NULL)
  ------------------
  |  Branch (2946:29): [True: 2.38k, False: 1.73k]
  ------------------
 2947|  2.38k|                        {
 2948|  2.38k|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2949|       |
 2950|  2.38k|                            if (noframes == NULL)
  ------------------
  |  Branch (2950:33): [True: 1.96k, False: 424]
  ------------------
 2951|  1.96k|                            {
 2952|  1.96k|                                noframes = TY_(InferredTag)(doc, TidyTag_NOFRAMES);
  ------------------
  |  |   23|  1.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2953|  1.96k|                                TY_(InsertNodeAtEnd)(frameset, noframes);
  ------------------
  |  |   23|  1.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2954|  1.96k|                                TY_(Report)(doc, html, noframes, INSERTING_TAG);
  ------------------
  |  |   23|  1.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2955|  1.96k|                            }
 2956|    424|                            else
 2957|    424|                            {
 2958|    424|                                if (noframes->type == StartEndTag)
  ------------------
  |  Branch (2958:37): [True: 194, False: 230]
  ------------------
 2959|    194|                                    noframes->type = StartTag;
 2960|    424|                            }
 2961|       |
 2962|  2.38k|                            state = STATE_PARSE_NOFRAMES;
 2963|  2.38k|                            continue;
 2964|  2.38k|                        }
 2965|  4.11k|                    }
 2966|       |
 2967|  1.73k|                    TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |   23|  1.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |  209|  1.73k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|  1.73k|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|  1.73k|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|  1.73k|#define X10F                1024u
  |  |  ------------------
  ------------------
 2968|  1.73k|                    state = STATE_PARSE_BODY;
 2969|  1.73k|                    continue;
 2970|  4.11k|                }
 2971|       |
 2972|       |                /* Flag an error if we see more than one frameset. */
 2973|  50.8k|                if ( nodeIsFRAMESET(node) )
  ------------------
  |  |  376|  50.8k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  50.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 50.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 39.9k, False: 10.9k]
  |  |  |  |  |  Branch (275:54): [True: 6.73k, False: 33.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2974|  6.73k|                {
 2975|  6.73k|                    if (node->type != StartTag)
  ------------------
  |  Branch (2975:25): [True: 212, False: 6.51k]
  ------------------
 2976|    212|                    {
 2977|    212|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    212|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    212|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2978|    212|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    212|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    212|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2979|    212|                        continue;
 2980|    212|                    }
 2981|       |
 2982|  6.51k|                    if (frameset != NULL)
  ------------------
  |  Branch (2982:25): [True: 1.35k, False: 5.16k]
  ------------------
 2983|  1.35k|                        TY_(Report)(doc, html, node, DUPLICATE_FRAMESET);
  ------------------
  |  |   23|  1.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2984|  5.16k|                    else
 2985|  5.16k|                        frameset = node;
 2986|       |
 2987|  6.51k|                    state = STATE_PARSE_FRAMESET;
 2988|  6.51k|                    continue;
 2989|  6.73k|                }
 2990|       |
 2991|       |                /* If not a frameset document coerce <noframes> to <body>. */
 2992|  44.1k|                if ( nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|  44.1k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  44.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 44.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 33.2k, False: 10.9k]
  |  |  |  |  |  Branch (275:54): [True: 2.05k, False: 31.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2993|  2.05k|                {
 2994|  2.05k|                    if (node->type != StartTag)
  ------------------
  |  Branch (2994:25): [True: 87, False: 1.96k]
  ------------------
 2995|     87|                    {
 2996|     87|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|     87|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     87|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2997|     87|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|     87|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     87|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2998|     87|                        continue;
 2999|     87|                    }
 3000|       |
 3001|  1.96k|                    if (frameset == NULL)
  ------------------
  |  Branch (3001:25): [True: 341, False: 1.62k]
  ------------------
 3002|    341|                    {
 3003|    341|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    341|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    341|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3004|    341|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    341|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    341|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3005|    341|                        node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|    341|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    341|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3006|    341|                        state = STATE_PARSE_BODY;
 3007|    341|                        continue;
 3008|    341|                    }
 3009|       |
 3010|  1.62k|                    if (noframes == NULL)
  ------------------
  |  Branch (3010:25): [True: 1.43k, False: 191]
  ------------------
 3011|  1.43k|                    {
 3012|  1.43k|                        noframes = node;
 3013|  1.43k|                        TY_(InsertNodeAtEnd)(frameset, noframes);
  ------------------
  |  |   23|  1.43k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.43k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3014|  1.43k|                        state = STATE_PARSE_NOFRAMES;
 3015|  1.43k|                    }
 3016|    191|                    else
 3017|    191|                    {
 3018|    191|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    191|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    191|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3019|    191|                    }
 3020|       |
 3021|  1.62k|                    continue;
 3022|  1.96k|                }
 3023|       |
 3024|       |                /* Deal with some other element that we're not expecting. */
 3025|  42.1k|                if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  42.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3025:21): [True: 32.7k, False: 9.37k]
  ------------------
 3026|  32.7k|                {
 3027|  32.7k|                    if (node->tag && node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  30.7k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (3027:25): [True: 30.7k, False: 1.95k]
  |  Branch (3027:38): [True: 294, False: 30.4k]
  ------------------
 3028|    294|                    {
 3029|    294|                        MoveToHead(doc, html, node);
 3030|    294|                        continue;
 3031|    294|                    }
 3032|       |
 3033|       |                    /* Discard illegal frame element following a frameset. */
 3034|  32.4k|                    if ( frameset != NULL && nodeIsFRAME(node) )
  ------------------
  |  |  377|  2.43k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|  2.43k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.43k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 504, False: 1.92k]
  |  |  |  |  |  Branch (275:54): [True: 349, False: 155]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3034:26): [True: 2.43k, False: 30.0k]
  ------------------
 3035|    349|                    {
 3036|    349|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    349|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    349|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3037|    349|                        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    349|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    349|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3038|    349|                        continue;
 3039|    349|                    }
 3040|  32.4k|                }
 3041|       |
 3042|  41.4k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  41.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3043|       |
 3044|       |                /* Insert other content into noframes element. */
 3045|  41.4k|                if (frameset)
  ------------------
  |  Branch (3045:21): [True: 3.71k, False: 37.7k]
  ------------------
 3046|  3.71k|                {
 3047|  3.71k|                    if (noframes == NULL)
  ------------------
  |  Branch (3047:25): [True: 2.84k, False: 878]
  ------------------
 3048|  2.84k|                    {
 3049|  2.84k|                        noframes = TY_(InferredTag)(doc, TidyTag_NOFRAMES);
  ------------------
  |  |   23|  2.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3050|  2.84k|                        TY_(InsertNodeAtEnd)(frameset, noframes);
  ------------------
  |  |   23|  2.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3051|  2.84k|                    }
 3052|    878|                    else
 3053|    878|                    {
 3054|    878|                        TY_(Report)(doc, html, node, NOFRAMES_CONTENT);
  ------------------
  |  |   23|    878|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    878|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3055|    878|                        if (noframes->type == StartEndTag)
  ------------------
  |  Branch (3055:29): [True: 218, False: 660]
  ------------------
 3056|    218|                            noframes->type = StartTag;
 3057|    878|                    }
 3058|       |
 3059|  3.71k|                    TY_(ConstrainVersion)(doc, VERS_FRAMESET);
  ------------------
  |  |   23|  3.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, VERS_FRAMESET);
  ------------------
  |  |  209|  3.71k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|  3.71k|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|  3.71k|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|  3.71k|#define X10F                1024u
  |  |  ------------------
  ------------------
 3060|  3.71k|                    state = STATE_PARSE_NOFRAMES;
 3061|  3.71k|                    continue;
 3062|  3.71k|                }
 3063|       |
 3064|  37.7k|                node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|  37.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3065|       |
 3066|       |                /* Issue #132 - disable inserting BODY tag warning
 3067|       |                 BUT only if NOT --show-body-only yes */
 3068|  75.5k|                if (!showingBodyOnly(doc))
  ------------------
  |  |   28|  37.7k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  37.7k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  37.7k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3068:21): [True: 37.7k, False: 0]
  |  Branch (3068:21): [True: 37.7k, False: 0]
  ------------------
 3069|  37.7k|                    TY_(Report)(doc, html, node, INSERTING_TAG );
  ------------------
  |  |   23|  37.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3070|       |
 3071|  37.7k|                TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |   23|  37.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |  209|  37.7k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|  37.7k|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|  37.7k|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|  37.7k|#define X10F                1024u
  |  |  ------------------
  ------------------
 3072|  37.7k|                state = STATE_PARSE_BODY;
 3073|  37.7k|                continue;
 3074|  41.4k|            } break;
 3075|       |
 3076|       |
 3077|       |            /**************************************************************
 3078|       |             In this case, we're ready to parse the head, and move on to
 3079|       |             look for the body or body alternative.
 3080|       |             **************************************************************/
 3081|  49.8k|            case STATE_PARSE_HEAD:
  ------------------
  |  Branch (3081:13): [True: 49.8k, False: 235k]
  ------------------
 3082|  49.8k|            {
 3083|  49.8k|                TidyParserMemory memory = {0};
 3084|  49.8k|                memory.identity = TY_(ParseHTML);
  ------------------
  |  |   23|  49.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3085|  49.8k|                memory.mode = mode;
 3086|  49.8k|                memory.original_node = html;
 3087|  49.8k|                memory.reentry_node = node;
 3088|  49.8k|                memory.reentry_mode = mode;
 3089|  49.8k|                memory.reentry_state = STATE_PARSE_HEAD_REENTER;
 3090|  49.8k|                TY_(InsertNodeAtEnd)(html, node);
  ------------------
  |  |   23|  49.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3091|  49.8k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  49.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3092|  49.8k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3093|  49.8k|                return node;
 3094|  41.4k|            } break;
 3095|       |
 3096|  49.8k|            case STATE_PARSE_HEAD_REENTER:
  ------------------
  |  Branch (3096:13): [True: 49.8k, False: 235k]
  ------------------
 3097|  49.8k|            {
 3098|  49.8k|                head = node;
 3099|  49.8k|                state = STATE_PRE_BODY;
 3100|  49.8k|            } break;
 3101|       |
 3102|       |
 3103|       |            /**************************************************************
 3104|       |             In this case, we can finally parse a body.
 3105|       |             **************************************************************/
 3106|  44.6k|            case STATE_PARSE_BODY:
  ------------------
  |  Branch (3106:13): [True: 44.6k, False: 240k]
  ------------------
 3107|  44.6k|            {
 3108|  44.6k|                TidyParserMemory memory = {0};
 3109|  44.6k|                memory.identity = NULL; /* we don't need to reenter */
 3110|  44.6k|                memory.mode = mode;
 3111|  44.6k|                memory.original_node = html;
 3112|  44.6k|                memory.reentry_node = NULL;
 3113|  44.6k|                memory.reentry_mode = mode;
 3114|  44.6k|                memory.reentry_state = STATE_COMPLETE;
 3115|  44.6k|                TY_(InsertNodeAtEnd)(html, node);
  ------------------
  |  |   23|  44.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3116|  44.6k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  44.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3117|  44.6k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3118|  44.6k|                return node;
 3119|  41.4k|            } break;
 3120|       |
 3121|       |
 3122|       |            /**************************************************************
 3123|       |             In this case, we will parse noframes. If necessary, the
 3124|       |             node is already inserted in the proper spot.
 3125|       |             **************************************************************/
 3126|  7.53k|            case STATE_PARSE_NOFRAMES:
  ------------------
  |  Branch (3126:13): [True: 7.53k, False: 277k]
  ------------------
 3127|  7.53k|            {
 3128|  7.53k|                TidyParserMemory memory = {0};
 3129|  7.53k|                memory.identity = TY_(ParseHTML);
  ------------------
  |  |   23|  7.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3130|  7.53k|                memory.mode = mode;
 3131|  7.53k|                memory.original_node = html;
 3132|  7.53k|                memory.reentry_node = frameset;
 3133|  7.53k|                memory.reentry_mode = mode;
 3134|  7.53k|                memory.reentry_state = STATE_PARSE_NOFRAMES_REENTER;
 3135|  7.53k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  7.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3136|  7.53k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3137|  7.53k|                return noframes;
 3138|  41.4k|            } break;
 3139|       |
 3140|  3.83k|            case STATE_PARSE_NOFRAMES_REENTER:
  ------------------
  |  Branch (3140:13): [True: 3.83k, False: 281k]
  ------------------
 3141|  3.83k|            {
 3142|  3.83k|                frameset = node;
 3143|  3.83k|                state = STATE_PRE_BODY;
 3144|  3.83k|            } break;
 3145|       |
 3146|       |
 3147|       |            /**************************************************************
 3148|       |             In this case, we parse the frameset, and look for noframes
 3149|       |             content to merge later if necessary.
 3150|       |             **************************************************************/
 3151|  6.51k|            case STATE_PARSE_FRAMESET:
  ------------------
  |  Branch (3151:13): [True: 6.51k, False: 278k]
  ------------------
 3152|  6.51k|            {
 3153|  6.51k|                TidyParserMemory memory = {0};
 3154|  6.51k|                memory.identity = TY_(ParseHTML);
  ------------------
  |  |   23|  6.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3155|  6.51k|                memory.mode = mode;
 3156|  6.51k|                memory.original_node = html;
 3157|  6.51k|                memory.reentry_node = frameset;
 3158|  6.51k|                memory.reentry_mode = mode;
 3159|  6.51k|                memory.reentry_state = STATE_PARSE_FRAMESET_REENTER;
 3160|  6.51k|                TY_(InsertNodeAtEnd)(html, node);
  ------------------
  |  |   23|  6.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3161|  6.51k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  6.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3162|  6.51k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3163|  6.51k|                return node;
 3164|  41.4k|            } break;
 3165|       |
 3166|  6.50k|            case (STATE_PARSE_FRAMESET_REENTER):
  ------------------
  |  Branch (3166:13): [True: 6.50k, False: 278k]
  ------------------
 3167|  6.50k|            {
 3168|  6.50k|                frameset = node;
 3169|       |                /*
 3170|       |                 See if it includes a noframes element so that
 3171|       |                 we can merge subsequent noframes elements.
 3172|       |                 */
 3173|  10.6k|                for (node = frameset->content; node; node = node->next)
  ------------------
  |  Branch (3173:48): [True: 4.15k, False: 6.50k]
  ------------------
 3174|  4.15k|                {
 3175|  4.15k|                    if ( nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|  4.15k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  4.15k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.15k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.73k, False: 416]
  |  |  |  |  |  Branch (275:54): [True: 2.75k, False: 982]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3176|  2.75k|                        noframes = node;
 3177|  4.15k|                }
 3178|  6.50k|                state = STATE_PRE_BODY;
 3179|  6.50k|            } break;
 3180|       |
 3181|       |
 3182|       |            /**************************************************************
 3183|       |             We really shouldn't get here, but if we do, finish nicely.
 3184|       |             **************************************************************/
 3185|      0|            default:
  ------------------
  |  Branch (3185:13): [True: 0, False: 284k]
  ------------------
 3186|      0|            {
 3187|      0|                state = STATE_COMPLETE;
 3188|      0|            }
 3189|   284k|        } /* switch */
 3190|   284k|    } /* while */
 3191|       |
 3192|  1.44k|    DEBUG_LOG_EXIT;
 3193|       |    return NULL;
 3194|   109k|}
prvTidyParseInline:
 3206|  4.21M|{
 3207|  4.21M|    Lexer* lexer = doc->lexer;
 3208|  4.21M|    Node *node = NULL;
 3209|  4.21M|    Node *parent = NULL;
 3210|  4.21M|    DEBUG_LOG_COUNTERS;
 3211|       |    
 3212|  4.21M|    if ( element == NULL )
  ------------------
  |  Branch (3212:10): [True: 2.02M, False: 2.19M]
  ------------------
 3213|  2.02M|    {
 3214|  2.02M|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  2.02M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.02M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3215|  2.02M|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 3216|  2.02M|        DEBUG_LOG_REENTER_WITH_NODE(node);
 3217|  2.02M|        element = memory.original_node;
 3218|  2.02M|        DEBUG_LOG_GET_OLD_MODE;
 3219|  2.02M|        mode = memory.reentry_mode;
 3220|  2.02M|        DEBUG_LOG_CHANGE_MODE;
 3221|  2.02M|    }
 3222|  2.19M|    else
 3223|  2.19M|    {
 3224|  2.19M|        DEBUG_LOG_ENTER_WITH_NODE(element);
 3225|       |
 3226|  2.19M|        if (element->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  2.19M|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (3226:13): [True: 0, False: 2.19M]
  ------------------
 3227|      0|        {
 3228|      0|            DEBUG_LOG_EXIT;
 3229|      0|            return NULL;
 3230|      0|        }
 3231|       |
 3232|       |        /*
 3233|       |         ParseInline is used for some block level elements like H1 to H6
 3234|       |         For such elements we need to insert inline emphasis tags currently
 3235|       |         on the inline stack. For Inline elements, we normally push them
 3236|       |         onto the inline stack provided they aren't implicit or OBJECT/APPLET.
 3237|       |         This test is carried out in PushInline and PopInline, see istack.c
 3238|       |
 3239|       |         InlineDup(...) is not called for elements with a CM_MIXED (inline and
 3240|       |         block) content model, e.g. <del> or <ins>, otherwise constructs like
 3241|       |
 3242|       |           <p>111<a name='foo'>222<del>333</del>444</a>555</p>
 3243|       |           <p>111<span>222<del>333</del>444</span>555</p>
 3244|       |           <p>111<em>222<del>333</del>444</em>555</p>
 3245|       |
 3246|       |         will get corrupted.
 3247|       |        */
 3248|  2.19M|        if ((TY_(nodeHasCM)(element, CM_BLOCK) || nodeIsDT(element)) &&
  ------------------
  |  |   23|  2.19M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.19M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((TY_(nodeHasCM)(element, CM_BLOCK) || nodeIsDT(element)) &&
  ------------------
  |  |  142|  2.19M|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                      if ((TY_(nodeHasCM)(element, CM_BLOCK) || nodeIsDT(element)) &&
  ------------------
  |  |  391|  2.09M|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  275|  2.09M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.09M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.09M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.58k, False: 2.09M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3248:14): [True: 93.6k, False: 2.09M]
  ------------------
 3249|  98.2k|            !TY_(nodeHasCM)(element, CM_MIXED))
  ------------------
  |  |   23|  98.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  98.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          !TY_(nodeHasCM)(element, CM_MIXED))
  ------------------
  |  |  156|  98.2k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (3249:13): [True: 96.9k, False: 1.30k]
  ------------------
 3250|  96.9k|            TY_(InlineDup)(doc, NULL);
  ------------------
  |  |   23|  96.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  96.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3251|  2.09M|        else if (TY_(nodeHasCM)(element, CM_INLINE))
  ------------------
  |  |   23|  2.09M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.09M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      else if (TY_(nodeHasCM)(element, CM_INLINE))
  ------------------
  |  |  143|  2.09M|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3251:18): [True: 2.09M, False: 257]
  ------------------
 3252|  2.09M|            TY_(PushInline)(doc, element);
  ------------------
  |  |   23|  2.09M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.09M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3253|       |
 3254|  2.19M|        if ( nodeIsNOBR(element) )
  ------------------
  |  |  415|  2.19M|#define nodeIsNOBR( node )       TagIsId( node, TidyTag_NOBR )
  |  |  ------------------
  |  |  |  |  275|  2.19M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.19M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.19M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 936, False: 2.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3255|    936|            doc->badLayout |= USING_NOBR;
  ------------------
  |  |  293|    936|#define USING_NOBR              4
  ------------------
 3256|  2.19M|        else if ( nodeIsFONT(element) )
  ------------------
  |  |  417|  2.19M|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  2.19M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.19M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.19M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.88M, False: 305k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3257|  1.88M|            doc->badLayout |= USING_FONT;
  ------------------
  |  |  294|  1.88M|#define USING_FONT              8
  ------------------
 3258|       |
 3259|       |        /* Inline elements may or may not be within a preformatted element */
 3260|  2.19M|        if (mode != Preformatted)
  ------------------
  |  Branch (3260:13): [True: 2.19M, False: 0]
  ------------------
 3261|  2.19M|        {
 3262|  2.19M|            DEBUG_LOG_GET_OLD_MODE;
 3263|  2.19M|            mode = MixedContent;
 3264|  2.19M|            DEBUG_LOG_CHANGE_MODE;
 3265|  2.19M|        }
 3266|  2.19M|    }
 3267|       |    
 3268|  4.42M|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|  4.42M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.42M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3268:12): [True: 3.04M, False: 1.37M]
  ------------------
 3269|  3.04M|    {
 3270|       |        /* end tag for current element */
 3271|  3.04M|        if (node->tag == element->tag && node->type == EndTag)
  ------------------
  |  Branch (3271:13): [True: 1.97M, False: 1.06M]
  |  Branch (3271:42): [True: 21.0k, False: 1.95M]
  ------------------
 3272|  21.0k|        {
 3273|  21.0k|            if (element->tag->model & CM_INLINE)
  ------------------
  |  |  143|  21.0k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3273:17): [True: 19.2k, False: 1.82k]
  ------------------
 3274|  19.2k|                TY_(PopInline)( doc, node );
  ------------------
  |  |   23|  19.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3275|       |
 3276|  21.0k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  21.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3277|       |
 3278|  21.0k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3278:17): [True: 21.0k, False: 0]
  ------------------
 3279|  21.0k|                TrimSpaces(doc, element);
 3280|       |
 3281|       |            /*
 3282|       |             if a font element wraps an anchor and nothing else
 3283|       |             then move the font element inside the anchor since
 3284|       |             otherwise it won't alter the anchor text color
 3285|       |            */
 3286|  21.0k|            if ( nodeIsFONT(element) &&
  ------------------
  |  |  417|  21.0k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  42.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 21.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 21.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 15.1k, False: 5.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3287|  15.1k|                 element->content && element->content == element->last )
  ------------------
  |  Branch (3287:18): [True: 14.9k, False: 221]
  |  Branch (3287:38): [True: 2.17k, False: 12.7k]
  ------------------
 3288|  2.17k|            {
 3289|  2.17k|                Node *child = element->content;
 3290|       |
 3291|  2.17k|                if ( nodeIsA(child) )
  ------------------
  |  |  401|  2.17k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  2.17k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.17k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.96k, False: 208]
  |  |  |  |  |  Branch (275:54): [True: 775, False: 1.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3292|    775|                {
 3293|    775|                    child->parent = element->parent;
 3294|    775|                    child->next = element->next;
 3295|    775|                    child->prev = element->prev;
 3296|       |
 3297|    775|                    element->next = NULL;
 3298|    775|                    element->prev = NULL;
 3299|    775|                    element->parent = child;
 3300|       |
 3301|    775|                    element->content = child->content;
 3302|    775|                    element->last = child->last;
 3303|    775|                    child->content = element;
 3304|       |
 3305|    775|                    TY_(FixNodeLinks)(child);
  ------------------
  |  |   23|    775|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    775|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3306|    775|                    TY_(FixNodeLinks)(element);
  ------------------
  |  |   23|    775|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    775|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3307|    775|                }
 3308|  2.17k|            }
 3309|       |
 3310|  21.0k|            element->closed = yes;
 3311|  21.0k|            TrimSpaces( doc, element );
 3312|       |
 3313|  21.0k|            DEBUG_LOG_EXIT;
 3314|  21.0k|            return NULL;
 3315|  21.0k|        }
 3316|       |
 3317|       |        /* <u>...<u>  map 2nd <u> to </u> if 1st is explicit */
 3318|       |        /* (see additional conditions below) */
 3319|       |        /* otherwise emphasis nesting is probably unintentional */
 3320|       |        /* big, small, sub, sup have cumulative effect to leave them alone */
 3321|  3.02M|        if ( node->type == StartTag
  ------------------
  |  Branch (3321:14): [True: 2.74M, False: 281k]
  ------------------
 3322|  2.74M|             && node->tag == element->tag
  ------------------
  |  Branch (3322:17): [True: 1.95M, False: 787k]
  ------------------
 3323|  1.95M|             && TY_(IsPushed)( doc, node )
  ------------------
  |  |   23|  1.95M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.95M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3323:17): [True: 1.87M, False: 83.6k]
  ------------------
 3324|  1.87M|             && !node->implicit
  ------------------
  |  Branch (3324:17): [True: 156k, False: 1.71M]
  ------------------
 3325|   156k|             && !element->implicit
  ------------------
  |  Branch (3325:17): [True: 152k, False: 4.49k]
  ------------------
 3326|   152k|             && node->tag && (node->tag->model & CM_INLINE)
  ------------------
  |  |  143|   152k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3326:17): [True: 152k, False: 0]
  |  Branch (3326:30): [True: 152k, False: 0]
  ------------------
 3327|  3.02M|             && !nodeIsA(node)
  ------------------
  |  |  401|   152k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  3.17M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 152k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 152k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.10k, False: 151k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3328|  3.02M|             && !nodeIsFONT(node)
  ------------------
  |  |  417|   151k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  3.17M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 151k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 151k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 138k, False: 12.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3329|  3.02M|             && !nodeIsBIG(node)
  ------------------
  |  |  407|  12.8k|#define nodeIsBIG( node )        TagIsId( node, TidyTag_BIG )
  |  |  ------------------
  |  |  |  |  275|  3.03M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 12.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 12.8k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 408, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3330|  3.02M|             && !nodeIsSMALL(node)
  ------------------
  |  |  408|  12.4k|#define nodeIsSMALL( node )      TagIsId( node, TidyTag_SMALL )
  |  |  ------------------
  |  |  |  |  275|  3.03M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 12.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 12.4k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 198, False: 12.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3331|  3.02M|             && !nodeIsSUB(node)
  ------------------
  |  |  448|  12.2k|#define nodeIsSUB( node )        TagIsId( node, TidyTag_SUB )
  |  |  ------------------
  |  |  |  |  275|  3.03M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 12.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 12.2k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 528, False: 11.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3332|  3.02M|             && !nodeIsSUP(node)
  ------------------
  |  |  449|  11.7k|#define nodeIsSUP( node )        TagIsId( node, TidyTag_SUP )
  |  |  ------------------
  |  |  |  |  275|  3.03M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 11.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 202, False: 11.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3333|  3.02M|             && !nodeIsQ(node)
  ------------------
  |  |  432|  11.5k|#define nodeIsQ( node )          TagIsId( node, TidyTag_Q )
  |  |  ------------------
  |  |  |  |  275|  3.03M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 11.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.88k, False: 8.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3334|  3.02M|             && !nodeIsSPAN(node)
  ------------------
  |  |  430|  8.62k|#define nodeIsSPAN( node )       TagIsId( node, TidyTag_SPAN )
  |  |  ------------------
  |  |  |  |  275|  3.03M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.62k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.62k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 260, False: 8.36k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3335|  8.36k|             && cfgBool(doc, TidyCoerceEndTags)
  ------------------
  |  |  418|  8.36k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  8.36k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 8.36k, False: 0]
  |  |  ------------------
  ------------------
 3336|  3.02M|           )
 3337|  8.36k|        {
 3338|       |            /* proceeds only if "node" does not have any attribute and
 3339|       |               follows a text node not finishing with a space */
 3340|  8.36k|            if (element->content != NULL && node->attributes == NULL
  ------------------
  |  Branch (3340:17): [True: 3.44k, False: 4.91k]
  |  Branch (3340:45): [True: 2.86k, False: 581]
  ------------------
 3341|  2.86k|                && TY_(nodeIsText)(element->last)
  ------------------
  |  |   23|  2.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3341:20): [True: 2.06k, False: 804]
  ------------------
 3342|  2.06k|                && !TY_(TextNodeEndWithSpace)(doc->lexer, element->last) )
  ------------------
  |  |   23|  2.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3342:20): [True: 1.58k, False: 476]
  ------------------
 3343|  1.58k|            {
 3344|  1.58k|                TY_(Report)(doc, element, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|  1.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3345|  1.58k|                node->type = EndTag;
 3346|  1.58k|                TY_(UngetToken)(doc);
  ------------------
  |  |   23|  1.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3347|  1.58k|                continue;
 3348|  1.58k|            }
 3349|       |
 3350|  6.77k|            if (node->attributes == NULL || element->attributes == NULL)
  ------------------
  |  Branch (3350:17): [True: 5.09k, False: 1.68k]
  |  Branch (3350:45): [True: 317, False: 1.37k]
  ------------------
 3351|  5.40k|                TY_(Report)(doc, element, node, NESTED_EMPHASIS);
  ------------------
  |  |   23|  5.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3352|  6.77k|        }
 3353|  3.01M|        else if ( TY_(IsPushed)(doc, node) && node->type == StartTag &&
  ------------------
  |  |   23|  3.01M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.01M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3353:19): [True: 2.02M, False: 990k]
  |  Branch (3353:47): [True: 2.00M, False: 15.6k]
  ------------------
 3354|  2.00M|                  nodeIsQ(node) )
  ------------------
  |  |  432|  2.00M|#define nodeIsQ( node )          TagIsId( node, TidyTag_Q )
  |  |  ------------------
  |  |  |  |  275|  2.00M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.00M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.00M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 21.4k, False: 1.98M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3355|  21.4k|        {
 3356|       |            /*\
 3357|       |             * Issue #215 - such nested quotes are NOT a problem if HTML5, so
 3358|       |             * only issue this warning if NOT HTML5 mode.
 3359|       |            \*/
 3360|  21.4k|            if (TY_(HTMLVersion)(doc) != HT50)
  ------------------
  |  |   23|  21.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(HTMLVersion)(doc) != HT50)
  ------------------
  |  |  200|  21.4k|#define HT50              131072u
  ------------------
  |  Branch (3360:17): [True: 21.4k, False: 0]
  ------------------
 3361|  21.4k|            {
 3362|  21.4k|                TY_(Report)(doc, element, node, NESTED_QUOTATION);
  ------------------
  |  |   23|  21.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3363|  21.4k|            }
 3364|  21.4k|        }
 3365|       |
 3366|  3.02M|        if ( TY_(nodeIsText)(node) )
  ------------------
  |  |   23|  3.02M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.02M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3366:14): [True: 68.9k, False: 2.95M]
  ------------------
 3367|  68.9k|        {
 3368|       |            /* only called for 1st child */
 3369|  68.9k|            if ( element->content == NULL && !(mode & Preformatted) )
  ------------------
  |  Branch (3369:18): [True: 44.5k, False: 24.3k]
  |  Branch (3369:46): [True: 44.5k, False: 0]
  ------------------
 3370|  44.5k|                TrimSpaces( doc, element );
 3371|       |
 3372|  68.9k|            if ( node->start >= node->end )
  ------------------
  |  Branch (3372:18): [True: 387, False: 68.5k]
  ------------------
 3373|    387|            {
 3374|    387|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    387|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    387|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3375|    387|                continue;
 3376|    387|            }
 3377|       |
 3378|  68.5k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  68.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  68.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3379|  68.5k|            continue;
 3380|  68.9k|        }
 3381|       |
 3382|       |        /* mixed content model so allow text */
 3383|  2.95M|        if (InsertMisc(element, node))
  ------------------
  |  Branch (3383:13): [True: 60.4k, False: 2.89M]
  ------------------
 3384|  60.4k|            continue;
 3385|       |
 3386|       |        /* deal with HTML tags */
 3387|  2.89M|        if ( nodeIsHTML(node) )
  ------------------
  |  |  370|  2.89M|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  2.89M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.89M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.84M, False: 51.6k]
  |  |  |  |  |  Branch (275:54): [True: 507, False: 2.83M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3388|    507|        {
 3389|    507|            if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|    507|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    507|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3389:18): [True: 306, False: 201]
  ------------------
 3390|    306|            {
 3391|    306|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    306|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    306|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3392|    306|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    306|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    306|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3393|    306|                continue;
 3394|    306|            }
 3395|       |
 3396|       |            /* otherwise infer end of inline element */
 3397|    201|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    201|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    201|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3398|       |
 3399|    201|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3399:17): [True: 201, False: 0]
  ------------------
 3400|    201|                TrimSpaces(doc, element);
 3401|       |
 3402|    201|            DEBUG_LOG_EXIT;
 3403|    201|            return NULL;
 3404|    507|        }
 3405|       |
 3406|       |        /* within <dt> or <pre> map <p> to <br> */
 3407|  2.89M|        if ( nodeIsP(node) &&
  ------------------
  |  |  385|  2.89M|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  5.78M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.89M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.83M, False: 51.6k]
  |  |  |  |  |  Branch (275:54): [True: 288k, False: 2.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3408|   288k|             node->type == StartTag &&
  ------------------
  |  Branch (3408:14): [True: 277k, False: 10.8k]
  ------------------
 3409|   277k|             ( (mode & Preformatted) ||
  ------------------
  |  Branch (3409:16): [True: 0, False: 277k]
  ------------------
 3410|   277k|               nodeIsDT(element) ||
  ------------------
  |  |  391|   277k|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  275|   555k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 277k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 277k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.71k, False: 275k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3411|   275k|               DescendantOf(element, TidyTag_DT )
  ------------------
  |  Branch (3411:16): [True: 3.60k, False: 272k]
  ------------------
 3412|   277k|             )
 3413|  2.89M|           )
 3414|  5.31k|        {
 3415|  5.31k|            node->tag = TY_(LookupTagDef)( TidyTag_BR );
  ------------------
  |  |   23|  5.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3416|  5.31k|            TidyDocFree(doc, node->element);
  ------------------
  |  |  159|  5.31k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  5.31k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 3417|  5.31k|            node->element = TY_(tmbstrdup)(doc->allocator, "br");
  ------------------
  |  |   23|  5.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3418|  5.31k|            TrimSpaces(doc, element);
 3419|  5.31k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  5.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3420|  5.31k|            continue;
 3421|  5.31k|        }
 3422|       |
 3423|       |        /* <p> allowed within <address> in HTML 4.01 Transitional */
 3424|  2.88M|        if ( nodeIsP(node) &&
  ------------------
  |  |  385|  2.88M|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  5.77M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.88M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.83M, False: 51.6k]
  |  |  |  |  |  Branch (275:54): [True: 283k, False: 2.55M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3425|   283k|             node->type == StartTag &&
  ------------------
  |  Branch (3425:14): [True: 272k, False: 10.8k]
  ------------------
 3426|   272k|             nodeIsADDRESS(element) )
  ------------------
  |  |  438|   272k|#define nodeIsADDRESS( node )    TagIsId( node, TidyTag_ADDRESS )
  |  |  ------------------
  |  |  |  |  275|   272k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 272k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 272k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 272k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3427|      0|        {
 3428|      0|            TY_(ConstrainVersion)( doc, ~VERS_HTML40_STRICT );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(ConstrainVersion)( doc, ~VERS_HTML40_STRICT );
  ------------------
  |  |  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
  |  |  ------------------
  ------------------
 3429|      0|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3430|      0|            (*node->tag->parser)( doc, node, mode );
 3431|      0|            continue;
 3432|      0|        }
 3433|       |
 3434|       |        /* ignore unknown and PARAM tags */
 3435|  2.88M|        if ( node->tag == NULL || nodeIsPARAM(node) )
  ------------------
  |  |  409|  2.83M|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|  2.83M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.83M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.83M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 322, False: 2.83M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3435:14): [True: 51.6k, False: 2.83M]
  ------------------
 3436|  51.9k|        {
 3437|  51.9k|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  51.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3438|  51.9k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  51.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3439|  51.9k|            continue;
 3440|  51.9k|        }
 3441|       |
 3442|  2.83M|        if ( nodeIsBR(node) && node->type == EndTag )
  ------------------
  |  |  400|  2.83M|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  5.66M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.83M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.83M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.75k, False: 2.83M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3442:32): [True: 216, False: 3.54k]
  ------------------
 3443|    216|            node->type = StartTag;
 3444|       |
 3445|  2.83M|        if ( node->type == EndTag )
  ------------------
  |  Branch (3445:14): [True: 66.5k, False: 2.76M]
  ------------------
 3446|  66.5k|        {
 3447|       |           /* coerce </br> to <br> */
 3448|  66.5k|           if ( nodeIsBR(node) )
  ------------------
  |  |  400|  66.5k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  66.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 66.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 66.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 66.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3449|      0|                node->type = StartTag;
 3450|  66.5k|           else if ( nodeIsP(node) )
  ------------------
  |  |  385|  66.5k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  66.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 66.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 66.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 10.7k, False: 55.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3451|  10.7k|           {
 3452|       |               /* coerce unmatched </p> to <br><br> */
 3453|  10.7k|                if ( !DescendantOf(element, TidyTag_P) )
  ------------------
  |  Branch (3453:22): [True: 1.69k, False: 9.01k]
  ------------------
 3454|  1.69k|                {
 3455|  1.69k|                    TY_(CoerceNode)(doc, node, TidyTag_BR, no, no);
  ------------------
  |  |   23|  1.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3456|  1.69k|                    TrimSpaces( doc, element );
 3457|  1.69k|                    TY_(InsertNodeAtEnd)( element, node );
  ------------------
  |  |   23|  1.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3458|  1.69k|                    node = TY_(InferredTag)(doc, TidyTag_BR);
  ------------------
  |  |   23|  1.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3459|  1.69k|                    TY_(InsertNodeAtEnd)( element, node ); /* todo: check this */
  ------------------
  |  |   23|  1.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3460|  1.69k|                    continue;
 3461|  1.69k|                }
 3462|  10.7k|           }
 3463|  55.8k|           else if ( TY_(nodeHasCM)(node, CM_INLINE)
  ------------------
  |  |   23|  55.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                         else if ( TY_(nodeHasCM)(node, CM_INLINE)
  ------------------
  |  |  143|  55.8k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3463:22): [True: 48.5k, False: 7.30k]
  ------------------
 3464|  55.8k|                     && !nodeIsA(node)
  ------------------
  |  |  401|  48.5k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|   104k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 48.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 48.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 13.4k, False: 35.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3465|  35.1k|                     && !TY_(nodeHasCM)(node, CM_OBJECT)
  ------------------
  |  |   23|  35.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && !TY_(nodeHasCM)(node, CM_OBJECT)
  ------------------
  |  |  150|  35.1k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (3465:25): [True: 16.9k, False: 18.1k]
  ------------------
 3466|  16.9k|                     && TY_(nodeHasCM)(element, CM_INLINE) )
  ------------------
  |  |   23|  16.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && TY_(nodeHasCM)(element, CM_INLINE) )
  ------------------
  |  |  143|  16.9k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3466:25): [True: 16.3k, False: 664]
  ------------------
 3467|  16.3k|            {
 3468|       |                /* allow any inline end tag to end current element */
 3469|       |
 3470|       |                /* http://tidy.sf.net/issue/1426419 */
 3471|       |                /* but, like the browser, retain an earlier inline element.
 3472|       |                   This is implemented by setting the lexer into a mode
 3473|       |                   where it gets tokens from the inline stack rather than
 3474|       |                   from the input stream. Check if the scenerio fits. */
 3475|  16.3k|                if ( !nodeIsA(element)
  ------------------
  |  |  401|  16.3k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  32.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 16.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 16.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 206, False: 16.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3476|  16.1k|                     && (node->tag != element->tag)
  ------------------
  |  Branch (3476:25): [True: 16.1k, False: 0]
  ------------------
 3477|  16.1k|                     && TY_(IsPushed)( doc, node )
  ------------------
  |  |   23|  16.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3477:25): [True: 15.6k, False: 514]
  ------------------
 3478|  15.6k|                     && TY_(IsPushed)( doc, element ) )
  ------------------
  |  |   23|  15.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3478:25): [True: 15.4k, False: 199]
  ------------------
 3479|  15.4k|                {
 3480|       |                    /* we have something like
 3481|       |                       <b>bold <i>bold and italic</b> italics</i> */
 3482|  15.4k|                    if ( TY_(SwitchInline)( doc, element, node ) )
  ------------------
  |  |   23|  15.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3482:26): [True: 13.9k, False: 1.43k]
  ------------------
 3483|  13.9k|                    {
 3484|  13.9k|                        TY_(Report)(doc, element, node, NON_MATCHING_ENDTAG);
  ------------------
  |  |   23|  13.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3485|  13.9k|                        TY_(UngetToken)( doc ); /* put this back */
  ------------------
  |  |   23|  13.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3486|  13.9k|                        TY_(InlineDup1)( doc, NULL, element ); /* dupe the <i>, after </b> */
  ------------------
  |  |   23|  13.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3487|  13.9k|                        if (!(mode & Preformatted))
  ------------------
  |  Branch (3487:29): [True: 13.9k, False: 0]
  ------------------
 3488|  13.9k|                            TrimSpaces( doc, element );
 3489|       |
 3490|  13.9k|                        DEBUG_LOG_EXIT;
 3491|  13.9k|                        return NULL; /* close <i>, but will re-open it, after </b> */
 3492|  13.9k|                    }
 3493|  15.4k|                }
 3494|  2.35k|                TY_(PopInline)( doc, element );
  ------------------
  |  |   23|  2.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3495|       |
 3496|  2.35k|                if ( !nodeIsA(element) )
  ------------------
  |  |  401|  2.35k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  2.35k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.35k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.35k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 206, False: 2.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3497|  2.14k|                {
 3498|  2.14k|                    if ( nodeIsA(node) && node->tag != element->tag )
  ------------------
  |  |  401|  2.14k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  4.28k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.14k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.14k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 2.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3498:43): [True: 0, False: 0]
  ------------------
 3499|      0|                    {
 3500|      0|                       TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3501|      0|                       TY_(UngetToken)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3502|      0|                    }
 3503|  2.14k|                    else
 3504|  2.14k|                    {
 3505|  2.14k|                        TY_(Report)(doc, element, node, NON_MATCHING_ENDTAG);
  ------------------
  |  |   23|  2.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3506|  2.14k|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3507|  2.14k|                    }
 3508|       |
 3509|  2.14k|                    if (!(mode & Preformatted))
  ------------------
  |  Branch (3509:25): [True: 2.14k, False: 0]
  ------------------
 3510|  2.14k|                        TrimSpaces(doc, element);
 3511|       |
 3512|  2.14k|                    DEBUG_LOG_EXIT;
 3513|  2.14k|                    return NULL;
 3514|  2.14k|                }
 3515|       |
 3516|       |                /* if parent is <a> then discard unexpected inline end tag */
 3517|    206|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    206|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    206|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3518|    206|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    206|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    206|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3519|    206|                continue;
 3520|  2.35k|            }  /* special case </tr> etc. for stuff moved in front of table */
 3521|  39.5k|            else if ( lexer->exiled
  ------------------
  |  Branch (3521:23): [True: 4.03k, False: 35.5k]
  ------------------
 3522|  4.03k|                     && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |   23|  4.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  146|  4.03k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  393|  3.79k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  3.79k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.79k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.79k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 466, False: 3.32k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3522:26): [True: 243, False: 3.79k]
  ------------------
 3523|    709|            {
 3524|    709|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    709|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    709|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3525|    709|                TrimSpaces(doc, element);
 3526|       |
 3527|    709|                DEBUG_LOG_EXIT;
 3528|    709|                return NULL;
 3529|    709|            }
 3530|  66.5k|        }
 3531|       |
 3532|       |        /* allow any header tag to end current header */
 3533|  2.81M|        if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |   23|  2.81M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.81M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |  153|  2.81M|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
                      if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |   23|  16.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |  153|  16.5k|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
  |  Branch (3533:14): [True: 16.5k, False: 2.79M]
  |  Branch (3533:50): [True: 1.94k, False: 14.5k]
  ------------------
 3534|  1.94k|        {
 3535|       |
 3536|  1.94k|            if ( node->tag == element->tag )
  ------------------
  |  Branch (3536:18): [True: 502, False: 1.44k]
  ------------------
 3537|    502|            {
 3538|    502|                TY_(Report)(doc, element, node, NON_MATCHING_ENDTAG );
  ------------------
  |  |   23|    502|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    502|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3539|    502|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    502|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    502|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3540|    502|            }
 3541|  1.44k|            else
 3542|  1.44k|            {
 3543|  1.44k|                TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|  1.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3544|  1.44k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3545|  1.44k|            }
 3546|       |
 3547|  1.94k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3547:17): [True: 1.94k, False: 0]
  ------------------
 3548|  1.94k|                TrimSpaces(doc, element);
 3549|       |
 3550|  1.94k|            DEBUG_LOG_EXIT;
 3551|  1.94k|            return NULL;
 3552|  1.94k|        }
 3553|       |
 3554|       |        /*
 3555|       |           an <A> tag to ends any open <A> element
 3556|       |           but <A href=...> is mapped to </A><A href=...>
 3557|       |        */
 3558|       |        /* #427827 - fix by Randy Waki and Bjoern Hoehrmann 23 Aug 00 */
 3559|       |        /* if (node->tag == doc->tags.tag_a && !node->implicit && TY_(IsPushed)(doc, node)) */
 3560|  2.81M|        if ( nodeIsA(node) && !node->implicit &&
  ------------------
  |  |  401|  2.81M|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  5.62M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.81M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.81M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 17.9k, False: 2.79M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3560:31): [True: 17.1k, False: 826]
  ------------------
 3561|  17.1k|             (nodeIsA(element) || DescendantOf(element, TidyTag_A)) )
  ------------------
  |  |  401|  17.1k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  34.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 17.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.19k, False: 15.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3561:35): [True: 13.2k, False: 2.72k]
  ------------------
 3562|  14.4k|        {
 3563|       |            /* coerce <a> to </a> unless it has some attributes */
 3564|       |            /* #427827 - fix by Randy Waki and Bjoern Hoehrmann 23 Aug 00 */
 3565|       |            /* other fixes by Dave Raggett */
 3566|       |            /* if (node->attributes == NULL) */
 3567|  14.4k|            if (node->type != EndTag && node->attributes == NULL
  ------------------
  |  Branch (3567:17): [True: 1.72k, False: 12.7k]
  |  Branch (3567:41): [True: 835, False: 887]
  ------------------
 3568|    835|                && cfgBool(doc, TidyCoerceEndTags) )
  ------------------
  |  |  418|    835|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    835|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 835, False: 0]
  |  |  ------------------
  ------------------
 3569|    835|            {
 3570|    835|                node->type = EndTag;
 3571|    835|                TY_(Report)(doc, element, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|    835|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    835|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3572|       |                /* TY_(PopInline)( doc, node ); */
 3573|    835|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    835|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    835|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3574|    835|                continue;
 3575|    835|            }
 3576|       |
 3577|  13.6k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  13.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3578|  13.6k|            TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  13.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3579|       |            /* TY_(PopInline)( doc, element ); */
 3580|       |
 3581|  13.6k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3581:17): [True: 13.6k, False: 0]
  ------------------
 3582|  13.6k|                TrimSpaces(doc, element);
 3583|       |
 3584|  13.6k|            DEBUG_LOG_EXIT;
 3585|  13.6k|            return NULL;
 3586|  14.4k|        }
 3587|       |
 3588|  2.79M|        if (element->tag->model & CM_HEADING)
  ------------------
  |  |  153|  2.79M|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
  |  Branch (3588:13): [True: 5.47k, False: 2.79M]
  ------------------
 3589|  5.47k|        {
 3590|  5.47k|            if ( nodeIsCENTER(node) || nodeIsDIV(node) )
  ------------------
  |  |  420|  5.47k|#define nodeIsCENTER( node )     TagIsId( node, TidyTag_CENTER )
  |  |  ------------------
  |  |  |  |  275|  10.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.47k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.47k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 372, False: 5.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsCENTER(node) || nodeIsDIV(node) )
  ------------------
  |  |  429|  5.09k|#define nodeIsDIV( node )        TagIsId( node, TidyTag_DIV )
  |  |  ------------------
  |  |  |  |  275|  5.09k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.09k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.09k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.63k, False: 3.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3591|  2.01k|            {
 3592|  2.01k|                if (!TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  2.01k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.01k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3592:21): [True: 234, False: 1.77k]
  ------------------
 3593|    234|                {
 3594|    234|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    234|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    234|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3595|    234|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    234|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    234|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3596|    234|                    continue;
 3597|    234|                }
 3598|       |
 3599|  1.77k|                TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3600|       |
 3601|       |                /* insert center as parent if heading is empty */
 3602|  1.77k|                if (element->content == NULL)
  ------------------
  |  Branch (3602:21): [True: 1.01k, False: 762]
  ------------------
 3603|  1.01k|                {
 3604|  1.01k|                    InsertNodeAsParent(element, node);
 3605|  1.01k|                    continue;
 3606|  1.01k|                }
 3607|       |
 3608|       |                /* split heading and make center parent of 2nd part */
 3609|    762|                TY_(InsertNodeAfterElement)(element, node);
  ------------------
  |  |   23|    762|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    762|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3610|       |
 3611|    762|                if (!(mode & Preformatted))
  ------------------
  |  Branch (3611:21): [True: 762, False: 0]
  ------------------
 3612|    762|                    TrimSpaces(doc, element);
 3613|       |
 3614|    762|                element = TY_(CloneNode)( doc, element );
  ------------------
  |  |   23|    762|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    762|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3615|    762|                TY_(InsertNodeAtEnd)(node, element);
  ------------------
  |  |   23|    762|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    762|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3616|    762|                continue;
 3617|  1.77k|            }
 3618|       |
 3619|  3.45k|            if ( nodeIsHR(node) )
  ------------------
  |  |  380|  3.45k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  3.45k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.45k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.45k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.63k, False: 1.82k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3620|  1.63k|            {
 3621|  1.63k|                if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3621:22): [True: 264, False: 1.37k]
  ------------------
 3622|    264|                {
 3623|    264|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    264|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    264|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3624|    264|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    264|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    264|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3625|    264|                    continue;
 3626|    264|                }
 3627|       |
 3628|  1.37k|                TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3629|       |
 3630|       |                /* insert hr before heading if heading is empty */
 3631|  1.37k|                if (element->content == NULL)
  ------------------
  |  Branch (3631:21): [True: 415, False: 960]
  ------------------
 3632|    415|                {
 3633|    415|                    TY_(InsertNodeBeforeElement)(element, node);
  ------------------
  |  |   23|    415|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    415|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3634|    415|                    continue;
 3635|    415|                }
 3636|       |
 3637|       |                /* split heading and insert hr before 2nd part */
 3638|    960|                TY_(InsertNodeAfterElement)(element, node);
  ------------------
  |  |   23|    960|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    960|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3639|       |
 3640|    960|                if (!(mode & Preformatted))
  ------------------
  |  Branch (3640:21): [True: 960, False: 0]
  ------------------
 3641|    960|                    TrimSpaces(doc, element);
 3642|       |
 3643|    960|                element = TY_(CloneNode)( doc, element );
  ------------------
  |  |   23|    960|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    960|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3644|    960|                TY_(InsertNodeAfterElement)(node, element);
  ------------------
  |  |   23|    960|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    960|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3645|    960|                continue;
 3646|  1.37k|            }
 3647|  3.45k|        }
 3648|       |
 3649|  2.79M|        if ( nodeIsDT(element) )
  ------------------
  |  |  391|  2.79M|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  275|  2.79M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.79M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.79M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 7.84k, False: 2.78M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3650|  7.84k|        {
 3651|  7.84k|            if ( nodeIsHR(node) )
  ------------------
  |  |  380|  7.84k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  7.84k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.84k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 7.84k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.89k, False: 5.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3652|  1.89k|            {
 3653|  1.89k|                Node *dd;
 3654|  1.89k|                if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3654:22): [True: 221, False: 1.67k]
  ------------------
 3655|    221|                {
 3656|    221|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    221|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    221|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3657|    221|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    221|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    221|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3658|    221|                    continue;
 3659|    221|                }
 3660|       |
 3661|  1.67k|                TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.67k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.67k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3662|  1.67k|                dd = TY_(InferredTag)(doc, TidyTag_DD);
  ------------------
  |  |   23|  1.67k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.67k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3663|       |
 3664|       |                /* insert hr within dd before dt if dt is empty */
 3665|  1.67k|                if (element->content == NULL)
  ------------------
  |  Branch (3665:21): [True: 974, False: 704]
  ------------------
 3666|    974|                {
 3667|    974|                    TY_(InsertNodeBeforeElement)(element, dd);
  ------------------
  |  |   23|    974|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    974|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3668|    974|                    TY_(InsertNodeAtEnd)(dd, node);
  ------------------
  |  |   23|    974|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    974|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3669|    974|                    continue;
 3670|    974|                }
 3671|       |
 3672|       |                /* split dt and insert hr within dd before 2nd part */
 3673|    704|                TY_(InsertNodeAfterElement)(element, dd);
  ------------------
  |  |   23|    704|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    704|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3674|    704|                TY_(InsertNodeAtEnd)(dd, node);
  ------------------
  |  |   23|    704|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    704|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3675|       |
 3676|    704|                if (!(mode & Preformatted))
  ------------------
  |  Branch (3676:21): [True: 704, False: 0]
  ------------------
 3677|    704|                    TrimSpaces(doc, element);
 3678|       |
 3679|    704|                element = TY_(CloneNode)( doc, element );
  ------------------
  |  |   23|    704|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    704|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3680|    704|                TY_(InsertNodeAfterElement)(dd, element);
  ------------------
  |  |   23|    704|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    704|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3681|    704|                continue;
 3682|  1.67k|            }
 3683|  7.84k|        }
 3684|       |
 3685|       |
 3686|       |        /*
 3687|       |          if this is the end tag for an ancestor element
 3688|       |          then infer end tag for this element
 3689|       |        */
 3690|  2.79M|        if (node->type == EndTag)
  ------------------
  |  Branch (3690:13): [True: 34.4k, False: 2.75M]
  ------------------
 3691|  34.4k|        {
 3692|  34.4k|            for (parent = element->parent;
 3693|  29.9M|                    parent != NULL; parent = parent->parent)
  ------------------
  |  Branch (3693:21): [True: 29.9M, False: 4.25k]
  ------------------
 3694|  29.9M|            {
 3695|  29.9M|                if (node->tag == parent->tag)
  ------------------
  |  Branch (3695:21): [True: 30.1k, False: 29.9M]
  ------------------
 3696|  30.1k|                {
 3697|  30.1k|                    if (!(element->tag->model & CM_OPT) && !element->implicit)
  ------------------
  |  |  154|  30.1k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (3697:25): [True: 29.8k, False: 321]
  |  Branch (3697:60): [True: 19.3k, False: 10.4k]
  ------------------
 3698|  19.3k|                        TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  19.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3699|       |
 3700|  30.1k|                    if( TY_(IsPushedLast)( doc, element, node ) )
  ------------------
  |  |   23|  30.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  30.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3700:25): [True: 0, False: 30.1k]
  ------------------
 3701|      0|                        TY_(PopInline)( doc, element );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3702|  30.1k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  30.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  30.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3703|       |
 3704|  30.1k|                    if (!(mode & Preformatted))
  ------------------
  |  Branch (3704:25): [True: 30.1k, False: 0]
  ------------------
 3705|  30.1k|                        TrimSpaces(doc, element);
 3706|       |
 3707|  30.1k|                    DEBUG_LOG_EXIT;
 3708|  30.1k|                    return NULL;
 3709|  30.1k|                }
 3710|  29.9M|            }
 3711|  34.4k|        }
 3712|       |
 3713|       |        /*\
 3714|       |         *  block level tags end this element
 3715|       |         *  Issue #333 - There seems an exception if the element is a 'span',
 3716|       |         *  and the node just collected is a 'meta'. The 'meta' can not have
 3717|       |         *  CM_INLINE added, nor can the 'span' have CM_MIXED added without
 3718|       |         *  big consequences.
 3719|       |         *  There may be other exceptions to be added...
 3720|       |        \*/
 3721|  2.76M|        if (!(node->tag->model & CM_INLINE) &&
  ------------------
  |  |  143|  2.76M|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3721:13): [True: 677k, False: 2.08M]
  ------------------
 3722|   677k|            !(element->tag->model & CM_MIXED) &&
  ------------------
  |  |  156|   677k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (3722:13): [True: 677k, False: 559]
  ------------------
 3723|   677k|            !(nodeIsSPAN(element) && nodeIsMETA(node)) )
  ------------------
  |  |  430|   677k|#define nodeIsSPAN( node )       TagIsId( node, TidyTag_SPAN )
  |  |  ------------------
  |  |  |  |  275|  1.35M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 677k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 677k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 819, False: 676k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          !(nodeIsSPAN(element) && nodeIsMETA(node)) )
  ------------------
  |  |  374|    819|#define nodeIsMETA( node )       TagIsId( node, TidyTag_META )
  |  |  ------------------
  |  |  |  |  275|    819|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 819, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 819, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 197, False: 622]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3724|   677k|        {
 3725|   677k|            if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|   677k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   677k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3725:18): [True: 2.80k, False: 674k]
  ------------------
 3726|  2.80k|            {
 3727|  2.80k|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3728|  2.80k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3729|  2.80k|                continue;
 3730|  2.80k|            }
 3731|       |            /* HTML5 */
 3732|   674k|            if (nodeIsDATALIST(element)) {
  ------------------
  |  |  463|   674k|#define nodeIsDATALIST( node )   TagIsId( node, TidyTag_DATALIST )
  |  |  ------------------
  |  |  |  |  275|   674k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 674k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 674k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 674k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3733|      0|                TY_(ConstrainVersion)( doc, ~VERS_HTML5 );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ConstrainVersion)( 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
  |  |  ------------------
  ------------------
 3734|      0|            } else
 3735|   674k|            if (!(element->tag->model & CM_OPT))
  ------------------
  |  |  154|   674k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (3735:17): [True: 587k, False: 87.2k]
  ------------------
 3736|   587k|                TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|   587k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   587k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3737|       |
 3738|   674k|            if (node->tag->model & CM_HEAD && !(node->tag->model & CM_BLOCK))
  ------------------
  |  |  141|  1.34M|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
                          if (node->tag->model & CM_HEAD && !(node->tag->model & CM_BLOCK))
  ------------------
  |  |  142|  3.92k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (3738:17): [True: 3.92k, False: 670k]
  |  Branch (3738:47): [True: 1.60k, False: 2.32k]
  ------------------
 3739|  1.60k|            {
 3740|  1.60k|                MoveToHead(doc, element, node);
 3741|  1.60k|                continue;
 3742|  1.60k|            }
 3743|       |
 3744|       |            /*
 3745|       |               prevent anchors from propagating into block tags
 3746|       |               except for headings h1 to h6
 3747|       |            */
 3748|   672k|            if ( nodeIsA(element) )
  ------------------
  |  |  401|   672k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|   672k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 672k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 672k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.33k, False: 671k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3749|  1.33k|            {
 3750|  1.33k|                if (node->tag && !(node->tag->model & CM_HEADING))
  ------------------
  |  |  153|  1.33k|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
  |  Branch (3750:21): [True: 1.33k, False: 0]
  |  Branch (3750:34): [True: 403, False: 928]
  ------------------
 3751|    403|                    TY_(PopInline)( doc, element );
  ------------------
  |  |   23|    403|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    403|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3752|    928|                else if (!(element->content))
  ------------------
  |  Branch (3752:26): [True: 559, False: 369]
  ------------------
 3753|    559|                {
 3754|    559|                    TY_(DiscardElement)( doc, element );
  ------------------
  |  |   23|    559|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    559|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3755|    559|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    559|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    559|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3756|       |
 3757|    559|                    DEBUG_LOG_EXIT;
 3758|    559|                    return NULL;
 3759|    559|                }
 3760|  1.33k|            }
 3761|       |
 3762|   672k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|   672k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   672k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3763|       |
 3764|   672k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3764:17): [True: 672k, False: 0]
  ------------------
 3765|   672k|                TrimSpaces(doc, element);
 3766|       |
 3767|   672k|            DEBUG_LOG_EXIT;
 3768|   672k|            return NULL;
 3769|   672k|        }
 3770|       |
 3771|       |        /* parse inline element */
 3772|  2.08M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  2.08M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.08M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3772:13): [True: 2.08M, False: 1.44k]
  ------------------
 3773|  2.08M|        {
 3774|  2.08M|            if (node->implicit)
  ------------------
  |  Branch (3774:17): [True: 1.85M, False: 227k]
  ------------------
 3775|  1.85M|                TY_(Report)(doc, element, node, INSERTING_TAG);
  ------------------
  |  |   23|  1.85M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.85M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3776|       |
 3777|       |            /* trim white space before <br> */
 3778|  2.08M|            if ( nodeIsBR(node) )
  ------------------
  |  |  400|  2.08M|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  2.08M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.08M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.08M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.75k, False: 2.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3779|  3.75k|                TrimSpaces(doc, element);
 3780|       |
 3781|  2.08M|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  2.08M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.08M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3782|       |            
 3783|  2.08M|            {
 3784|  2.08M|                TidyParserMemory memory = {0};
 3785|  2.08M|                memory.identity = TY_(ParseInline);
  ------------------
  |  |   23|  2.08M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.08M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3786|  2.08M|                memory.original_node = element;
 3787|  2.08M|                memory.reentry_node = node;
 3788|  2.08M|                memory.mode = mode;
 3789|  2.08M|                memory.reentry_mode = mode;
 3790|  2.08M|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  2.08M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.08M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3791|  2.08M|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3792|  2.08M|                return node;
 3793|  2.08M|            }
 3794|  2.08M|        }
 3795|       |
 3796|       |        /* discard unexpected tags */
 3797|  1.44k|        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3798|  1.44k|        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  1.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3799|  1.44k|        continue;
 3800|  2.08M|    }
 3801|       |
 3802|  1.37M|    if (!(element->tag->model & CM_OPT))
  ------------------
  |  |  154|  1.37M|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (3802:9): [True: 1.37M, False: 5.71k]
  ------------------
 3803|  1.37M|        TY_(Report)(doc, element, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  1.37M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3804|       |
 3805|  1.37M|    DEBUG_LOG_EXIT;
 3806|       |    return NULL;
 3807|  4.21M|}
prvTidyParseList:
 3819|   128k|{
 3820|   128k|    Lexer* lexer = doc->lexer;
 3821|   128k|    Node *node = NULL;
 3822|   128k|    Node *parent = NULL;
 3823|   128k|    Node *lastli = NULL;;
 3824|   128k|    Bool wasblock = no;
 3825|   128k|    Bool nodeisOL = nodeIsOL(list);
  ------------------
  |  |  387|   128k|#define nodeIsOL( node )         TagIsId( node, TidyTag_OL )
  |  |  ------------------
  |  |  |  |  275|   128k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 59.9k, False: 68.6k]
  |  |  |  |  |  Branch (275:39): [True: 59.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 52.7k, False: 7.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3826|   128k|    DEBUG_LOG_COUNTERS;
 3827|       |
 3828|   128k|    if ( list == NULL )
  ------------------
  |  Branch (3828:10): [True: 68.6k, False: 59.9k]
  ------------------
 3829|  68.6k|    {
 3830|  68.6k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  68.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  68.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3831|  68.6k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 3832|  68.6k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 3833|  68.6k|        list = memory.original_node;
 3834|  68.6k|        DEBUG_LOG_GET_OLD_MODE;
 3835|  68.6k|        mode = memory.mode;
 3836|  68.6k|        DEBUG_LOG_CHANGE_MODE;
 3837|  68.6k|    }
 3838|  59.9k|    else
 3839|  59.9k|    {
 3840|  59.9k|        DEBUG_LOG_ENTER_WITH_NODE(list);
 3841|       |
 3842|  59.9k|        if (list->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  59.9k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (3842:13): [True: 0, False: 59.9k]
  ------------------
 3843|      0|        {
 3844|      0|            DEBUG_LOG_EXIT;
 3845|      0|            return NULL;
 3846|      0|        }
 3847|  59.9k|    }
 3848|       |    
 3849|   128k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 3850|       |
 3851|   139k|    while ((node = TY_(GetToken)( doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|   139k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   139k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3851:12): [True: 87.8k, False: 51.8k]
  ------------------
 3852|  87.8k|    {
 3853|  87.8k|        Bool foundLI = no;
 3854|  87.8k|        if (node->tag == list->tag && node->type == EndTag)
  ------------------
  |  Branch (3854:13): [True: 51.7k, False: 36.0k]
  |  Branch (3854:39): [True: 3.29k, False: 48.4k]
  ------------------
 3855|  3.29k|        {
 3856|  3.29k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  3.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3857|  3.29k|            list->closed = yes;
 3858|  3.29k|            DEBUG_LOG_EXIT;
 3859|  3.29k|            return NULL;
 3860|  3.29k|        }
 3861|       |
 3862|       |        /* deal with comments etc. */
 3863|  84.5k|        if (InsertMisc(list, node))
  ------------------
  |  Branch (3863:13): [True: 2.17k, False: 82.3k]
  ------------------
 3864|  2.17k|            continue;
 3865|       |
 3866|  82.3k|        if (node->type != TextNode && node->tag == NULL)
  ------------------
  |  Branch (3866:13): [True: 73.8k, False: 8.52k]
  |  Branch (3866:39): [True: 6.77k, False: 67.0k]
  ------------------
 3867|  6.77k|        {
 3868|  6.77k|            TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  6.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3869|  6.77k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  6.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3870|  6.77k|            continue;
 3871|  6.77k|        }
 3872|  75.5k|        if (lexer && (node->type == TextNode))
  ------------------
  |  Branch (3872:13): [True: 75.5k, False: 0]
  |  Branch (3872:22): [True: 8.52k, False: 67.0k]
  ------------------
 3873|  8.52k|        {
 3874|  8.52k|            uint ch, ix = node->start;
 3875|       |            /* Issue #572 - Skip whitespace. */
 3876|  9.71k|            while (ix < node->end && (ch = (lexer->lexbuf[ix] & 0xff))
  ------------------
  |  Branch (3876:20): [True: 9.43k, False: 288]
  |  Branch (3876:38): [True: 9.36k, False: 66]
  ------------------
 3877|  9.36k|                && (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n'))
  ------------------
  |  Branch (3877:21): [True: 428, False: 8.93k]
  |  Branch (3877:34): [True: 503, False: 8.43k]
  |  Branch (3877:48): [True: 205, False: 8.22k]
  |  Branch (3877:62): [True: 63, False: 8.16k]
  ------------------
 3878|  1.19k|                ++ix;
 3879|  8.52k|            if (ix >= node->end)
  ------------------
  |  Branch (3879:17): [True: 288, False: 8.23k]
  ------------------
 3880|    288|            {
 3881|       |                /* Issue #572 - Discard if ALL whitespace. */
 3882|    288|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    288|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    288|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3883|    288|                continue;
 3884|    288|            }
 3885|  8.52k|        }
 3886|       |
 3887|       |
 3888|       |        /*
 3889|       |          if this is the end tag for an ancestor element
 3890|       |          then infer end tag for this element
 3891|       |        */
 3892|  75.2k|        if (node->type == EndTag)
  ------------------
  |  Branch (3892:13): [True: 2.21k, False: 73.0k]
  ------------------
 3893|  2.21k|        {
 3894|  2.21k|            if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  2.21k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  2.21k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.21k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.21k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 248, False: 1.96k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3895|    248|            {
 3896|    248|                BadForm( doc );
 3897|    248|                TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    248|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    248|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3898|    248|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    248|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    248|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3899|    248|                continue;
 3900|    248|            }
 3901|       |
 3902|  1.96k|            if (TY_(nodeHasCM)(node,CM_INLINE))
  ------------------
  |  |   23|  1.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(nodeHasCM)(node,CM_INLINE))
  ------------------
  |  |  143|  1.96k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3902:17): [True: 788, False: 1.17k]
  ------------------
 3903|    788|            {
 3904|    788|                TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    788|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    788|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3905|    788|                TY_(PopInline)( doc, node );
  ------------------
  |  |   23|    788|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    788|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3906|    788|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    788|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    788|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3907|    788|                continue;
 3908|    788|            }
 3909|       |
 3910|  1.17k|            for ( parent = list->parent;
 3911|  46.7k|                  parent != NULL; parent = parent->parent )
  ------------------
  |  Branch (3911:19): [True: 46.5k, False: 232]
  ------------------
 3912|  46.5k|            {
 3913|       |               /* Do not match across BODY to avoid infinite loop
 3914|       |                  between ParseBody and this parser,
 3915|       |                  See http://tidy.sf.net/bug/1053626. */
 3916|  46.5k|                if (nodeIsBODY(parent))
  ------------------
  |  |  375|  46.5k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  46.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 46.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 46.3k, False: 232]
  |  |  |  |  |  Branch (275:54): [True: 447, False: 45.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3917|    447|                    break;
 3918|  46.1k|                if (node->tag == parent->tag)
  ------------------
  |  Branch (3918:21): [True: 500, False: 45.6k]
  ------------------
 3919|    500|                {
 3920|    500|                    TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|    500|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    500|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3921|    500|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    500|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    500|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3922|    500|                    DEBUG_LOG_EXIT;
 3923|    500|                    return NULL;
 3924|    500|                }
 3925|  46.1k|            }
 3926|       |
 3927|    679|            TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    679|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    679|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3928|    679|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    679|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    679|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3929|    679|            continue;
 3930|  1.17k|        }
 3931|       |
 3932|  73.0k|        if ( !nodeIsLI(node) && nodeisOL )
  ------------------
  |  |  390|  73.0k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|   146k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 73.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 64.8k, False: 8.23k]
  |  |  |  |  |  Branch (275:54): [True: 4.63k, False: 60.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3932:33): [True: 48.9k, False: 19.4k]
  ------------------
 3933|  48.9k|        {
 3934|       |            /* Issue #572 - A <ol><li> can have nested <ol> elements */
 3935|  48.9k|            foundLI = FindLastLI(list, &lastli); /* find last <li> */
 3936|  48.9k|        }
 3937|       |
 3938|  73.0k|        if ( nodeIsLI(node) || (TY_(IsHTML5Mode)(doc) && !foundLI) )
  ------------------
  |  |  390|  73.0k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|   146k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 73.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 64.8k, False: 8.23k]
  |  |  |  |  |  Branch (275:54): [True: 4.63k, False: 60.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsLI(node) || (TY_(IsHTML5Mode)(doc) && !foundLI) )
  ------------------
  |  |   23|  68.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  68.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3938:33): [True: 23.3k, False: 45.0k]
  |  Branch (3938:58): [True: 23.3k, False: 0]
  ------------------
 3939|  27.9k|        {
 3940|       |            /* node is <LI> OR
 3941|       |               Issue #396 - A <ul> can have Zero or more <li> elements
 3942|       |             */
 3943|  27.9k|            TY_(InsertNodeAtEnd)(list,node);
  ------------------
  |  |   23|  27.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3944|  27.9k|        }
 3945|  45.0k|        else
 3946|  45.0k|        {
 3947|  45.0k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  45.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3948|       |
 3949|  45.0k|            if (TY_(nodeHasCM)(node,CM_BLOCK) && lexer->excludeBlocks)
  ------------------
  |  |   23|  45.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(nodeHasCM)(node,CM_BLOCK) && lexer->excludeBlocks)
  ------------------
  |  |  142|  45.0k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (3949:17): [True: 38.4k, False: 6.59k]
  |  Branch (3949:50): [True: 1.13k, False: 37.3k]
  ------------------
 3950|  1.13k|            {
 3951|  1.13k|                TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3952|  1.13k|                DEBUG_LOG_EXIT;
 3953|  1.13k|                return NULL;
 3954|  1.13k|            }
 3955|       |            /* http://tidy.sf.net/issue/1316307 */
 3956|       |            /* In exiled mode, return so table processing can continue. */
 3957|  43.9k|            else if ( lexer->exiled
  ------------------
  |  Branch (3957:23): [True: 21.3k, False: 22.5k]
  ------------------
 3958|  21.3k|                      && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                    && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |  146|  21.3k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                    && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |  147|  21.3k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
                                    && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |  148|  21.3k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (3958:27): [True: 1.31k, False: 20.0k]
  ------------------
 3959|  21.3k|                          || nodeIsTABLE(node)) )
  ------------------
  |  |  393|  20.0k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  20.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 20.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 18.5k, False: 1.52k]
  |  |  |  |  |  Branch (275:54): [True: 35, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3960|  1.35k|            {
 3961|  1.35k|                DEBUG_LOG_EXIT;
 3962|  1.35k|                return NULL;
 3963|  1.35k|            }
 3964|       |            /* http://tidy.sf.net/issue/836462
 3965|       |               If "list" is an unordered list, insert the next tag within
 3966|       |               the last <li> to preserve the numbering to match the visual
 3967|       |               rendering of most browsers. */
 3968|  42.5k|            if ( nodeIsOL(list) && FindLastLI(list, &lastli) )
  ------------------
  |  |  387|  42.5k|#define nodeIsOL( node )         TagIsId( node, TidyTag_OL )
  |  |  ------------------
  |  |  |  |  275|  85.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 42.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 42.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 39.8k, False: 2.69k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3968:36): [True: 811, False: 39.0k]
  ------------------
 3969|    811|            {
 3970|       |                /* Create a node for error reporting */
 3971|    811|                node = TY_(InferredTag)(doc, TidyTag_LI);
  ------------------
  |  |   23|    811|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    811|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3972|    811|                TY_(Report)(doc, list, node, MISSING_STARTTAG );
  ------------------
  |  |   23|    811|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    811|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3973|    811|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    811|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    811|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3974|    811|                node = lastli;
 3975|    811|            }
 3976|  41.7k|            else
 3977|  41.7k|            {
 3978|       |                /* Add an inferred <li> */
 3979|  41.7k|                wasblock = TY_(nodeHasCM)(node,CM_BLOCK);
  ------------------
  |  |   23|  41.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              wasblock = TY_(nodeHasCM)(node,CM_BLOCK);
  ------------------
  |  |  142|  41.7k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
 3980|  41.7k|                node = TY_(InferredTag)(doc, TidyTag_LI);
  ------------------
  |  |   23|  41.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3981|       |                /* Add "display: inline" to avoid a blank line after <li> with
 3982|       |                   Internet Explorer. See http://tidy.sf.net/issue/836462 */
 3983|  41.7k|                TY_(AddStyleProperty)( doc, node,
  ------------------
  |  |   23|  41.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3984|  41.7k|                                       wasblock
  ------------------
  |  Branch (3984:40): [True: 37.2k, False: 4.52k]
  ------------------
 3985|  41.7k|                                       ? "list-style: none; display: inline"
 3986|  41.7k|                                       : "list-style: none"
 3987|  41.7k|                                       );
 3988|  41.7k|                TY_(Report)(doc, list, node, MISSING_STARTTAG );
  ------------------
  |  |   23|  41.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3989|  41.7k|                TY_(InsertNodeAtEnd)(list,node);
  ------------------
  |  |   23|  41.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3990|  41.7k|            }
 3991|  42.5k|        }
 3992|       |
 3993|  70.5k|        {
 3994|  70.5k|            TidyParserMemory memory = {0};
 3995|  70.5k|            memory.identity = TY_(ParseList);
  ------------------
  |  |   23|  70.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  70.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3996|  70.5k|            memory.original_node = list;
 3997|  70.5k|            memory.reentry_node = node;
 3998|  70.5k|            memory.mode = IgnoreWhitespace;
 3999|  70.5k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  70.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  70.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4000|  70.5k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 4001|  70.5k|            return node;
 4002|  73.0k|        }
 4003|  73.0k|    }
 4004|       |
 4005|  51.8k|    TY_(Report)(doc, list, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  51.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4006|  51.8k|    DEBUG_LOG_EXIT;
 4007|       |    return NULL;
 4008|   128k|}
prvTidyParseNamespace:
 4028|  7.11k|{
 4029|  7.11k|    Lexer* lexer = doc->lexer;
 4030|  7.11k|    Node *node;
 4031|  7.11k|    Node *parent = basenode;
 4032|  7.11k|    uint istackbase;
 4033|  7.11k|    AttVal* av; /* #130 MathML attr and entity fix! */
 4034|       |
 4035|       |    /* a la <table>: defer popping elements off the inline stack */
 4036|  7.11k|    TY_(DeferDup)( doc );
  ------------------
  |  |   23|  7.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4037|  7.11k|    istackbase = lexer->istackbase;
 4038|  7.11k|    lexer->istackbase = lexer->istacksize;
 4039|       |
 4040|  7.11k|    mode = OtherNamespace; /* Preformatted; IgnoreWhitespace; */
 4041|       |
 4042|  60.3k|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|  60.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4042:12): [True: 53.6k, False: 6.71k]
  ------------------
 4043|  53.6k|    {
 4044|       |        /*
 4045|       |        fix check to skip action in InsertMisc for regular/empty
 4046|       |        nodes, which we don't want here...
 4047|       |
 4048|       |        The way we do it here is by checking and processing everything
 4049|       |        and only what remains goes into InsertMisc()
 4050|       |        */
 4051|       |
 4052|       |        /* is this a close tag? And does it match the current parent node? */
 4053|  53.6k|        if (node->type == EndTag)
  ------------------
  |  Branch (4053:13): [True: 5.10k, False: 48.5k]
  ------------------
 4054|  5.10k|        {
 4055|       |            /*
 4056|       |            to prevent end tags flowing from one 'alternate namespace' we
 4057|       |            check this in two phases: first we check if the tag is a
 4058|       |            descendant of the current node, and when it is, we check whether
 4059|       |            it is the end tag for a node /within/ or /outside/ the basenode.
 4060|       |            */
 4061|  5.10k|            Bool outside;
 4062|  5.10k|            Node *mp = FindMatchingDescendant(parent, node, basenode, &outside);
 4063|       |
 4064|  5.10k|            if (mp != NULL)
  ------------------
  |  Branch (4064:17): [True: 3.21k, False: 1.89k]
  ------------------
 4065|  3.21k|            {
 4066|       |                /*
 4067|       |                when mp != parent as we might expect,
 4068|       |                infer end tags until we 'hit' the matched
 4069|       |                parent or the basenode
 4070|       |                */
 4071|  3.21k|                Node *n;
 4072|       |
 4073|  3.21k|                for (n = parent;
 4074|  4.80k|                     n != NULL && n != basenode->parent && n != mp;
  ------------------
  |  Branch (4074:22): [True: 4.80k, False: 0]
  |  Branch (4074:35): [True: 4.41k, False: 391]
  |  Branch (4074:60): [True: 1.58k, False: 2.82k]
  ------------------
 4075|  3.21k|                     n = n->parent)
 4076|  1.58k|                {
 4077|       |                    /* n->implicit = yes; */
 4078|  1.58k|                    n->closed = yes;
 4079|  1.58k|                    TY_(Report)(doc, n->parent, n, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4080|  1.58k|                }
 4081|       |
 4082|       |                /* Issue #369 - Since 'assert' is DEBUG only, and there are
 4083|       |                   simple cases where these can be fired, removing them
 4084|       |                   pending feedback from the original author!
 4085|       |                   assert(outside == no ? n == mp : 1);
 4086|       |                   assert(outside == yes ? n == basenode->parent : 1);
 4087|       |                   =================================================== */
 4088|       |
 4089|  3.21k|                if (outside == no)
  ------------------
  |  Branch (4089:21): [True: 3.21k, False: 0]
  ------------------
 4090|  3.21k|                {
 4091|       |                    /* EndTag for a node within the basenode subtree. Roll on... */
 4092|  3.21k|                    if (n)
  ------------------
  |  Branch (4092:25): [True: 3.21k, False: 0]
  ------------------
 4093|  3.21k|                        n->closed = yes;
 4094|  3.21k|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  3.21k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.21k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4095|       |
 4096|  3.21k|                    node = n;
 4097|  3.21k|                    parent = node ? node->parent : NULL;
  ------------------
  |  Branch (4097:30): [True: 3.21k, False: 0]
  ------------------
 4098|  3.21k|                }
 4099|      0|                else
 4100|      0|                {
 4101|       |                    /* EndTag for a node outside the basenode subtree: let the caller handle that. */
 4102|      0|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4103|      0|                    node = basenode;
 4104|      0|                    parent = node->parent;
 4105|      0|                }
 4106|       |
 4107|       |                /* when we've arrived at the end-node for the base node, it's quitting time */
 4108|  3.21k|                if (node == basenode)
  ------------------
  |  Branch (4108:21): [True: 402, False: 2.81k]
  ------------------
 4109|    402|                {
 4110|    402|                    lexer->istackbase = istackbase;
 4111|    402|                    assert(basenode && basenode->closed == yes);
  ------------------
  |  Branch (4111:21): [True: 0, False: 402]
  |  Branch (4111:21): [True: 0, False: 0]
  |  Branch (4111:21): [True: 402, False: 0]
  |  Branch (4111:21): [True: 402, False: 0]
  ------------------
 4112|    402|                    return NULL;
 4113|    402|                }
 4114|  3.21k|            }
 4115|  1.89k|            else
 4116|  1.89k|            {
 4117|       |                /* unmatched close tag: report an error and discard */
 4118|       |                /* TY_(Report)(doc, parent, node, NON_MATCHING_ENDTAG); Issue #308 - Seems wrong warning! */
 4119|  1.89k|                TY_(Report)(doc, parent, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4120|  1.89k|                assert(parent);
  ------------------
  |  Branch (4120:17): [True: 0, False: 1.89k]
  |  Branch (4120:17): [True: 1.89k, False: 0]
  ------------------
 4121|       |                /* assert(parent->tag != node->tag); Issue #308 - Seems would always be true! */
 4122|  1.89k|                TY_(FreeNode)( doc, node); /* Issue #308 - Discard unexpected end tag memory */
  ------------------
  |  |   23|  1.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4123|  1.89k|            }
 4124|  5.10k|        }
 4125|  48.5k|        else if (node->type == StartTag)
  ------------------
  |  Branch (4125:18): [True: 15.8k, False: 32.7k]
  ------------------
 4126|  15.8k|        {
 4127|       |            /* #130 MathML attr and entity fix!
 4128|       |               care if it has attributes, and 'accidently' any of those attributes match known */
 4129|  20.8k|            for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (4129:42): [True: 4.99k, False: 15.8k]
  ------------------
 4130|  4.99k|            {
 4131|  4.99k|                av->dict = 0; /* does something need to be freed? */
 4132|  4.99k|            }
 4133|       |            /* add another child to the current parent */
 4134|  15.8k|            TY_(InsertNodeAtEnd)(parent, node);
  ------------------
  |  |   23|  15.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4135|  15.8k|            parent = node;
 4136|  15.8k|        }
 4137|  32.7k|        else
 4138|  32.7k|        {
 4139|       |            /* #130 MathML attr and entity fix!
 4140|       |               care if it has attributes, and 'accidently' any of those attributes match known */
 4141|  54.8k|            for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (4141:42): [True: 22.0k, False: 32.7k]
  ------------------
 4142|  22.0k|            {
 4143|  22.0k|                av->dict = 0; /* does something need to be freed? */
 4144|  22.0k|            }
 4145|  32.7k|            TY_(InsertNodeAtEnd)(parent, node);
  ------------------
  |  |   23|  32.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4146|  32.7k|        }
 4147|  53.6k|    }
 4148|       |
 4149|  6.71k|    TY_(Report)(doc, basenode->parent, basenode, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  6.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4150|       |    return NULL;
 4151|  7.11k|}
prvTidyParseNoFrames:
 4163|  49.2k|{
 4164|  49.2k|    Lexer* lexer = doc->lexer;
 4165|  49.2k|    Node *node = NULL;
 4166|  49.2k|    Bool body_seen = no;
 4167|  49.2k|    DEBUG_LOG_COUNTERS;
 4168|       |
 4169|  49.2k|    enum parserState {
 4170|  49.2k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4171|  49.2k|        STATE_POST_NODEISBODY,        /* To-do after re-entering after checks. */
 4172|  49.2k|        STATE_COMPLETE,               /* Done with the switch. */
 4173|  49.2k|    } state = STATE_INITIAL;
 4174|       |
 4175|       |    /*
 4176|       |     If we're re-entering, then we need to setup from a previous state,
 4177|       |     instead of starting fresh. We can pull what we need from the document's
 4178|       |     stack.
 4179|       |     */
 4180|  49.2k|    if ( noframes == NULL )
  ------------------
  |  Branch (4180:10): [True: 24.7k, False: 24.5k]
  ------------------
 4181|  24.7k|    {
 4182|  24.7k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  24.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4183|  24.7k|        node = memory.reentry_node; /* Throwaway, because we replace it entering the loop anyway.*/
 4184|  24.7k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4185|  24.7k|        noframes = memory.original_node;
 4186|  24.7k|        state = memory.reentry_state;
 4187|  24.7k|        body_seen = memory.register_1;
 4188|  24.7k|        DEBUG_LOG_GET_OLD_MODE;
 4189|  24.7k|        mode = memory.mode;
 4190|  24.7k|        DEBUG_LOG_CHANGE_MODE;
 4191|  24.7k|    }
 4192|  24.5k|    else
 4193|  24.5k|    {
 4194|  24.5k|        DEBUG_LOG_ENTER_WITH_NODE(noframes);
 4195|  24.5k|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  24.5k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (4195:14): [True: 24.5k, False: 0]
  ------------------
 4196|  24.5k|        {
 4197|  24.5k|            doc->badAccess |=  BA_USING_NOFRAMES;
  ------------------
  |  |  285|  24.5k|#define BA_USING_NOFRAMES          32
  ------------------
 4198|  24.5k|        }
 4199|  24.5k|    }
 4200|       |
 4201|  49.2k|    mode = IgnoreWhitespace;
 4202|       |
 4203|  76.3k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4203:13): [True: 58.2k, False: 18.1k]
  ------------------
 4204|  58.2k|    {
 4205|  58.2k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4205:14): [True: 54.9k, False: 3.27k]
  ------------------
 4206|  54.9k|        {
 4207|  54.9k|            node = TY_(GetToken)(doc, mode);
  ------------------
  |  |   23|  54.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  54.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4208|  54.9k|            DEBUG_LOG_GOT_TOKEN(node);
 4209|  54.9k|        }
 4210|       |        
 4211|  58.2k|        switch ( state )
 4212|  58.2k|        {
 4213|  54.9k|            case STATE_INITIAL:
  ------------------
  |  Branch (4213:13): [True: 54.9k, False: 3.27k]
  ------------------
 4214|  54.9k|            {
 4215|  54.9k|                if ( node == NULL )
  ------------------
  |  Branch (4215:22): [True: 18.1k, False: 36.8k]
  ------------------
 4216|  18.1k|                {
 4217|  18.1k|                    state = STATE_COMPLETE;
 4218|  18.1k|                    continue;
 4219|  18.1k|                }
 4220|       |                
 4221|  36.8k|                if ( node->tag == noframes->tag && node->type == EndTag )
  ------------------
  |  Branch (4221:22): [True: 15.2k, False: 21.6k]
  |  Branch (4221:52): [True: 264, False: 14.9k]
  ------------------
 4222|    264|                {
 4223|    264|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    264|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    264|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4224|    264|                    noframes->closed = yes;
 4225|    264|                    TrimSpaces(doc, noframes);
 4226|    264|                    DEBUG_LOG_EXIT;
 4227|    264|                    return NULL;
 4228|    264|                }
 4229|       |
 4230|  36.5k|                if ( nodeIsFRAME(node) || nodeIsFRAMESET(node) )
  ------------------
  |  |  377|  36.5k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|  73.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 36.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 28.4k, False: 8.10k]
  |  |  |  |  |  Branch (275:54): [True: 791, False: 27.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( nodeIsFRAME(node) || nodeIsFRAMESET(node) )
  ------------------
  |  |  376|  35.7k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  35.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 35.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 27.6k, False: 8.10k]
  |  |  |  |  |  Branch (275:54): [True: 1.59k, False: 26.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4231|  2.38k|                {
 4232|  2.38k|                    TrimSpaces(doc, noframes);
 4233|  2.38k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4233:25): [True: 357, False: 2.02k]
  ------------------
 4234|    357|                    {
 4235|    357|                        TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    357|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    357|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4236|    357|                        TY_(FreeNode)( doc, node);       /* Throw it away */
  ------------------
  |  |   23|    357|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    357|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4237|    357|                    }
 4238|  2.02k|                    else
 4239|  2.02k|                    {
 4240|  2.02k|                        TY_(Report)(doc, noframes, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  2.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4241|  2.02k|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4242|  2.02k|                    }
 4243|  2.38k|                    DEBUG_LOG_EXIT;
 4244|  2.38k|                    return NULL;
 4245|  2.38k|                }
 4246|       |
 4247|  34.1k|                if ( nodeIsHTML(node) )
  ------------------
  |  |  370|  34.1k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  34.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 34.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 26.0k, False: 8.10k]
  |  |  |  |  |  Branch (275:54): [True: 455, False: 25.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4248|    455|                {
 4249|    455|                    if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|    455|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    455|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4249:25): [True: 247, False: 208]
  ------------------
 4250|    247|                        TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    247|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    247|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4251|       |
 4252|    455|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    455|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    455|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4253|    455|                    continue;
 4254|    455|                }
 4255|       |
 4256|       |                /* deal with comments etc. */
 4257|  33.7k|                if (InsertMisc(noframes, node))
  ------------------
  |  Branch (4257:21): [True: 422, False: 33.3k]
  ------------------
 4258|    422|                    continue;
 4259|       |
 4260|  33.3k|                if ( nodeIsBODY(node) && node->type == StartTag )
  ------------------
  |  |  375|  33.3k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  66.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 33.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 25.6k, False: 7.67k]
  |  |  |  |  |  Branch (275:54): [True: 5.42k, False: 20.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4260:42): [True: 5.17k, False: 250]
  ------------------
 4261|  5.17k|                {
 4262|  5.17k|                    TidyParserMemory memory = {0};
 4263|  5.17k|                    memory.identity = TY_(ParseNoFrames);
  ------------------
  |  |   23|  5.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4264|  5.17k|                    memory.original_node = noframes;
 4265|  5.17k|                    memory.reentry_node = node;
 4266|  5.17k|                    memory.reentry_state = STATE_POST_NODEISBODY;
 4267|  5.17k|                    memory.register_1 = lexer->seenEndBody;
 4268|  5.17k|                    memory.mode = IgnoreWhitespace;
 4269|       |
 4270|  5.17k|                    TY_(InsertNodeAtEnd)(noframes, node);
  ------------------
  |  |   23|  5.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4271|  5.17k|                    TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  5.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4272|  5.17k|                    DEBUG_LOG_EXIT_WITH_NODE(node);
 4273|  5.17k|                    return node;
 4274|  5.17k|                }
 4275|       |
 4276|       |                /* implicit body element inferred */
 4277|  28.1k|                if (TY_(nodeIsText)(node) || (node->tag && node->type != EndTag))
  ------------------
  |  |   23|  28.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4277:21): [True: 3.44k, False: 24.6k]
  |  Branch (4277:47): [True: 20.4k, False: 4.23k]
  |  Branch (4277:60): [True: 20.1k, False: 351]
  ------------------
 4278|  23.5k|                {
 4279|  23.5k|                    Node *body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  23.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4280|  23.5k|                    if ( body || lexer->seenEndBody )
  ------------------
  |  Branch (4280:26): [True: 10.6k, False: 12.8k]
  |  Branch (4280:34): [True: 256, False: 12.6k]
  ------------------
 4281|  10.9k|                    {
 4282|  10.9k|                        if ( body == NULL )
  ------------------
  |  Branch (4282:30): [True: 256, False: 10.6k]
  ------------------
 4283|    256|                        {
 4284|    256|                            TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    256|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    256|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4285|    256|                            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    256|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    256|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4286|    256|                            continue;
 4287|    256|                        }
 4288|  10.6k|                        if ( TY_(nodeIsText)(node) )
  ------------------
  |  |   23|  10.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4288:30): [True: 2.64k, False: 8.01k]
  ------------------
 4289|  2.64k|                        {
 4290|  2.64k|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4291|  2.64k|                            node = TY_(InferredTag)(doc, TidyTag_P);
  ------------------
  |  |   23|  2.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4292|  2.64k|                            TY_(Report)(doc, noframes, node, CONTENT_AFTER_BODY );
  ------------------
  |  |   23|  2.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4293|  2.64k|                        }
 4294|  10.6k|                        TY_(InsertNodeAtEnd)( body, node );
  ------------------
  |  |   23|  10.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4295|  10.6k|                    }
 4296|  12.6k|                    else
 4297|  12.6k|                    {
 4298|  12.6k|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  12.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4299|  12.6k|                        node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|  12.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4300|  12.6k|                        if ( cfgBool(doc, TidyXmlOut) )
  ------------------
  |  |  418|  12.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  12.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 12.6k, False: 0]
  |  |  ------------------
  ------------------
 4301|  12.6k|                            TY_(Report)(doc, noframes, node, INSERTING_TAG);
  ------------------
  |  |   23|  12.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4302|  12.6k|                        TY_(InsertNodeAtEnd)( noframes, node );
  ------------------
  |  |   23|  12.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4303|  12.6k|                    }
 4304|       |
 4305|  23.2k|                    {
 4306|  23.2k|                        TidyParserMemory memory = {0};
 4307|  23.2k|                        memory.identity = TY_(ParseNoFrames);
  ------------------
  |  |   23|  23.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4308|  23.2k|                        memory.original_node = noframes;
 4309|  23.2k|                        memory.reentry_node = node;
 4310|  23.2k|                        memory.mode = IgnoreWhitespace; /*MixedContent*/
 4311|  23.2k|                        memory.reentry_state = STATE_INITIAL;
 4312|  23.2k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  23.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4313|  23.2k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 4314|  23.2k|                        return node;
 4315|  23.5k|                    }
 4316|  23.5k|                }
 4317|       |
 4318|       |                /* discard unexpected end tags */
 4319|  4.58k|                TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  4.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4320|  4.58k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  4.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4321|  4.58k|            } break;
 4322|       |                
 4323|       |                
 4324|  3.27k|            case STATE_POST_NODEISBODY:
  ------------------
  |  Branch (4324:13): [True: 3.27k, False: 54.9k]
  ------------------
 4325|  3.27k|            {
 4326|       |                /* fix for bug http://tidy.sf.net/bug/887259 */
 4327|  3.27k|                if (body_seen && TY_(FindBody)(doc) != node)
  ------------------
  |  |   23|  1.49k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.49k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4327:21): [True: 1.49k, False: 1.78k]
  |  Branch (4327:34): [True: 1.49k, False: 1]
  ------------------
 4328|  1.49k|                {
 4329|  1.49k|                    TY_(CoerceNode)(doc, node, TidyTag_DIV, no, no);
  ------------------
  |  |   23|  1.49k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.49k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4330|  1.49k|                    MoveNodeToBody(doc, node);
 4331|  1.49k|                }
 4332|  3.27k|                state = STATE_INITIAL;
 4333|  3.27k|                continue;
 4334|       |
 4335|  28.1k|            } break;
 4336|       |                
 4337|       |                
 4338|      0|            default:
  ------------------
  |  Branch (4338:13): [True: 0, False: 58.2k]
  ------------------
 4339|      0|                break;
 4340|  58.2k|        } /* switch */
 4341|  58.2k|    } /* while */
 4342|       |
 4343|  18.1k|    TY_(Report)(doc, noframes, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  18.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4344|  18.1k|    DEBUG_LOG_EXIT;
 4345|       |    return NULL;
 4346|  49.2k|}
prvTidyParseOptGroup:
 4358|  12.4k|{
 4359|  12.4k|    Lexer* lexer = doc->lexer;
 4360|  12.4k|    Node *node;
 4361|  12.4k|    DEBUG_LOG_COUNTERS;
 4362|       |    
 4363|  12.4k|    if ( field == NULL )
  ------------------
  |  Branch (4363:10): [True: 5.86k, False: 6.57k]
  ------------------
 4364|  5.86k|    {
 4365|  5.86k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  5.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4366|  5.86k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4367|  5.86k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4368|  5.86k|        field = memory.original_node;
 4369|  5.86k|        DEBUG_LOG_GET_OLD_MODE;
 4370|  5.86k|        mode = memory.mode;
 4371|  5.86k|        DEBUG_LOG_CHANGE_MODE;
 4372|  5.86k|    }
 4373|  6.57k|    else
 4374|  6.57k|    {
 4375|  6.57k|        DEBUG_LOG_ENTER_WITH_NODE(field);
 4376|  6.57k|    }
 4377|       |    
 4378|  12.4k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 4379|       |
 4380|  16.1k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  16.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4380:12): [True: 10.0k, False: 6.16k]
  ------------------
 4381|  10.0k|    {
 4382|  10.0k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (4382:13): [True: 5.88k, False: 4.11k]
  |  Branch (4382:40): [True: 407, False: 5.48k]
  ------------------
 4383|    407|        {
 4384|    407|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    407|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    407|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4385|    407|            field->closed = yes;
 4386|    407|            TrimSpaces(doc, field);
 4387|    407|            DEBUG_LOG_EXIT;
 4388|    407|            return NULL;
 4389|    407|        }
 4390|       |
 4391|       |        /* deal with comments etc. */
 4392|  9.59k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (4392:13): [True: 1.23k, False: 8.35k]
  ------------------
 4393|  1.23k|            continue;
 4394|       |
 4395|  8.35k|        if ( node->type == StartTag &&
  ------------------
  |  Branch (4395:14): [True: 7.10k, False: 1.25k]
  ------------------
 4396|  7.10k|             (nodeIsOPTION(node) || nodeIsOPTGROUP(node)) )
  ------------------
  |  |  410|  7.10k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  14.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.10k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.55k, False: 550]
  |  |  |  |  |  Branch (275:54): [True: 387, False: 6.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                           (nodeIsOPTION(node) || nodeIsOPTGROUP(node)) )
  ------------------
  |  |  411|  6.71k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  6.71k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.71k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.16k, False: 550]
  |  |  |  |  |  Branch (275:54): [True: 5.48k, False: 684]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4397|  5.86k|        {
 4398|  5.86k|            TidyParserMemory memory = {0};
 4399|       |
 4400|  5.86k|            if ( nodeIsOPTGROUP(node) )
  ------------------
  |  |  411|  5.86k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  5.86k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.86k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.86k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.48k, False: 387]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4401|  5.48k|                TY_(Report)(doc, field, node, CANT_BE_NESTED);
  ------------------
  |  |   23|  5.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4402|       |
 4403|  5.86k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  5.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4404|       |
 4405|  5.86k|            memory.identity = TY_(ParseOptGroup);
  ------------------
  |  |   23|  5.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4406|  5.86k|            memory.original_node = field;
 4407|  5.86k|            memory.reentry_node = node;
 4408|  5.86k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  5.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4409|  5.86k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 4410|  5.86k|            return node;
 4411|  5.86k|        }
 4412|       |
 4413|       |        /* discard unexpected tags */
 4414|  2.48k|        TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  2.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4415|  2.48k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4416|  2.48k|    }
 4417|  6.16k|    DEBUG_LOG_EXIT;
 4418|       |    return NULL;
 4419|  12.4k|}
prvTidyParsePre:
 4431|   123k|{
 4432|   123k|    Node *node = NULL;
 4433|   123k|    DEBUG_LOG_COUNTERS;
 4434|       |
 4435|   123k|    enum parserState {
 4436|   123k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4437|   123k|        STATE_RENTRY_ACTION,          /* To-do after re-entering after checks. */
 4438|   123k|        STATE_COMPLETE,               /* Done with the switch. */
 4439|   123k|    } state = STATE_INITIAL;
 4440|       |
 4441|       |
 4442|   123k|    if ( pre == NULL )
  ------------------
  |  Branch (4442:10): [True: 49.4k, False: 73.7k]
  ------------------
 4443|  49.4k|    {
 4444|  49.4k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  49.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4445|  49.4k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4446|  49.4k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4447|  49.4k|        pre = memory.original_node;
 4448|  49.4k|        state = memory.reentry_state;
 4449|  49.4k|        DEBUG_LOG_GET_OLD_MODE;
 4450|  49.4k|        mode = memory.mode;
 4451|  49.4k|        DEBUG_LOG_CHANGE_MODE;
 4452|  49.4k|    }
 4453|  73.7k|    else
 4454|  73.7k|    {
 4455|  73.7k|        DEBUG_LOG_ENTER_WITH_NODE(pre);
 4456|  73.7k|        if (pre->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  73.7k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (4456:13): [True: 0, False: 73.7k]
  ------------------
 4457|      0|        {
 4458|      0|            DEBUG_LOG_EXIT;
 4459|      0|            return NULL;
 4460|      0|        }
 4461|  73.7k|    }
 4462|       |
 4463|   123k|    TY_(InlineDup)( doc, NULL ); /* tell lexer to insert inlines if needed */
  ------------------
  |  |   23|   123k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   123k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4464|       |
 4465|   211k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4465:13): [True: 204k, False: 7.28k]
  ------------------
 4466|   204k|    {
 4467|   204k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4467:14): [True: 158k, False: 46.0k]
  ------------------
 4468|   158k|            node = TY_(GetToken)(doc, Preformatted);
  ------------------
  |  |   23|   158k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   158k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4469|       |        
 4470|   204k|        switch ( state )
 4471|   204k|        {
 4472|   158k|            case STATE_INITIAL:
  ------------------
  |  Branch (4472:13): [True: 158k, False: 46.0k]
  ------------------
 4473|   158k|            {
 4474|   158k|                if ( node == NULL )
  ------------------
  |  Branch (4474:22): [True: 7.28k, False: 150k]
  ------------------
 4475|  7.28k|                {
 4476|  7.28k|                    state = STATE_COMPLETE;
 4477|  7.28k|                    continue;
 4478|  7.28k|                }
 4479|       |                
 4480|   150k|                if ( node->type == EndTag &&
  ------------------
  |  Branch (4480:22): [True: 3.71k, False: 147k]
  ------------------
 4481|  3.71k|                     (node->tag == pre->tag || DescendantOf(pre, TagId(node))) )
  ------------------
  |  |  270|  3.30k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 3.30k, False: 0]
  |  |  |  Branch (270:39): [True: 2.91k, False: 394]
  |  |  ------------------
  ------------------
  |  Branch (4481:23): [True: 409, False: 3.30k]
  |  Branch (4481:48): [True: 1.28k, False: 2.01k]
  ------------------
 4482|  1.69k|                {
 4483|  1.69k|                    if (nodeIsBODY(node) || nodeIsHTML(node))
  ------------------
  |  |  375|  1.69k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  3.39k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.69k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.69k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 207, False: 1.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if (nodeIsBODY(node) || nodeIsHTML(node))
  ------------------
  |  |  370|  1.49k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  1.49k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.49k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.49k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 293, False: 1.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4484|    500|                    {
 4485|    500|                        TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    500|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    500|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4486|    500|                        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    500|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    500|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4487|    500|                        continue;
 4488|    500|                    }
 4489|  1.19k|                    if (node->tag == pre->tag)
  ------------------
  |  Branch (4489:25): [True: 409, False: 789]
  ------------------
 4490|    409|                    {
 4491|    409|                        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    409|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    409|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4492|    409|                    }
 4493|    789|                    else
 4494|    789|                    {
 4495|    789|                        TY_(Report)(doc, pre, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|    789|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    789|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4496|    789|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    789|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    789|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4497|    789|                    }
 4498|  1.19k|                    pre->closed = yes;
 4499|  1.19k|                    TrimSpaces(doc, pre);
 4500|  1.19k|                    DEBUG_LOG_EXIT;
 4501|  1.19k|                    return NULL;
 4502|  1.69k|                }
 4503|       |
 4504|   149k|                if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|   149k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   149k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4504:21): [True: 12.9k, False: 136k]
  ------------------
 4505|  12.9k|                {
 4506|  12.9k|                    TY_(InsertNodeAtEnd)(pre, node);
  ------------------
  |  |   23|  12.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4507|  12.9k|                    continue;
 4508|  12.9k|                }
 4509|       |
 4510|       |                /* deal with comments etc. */
 4511|   136k|                if (InsertMisc(pre, node))
  ------------------
  |  Branch (4511:21): [True: 355, False: 136k]
  ------------------
 4512|    355|                    continue;
 4513|       |
 4514|   136k|                if (node->tag == NULL)
  ------------------
  |  Branch (4514:21): [True: 15.2k, False: 120k]
  ------------------
 4515|  15.2k|                {
 4516|  15.2k|                    TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  15.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4517|  15.2k|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  15.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4518|  15.2k|                    continue;
 4519|  15.2k|                }
 4520|       |
 4521|       |                /* strip unexpected tags */
 4522|   120k|                if ( !PreContent(doc, node) )
  ------------------
  |  Branch (4522:22): [True: 112k, False: 8.75k]
  ------------------
 4523|   112k|                {
 4524|       |                    /* fix for http://tidy.sf.net/bug/772205 */
 4525|   112k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4525:25): [True: 1.20k, False: 110k]
  ------------------
 4526|  1.20k|                    {
 4527|       |                        /* http://tidy.sf.net/issue/1590220 */
 4528|  1.20k|                       if ( doc->lexer->exiled
  ------------------
  |  Branch (4528:29): [True: 855, False: 350]
  ------------------
 4529|    855|                           && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |   23|    855|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    855|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                         && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  146|    855|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                         && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  393|    608|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|    608|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 608, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 608, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 216, False: 392]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4529:32): [True: 247, False: 608]
  ------------------
 4530|    463|                       {
 4531|    463|                          TY_(UngetToken)(doc);
  ------------------
  |  |   23|    463|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    463|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4532|    463|                          TrimSpaces(doc, pre);
 4533|    463|                           DEBUG_LOG_EXIT;
 4534|    463|                          return NULL;
 4535|    463|                       }
 4536|       |
 4537|    742|                       TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    742|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    742|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4538|    742|                       TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    742|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    742|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4539|    742|                       continue;
 4540|  1.20k|                    }
 4541|       |                    /* http://tidy.sf.net/issue/1590220 */
 4542|   110k|                    else if (TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)
  ------------------
  |  |   23|   110k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   110k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  else if (TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)
  ------------------
  |  |  146|   110k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                  else if (TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)
  ------------------
  |  |  148|   110k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (4542:30): [True: 2.01k, False: 108k]
  ------------------
 4543|   108k|                             || nodeIsTABLE(node) )
  ------------------
  |  |  393|   108k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|   108k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 108k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 108k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 35.2k, False: 73.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4544|  37.2k|                    {
 4545|  37.2k|                        if (!doc->lexer->exiled)
  ------------------
  |  Branch (4545:29): [True: 35.5k, False: 1.72k]
  ------------------
 4546|       |                            /* No missing close warning if exiled. */
 4547|  35.5k|                            TY_(Report)(doc, pre, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  35.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4548|       |
 4549|  37.2k|                        TY_(UngetToken)(doc);
  ------------------
  |  |   23|  37.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4550|  37.2k|                        DEBUG_LOG_EXIT;
 4551|  37.2k|                        return NULL;
 4552|  37.2k|                    }
 4553|       |
 4554|       |                    /*
 4555|       |                      This is basically what Tidy 04 August 2000 did and far more accurate
 4556|       |                      with respect to browser behaivour than the code commented out above.
 4557|       |                      Tidy could try to propagate the <pre> into each disallowed child where
 4558|       |                      <pre> is allowed in order to replicate some browsers behaivour, but
 4559|       |                      there are a lot of exceptions, e.g. Internet Explorer does not propagate
 4560|       |                      <pre> into table cells while Mozilla does. Opera 6 never propagates
 4561|       |                      <pre> into blocklevel elements while Opera 7 behaves much like Mozilla.
 4562|       |
 4563|       |                      Tidy behaves thus mostly like Opera 6 except for nested <pre> elements
 4564|       |                      which are handled like Mozilla takes them (Opera6 closes all <pre> after
 4565|       |                      the first </pre>).
 4566|       |
 4567|       |                      There are similar issues like replacing <p> in <pre> with <br>, for
 4568|       |                      example
 4569|       |
 4570|       |                        <pre>...<p>...</pre>                 (Input)
 4571|       |                        <pre>...<br>...</pre>                (Tidy)
 4572|       |                        <pre>...<br>...</pre>                (Opera 7 and Internet Explorer)
 4573|       |                        <pre>...<br><br>...</pre>            (Opera 6 and Mozilla)
 4574|       |
 4575|       |                        <pre>...<p>...</p>...</pre>          (Input)
 4576|       |                        <pre>...<br>......</pre>             (Tidy, BUG!)
 4577|       |                        <pre>...<br>...<br>...</pre>         (Internet Explorer)
 4578|       |                        <pre>...<br><br>...<br><br>...</pre> (Mozilla, Opera 6)
 4579|       |                        <pre>...<br>...<br><br>...</pre>     (Opera 7)
 4580|       |
 4581|       |                      or something similar, they could also be closing the <pre> and propagate
 4582|       |                      the <pre> into the newly opened <p>.
 4583|       |
 4584|       |                      Todo: IMG, OBJECT, APPLET, BIG, SMALL, SUB, SUP, FONT, and BASEFONT are
 4585|       |                      disallowed in <pre>, Tidy neither detects this nor does it perform any
 4586|       |                      cleanup operation. Tidy should at least issue a warning if it encounters
 4587|       |                      such constructs.
 4588|       |
 4589|       |                      Todo: discarding </p> is abviously a bug, it should be replaced by <br>.
 4590|       |                    */
 4591|  73.5k|                    TY_(InsertNodeAfterElement)(pre, node);
  ------------------
  |  |   23|  73.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4592|  73.5k|                    TY_(Report)(doc, pre, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  73.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4593|       |                    
 4594|  73.5k|                    {
 4595|  73.5k|                        TidyParserMemory memory = {0};
 4596|  73.5k|                        memory.identity = TY_(ParsePre);
  ------------------
  |  |   23|  73.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4597|  73.5k|                        memory.original_node = pre;
 4598|  73.5k|                        memory.reentry_node = node;
 4599|  73.5k|                        memory.reentry_state = STATE_RENTRY_ACTION;
 4600|  73.5k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  73.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4601|  73.5k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 4602|  73.5k|                        return node;
 4603|   112k|                    }
 4604|   112k|                }
 4605|       |
 4606|  8.75k|                if ( nodeIsP(node) )
  ------------------
  |  |  385|  8.75k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  8.75k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.75k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.75k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.09k, False: 3.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4607|  5.09k|                {
 4608|  5.09k|                    if (node->type == StartTag)
  ------------------
  |  Branch (4608:25): [True: 4.90k, False: 194]
  ------------------
 4609|  4.90k|                    {
 4610|  4.90k|                        TY_(Report)(doc, pre, node, USING_BR_INPLACE_OF);
  ------------------
  |  |   23|  4.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4611|       |
 4612|       |                        /* trim white space before <p> in <pre>*/
 4613|  4.90k|                        TrimSpaces(doc, pre);
 4614|       |
 4615|       |                        /* coerce both <p> and </p> to <br> */
 4616|  4.90k|                        TY_(CoerceNode)(doc, node, TidyTag_BR, no, no);
  ------------------
  |  |   23|  4.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4617|  4.90k|                        TY_(FreeAttrs)( doc, node ); /* discard align attribute etc. */
  ------------------
  |  |   23|  4.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4618|  4.90k|                        TY_(InsertNodeAtEnd)( pre, node );
  ------------------
  |  |   23|  4.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4619|  4.90k|                    }
 4620|    194|                    else
 4621|    194|                    {
 4622|    194|                        TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4623|    194|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4624|    194|                    }
 4625|  5.09k|                    continue;
 4626|  5.09k|                }
 4627|       |
 4628|  3.66k|                if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  3.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4628:22): [True: 3.43k, False: 224]
  ------------------
 4629|  3.43k|                {
 4630|       |                    /* trim white space before <br> */
 4631|  3.43k|                    if ( nodeIsBR(node) )
  ------------------
  |  |  400|  3.43k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  3.43k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.43k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.43k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 226, False: 3.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4632|    226|                        TrimSpaces(doc, pre);
 4633|       |
 4634|  3.43k|                    TY_(InsertNodeAtEnd)(pre, node);
  ------------------
  |  |   23|  3.43k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.43k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4635|       |                    
 4636|  3.43k|                    {
 4637|  3.43k|                        TidyParserMemory memory = {0};
 4638|  3.43k|                        memory.identity = TY_(ParsePre);
  ------------------
  |  |   23|  3.43k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.43k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4639|  3.43k|                        memory.original_node = pre;
 4640|  3.43k|                        memory.reentry_node = node;
 4641|  3.43k|                        memory.reentry_state = STATE_INITIAL;
 4642|  3.43k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  3.43k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.43k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4643|  3.43k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 4644|  3.43k|                        return node;
 4645|  3.43k|                    }
 4646|  3.43k|                }
 4647|       |
 4648|       |                /* discard unexpected tags */
 4649|    224|                TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    224|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    224|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4650|    224|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    224|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    224|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4651|    224|            } break;
 4652|       |                
 4653|  46.0k|            case STATE_RENTRY_ACTION:
  ------------------
  |  Branch (4653:13): [True: 46.0k, False: 158k]
  ------------------
 4654|  46.0k|            {
 4655|  46.0k|                Node* newnode = TY_(InferredTag)(doc, TidyTag_PRE);
  ------------------
  |  |   23|  46.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4656|  46.0k|                TY_(Report)(doc, pre, newnode, INSERTING_TAG);
  ------------------
  |  |   23|  46.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4657|  46.0k|                pre = newnode;
 4658|  46.0k|                TY_(InsertNodeAfterElement)(node, pre);
  ------------------
  |  |   23|  46.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4659|  46.0k|                state = STATE_INITIAL;
 4660|  46.0k|                continue;
 4661|  3.66k|            } break;
 4662|       |            
 4663|      0|            default:
  ------------------
  |  Branch (4663:13): [True: 0, False: 204k]
  ------------------
 4664|      0|                break;
 4665|       |
 4666|   204k|        } /* switch */
 4667|   204k|    } /* while */
 4668|       |
 4669|  7.28k|    TY_(Report)(doc, pre, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  7.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4670|  7.28k|    DEBUG_LOG_EXIT;
 4671|       |    return NULL;
 4672|   123k|}
prvTidyParseRow:
 4684|  40.9k|{
 4685|  40.9k|    Lexer* lexer = doc->lexer;
 4686|  40.9k|    Node *node = NULL;
 4687|  40.9k|    Bool exclude_state = no;
 4688|  40.9k|    DEBUG_LOG_COUNTERS;
 4689|       |
 4690|  40.9k|    enum parserState {
 4691|  40.9k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4692|  40.9k|        STATE_POST_NOT_ENDTAG,        /* To-do after re-entering after !EndTag checks. */
 4693|  40.9k|        STATE_POST_TD_TH,             /* To-do after re-entering after TD/TH checks. */
 4694|  40.9k|        STATE_COMPLETE,               /* Done with the switch. */
 4695|  40.9k|    } state = STATE_INITIAL;
 4696|       |
 4697|  40.9k|    if ( row == NULL )
  ------------------
  |  Branch (4697:10): [True: 16.7k, False: 24.1k]
  ------------------
 4698|  16.7k|    {
 4699|  16.7k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  16.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4700|  16.7k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4701|  16.7k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4702|  16.7k|        row = memory.original_node;
 4703|  16.7k|        state = memory.reentry_state;
 4704|  16.7k|        exclude_state = memory.register_1;
 4705|  16.7k|        DEBUG_LOG_GET_OLD_MODE;
 4706|  16.7k|        mode = memory.mode;
 4707|  16.7k|        DEBUG_LOG_CHANGE_MODE;
 4708|  16.7k|    }
 4709|  24.1k|    else
 4710|  24.1k|    {
 4711|  24.1k|        DEBUG_LOG_ENTER_WITH_NODE(row);
 4712|       |
 4713|  24.1k|        if (row->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  24.1k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (4713:13): [True: 0, False: 24.1k]
  ------------------
 4714|      0|            return NULL;
 4715|  24.1k|    }
 4716|       |
 4717|  79.5k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4717:13): [True: 69.1k, False: 10.4k]
  ------------------
 4718|  69.1k|    {
 4719|  69.1k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4719:14): [True: 52.4k, False: 16.7k]
  ------------------
 4720|  52.4k|        {
 4721|  52.4k|            node = TY_(GetToken)( doc, IgnoreWhitespace );
  ------------------
  |  |   23|  52.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  52.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4722|  52.4k|            DEBUG_LOG_GOT_TOKEN(node);
 4723|  52.4k|        }
 4724|       |    
 4725|  69.1k|        switch (state)
 4726|  69.1k|        {
 4727|  52.4k|            case STATE_INITIAL:
  ------------------
  |  Branch (4727:13): [True: 52.4k, False: 16.7k]
  ------------------
 4728|  52.4k|            {
 4729|  52.4k|                if ( node == NULL)
  ------------------
  |  Branch (4729:22): [True: 10.4k, False: 42.0k]
  ------------------
 4730|  10.4k|                {
 4731|  10.4k|                    state = STATE_COMPLETE;
 4732|  10.4k|                    continue;
 4733|  10.4k|                }
 4734|       |                
 4735|  42.0k|                if (node->tag == row->tag)
  ------------------
  |  Branch (4735:21): [True: 3.16k, False: 38.8k]
  ------------------
 4736|  3.16k|                {
 4737|  3.16k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4737:25): [True: 456, False: 2.70k]
  ------------------
 4738|    456|                    {
 4739|    456|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    456|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    456|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4740|    456|                        row->closed = yes;
 4741|    456|                        FixEmptyRow( doc, row);
 4742|    456|                        DEBUG_LOG_EXIT;
 4743|    456|                        return NULL;
 4744|    456|                    }
 4745|       |
 4746|       |                    /* New row start implies end of current row */
 4747|  2.70k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.70k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.70k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4748|  2.70k|                    FixEmptyRow( doc, row);
 4749|  2.70k|                    DEBUG_LOG_EXIT;
 4750|  2.70k|                    return NULL;
 4751|  3.16k|                }
 4752|       |
 4753|       |                /*
 4754|       |                  if this is the end tag for an ancestor element
 4755|       |                  then infer end tag for this element
 4756|       |                */
 4757|  38.8k|                if ( node->type == EndTag )
  ------------------
  |  Branch (4757:22): [True: 3.13k, False: 35.7k]
  ------------------
 4758|  3.13k|                {
 4759|  3.13k|                    if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |   23|  3.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |  140|  3.13k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
                                  if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |  146|  3.13k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                  if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |  393|  2.51k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  2.51k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.51k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.96k, False: 550]
  |  |  |  |  |  Branch (275:54): [True: 200, False: 1.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4759:27): [True: 617, False: 2.51k]
  ------------------
 4760|    817|                         && DescendantOf(row, TagId(node)) )
  ------------------
  |  |  270|    817|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 817, False: 0]
  |  |  |  Branch (270:39): [True: 817, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (4760:29): [True: 303, False: 514]
  ------------------
 4761|    303|                    {
 4762|    303|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    303|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    303|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4763|    303|                        DEBUG_LOG_EXIT;
 4764|    303|                        return NULL;
 4765|    303|                    }
 4766|       |
 4767|  2.83k|                    if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  424|  2.83k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  5.66k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.83k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.28k, False: 550]
  |  |  |  |  |  Branch (275:54): [True: 204, False: 2.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  2.62k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.62k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  2.62k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  2.62k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (4767:46): [True: 567, False: 2.06k]
  ------------------
 4768|    771|                    {
 4769|    771|                        if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    771|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    771|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 771, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 771, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 204, False: 567]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4770|    204|                            BadForm( doc );
 4771|       |
 4772|    771|                        TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    771|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    771|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4773|    771|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    771|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    771|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4774|    771|                        continue;
 4775|    771|                    }
 4776|       |
 4777|  2.06k|                    if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  395|  2.06k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  4.12k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.06k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.51k, False: 550]
  |  |  |  |  |  Branch (275:54): [True: 448, False: 1.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  396|  1.61k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  1.61k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.61k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.06k, False: 550]
  |  |  |  |  |  Branch (275:54): [True: 198, False: 864]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4778|    646|                    {
 4779|    646|                        TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    646|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    646|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4780|    646|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    646|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    646|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4781|    646|                        continue;
 4782|    646|                    }
 4783|  2.06k|                }
 4784|       |
 4785|       |                /* deal with comments etc. */
 4786|  37.1k|                if (InsertMisc(row, node))
  ------------------
  |  Branch (4786:21): [True: 918, False: 36.2k]
  ------------------
 4787|    918|                    continue;
 4788|       |
 4789|       |                /* discard unknown tags */
 4790|  36.2k|                if (node->tag == NULL && node->type != TextNode)
  ------------------
  |  Branch (4790:21): [True: 4.21k, False: 32.0k]
  |  Branch (4790:42): [True: 2.22k, False: 1.98k]
  ------------------
 4791|  2.22k|                {
 4792|  2.22k|                    TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4793|  2.22k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4794|  2.22k|                    continue;
 4795|  2.22k|                }
 4796|       |
 4797|       |                /* discard unexpected <table> element */
 4798|  34.0k|                if ( nodeIsTABLE(node) )
  ------------------
  |  |  393|  34.0k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  34.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 34.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 32.0k, False: 1.98k]
  |  |  |  |  |  Branch (275:54): [True: 246, False: 31.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4799|    246|                {
 4800|    246|                    TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    246|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    246|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4801|    246|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    246|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    246|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4802|    246|                    continue;
 4803|    246|                }
 4804|       |
 4805|       |                /* THEAD, TFOOT or TBODY */
 4806|  33.7k|                if ( TY_(nodeHasCM)(node, CM_ROWGRP) )
  ------------------
  |  |   23|  33.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  33.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_ROWGRP) )
  ------------------
  |  |  147|  33.7k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
  |  Branch (4806:22): [True: 1.06k, False: 32.7k]
  ------------------
 4807|  1.06k|                {
 4808|  1.06k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4809|  1.06k|                    DEBUG_LOG_EXIT;
 4810|  1.06k|                    return NULL;
 4811|  1.06k|                }
 4812|       |
 4813|  32.7k|                if (node->type == EndTag)
  ------------------
  |  Branch (4813:21): [True: 864, False: 31.8k]
  ------------------
 4814|    864|                {
 4815|    864|                    TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    864|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    864|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4816|    864|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    864|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    864|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4817|    864|                    continue;
 4818|    864|                }
 4819|       |
 4820|       |                /*
 4821|       |                  if text or inline or block move before table
 4822|       |                  if head content move to head
 4823|       |                */
 4824|       |
 4825|  31.8k|                if (node->type != EndTag)
  ------------------
  |  Branch (4825:21): [True: 31.8k, False: 0]
  ------------------
 4826|  31.8k|                {
 4827|  31.8k|                    if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  31.8k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  31.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 31.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 29.8k, False: 1.98k]
  |  |  |  |  |  Branch (275:54): [True: 6.23k, False: 23.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4828|  6.23k|                    {
 4829|  6.23k|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  6.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4830|  6.23k|                        node = TY_(InferredTag)(doc, TidyTag_TD);
  ------------------
  |  |   23|  6.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4831|  6.23k|                        TY_(Report)(doc, row, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  6.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4832|  6.23k|                    }
 4833|  25.6k|                    else if ( TY_(nodeIsText)(node)
  ------------------
  |  |   23|  25.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  25.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4833:31): [True: 1.98k, False: 23.6k]
  ------------------
 4834|  23.6k|                              || TY_(nodeHasCM)(node, CM_BLOCK | CM_INLINE) )
  ------------------
  |  |   23|  23.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK | CM_INLINE) )
  ------------------
  |  |  142|  23.6k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK | CM_INLINE) )
  ------------------
  |  |  143|  23.6k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (4834:34): [True: 6.46k, False: 17.1k]
  ------------------
 4835|  8.45k|                    {
 4836|  8.45k|                        MoveBeforeTable( doc, row, node );
 4837|  8.45k|                        TY_(Report)(doc, row, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  8.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4838|  8.45k|                        lexer->exiled = yes;
 4839|  8.45k|                        exclude_state = lexer->excludeBlocks;
 4840|  8.45k|                        lexer->excludeBlocks = no;
 4841|       |
 4842|  8.45k|                        if (node->type != TextNode)
  ------------------
  |  Branch (4842:29): [True: 6.46k, False: 1.98k]
  ------------------
 4843|  6.46k|                        {
 4844|  6.46k|                            TidyParserMemory memory = {0};
 4845|  6.46k|                            memory.identity = TY_(ParseRow);
  ------------------
  |  |   23|  6.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4846|  6.46k|                            memory.original_node = row;
 4847|  6.46k|                            memory.reentry_node = node;
 4848|  6.46k|                            memory.reentry_state = STATE_POST_NOT_ENDTAG;
 4849|  6.46k|                            memory.register_1 = exclude_state;
 4850|  6.46k|                            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  6.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4851|  6.46k|                            DEBUG_LOG_EXIT_WITH_NODE(node);
 4852|  6.46k|                            return node;
 4853|  6.46k|                        }
 4854|       |                        
 4855|  1.98k|                        lexer->exiled = no;
 4856|  1.98k|                        lexer->excludeBlocks = exclude_state;
 4857|  1.98k|                        continue;
 4858|  8.45k|                    }
 4859|  17.1k|                    else if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  17.1k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (4859:30): [True: 234, False: 16.9k]
  ------------------
 4860|    234|                    {
 4861|    234|                        TY_(Report)(doc, row, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|    234|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    234|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4862|    234|                        MoveToHead( doc, row, node);
 4863|    234|                        continue;
 4864|    234|                    }
 4865|  31.8k|                }
 4866|       |
 4867|  23.1k|                if ( !(nodeIsTD(node) || nodeIsTH(node)) )
  ------------------
  |  |  395|  23.1k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  46.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 23.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 23.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 8.17k, False: 14.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !(nodeIsTD(node) || nodeIsTH(node)) )
  ------------------
  |  |  396|  14.9k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  14.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 14.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 14.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 11.3k, False: 3.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4868|  3.62k|                {
 4869|  3.62k|                    TY_(Report)(doc, row, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  3.62k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.62k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4870|  3.62k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  3.62k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.62k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4871|  3.62k|                    continue;
 4872|  3.62k|                }
 4873|       |
 4874|       |                /* node should be <TD> or <TH> */
 4875|  19.5k|                TY_(InsertNodeAtEnd)(row, node);
  ------------------
  |  |   23|  19.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4876|  19.5k|                exclude_state = lexer->excludeBlocks;
 4877|  19.5k|                lexer->excludeBlocks = no;
 4878|  19.5k|                {
 4879|  19.5k|                    TidyParserMemory memory = {0};
 4880|  19.5k|                    memory.identity = TY_(ParseRow);
  ------------------
  |  |   23|  19.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4881|  19.5k|                    memory.original_node = row;
 4882|  19.5k|                    memory.reentry_node = node;
 4883|  19.5k|                    memory.reentry_state = STATE_POST_TD_TH;
 4884|  19.5k|                    memory.register_1 = exclude_state;
 4885|  19.5k|                    TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  19.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4886|  19.5k|                    DEBUG_LOG_EXIT_WITH_NODE(node);
 4887|  19.5k|                    return node;
 4888|  23.1k|                }
 4889|  23.1k|            } break;
 4890|       |                
 4891|       |                
 4892|  6.43k|            case STATE_POST_NOT_ENDTAG:
  ------------------
  |  Branch (4892:13): [True: 6.43k, False: 62.7k]
  ------------------
 4893|  6.43k|            {
 4894|  6.43k|                lexer->exiled = no;
 4895|  6.43k|                lexer->excludeBlocks = exclude_state; /* capture this in stack. */
 4896|  6.43k|                state = STATE_INITIAL;
 4897|  6.43k|                continue;
 4898|  23.1k|            } break;
 4899|       |                
 4900|       |                
 4901|  10.3k|            case STATE_POST_TD_TH:
  ------------------
  |  Branch (4901:13): [True: 10.3k, False: 58.8k]
  ------------------
 4902|  10.3k|            {
 4903|  10.3k|                lexer->excludeBlocks = exclude_state; /* capture this in stack. */
 4904|       |
 4905|       |                /* pop inline stack */
 4906|  15.1k|                while ( lexer->istacksize > lexer->istackbase )
  ------------------
  |  Branch (4906:25): [True: 4.82k, False: 10.3k]
  ------------------
 4907|  4.82k|                    TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|  4.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4908|       |                
 4909|  10.3k|                state = STATE_INITIAL;
 4910|  10.3k|                continue;
 4911|  23.1k|            } break;
 4912|       |                
 4913|       |                
 4914|      0|            default:
  ------------------
  |  Branch (4914:13): [True: 0, False: 69.1k]
  ------------------
 4915|      0|                break;
 4916|       |                
 4917|  69.1k|        } /* switch */
 4918|  69.1k|    } /* while */
 4919|  10.4k|    DEBUG_LOG_EXIT;
 4920|       |    return NULL;
 4921|  40.9k|}
prvTidyParseRowGroup:
 4933|  19.3k|{
 4934|  19.3k|    Lexer* lexer = doc->lexer;
 4935|  19.3k|    Node *node = NULL;
 4936|  19.3k|    Node *parent = NULL;
 4937|  19.3k|    DEBUG_LOG_COUNTERS;
 4938|       |
 4939|  19.3k|    enum parserState {
 4940|  19.3k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4941|  19.3k|        STATE_POST_NOT_TEXTNODE,      /* To-do after re-entering after checks. */
 4942|  19.3k|        STATE_COMPLETE,               /* Done with the switch. */
 4943|  19.3k|    } state = STATE_INITIAL;
 4944|       |
 4945|  19.3k|    if ( rowgroup == NULL )
  ------------------
  |  Branch (4945:10): [True: 6.94k, False: 12.3k]
  ------------------
 4946|  6.94k|    {
 4947|  6.94k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  6.94k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.94k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4948|  6.94k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4949|  6.94k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4950|  6.94k|        rowgroup = memory.original_node;
 4951|  6.94k|        state = memory.reentry_state;
 4952|  6.94k|        DEBUG_LOG_GET_OLD_MODE;
 4953|  6.94k|        mode = memory.mode;
 4954|  6.94k|        DEBUG_LOG_CHANGE_MODE;
 4955|  6.94k|    }
 4956|  12.3k|    else
 4957|  12.3k|    {
 4958|  12.3k|        DEBUG_LOG_ENTER_WITH_NODE(rowgroup);
 4959|  12.3k|        if (rowgroup->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  12.3k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (4959:13): [True: 0, False: 12.3k]
  ------------------
 4960|      0|        {
 4961|      0|            DEBUG_LOG_EXIT;
 4962|      0|            return NULL;
 4963|      0|        }
 4964|  12.3k|    }
 4965|       |
 4966|   259k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4966:13): [True: 256k, False: 2.91k]
  ------------------
 4967|   256k|    {
 4968|   256k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4968:14): [True: 173k, False: 82.7k]
  ------------------
 4969|   173k|            node = TY_(GetToken)(doc, IgnoreWhitespace);
  ------------------
  |  |   23|   173k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   173k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4970|       |        
 4971|   256k|        switch (state)
 4972|   256k|        {
 4973|   173k|            case STATE_INITIAL:
  ------------------
  |  Branch (4973:13): [True: 173k, False: 82.7k]
  ------------------
 4974|   173k|            {
 4975|   173k|                TidyParserMemory memory = {0};
 4976|       |
 4977|   173k|                if (node == NULL)
  ------------------
  |  Branch (4977:21): [True: 2.91k, False: 170k]
  ------------------
 4978|  2.91k|                {
 4979|  2.91k|                    state = STATE_COMPLETE;
 4980|  2.91k|                    continue;
 4981|  2.91k|                }
 4982|       |                
 4983|   170k|                if (node->tag == rowgroup->tag)
  ------------------
  |  Branch (4983:21): [True: 8.35k, False: 162k]
  ------------------
 4984|  8.35k|                {
 4985|  8.35k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4985:25): [True: 270, False: 8.08k]
  ------------------
 4986|    270|                    {
 4987|    270|                        rowgroup->closed = yes;
 4988|    270|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    270|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    270|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4989|    270|                        DEBUG_LOG_EXIT;
 4990|    270|                        return NULL;
 4991|    270|                    }
 4992|       |
 4993|  8.08k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  8.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4994|  8.08k|                    DEBUG_LOG_EXIT;
 4995|  8.08k|                    return NULL;
 4996|  8.35k|                }
 4997|       |
 4998|       |                /* if </table> infer end tag */
 4999|   162k|                if ( nodeIsTABLE(node) && node->type == EndTag )
  ------------------
  |  |  393|   162k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|   324k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 162k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.9k, False: 151k]
  |  |  |  |  |  Branch (275:54): [True: 357, False: 10.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4999:43): [True: 72, False: 285]
  ------------------
 5000|     72|                {
 5001|     72|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|     72|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     72|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5002|     72|                    DEBUG_LOG_EXIT;
 5003|     72|                    return NULL;
 5004|     72|                }
 5005|       |
 5006|       |                /* deal with comments etc. */
 5007|   162k|                if (InsertMisc(rowgroup, node))
  ------------------
  |  Branch (5007:21): [True: 70.7k, False: 91.4k]
  ------------------
 5008|  70.7k|                    continue;
 5009|       |
 5010|       |                /* discard unknown tags */
 5011|  91.4k|                if (node->tag == NULL && node->type != TextNode)
  ------------------
  |  Branch (5011:21): [True: 80.5k, False: 10.8k]
  |  Branch (5011:42): [True: 2.71k, False: 77.8k]
  ------------------
 5012|  2.71k|                {
 5013|  2.71k|                    TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5014|  2.71k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5015|  2.71k|                    continue;
 5016|  2.71k|                }
 5017|       |
 5018|       |                /*
 5019|       |                  if TD or TH then infer <TR>
 5020|       |                  if text or inline or block move before table
 5021|       |                  if head content move to head
 5022|       |                */
 5023|       |
 5024|  88.6k|                if (node->type != EndTag)
  ------------------
  |  Branch (5024:21): [True: 85.7k, False: 2.89k]
  ------------------
 5025|  85.7k|                {
 5026|  85.7k|                    if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  395|  85.7k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|   171k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 85.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 7.98k, False: 77.8k]
  |  |  |  |  |  Branch (275:54): [True: 371, False: 7.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  396|  85.4k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  85.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 85.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 7.61k, False: 77.8k]
  |  |  |  |  |  Branch (275:54): [True: 106, False: 7.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5027|    477|                    {
 5028|    477|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    477|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    477|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5029|    477|                        node = TY_(InferredTag)(doc, TidyTag_TR);
  ------------------
  |  |   23|    477|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    477|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5030|    477|                        TY_(Report)(doc, rowgroup, node, MISSING_STARTTAG);
  ------------------
  |  |   23|    477|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    477|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5031|    477|                    }
 5032|  85.3k|                    else if ( TY_(nodeIsText)(node)
  ------------------
  |  |   23|  85.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  85.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5032:31): [True: 77.8k, False: 7.50k]
  ------------------
 5033|  7.50k|                              || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  7.50k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.50k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  7.50k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  7.50k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5033:34): [True: 4.89k, False: 2.61k]
  ------------------
 5034|  82.7k|                    {
 5035|  82.7k|                        MoveBeforeTable( doc, rowgroup, node );
 5036|  82.7k|                        TY_(Report)(doc, rowgroup, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  82.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  82.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5037|  82.7k|                        lexer->exiled = yes;
 5038|       |
 5039|  82.7k|                        if (node->type != TextNode)
  ------------------
  |  Branch (5039:29): [True: 4.89k, False: 77.8k]
  ------------------
 5040|  4.89k|                        {
 5041|  4.89k|                            memory.identity = TY_(ParseRowGroup);
  ------------------
  |  |   23|  4.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5042|  4.89k|                            memory.original_node = rowgroup;
 5043|  4.89k|                            memory.reentry_node = node;
 5044|  4.89k|                            memory.reentry_state = STATE_POST_NOT_TEXTNODE;
 5045|  4.89k|                            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  4.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5046|  4.89k|                            DEBUG_LOG_EXIT_WITH_NODE(node);
 5047|  4.89k|                            return node;
 5048|  4.89k|                        }
 5049|       |                        
 5050|  77.8k|                        state = STATE_POST_NOT_TEXTNODE;
 5051|  77.8k|                        continue;
 5052|  82.7k|                    }
 5053|  2.61k|                    else if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  2.61k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (5053:30): [True: 221, False: 2.39k]
  ------------------
 5054|    221|                    {
 5055|    221|                        TY_(Report)(doc, rowgroup, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|    221|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    221|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5056|    221|                        MoveToHead(doc, rowgroup, node);
 5057|    221|                        continue;
 5058|    221|                    }
 5059|  85.7k|                }
 5060|       |
 5061|       |                /*
 5062|       |                  if this is the end tag for ancestor element
 5063|       |                  then infer end tag for this element
 5064|       |                */
 5065|  5.76k|                if (node->type == EndTag)
  ------------------
  |  Branch (5065:21): [True: 2.89k, False: 2.87k]
  ------------------
 5066|  2.89k|                {
 5067|  2.89k|                    if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  424|  2.89k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  5.78k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.89k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.89k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 195, False: 2.69k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  2.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  2.69k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  2.69k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5067:46): [True: 302, False: 2.39k]
  ------------------
 5068|    497|                    {
 5069|    497|                        if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    497|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    497|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 497, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 497, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 195, False: 302]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5070|    195|                            BadForm( doc );
 5071|       |
 5072|    497|                        TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    497|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    497|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5073|    497|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    497|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    497|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5074|    497|                        continue;
 5075|    497|                    }
 5076|       |
 5077|  2.39k|                    if ( nodeIsTR(node) || nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  397|  2.39k|#define nodeIsTR( node )         TagIsId( node, TidyTag_TR )
  |  |  ------------------
  |  |  |  |  275|  4.79k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.39k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.39k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 506, False: 1.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTR(node) || nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  395|  1.88k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  4.28k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.88k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.88k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 348, False: 1.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTR(node) || nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  396|  1.54k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  1.54k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.54k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.54k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 198, False: 1.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5078|  1.05k|                    {
 5079|  1.05k|                        TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5080|  1.05k|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5081|  1.05k|                        continue;
 5082|  1.05k|                    }
 5083|       |
 5084|  1.34k|                    for ( parent = rowgroup->parent;
 5085|  5.03k|                          parent != NULL;
  ------------------
  |  Branch (5085:27): [True: 3.90k, False: 1.13k]
  ------------------
 5086|  3.69k|                          parent = parent->parent )
 5087|  3.90k|                    {
 5088|  3.90k|                        if (node->tag == parent->tag)
  ------------------
  |  Branch (5088:29): [True: 212, False: 3.69k]
  ------------------
 5089|    212|                        {
 5090|    212|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    212|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    212|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5091|    212|                            DEBUG_LOG_EXIT;
 5092|    212|                            return NULL;
 5093|    212|                        }
 5094|  3.90k|                    }
 5095|  1.34k|                }
 5096|       |
 5097|       |                /*
 5098|       |                  if THEAD, TFOOT or TBODY then implied end tag
 5099|       |
 5100|       |                */
 5101|  4.00k|                if (node->tag->model & CM_ROWGRP)
  ------------------
  |  |  147|  4.00k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
  |  Branch (5101:21): [True: 1.70k, False: 2.30k]
  ------------------
 5102|  1.70k|                {
 5103|  1.70k|                    if (node->type != EndTag)
  ------------------
  |  Branch (5103:25): [True: 814, False: 886]
  ------------------
 5104|    814|                    {
 5105|    814|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    814|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    814|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5106|    814|                        DEBUG_LOG_EXIT;
 5107|    814|                        return NULL;
 5108|    814|                    }
 5109|  1.70k|                }
 5110|       |
 5111|  3.18k|                if (node->type == EndTag)
  ------------------
  |  Branch (5111:21): [True: 1.13k, False: 2.05k]
  ------------------
 5112|  1.13k|                {
 5113|  1.13k|                    TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5114|  1.13k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5115|  1.13k|                    continue;
 5116|  1.13k|                }
 5117|       |
 5118|  2.05k|                if ( !nodeIsTR(node) )
  ------------------
  |  |  397|  2.05k|#define nodeIsTR( node )         TagIsId( node, TidyTag_TR )
  |  |  ------------------
  |  |  |  |  275|  2.05k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.05k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.05k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.08k, False: 974]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5119|    974|                {
 5120|    974|                    node = TY_(InferredTag)(doc, TidyTag_TR);
  ------------------
  |  |   23|    974|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    974|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5121|    974|                    TY_(Report)(doc, rowgroup, node, MISSING_STARTTAG);
  ------------------
  |  |   23|    974|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    974|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5122|    974|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    974|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    974|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5123|    974|                }
 5124|       |
 5125|       |               /* node should be <TR> */
 5126|  2.05k|                TY_(InsertNodeAtEnd)(rowgroup, node);
  ------------------
  |  |   23|  2.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5127|  2.05k|                memory.identity = TY_(ParseRowGroup);
  ------------------
  |  |   23|  2.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5128|  2.05k|                memory.original_node = rowgroup;
 5129|  2.05k|                memory.reentry_node = node;
 5130|  2.05k|                memory.reentry_state = STATE_INITIAL;
 5131|  2.05k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  2.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5132|  2.05k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 5133|  2.05k|                return node;
 5134|  3.18k|            } break;
 5135|       |                
 5136|       |                
 5137|  82.7k|            case STATE_POST_NOT_TEXTNODE:
  ------------------
  |  Branch (5137:13): [True: 82.7k, False: 173k]
  ------------------
 5138|  82.7k|            {
 5139|  82.7k|                lexer->exiled = no;
 5140|  82.7k|                state = STATE_INITIAL;
 5141|  82.7k|                continue;
 5142|  3.18k|            } break;
 5143|       |
 5144|       |                
 5145|      0|            default:
  ------------------
  |  Branch (5145:13): [True: 0, False: 256k]
  ------------------
 5146|      0|                break;
 5147|   256k|        } /* switch */
 5148|   256k|    } /* while */
 5149|  2.91k|    DEBUG_LOG_EXIT;
 5150|       |    return NULL;
 5151|  19.3k|}
prvTidyParseScript:
 5171|  4.17k|{
 5172|  4.17k|    Node *node = NULL;
 5173|       |#if defined(ENABLE_DEBUG_LOG)
 5174|       |    static int depth_parser = 0;
 5175|       |    static int count_parser = 0;
 5176|       |#endif
 5177|       |    
 5178|  4.17k|    DEBUG_LOG_ENTER_WITH_NODE(script);
 5179|       |    
 5180|  4.17k|    doc->lexer->parent = script;
 5181|  4.17k|    node = TY_(GetToken)(doc, CdataContent);
  ------------------
  |  |   23|  4.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5182|  4.17k|    doc->lexer->parent = NULL;
 5183|       |
 5184|  4.17k|    if (node)
  ------------------
  |  Branch (5184:9): [True: 2.99k, False: 1.18k]
  ------------------
 5185|  2.99k|    {
 5186|  2.99k|        TY_(InsertNodeAtEnd)(script, node);
  ------------------
  |  |   23|  2.99k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.99k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5187|  2.99k|    }
 5188|  1.18k|    else
 5189|  1.18k|    {
 5190|       |        /* handle e.g. a document like "<script>" */
 5191|  1.18k|        TY_(Report)(doc, script, NULL, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  1.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5192|  1.18k|        DEBUG_LOG_EXIT;
 5193|  1.18k|        return NULL;
 5194|  1.18k|    }
 5195|       |
 5196|  2.99k|    node = TY_(GetToken)(doc, IgnoreWhitespace);
  ------------------
  |  |   23|  2.99k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.99k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5197|  2.99k|    DEBUG_LOG_GOT_TOKEN(node);
 5198|       |
 5199|  2.99k|    if (!(node && node->type == EndTag && node->tag &&
  ------------------
  |  Branch (5199:11): [True: 2.35k, False: 644]
  |  Branch (5199:19): [True: 1.97k, False: 374]
  |  Branch (5199:43): [True: 1.57k, False: 405]
  ------------------
 5200|  1.57k|        node->tag->id == script->tag->id))
  ------------------
  |  Branch (5200:9): [True: 1.37k, False: 198]
  ------------------
 5201|  1.62k|    {
 5202|  1.62k|        TY_(Report)(doc, script, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  1.62k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.62k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5203|       |
 5204|  1.62k|        if (node)
  ------------------
  |  Branch (5204:13): [True: 977, False: 644]
  ------------------
 5205|    977|            TY_(UngetToken)(doc);
  ------------------
  |  |   23|    977|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    977|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5206|  1.62k|    }
 5207|  1.37k|    else
 5208|  1.37k|    {
 5209|  1.37k|        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5210|  1.37k|    }
 5211|  2.99k|    DEBUG_LOG_EXIT;
 5212|       |    return NULL;
 5213|  4.17k|}
prvTidyParseSelect:
 5225|  2.46k|{
 5226|  2.46k|    Lexer* lexer = doc->lexer;
 5227|  2.46k|    Node *node;
 5228|  2.46k|    DEBUG_LOG_COUNTERS;
 5229|       |
 5230|  2.46k|    if ( field == NULL )
  ------------------
  |  Branch (5230:10): [True: 1.56k, False: 900]
  ------------------
 5231|  1.56k|    {
 5232|  1.56k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5233|  1.56k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 5234|  1.56k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 5235|  1.56k|        field = memory.original_node;
 5236|  1.56k|        DEBUG_LOG_GET_OLD_MODE;
 5237|  1.56k|        mode = memory.mode;
 5238|  1.56k|        DEBUG_LOG_CHANGE_MODE;
 5239|  1.56k|    }
 5240|    900|    else
 5241|    900|    {
 5242|    900|        DEBUG_LOG_ENTER_WITH_NODE(field);
 5243|    900|    }
 5244|       |    
 5245|  2.46k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 5246|       |
 5247|  5.90k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  5.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5247:12): [True: 5.07k, False: 834]
  ------------------
 5248|  5.07k|    {
 5249|  5.07k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (5249:13): [True: 570, False: 4.50k]
  |  Branch (5249:40): [True: 66, False: 504]
  ------------------
 5250|     66|        {
 5251|     66|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|     66|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     66|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5252|     66|            field->closed = yes;
 5253|     66|            TrimSpaces(doc, field);
 5254|       |
 5255|     66|            DEBUG_LOG_EXIT;
 5256|     66|            return NULL;
 5257|     66|        }
 5258|       |
 5259|       |        /* deal with comments etc. */
 5260|  5.00k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (5260:13): [True: 226, False: 4.78k]
  ------------------
 5261|    226|            continue;
 5262|       |
 5263|  4.78k|        if ( node->type == StartTag &&
  ------------------
  |  Branch (5263:14): [True: 3.79k, False: 989]
  ------------------
 5264|  3.79k|             ( nodeIsOPTION(node)   ||
  ------------------
  |  |  410|  3.79k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  7.58k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.79k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.92k, False: 866]
  |  |  |  |  |  Branch (275:54): [True: 335, False: 2.59k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5265|  3.79k|               nodeIsOPTGROUP(node) ||
  ------------------
  |  |  411|  3.45k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  7.24k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.45k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.59k, False: 866]
  |  |  |  |  |  Branch (275:54): [True: 721, False: 1.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5266|  3.79k|               nodeIsDATALIST(node) ||
  ------------------
  |  |  463|  2.73k|#define nodeIsDATALIST( node )   TagIsId( node, TidyTag_DATALIST )
  |  |  ------------------
  |  |  |  |  275|  6.52k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.73k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.86k, False: 866]
  |  |  |  |  |  Branch (275:54): [True: 262, False: 1.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5267|  3.79k|               nodeIsSCRIPT(node))
  ------------------
  |  |  422|  2.47k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  2.47k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.47k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.60k, False: 866]
  |  |  |  |  |  Branch (275:54): [True: 248, False: 1.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5268|  4.78k|           )
 5269|  1.56k|        {
 5270|  1.56k|            TidyParserMemory memory = {0};
 5271|  1.56k|            memory.identity = TY_(ParseSelect);
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5272|  1.56k|            memory.original_node = field;
 5273|  1.56k|            memory.reentry_node = node;
 5274|       |
 5275|  1.56k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5276|  1.56k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5277|  1.56k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 5278|  1.56k|            return node;
 5279|  1.56k|        }
 5280|       |
 5281|       |        /* discard unexpected tags */
 5282|  3.21k|        TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  3.21k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.21k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5283|  3.21k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  3.21k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.21k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5284|  3.21k|    }
 5285|       |
 5286|    834|    TY_(Report)(doc, field, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|    834|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    834|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5287|       |
 5288|    834|    DEBUG_LOG_EXIT;
 5289|       |    return NULL;
 5290|  2.46k|}
prvTidyParseTableTag:
 5302|  58.9k|{
 5303|  58.9k|    Lexer* lexer = doc->lexer;
 5304|  58.9k|    Node *node, *parent;
 5305|  58.9k|    uint istackbase;
 5306|  58.9k|    DEBUG_LOG_COUNTERS;
 5307|       |
 5308|  58.9k|    if ( table == NULL )
  ------------------
  |  Branch (5308:10): [True: 26.9k, False: 32.0k]
  ------------------
 5309|  26.9k|    {
 5310|  26.9k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  26.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5311|  26.9k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 5312|  26.9k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 5313|  26.9k|        table = memory.original_node;
 5314|  26.9k|        lexer->exiled = memory.register_1;
 5315|  26.9k|        DEBUG_LOG_GET_OLD_MODE;
 5316|  26.9k|        mode = memory.mode;
 5317|  26.9k|        DEBUG_LOG_CHANGE_MODE;
 5318|  26.9k|    }
 5319|  32.0k|    else
 5320|  32.0k|    {
 5321|  32.0k|        DEBUG_LOG_ENTER_WITH_NODE(table);
 5322|  32.0k|        TY_(DeferDup)( doc );
  ------------------
  |  |   23|  32.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5323|  32.0k|    }
 5324|       |
 5325|  58.9k|    istackbase = lexer->istackbase;
 5326|  58.9k|    lexer->istackbase = lexer->istacksize;
 5327|       |
 5328|  63.5k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  63.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  63.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5328:12): [True: 43.3k, False: 20.1k]
  ------------------
 5329|  43.3k|    {
 5330|  43.3k|        DEBUG_LOG_GOT_TOKEN(node);
 5331|  43.3k|        if (node->tag == table->tag )
  ------------------
  |  Branch (5331:13): [True: 1.88k, False: 41.4k]
  ------------------
 5332|  1.88k|        {
 5333|  1.88k|            if (node->type == EndTag)
  ------------------
  |  Branch (5333:17): [True: 267, False: 1.61k]
  ------------------
 5334|    267|            {
 5335|    267|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    267|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    267|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5336|    267|            }
 5337|  1.61k|            else
 5338|  1.61k|            {
 5339|       |                /* Issue #498 - If a <table> in a <table>
 5340|       |                 * just close the current table, and issue a
 5341|       |                 * warning. The previous action was to discard
 5342|       |                 * this second <table>
 5343|       |                 */
 5344|  1.61k|                TY_(UngetToken)(doc);
  ------------------
  |  |   23|  1.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5345|  1.61k|                TY_(Report)(doc, table, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5346|  1.61k|            }
 5347|  1.88k|            lexer->istackbase = istackbase;
 5348|  1.88k|            table->closed = yes;
 5349|       |
 5350|  1.88k|            DEBUG_LOG_EXIT;
 5351|  1.88k|            return NULL;
 5352|  1.88k|        }
 5353|       |
 5354|       |        /* deal with comments etc. */
 5355|  41.4k|        if (InsertMisc(table, node))
  ------------------
  |  Branch (5355:13): [True: 536, False: 40.9k]
  ------------------
 5356|    536|            continue;
 5357|       |
 5358|       |        /* discard unknown tags */
 5359|  40.9k|        if (node->tag == NULL && node->type != TextNode)
  ------------------
  |  Branch (5359:13): [True: 2.92k, False: 38.0k]
  |  Branch (5359:34): [True: 1.08k, False: 1.84k]
  ------------------
 5360|  1.08k|        {
 5361|  1.08k|            TY_(Report)(doc, table, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5362|  1.08k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5363|  1.08k|            continue;
 5364|  1.08k|        }
 5365|       |
 5366|       |        /* if TD or TH or text or inline or block then infer <TR> */
 5367|       |
 5368|  39.8k|        if (node->type != EndTag)
  ------------------
  |  Branch (5368:13): [True: 38.5k, False: 1.31k]
  ------------------
 5369|  38.5k|        {
 5370|  38.5k|            if ( nodeIsTD(node) || nodeIsTH(node) || nodeIsTABLE(node) )
  ------------------
  |  |  395|  38.5k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  77.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 38.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 36.6k, False: 1.84k]
  |  |  |  |  |  Branch (275:54): [True: 469, False: 36.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsTD(node) || nodeIsTH(node) || nodeIsTABLE(node) )
  ------------------
  |  |  396|  38.0k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  76.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 38.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 36.2k, False: 1.84k]
  |  |  |  |  |  Branch (275:54): [True: 10.7k, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsTD(node) || nodeIsTH(node) || nodeIsTABLE(node) )
  ------------------
  |  |  393|  27.3k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  27.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 27.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 25.5k, False: 1.84k]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5371|  11.1k|            {
 5372|  11.1k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  11.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5373|  11.1k|                node = TY_(InferredTag)(doc, TidyTag_TR);
  ------------------
  |  |   23|  11.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5374|  11.1k|                TY_(Report)(doc, table, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  11.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5375|  11.1k|            }
 5376|  27.3k|            else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  27.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  25.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  25.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  25.5k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                          else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  25.5k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5376:23): [True: 1.84k, False: 25.5k]
  |  Branch (5376:47): [True: 1.78k, False: 23.7k]
  ------------------
 5377|  3.63k|            {
 5378|  3.63k|                TY_(InsertNodeBeforeElement)(table, node);
  ------------------
  |  |   23|  3.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5379|  3.63k|                TY_(Report)(doc, table, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  3.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5380|  3.63k|                lexer->exiled = yes;
 5381|       |
 5382|  3.63k|                if (node->type != TextNode)
  ------------------
  |  Branch (5382:21): [True: 1.78k, False: 1.84k]
  ------------------
 5383|  1.78k|                {
 5384|  1.78k|                    TidyParserMemory memory = {0};
 5385|  1.78k|                    memory.identity = TY_(ParseTableTag);
  ------------------
  |  |   23|  1.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5386|  1.78k|                    memory.original_node = table;
 5387|  1.78k|                    memory.reentry_node = node;
 5388|  1.78k|                    memory.register_1 = no; /* later, lexer->exiled = no */
 5389|  1.78k|                    memory.mode = IgnoreWhitespace;
 5390|  1.78k|                    TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5391|  1.78k|                    DEBUG_LOG_EXIT_WITH_NODE(node);
 5392|  1.78k|                    return node;
 5393|  1.78k|                }
 5394|       |
 5395|  1.84k|                lexer->exiled = no;
 5396|  1.84k|                continue;
 5397|  3.63k|            }
 5398|  23.7k|            else if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  23.7k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (5398:22): [True: 354, False: 23.3k]
  ------------------
 5399|    354|            {
 5400|    354|                MoveToHead(doc, table, node);
 5401|    354|                continue;
 5402|    354|            }
 5403|  38.5k|        }
 5404|       |
 5405|       |        /*
 5406|       |          if this is the end tag for an ancestor element
 5407|       |          then infer end tag for this element
 5408|       |        */
 5409|  35.8k|        if (node->type == EndTag)
  ------------------
  |  Branch (5409:13): [True: 1.31k, False: 34.5k]
  ------------------
 5410|  1.31k|        {
 5411|  1.31k|            if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  1.31k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  1.31k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.31k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.31k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 255, False: 1.05k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5412|    255|            {
 5413|    255|                BadForm( doc );
 5414|    255|                TY_(Report)(doc, table, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    255|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    255|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5415|    255|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    255|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    255|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5416|    255|                continue;
 5417|    255|            }
 5418|       |
 5419|       |            /* best to discard unexpected block/inline end tags */
 5420|  1.05k|            if ( TY_(nodeHasCM)(node, CM_TABLE|CM_ROW) ||
  ------------------
  |  |   23|  1.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if ( TY_(nodeHasCM)(node, CM_TABLE|CM_ROW) ||
  ------------------
  |  |  146|  1.05k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                          if ( TY_(nodeHasCM)(node, CM_TABLE|CM_ROW) ||
  ------------------
  |  |  148|  1.05k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (5420:18): [True: 215, False: 841]
  ------------------
 5421|    841|                 TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|    841|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    841|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                               TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|    841|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                               TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|    841|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5421:18): [True: 256, False: 585]
  ------------------
 5422|    471|            {
 5423|    471|                TY_(Report)(doc, table, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    471|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    471|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5424|    471|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    471|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    471|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5425|    471|                continue;
 5426|    471|            }
 5427|       |
 5428|    585|            for ( parent = table->parent;
 5429|  6.88k|                  parent != NULL;
  ------------------
  |  Branch (5429:19): [True: 6.43k, False: 455]
  ------------------
 5430|  6.30k|                  parent = parent->parent )
 5431|  6.43k|            {
 5432|  6.43k|                if (node->tag == parent->tag)
  ------------------
  |  Branch (5432:21): [True: 130, False: 6.30k]
  ------------------
 5433|    130|                {
 5434|    130|                    TY_(Report)(doc, table, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|    130|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    130|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5435|    130|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    130|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    130|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5436|    130|                    lexer->istackbase = istackbase;
 5437|       |
 5438|    130|                    DEBUG_LOG_EXIT;
 5439|    130|                    return NULL;
 5440|    130|                }
 5441|  6.43k|            }
 5442|    585|        }
 5443|       |
 5444|  35.0k|        if (!(node->tag->model & CM_TABLE))
  ------------------
  |  |  146|  35.0k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
  |  Branch (5444:13): [True: 624, False: 34.3k]
  ------------------
 5445|    624|        {
 5446|    624|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    624|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    624|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5447|    624|            TY_(Report)(doc, table, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|    624|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    624|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5448|    624|            lexer->istackbase = istackbase;
 5449|       |
 5450|    624|            DEBUG_LOG_EXIT;
 5451|    624|            return NULL;
 5452|    624|        }
 5453|       |
 5454|  34.3k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  34.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5454:13): [True: 34.3k, False: 0]
  ------------------
 5455|  34.3k|        {
 5456|  34.3k|            TidyParserMemory memory = {0};
 5457|  34.3k|            TY_(InsertNodeAtEnd)(table, node);
  ------------------
  |  |   23|  34.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5458|  34.3k|            memory.identity = TY_(ParseTableTag);
  ------------------
  |  |   23|  34.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5459|  34.3k|            memory.original_node = table;
 5460|  34.3k|            memory.reentry_node = node;
 5461|  34.3k|            memory.register_1 = lexer->exiled;
 5462|  34.3k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  34.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5463|  34.3k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 5464|  34.3k|            return node;
 5465|  34.3k|        }
 5466|       |
 5467|       |        /* discard unexpected text nodes and end tags */
 5468|      0|        TY_(Report)(doc, table, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5469|      0|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5470|      0|    }
 5471|       |
 5472|  20.1k|    TY_(Report)(doc, table, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  20.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5473|  20.1k|    lexer->istackbase = istackbase;
 5474|       |
 5475|  20.1k|    DEBUG_LOG_EXIT;
 5476|       |    return NULL;
 5477|  58.9k|}
prvTidyParseText:
 5489|  4.25k|{
 5490|  4.25k|    Lexer* lexer = doc->lexer;
 5491|  4.25k|    Node *node;
 5492|  4.25k|    DEBUG_LOG_COUNTERS;
 5493|       |    
 5494|  4.25k|    DEBUG_LOG_ENTER_WITH_NODE(field);
 5495|       |
 5496|  4.25k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 5497|       |
 5498|  4.25k|    DEBUG_LOG_GET_OLD_MODE;
 5499|  4.25k|    if ( nodeIsTEXTAREA(field) )
  ------------------
  |  |  425|  4.25k|#define nodeIsTEXTAREA( node )   TagIsId( node, TidyTag_TEXTAREA )
  |  |  ------------------
  |  |  |  |  275|  4.25k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.25k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.25k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.57k, False: 2.67k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5500|  1.57k|        mode = Preformatted;
 5501|  2.67k|    else
 5502|  2.67k|        mode = MixedContent;  /* kludge for font tags */
 5503|  4.25k|    DEBUG_LOG_CHANGE_MODE;
 5504|       |
 5505|  8.04k|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|  8.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5505:12): [True: 7.18k, False: 857]
  ------------------
 5506|  7.18k|    {
 5507|  7.18k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (5507:13): [True: 2.94k, False: 4.24k]
  |  Branch (5507:40): [True: 199, False: 2.74k]
  ------------------
 5508|    199|        {
 5509|    199|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    199|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    199|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5510|    199|            field->closed = yes;
 5511|    199|            TrimSpaces(doc, field);
 5512|    199|            DEBUG_LOG_EXIT;
 5513|    199|            return NULL;
 5514|    199|        }
 5515|       |
 5516|       |        /* deal with comments etc. */
 5517|  6.98k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (5517:13): [True: 1.59k, False: 5.39k]
  ------------------
 5518|  1.59k|            continue;
 5519|       |
 5520|  5.39k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  5.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5520:13): [True: 1.78k, False: 3.60k]
  ------------------
 5521|  1.78k|        {
 5522|       |            /* only called for 1st child */
 5523|  1.78k|            if (field->content == NULL && !(mode & Preformatted))
  ------------------
  |  Branch (5523:17): [True: 1.00k, False: 786]
  |  Branch (5523:43): [True: 515, False: 486]
  ------------------
 5524|    515|                TrimSpaces(doc, field);
 5525|       |
 5526|  1.78k|            if (node->start >= node->end)
  ------------------
  |  Branch (5526:17): [True: 1, False: 1.78k]
  ------------------
 5527|      1|            {
 5528|      1|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5529|      1|                continue;
 5530|      1|            }
 5531|       |
 5532|  1.78k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  1.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5533|  1.78k|            continue;
 5534|  1.78k|        }
 5535|       |
 5536|       |        /* for textarea should all cases of < and & be escaped? */
 5537|       |
 5538|       |        /* discard inline tags e.g. font */
 5539|  3.60k|        if (   node->tag
  ------------------
  |  Branch (5539:16): [True: 3.20k, False: 402]
  ------------------
 5540|  3.20k|            && node->tag->model & CM_INLINE
  ------------------
  |  |  143|  6.80k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5540:16): [True: 1.35k, False: 1.84k]
  ------------------
 5541|  1.35k|            && !(node->tag->model & CM_FIELD)) /* #487283 - fix by Lee Passey 25 Jan 02 */
  ------------------
  |  |  149|  1.35k|#define CM_FIELD        (1 << 10)  /**< Elements whose content must be protected against white space movement. Includes some elements that can found in forms. */
  ------------------
  |  Branch (5541:16): [True: 406, False: 951]
  ------------------
 5542|    406|        {
 5543|    406|            TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    406|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    406|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5544|    406|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    406|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    406|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5545|    406|            continue;
 5546|    406|        }
 5547|       |
 5548|       |        /* terminate element on other tags */
 5549|  3.19k|        if (!(field->tag->model & CM_OPT))
  ------------------
  |  |  154|  3.19k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (5549:13): [True: 1.30k, False: 1.89k]
  ------------------
 5550|  1.30k|            TY_(Report)(doc, field, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.30k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.30k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5551|       |
 5552|  3.19k|        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  3.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5553|  3.19k|        TrimSpaces(doc, field);
 5554|  3.19k|        DEBUG_LOG_EXIT;
 5555|  3.19k|        return NULL;
 5556|  3.60k|    }
 5557|       |
 5558|    857|    if (!(field->tag->model & CM_OPT))
  ------------------
  |  |  154|    857|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (5558:9): [True: 272, False: 585]
  ------------------
 5559|    272|        TY_(Report)(doc, field, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|    272|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    272|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5560|    857|    DEBUG_LOG_EXIT;
 5561|       |    return NULL;
 5562|  4.25k|}
prvTidyParseTitle:
 5574|  2.80k|{
 5575|  2.80k|    Node *node;
 5576|  6.49k|    while ((node = TY_(GetToken)(doc, MixedContent)) != NULL)
  ------------------
  |  |   23|  6.49k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.49k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5576:12): [True: 5.99k, False: 498]
  ------------------
 5577|  5.99k|    {
 5578|  5.99k|        if (node->tag == title->tag && node->type == StartTag
  ------------------
  |  Branch (5578:13): [True: 2.91k, False: 3.07k]
  |  Branch (5578:40): [True: 1.15k, False: 1.76k]
  ------------------
 5579|  1.15k|            && cfgBool(doc, TidyCoerceEndTags) )
  ------------------
  |  |  418|  1.15k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.15k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 1.15k, False: 0]
  |  |  ------------------
  ------------------
 5580|  1.15k|        {
 5581|  1.15k|            TY_(Report)(doc, title, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|  1.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5582|  1.15k|            node->type = EndTag;
 5583|  1.15k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5584|  1.15k|            continue;
 5585|  1.15k|        }
 5586|  4.83k|        else if (node->tag == title->tag && node->type == EndTag)
  ------------------
  |  Branch (5586:18): [True: 1.76k, False: 3.07k]
  |  Branch (5586:45): [True: 1.17k, False: 582]
  ------------------
 5587|  1.17k|        {
 5588|  1.17k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5589|  1.17k|            title->closed = yes;
 5590|  1.17k|            TrimSpaces(doc, title);
 5591|  1.17k|            return NULL;
 5592|  1.17k|        }
 5593|       |
 5594|  3.65k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  3.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5594:13): [True: 1.43k, False: 2.22k]
  ------------------
 5595|  1.43k|        {
 5596|       |            /* only called for 1st child */
 5597|  1.43k|            if (title->content == NULL)
  ------------------
  |  Branch (5597:17): [True: 1.04k, False: 397]
  ------------------
 5598|  1.04k|                TrimInitialSpace(doc, title, node);
 5599|       |
 5600|  1.43k|            if (node->start >= node->end)
  ------------------
  |  Branch (5600:17): [True: 80, False: 1.35k]
  ------------------
 5601|     80|            {
 5602|     80|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|     80|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     80|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5603|     80|                continue;
 5604|     80|            }
 5605|       |
 5606|  1.35k|            TY_(InsertNodeAtEnd)(title, node);
  ------------------
  |  |   23|  1.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5607|  1.35k|            continue;
 5608|  1.43k|        }
 5609|       |
 5610|       |        /* deal with comments etc. */
 5611|  2.22k|        if (InsertMisc(title, node))
  ------------------
  |  Branch (5611:13): [True: 270, False: 1.95k]
  ------------------
 5612|    270|            continue;
 5613|       |
 5614|       |        /* discard unknown tags */
 5615|  1.95k|        if (node->tag == NULL)
  ------------------
  |  Branch (5615:13): [True: 820, False: 1.13k]
  ------------------
 5616|    820|        {
 5617|    820|            TY_(Report)(doc, title, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    820|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    820|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5618|    820|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    820|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    820|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5619|    820|            continue;
 5620|    820|        }
 5621|       |
 5622|       |        /* pushback unexpected tokens */
 5623|  1.13k|        TY_(Report)(doc, title, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5624|  1.13k|        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5625|  1.13k|        TrimSpaces(doc, title);
 5626|  1.13k|        return NULL;
 5627|  1.95k|    }
 5628|       |
 5629|    498|    TY_(Report)(doc, title, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|    498|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    498|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5630|       |    return NULL;
 5631|  2.80k|}
prvTidyCheckNodeIntegrity:
 5902|  5.47M|{
 5903|  5.47M|#ifndef NO_NODE_INTEGRITY_CHECK
 5904|  5.47M|    Node *child;
 5905|       |
 5906|  5.47M|    if (node->prev)
  ------------------
  |  Branch (5906:9): [True: 1.19M, False: 4.28M]
  ------------------
 5907|  1.19M|    {
 5908|  1.19M|        if (node->prev->next != node)
  ------------------
  |  Branch (5908:13): [True: 0, False: 1.19M]
  ------------------
 5909|      0|            return no;
 5910|  1.19M|    }
 5911|       |
 5912|  5.47M|    if (node->next)
  ------------------
  |  Branch (5912:9): [True: 1.19M, False: 4.28M]
  ------------------
 5913|  1.19M|    {
 5914|  1.19M|        if (node->next == node || node->next->prev != node)
  ------------------
  |  Branch (5914:13): [True: 0, False: 1.19M]
  |  Branch (5914:35): [True: 0, False: 1.19M]
  ------------------
 5915|      0|            return no;
 5916|  1.19M|    }
 5917|       |
 5918|  5.47M|    if (node->parent)
  ------------------
  |  Branch (5918:9): [True: 5.43M, False: 40.4k]
  ------------------
 5919|  5.43M|    {
 5920|  5.43M|        if (node->prev == NULL && node->parent->content != node)
  ------------------
  |  Branch (5920:13): [True: 4.24M, False: 1.19M]
  |  Branch (5920:35): [True: 0, False: 4.24M]
  ------------------
 5921|      0|            return no;
 5922|       |
 5923|  5.43M|        if (node->next == NULL && node->parent->last != node)
  ------------------
  |  Branch (5923:13): [True: 4.24M, False: 1.19M]
  |  Branch (5923:35): [True: 0, False: 4.24M]
  ------------------
 5924|      0|            return no;
 5925|  5.43M|    }
 5926|       |
 5927|  10.9M|    for (child = node->content; child; child = child->next)
  ------------------
  |  Branch (5927:33): [True: 5.43M, False: 5.47M]
  ------------------
 5928|  5.43M|        if ( child->parent != node || !TY_(CheckNodeIntegrity)(child) )
  ------------------
  |  |   23|  5.43M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.43M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5928:14): [True: 0, False: 5.43M]
  |  Branch (5928:39): [True: 0, False: 5.43M]
  ------------------
 5929|      0|            return no;
 5930|       |
 5931|  5.47M|#endif
 5932|  5.47M|    return yes;
 5933|  5.47M|}
prvTidyCoerceNode:
 5941|  11.1k|{
 5942|  11.1k|    const Dict* tag = TY_(LookupTagDef)(tid);
  ------------------
  |  |   23|  11.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5943|  11.1k|    Node* tmp = TY_(InferredTag)(doc, tag->id);
  ------------------
  |  |   23|  11.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5944|       |
 5945|  11.1k|    if (obsolete)
  ------------------
  |  Branch (5945:9): [True: 3.03k, False: 8.08k]
  ------------------
 5946|  3.03k|        TY_(Report)(doc, node, tmp, OBSOLETE_ELEMENT);
  ------------------
  |  |   23|  3.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5947|  8.08k|    else if (unexpected)
  ------------------
  |  Branch (5947:14): [True: 0, False: 8.08k]
  ------------------
 5948|      0|        TY_(Report)(doc, node, tmp, REPLACING_UNEX_ELEMENT);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5949|  8.08k|    else
 5950|  8.08k|        TY_(Report)(doc, node, tmp, REPLACING_ELEMENT);
  ------------------
  |  |   23|  8.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5951|       |
 5952|  11.1k|    TidyDocFree(doc, tmp->element);
  ------------------
  |  |  159|  11.1k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  11.1k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 5953|  11.1k|    TidyDocFree(doc, tmp);
  ------------------
  |  |  159|  11.1k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  11.1k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 5954|       |
 5955|  11.1k|    node->was = node->tag;
 5956|  11.1k|    node->tag = tag;
 5957|  11.1k|    node->type = StartTag;
 5958|  11.1k|    node->implicit = yes;
 5959|  11.1k|    TidyDocFree(doc, node->element);
  ------------------
  |  |  159|  11.1k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  11.1k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 5960|  11.1k|    node->element = TY_(tmbstrdup)(doc->allocator, tag->name);
  ------------------
  |  |   23|  11.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5961|  11.1k|}
prvTidyDiscardElement:
 5968|   516k|{
 5969|   516k|    Node *next = NULL;
 5970|       |
 5971|   516k|    if (element)
  ------------------
  |  Branch (5971:9): [True: 516k, False: 0]
  ------------------
 5972|   516k|    {
 5973|   516k|        next = element->next;
 5974|   516k|        TY_(RemoveNode)(element);
  ------------------
  |  |   23|   516k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   516k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5975|   516k|        TY_(FreeNode)( doc, element);
  ------------------
  |  |   23|   516k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   516k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5976|   516k|    }
 5977|       |
 5978|   516k|    return next;
 5979|   516k|}
prvTidyDropEmptyElements:
 5986|  2.47M|{
 5987|  2.47M|    Node* next;
 5988|       |
 5989|  5.76M|    while (node)
  ------------------
  |  Branch (5989:12): [True: 3.29M, False: 2.47M]
  ------------------
 5990|  3.29M|    {
 5991|  3.29M|        next = node->next;
 5992|       |
 5993|  3.29M|        if (node->content)
  ------------------
  |  Branch (5993:13): [True: 2.45M, False: 843k]
  ------------------
 5994|  2.45M|            TY_(DropEmptyElements)(doc, node->content);
  ------------------
  |  |   23|  2.45M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.45M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5995|       |
 5996|  3.29M|        if (!TY_(nodeIsElement)(node) &&
  ------------------
  |  |   23|  3.29M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.29M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5996:13): [True: 489k, False: 2.80M]
  ------------------
 5997|   489k|            !(TY_(nodeIsText)(node) && !(node->start < node->end)))
  ------------------
  |  |   23|   489k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   489k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5997:15): [True: 236k, False: 252k]
  |  Branch (5997:40): [True: 9.35k, False: 227k]
  ------------------
 5998|   480k|        {
 5999|   480k|            node = next;
 6000|   480k|            continue;
 6001|   480k|        }
 6002|       |
 6003|  2.81M|        next = TY_(TrimEmptyElement)(doc, node);
  ------------------
  |  |   23|  2.81M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.81M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6004|  2.81M|        node = next;
 6005|  2.81M|    }
 6006|       |
 6007|  2.47M|    return node;
 6008|  2.47M|}
prvTidyInsertNodeAtStart:
 6015|  21.8k|{
 6016|  21.8k|    node->parent = element;
 6017|       |
 6018|  21.8k|    if (element->content == NULL)
  ------------------
  |  Branch (6018:9): [True: 817, False: 21.0k]
  ------------------
 6019|    817|        element->last = node;
 6020|  21.0k|    else
 6021|  21.0k|        element->content->prev = node;
 6022|       |
 6023|  21.8k|    node->next = element->content;
 6024|       |    node->prev = NULL;
 6025|  21.8k|    element->content = node;
 6026|  21.8k|}
prvTidyInsertNodeAtEnd:
 6033|  3.24M|{
 6034|  3.24M|    node->parent = element;
 6035|  3.24M|    node->prev = element ? element->last : NULL;
  ------------------
  |  Branch (6035:18): [True: 3.24M, False: 339]
  ------------------
 6036|       |
 6037|  3.24M|    if (element && element->last != NULL)
  ------------------
  |  Branch (6037:9): [True: 3.24M, False: 339]
  |  Branch (6037:20): [True: 619k, False: 2.62M]
  ------------------
 6038|   619k|        element->last->next = node;
 6039|  2.62M|    else
 6040|  2.62M|        if (element)
  ------------------
  |  Branch (6040:13): [True: 2.62M, False: 339]
  ------------------
 6041|  2.62M|            element->content = node;
 6042|       |
 6043|  3.24M|    if (element)
  ------------------
  |  Branch (6043:9): [True: 3.24M, False: 339]
  ------------------
 6044|  3.24M|        element->last = node;
 6045|  3.24M|}
prvTidyInsertNodeBeforeElement:
 6052|   121k|{
 6053|   121k|    Node *parent;
 6054|       |
 6055|   121k|    parent = element ? element->parent : NULL;
  ------------------
  |  Branch (6055:14): [True: 120k, False: 823]
  ------------------
 6056|   121k|    node->parent = parent;
 6057|   121k|    node->next = element;
 6058|   121k|    node->prev = element ? element->prev : NULL;
  ------------------
  |  Branch (6058:18): [True: 120k, False: 823]
  ------------------
 6059|   121k|    if (element)
  ------------------
  |  Branch (6059:9): [True: 120k, False: 823]
  ------------------
 6060|   120k|        element->prev = node;
 6061|       |
 6062|   121k|    if (node->prev)
  ------------------
  |  Branch (6062:9): [True: 94.4k, False: 26.5k]
  ------------------
 6063|  94.4k|        node->prev->next = node;
 6064|       |
 6065|   121k|    if (parent && parent->content == element)
  ------------------
  |  Branch (6065:9): [True: 118k, False: 3.01k]
  |  Branch (6065:19): [True: 25.1k, False: 92.8k]
  ------------------
 6066|  25.1k|        parent->content = node;
 6067|   121k|}
prvTidyInsertNodeAfterElement:
 6074|   124k|{
 6075|   124k|    Node *parent;
 6076|       |
 6077|   124k|    parent = element->parent;
 6078|   124k|    node->parent = parent;
 6079|       |
 6080|       |    /* AQ - 13 Jan 2000 fix for parent == NULL */
 6081|   124k|    if (parent != NULL && parent->last == element)
  ------------------
  |  Branch (6081:9): [True: 122k, False: 2.26k]
  |  Branch (6081:27): [True: 73.3k, False: 49.2k]
  ------------------
 6082|  73.3k|        parent->last = node;
 6083|  51.5k|    else
 6084|  51.5k|    {
 6085|  51.5k|        node->next = element->next;
 6086|       |        /* AQ - 13 Jan 2000 fix for node->next == NULL */
 6087|  51.5k|        if (node->next != NULL)
  ------------------
  |  Branch (6087:13): [True: 49.4k, False: 2.04k]
  ------------------
 6088|  49.4k|            node->next->prev = node;
 6089|  51.5k|    }
 6090|       |
 6091|   124k|    element->next = node;
 6092|   124k|    node->prev = element;
 6093|   124k|}
prvTidyIsBlank:
 6101|    477|{
 6102|    477|    Bool isBlank = TY_(nodeIsText)(node);
  ------------------
  |  |   23|    477|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    477|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6103|    477|    if ( isBlank )
  ------------------
  |  Branch (6103:10): [True: 0, False: 477]
  ------------------
 6104|      0|        isBlank = ( node->end == node->start ||       /* Zero length */
  ------------------
  |  Branch (6104:21): [True: 0, False: 0]
  ------------------
 6105|      0|                   ( node->end == node->start+1      /* or one blank. */
  ------------------
  |  Branch (6105:22): [True: 0, False: 0]
  ------------------
 6106|      0|                    && lexer->lexbuf[node->start] == ' ' ) );
  ------------------
  |  Branch (6106:24): [True: 0, False: 0]
  ------------------
 6107|       |    
 6108|    477|    return isBlank;
 6109|    477|}
prvTidyIsJavaScript:
 6117|  3.09k|{
 6118|  3.09k|    Bool result = no;
 6119|  3.09k|    AttVal *attr;
 6120|       |
 6121|  3.09k|    if (node->attributes == NULL)
  ------------------
  |  Branch (6121:9): [True: 1.24k, False: 1.84k]
  ------------------
 6122|  1.24k|        return yes;
 6123|       |
 6124|  5.42k|    for (attr = node->attributes; attr; attr = attr->next)
  ------------------
  |  Branch (6124:35): [True: 3.85k, False: 1.57k]
  ------------------
 6125|  3.85k|    {
 6126|  3.85k|        if ( (attrIsLANGUAGE(attr) || attrIsTYPE(attr))
  ------------------
  |  |  252|  3.85k|#define attrIsLANGUAGE(av)          AttrIsId( av, TidyAttr_LANGUAGE  )
  |  |  ------------------
  |  |  |  |  169|  7.70k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.85k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.34k, False: 1.50k]
  |  |  |  |  |  Branch (169:51): [True: 729, False: 1.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( (attrIsLANGUAGE(attr) || attrIsTYPE(attr))
  ------------------
  |  |  330|  3.12k|#define attrIsTYPE(av)              AttrIsId( av, TidyAttr_TYPE  )
  |  |  ------------------
  |  |  |  |  169|  3.12k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.12k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.61k, False: 1.50k]
  |  |  |  |  |  Branch (169:51): [True: 863, False: 751]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6127|  1.59k|             && AttrContains(attr, "javascript") )
  ------------------
  |  |  174|  1.59k|#define AttrContains(attr, val) (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  3.18k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 1.59k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 1.25k, False: 335]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  1.59k|                                 TY_(tmbsubstr)((attr)->value, val) != NULL)
  |  |  ------------------
  |  |  |  |   23|  1.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (175:34): [True: 277, False: 980]
  |  |  ------------------
  ------------------
 6128|    277|        {
 6129|    277|            result = yes;
 6130|    277|            break;
 6131|    277|        }
 6132|  3.85k|    }
 6133|       |
 6134|  1.84k|    return result;
 6135|  3.09k|}
prvTidyRemoveNode:
 6157|   526k|{
 6158|   526k|    if (node->prev)
  ------------------
  |  Branch (6158:9): [True: 150k, False: 376k]
  ------------------
 6159|   150k|        node->prev->next = node->next;
 6160|       |
 6161|   526k|    if (node->next)
  ------------------
  |  Branch (6161:9): [True: 222k, False: 304k]
  ------------------
 6162|   222k|        node->next->prev = node->prev;
 6163|       |
 6164|   526k|    if (node->parent)
  ------------------
  |  Branch (6164:9): [True: 522k, False: 4.02k]
  ------------------
 6165|   522k|    {
 6166|   522k|        if (node->parent->content == node)
  ------------------
  |  Branch (6166:13): [True: 371k, False: 150k]
  ------------------
 6167|   371k|            node->parent->content = node->next;
 6168|       |
 6169|   522k|        if (node->parent->last == node)
  ------------------
  |  Branch (6169:13): [True: 300k, False: 222k]
  ------------------
 6170|   300k|            node->parent->last = node->prev;
 6171|   522k|    }
 6172|       |
 6173|       |    node->parent = node->prev = node->next = NULL;
 6174|   526k|    return node;
 6175|   526k|}
prvTidyTrimEmptyElement:
 6182|  2.81M|{
 6183|  2.81M|    if ( CanPrune(doc, element) )
  ------------------
  |  Branch (6183:10): [True: 512k, False: 2.30M]
  ------------------
 6184|   512k|    {
 6185|   512k|        if (element->type != TextNode)
  ------------------
  |  Branch (6185:13): [True: 503k, False: 9.35k]
  ------------------
 6186|   503k|        {
 6187|   503k|            doc->footnotes |= FN_TRIM_EMPTY_ELEMENT;
  ------------------
  |  |  309|   503k|#define FN_TRIM_EMPTY_ELEMENT     1
  ------------------
 6188|   503k|            TY_(Report)(doc, element, NULL, TRIM_EMPTY_ELEMENT);
  ------------------
  |  |   23|   503k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   503k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6189|   503k|        }
 6190|       |
 6191|   512k|        return TY_(DiscardElement)(doc, element);
  ------------------
  |  |   23|   512k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   512k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6192|   512k|    }
 6193|  2.30M|    return element->next;
 6194|  2.81M|}
prvTidyParseDocument:
 6246|  20.2k|{
 6247|  20.2k|    Node *node, *html, *doctype = NULL;
 6248|       |
 6249|  28.3k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  28.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6249:12): [True: 25.0k, False: 3.31k]
  ------------------
 6250|  25.0k|    {
 6251|  25.0k|        if (node->type == XmlDecl)
  ------------------
  |  Branch (6251:13): [True: 873, False: 24.1k]
  ------------------
 6252|    873|        {
 6253|    873|            doc->xmlDetected = yes;
 6254|       |
 6255|    873|            if (TY_(FindXmlDecl)(doc) && doc->root.content)
  ------------------
  |  |   23|    873|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    873|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6255:17): [True: 739, False: 134]
  |  Branch (6255:42): [True: 739, False: 0]
  ------------------
 6256|    739|            {
 6257|    739|                TY_(Report)(doc, &doc->root, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    739|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    739|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6258|    739|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    739|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    739|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6259|    739|                continue;
 6260|    739|            }
 6261|    134|            if (node->line > 1 || node->column != 1)
  ------------------
  |  Branch (6261:17): [True: 12, False: 122]
  |  Branch (6261:35): [True: 53, False: 69]
  ------------------
 6262|     65|            {
 6263|     65|                TY_(Report)(doc, &doc->root, node, SPACE_PRECEDING_XMLDECL);
  ------------------
  |  |   23|     65|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     65|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6264|     65|            }
 6265|    134|        }
 6266|       |
 6267|       |        /* deal with comments etc. */
 6268|  24.2k|        if (InsertMisc( &doc->root, node ))
  ------------------
  |  Branch (6268:13): [True: 3.49k, False: 20.7k]
  ------------------
 6269|  3.49k|            continue;
 6270|       |
 6271|  20.7k|        if (node->type == DocTypeTag)
  ------------------
  |  Branch (6271:13): [True: 3.56k, False: 17.2k]
  ------------------
 6272|  3.56k|        {
 6273|  3.56k|            if (doctype == NULL)
  ------------------
  |  Branch (6273:17): [True: 1.68k, False: 1.88k]
  ------------------
 6274|  1.68k|            {
 6275|  1.68k|                TY_(InsertNodeAtEnd)( &doc->root, node);
  ------------------
  |  |   23|  1.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6276|  1.68k|                doctype = node;
 6277|  1.68k|            }
 6278|  1.88k|            else
 6279|  1.88k|            {
 6280|  1.88k|                TY_(Report)(doc, &doc->root, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.88k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.88k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6281|  1.88k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.88k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.88k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6282|  1.88k|            }
 6283|  3.56k|            continue;
 6284|  3.56k|        }
 6285|       |
 6286|  17.2k|        if (node->type == EndTag)
  ------------------
  |  Branch (6286:13): [True: 316, False: 16.8k]
  ------------------
 6287|    316|        {
 6288|    316|            TY_(Report)(doc, &doc->root, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    316|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    316|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6289|    316|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    316|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    316|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6290|    316|            continue;
 6291|    316|        }
 6292|       |
 6293|  16.8k|        if (node->type == StartTag && nodeIsHTML(node))
  ------------------
  |  |  370|  11.6k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  11.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.0k, False: 1.64k]
  |  |  |  |  |  Branch (275:54): [True: 51, False: 9.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6293:13): [True: 11.6k, False: 5.23k]
  ------------------
 6294|     51|        {
 6295|     51|            AttVal *xmlns = TY_(AttrGetById)(node, TidyAttr_XMLNS);
  ------------------
  |  |   23|     51|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     51|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6296|       |
 6297|     51|            if (AttrValueIs(xmlns, XHTML_NAMESPACE))
  ------------------
  |  |  172|     51|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|    102|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 0, False: 51]
  |  |  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|     51|                                 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]
  |  |  ------------------
  ------------------
 6298|      0|            {
 6299|      0|                Bool htmlOut = cfgBool( doc, TidyHtmlOut );
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 6300|      0|                doc->lexer->isvoyager = yes;                  /* Unless plain HTML */
 6301|      0|                TY_(SetOptionBool)( doc, TidyXhtmlOut, !htmlOut ); /* is specified, output*/
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6302|      0|                TY_(SetOptionBool)( doc, TidyXmlOut, !htmlOut );   /* will be XHTML. */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6303|       |
 6304|       |                /* adjust other config options, just as in config.c */
 6305|      0|                if ( !htmlOut )
  ------------------
  |  Branch (6305:22): [True: 0, False: 0]
  ------------------
 6306|      0|                {
 6307|      0|                    TY_(SetOptionBool)( doc, TidyUpperCaseTags, no );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6308|      0|                    TY_(SetOptionInt)( doc, TidyUpperCaseAttrs, no );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6309|      0|                }
 6310|      0|            }
 6311|     51|        }
 6312|       |
 6313|  16.8k|        if ( node->type != StartTag || !nodeIsHTML(node) )
  ------------------
  |  |  370|  11.6k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  11.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.0k, False: 1.64k]
  |  |  |  |  |  Branch (275:54): [True: 51, False: 9.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6313:14): [True: 5.23k, False: 11.6k]
  ------------------
 6314|  16.8k|        {
 6315|  16.8k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6316|  16.8k|            html = TY_(InferredTag)(doc, TidyTag_HTML);
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6317|  16.8k|        }
 6318|     51|        else
 6319|     51|            html = node;
 6320|       |
 6321|       |        /*\
 6322|       |         *  #72, avoid MISSING_DOCTYPE if show-body-only.
 6323|       |         *  #191, also if --doctype omit, that is TidyDoctypeOmit
 6324|       |         *  #342, adjust tags to html4-- if not 'auto' or 'html5'
 6325|       |        \*/
 6326|  16.8k|        if (!TY_(FindDocType)(doc))
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6326:13): [True: 16.4k, False: 476]
  ------------------
 6327|  16.4k|        {
 6328|  16.4k|            ulong dtmode = cfg( doc, TidyDoctypeMode );
  ------------------
  |  |  415|  16.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 6329|  16.4k|            if ((dtmode != TidyDoctypeOmit) && !showingBodyOnly(doc))
  ------------------
  |  |   28|  16.4k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  16.4k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  16.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6329:17): [True: 16.4k, False: 0]
  |  Branch (6329:17): [True: 16.4k, False: 0]
  |  Branch (6329:48): [True: 16.4k, False: 0]
  ------------------
 6330|  16.4k|                TY_(Report)(doc, NULL, NULL, MISSING_DOCTYPE);
  ------------------
  |  |   23|  16.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6331|  16.4k|            if ((dtmode != TidyDoctypeAuto) && (dtmode != TidyDoctypeHtml5))
  ------------------
  |  Branch (6331:17): [True: 0, False: 16.4k]
  |  Branch (6331:48): [True: 0, False: 0]
  ------------------
 6332|      0|            {
 6333|       |                /*\
 6334|       |                 *  Issue #342 - if not doctype 'auto', or 'html5'
 6335|       |                 *  then reset mode htm4-- parsing
 6336|       |                \*/
 6337|      0|                TY_(AdjustTags)(doc); /* Dynamically modify the tags table to html4-- mode */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6338|      0|            }
 6339|  16.4k|        }
 6340|  16.8k|        TY_(InsertNodeAtEnd)( &doc->root, html);
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6341|  16.8k|        ParseHTMLWithNode( doc, html );
 6342|  16.8k|        break;
 6343|  17.2k|    }
 6344|       |
 6345|       |    /* do this before any more document fixes */
 6346|  20.2k|    if ( cfg( doc, TidyAccessibilityCheckLevel ) > 0 )
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (6346:10): [True: 0, False: 20.2k]
  ------------------
 6347|      0|        TY_(AccessibilityChecks)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6348|       |
 6349|  20.2k|    if (!TY_(FindHTML)(doc))
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6349:9): [True: 3.31k, False: 16.8k]
  ------------------
 6350|  3.31k|    {
 6351|       |        /* a later check should complain if <body> is empty */
 6352|  3.31k|        html = TY_(InferredTag)(doc, TidyTag_HTML);
  ------------------
  |  |   23|  3.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6353|  3.31k|        TY_(InsertNodeAtEnd)( &doc->root, html);
  ------------------
  |  |   23|  3.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6354|  3.31k|        ParseHTMLWithNode( doc, html );
 6355|  3.31k|    }
 6356|       |
 6357|  20.2k|    node = TY_(FindTITLE)(doc);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6358|  20.2k|    if (!node)
  ------------------
  |  Branch (6358:9): [True: 20.0k, False: 119]
  ------------------
 6359|  20.0k|    {
 6360|  20.0k|        Node* head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  20.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6361|       |        /* #72, avoid MISSING_TITLE_ELEMENT if show-body-only (but allow InsertNodeAtEnd to avoid new warning) */
 6362|  40.1k|        if (!showingBodyOnly(doc))
  ------------------
  |  |   28|  20.0k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  20.0k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  20.0k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6362:13): [True: 20.0k, False: 0]
  |  Branch (6362:13): [True: 20.0k, False: 0]
  ------------------
 6363|  20.0k|        {
 6364|  20.0k|            TY_(Report)(doc, head, NULL, MISSING_TITLE_ELEMENT);
  ------------------
  |  |   23|  20.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6365|  20.0k|        }
 6366|  20.0k|        TY_(InsertNodeAtEnd)(head, TY_(InferredTag)(doc, TidyTag_TITLE));
  ------------------
  |  |   23|  20.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(InsertNodeAtEnd)(head, TY_(InferredTag)(doc, TidyTag_TITLE));
  ------------------
  |  |   23|  20.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6367|  20.0k|    }
 6368|    119|    else if (!node->content && !showingBodyOnly(doc))
  ------------------
  |  |   28|     72|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|     72|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|     72|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6368:14): [True: 72, False: 47]
  |  Branch (6368:14): [True: 72, False: 47]
  |  Branch (6368:32): [True: 72, False: 0]
  ------------------
 6369|     72|    {
 6370|       |        /* Is #839 - warn node is blank in HTML5 */
 6371|     72|        if (TY_(IsHTML5Mode)(doc))
  ------------------
  |  |   23|     72|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     72|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6371:13): [True: 69, False: 3]
  ------------------
 6372|     69|        {
 6373|     69|            TY_(Report)(doc, node, NULL, BLANK_TITLE_ELEMENT);
  ------------------
  |  |   23|     69|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     69|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6374|     69|        }
 6375|     72|    }
 6376|       |
 6377|  20.2k|    AttributeChecks(doc, &doc->root);
 6378|  20.2k|    ReplaceObsoleteElements(doc, &doc->root);
 6379|  20.2k|    TY_(DropEmptyElements)(doc, &doc->root);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6380|  20.2k|    CleanSpaces(doc, &doc->root);
 6381|       |
 6382|  20.2k|    if (cfgBool(doc, TidyEncloseBodyText))
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.2k]
  |  |  ------------------
  ------------------
 6383|      0|        EncloseBodyText(doc);
 6384|  20.2k|    if (cfgBool(doc, TidyEncloseBlockText))
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.2k]
  |  |  ------------------
  ------------------
 6385|      0|        EncloseBlockText(doc, &doc->root);
 6386|  20.2k|}
parser.c:growParserStack:
  870|  4.24k|{
  871|  4.24k|    TidyParserMemory *content;
  872|  4.24k|    content = (TidyParserMemory *) TidyAlloc( doc->allocator, sizeof(TidyParserMemory) * doc->stack.size * 2 );
  ------------------
  |  |   66|  4.24k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  873|       |
  874|  4.24k|    memcpy( content, doc->stack.content, sizeof(TidyParserMemory) * (doc->stack.top + 1) );
  875|  4.24k|    TidyFree(doc->allocator, doc->stack.content);
  ------------------
  |  |   68|  4.24k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  876|       |
  877|  4.24k|    doc->stack.content = content;
  878|  4.24k|    doc->stack.size = doc->stack.size * 2;
  879|  4.24k|}
parser.c:GetParserForNode:
 1017|  2.89M|{
 1018|  2.89M|    Lexer* lexer = doc->lexer;
 1019|       |
 1020|  2.89M|    if ( cfgBool( doc, TidyXmlTags ) )
  ------------------
  |  |  418|  2.89M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.89M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 2.89M]
  |  |  ------------------
  ------------------
 1021|      0|        return ParseXMLElement;
 1022|       |    
 1023|       |    /* [i_a]2 prevent crash for active content (php, asp) docs */
 1024|  2.89M|    if (!node || node->tag == NULL)
  ------------------
  |  Branch (1024:9): [True: 0, False: 2.89M]
  |  Branch (1024:18): [True: 6.46k, False: 2.88M]
  ------------------
 1025|  6.46k|        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|  2.88M|    if (node->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  2.88M|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (1031:9): [True: 28.0k, False: 2.85M]
  ------------------
 1032|  28.0k|    {
 1033|  28.0k|        lexer->waswhite = no;
 1034|  28.0k|        if (node->tag->parser == NULL)
  ------------------
  |  Branch (1034:13): [True: 0, False: 28.0k]
  ------------------
 1035|      0|            return NULL;
 1036|  28.0k|    }
 1037|  2.85M|    else if (!(node->tag->model & CM_INLINE))
  ------------------
  |  |  143|  2.85M|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1037:14): [True: 666k, False: 2.19M]
  ------------------
 1038|   666k|        lexer->insertspace = no;
 1039|       |
 1040|  2.88M|    if (node->tag->parser == NULL)
  ------------------
  |  Branch (1040:9): [True: 0, False: 2.88M]
  ------------------
 1041|      0|        return NULL;
 1042|       |
 1043|  2.88M|    if (node->type == StartEndTag)
  ------------------
  |  Branch (1043:9): [True: 8.72k, False: 2.87M]
  ------------------
 1044|  8.72k|        return NULL;
 1045|       |
 1046|       |    /* [i_a]2 added this - not sure why - CHECKME: */
 1047|  2.87M|    lexer->parent = node;
 1048|       |
 1049|  2.87M|    return (node->tag->parser);
 1050|  2.88M|}
parser.c:DescendantOf:
  339|   327k|{
  340|   327k|    Node *parent;
  341|   327k|    for ( parent = element->parent;
  342|   189M|         parent != NULL;
  ------------------
  |  Branch (342:10): [True: 189M, False: 286k]
  ------------------
  343|   189M|         parent = parent->parent )
  344|   189M|    {
  345|   189M|        if ( TagIsId(parent, tid) )
  ------------------
  |  |  275|   189M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  ------------------
  |  |  |  Branch (275:29): [True: 189M, False: 0]
  |  |  |  Branch (275:39): [True: 189M, False: 279k]
  |  |  |  Branch (275:54): [True: 41.2k, False: 189M]
  |  |  ------------------
  ------------------
  346|  41.2k|            return yes;
  347|   189M|    }
  348|   286k|    return no;
  349|   327k|}
parser.c:TrimSpaces:
  725|  1.00M|{
  726|  1.00M|    Node* text = element->content;
  727|       |
  728|  1.00M|    if (nodeIsPRE(element) || IsPreDescendant(element))
  ------------------
  |  |  383|  1.00M|#define nodeIsPRE( node )        TagIsId( node, TidyTag_PRE )
  |  |  ------------------
  |  |  |  |  275|  2.01M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.00M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.00M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 6.65k, False: 1.00M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (728:31): [True: 15.3k, False: 985k]
  ------------------
  729|  22.0k|        return;
  730|       |
  731|   985k|    if (TY_(nodeIsText)(text))
  ------------------
  |  |   23|   985k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   985k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (731:9): [True: 54.9k, False: 930k]
  ------------------
  732|  54.9k|        TrimInitialSpace(doc, element, text);
  733|       |
  734|   985k|    text = element->last;
  735|       |
  736|   985k|    if (TY_(nodeIsText)(text))
  ------------------
  |  |   23|   985k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   985k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (736:9): [True: 41.7k, False: 943k]
  ------------------
  737|  41.7k|        TrimTrailingSpace(doc, element, text);
  738|   985k|}
parser.c:IsPreDescendant:
  356|  1.45M|{
  357|  1.45M|    Node *parent = node->parent;
  358|       |
  359|  3.15G|    while (parent)
  ------------------
  |  Branch (359:12): [True: 3.15G, False: 1.41M]
  ------------------
  360|  3.15G|    {
  361|  3.15G|        if (parent->tag && parent->tag->parser == TY_(ParsePre))
  ------------------
  |  |   23|  3.14G|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.14G|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (361:13): [True: 3.14G, False: 1.79M]
  |  Branch (361:28): [True: 44.0k, False: 3.14G]
  ------------------
  362|  44.0k|            return yes;
  363|       |
  364|  3.15G|        parent = parent->parent;
  365|  3.15G|    }
  366|       |
  367|  1.41M|    return no;
  368|  1.45M|}
parser.c:TrimTrailingSpace:
  691|  41.7k|{
  692|  41.7k|    Lexer* lexer = doc->lexer;
  693|  41.7k|    byte c;
  694|       |
  695|  41.7k|    if (TY_(nodeIsText)(last))
  ------------------
  |  |   23|  41.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (695:9): [True: 41.7k, False: 0]
  ------------------
  696|  41.7k|    {
  697|  41.7k|        if (last->end > last->start)
  ------------------
  |  Branch (697:13): [True: 40.4k, False: 1.28k]
  ------------------
  698|  40.4k|        {
  699|  40.4k|            c = (byte) lexer->lexbuf[ last->end - 1 ];
  700|       |
  701|  40.4k|            if ( c == ' ' )
  ------------------
  |  Branch (701:18): [True: 5.76k, False: 34.6k]
  ------------------
  702|  5.76k|            {
  703|  5.76k|                last->end -= 1;
  704|  5.76k|                if ( (element->tag->model & CM_INLINE) &&
  ------------------
  |  |  143|  5.76k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (704:22): [True: 4.98k, False: 786]
  ------------------
  705|  4.98k|                     !(element->tag->model & CM_FIELD) )
  ------------------
  |  |  149|  4.98k|#define CM_FIELD        (1 << 10)  /**< Elements whose content must be protected against white space movement. Includes some elements that can found in forms. */
  ------------------
  |  Branch (705:22): [True: 4.68k, False: 294]
  ------------------
  706|  4.68k|                    lexer->insertspace = yes;
  707|  5.76k|            }
  708|  40.4k|        }
  709|  41.7k|    }
  710|  41.7k|}
parser.c:InsertMisc:
   90|  4.31M|{
   91|  4.31M|    if (node->type == CommentTag ||
  ------------------
  |  Branch (91:9): [True: 95.7k, False: 4.21M]
  ------------------
   92|  4.21M|        node->type == ProcInsTag ||
  ------------------
  |  Branch (92:9): [True: 92.5k, False: 4.12M]
  ------------------
   93|  4.12M|        node->type == CDATATag ||
  ------------------
  |  Branch (93:9): [True: 1.81k, False: 4.12M]
  ------------------
   94|  4.12M|        node->type == SectionTag ||
  ------------------
  |  Branch (94:9): [True: 15.2k, False: 4.10M]
  ------------------
   95|  4.10M|        node->type == AspTag ||
  ------------------
  |  Branch (95:9): [True: 2.45k, False: 4.10M]
  ------------------
   96|  4.10M|        node->type == JsteTag ||
  ------------------
  |  Branch (96:9): [True: 3.95k, False: 4.10M]
  ------------------
   97|  4.10M|        node->type == PhpTag )
  ------------------
  |  Branch (97:9): [True: 371, False: 4.09M]
  ------------------
   98|   212k|    {
   99|   212k|        TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|   212k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   212k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  100|   212k|        return yes;
  101|   212k|    }
  102|       |
  103|  4.09M|    if ( node->type == XmlDecl )
  ------------------
  |  Branch (103:10): [True: 17.4k, False: 4.08M]
  ------------------
  104|  17.4k|    {
  105|  17.4k|        Node* root = element;
  106|  4.08M|        while ( root && root->parent )
  ------------------
  |  Branch (106:17): [True: 4.08M, False: 0]
  |  Branch (106:25): [True: 4.06M, False: 17.4k]
  ------------------
  107|  4.06M|            root = root->parent;
  108|  17.4k|        if ( root && !(root->content && root->content->type == XmlDecl))
  ------------------
  |  Branch (108:14): [True: 17.4k, False: 0]
  |  Branch (108:24): [True: 17.1k, False: 325]
  |  Branch (108:41): [True: 16.8k, False: 302]
  ------------------
  109|    627|        {
  110|    627|          TY_(InsertNodeAtStart)( root, node );
  ------------------
  |  |   23|    627|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    627|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  111|    627|          return yes;
  112|    627|        }
  113|  17.4k|    }
  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|  4.09M|    if ( node->tag &&
  ------------------
  |  Branch (119:10): [True: 3.73M, False: 366k]
  ------------------
  120|  3.73M|         TY_(nodeIsElement)(node) &&
  ------------------
  |  |   23|  3.73M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.73M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (120:10): [True: 3.63M, False: 93.0k]
  ------------------
  121|  3.63M|         TY_(nodeCMIsEmpty)(node) && TagId(node) == TidyTag_UNKNOWN &&
  ------------------
  |  |   23|  3.63M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.63M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                       TY_(nodeCMIsEmpty)(node) && TagId(node) == TidyTag_UNKNOWN &&
  ------------------
  |  |  270|   107k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 107k, False: 0]
  |  |  |  Branch (270:39): [True: 107k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (121:10): [True: 107k, False: 3.53M]
  |  Branch (121:38): [True: 0, False: 107k]
  ------------------
  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|  4.09M|    return no;
  129|  4.09M|}
parser.c:BadForm:
  521|  3.35k|{
  522|  3.35k|    doc->badForm |= flg_BadForm;
  ------------------
  |  |   34|  3.35k|#define flg_BadForm     0x00000001
  ------------------
  523|  3.35k|}
parser.c:MoveToHead:
  206|  3.95k|{
  207|  3.95k|    Node *head = NULL;
  208|       |
  209|  3.95k|    TY_(RemoveNode)( node );  /* make sure that node is isolated */
  ------------------
  |  |   23|  3.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  210|       |
  211|  3.95k|    if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  3.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (211:10): [True: 3.73k, False: 224]
  ------------------
  212|  3.73k|    {
  213|  3.73k|        TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN );
  ------------------
  |  |   23|  3.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  214|       |
  215|  3.73k|        head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  3.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  216|  3.73k|        assert(head != NULL);
  ------------------
  |  Branch (216:9): [True: 0, False: 3.73k]
  |  Branch (216:9): [True: 3.73k, False: 0]
  ------------------
  217|       |
  218|  3.73k|        TY_(InsertNodeAtEnd)(head, node);
  ------------------
  |  |   23|  3.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  219|       |
  220|  3.73k|        if ( node->tag->parser )
  ------------------
  |  Branch (220:14): [True: 3.73k, False: 0]
  ------------------
  221|  3.73k|        {
  222|       |            /* Only one of the existing test cases as of 2021-08-14 invoke
  223|       |               MoveToHead, and it doesn't go deeper than one level. The
  224|       |               parser() call is supposed to return a node if additional
  225|       |               parsing is needed. Keep this in mind if we start to get bug
  226|       |               reports.
  227|       |             */
  228|  3.73k|            Parser* parser = node->tag->parser;
  229|  3.73k|            parser( doc, node, IgnoreWhitespace );
  230|  3.73k|        }
  231|  3.73k|    }
  232|    224|    else
  233|    224|    {
  234|    224|        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    224|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    224|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  235|    224|        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    224|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    224|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  236|    224|    }
  237|  3.95k|}
parser.c:AddClassNoIndent:
  536|  2.13k|{
  537|  2.13k|    ctmbstr sprop =
  538|  2.13k|    "padding-left: 2ex; margin-left: 0ex"
  539|  2.13k|    "; margin-top: 0ex; margin-bottom: 0ex";
  540|  2.13k|    if ( !cfgBool(doc, TidyDecorateInferredUL) )
  ------------------
  |  |  418|  2.13k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.13k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (540:10): [True: 2.13k, False: 0]
  ------------------
  541|  2.13k|        return;
  542|      0|    if ( cfgBool(doc, TidyMakeClean) )
  ------------------
  |  |  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]
  |  |  ------------------
  ------------------
  543|      0|        TY_(AddStyleAsClass)( doc, node, sprop );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  544|      0|    else
  545|      0|        TY_(AddStyleProperty)( doc, node, sprop );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  546|      0|}
parser.c:InsertDocType:
  614|  4.77k|{
  615|  4.77k|    Node* existing = TY_(FindDocType)( doc );
  ------------------
  |  |   23|  4.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  616|  4.77k|    if ( existing )
  ------------------
  |  Branch (616:10): [True: 2.90k, False: 1.87k]
  ------------------
  617|  2.90k|    {
  618|  2.90k|        TY_(Report)(doc, element, doctype, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  2.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  619|  2.90k|        TY_(FreeNode)( doc, doctype );
  ------------------
  |  |   23|  2.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  620|  2.90k|    }
  621|  1.87k|    else
  622|  1.87k|    {
  623|  1.87k|        TY_(Report)(doc, element, doctype, DOCTYPE_AFTER_TAGS );
  ------------------
  |  |   23|  1.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  624|  3.97k|        while ( !nodeIsHTML(element) )
  ------------------
  |  |  370|  3.97k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  3.97k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.97k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.97k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.87k, False: 2.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  625|  2.10k|            element = element->parent;
  626|  1.87k|        TY_(InsertNodeBeforeElement)( element, doctype );
  ------------------
  |  |   23|  1.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  627|  1.87k|    }
  628|  4.77k|}
parser.c:findNodeById:
   79|    451|{
   80|    451|    Node *node = (doc ? doc->root.content : NULL);
  ------------------
  |  Branch (80:19): [True: 451, False: 0]
  ------------------
   81|    451|    return findNodeWithId( node,tid );
   82|    451|}
parser.c:findNodeWithId:
   49|  2.46k|{
   50|  2.46k|    Node *content;
   51|  4.98k|    while (node)
  ------------------
  |  Branch (51:12): [True: 3.78k, False: 1.20k]
  ------------------
   52|  3.78k|    {
   53|  3.78k|        if (TagIsId(node,tid))
  ------------------
  |  |  275|  3.78k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  ------------------
  |  |  |  Branch (275:29): [True: 3.78k, False: 0]
  |  |  |  Branch (275:39): [True: 3.25k, False: 533]
  |  |  |  Branch (275:54): [True: 384, False: 2.86k]
  |  |  ------------------
  ------------------
   54|    384|            return yes;
   55|       |        /*\
   56|       |         *   Issue #459 - Under certain circumstances, with many node this use of
   57|       |         *   'for (content = node->content; content; content = content->content)'
   58|       |         *   would produce a **forever** circle, or at least a very extended loop...
   59|       |         *   It is sufficient to test the content, if it exists,
   60|       |         *   to quickly iterate all nodes. Now all nodes are tested only once.
   61|       |        \*/
   62|  3.40k|        content = node->content;
   63|  3.40k|        if (content)
  ------------------
  |  Branch (63:13): [True: 2.01k, False: 1.39k]
  ------------------
   64|  2.01k|        {
   65|  2.01k|            if ( findNodeWithId(content,tid) )
  ------------------
  |  Branch (65:18): [True: 875, False: 1.13k]
  ------------------
   66|    875|                return yes;
   67|  2.01k|        }
   68|  2.52k|        node = node->next;
   69|  2.52k|    }
   70|  1.20k|    return no;
   71|  2.46k|}
parser.c:InsertNodeAsParent:
  137|  1.01k|{
  138|  1.01k|    node->content = element;
  139|  1.01k|    node->last = element;
  140|  1.01k|    node->parent = element->parent;
  141|  1.01k|    element->parent = node;
  142|       |
  143|  1.01k|    if (node->parent->content == element)
  ------------------
  |  Branch (143:9): [True: 743, False: 272]
  ------------------
  144|    743|        node->parent->content = node;
  145|       |
  146|  1.01k|    if (node->parent->last == element)
  ------------------
  |  Branch (146:9): [True: 947, False: 68]
  ------------------
  147|    947|        node->parent->last = node;
  148|       |
  149|  1.01k|    node->prev = element->prev;
  150|  1.01k|    element->prev = NULL;
  151|       |
  152|  1.01k|    if (node->prev)
  ------------------
  |  Branch (152:9): [True: 272, False: 743]
  ------------------
  153|    272|        node->prev->next = node;
  154|       |
  155|  1.01k|    node->next = element->next;
  156|  1.01k|    element->next = NULL;
  157|       |
  158|  1.01k|    if (node->next)
  ------------------
  |  Branch (158:9): [True: 68, False: 947]
  ------------------
  159|     68|        node->next->prev = node;
  160|  1.01k|}
parser.c:FindLastLI:
  823|  88.8k|{
  824|  88.8k|    Node *node;
  825|       |
  826|  88.8k|    *lastli = NULL;
  827|  93.2k|    for ( node = list->content; node ; node = node->next )
  ------------------
  |  Branch (827:33): [True: 4.43k, False: 88.8k]
  ------------------
  828|  4.43k|        if ( nodeIsLI(node) && node->type == StartTag )
  ------------------
  |  |  390|  4.43k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|  8.86k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.43k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.83k, False: 2.59k]
  |  |  |  |  |  Branch (275:54): [True: 1.12k, False: 709]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (828:32): [True: 833, False: 292]
  ------------------
  829|    833|            *lastli=node;
  830|  88.8k|    return *lastli ? yes:no;
  ------------------
  |  Branch (830:12): [True: 811, False: 88.0k]
  ------------------
  831|  88.8k|}
parser.c:FindMatchingDescendant:
  801|  5.10k|{
  802|  5.10k|    struct MatchingDescendantData cb_data = { 0 };
  803|  5.10k|    cb_data.matching_tagId = TagId(node);
  ------------------
  |  |  270|  5.10k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 5.10k, False: 0]
  |  |  |  Branch (270:39): [True: 3.28k, False: 1.82k]
  |  |  ------------------
  ------------------
  804|  5.10k|    cb_data.node_to_find = node;
  805|  5.10k|    cb_data.marker_node = marker_node;
  806|       |
  807|  5.10k|    assert(node);
  ------------------
  |  Branch (807:5): [True: 0, False: 5.10k]
  |  Branch (807:5): [True: 5.10k, False: 0]
  ------------------
  808|       |
  809|  5.10k|    if (is_parent_of_marker)
  ------------------
  |  Branch (809:9): [True: 5.10k, False: 0]
  ------------------
  810|  5.10k|        *is_parent_of_marker = no;
  811|       |
  812|  5.10k|    TY_(TraverseNodeTree)(NULL, parent, FindDescendant_cb, &cb_data);
  ------------------
  |  |   23|  5.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  813|  5.10k|    return cb_data.found_node;
  814|  5.10k|}
parser.c:FindDescendant_cb:
  765|  35.2k|{
  766|  35.2k|    struct MatchingDescendantData *cb_data = (struct MatchingDescendantData *)propagate;
  767|       |
  768|  35.2k|    if (TagId(node) == cb_data->matching_tagId)
  ------------------
  |  |  270|  35.2k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 35.2k, False: 0]
  |  |  |  Branch (270:39): [True: 28.6k, False: 6.58k]
  |  |  ------------------
  ------------------
  |  Branch (768:9): [True: 6.96k, False: 28.2k]
  ------------------
  769|  6.96k|    {
  770|       |        /* make sure we match up 'unknown' tags exactly! */
  771|  6.96k|        if (cb_data->matching_tagId != TidyTag_UNKNOWN ||
  ------------------
  |  Branch (771:13): [True: 2.71k, False: 4.25k]
  ------------------
  772|  4.25k|            (node->element != NULL &&
  ------------------
  |  Branch (772:14): [True: 2.93k, False: 1.32k]
  ------------------
  773|  2.93k|            cb_data->node_to_find != NULL &&
  ------------------
  |  Branch (773:13): [True: 2.93k, False: 0]
  ------------------
  774|  2.93k|            cb_data->node_to_find->element != NULL &&
  ------------------
  |  Branch (774:13): [True: 2.93k, False: 0]
  ------------------
  775|  2.93k|            0 == TY_(tmbstrcmp)(cb_data->node_to_find->element, node->element)))
  ------------------
  |  |   23|  2.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (775:13): [True: 500, False: 2.43k]
  ------------------
  776|  3.21k|        {
  777|  3.21k|            cb_data->found_node = node;
  778|  3.21k|            return ExitTraversal;
  779|  3.21k|        }
  780|  6.96k|    }
  781|       |
  782|  31.9k|    if (cb_data->passed_marker_node && node == cb_data->marker_node)
  ------------------
  |  Branch (782:9): [True: 0, False: 31.9k]
  |  Branch (782:40): [True: 0, False: 0]
  ------------------
  783|      0|        *cb_data->passed_marker_node = yes;
  784|       |
  785|  31.9k|    return VisitParent;
  786|  35.2k|}
parser.c:MoveNodeToBody:
  191|  1.49k|{
  192|  1.49k|    Node* body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  1.49k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.49k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  193|  1.49k|    if ( body )
  ------------------
  |  Branch (193:10): [True: 1.29k, False: 198]
  ------------------
  194|  1.29k|    {
  195|  1.29k|        TY_(RemoveNode)( node );
  ------------------
  |  |   23|  1.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  196|  1.29k|        TY_(InsertNodeAtEnd)( body, node );
  ------------------
  |  |   23|  1.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  197|  1.29k|    }
  198|  1.49k|}
parser.c:PreContent:
  386|   120k|{
  387|       |    /* p is coerced to br's, Text OK too */
  388|   120k|    if ( nodeIsP(node) || TY_(nodeIsText)(node) )
  ------------------
  |  |  385|   120k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|   241k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 120k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 120k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.09k, False: 115k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( nodeIsP(node) || TY_(nodeIsText)(node) )
  ------------------
  |  |   23|   115k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   115k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (388:27): [True: 0, False: 115k]
  ------------------
  389|  5.09k|        return yes;
  390|       |
  391|   115k|    if ( node->tag == NULL ||
  ------------------
  |  Branch (391:10): [True: 0, False: 115k]
  ------------------
  392|   115k|         nodeIsPARAM(node) ||
  ------------------
  |  |  409|   115k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|   231k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 115k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 115k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 286, False: 115k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  393|   115k|         !TY_(nodeHasCM)(node, CM_INLINE|CM_NEW) )
  ------------------
  |  |   23|   115k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   115k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                       !TY_(nodeHasCM)(node, CM_INLINE|CM_NEW) )
  ------------------
  |  |  143|   115k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                       !TY_(nodeHasCM)(node, CM_INLINE|CM_NEW) )
  ------------------
  |  |  159|   115k|#define CM_NEW          (1 << 20)  /**< User defined elements. Used to determine how attributes without value should be printed. */
  ------------------
  |  Branch (393:10): [True: 111k, False: 3.66k]
  ------------------
  394|   112k|        return no;
  395|       |
  396|  3.66k|    return yes;
  397|   115k|}
parser.c:FixEmptyRow:
  597|  3.16k|{
  598|  3.16k|    Node *cell;
  599|       |
  600|  3.16k|    if (row->content == NULL)
  ------------------
  |  Branch (600:9): [True: 2.67k, False: 489]
  ------------------
  601|  2.67k|    {
  602|  2.67k|        cell = TY_(InferredTag)(doc, TidyTag_TD);
  ------------------
  |  |   23|  2.67k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.67k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  603|  2.67k|        TY_(InsertNodeAtEnd)(row, cell);
  ------------------
  |  |   23|  2.67k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.67k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  604|  2.67k|        TY_(Report)(doc, row, cell, MISSING_STARTTAG);
  ------------------
  |  |   23|  2.67k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.67k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  605|  2.67k|    }
  606|  3.16k|}
parser.c:MoveBeforeTable:
  170|  91.1k|{
  171|  91.1k|    Node *table;
  172|       |
  173|       |    /* first find the table element */
  174|  1.26M|    for (table = row->parent; table; table = table->parent)
  ------------------
  |  Branch (174:31): [True: 1.17M, False: 88.4k]
  ------------------
  175|  1.17M|    {
  176|  1.17M|        if ( nodeIsTABLE(table) )
  ------------------
  |  |  393|  1.17M|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  1.17M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.17M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.08M, False: 87.6k]
  |  |  |  |  |  Branch (275:54): [True: 2.66k, False: 1.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  2.66k|        {
  178|  2.66k|            TY_(InsertNodeBeforeElement)( table, node );
  ------------------
  |  |   23|  2.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  179|  2.66k|            return;
  180|  2.66k|        }
  181|  1.17M|    }
  182|       |    /* No table element */
  183|  88.4k|    TY_(InsertNodeBeforeElement)( row->parent, node );
  ------------------
  |  |   23|  88.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  88.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  184|  88.4k|}
parser.c:TrimInitialSpace:
  642|  55.9k|{
  643|  55.9k|    Lexer* lexer = doc->lexer;
  644|  55.9k|    Node *prev, *node;
  645|       |
  646|  55.9k|    if ( TY_(nodeIsText)(text) &&
  ------------------
  |  |   23|  55.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (646:10): [True: 55.9k, False: 0]
  ------------------
  647|  55.9k|         lexer->lexbuf[text->start] == ' ' &&
  ------------------
  |  Branch (647:10): [True: 7.26k, False: 48.6k]
  ------------------
  648|  7.26k|         text->start < text->end )
  ------------------
  |  Branch (648:10): [True: 6.39k, False: 869]
  ------------------
  649|  6.39k|    {
  650|  6.39k|        if ( (element->tag->model & CM_INLINE) &&
  ------------------
  |  |  143|  6.39k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (650:14): [True: 5.05k, False: 1.34k]
  ------------------
  651|  5.05k|             !(element->tag->model & CM_FIELD) )
  ------------------
  |  |  149|  5.05k|#define CM_FIELD        (1 << 10)  /**< Elements whose content must be protected against white space movement. Includes some elements that can found in forms. */
  ------------------
  |  Branch (651:14): [True: 4.72k, False: 332]
  ------------------
  652|  4.72k|        {
  653|  4.72k|            prev = element->prev;
  654|       |
  655|  4.72k|            if (TY_(nodeIsText)(prev))
  ------------------
  |  |   23|  4.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (655:17): [True: 655, False: 4.06k]
  ------------------
  656|    655|            {
  657|    655|                if (prev->end == 0 || lexer->lexbuf[prev->end - 1] != ' ')
  ------------------
  |  Branch (657:21): [True: 0, False: 655]
  |  Branch (657:39): [True: 348, False: 307]
  ------------------
  658|    348|                    lexer->lexbuf[(prev->end)++] = ' ';
  659|       |
  660|    655|                ++(element->start);
  661|    655|            }
  662|  4.06k|            else /* create new node */
  663|  4.06k|            {
  664|  4.06k|                node = TY_(NewNode)(lexer->allocator, lexer);
  ------------------
  |  |   23|  4.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  665|  4.06k|                node->start = (element->start)++;
  666|  4.06k|                node->end = element->start;
  667|  4.06k|                lexer->lexbuf[node->start] = ' ';
  668|  4.06k|                TY_(InsertNodeBeforeElement)(element ,node);
  ------------------
  |  |   23|  4.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  669|  4.06k|                DEBUG_LOG(SPRTF("TrimInitialSpace: Created text node, inserted before <%s>\n",
  670|  4.06k|                    (element->element ? element->element : "unknown")));
  671|  4.06k|            }
  672|  4.72k|        }
  673|       |
  674|       |        /* discard the space in current node */
  675|  6.39k|        ++(text->start);
  676|  6.39k|    }
  677|  55.9k|}
parser.c:CanPrune:
  250|  2.81M|{
  251|  2.81M|    if ( !cfgBool(doc, TidyDropEmptyElems) )
  ------------------
  |  |  418|  2.81M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.81M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (251:10): [True: 0, False: 2.81M]
  ------------------
  252|      0|        return no;
  253|       |
  254|  2.81M|    if ( TY_(nodeIsText)(element) )
  ------------------
  |  |   23|  2.81M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.81M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (254:10): [True: 9.35k, False: 2.80M]
  ------------------
  255|  9.35k|        return yes;
  256|       |
  257|  2.80M|    if ( element->content )
  ------------------
  |  Branch (257:10): [True: 2.14M, False: 663k]
  ------------------
  258|  2.14M|        return no;
  259|       |
  260|   663k|    if ( element->tag == NULL )
  ------------------
  |  Branch (260:10): [True: 929, False: 662k]
  ------------------
  261|    929|        return no;
  262|       |
  263|   662k|    if ( element->tag->model & CM_BLOCK && element->attributes != NULL )
  ------------------
  |  |  142|  1.32M|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (263:10): [True: 193k, False: 469k]
  |  Branch (263:44): [True: 12.9k, False: 180k]
  ------------------
  264|  12.9k|        return no;
  265|       |
  266|   649k|    if ( nodeIsA(element) && element->attributes != NULL )
  ------------------
  |  |  401|   649k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  1.29M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 649k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 649k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.49k, False: 646k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:30): [True: 1.15k, False: 2.34k]
  ------------------
  267|  1.15k|        return no;
  268|       |
  269|   648k|    if ( nodeIsP(element) && !cfgBool(doc, TidyDropEmptyParas) )
  ------------------
  |  |  385|   648k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  1.29M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 648k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 648k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 34.4k, False: 614k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( nodeIsP(element) && !cfgBool(doc, TidyDropEmptyParas) )
  ------------------
  |  |  418|  34.4k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  34.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (269:30): [True: 0, False: 34.4k]
  ------------------
  270|      0|        return no;
  271|       |
  272|   648k|    if ( element->tag->model & CM_ROW )
  ------------------
  |  |  148|   648k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (272:10): [True: 5.57k, False: 643k]
  ------------------
  273|  5.57k|        return no;
  274|       |
  275|   643k|    if ( element->tag->model & CM_EMPTY )
  ------------------
  |  |  139|   643k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (275:10): [True: 43.6k, False: 599k]
  ------------------
  276|  43.6k|        return no;
  277|       |
  278|   599k|    if ( nodeIsAPPLET(element) )
  ------------------
  |  |  427|   599k|#define nodeIsAPPLET( node )     TagIsId( node, TidyTag_APPLET )
  |  |  ------------------
  |  |  |  |  275|   599k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 599k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 599k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 324, False: 599k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|    324|        return no;
  280|       |
  281|   599k|    if ( nodeIsOBJECT(element) )
  ------------------
  |  |  428|   599k|#define nodeIsOBJECT( node )     TagIsId( node, TidyTag_OBJECT )
  |  |  ------------------
  |  |  |  |  275|   599k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 599k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 599k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 833, False: 598k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  282|    833|        return no;
  283|       |
  284|   598k|    if ( nodeIsSCRIPT(element) && attrGetSRC(element) )
  ------------------
  |  |  422|   598k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  1.19M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 598k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 598k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 358, False: 597k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( nodeIsSCRIPT(element) && attrGetSRC(element) )
  ------------------
  |  |  396|    358|#define attrGetSRC( nod )         TY_(AttrGetById)( nod, TidyAttr_SRC  )
  |  |  ------------------
  |  |  |  |   23|    358|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    358|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (396:35): [True: 0, False: 358]
  |  |  ------------------
  ------------------
  285|      0|        return no;
  286|       |
  287|   598k|    if ( nodeIsTITLE(element) )
  ------------------
  |  |  372|   598k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|   598k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 598k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 598k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 23.2k, False: 574k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|  23.2k|        return no;
  289|       |
  290|       |    /* #433359 - fix by Randy Waki 12 Mar 01 */
  291|   574k|    if ( nodeIsIFRAME(element) )
  ------------------
  |  |  378|   574k|#define nodeIsIFRAME( node )     TagIsId( node, TidyTag_IFRAME )
  |  |  ------------------
  |  |  |  |  275|   574k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 574k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 574k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 76, False: 574k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  292|     76|        return no;
  293|       |
  294|       |    /* fix for bug 770297 */
  295|   574k|    if (nodeIsTEXTAREA(element))
  ------------------
  |  |  425|   574k|#define nodeIsTEXTAREA( node )   TagIsId( node, TidyTag_TEXTAREA )
  |  |  ------------------
  |  |  |  |  275|   574k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 574k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 574k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.08k, False: 573k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  296|  1.08k|        return no;
  297|       |
  298|       |    /* fix for ISSUE #7 https://github.com/w3c/tidy-html5/issues/7 */
  299|   573k|    if (nodeIsCANVAS(element))
  ------------------
  |  |  454|   573k|#define nodeIsCANVAS( node )     TagIsId( node, TidyTag_CANVAS )
  |  |  ------------------
  |  |  |  |  275|   573k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 573k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 573k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 208, False: 573k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  300|    208|        return no;
  301|       |    
  302|   573k|    if (nodeIsPROGRESS(element))
  ------------------
  |  |  455|   573k|#define nodeIsPROGRESS( node )   TagIsId( node, TidyTag_PROGRESS )
  |  |  ------------------
  |  |  |  |  275|   573k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 573k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 573k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 96, False: 573k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  303|     96|        return no;
  304|       |
  305|   573k|    if ( attrGetID(element) || attrGetNAME(element) )
  ------------------
  |  |  397|  1.14M|#define attrGetID( nod )          TY_(AttrGetById)( nod, TidyAttr_ID  )
  |  |  ------------------
  |  |  |  |   23|   573k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   573k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (397:35): [True: 54.8k, False: 518k]
  |  |  ------------------
  ------------------
                  if ( attrGetID(element) || attrGetNAME(element) )
  ------------------
  |  |  398|   518k|#define attrGetNAME( nod )        TY_(AttrGetById)( nod, TidyAttr_NAME  )
  |  |  ------------------
  |  |  |  |   23|   518k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   518k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (398:35): [True: 469, False: 518k]
  |  |  ------------------
  ------------------
  306|  55.3k|        return no;
  307|       |
  308|       |    /* fix for bug 695408; a better fix would look for unknown and    */
  309|       |    /* known proprietary attributes that make the element significant */
  310|   518k|    if (attrGetDATAFLD(element))
  ------------------
  |  |  410|   518k|#define attrGetDATAFLD( nod )     TY_(AttrGetById)( nod, TidyAttr_DATAFLD  )
  |  |  ------------------
  |  |  |  |   23|   518k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   518k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (410:35): [True: 0, False: 518k]
  |  |  ------------------
  ------------------
  311|      0|        return no;
  312|       |
  313|       |    /* fix for bug 723772, don't trim new-...-tags */
  314|   518k|    if (element->tag->id == TidyTag_UNKNOWN)
  ------------------
  |  Branch (314:9): [True: 0, False: 518k]
  ------------------
  315|      0|        return no;
  316|       |
  317|   518k|    if (nodeIsBODY(element))
  ------------------
  |  |  375|   518k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   518k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 518k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 518k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 11.6k, False: 506k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  11.6k|        return no;
  319|       |
  320|   506k|    if (nodeIsCOLGROUP(element))
  ------------------
  |  |  399|   506k|#define nodeIsCOLGROUP( node )   TagIsId( node, TidyTag_COLGROUP )
  |  |  ------------------
  |  |  |  |  275|   506k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 506k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 506k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.39k, False: 505k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|  1.39k|        return no;
  322|       |
  323|       |    /* HTML5 - do NOT drop empty option if it has attributes */
  324|   505k|    if ( nodeIsOPTION(element) && element->attributes != NULL )
  ------------------
  |  |  410|   505k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  1.01M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 505k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 505k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.13k, False: 503k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (324:35): [True: 359, False: 1.77k]
  ------------------
  325|    359|        return no;
  326|       |
  327|       |    /* fix for #103 - don't drop empty dd tags lest document not validate */
  328|   504k|    if (nodeIsDD(element))
  ------------------
  |  |  392|   504k|#define nodeIsDD( node )         TagIsId( node, TidyTag_DD )
  |  |  ------------------
  |  |  |  |  275|   504k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 504k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 504k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.30k, False: 503k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  329|  1.30k|        return no;
  330|       |
  331|   503k|    return yes;
  332|   504k|}
parser.c:AttributeChecks:
 5753|  2.47M|{
 5754|  2.47M|    Node *next;
 5755|       |
 5756|  5.76M|    while (node)
  ------------------
  |  Branch (5756:12): [True: 3.29M, False: 2.47M]
  ------------------
 5757|  3.29M|    {
 5758|  3.29M|        next = node->next;
 5759|       |
 5760|  3.29M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  3.29M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.29M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5760:13): [True: 2.80M, False: 489k]
  ------------------
 5761|  2.80M|        {
 5762|  2.80M|            if (node->tag && node->tag->chkattrs) /* [i_a]2 fix crash after adding SVG support with alt/unknown tag subtree insertion there */
  ------------------
  |  Branch (5762:17): [True: 2.80M, False: 4.72k]
  |  Branch (5762:30): [True: 84.6k, False: 2.71M]
  ------------------
 5763|  84.6k|                node->tag->chkattrs(doc, node);
 5764|  2.72M|            else
 5765|  2.72M|                TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  2.72M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.72M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5766|  2.80M|        }
 5767|       |
 5768|  3.29M|        if (node->content)
  ------------------
  |  Branch (5768:13): [True: 2.45M, False: 843k]
  ------------------
 5769|  2.45M|            AttributeChecks(doc, node->content);
 5770|       |
 5771|  3.29M|        assert( next != node ); /* http://tidy.sf.net/issue/1603538 */
  ------------------
  |  Branch (5771:9): [True: 0, False: 3.29M]
  |  Branch (5771:9): [True: 3.29M, False: 0]
  ------------------
 5772|  3.29M|        node = next;
 5773|  3.29M|    }
 5774|  2.47M|}
parser.c:ReplaceObsoleteElements:
 5866|  2.47M|{
 5867|  2.47M|    Node *next;
 5868|       |
 5869|  5.76M|    while (node)
  ------------------
  |  Branch (5869:12): [True: 3.29M, False: 2.47M]
  ------------------
 5870|  3.29M|    {
 5871|  3.29M|        next = node->next;
 5872|       |
 5873|       |        /* if (nodeIsDIR(node) || nodeIsMENU(node)) */
 5874|       |        /* HTML5 - <menu ... > is no longer obsolete */
 5875|  3.29M|        if (nodeIsDIR(node))
  ------------------
  |  |  389|  3.29M|#define nodeIsDIR( node )        TagIsId( node, TidyTag_DIR )
  |  |  ------------------
  |  |  |  |  275|  3.29M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.29M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.80M, False: 494k]
  |  |  |  |  |  Branch (275:54): [True: 1.04k, False: 2.80M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5876|  1.04k|            TY_(CoerceNode)(doc, node, TidyTag_UL, yes, yes);
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5877|       |
 5878|  3.29M|        if (nodeIsXMP(node) || nodeIsLISTING(node) ||
  ------------------
  |  |  439|  3.29M|#define nodeIsXMP( node )        TagIsId( node, TidyTag_XMP )
  |  |  ------------------
  |  |  |  |  275|  6.59M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.29M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.80M, False: 494k]
  |  |  |  |  |  Branch (275:54): [True: 239, False: 2.80M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (nodeIsXMP(node) || nodeIsLISTING(node) ||
  ------------------
  |  |  384|  3.29M|#define nodeIsLISTING( node )    TagIsId( node, TidyTag_LISTING )
  |  |  ------------------
  |  |  |  |  275|  6.59M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.29M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.80M, False: 494k]
  |  |  |  |  |  Branch (275:54): [True: 1.29k, False: 2.80M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5879|  3.29M|            (node->tag && node->tag->id == TidyTag_PLAINTEXT))
  ------------------
  |  Branch (5879:14): [True: 2.80M, False: 494k]
  |  Branch (5879:27): [True: 453, False: 2.79M]
  ------------------
 5880|  1.99k|            TY_(CoerceNode)(doc, node, TidyTag_PRE, yes, yes);
  ------------------
  |  |   23|  1.99k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.99k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5881|       |
 5882|  3.29M|        if (node->content)
  ------------------
  |  Branch (5882:13): [True: 2.45M, False: 843k]
  ------------------
 5883|  2.45M|            ReplaceObsoleteElements(doc, node->content);
 5884|       |
 5885|  3.29M|        node = next;
 5886|  3.29M|    }
 5887|  2.47M|}
parser.c:CleanSpaces:
  554|  20.2k|{
  555|  20.2k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  556|  20.2k|    Node *next;
  557|       |    
  558|  2.80M|    while (node)
  ------------------
  |  Branch (558:12): [True: 2.78M, False: 20.2k]
  ------------------
  559|  2.78M|    {
  560|  2.78M|        next = node->next;
  561|       |
  562|  2.78M|        if (TY_(nodeIsText)(node) && CleanLeadingWhitespace(doc, node))
  ------------------
  |  |   23|  2.78M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.78M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (562:13): [True: 227k, False: 2.55M]
  |  Branch (562:38): [True: 47.0k, False: 180k]
  ------------------
  563|  50.6k|            while (node->start < node->end && TY_(IsWhite)(doc->lexer->lexbuf[node->start]))
  ------------------
  |  |   23|  48.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  48.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (563:20): [True: 48.5k, False: 2.11k]
  |  Branch (563:47): [True: 3.65k, False: 44.9k]
  ------------------
  564|  3.65k|                ++(node->start);
  565|       |
  566|  2.78M|        if (TY_(nodeIsText)(node) && CleanTrailingWhitespace(doc, node))
  ------------------
  |  |   23|  2.78M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.78M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (566:13): [True: 227k, False: 2.55M]
  |  Branch (566:38): [True: 43.3k, False: 183k]
  ------------------
  567|  79.9k|            while (node->end > node->start && TY_(IsWhite)(doc->lexer->lexbuf[node->end - 1]))
  ------------------
  |  |   23|  77.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  77.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (567:20): [True: 77.5k, False: 2.37k]
  |  Branch (567:47): [True: 36.5k, False: 40.9k]
  ------------------
  568|  36.5k|                --(node->end);
  569|       |
  570|  2.78M|        if (TY_(nodeIsText)(node) && !(node->start < node->end))
  ------------------
  |  |   23|  2.78M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.78M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (570:13): [True: 227k, False: 2.55M]
  |  Branch (570:38): [True: 3.70k, False: 223k]
  ------------------
  571|  3.70k|        {
  572|  3.70k|            TY_(RemoveNode)(node);
  ------------------
  |  |   23|  3.70k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.70k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  573|  3.70k|            TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  3.70k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.70k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  574|  3.70k|            node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|    526|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    526|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (574:20): [True: 3.17k, False: 526]
  ------------------
  575|  3.70k|            continue;
  576|  3.70k|        }
  577|       |
  578|  2.77M|        if (node->content)
  ------------------
  |  Branch (578:13): [True: 2.16M, False: 615k]
  ------------------
  579|  2.16M|        {
  580|  2.16M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.16M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.16M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  581|  2.16M|            node = node->content;
  582|  2.16M|            continue;
  583|  2.16M|        }
  584|       |
  585|   615k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   151k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   151k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (585:16): [True: 464k, False: 151k]
  ------------------
  586|   615k|    }
  587|  20.2k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  588|  20.2k|}
parser.c:CleanLeadingWhitespace:
  404|   227k|{
  405|   227k|    if (!TY_(nodeIsText)(node))
  ------------------
  |  |   23|   227k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   227k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (405:9): [True: 0, False: 227k]
  ------------------
  406|      0|        return no;
  407|       |
  408|   227k|    if (node->parent->type == DocTypeTag)
  ------------------
  |  Branch (408:9): [True: 705, False: 226k]
  ------------------
  409|    705|        return no;
  410|       |
  411|   226k|    if (IsPreDescendant(node))
  ------------------
  |  Branch (411:9): [True: 14.3k, False: 212k]
  ------------------
  412|  14.3k|        return no;
  413|       |
  414|   212k|    if (node->parent->tag && node->parent->tag->parser == TY_(ParseScript))
  ------------------
  |  |   23|   209k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   209k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (414:9): [True: 209k, False: 2.80k]
  |  Branch (414:30): [True: 2.47k, False: 207k]
  ------------------
  415|  2.47k|        return no;
  416|       |    
  417|       |    /* #523, prevent blank spaces after script if the next item is script.
  418|       |     * This is actually more generalized as, if the preceding element is
  419|       |     * a body level script, then indicate that we want to clean leading
  420|       |     * whitespace.
  421|       |     */
  422|   209k|    if ( node->prev && nodeIsSCRIPT(node->prev) && nodeIsBODY(node->prev->parent) )
  ------------------
  |  |  422|   144k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|   354k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 144k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 13.5k, False: 130k]
  |  |  |  |  |  Branch (275:54): [True: 628, False: 12.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( node->prev && nodeIsSCRIPT(node->prev) && nodeIsBODY(node->prev->parent) )
  ------------------
  |  |  375|    628|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|    628|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 628, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 433, False: 195]
  |  |  |  |  |  Branch (275:54): [True: 212, False: 221]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (422:10): [True: 144k, False: 65.5k]
  ------------------
  423|    212|        return yes;
  424|       |
  425|       |    /* <p>...<br> <em>...</em>...</p> */
  426|   209k|    if (nodeIsBR(node->prev))
  ------------------
  |  |  400|   209k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   209k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 144k, False: 65.5k]
  |  |  |  |  |  Branch (275:39): [True: 13.3k, False: 130k]
  |  |  |  |  |  Branch (275:54): [True: 4.47k, False: 8.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|  4.47k|        return yes;
  428|       |
  429|       |    /* <p> ...</p> */
  430|   205k|    if (node->prev == NULL && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |   23|  65.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  65.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (node->prev == NULL && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |  143|  65.5k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (430:9): [True: 65.5k, False: 139k]
  |  Branch (430:31): [True: 28.9k, False: 36.5k]
  ------------------
  431|  28.9k|        return yes;
  432|       |
  433|       |    /* <h4>...</h4> <em>...</em> */
  434|   176k|    if (node->prev && !TY_(nodeHasCM)(node->prev, CM_INLINE) &&
  ------------------
  |  |   23|   139k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   139k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (node->prev && !TY_(nodeHasCM)(node->prev, CM_INLINE) &&
  ------------------
  |  |  143|   139k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (434:9): [True: 139k, False: 36.5k]
  |  Branch (434:23): [True: 135k, False: 4.65k]
  ------------------
  435|   135k|        TY_(nodeIsElement)(node->prev))
  ------------------
  |  |   23|   135k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   135k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (435:9): [True: 4.27k, False: 130k]
  ------------------
  436|  4.27k|        return yes;
  437|       |
  438|       |    /* <p><span> ...</span></p> */
  439|   171k|    if (!node->prev && !node->parent->prev && !TY_(nodeHasCM)(node->parent->parent, CM_INLINE))
  ------------------
  |  |   23|  26.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (!node->prev && !node->parent->prev && !TY_(nodeHasCM)(node->parent->parent, CM_INLINE))
  ------------------
  |  |  143|  26.7k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (439:9): [True: 36.5k, False: 135k]
  |  Branch (439:24): [True: 26.7k, False: 9.86k]
  |  Branch (439:47): [True: 9.16k, False: 17.5k]
  ------------------
  440|  9.16k|        return yes;
  441|       |
  442|   162k|    return no;
  443|   171k|}
parser.c:CleanTrailingWhitespace:
  450|   227k|{
  451|   227k|    Node* next;
  452|       |
  453|   227k|    if (!TY_(nodeIsText)(node))
  ------------------
  |  |   23|   227k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   227k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (453:9): [True: 0, False: 227k]
  ------------------
  454|      0|        return no;
  455|       |
  456|   227k|    if (node->parent->type == DocTypeTag)
  ------------------
  |  Branch (456:9): [True: 705, False: 226k]
  ------------------
  457|    705|        return no;
  458|       |
  459|   226k|    if (IsPreDescendant(node))
  ------------------
  |  Branch (459:9): [True: 14.3k, False: 212k]
  ------------------
  460|  14.3k|        return no;
  461|       |
  462|   212k|    if (node->parent->tag && node->parent->tag->parser == TY_(ParseScript))
  ------------------
  |  |   23|   209k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   209k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (462:9): [True: 209k, False: 2.80k]
  |  Branch (462:30): [True: 2.47k, False: 207k]
  ------------------
  463|  2.47k|        return no;
  464|       |
  465|       |    /* #523, prevent blank spaces after script if the next item is script.
  466|       |     * This is actually more generalized as, if the next element is
  467|       |     * a body level script, then indicate that we want to clean trailing
  468|       |     * whitespace.
  469|       |     */
  470|   209k|    if ( node->next && nodeIsSCRIPT(node->next) && nodeIsBODY(node->next->parent) )
  ------------------
  |  |  422|   169k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|   379k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 169k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 37.4k, False: 132k]
  |  |  |  |  |  Branch (275:54): [True: 903, False: 36.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( node->next && nodeIsSCRIPT(node->next) && nodeIsBODY(node->next->parent) )
  ------------------
  |  |  375|    903|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|    903|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 903, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 492, False: 411]
  |  |  |  |  |  Branch (275:54): [True: 242, False: 250]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (470:10): [True: 169k, False: 40.0k]
  ------------------
  471|    242|        return yes;
  472|       |
  473|   209k|    next = node->next;
  474|       |
  475|       |    /* <p>... </p> */
  476|   209k|    if (!next && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |   23|  40.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (!next && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |  143|  40.0k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (476:9): [True: 40.0k, False: 169k]
  |  Branch (476:18): [True: 17.4k, False: 22.5k]
  ------------------
  477|  17.4k|        return yes;
  478|       |
  479|       |    /* <div><small>... </small><h3>...</h3></div> */
  480|   192k|    if (!next && node->parent->next && !TY_(nodeHasCM)(node->parent->next, CM_INLINE))
  ------------------
  |  |   23|  8.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (!next && node->parent->next && !TY_(nodeHasCM)(node->parent->next, CM_INLINE))
  ------------------
  |  |  143|  8.31k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (480:9): [True: 22.5k, False: 169k]
  |  Branch (480:18): [True: 8.31k, False: 14.2k]
  |  Branch (480:40): [True: 5.05k, False: 3.26k]
  ------------------
  481|  5.05k|        return yes;
  482|       |
  483|   187k|    if (!next)
  ------------------
  |  Branch (483:9): [True: 17.4k, False: 169k]
  ------------------
  484|  17.4k|        return no;
  485|       |
  486|   169k|    if (nodeIsBR(next))
  ------------------
  |  |  400|   169k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   169k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 169k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 37.2k, False: 132k]
  |  |  |  |  |  Branch (275:54): [True: 4.47k, False: 32.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  4.47k|        return yes;
  488|       |
  489|   165k|    if (TY_(nodeHasCM)(next, CM_INLINE))
  ------------------
  |  |   23|   165k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   165k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (TY_(nodeHasCM)(next, CM_INLINE))
  ------------------
  |  |  143|   165k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (489:9): [True: 20.1k, False: 144k]
  ------------------
  490|  20.1k|        return no;
  491|       |
  492|       |    /* <a href='/'>...</a> <p>...</p> */
  493|   144k|    if (next->type == StartTag)
  ------------------
  |  Branch (493:9): [True: 13.2k, False: 131k]
  ------------------
  494|  13.2k|        return yes;
  495|       |
  496|       |    /* <strong>...</strong> <hr /> */
  497|   131k|    if (next->type == StartEndTag)
  ------------------
  |  Branch (497:9): [True: 277, False: 131k]
  ------------------
  498|    277|        return yes;
  499|       |
  500|       |    /* evil adjacent text nodes, Tidy should not generate these :-( */
  501|   131k|    if (TY_(nodeIsText)(next) && next->start < next->end
  ------------------
  |  |   23|   131k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   131k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (501:9): [True: 95.8k, False: 35.6k]
  |  Branch (501:34): [True: 95.8k, False: 0]
  ------------------
  502|  95.8k|        && TY_(IsWhite)(doc->lexer->lexbuf[next->start]))
  ------------------
  |  |   23|  95.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  95.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (502:12): [True: 2.58k, False: 93.2k]
  ------------------
  503|  2.58k|        return yes;
  504|       |
  505|   128k|    return no;
  506|   131k|}

prvTidyInitPrintBuf:
  286|  40.4k|{
  287|  40.4k|    TidyClearMemory( &doc->pprint, sizeof(TidyPrintImpl) );
  ------------------
  |  |   70|  40.4k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  288|  40.4k|    InitIndent( &doc->pprint.indent[0] );
  289|  40.4k|    InitIndent( &doc->pprint.indent[1] );
  290|  40.4k|    doc->pprint.allocator = doc->allocator;
  291|  40.4k|    doc->pprint.line = 0;
  292|  40.4k|}
prvTidyFreePrintBuf:
  299|  20.2k|{
  300|  20.2k|    TidyDocFree( doc, doc->pprint.linebuf );
  ------------------
  |  |  159|  20.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  301|  20.2k|    TY_(InitPrintBuf)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  302|  20.2k|}
prvTidyPFlushLine:
  847|  33.7k|{
  848|  33.7k|    TidyPrintImpl* pprint = &doc->pprint;
  849|       |
  850|  33.7k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (850:10): [True: 31.3k, False: 2.40k]
  ------------------
  851|  31.3k|        PFlushLineImpl( doc );
  852|       |
  853|  33.7k|    TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|  33.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  33.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  854|  33.7k|    pprint->line++;
  855|       |
  856|  33.7k|    if (pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (856:9): [True: 7, False: 33.7k]
  ------------------
  857|      7|    {
  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|      7|        pprint->indent[ 0 ].spaces = indent;
  862|      7|    }
  863|  33.7k|}
prvTidyTextNodeEndWithSpace:
 1667|  1.00M|{
 1668|  1.00M|    if (TY_(nodeIsText)(node) && node->end > node->start)
  ------------------
  |  |   23|  1.00M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1668:9): [True: 1.00M, False: 0]
  |  Branch (1668:34): [True: 1.00M, False: 0]
  ------------------
 1669|  1.00M|    {
 1670|  1.00M|        uint i, c = '\0'; /* initialised to avoid warnings */
 1671|  6.61M|        for (i = node->start; i < node->end; ++i)
  ------------------
  |  Branch (1671:31): [True: 5.60M, False: 1.00M]
  ------------------
 1672|  5.60M|        {
 1673|  5.60M|            c = (byte) lexer->lexbuf[i];
 1674|  5.60M|            if ( c > 0x7F )
  ------------------
  |  Branch (1674:18): [True: 723k, False: 4.88M]
  ------------------
 1675|   723k|                i += TY_(GetUTF8)( lexer->lexbuf + i, &c );
  ------------------
  |  |   23|   723k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   723k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1676|  5.60M|        }
 1677|       |
 1678|  1.00M|        if ( c == ' ' || c == '\n' )
  ------------------
  |  Branch (1678:14): [True: 13.0k, False: 995k]
  |  Branch (1678:26): [True: 732, False: 995k]
  ------------------
 1679|  13.8k|            return yes;
 1680|  1.00M|    }
 1681|   995k|    return no;
 1682|  1.00M|}
prvTidyPPrintTree:
 2275|  2.72M|{
 2276|  2.72M|    Node *content, *last;
 2277|  2.72M|    uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|  2.72M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 2278|  2.72M|    Bool xhtml = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  2.72M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.72M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2279|       |
 2280|  2.72M|    if ( node == NULL )
  ------------------
  |  Branch (2280:10): [True: 0, False: 2.72M]
  ------------------
 2281|      0|        return;
 2282|       |
 2283|  2.72M|    if (doc->progressCallback)
  ------------------
  |  Branch (2283:9): [True: 0, False: 2.72M]
  ------------------
 2284|      0|    {
 2285|      0|        doc->progressCallback( tidyImplToDoc(doc), node->line, node->column, doc->pprint.line + 1 );
  ------------------
  |  |  141|      0|#define tidyImplToDoc( doc )            ((TidyDoc)(doc))
  ------------------
 2286|      0|    }
 2287|       |
 2288|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_PPRINT)
 2289|       |    dbg_show_node( doc, node, 4, GetSpaces( &doc->pprint ) );
 2290|       |#endif
 2291|       |
 2292|  2.72M|    if (node->type == TextNode)
  ------------------
  |  Branch (2292:9): [True: 220k, False: 2.50M]
  ------------------
 2293|   220k|    {
 2294|   220k|        PPrintText( doc, mode, indent, node );
 2295|   220k|    }
 2296|  2.50M|    else if ( node->type == CommentTag )
  ------------------
  |  Branch (2296:15): [True: 95.9k, False: 2.41M]
  ------------------
 2297|  95.9k|    {
 2298|  95.9k|        PPrintComment( doc, indent, node );
 2299|  95.9k|    }
 2300|  2.41M|    else if ( node->type == RootNode )
  ------------------
  |  Branch (2300:15): [True: 20.2k, False: 2.39M]
  ------------------
 2301|  20.2k|    {
 2302|  64.7k|        for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2302:40): [True: 44.5k, False: 20.2k]
  ------------------
 2303|  44.5k|           TY_(PPrintTree)( doc, mode, indent, content );
  ------------------
  |  |   23|  44.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2304|  20.2k|    }
 2305|  2.39M|    else if ( node->type == DocTypeTag )
  ------------------
  |  Branch (2305:15): [True: 31.4k, False: 2.36M]
  ------------------
 2306|  31.4k|        PPrintDocType( doc, indent, node );
 2307|  2.36M|    else if ( node->type == ProcInsTag)
  ------------------
  |  Branch (2307:15): [True: 94.6k, False: 2.26M]
  ------------------
 2308|  94.6k|        PPrintPI( doc, indent, node );
 2309|  2.26M|    else if ( node->type == XmlDecl)
  ------------------
  |  Branch (2309:15): [True: 2.56k, False: 2.26M]
  ------------------
 2310|  2.56k|        PPrintXmlDecl( doc, indent, node );
 2311|  2.26M|    else if ( node->type == CDATATag)
  ------------------
  |  Branch (2311:15): [True: 1.81k, False: 2.26M]
  ------------------
 2312|  1.81k|        PPrintCDATA( doc, indent, node );
 2313|  2.26M|    else if ( node->type == SectionTag)
  ------------------
  |  Branch (2313:15): [True: 15.2k, False: 2.24M]
  ------------------
 2314|  15.2k|        PPrintSection( doc, indent, node );
 2315|  2.24M|    else if ( node->type == AspTag)
  ------------------
  |  Branch (2315:15): [True: 2.45k, False: 2.24M]
  ------------------
 2316|  2.45k|        PPrintAsp( doc, indent, node );
 2317|  2.24M|    else if ( node->type == JsteTag)
  ------------------
  |  Branch (2317:15): [True: 3.90k, False: 2.24M]
  ------------------
 2318|  3.90k|        PPrintJste( doc, indent, node );
 2319|  2.24M|    else if ( node->type == PhpTag)
  ------------------
  |  Branch (2319:15): [True: 371, False: 2.24M]
  ------------------
 2320|    371|        PPrintPhp( doc, indent, node );
 2321|  2.24M|    else if ( nodeIsMATHML(node) )
  ------------------
  |  |  465|  2.24M|#define nodeIsMATHML( node )     TagIsId( node, TidyTag_MATHML ) /* #130 MathML attr and entity fix! */
  |  |  ------------------
  |  |  |  |  275|  2.24M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.24M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.23M, False: 4.62k]
  |  |  |  |  |  Branch (275:54): [True: 333, False: 2.23M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2322|    333|        PPrintMathML( doc, indent, node ); /* #130 MathML attr and entity fix! */
 2323|  2.23M|    else if ( TY_(nodeCMIsEmpty)(node) ||
  ------------------
  |  |   23|  2.23M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.23M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2323:15): [True: 65.3k, False: 2.17M]
  ------------------
 2324|  2.17M|              (node->type == StartEndTag && !xhtml) )
  ------------------
  |  Branch (2324:16): [True: 4.34k, False: 2.17M]
  |  Branch (2324:45): [True: 0, False: 4.34k]
  ------------------
 2325|  65.3k|    {
 2326|       |        /* Issue #8 - flush to new line? 
 2327|       |           maybe use if ( TY_(nodeHasCM)(node, CM_BLOCK) ) instead
 2328|       |           or remove the CM_INLINE from the tag
 2329|       |         */
 2330|  65.3k|        if ( ! TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|  65.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  65.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( ! TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|  65.3k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2330:14): [True: 40.7k, False: 24.6k]
  ------------------
 2331|  40.7k|            PCondFlushLineSmart( doc, indent );
 2332|       |
 2333|  65.3k|        if ( nodeIsBR(node) && node->prev &&
  ------------------
  |  |  400|  65.3k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   130k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 65.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 65.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 18.4k, False: 46.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2333:32): [True: 16.8k, False: 1.63k]
  ------------------
 2334|  16.8k|             !(nodeIsBR(node->prev) || (mode & PREFORMATTED)) &&
  ------------------
  |  |  400|  16.8k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  33.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 16.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 11.5k, False: 5.27k]
  |  |  |  |  |  Branch (275:54): [True: 10.6k, False: 960]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2334:40): [True: 1.25k, False: 4.97k]
  ------------------
 2335|  4.97k|             cfgBool(doc, TidyBreakBeforeBR) )
  ------------------
  |  |  418|  4.97k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  4.97k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 4.97k]
  |  |  ------------------
  ------------------
 2336|      0|            PFlushLineSmart( doc, indent );
 2337|       |
 2338|  65.3k|        if ( nodeIsHR(node) )
  ------------------
  |  |  380|  65.3k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  65.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 65.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 65.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.82k, False: 59.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2339|  5.82k|        {
 2340|       |            /* insert extra newline for classic formatting */
 2341|  5.82k|            Bool classic = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
  ------------------
  |  |   51|  5.82k|#define TidyClassicVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyYesState) ? yes : no)
  |  |  ------------------
  |  |  |  |  421|  5.82k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  5.82k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (51:24): [True: 0, False: 5.82k]
  |  |  ------------------
  ------------------
 2342|  5.82k|            if (classic && node->parent && node->parent->content != node)
  ------------------
  |  Branch (2342:17): [True: 0, False: 5.82k]
  |  Branch (2342:28): [True: 0, False: 0]
  |  Branch (2342:44): [True: 0, False: 0]
  ------------------
 2343|      0|            {
 2344|      0|                PFlushLineSmart( doc, indent );
 2345|      0|            }
 2346|  5.82k|        }
 2347|       |
 2348|  65.3k|        PPrintTag( doc, mode, indent, node );
 2349|       |
 2350|  65.3k|        if (node->next)
  ------------------
  |  Branch (2350:13): [True: 56.4k, False: 8.86k]
  ------------------
 2351|  56.4k|        {
 2352|  56.4k|          if (nodeIsPARAM(node) || nodeIsAREA(node))
  ------------------
  |  |  409|  56.4k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|   112k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 56.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 56.4k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.14k, False: 55.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                        if (nodeIsPARAM(node) || nodeIsAREA(node))
  ------------------
  |  |  414|  55.3k|#define nodeIsAREA( node )       TagIsId( node, TidyTag_AREA )
  |  |  ------------------
  |  |  |  |  275|  55.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 55.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 55.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.32k, False: 54.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2353|  2.46k|              PCondFlushLineSmart(doc, indent);
 2354|  54.0k|          else if ((nodeIsBR(node) && !(mode & PREFORMATTED))
  ------------------
  |  |  400|  54.0k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   108k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 54.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 54.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 16.8k, False: 37.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2354:39): [True: 12.3k, False: 4.56k]
  ------------------
 2355|  41.7k|                   || nodeIsHR(node))
  ------------------
  |  |  380|  41.7k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  41.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 41.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 41.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.73k, False: 36.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2356|  17.0k|              PFlushLineSmart(doc, indent);
 2357|  56.4k|        }
 2358|  65.3k|    }
 2359|  2.17M|    else /* some kind of container element */
 2360|  2.17M|    {
 2361|  2.17M|        if ( node->type == StartEndTag )
  ------------------
  |  Branch (2361:14): [True: 4.34k, False: 2.17M]
  ------------------
 2362|  4.34k|            node->type = StartTag;
 2363|       |
 2364|  2.17M|        if ( node->tag && 
  ------------------
  |  Branch (2364:14): [True: 2.16M, False: 4.62k]
  ------------------
 2365|  2.16M|             (node->tag->parser == TY_(ParsePre) || nodeIsTEXTAREA(node)) )
  ------------------
  |  |   23|  2.16M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.16M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           (node->tag->parser == TY_(ParsePre) || nodeIsTEXTAREA(node)) )
  ------------------
  |  |  425|  2.16M|#define nodeIsTEXTAREA( node )   TagIsId( node, TidyTag_TEXTAREA )
  |  |  ------------------
  |  |  |  |  275|  2.16M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.16M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.16M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.56k, False: 2.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2365:15): [True: 6.64k, False: 2.16M]
  ------------------
 2366|  8.21k|        {
 2367|  8.21k|            Bool classic  = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
  ------------------
  |  |   51|  8.21k|#define TidyClassicVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyYesState) ? yes : no)
  |  |  ------------------
  |  |  |  |  421|  8.21k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  8.21k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (51:24): [True: 0, False: 8.21k]
  |  |  ------------------
  ------------------
 2368|  8.21k|            uint indprev = indent;
 2369|       |
 2370|  8.21k|            PCondFlushLineSmart( doc, indent ); /* about to add <pre> tag - clear any previous */
 2371|       |
 2372|       |            /* insert extra newline for classic formatting */
 2373|  8.21k|            if (classic && node->parent && node->parent->content != node)
  ------------------
  |  Branch (2373:17): [True: 0, False: 8.21k]
  |  Branch (2373:28): [True: 0, False: 0]
  |  Branch (2373:44): [True: 0, False: 0]
  ------------------
 2374|      0|            {
 2375|      0|                PFlushLineSmart( doc, indent );
 2376|      0|            }
 2377|       |
 2378|       |            /* Issue #697 - Add NOWRAP to the mode */
 2379|  8.21k|            PPrintTag( doc, (mode | NOWRAP), indent, node );   /* add <pre> or <textarea> tag */
 2380|       |
 2381|  8.21k|            indent = 0;
 2382|       |            /* @camoy Fix #158 - remove inserted newlines in pre - PFlushLineSmart( doc, indent ); */
 2383|       |
 2384|  31.2k|            for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2384:44): [True: 22.9k, False: 8.21k]
  ------------------
 2385|  22.9k|            {
 2386|  22.9k|                TY_(PPrintTree)( doc, (mode | PREFORMATTED | NOWRAP),
  ------------------
  |  |   23|  22.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2387|  22.9k|                                 indent, content );
 2388|  22.9k|            }
 2389|       |
 2390|       |            /* @camoy Fix #158 - remove inserted newlines in pre - PCondFlushLineSmart( doc, indent ); */
 2391|  8.21k|            indent = indprev;
 2392|  8.21k|            PPrintEndTag( doc, mode, indent, node );
 2393|       |
 2394|  8.21k|            if ( cfgAutoBool(doc, TidyIndentContent) == TidyNoState
  ------------------
  |  |  421|  8.21k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  8.21k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2394:18): [True: 8.21k, False: 0]
  ------------------
 2395|  8.21k|                 && node->next != NULL )
  ------------------
  |  Branch (2395:21): [True: 7.48k, False: 724]
  ------------------
 2396|  7.48k|                PFlushLineSmart( doc, indent );
 2397|  8.21k|        }
 2398|  2.16M|        else if ( nodeIsSTYLE(node) || nodeIsSCRIPT(node) )
  ------------------
  |  |  421|  2.16M|#define nodeIsSTYLE( node )      TagIsId( node, TidyTag_STYLE )
  |  |  ------------------
  |  |  |  |  275|  4.33M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.16M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.16M, False: 4.62k]
  |  |  |  |  |  Branch (275:54): [True: 1.52k, False: 2.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      else if ( nodeIsSTYLE(node) || nodeIsSCRIPT(node) )
  ------------------
  |  |  422|  2.16M|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  2.16M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.16M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.16M, False: 4.62k]
  |  |  |  |  |  Branch (275:54): [True: 2.27k, False: 2.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2399|  3.79k|        {
 2400|  3.79k|            PPrintScriptStyle( doc, (mode | PREFORMATTED | NOWRAP | CDATA),
 2401|  3.79k|                               indent, node );
 2402|  3.79k|        }
 2403|  2.16M|        else if ( TY_(nodeCMIsInline)(node) )
  ------------------
  |  |   23|  2.16M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.16M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2403:19): [True: 1.80M, False: 360k]
  ------------------
 2404|  1.80M|        {
 2405|  1.80M|            if ( cfgBool(doc, TidyMakeClean) )
  ------------------
  |  |  418|  1.80M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.80M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 1.80M]
  |  |  ------------------
  ------------------
 2406|      0|            {
 2407|       |                /* replace <nobr>...</nobr> by &nbsp; or &#160; etc. */
 2408|      0|                if ( nodeIsNOBR(node) )
  ------------------
  |  |  415|      0|#define nodeIsNOBR( node )       TagIsId( node, TidyTag_NOBR )
  |  |  ------------------
  |  |  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2409|      0|                {
 2410|      0|                    for ( content = node->content;
 2411|      0|                          content != NULL;
  ------------------
  |  Branch (2411:27): [True: 0, False: 0]
  ------------------
 2412|      0|                          content = content->next)
 2413|      0|                        TY_(PPrintTree)( doc, mode|NOWRAP, indent, content );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2414|      0|                    return;
 2415|      0|                }
 2416|      0|            }
 2417|       |
 2418|       |            /* otherwise a normal inline element */
 2419|  1.80M|            PPrintTag( doc, mode, indent, node );
 2420|       |
 2421|       |            /* indent content for SELECT, TEXTAREA, MAP, OBJECT and APPLET */
 2422|  1.80M|            if ( ShouldIndent(doc, node) )
  ------------------
  |  Branch (2422:18): [True: 0, False: 1.80M]
  ------------------
 2423|      0|            {
 2424|      0|                indent += spaces;
 2425|      0|                PCondFlushLineSmart( doc, indent );
 2426|       |
 2427|      0|                for ( content = node->content;
 2428|      0|                      content != NULL;
  ------------------
  |  Branch (2428:23): [True: 0, False: 0]
  ------------------
 2429|      0|                      content = content->next )
 2430|      0|                    TY_(PPrintTree)( doc, mode, indent, content );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2431|       |
 2432|      0|                indent -= spaces;
 2433|      0|                PCondFlushLineSmart( doc, indent );
 2434|       |                /* PCondFlushLine( doc, indent ); */
 2435|      0|            }
 2436|  1.80M|            else
 2437|  1.80M|            {
 2438|  1.80M|                for ( content = node->content;
 2439|  3.67M|                      content != NULL;
  ------------------
  |  Branch (2439:23): [True: 1.87M, False: 1.80M]
  ------------------
 2440|  1.87M|                      content = content->next )
 2441|  1.87M|                    TY_(PPrintTree)( doc, mode, indent, content );
  ------------------
  |  |   23|  1.87M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.87M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2442|  1.80M|            }
 2443|  1.80M|            PPrintEndTag( doc, mode, indent, node );
 2444|  1.80M|        }
 2445|   360k|        else /* other tags */
 2446|   360k|        {
 2447|   360k|            Bool indcont  = ( cfgAutoBool(doc, TidyIndentContent) != TidyNoState );
  ------------------
  |  |  421|   360k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   360k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2448|       |            /* Issue #582 - Seems this is no longer used
 2449|       |               Bool indsmart = ( cfgAutoBool(doc, TidyIndentContent) == TidyAutoState ); */
 2450|   360k|            Bool hideend  = cfgBool( doc, TidyOmitOptionalTags );
  ------------------
  |  |  418|   360k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   360k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2451|   360k|            Bool classic  = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
  ------------------
  |  |   51|   360k|#define TidyClassicVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyYesState) ? yes : no)
  |  |  ------------------
  |  |  |  |  421|   360k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|   360k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (51:24): [True: 0, False: 360k]
  |  |  ------------------
  ------------------
 2452|   360k|            uint contentIndent = indent;
 2453|       |
 2454|       |            /* insert extra newline for classic formatting */
 2455|   360k|            if (classic && node->parent && node->parent->content != node && !nodeIsHTML(node))
  ------------------
  |  |  370|      0|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  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 (2455:17): [True: 0, False: 360k]
  |  Branch (2455:28): [True: 0, False: 0]
  |  Branch (2455:44): [True: 0, False: 0]
  ------------------
 2456|      0|            {
 2457|      0|                PFlushLineSmart( doc, indent );
 2458|      0|            }
 2459|       |
 2460|   360k|            if ( ShouldIndent(doc, node) )
  ------------------
  |  Branch (2460:18): [True: 0, False: 360k]
  ------------------
 2461|      0|                contentIndent += spaces;
 2462|       |
 2463|   360k|            PCondFlushLineSmart( doc, indent );
 2464|       |
 2465|       |            /*\
 2466|       |             *  Issue #180 - with the above PCondFlushLine, 
 2467|       |             *  this adds an unnecessary additional line!
 2468|       |             *  Maybe only if 'classic' ie --vertical-space yes 
 2469|       |             *  Issue #582 - maybe this is no longer needed!
 2470|       |             *  It adds a 3rd newline if indent: auto...
 2471|       |             *  if ( indsmart && node->prev != NULL && classic)
 2472|       |             *   PFlushLineSmart( doc, indent );
 2473|       |            \*/
 2474|       |
 2475|       |            /* do not omit elements with attributes */
 2476|   360k|            if ( !hideend || !TY_(nodeHasCM)(node, CM_OMITST) ||
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if ( !hideend || !TY_(nodeHasCM)(node, CM_OMITST) ||
  ------------------
  |  |  160|      0|#define CM_OMITST       (1 << 21)  /**< Elements that cannot be omitted. */
  ------------------
  |  Branch (2476:18): [True: 360k, False: 0]
  |  Branch (2476:30): [True: 0, False: 0]
  ------------------
 2477|      0|                 node->attributes != NULL )
  ------------------
  |  Branch (2477:18): [True: 0, False: 0]
  ------------------
 2478|   360k|            {
 2479|   360k|                PPrintTag( doc, mode, indent, node );
 2480|       |
 2481|   360k|                if ( ShouldIndent(doc, node) )
  ------------------
  |  Branch (2481:22): [True: 0, False: 360k]
  ------------------
 2482|      0|                {
 2483|       |                    /* fix for bug 530791, don't wrap after */
 2484|       |                    /* <li> if first child is text node     */
 2485|      0|                    if (!(nodeIsLI(node) && TY_(nodeIsText)(node->content)))
  ------------------
  |  |  390|      0|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if (!(nodeIsLI(node) && TY_(nodeIsText)(node->content)))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2485:45): [True: 0, False: 0]
  ------------------
 2486|      0|                        PCondFlushLineSmart( doc, contentIndent );
 2487|      0|                }
 2488|   360k|                else if ( TY_(nodeHasCM)(node, CM_HTML) || nodeIsNOFRAMES(node) ||
  ------------------
  |  |   23|   360k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   360k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_HTML) || nodeIsNOFRAMES(node) ||
  ------------------
  |  |  140|   360k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_HTML) || nodeIsNOFRAMES(node) ||
  ------------------
  |  |  379|   221k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|   582k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 221k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 217k, False: 4.62k]
  |  |  |  |  |  Branch (275:54): [True: 13.4k, False: 203k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2488:27): [True: 138k, False: 221k]
  ------------------
 2489|   208k|                          (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node)) )
  ------------------
  |  |   23|   208k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   208k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                        (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node)) )
  ------------------
  |  |  141|   208k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
                                        (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node)) )
  ------------------
  |  |  372|  24.1k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  24.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 24.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 24.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 23.0k, False: 1.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2489:28): [True: 24.1k, False: 184k]
  ------------------
 2490|   153k|                    PFlushLineSmart( doc, contentIndent );
 2491|   360k|            }
 2492|      0|            else if ( ShouldIndent(doc, node) )
  ------------------
  |  Branch (2492:23): [True: 0, False: 0]
  ------------------
 2493|      0|            {
 2494|       |                /*\
 2495|       |                 * Issue #180 - If the tag was NOT printed due to the -omit option,
 2496|       |                 * then reduce the bumped indent under the same ShouldIndent(doc, node) 
 2497|       |                 * conditions that caused the indent to be bumped.
 2498|       |                \*/
 2499|      0|                contentIndent -= spaces;
 2500|      0|            }
 2501|       |
 2502|   360k|            last = NULL;
 2503|  1.12M|            for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2503:44): [True: 760k, False: 360k]
  ------------------
 2504|   760k|            {
 2505|       |                /* kludge for naked text before block level tag */
 2506|   760k|                if ( last && !indcont && TY_(nodeIsText)(last) &&
  ------------------
  |  |   23|   445k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   445k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2506:22): [True: 445k, False: 314k]
  |  Branch (2506:30): [True: 445k, False: 0]
  |  Branch (2506:42): [True: 129k, False: 315k]
  ------------------
 2507|   129k|                     content->tag && !TY_(nodeHasCM)(content, CM_INLINE) )
  ------------------
  |  |   23|  17.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   content->tag && !TY_(nodeHasCM)(content, CM_INLINE) )
  ------------------
  |  |  143|  17.9k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2507:22): [True: 17.9k, False: 111k]
  |  Branch (2507:38): [True: 11.9k, False: 6.01k]
  ------------------
 2508|  11.9k|                {
 2509|       |                    /* TY_(PFlushLine)(fout, indent); */
 2510|  11.9k|                    PFlushLineSmart( doc, contentIndent );
 2511|  11.9k|                }
 2512|       |
 2513|   760k|                TY_(PPrintTree)( doc, mode, contentIndent, content );
  ------------------
  |  |   23|   760k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   760k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2514|   760k|                last = content;
 2515|   760k|            }
 2516|       |
 2517|       |            /* don't flush line for td and th */
 2518|   360k|            if ( ShouldIndent(doc, node) ||
  ------------------
  |  Branch (2518:18): [True: 0, False: 360k]
  ------------------
 2519|   360k|                 ( !hideend &&
  ------------------
  |  Branch (2519:20): [True: 360k, False: 0]
  ------------------
 2520|   360k|                   ( TY_(nodeHasCM)(node, CM_HTML) || 
  ------------------
  |  |   23|   360k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   360k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                 ( TY_(nodeHasCM)(node, CM_HTML) || 
  ------------------
  |  |  140|   360k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
  |  Branch (2520:22): [True: 138k, False: 221k]
  ------------------
 2521|   360k|                     nodeIsNOFRAMES(node) ||
  ------------------
  |  |  379|   221k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|   582k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 221k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 217k, False: 4.62k]
  |  |  |  |  |  Branch (275:54): [True: 13.4k, False: 203k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2522|   208k|                     (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node))
  ------------------
  |  |   23|   208k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   208k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node))
  ------------------
  |  |  141|   208k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
                                   (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node))
  ------------------
  |  |  372|  24.1k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  24.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 24.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 24.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 23.0k, False: 1.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2522:23): [True: 24.1k, False: 184k]
  ------------------
 2523|   360k|                   )
 2524|   360k|                 )
 2525|   360k|               )
 2526|   153k|            {
 2527|   153k|                PCondFlushLineSmart( doc, indent );
 2528|   153k|                if ( !hideend || !TY_(nodeHasCM)(node, CM_OPT) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( !hideend || !TY_(nodeHasCM)(node, CM_OPT) )
  ------------------
  |  |  154|      0|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (2528:22): [True: 153k, False: 0]
  |  Branch (2528:34): [True: 0, False: 0]
  ------------------
 2529|   153k|                {
 2530|   153k|                    PPrintEndTag( doc, mode, indent, node );
 2531|       |                    /* TY_(PFlushLine)( doc, indent ); */
 2532|   153k|                }
 2533|   153k|            }
 2534|   207k|            else
 2535|   207k|            {
 2536|   207k|                if ( !hideend || !TY_(nodeHasCM)(node, CM_OPT) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( !hideend || !TY_(nodeHasCM)(node, CM_OPT) )
  ------------------
  |  |  154|      0|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (2536:22): [True: 207k, False: 0]
  |  Branch (2536:34): [True: 0, False: 0]
  ------------------
 2537|   207k|                {
 2538|       |                    /* newline before endtag for classic formatting */
 2539|   207k|                    if ( classic && !HasMixedContent(node) )
  ------------------
  |  Branch (2539:26): [True: 0, False: 207k]
  |  Branch (2539:37): [True: 0, False: 0]
  ------------------
 2540|      0|                        PFlushLineSmart( doc, indent );
 2541|   207k|                    PPrintEndTag( doc, mode, indent, node );
 2542|   207k|                }
 2543|      0|                else if (hideend)
  ------------------
  |  Branch (2543:26): [True: 0, False: 0]
  ------------------
 2544|      0|                {
 2545|       |                    /* Issue #390  - must still deal with adjusting indent */
 2546|      0|                    TidyPrintImpl* pprint = &doc->pprint;
 2547|      0|                    if (pprint->indent[ 0 ].spaces != (int)indent)
  ------------------
  |  Branch (2547:25): [True: 0, False: 0]
  ------------------
 2548|      0|                    {
 2549|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_INDENT)
 2550|       |                        SPRTF("%s Indent from %d to %d\n", __FUNCTION__, pprint->indent[ 0 ].spaces, indent );
 2551|       |#endif  
 2552|      0|                        pprint->indent[ 0 ].spaces = indent;
 2553|      0|                    }
 2554|      0|                }
 2555|   207k|            }
 2556|       |
 2557|   360k|            if (!indcont && !hideend && !nodeIsHTML(node) && !classic)
  ------------------
  |  |  370|   360k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   721k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 360k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 356k, False: 4.62k]
  |  |  |  |  |  Branch (275:54): [True: 44.4k, False: 311k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2557:17): [True: 360k, False: 0]
  |  Branch (2557:29): [True: 360k, False: 0]
  |  Branch (2557:62): [True: 316k, False: 0]
  ------------------
 2558|   316k|                PFlushLineSmart( doc, indent );
 2559|  44.4k|            else if (classic && node->next != NULL && TY_(nodeHasCM)(node, CM_LIST|CM_DEFLIST|CM_TABLE|CM_BLOCK/*|CM_HEADING*/))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if (classic && node->next != NULL && TY_(nodeHasCM)(node, CM_LIST|CM_DEFLIST|CM_TABLE|CM_BLOCK/*|CM_HEADING*/))
  ------------------
  |  |  144|      0|#define CM_LIST         (1 << 5)   /**< Elements that mark list item ("LI"). */
  ------------------
                          else if (classic && node->next != NULL && TY_(nodeHasCM)(node, CM_LIST|CM_DEFLIST|CM_TABLE|CM_BLOCK/*|CM_HEADING*/))
  ------------------
  |  |  145|      0|#define CM_DEFLIST      (1 << 6)   /**< Elements that mark definition list item ("DL", "DT"). */
  ------------------
                          else if (classic && node->next != NULL && TY_(nodeHasCM)(node, CM_LIST|CM_DEFLIST|CM_TABLE|CM_BLOCK/*|CM_HEADING*/))
  ------------------
  |  |  146|      0|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                          else if (classic && node->next != NULL && TY_(nodeHasCM)(node, CM_LIST|CM_DEFLIST|CM_TABLE|CM_BLOCK/*|CM_HEADING*/))
  ------------------
  |  |  142|      0|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (2559:22): [True: 0, False: 44.4k]
  |  Branch (2559:33): [True: 0, False: 0]
  |  Branch (2559:55): [True: 0, False: 0]
  ------------------
 2560|      0|                PFlushLineSmart( doc, indent );
 2561|   360k|        }
 2562|  2.17M|    }
 2563|  2.72M|}
pprint.c:InitIndent:
  275|  86.5k|{
  276|  86.5k|    ind->spaces = -1;
  277|  86.5k|    ind->attrValStart = -1;
  278|  86.5k|    ind->attrStringStart = -1;
  279|  86.5k|}
pprint.c:PFlushLineImpl:
  821|   904k|{
  822|   904k|    TidyPrintImpl* pprint = &doc->pprint;
  823|       |
  824|   904k|    uint i;
  825|       |
  826|   904k|    CheckWrapLine( doc );
  827|       |
  828|   904k|    if ( WantIndent(doc) )
  ------------------
  |  Branch (828:10): [True: 248, False: 904k]
  ------------------
  829|    248|        WriteIndentChar(doc);
  830|       |
  831|   300M|    for ( i = 0; i < pprint->linelen; ++i )
  ------------------
  |  Branch (831:18): [True: 299M, False: 904k]
  ------------------
  832|   299M|        TY_(WriteChar)( pprint->linebuf[i], doc->docOut );
  ------------------
  |  |   23|   299M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   299M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  833|       |
  834|   904k|    if ( IsInString(pprint) )
  ------------------
  |  Branch (834:10): [True: 0, False: 904k]
  ------------------
  835|      0|        TY_(WriteChar)( '\\', doc->docOut );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  836|   904k|    ResetLine( pprint );
  837|   904k|    pprint->linelen = 0;
  838|   904k|}
pprint.c:CheckWrapLine:
  680|   904k|{
  681|   904k|    TidyPrintImpl* pprint = &doc->pprint;
  682|   904k|    if ( GetSpaces(pprint) + pprint->linelen >= cfg(doc, TidyWrapLen) )
  ------------------
  |  |  415|   904k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (682:10): [True: 66.6k, False: 837k]
  ------------------
  683|  66.6k|    {
  684|  66.6k|        WrapLine( doc );
  685|  66.6k|        return yes;
  686|  66.6k|    }
  687|   837k|    return no;
  688|   904k|}
pprint.c:GetSpaces:
  343|   273M|{
  344|   273M|    int spaces = pprint->indent[ 0 ].spaces;
  345|   273M|    return ( spaces < 0 ? 0U : (uint) spaces );
  ------------------
  |  Branch (345:14): [True: 2.07k, False: 273M]
  ------------------
  346|   273M|}
pprint.c:WrapLine:
  652|   267M|{
  653|   267M|    TidyPrintImpl* pprint = &doc->pprint;
  654|   267M|    uint i;
  655|       |
  656|   267M|    if ( pprint->wraphere == 0 )
  ------------------
  |  Branch (656:10): [True: 267M, False: 86.2k]
  ------------------
  657|   267M|        return;
  658|       |
  659|  86.2k|    if ( WantIndent(doc) )
  ------------------
  |  Branch (659:10): [True: 0, False: 86.2k]
  ------------------
  660|      0|        WriteIndentChar(doc);
  661|       |
  662|  20.5M|    for ( i = 0; i < pprint->wraphere; ++i )
  ------------------
  |  Branch (662:18): [True: 20.4M, False: 86.2k]
  ------------------
  663|  20.4M|        TY_(WriteChar)( pprint->linebuf[i], doc->docOut );
  ------------------
  |  |   23|  20.4M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  664|       |
  665|  86.2k|    if ( IsWrapInString(pprint) )
  ------------------
  |  Branch (665:10): [True: 0, False: 86.2k]
  ------------------
  666|      0|        TY_(WriteChar)( '\\', doc->docOut );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  667|       |
  668|  86.2k|    TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|  86.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  86.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  669|  86.2k|    pprint->line++;
  670|  86.2k|    ResetLineAfterWrap( pprint );
  671|  86.2k|}
pprint.c:IsWrapInString:
  392|  86.5k|{
  393|  86.5k|    TidyIndent *ind = pprint->indent + 0; /* Always 1st */
  394|  86.5k|    int wrap = (int) pprint->wraphere;
  395|  86.5k|    return ( ind->attrStringStart == 0 ||
  ------------------
  |  Branch (395:14): [True: 0, False: 86.5k]
  ------------------
  396|  86.5k|             (ind->attrStringStart > 0 && ind->attrStringStart < wrap) );
  ------------------
  |  Branch (396:15): [True: 0, False: 86.5k]
  |  Branch (396:43): [True: 0, False: 0]
  ------------------
  397|  86.5k|}
pprint.c:ResetLineAfterWrap:
  595|  86.2k|{
  596|  86.2k|    if ( pprint->linelen > pprint->wraphere )
  ------------------
  |  Branch (596:10): [True: 86.2k, False: 0]
  ------------------
  597|  86.2k|    {
  598|  86.2k|        uint *p = pprint->linebuf;
  599|  86.2k|        uint *q = p + pprint->wraphere;
  600|  86.2k|        uint *end = p + pprint->linelen;
  601|       |
  602|  86.2k|        if ( ! IsWrapInAttrVal(pprint) )
  ------------------
  |  Branch (602:14): [True: 86.2k, False: 0]
  ------------------
  603|  86.2k|        {
  604|   121k|            while ( q < end && *q == ' ' )
  ------------------
  |  Branch (604:21): [True: 98.0k, False: 23.7k]
  |  Branch (604:32): [True: 35.5k, False: 62.4k]
  ------------------
  605|  35.5k|                ++q, ++pprint->wraphere;
  606|  86.2k|        }
  607|       |
  608|  8.55M|        while ( q < end )
  ------------------
  |  Branch (608:17): [True: 8.46M, False: 86.2k]
  ------------------
  609|  8.46M|            *p++ = *q++;
  610|       |
  611|  86.2k|        pprint->linelen -= pprint->wraphere;
  612|  86.2k|    }
  613|      0|    else
  614|      0|    {
  615|      0|        pprint->linelen = 0;
  616|      0|    }
  617|       |
  618|  86.2k|    ResetLine( pprint );
  619|  86.2k|}
pprint.c:IsWrapInAttrVal:
  430|  86.5k|{
  431|  86.5k|    TidyIndent *ind = pprint->indent + 0; /* Always 1st */
  432|  86.5k|    int wrap = (int) pprint->wraphere;
  433|  86.5k|    return ( ind->attrValStart == 0 ||
  ------------------
  |  Branch (433:14): [True: 0, False: 86.5k]
  ------------------
  434|  86.5k|             (ind->attrValStart > 0 && ind->attrValStart < wrap) );
  ------------------
  |  Branch (434:15): [True: 268, False: 86.2k]
  |  Branch (434:40): [True: 0, False: 268]
  ------------------
  435|  86.5k|}
pprint.c:WantIndent:
  489|   990k|{
  490|   990k|    TidyPrintImpl* pprint = &doc->pprint;
  491|   990k|    Bool wantIt = GetSpaces(pprint) > 0;
  492|   990k|    if ( wantIt )
  ------------------
  |  Branch (492:10): [True: 248, False: 990k]
  ------------------
  493|    248|    {
  494|    248|        Bool indentAttrs = cfgBool( doc, TidyIndentAttributes );
  ------------------
  |  |  418|    248|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    248|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  495|    248|        wantIt = ( ( !IsWrapInAttrVal(pprint) || indentAttrs ) &&
  ------------------
  |  Branch (495:22): [True: 248, False: 0]
  |  Branch (495:50): [True: 0, False: 0]
  ------------------
  496|    248|                   !IsWrapInString(pprint) );
  ------------------
  |  Branch (496:20): [True: 248, False: 0]
  ------------------
  497|    248|    }
  498|   990k|    return wantIt;
  499|   990k|}
pprint.c:WriteIndentChar:
  630|    248|{
  631|    248|    TidyPrintImpl* pprint = &doc->pprint;
  632|    248|    uint i;
  633|    248|    uint spaces = GetSpaces(pprint);
  634|    248|    uint tabsize = cfg(doc, TidyTabSize);
  ------------------
  |  |  415|    248|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  635|    248|    if (spaces && (doc->indent_char == '\t') && tabsize)
  ------------------
  |  Branch (635:9): [True: 248, False: 0]
  |  Branch (635:19): [True: 0, False: 248]
  |  Branch (635:49): [True: 0, False: 0]
  ------------------
  636|      0|    {
  637|      0|        spaces /= tabsize;  /* set number of tabs to output */
  638|      0|        if (spaces == 0)    /* with a minimum of one */
  ------------------
  |  Branch (638:13): [True: 0, False: 0]
  ------------------
  639|      0|            spaces = 1;
  640|      0|    }
  641|  1.05k|    for (i = 0; i < spaces; i++)
  ------------------
  |  Branch (641:17): [True: 807, False: 248]
  ------------------
  642|    807|        TY_(WriteChar)(doc->indent_char, doc->docOut); /* 20150515 - Issue #108 */
  ------------------
  |  |   23|    807|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    807|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  643|       |
  644|    248|}
pprint.c:IsInString:
  380|   904k|{
  381|   904k|    TidyIndent *ind = pprint->indent + 0; /* Always 1st */
  382|   904k|    return ( ind->attrStringStart >= 0 && 
  ------------------
  |  Branch (382:14): [True: 0, False: 904k]
  ------------------
  383|      0|             ind->attrStringStart < (int) pprint->linelen );
  ------------------
  |  Branch (383:14): [True: 0, False: 0]
  ------------------
  384|   904k|}
pprint.c:ResetLine:
  564|   990k|{
  565|   990k|    TidyIndent* ind = pprint->indent + 0;
  566|   990k|    if ( pprint->ixInd > 0 )
  ------------------
  |  Branch (566:10): [True: 5.70k, False: 984k]
  ------------------
  567|  5.70k|    {
  568|  5.70k|        ind[0] = ind[1];
  569|  5.70k|        InitIndent( &ind[1] );
  570|  5.70k|    }
  571|       |
  572|   990k|    if ( pprint->wraphere > 0 )
  ------------------
  |  Branch (572:10): [True: 542k, False: 447k]
  ------------------
  573|   542k|    {
  574|   542k|        int wrap = (int) pprint->wraphere;
  575|   542k|        if ( ind[0].attrStringStart > wrap )
  ------------------
  |  Branch (575:14): [True: 0, False: 542k]
  ------------------
  576|      0|            ind[0].attrStringStart -= wrap;
  577|   542k|        if ( ind[0].attrValStart > wrap )
  ------------------
  |  Branch (577:14): [True: 1.32k, False: 541k]
  ------------------
  578|  1.32k|            ind[0].attrValStart -= wrap;
  579|   542k|    }
  580|   447k|    else
  581|   447k|    {
  582|   447k|        if ( ind[0].attrStringStart > 0 )
  ------------------
  |  Branch (582:14): [True: 0, False: 447k]
  ------------------
  583|      0|            ind[0].attrStringStart = 0;
  584|   447k|        if ( ind[0].attrValStart > 0 )
  ------------------
  |  Branch (584:14): [True: 344, False: 447k]
  ------------------
  585|    344|            ind[0].attrValStart = 0;
  586|   447k|    }
  587|   990k|    pprint->wraphere = pprint->ixInd = 0;
  588|   990k|}
pprint.c:PPrintText:
 1359|   444k|{
 1360|   444k|    uint start = node->start;
 1361|   444k|    uint end = node->end;
 1362|   444k|    uint ix, c = 0;
 1363|   444k|    int  ixNL = TextEndsWithNewline( doc->lexer, node, mode );
 1364|   444k|    int  ixWS = TextStartsWithWhitespace( doc->lexer, node, start, mode );
 1365|   444k|    if ( ixNL > 0 )
  ------------------
  |  Branch (1365:10): [True: 58, False: 444k]
  ------------------
 1366|     58|      end -= ixNL;
 1367|   444k|    start = IncrWS( start, end, indent, ixWS );
 1368|       |
 1369|   269M|    for ( ix = start; ix < end; ++ix )
  ------------------
  |  Branch (1369:23): [True: 268M, False: 444k]
  ------------------
 1370|   268M|    {
 1371|   268M|        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|   268M|        c = (byte) doc->lexer->lexbuf[ix];
 1380|       |
 1381|       |        /* look for UTF-8 multibyte character */
 1382|   268M|        if ( c > 0x7F )
  ------------------
  |  Branch (1382:14): [True: 2.05M, False: 266M]
  ------------------
 1383|  2.05M|             ix += TY_(GetUTF8)( doc->lexer->lexbuf + ix, &c );
  ------------------
  |  |   23|  2.05M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.05M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1384|       |
 1385|   268M|        if ( c == '\n' )
  ------------------
  |  Branch (1385:14): [True: 10.0k, False: 268M]
  ------------------
 1386|  10.0k|        {
 1387|  10.0k|            TY_(PFlushLine)( doc, indent );
  ------------------
  |  |   23|  10.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1388|  10.0k|            ixWS = TextStartsWithWhitespace( doc->lexer, node, ix+1, mode );
 1389|  10.0k|            ix = IncrWS( ix, end, indent, ixWS );
 1390|  10.0k|        }
 1391|   268M|        else if (( c == '&' ) && (TY_(HTMLVersion)(doc) == HT50) &&
  ------------------
  |  |   23|   203k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   203k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      else if (( c == '&' ) && (TY_(HTMLVersion)(doc) == HT50) &&
  ------------------
  |  |  200|   203k|#define HT50              131072u
  ------------------
  |  Branch (1391:18): [True: 203k, False: 268M]
  |  Branch (1391:34): [True: 0, False: 203k]
  ------------------
 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|   268M|        else
 1401|   268M|        {
 1402|   268M|            PPrintChar( doc, c, mode );
 1403|   268M|        }
 1404|   268M|    }
 1405|   444k|}
pprint.c:TextEndsWithNewline:
  999|   446k|{
 1000|   446k|    if ( (mode & (CDATA|COMMENT)) && TY_(nodeIsText)(node) && node->end > node->start )
  ------------------
  |  |   23|   228k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   228k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1000:10): [True: 228k, False: 217k]
  |  Branch (1000:38): [True: 5.01k, False: 223k]
  |  Branch (1000:63): [True: 5.01k, False: 0]
  ------------------
 1001|  5.01k|    {
 1002|  5.01k|        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|  49.7k|        while ( ix > node->start && (ch = (lexer->lexbuf[ix] & 0xff))
  ------------------
  |  Branch (1007:17): [True: 48.8k, False: 968]
  |  Branch (1007:37): [True: 48.8k, False: 22]
  ------------------
 1008|  48.8k|                 && ( ch == ' ' || ch == '\t' || ch == '\r' ) )
  ------------------
  |  Branch (1008:23): [True: 44.5k, False: 4.27k]
  |  Branch (1008:36): [True: 241, False: 4.03k]
  |  Branch (1008:50): [True: 10, False: 4.02k]
  ------------------
 1009|  44.7k|            --ix;
 1010|       |
 1011|  5.01k|        if ( lexer->lexbuf[ ix ] == '\n' )
  ------------------
  |  Branch (1011:14): [True: 132, False: 4.88k]
  ------------------
 1012|    132|          return node->end - ix - 1; /* #543262 tidy eats all memory */
 1013|  5.01k|    }
 1014|   446k|    return -1;
 1015|   446k|}
pprint.c:TextStartsWithWhitespace:
 1044|   454k|{
 1045|   454k|    assert( node != NULL );
  ------------------
  |  Branch (1045:5): [True: 0, False: 454k]
  |  Branch (1045:5): [True: 454k, False: 0]
  ------------------
 1046|   454k|    if ( (mode & (CDATA|COMMENT)) && TY_(nodeIsTextLike)(node) && node->end > node->start && start >= node->start )
  ------------------
  |  |   23|   232k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   232k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1046:10): [True: 232k, False: 221k]
  |  Branch (1046:38): [True: 19.6k, False: 213k]
  |  Branch (1046:67): [True: 13.2k, False: 6.32k]
  |  Branch (1046:94): [True: 13.2k, False: 0]
  ------------------
 1047|  13.2k|    {
 1048|  13.2k|        uint ch, ix = start;
 1049|       |        /* Skip whitespace. */
 1050|  1.80M|        while ( ix < node->end && (ch = (lexer->lexbuf[ix] & 0xff))
  ------------------
  |  Branch (1050:17): [True: 1.80M, False: 1.41k]
  |  Branch (1050:35): [True: 1.80M, False: 420]
  ------------------
 1051|  1.80M|                && ( ch==' ' || ch=='\t' || ch=='\r' ) )
  ------------------
  |  Branch (1051:22): [True: 1.78M, False: 12.4k]
  |  Branch (1051:33): [True: 737, False: 11.7k]
  |  Branch (1051:45): [True: 287, False: 11.4k]
  ------------------
 1052|  1.79M|            ++ix;
 1053|       |
 1054|  13.2k|        if ( ix > start )
  ------------------
  |  Branch (1054:14): [True: 2.60k, False: 10.6k]
  ------------------
 1055|  2.60k|          return ix - start;
 1056|  13.2k|    }
 1057|   451k|    return -1;
 1058|   454k|}
pprint.c:prvTidynodeIsTextLike:
 1028|   232k|{
 1029|   232k|    if ( TY_(nodeIsText)(node) )
  ------------------
  |  |   23|   232k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   232k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1029:10): [True: 5.56k, False: 227k]
  ------------------
 1030|  5.56k|        return yes;
 1031|   227k|    if ( node->type == AspTag )
  ------------------
  |  Branch (1031:10): [True: 6.88k, False: 220k]
  ------------------
 1032|  6.88k|        return yes;
 1033|   220k|    if (node->type == PhpTag)
  ------------------
  |  Branch (1033:9): [True: 7.16k, False: 213k]
  ------------------
 1034|  7.16k|        return yes; /* Issue #392 */
 1035|       |    /* add other text like nodes... */
 1036|   213k|    return no;
 1037|   220k|}
pprint.c:IncrWS:
 1341|   454k|{
 1342|   454k|  if ( ixWS > 0 )
  ------------------
  |  Branch (1342:8): [True: 2.60k, False: 451k]
  ------------------
 1343|  2.60k|  {
 1344|  2.60k|    uint st = start + MIN( (uint)ixWS, indent );
  ------------------
  |  |   25|  2.60k|#define MIN(a,b) (((a) < (b))?(a):(b))
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 2.60k]
  |  |  ------------------
  ------------------
 1345|  2.60k|    start = MIN( st, end );
  ------------------
  |  |   25|  2.60k|#define MIN(a,b) (((a) < (b))?(a):(b))
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 2.60k, False: 0]
  |  |  ------------------
  ------------------
 1346|  2.60k|  }
 1347|   454k|  return start;
 1348|   454k|}
pprint.c:CheckWrapIndent:
  696|   271M|{
  697|   271M|    TidyPrintImpl* pprint = &doc->pprint;
  698|   271M|    if ( GetSpaces(pprint) + pprint->linelen >= cfg(doc, TidyWrapLen) )
  ------------------
  |  |  415|   271M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (698:10): [True: 267M, False: 4.60M]
  ------------------
  699|   267M|    {
  700|   267M|        WrapLine( doc );
  701|   267M|        if ( pprint->indent[ 0 ].spaces < 0 )
  ------------------
  |  Branch (701:14): [True: 28, False: 267M]
  ------------------
  702|     28|        {
  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|     28|            pprint->indent[ 0 ].spaces = indent;
  707|     28|        }
  708|   267M|        return yes;
  709|   267M|    }
  710|  4.60M|    return no;
  711|   271M|}
pprint.c:PPrintChar:
 1138|   284M|{
 1139|   284M|    tmbchar entity[128];
 1140|   284M|    ctmbstr p;
 1141|   284M|    TidyPrintImpl* pprint  = &doc->pprint;
 1142|   284M|    uint outenc = cfg( doc, TidyOutCharEncoding );
  ------------------
  |  |  415|   284M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1143|   284M|    Bool qmark = cfgBool( doc, TidyQuoteMarks );
  ------------------
  |  |  418|   284M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   284M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1144|       |
 1145|   284M|    if ( c == ' ' && !(mode & (PREFORMATTED | COMMENT | ATTRIBVALUE | CDATA)))
  ------------------
  |  Branch (1145:10): [True: 252M, False: 31.9M]
  |  Branch (1145:22): [True: 97.7k, False: 252M]
  ------------------
 1146|  97.7k|    {
 1147|       |        /* coerce a space character to a non-breaking space */
 1148|  97.7k|        if (mode & NOWRAP)
  ------------------
  |  Branch (1148:13): [True: 0, False: 97.7k]
  ------------------
 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|  97.7k|        else
 1158|  97.7k|            pprint->wraphere = pprint->linelen;
 1159|  97.7k|    }
 1160|       |
 1161|       |    /* comment characters are passed raw */
 1162|   284M|    if ( mode & (COMMENT | CDATA) )
  ------------------
  |  Branch (1162:10): [True: 114M, False: 169M]
  ------------------
 1163|   114M|    {
 1164|   114M|        AddChar( pprint, c );
 1165|   114M|        return;
 1166|   114M|    }
 1167|       |
 1168|       |    /* except in CDATA map < to &lt; etc. */
 1169|   169M|    if ( !(mode & CDATA) )
  ------------------
  |  Branch (1169:10): [True: 169M, False: 0]
  ------------------
 1170|   169M|    {
 1171|   169M|        if ( c == '<')
  ------------------
  |  Branch (1171:14): [True: 414k, False: 169M]
  ------------------
 1172|   414k|        {
 1173|   414k|            AddString( pprint, "&lt;" );
 1174|   414k|            return;
 1175|   414k|        }
 1176|       |            
 1177|   169M|        if ( c == '>')
  ------------------
  |  Branch (1177:14): [True: 151k, False: 169M]
  ------------------
 1178|   151k|        {
 1179|   151k|            AddString( pprint, "&gt;" );
 1180|   151k|            return;
 1181|   151k|        }
 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|   169M|        if ( c == '&' && cfgBool(doc, TidyQuoteAmpersand)
  ------------------
  |  |  418|   169M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   208k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 208k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1188:14): [True: 208k, False: 168M]
  ------------------
 1189|   208k|             && !cfgBool(doc, TidyPreserveEntities)
  ------------------
  |  |  418|   169M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   208k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1189:17): [True: 208k, False: 0]
  ------------------
 1190|   208k|             && ( mode != OtherNamespace) ) /* #130 MathML attr and entity fix! */
  ------------------
  |  Branch (1190:17): [True: 208k, False: 239]
  ------------------
 1191|   208k|        {
 1192|   208k|            AddString( pprint, "&amp;" );
 1193|   208k|            return;
 1194|   208k|        }
 1195|       |
 1196|   168M|        if ( c == '"' && qmark )
  ------------------
  |  Branch (1196:14): [True: 5.79k, False: 168M]
  |  Branch (1196:26): [True: 0, False: 5.79k]
  ------------------
 1197|      0|        {
 1198|      0|            AddString( pprint, "&quot;" );
 1199|      0|            return;
 1200|      0|        }
 1201|       |
 1202|   168M|        if ( c == '\'' && qmark )
  ------------------
  |  Branch (1202:14): [True: 20.4k, False: 168M]
  |  Branch (1202:27): [True: 0, False: 20.4k]
  ------------------
 1203|      0|        {
 1204|      0|            AddString( pprint, "&#39;" );
 1205|      0|            return;
 1206|      0|        }
 1207|       |
 1208|   168M|        if ( c == 160 && outenc != RAW )
  ------------------
  |  |  133|  2.73k|#define RAW         0
  ------------------
  |  Branch (1208:14): [True: 2.73k, False: 168M]
  |  Branch (1208:26): [True: 2.73k, False: 0]
  ------------------
 1209|  2.73k|        {
 1210|  2.73k|            if ( cfgBool(doc, TidyQuoteNbsp) )
  ------------------
  |  |  418|  2.73k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.73k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 2.73k, False: 0]
  |  |  ------------------
  ------------------
 1211|  2.73k|            {
 1212|  2.73k|                if ( cfgBool(doc, TidyNumEntities) ||
  ------------------
  |  |  418|  5.47k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.73k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 2.73k]
  |  |  ------------------
  ------------------
 1213|  2.73k|                     cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  2.73k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.73k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 2.73k]
  |  |  ------------------
  ------------------
 1214|      0|                    AddString( pprint, "&#160;" );
 1215|  2.73k|                else
 1216|  2.73k|                    AddString( pprint, "&nbsp;" );
 1217|  2.73k|            }
 1218|      0|            else
 1219|      0|                AddChar( pprint, c );
 1220|  2.73k|            return;
 1221|  2.73k|        }
 1222|   168M|    }
 1223|       |
 1224|       |    /* Handle encoding-specific issues */
 1225|   168M|    switch ( outenc )
  ------------------
  |  Branch (1225:14): [True: 168M, False: 0]
  ------------------
 1226|   168M|    {
 1227|   168M|    case UTF8:
  ------------------
  |  |  137|   168M|#define UTF8        4
  ------------------
  |  Branch (1227:5): [True: 168M, False: 0]
  ------------------
 1228|   168M|    case UTF16:
  ------------------
  |  |  144|   168M|#define UTF16       11
  ------------------
  |  Branch (1228:5): [True: 0, False: 168M]
  ------------------
 1229|   168M|    case UTF16LE:
  ------------------
  |  |  142|   168M|#define UTF16LE     9
  ------------------
  |  Branch (1229:5): [True: 0, False: 168M]
  ------------------
 1230|   168M|    case UTF16BE:
  ------------------
  |  |  143|   168M|#define UTF16BE     10
  ------------------
  |  Branch (1230:5): [True: 0, False: 168M]
  ------------------
 1231|   168M|        if (!(mode & PREFORMATTED) && cfg(doc, TidyPunctWrap))
  ------------------
  |  |  415|  14.2M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (415:33): [True: 0, False: 14.2M]
  |  |  ------------------
  ------------------
  |  Branch (1231:13): [True: 14.2M, False: 154M]
  ------------------
 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|   168M|        break;
 1240|       |
 1241|      0|    case BIG5:
  ------------------
  |  |  145|      0|#define BIG5        12
  ------------------
  |  Branch (1241:5): [True: 0, False: 168M]
  ------------------
 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: 168M]
  ------------------
 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: 168M]
  ------------------
 1258|      0|#endif
 1259|      0|    case RAW:
  ------------------
  |  |  133|      0|#define RAW         0
  ------------------
  |  Branch (1259:5): [True: 0, False: 168M]
  ------------------
 1260|      0|        AddChar( pprint, c );
 1261|      0|        return;
 1262|   168M|    }
 1263|       |
 1264|       |    /* don't map latin-1 chars to entities */
 1265|   168M|    if ( outenc == LATIN1 )
  ------------------
  |  |  136|   168M|#define LATIN1      3
  ------------------
  |  Branch (1265:10): [True: 0, False: 168M]
  ------------------
 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|   168M|    if ( outenc == UTF8 )
  ------------------
  |  |  137|   168M|#define UTF8        4
  ------------------
  |  Branch (1291:10): [True: 168M, False: 0]
  ------------------
 1292|   168M|    {
 1293|   168M|        AddChar( pprint, c );
 1294|   168M|        return;
 1295|   168M|    }
 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|  3.40M|{
  808|  3.40M|   return pprint->linelen = AddAsciiString( pprint, str, pprint->linelen );
  809|  3.40M|}
pprint.c:AddAsciiString:
  792|  3.40M|{
  793|  3.40M|    uint ix, len = TY_(tmbstrlen)( str );
  ------------------
  |  |   23|  3.40M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.40M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  794|  3.40M|    if ( string_index + len >= pprint->lbufsize )
  ------------------
  |  Branch (794:10): [True: 21.1k, False: 3.38M]
  ------------------
  795|  21.1k|        expand( pprint, string_index + len );
  796|       |
  797|  13.4M|    for ( ix=0; ix<len; ++ix )
  ------------------
  |  Branch (797:17): [True: 10.0M, False: 3.40M]
  ------------------
  798|  10.0M|        pprint->linebuf[string_index + ix] = str[ ix ];
  799|  3.40M|    return string_index + len;
  800|  3.40M|}
pprint.c:expand:
  314|  26.4k|{
  315|  26.4k|    uint* ip;
  316|  26.4k|    uint buflen = pprint->lbufsize;
  317|       |
  318|  26.4k|    if ( buflen == 0 )
  ------------------
  |  Branch (318:10): [True: 20.2k, False: 6.25k]
  ------------------
  319|  20.2k|        buflen = 256;
  320|  32.8k|    while ( len >= buflen )
  ------------------
  |  Branch (320:13): [True: 6.39k, False: 26.4k]
  ------------------
  321|  6.39k|        buflen *= 2;
  322|       |
  323|  26.4k|    ip = (uint*) TidyRealloc( pprint->allocator, pprint->linebuf, buflen*sizeof(uint) );
  ------------------
  |  |   67|  26.4k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  324|  26.4k|    if ( ip )
  ------------------
  |  Branch (324:10): [True: 26.4k, False: 0]
  ------------------
  325|  26.4k|    {
  326|  26.4k|      TidyClearMemory( ip+pprint->lbufsize, 
  ------------------
  |  |   70|  26.4k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  327|  26.4k|                       (buflen-pprint->lbufsize)*sizeof(uint) );
  328|  26.4k|      pprint->lbufsize = buflen;
  329|  26.4k|      pprint->linebuf = ip;
  330|  26.4k|    }
  331|  26.4k|}
pprint.c:AddChar:
  782|   310M|{
  783|   310M|    AddC( pprint, c, pprint->linelen );
  784|   310M|    return ++pprint->linelen;
  785|   310M|}
pprint.c:AddC:
  771|   310M|{
  772|   310M|    if ( string_index + 1 >= pprint->lbufsize )
  ------------------
  |  Branch (772:10): [True: 5.35k, False: 310M]
  ------------------
  773|  5.35k|        expand( pprint, string_index + 1 );
  774|   310M|    pprint->linebuf[string_index] = c;
  775|   310M|}
pprint.c:PPrintComment:
 1859|  95.9k|{
 1860|  95.9k|    TidyPrintImpl* pprint = &doc->pprint;
 1861|       |
 1862|  95.9k|    SetWrap( doc, indent );
 1863|  95.9k|    AddString( pprint, "<!--" );
 1864|       |
 1865|  95.9k|    PPrintText(doc, COMMENT, 0, node);
 1866|       |
 1867|  95.9k|    AddString(pprint, "--");
 1868|  95.9k|    AddChar( pprint, '>' );
 1869|  95.9k|    if ( node->linebreak && node->next )
  ------------------
  |  Branch (1869:10): [True: 749, False: 95.2k]
  |  Branch (1869:29): [True: 723, False: 26]
  ------------------
 1870|    723|        PFlushLineSmart( doc, indent );
 1871|  95.9k|}
pprint.c:SetWrap:
  541|   725k|{
  542|   725k|    TidyPrintImpl* pprint = &doc->pprint;
  543|   725k|    Bool wrap = ( indent + pprint->linelen < cfg(doc, TidyWrapLen) );
  ------------------
  |  |  415|   725k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  544|   725k|    if ( wrap )
  ------------------
  |  Branch (544:10): [True: 580k, False: 145k]
  ------------------
  545|   580k|    {
  546|   580k|        if ( pprint->indent[0].spaces < 0 )
  ------------------
  |  Branch (546:14): [True: 20.1k, False: 560k]
  ------------------
  547|  20.1k|            pprint->indent[0].spaces = indent;
  548|   580k|        pprint->wraphere = pprint->linelen;
  549|   580k|    }
  550|   145k|    else if ( pprint->ixInd == 0 )
  ------------------
  |  Branch (550:15): [True: 5.70k, False: 139k]
  ------------------
  551|  5.70k|    {
  552|       |        /* Save indent 1st time we pass the the wrap line */
  553|  5.70k|        pprint->indent[ 1 ].spaces = indent;
  554|  5.70k|        pprint->ixInd = 1;
  555|  5.70k|    }
  556|   725k|    return wrap;
  557|   725k|}
pprint.c:PPrintDocType:
 1878|  31.4k|{
 1879|  31.4k|    TidyPrintImpl* pprint = &doc->pprint;
 1880|  31.4k|    uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  31.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1881|  31.4k|    uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|  31.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1882|  31.4k|    AttVal* fpi = TY_(GetAttrByName)(node, "PUBLIC");
  ------------------
  |  |   23|  31.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1883|  31.4k|    AttVal* sys = TY_(GetAttrByName)(node, "SYSTEM");
  ------------------
  |  |   23|  31.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1884|       |
 1885|       |    /* todo: handle non-ASCII characters in FPI / SI / node->element */
 1886|       |
 1887|  31.4k|    SetWrap( doc, indent );
 1888|  31.4k|    PCondFlushLineSmart( doc, indent );
 1889|       |
 1890|  31.4k|    AddString( pprint, "<!DOCTYPE " );
 1891|  31.4k|    SetWrap( doc, indent );
 1892|  31.4k|    if (node->element)
  ------------------
  |  Branch (1892:9): [True: 31.4k, False: 0]
  ------------------
 1893|  31.4k|    {
 1894|  31.4k|        AddString(pprint, node->element);
 1895|  31.4k|    }
 1896|       |
 1897|  31.4k|    if (fpi && fpi->value)
  ------------------
  |  Branch (1897:9): [True: 9.50k, False: 21.9k]
  |  Branch (1897:16): [True: 5.14k, False: 4.35k]
  ------------------
 1898|  5.14k|    {
 1899|  5.14k|        AddString(pprint, " PUBLIC ");
 1900|  5.14k|        AddChar(pprint, fpi->delim);
 1901|  5.14k|        AddString(pprint, fpi->value);
 1902|  5.14k|        AddChar(pprint, fpi->delim);
 1903|  5.14k|    }
 1904|       |
 1905|  31.4k|    if (fpi && fpi->value && sys && sys->value)
  ------------------
  |  Branch (1905:9): [True: 9.50k, False: 21.9k]
  |  Branch (1905:16): [True: 5.14k, False: 4.35k]
  |  Branch (1905:30): [True: 1.55k, False: 3.59k]
  |  Branch (1905:37): [True: 1.51k, False: 36]
  ------------------
 1906|  1.51k|    {
 1907|  1.51k|        uint i = pprint->linelen - (TY_(tmbstrlen)(sys->value) + 2) - 1;
  ------------------
  |  |   23|  1.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1908|  1.51k|        if (!(i>0&&TY_(tmbstrlen)(sys->value)+2+i<wraplen&&i<=(spaces?spaces:2)*2))
  ------------------
  |  |   23|  1.49k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.49k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1908:15): [True: 1.49k, False: 19]
  |  Branch (1908:20): [True: 1.48k, False: 16]
  |  Branch (1908:60): [True: 248, False: 1.23k]
  |  Branch (1908:64): [True: 0, False: 1.48k]
  ------------------
 1909|  1.26k|            i = 0;
 1910|       |
 1911|  1.51k|        PCondFlushLineSmart(doc, i);
 1912|  1.51k|        if (pprint->linelen)
  ------------------
  |  Branch (1912:13): [True: 0, False: 1.51k]
  ------------------
 1913|      0|            AddChar(pprint, ' ');
 1914|  1.51k|    }
 1915|  29.9k|    else if (sys && sys->value)
  ------------------
  |  Branch (1915:14): [True: 4.11k, False: 25.8k]
  |  Branch (1915:21): [True: 3.74k, False: 367]
  ------------------
 1916|  3.74k|    {
 1917|  3.74k|        AddString(pprint, " SYSTEM ");
 1918|  3.74k|    }
 1919|       |
 1920|  31.4k|    if (sys && sys->value)
  ------------------
  |  Branch (1920:9): [True: 5.63k, False: 25.8k]
  |  Branch (1920:16): [True: 5.26k, False: 367]
  ------------------
 1921|  5.26k|    {
 1922|  5.26k|        AddChar(pprint, sys->delim);
 1923|  5.26k|        AddString(pprint, sys->value);
 1924|  5.26k|        AddChar(pprint, sys->delim);
 1925|  5.26k|    }
 1926|       |
 1927|  31.4k|    if (node->content)
  ------------------
  |  Branch (1927:9): [True: 516, False: 30.9k]
  ------------------
 1928|    516|    {
 1929|    516|        PCondFlushLineSmart(doc, indent);
 1930|    516|        AddChar(pprint, '[');
 1931|    516|        PPrintText(doc, CDATA, 0, node->content);
 1932|    516|        AddChar(pprint, ']');
 1933|    516|    }
 1934|       |
 1935|  31.4k|    SetWrap( doc, 0 );
 1936|  31.4k|    AddChar( pprint, '>' );
 1937|  31.4k|    PCondFlushLineSmart( doc, indent );
 1938|  31.4k|}
pprint.c:PPrintPI:
 1945|  94.6k|{
 1946|  94.6k|    TidyPrintImpl* pprint = &doc->pprint;
 1947|  94.6k|    tchar c;
 1948|  94.6k|    tmbstr s;
 1949|       |
 1950|  94.6k|    SetWrap( doc, indent );
 1951|  94.6k|    AddString( pprint, "<?" );
 1952|       |
 1953|  94.6k|    s = node->element;
 1954|       |
 1955|   163k|    while (s && *s)
  ------------------
  |  Branch (1955:12): [True: 75.2k, False: 88.7k]
  |  Branch (1955:17): [True: 69.3k, False: 5.89k]
  ------------------
 1956|  69.3k|    {
 1957|  69.3k|        c = (unsigned char)*s;
 1958|  69.3k|        if (c > 0x7F)
  ------------------
  |  Branch (1958:13): [True: 6.75k, False: 62.5k]
  ------------------
 1959|  6.75k|            s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|  6.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1960|  69.3k|        AddChar(pprint, c);
 1961|  69.3k|        ++s;
 1962|  69.3k|    }
 1963|       |
 1964|       |    /* set CDATA to pass < and > unescaped */
 1965|  94.6k|    PPrintText( doc, CDATA, indent, node );
 1966|       |
 1967|  94.6k|    if (cfgBool(doc, TidyXmlOut) ||
  ------------------
  |  |  418|   189k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  94.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 94.6k, False: 0]
  |  |  ------------------
  ------------------
 1968|      0|        cfgBool(doc, TidyXhtmlOut) || node->closed)
  ------------------
  |  |  418|  94.6k|#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|  94.6k|        AddChar( pprint, '?' );
 1970|       |
 1971|  94.6k|    AddChar( pprint, '>' );
 1972|  94.6k|    PCondFlushLine( doc, indent );
 1973|  94.6k|}
pprint.c:PCondFlushLine:
  873|  94.6k|{
  874|  94.6k|    TidyPrintImpl* pprint = &doc->pprint;
  875|       |
  876|  94.6k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (876:10): [True: 94.6k, False: 0]
  ------------------
  877|  94.6k|    {
  878|  94.6k|         PFlushLineImpl( doc );
  879|       |
  880|  94.6k|         TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|  94.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  94.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  881|  94.6k|         pprint->line++;
  882|  94.6k|    }
  883|       |
  884|       |    /* Issue #390 - Whether chars to flush or not, set new indent */
  885|  94.6k|    if ( pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (885:10): [True: 0, False: 94.6k]
  ------------------
  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|  94.6k|}
pprint.c:PPrintXmlDecl:
 1980|  2.56k|{
 1981|  2.56k|    AttVal* att;
 1982|  2.56k|    uint saveWrap;
 1983|  2.56k|    TidyPrintImpl* pprint = &doc->pprint;
 1984|  2.56k|    Bool ucAttrs;
 1985|  2.56k|    SetWrap( doc, indent );
 1986|  2.56k|    saveWrap = WrapOff( doc );
 1987|       |
 1988|       |    /* no case translation for XML declaration pseudo attributes */
 1989|  2.56k|    ucAttrs = cfg(doc, TidyUpperCaseAttrs);
  ------------------
  |  |  415|  2.56k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1990|  2.56k|    TY_(SetOptionInt)(doc, TidyUpperCaseAttrs, no);
  ------------------
  |  |   23|  2.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1991|       |
 1992|  2.56k|    AddString( pprint, "<?xml" );
 1993|       |
 1994|       |    /* Force order of XML declaration attributes */
 1995|       |    /* PPrintAttrs( doc, indent, node ); */
 1996|  2.56k|    if ( NULL != (att = TY_(AttrGetById)(node, TidyAttr_VERSION)) )
  ------------------
  |  |   23|  2.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1996:10): [True: 15, False: 2.55k]
  ------------------
 1997|     15|      PPrintAttribute( doc, indent, node, att );
 1998|  2.56k|    if ( NULL != (att = TY_(AttrGetById)(node, TidyAttr_ENCODING)) )
  ------------------
  |  |   23|  2.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1998:10): [True: 12, False: 2.55k]
  ------------------
 1999|     12|      PPrintAttribute( doc, indent, node, att );
 2000|  2.56k|    if ( NULL != (att = TY_(GetAttrByName)(node, "standalone")) )
  ------------------
  |  |   23|  2.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2000:10): [True: 0, False: 2.56k]
  ------------------
 2001|      0|      PPrintAttribute( doc, indent, node, att );
 2002|       |
 2003|       |    /* restore old config value */
 2004|  2.56k|    TY_(SetOptionInt)(doc, TidyUpperCaseAttrs, ucAttrs);
  ------------------
  |  |   23|  2.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2005|       |
 2006|  2.56k|    if ( node->end <= 0 || doc->lexer->lexbuf[node->end - 1] != '?' )
  ------------------
  |  Branch (2006:10): [True: 79, False: 2.48k]
  |  Branch (2006:28): [True: 1.72k, False: 757]
  ------------------
 2007|  1.80k|        AddChar( pprint, '?' );
 2008|  2.56k|    AddChar( pprint, '>' );
 2009|  2.56k|    WrapOn( doc, saveWrap );
 2010|  2.56k|    PFlushLineSmart( doc, indent );
 2011|  2.56k|}
pprint.c:WrapOff:
  508|  8.98k|{
  509|  8.98k|    uint saveWrap = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  8.98k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  510|  8.98k|    TY_(SetOptionInt)( doc, TidyWrapLen, 0xFFFFFFFF );  /* very large number */
  ------------------
  |  |   23|  8.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  511|  8.98k|    return saveWrap;
  512|  8.98k|}
pprint.c:PPrintAttribute:
 1546|   328k|{
 1547|   328k|    TidyPrintImpl* pprint = &doc->pprint;
 1548|   328k|    Bool xmlOut    = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|   328k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   328k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1549|   328k|    Bool xhtmlOut  = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|   328k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   328k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1550|   328k|    Bool wrapAttrs = cfgBool( doc, TidyWrapAttVals );
  ------------------
  |  |  418|   328k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   328k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1551|   328k|    uint ucAttrs   = cfg( doc, TidyUpperCaseAttrs );
  ------------------
  |  |  415|   328k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1552|   328k|    Bool indAttrs  = cfgBool( doc, TidyIndentAttributes );
  ------------------
  |  |  418|   328k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   328k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1553|   328k|    uint xtra      = AttrIndent( doc, node, attr );
 1554|   328k|    Bool first     = (attr == node->attributes);
 1555|   328k|    tmbstr name    = attr->attribute;
 1556|   328k|    Bool wrappable = no;
 1557|   328k|    tchar c;
 1558|       |
 1559|       |    /* fix for odd attribute indentation bug triggered by long values */
 1560|   328k|    if (!indAttrs)
  ------------------
  |  Branch (1560:9): [True: 328k, False: 0]
  ------------------
 1561|   328k|      xtra = 0;
 1562|       |
 1563|   328k|    if ( indAttrs )
  ------------------
  |  Branch (1563:10): [True: 0, False: 328k]
  ------------------
 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|   328k|    CheckWrapIndent( doc, indent );
 1573|       |
 1574|   328k|    if ( !xmlOut && !xhtmlOut && attr->dict )
  ------------------
  |  Branch (1574:10): [True: 0, False: 328k]
  |  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|   328k|    if ( !first && !SetWrap(doc, indent) )
  ------------------
  |  Branch (1582:10): [True: 109k, False: 219k]
  |  Branch (1582:20): [True: 1.82k, False: 107k]
  ------------------
 1583|  1.82k|    {
 1584|  1.82k|        TY_(PFlushLine)( doc, indent+xtra );  /* Put it on next line */
  ------------------
  |  |   23|  1.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1585|  1.82k|    }
 1586|   327k|    else if ( pprint->linelen > 0 )
  ------------------
  |  Branch (1586:15): [True: 327k, False: 0]
  ------------------
 1587|   327k|    {
 1588|   327k|        AddChar( pprint, ' ' );
 1589|   327k|    }
 1590|       |
 1591|       |    /* Attribute name */
 1592|  1.79M|    while (*name)
  ------------------
  |  Branch (1592:12): [True: 1.46M, False: 328k]
  ------------------
 1593|  1.46M|    {
 1594|  1.46M|        c = (unsigned char)*name;
 1595|       |
 1596|  1.46M|        if (c > 0x7F)
  ------------------
  |  Branch (1596:13): [True: 0, False: 1.46M]
  ------------------
 1597|      0|            name += TY_(GetUTF8)(name, &c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1598|  1.46M|        else if (ucAttrs == TidyUppercaseYes)
  ------------------
  |  Branch (1598:18): [True: 0, False: 1.46M]
  ------------------
 1599|      0|            c = TY_(ToUpper)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1600|       |
 1601|  1.46M|        AddChar(pprint, c);
 1602|  1.46M|        ++name;
 1603|  1.46M|    }
 1604|       |
 1605|   328k|    CheckWrapIndent( doc, indent );
 1606|       | 
 1607|   328k|    if ( attr->value == NULL )
  ------------------
  |  Branch (1607:10): [True: 122k, False: 206k]
  ------------------
 1608|   122k|    {
 1609|   122k|        Bool isB = TY_(IsBoolAttribute)(attr);
  ------------------
  |  |   23|   122k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   122k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1610|   122k|        Bool scriptAttr = TY_(attrIsEvent)(attr);
  ------------------
  |  |   23|   122k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   122k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1611|       |
 1612|   122k|        if ( xmlOut )
  ------------------
  |  Branch (1612:14): [True: 122k, False: 0]
  ------------------
 1613|   122k|            PPrintAttrValue( doc, indent, isB ? attr->attribute : NULLSTR,
  ------------------
  |  |  625|   244k|#  define NULLSTR (tmbstr)""
  ------------------
  |  Branch (1613:43): [True: 623, False: 121k]
  ------------------
 1614|   122k|                             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|   122k|    }
 1622|   206k|    else
 1623|   206k|        PPrintAttrValue( doc, indent, attr->value, attr->delim, wrappable, no );
 1624|   328k|}
pprint.c:AttrIndent:
 1525|   328k|{
 1526|   328k|  uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|   328k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1527|   328k|  uint xtra = 2;  /* 1 for the '<', another for the ' ' */
 1528|   328k|  if ( node->element == NULL )
  ------------------
  |  Branch (1528:8): [True: 27, False: 328k]
  ------------------
 1529|     27|    return spaces;
 1530|       |
 1531|   328k|  if ( !TY_(nodeHasCM)(node, CM_INLINE) ||
  ------------------
  |  |   23|   328k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   328k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                if ( !TY_(nodeHasCM)(node, CM_INLINE) ||
  ------------------
  |  |  143|   328k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1531:8): [True: 94.0k, False: 234k]
  ------------------
 1532|   234k|       !ShouldIndent(doc, node->parent ? node->parent: node) )
  ------------------
  |  Branch (1532:8): [True: 234k, False: 0]
  |  Branch (1532:27): [True: 234k, False: 0]
  ------------------
 1533|   328k|    return xtra + TY_(tmbstrlen)( node->element );
  ------------------
  |  |   23|   328k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   328k|#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|   328k|{
 1414|   328k|    TidyPrintImpl* pprint = &doc->pprint;
 1415|   328k|    Bool scriptlets = cfgBool(doc, TidyWrapScriptlets);
  ------------------
  |  |  418|   328k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   328k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1416|       |
 1417|   328k|    uint mode = PREFORMATTED | ATTRIBVALUE;
 1418|   328k|    if ( wrappable )
  ------------------
  |  Branch (1418:10): [True: 0, False: 328k]
  ------------------
 1419|      0|        mode = NORMAL | ATTRIBVALUE;
 1420|       |
 1421|       |    /* look for ASP, Tango or PHP instructions for computed attribute value */
 1422|   328k|    if ( value && value[0] == '<' )
  ------------------
  |  Branch (1422:10): [True: 328k, False: 0]
  |  Branch (1422:19): [True: 7.00k, False: 321k]
  ------------------
 1423|  7.00k|    {
 1424|  7.00k|        if ( value[1] == '%' || value[1] == '@'||
  ------------------
  |  Branch (1424:14): [True: 1.82k, False: 5.18k]
  |  Branch (1424:33): [True: 315, False: 4.87k]
  ------------------
 1425|  4.87k|             TY_(tmbstrncmp)(value, "<?php", 5) == 0 )
  ------------------
  |  |   23|  4.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1425:14): [True: 2.54k, False: 2.32k]
  ------------------
 1426|  4.68k|            mode |= CDATA;
 1427|  7.00k|    }
 1428|       |
 1429|   328k|    if ( delim == 0 )
  ------------------
  |  Branch (1429:10): [True: 15, False: 328k]
  ------------------
 1430|     15|        delim = '"';
 1431|       |
 1432|   328k|    AddChar( pprint, '=' );
 1433|       |
 1434|       |    /* don't wrap after "=" for xml documents */
 1435|   328k|    if ( !cfgBool(doc, TidyXmlOut) || cfgBool(doc, TidyXhtmlOut) )
  ------------------
  |  |  418|   657k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   328k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                  if ( !cfgBool(doc, TidyXmlOut) || cfgBool(doc, TidyXhtmlOut) )
  ------------------
  |  |  418|   328k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   328k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 328k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1435:10): [True: 0, False: 328k]
  ------------------
 1436|   328k|    {
 1437|   328k|        SetWrap( doc, indent );
 1438|   328k|        CheckWrapIndent( doc, indent );
 1439|       |        /*
 1440|       |        if ( !SetWrap(doc, indent) )
 1441|       |            PCondFlushLine( doc, indent );
 1442|       |        */
 1443|   328k|    }
 1444|       |
 1445|   328k|    AddChar( pprint, delim );
 1446|       |
 1447|   328k|    if ( value )
  ------------------
  |  Branch (1447:10): [True: 328k, False: 0]
  ------------------
 1448|   328k|    {
 1449|   328k|        uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|   328k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1450|   328k|        int attrStart = SetInAttrVal( pprint );
 1451|   328k|        int strStart = ClearInString( pprint );
 1452|       |
 1453|  16.1M|        while (*value != '\0')
  ------------------
  |  Branch (1453:16): [True: 15.8M, False: 328k]
  ------------------
 1454|  15.8M|        {
 1455|  15.8M|            uint c = *value;
 1456|       |
 1457|  15.8M|            if ( wrappable && c == ' ' )
  ------------------
  |  Branch (1457:18): [True: 0, False: 15.8M]
  |  Branch (1457:31): [True: 0, False: 0]
  ------------------
 1458|      0|                SetWrapAttr( doc, indent, attrStart, strStart );
 1459|       |
 1460|  15.8M|            if ( wrappable && pprint->wraphere > 0 &&
  ------------------
  |  Branch (1460:18): [True: 0, False: 15.8M]
  |  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|  15.8M|            if ( c == delim )
  ------------------
  |  Branch (1464:18): [True: 4.10k, False: 15.8M]
  ------------------
 1465|  4.10k|            {
 1466|  4.10k|                ctmbstr entity = (c == '"' ? "&quot;" : "&#39;");
  ------------------
  |  Branch (1466:35): [True: 3.91k, False: 189]
  ------------------
 1467|  4.10k|                AddString( pprint, entity );
 1468|  4.10k|                ++value;
 1469|  4.10k|                continue;
 1470|  4.10k|            }
 1471|  15.8M|            else if (c == '"')
  ------------------
  |  Branch (1471:22): [True: 1.62k, False: 15.8M]
  ------------------
 1472|  1.62k|            {
 1473|  1.62k|                if ( cfgBool(doc, TidyQuoteMarks) )
  ------------------
  |  |  418|  1.62k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.62k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 1.62k]
  |  |  ------------------
  ------------------
 1474|      0|                    AddString( pprint, "&quot;" );
 1475|  1.62k|                else
 1476|  1.62k|                    AddChar( pprint, c );
 1477|       |
 1478|  1.62k|                if ( delim == '\'' && scriptAttr && scriptlets )
  ------------------
  |  Branch (1478:22): [True: 1.62k, False: 0]
  |  Branch (1478:39): [True: 0, False: 1.62k]
  |  Branch (1478:53): [True: 0, False: 0]
  ------------------
 1479|      0|                    strStart = ToggleInString( pprint );
 1480|       |
 1481|  1.62k|                ++value;
 1482|  1.62k|                continue;
 1483|  1.62k|            }
 1484|  15.8M|            else if ( c == '\'' )
  ------------------
  |  Branch (1484:23): [True: 10.1k, False: 15.8M]
  ------------------
 1485|  10.1k|            {
 1486|  10.1k|                if ( cfgBool(doc, TidyQuoteMarks) )
  ------------------
  |  |  418|  10.1k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  10.1k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 10.1k]
  |  |  ------------------
  ------------------
 1487|      0|                    AddString( pprint, "&#39;" );
 1488|  10.1k|                else
 1489|  10.1k|                    AddChar( pprint, c );
 1490|       |
 1491|  10.1k|                if ( delim == '"' && scriptAttr && scriptlets )
  ------------------
  |  Branch (1491:22): [True: 10.1k, False: 0]
  |  Branch (1491:38): [True: 0, False: 10.1k]
  |  Branch (1491:52): [True: 0, False: 0]
  ------------------
 1492|      0|                    strStart = ToggleInString( pprint );
 1493|       |
 1494|  10.1k|                ++value;
 1495|  10.1k|                continue;
 1496|  10.1k|            }
 1497|       |
 1498|       |            /* look for UTF-8 multibyte character */
 1499|  15.8M|            if ( c > 0x7F )
  ------------------
  |  Branch (1499:18): [True: 820k, False: 15.0M]
  ------------------
 1500|   820k|                 value += TY_(GetUTF8)( value, &c );
  ------------------
  |  |   23|   820k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   820k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1501|  15.8M|            ++value;
 1502|       |
 1503|  15.8M|            if ( c == '\n' )
  ------------------
  |  Branch (1503:18): [True: 1.64k, False: 15.8M]
  ------------------
 1504|  1.64k|            {
 1505|       |                /* No indent inside Javascript literals */
 1506|  1.64k|                TY_(PFlushLine)( doc, (strStart < 0
  ------------------
  |  |   23|  1.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1506:40): [True: 1.64k, False: 0]
  ------------------
 1507|  1.64k|                                       && !cfgBool(doc, TidyLiteralAttribs) ?
  ------------------
  |  |  418|  1.64k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.64k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1507:43): [True: 1.64k, False: 0]
  ------------------
 1508|  1.64k|                                       indent : 0) );
 1509|  1.64k|                continue;
 1510|  1.64k|            }
 1511|  15.8M|            PPrintChar( doc, c, mode );
 1512|  15.8M|        }
 1513|   328k|        ClearInAttrVal( pprint );
 1514|   328k|        ClearInString( pprint );
 1515|   328k|    }
 1516|   328k|    AddChar( pprint, delim );
 1517|   328k|}
pprint.c:SetInAttrVal:
  419|   328k|{
  420|   328k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  421|   328k|    return ind->attrValStart = (int) pprint->linelen;
  422|   328k|}
pprint.c:ClearInString:
  355|   657k|{
  356|   657k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  357|   657k|    return ind->attrStringStart = -1;
  358|   657k|}
pprint.c:ClearInAttrVal:
  406|   328k|{
  407|   328k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  408|   328k|    ind->attrValStart = -1;
  409|   328k|}
pprint.c:WrapOn:
  520|  33.1k|{
  521|  33.1k|    TY_(SetOptionInt)( doc, TidyWrapLen, saveWrap );
  ------------------
  |  |   23|  33.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  33.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  522|  33.1k|}
pprint.c:PPrintCDATA:
 2080|  1.81k|{
 2081|  1.81k|    uint saveWrap;
 2082|  1.81k|    TidyPrintImpl* pprint = &doc->pprint;
 2083|  1.81k|    Bool indentCData = cfgBool( doc, TidyIndentCdata );
  ------------------
  |  |  418|  1.81k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.81k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2084|  1.81k|    if ( !indentCData )
  ------------------
  |  Branch (2084:10): [True: 1.81k, False: 0]
  ------------------
 2085|  1.81k|        indent = 0;
 2086|       |
 2087|  1.81k|    PCondFlushLineSmart( doc, indent );
 2088|  1.81k|    saveWrap = WrapOff( doc );        /* disable wrapping */
 2089|       |
 2090|  1.81k|    AddString( pprint, "<![CDATA[" );
 2091|  1.81k|    PPrintText( doc, COMMENT, indent, node );
 2092|  1.81k|    AddString( pprint, "]]>" );
 2093|       |
 2094|  1.81k|    PCondFlushLineSmart( doc, indent );
 2095|  1.81k|    WrapOn( doc, saveWrap );          /* restore wrapping */
 2096|  1.81k|}
pprint.c:PPrintSection:
 2103|  15.2k|{
 2104|  15.2k|    TidyPrintImpl* pprint = &doc->pprint;
 2105|  15.2k|    Bool wrapSect = cfgBool( doc, TidyWrapSection );
  ------------------
  |  |  418|  15.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  15.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2106|  15.2k|    uint saveWrap = WrapOffCond( doc, !wrapSect  );
 2107|       |
 2108|  15.2k|    AddString( pprint, "<![" );
 2109|  15.2k|    PPrintText( doc, (wrapSect ? CDATA : COMMENT),
  ------------------
  |  Branch (2109:23): [True: 15.2k, False: 0]
  ------------------
 2110|  15.2k|                indent, node );
 2111|  15.2k|    AddString( pprint, "]>" );
 2112|       |
 2113|       |    /* PCondFlushLine( doc, indent ); */
 2114|  15.2k|    WrapOn( doc, saveWrap );
 2115|  15.2k|}
pprint.c:WrapOffCond:
  529|  24.1k|{
  530|  24.1k|    if ( onoff )
  ------------------
  |  Branch (530:10): [True: 0, False: 24.1k]
  ------------------
  531|      0|        return WrapOff( doc );
  532|  24.1k|    return cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  24.1k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  533|  24.1k|}
pprint.c:PPrintAsp:
 2019|  4.98k|{
 2020|  4.98k|    TidyPrintImpl* pprint = &doc->pprint;
 2021|  4.98k|    Bool wrapAsp  = cfgBool( doc, TidyWrapAsp );
  ------------------
  |  |  418|  4.98k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  4.98k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2022|  4.98k|    Bool wrapJste = cfgBool( doc, TidyWrapJste );
  ------------------
  |  |  418|  4.98k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  4.98k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2023|  4.98k|    uint saveWrap = WrapOffCond( doc, !wrapAsp || !wrapJste );
  ------------------
  |  Branch (2023:39): [True: 0, False: 4.98k]
  |  Branch (2023:51): [True: 0, False: 4.98k]
  ------------------
 2024|       |
 2025|  4.98k|    AddString( pprint, "<%" );
 2026|  4.98k|    PPrintText( doc, (wrapAsp ? CDATA : COMMENT), indent, node );
  ------------------
  |  Branch (2026:23): [True: 4.98k, False: 0]
  ------------------
 2027|  4.98k|    AddString( pprint, "%>" );
 2028|       |
 2029|       |    /* PCondFlushLine( doc, indent ); */
 2030|  4.98k|    WrapOn( doc, saveWrap );
 2031|  4.98k|}
pprint.c:PPrintJste:
 2039|  3.90k|{
 2040|  3.90k|    TidyPrintImpl* pprint = &doc->pprint;
 2041|  3.90k|    Bool wrapAsp = cfgBool( doc, TidyWrapAsp );
  ------------------
  |  |  418|  3.90k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.90k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2042|  3.90k|    uint saveWrap = WrapOffCond( doc, !wrapAsp  );
 2043|       |
 2044|  3.90k|    AddString( pprint, "<#" );
 2045|  3.90k|    PPrintText( doc, (cfgBool(doc, TidyWrapJste) ? CDATA : COMMENT),
  ------------------
  |  |  418|  3.90k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.90k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 3.90k, False: 0]
  |  |  ------------------
  ------------------
 2046|  3.90k|                indent, node );
 2047|  3.90k|    AddString( pprint, "#>" );
 2048|       |
 2049|       |    /* PCondFlushLine( doc, indent ); */
 2050|  3.90k|    WrapOn( doc, saveWrap );
 2051|  3.90k|}
pprint.c:PPrintPhp:
 2059|  6.30k|{
 2060|  6.30k|    TidyPrintImpl* pprint = &doc->pprint;
 2061|  6.30k|    Bool wrapPhp = cfgBool( doc, TidyWrapPhp );
  ------------------
  |  |  418|  6.30k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  6.30k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2062|       |    /* uint saveWrap = WrapOffCond( doc, !wrapPhp  ); */
 2063|       |
 2064|  6.30k|    AddString( pprint, "<?" );
 2065|  6.30k|    PPrintText( doc, CDATA, indent, node );
 2066|  6.30k|    AddString( pprint, "?>" );
 2067|       |
 2068|       |    /* Issue #437 - add a new line if 'wrap-php' is on */
 2069|  6.30k|    if (wrapPhp)
  ------------------
  |  Branch (2069:9): [True: 0, False: 6.30k]
  ------------------
 2070|      0|        PCondFlushLine( doc, indent ); 
 2071|       |       
 2072|       |    /* WrapOn( doc, saveWrap ); */
 2073|  6.30k|}
pprint.c:PPrintMathML:
 2239|    333|{
 2240|    333|    Node *content;
 2241|    333|    uint mode = OtherNamespace;
 2242|       |
 2243|    333|    PPrintTag( doc, mode, indent, node );
 2244|       |
 2245|    890|    for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2245:36): [True: 557, False: 333]
  ------------------
 2246|    557|           TY_(PPrintTree)( doc, mode, indent, content );
  ------------------
  |  |   23|    557|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    557|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2247|       |
 2248|    333|    PPrintEndTag( doc, mode, indent, node );
 2249|    333|}
pprint.c:PCondFlushLineSmart:
  930|   694k|{
  931|   694k|    TidyPrintImpl* pprint = &doc->pprint;
  932|       |
  933|   694k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (933:10): [True: 265k, False: 429k]
  ------------------
  934|   265k|    {
  935|   265k|         PFlushLineImpl( doc );
  936|       |
  937|       |         /* Issue #228 - cfgBool( doc, TidyVertSpace ); */
  938|   265k|         if(TidyAddVS) {
  ------------------
  |  |   52|   265k|#define TidyAddVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyAutoState) ? no : yes )
  |  |  ------------------
  |  |  |  |  421|   265k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|   265k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (52:19): [True: 265k, False: 0]
  |  |  |  Branch (52:20): [True: 0, False: 265k]
  |  |  ------------------
  ------------------
  939|   265k|            TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|   265k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   265k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  940|   265k|            pprint->line++;
  941|   265k|         }
  942|   265k|    }
  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|   694k|    if (pprint->indent[ 0 ].spaces != (int)indent)
  ------------------
  |  Branch (949:9): [True: 545, False: 694k]
  ------------------
  950|    545|    {
  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|    545|        pprint->indent[ 0 ].spaces = indent;
  955|    545|    }
  956|   694k|}
pprint.c:PFlushLineSmart:
  901|   514k|{
  902|   514k|    TidyPrintImpl* pprint = &doc->pprint;
  903|       |
  904|   514k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (904:10): [True: 513k, False: 1.56k]
  ------------------
  905|   513k|        PFlushLineImpl( doc );
  906|       |
  907|       |    /* Issue #228 - cfgBool( doc, TidyVertSpace ); */
  908|   514k|    if(TidyAddVS) {
  ------------------
  |  |   52|   514k|#define TidyAddVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyAutoState) ? no : yes )
  |  |  ------------------
  |  |  |  |  421|   514k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|   514k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (52:19): [True: 514k, False: 0]
  |  |  |  Branch (52:20): [True: 0, False: 514k]
  |  |  ------------------
  ------------------
  909|   514k|        TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|   514k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   514k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  910|   514k|        pprint->line++;
  911|   514k|    }
  912|       |
  913|   514k|    if ( pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (913:10): [True: 0, False: 514k]
  ------------------
  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|   514k|}
pprint.c:PPrintTag:
 1772|  2.24M|{
 1773|  2.24M|    TidyPrintImpl* pprint = &doc->pprint;
 1774|  2.24M|    Bool uc = cfgBool( doc, TidyUpperCaseTags );
  ------------------
  |  |  418|  2.24M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.24M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1775|  2.24M|    Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  2.24M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.24M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1776|  2.24M|    Bool xmlOut = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|  2.24M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.24M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1777|  2.24M|    tchar c;
 1778|  2.24M|    tmbstr s = node->element;
 1779|       |
 1780|  2.24M|    AddChar( pprint, '<' );
 1781|       |
 1782|  2.24M|    if ( node->type == EndTag )
  ------------------
  |  Branch (1782:10): [True: 265, False: 2.23M]
  ------------------
 1783|    265|        AddChar( pprint, '/' );
 1784|       |
 1785|  2.24M|    if (s)
  ------------------
  |  Branch (1785:9): [True: 2.24M, False: 24]
  ------------------
 1786|  2.24M|    {
 1787|  10.6M|        while (*s)
  ------------------
  |  Branch (1787:16): [True: 8.36M, False: 2.24M]
  ------------------
 1788|  8.36M|        {
 1789|  8.36M|            c = (unsigned char)*s;
 1790|       |
 1791|  8.36M|            if (c > 0x7F)
  ------------------
  |  Branch (1791:17): [True: 0, False: 8.36M]
  ------------------
 1792|      0|                s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1793|  8.36M|            else if (uc)
  ------------------
  |  Branch (1793:22): [True: 0, False: 8.36M]
  ------------------
 1794|      0|                c = TY_(ToUpper)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1795|       |
 1796|  8.36M|            AddChar(pprint, c);
 1797|  8.36M|            ++s;
 1798|  8.36M|        }
 1799|  2.24M|    }
 1800|       |
 1801|  2.24M|    PPrintAttrs( doc, indent, node );
 1802|       |
 1803|  2.24M|    if ( (xmlOut || xhtmlOut) &&
  ------------------
  |  Branch (1803:11): [True: 2.24M, False: 0]
  |  Branch (1803:21): [True: 0, False: 0]
  ------------------
 1804|  2.24M|         (node->type == StartEndTag || TY_(nodeCMIsEmpty)(node)) )
  ------------------
  |  |   23|  2.23M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.23M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1804:11): [True: 639, False: 2.23M]
  |  Branch (1804:40): [True: 64.7k, False: 2.17M]
  ------------------
 1805|  65.3k|    {
 1806|  65.3k|        AddChar( pprint, ' ' );   /* Space is NS compatibility hack <br /> */
 1807|  65.3k|        AddChar( pprint, '/' );   /* Required end tag marker */
 1808|  65.3k|    }
 1809|       |
 1810|  2.24M|    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.24M|    if ((node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50) && !TY_(nodeHasCM)(node, CM_VOID ) )
  ------------------
  |  |   23|    639|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    639|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if ((node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50) && !TY_(nodeHasCM)(node, CM_VOID ) )
  ------------------
  |  |  200|    639|#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: 639, False: 2.23M]
  |  Branch (1820:39): [True: 0, False: 639]
  |  Branch (1820:73): [True: 0, False: 0]
  ------------------
 1821|      0|    {
 1822|      0|        PPrintEndTag( doc, mode, indent, node );
 1823|      0|    }
 1824|       |
 1825|  2.24M|    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.23M, False: 639]
  |  Branch (1825:40): [True: 639, False: 0]
  |  Branch (1825:53): [True: 0, False: 0]
  |  Branch (1825:82): [True: 0, False: 0]
  |  Branch (1825:117): [True: 2.22M, False: 19.7k]
  ------------------
 1826|  2.22M|    {
 1827|  2.22M|        uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  2.22M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1828|  2.22M|        CheckWrapIndent( doc, indent );
 1829|       |
 1830|  2.22M|        if ( indent + pprint->linelen < wraplen )
  ------------------
  |  Branch (1830:14): [True: 1.10M, False: 1.11M]
  ------------------
 1831|  1.10M|        {
 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|  1.10M|            if (!(mode & NOWRAP)
  ------------------
  |  Branch (1838:17): [True: 1.09M, False: 7.88k]
  ------------------
 1839|  1.09M|                && (!TY_(nodeCMIsInline)(node) || nodeIsBR(node))
  ------------------
  |  |   23|  1.09M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.09M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              && (!TY_(nodeCMIsInline)(node) || nodeIsBR(node))
  ------------------
  |  |  400|   695k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   695k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 695k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 695k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 12.9k, False: 682k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1839:21): [True: 400k, False: 695k]
  ------------------
 1840|   413k|                && AfterSpace(doc->lexer, node))
  ------------------
  |  Branch (1840:20): [True: 407k, False: 5.61k]
  ------------------
 1841|   407k|            {
 1842|   407k|                pprint->wraphere = pprint->linelen;
 1843|   407k|            }
 1844|  1.10M|        }
 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|  1.11M|        else if ( mode & NOWRAP ||
  ------------------
  |  Branch (1848:19): [True: 66, False: 1.11M]
  ------------------
 1849|  1.11M|                  nodeIsBR(node) || AfterSpace(doc->lexer, node))
  ------------------
  |  |  400|  1.11M|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  2.23M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.11M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.11M, False: 229]
  |  |  |  |  |  Branch (275:54): [True: 326, False: 1.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1849:37): [True: 49.7k, False: 1.06M]
  ------------------
 1850|  50.1k|            PCondFlushLineSmart( doc, indent );
 1851|  2.22M|    }
 1852|  2.24M|}
pprint.c:PPrintAttrs:
 1631|  2.24M|{
 1632|  2.24M|    TidyPrintImpl* pprint = &doc->pprint;
 1633|  2.24M|    AttVal* av;
 1634|       |
 1635|       |    /* add xml:space attribute to pre and other elements */
 1636|  2.24M|    if ( cfgBool(doc, TidyXmlOut) && cfgBool(doc, TidyXmlSpace) &&
  ------------------
  |  |  418|  4.48M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.24M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 2.24M, False: 0]
  |  |  ------------------
  ------------------
                  if ( cfgBool(doc, TidyXmlOut) && cfgBool(doc, TidyXmlSpace) &&
  ------------------
  |  |  418|  4.48M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.24M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 2.24M]
  |  |  ------------------
  ------------------
 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|  2.57M|    for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (1643:34): [True: 337k, False: 2.24M]
  ------------------
 1644|   337k|    {
 1645|   337k|        if ( av->attribute != NULL )
  ------------------
  |  Branch (1645:14): [True: 328k, False: 8.45k]
  ------------------
 1646|   328k|        {
 1647|   328k|            PPrintAttribute( doc, indent, node, av );
 1648|   328k|        }
 1649|  8.45k|        else if ( av->asp != NULL )
  ------------------
  |  Branch (1649:19): [True: 2.52k, False: 5.93k]
  ------------------
 1650|  2.52k|        {
 1651|  2.52k|            AddChar( pprint, ' ' );
 1652|  2.52k|            PPrintAsp( doc, indent, av->asp );
 1653|  2.52k|        }
 1654|  5.93k|        else if ( av->php != NULL )
  ------------------
  |  Branch (1654:19): [True: 5.93k, False: 0]
  ------------------
 1655|  5.93k|        {
 1656|  5.93k|            AddChar( pprint, ' ' );
 1657|  5.93k|            PPrintPhp( doc, indent, av->php );
 1658|  5.93k|        }
 1659|   337k|    }
 1660|  2.24M|}
pprint.c:AfterSpace:
 1729|  1.52M|{
 1730|  1.52M|    return AfterSpaceImp(lexer, node, TY_(nodeCMIsEmpty)(node));
  ------------------
  |  |   23|  1.52M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.52M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1731|  1.52M|}
pprint.c:AfterSpaceImp:
 1689|  1.80G|{
 1690|  1.80G|    Node *prev;
 1691|       |
 1692|  1.80G|    if ( !TY_(nodeCMIsInline)(node) )
  ------------------
  |  |   23|  1.80G|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.80G|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1692:10): [True: 436k, False: 1.80G]
  ------------------
 1693|   436k|        return yes;
 1694|       |
 1695|  1.80G|    prev = node->prev;
 1696|  1.80G|    if (prev)
  ------------------
  |  Branch (1696:9): [True: 1.09M, False: 1.80G]
  ------------------
 1697|  1.09M|    {
 1698|  1.09M|        if (TY_(nodeIsText)(prev))
  ------------------
  |  |   23|  1.09M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.09M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1698:13): [True: 1.00M, False: 85.6k]
  ------------------
 1699|  1.00M|            return TY_(TextNodeEndWithSpace)( lexer, prev );
  ------------------
  |  |   23|  1.00M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1700|  85.6k|        else if (nodeIsBR(prev))
  ------------------
  |  |  400|  85.6k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  85.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 85.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 73.2k, False: 12.3k]
  |  |  |  |  |  Branch (275:54): [True: 7.34k, False: 65.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1701|  7.34k|            return yes;
 1702|       |
 1703|  78.2k|        return no;
 1704|  1.09M|    }
 1705|       |
 1706|  1.80G|    if ( isEmpty && !TY_(nodeCMIsInline)(node->parent) )
  ------------------
  |  |   23|  1.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1706:10): [True: 1.95k, False: 1.80G]
  |  Branch (1706:21): [True: 462, False: 1.49k]
  ------------------
 1707|    462|        return no;
 1708|       |
 1709|  1.80G|    return AfterSpaceImp(lexer, node->parent, isEmpty);
 1710|  1.80G|}
pprint.c:PPrintEndTag:
 1739|  2.17M|{
 1740|  2.17M|    TidyPrintImpl* pprint = &doc->pprint;
 1741|  2.17M|    Bool uc = cfgBool( doc, TidyUpperCaseTags );
  ------------------
  |  |  418|  2.17M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.17M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1742|  2.17M|    tmbstr s = node->element;
 1743|  2.17M|    tchar c;
 1744|       |
 1745|  2.17M|    AddString( pprint, "</" );
 1746|       |
 1747|  2.17M|    if (s)
  ------------------
  |  Branch (1747:9): [True: 2.17M, False: 24]
  ------------------
 1748|  2.17M|    {
 1749|  10.3M|        while (*s)
  ------------------
  |  Branch (1749:16): [True: 8.15M, False: 2.17M]
  ------------------
 1750|  8.15M|        {
 1751|  8.15M|             c = (unsigned char)*s;
 1752|       |
 1753|  8.15M|             if (c > 0x7F)
  ------------------
  |  Branch (1753:18): [True: 0, False: 8.15M]
  ------------------
 1754|      0|                 s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1755|  8.15M|             else if (uc)
  ------------------
  |  Branch (1755:23): [True: 0, False: 8.15M]
  ------------------
 1756|      0|                 c = TY_(ToUpper)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1757|       |
 1758|  8.15M|             AddChar(pprint, c);
 1759|  8.15M|             ++s;
 1760|  8.15M|        }
 1761|  2.17M|    }
 1762|       |
 1763|  2.17M|    AddChar( pprint, '>' );
 1764|  2.17M|}
pprint.c:PPrintScriptStyle:
 2122|  3.79k|{
 2123|  3.79k|    TidyPrintImpl* pprint = &doc->pprint;
 2124|  3.79k|    Node*   content;
 2125|  3.79k|    ctmbstr commentStart = DEFAULT_COMMENT_START;
 2126|  3.79k|    ctmbstr commentEnd = DEFAULT_COMMENT_END;
 2127|  3.79k|    Bool    hasCData = no;
 2128|  3.79k|    int     contentIndent = -1;
 2129|  3.79k|    Bool    xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  3.79k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.79k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2130|       |
 2131|  3.79k|    if ( InsideHead(doc, node) )
  ------------------
  |  Branch (2131:10): [True: 1.76k, False: 2.03k]
  ------------------
 2132|  1.76k|      PFlushLineSmart( doc, indent );
 2133|       |
 2134|  3.79k|    PCondFlushLineSmart( doc, indent );  /* Issue #56 - long outstanding bug - flush any existing closing tag */
 2135|       |
 2136|  3.79k|    PPrintTag( doc, mode, indent, node );
 2137|       |
 2138|       |    /* SCRIPT may have no content such as when loading code via its SRC attribute.
 2139|       |       In this case we don't want to flush the line, preferring to keep the required
 2140|       |       closing SCRIPT tag on the same line. */
 2141|  3.79k|    if ( node->content != NULL )
  ------------------
  |  Branch (2141:10): [True: 2.37k, False: 1.42k]
  ------------------
 2142|  2.37k|        PFlushLineSmart(doc, indent);
 2143|       |
 2144|  3.79k|    if ( xhtmlOut && node->content != NULL )
  ------------------
  |  Branch (2144:10): [True: 3.79k, False: 0]
  |  Branch (2144:22): [True: 2.37k, False: 1.42k]
  ------------------
 2145|  2.37k|    {
 2146|  2.37k|        AttVal* type = attrGetTYPE(node);
  ------------------
  |  |  405|  2.37k|#define attrGetTYPE( nod )        TY_(AttrGetById)( nod, TidyAttr_TYPE  )
  |  |  ------------------
  |  |  |  |   23|  2.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  2.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2147|       |
 2148|  2.37k|        if (AttrValueIs(type, "text/javascript"))
  ------------------
  |  |  172|  2.37k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  4.74k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 103, False: 2.27k]
  |  |  |  |  |  Branch (171:44): [True: 92, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  2.37k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|     92|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     92|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 92]
  |  |  ------------------
  ------------------
 2149|      0|        {
 2150|      0|            commentStart = JS_COMMENT_START;
 2151|      0|            commentEnd = JS_COMMENT_END;
 2152|      0|        }
 2153|  2.37k|        else if (AttrValueIs(type, "text/css"))
  ------------------
  |  |  172|  2.37k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  4.74k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 103, False: 2.27k]
  |  |  |  |  |  Branch (171:44): [True: 92, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  2.37k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|     92|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     92|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 52, False: 40]
  |  |  ------------------
  ------------------
 2154|     52|        {
 2155|     52|            commentStart = CSS_COMMENT_START;
 2156|     52|            commentEnd = CSS_COMMENT_END;
 2157|     52|        }
 2158|  2.32k|        else if (AttrValueIs(type, "text/vbscript"))
  ------------------
  |  |  172|  2.32k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  4.64k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 51, False: 2.27k]
  |  |  |  |  |  Branch (171:44): [True: 40, False: 11]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  2.32k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|     40|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     40|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 40]
  |  |  ------------------
  ------------------
 2159|      0|        {
 2160|      0|            commentStart = VB_COMMENT_START;
 2161|      0|            commentEnd = VB_COMMENT_END;
 2162|      0|        }
 2163|       |
 2164|  2.37k|        hasCData = HasCDATA(doc->lexer, node->content);
 2165|       |
 2166|  2.37k|        if (!hasCData)
  ------------------
  |  Branch (2166:13): [True: 2.30k, False: 71]
  ------------------
 2167|  2.30k|        {
 2168|  2.30k|            uint saveWrap = WrapOff( doc );
 2169|       |
 2170|  2.30k|            AddString( pprint, commentStart );
 2171|  2.30k|            AddString( pprint, CDATA_START );
 2172|  2.30k|            AddString( pprint, commentEnd );
 2173|  2.30k|            PCondFlushLineSmart( doc, indent );
 2174|       |
 2175|  2.30k|            WrapOn( doc, saveWrap );
 2176|  2.30k|        }
 2177|  2.37k|    }
 2178|       |
 2179|  3.79k|    for ( content = node->content;
 2180|  8.10k|          content != NULL;
  ------------------
  |  Branch (2180:11): [True: 4.30k, False: 3.79k]
  ------------------
 2181|  4.30k|          content = content->next )
 2182|  4.30k|    {
 2183|       |        /*
 2184|       |          This is a bit odd, with the current code there can only
 2185|       |          be one child and the only caller of this function defines
 2186|       |          all these modes already...
 2187|       |        */
 2188|  4.30k|        TY_(PPrintTree)( doc, (mode | PREFORMATTED | NOWRAP | CDATA),
  ------------------
  |  |   23|  4.30k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.30k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2189|  4.30k|                         indent, content );
 2190|       |
 2191|  4.30k|        if ( content == node->last )
  ------------------
  |  Branch (2191:14): [True: 2.37k, False: 1.93k]
  ------------------
 2192|  2.37k|            contentIndent = TextEndsWithNewline( doc->lexer, content, CDATA );
 2193|  4.30k|    }
 2194|       |
 2195|       |    /* Only flush the line if these was content present so that the closing
 2196|       |       SCRIPT tag will stay on the same line. */
 2197|  3.79k|    if ( contentIndent < 0 && node->content != NULL )
  ------------------
  |  Branch (2197:10): [True: 3.73k, False: 66]
  |  Branch (2197:31): [True: 2.30k, False: 1.42k]
  ------------------
 2198|  2.30k|    {
 2199|  2.30k|        PCondFlushLineSmart( doc, indent );
 2200|  2.30k|        contentIndent = 0;
 2201|  2.30k|    }
 2202|       |
 2203|  3.79k|    if ( xhtmlOut && node->content != NULL )
  ------------------
  |  Branch (2203:10): [True: 3.79k, False: 0]
  |  Branch (2203:22): [True: 2.37k, False: 1.42k]
  ------------------
 2204|  2.37k|    {
 2205|  2.37k|        if ( ! hasCData )
  ------------------
  |  Branch (2205:14): [True: 2.30k, False: 71]
  ------------------
 2206|  2.30k|        {
 2207|  2.30k|            uint saveWrap = WrapOff( doc );
 2208|       |
 2209|  2.30k|            AddString( pprint, commentStart );
 2210|  2.30k|            AddString( pprint, CDATA_END );
 2211|  2.30k|            AddString( pprint, commentEnd );
 2212|       |
 2213|  2.30k|            WrapOn( doc, saveWrap );
 2214|  2.30k|            PCondFlushLineSmart( doc, indent );
 2215|  2.30k|        }
 2216|  2.37k|    }
 2217|       |
 2218|  3.79k|    if ( node->content && pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (2218:10): [True: 2.37k, False: 1.42k]
  |  Branch (2218:27): [True: 0, False: 2.37k]
  ------------------
 2219|      0|    {
 2220|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_INDENT)
 2221|       |        SPRTF("%s Indent from %d to %d\n", __FUNCTION__, pprint->indent[ 0 ].spaces, indent );
 2222|       |#endif
 2223|      0|        pprint->indent[ 0 ].spaces = indent;
 2224|      0|    }
 2225|  3.79k|    PPrintEndTag( doc, mode, indent, node );
 2226|  3.79k|    if ( cfgAutoBool(doc, TidyIndentContent) == TidyNoState
  ------------------
  |  |  421|  3.79k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.79k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2226:10): [True: 3.79k, False: 0]
  ------------------
 2227|  3.79k|         && node->next != NULL &&
  ------------------
  |  Branch (2227:13): [True: 2.63k, False: 1.16k]
  ------------------
 2228|  2.63k|         !( TY_(nodeHasCM)(node, CM_INLINE) || TY_(nodeIsText)(node) ) )
  ------------------
  |  |   23|  2.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                       !( TY_(nodeHasCM)(node, CM_INLINE) || TY_(nodeIsText)(node) ) )
  ------------------
  |  |  143|  2.63k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                       !( TY_(nodeHasCM)(node, CM_INLINE) || TY_(nodeIsText)(node) ) )
  ------------------
  |  |   23|  1.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2228:13): [True: 1.44k, False: 1.18k]
  |  Branch (2228:48): [True: 0, False: 1.18k]
  ------------------
 2229|  1.18k|        PFlushLineSmart( doc, indent );
 2230|  3.79k|}
pprint.c:InsideHead:
  981|  69.4k|{
  982|  69.4k|  if ( nodeIsHEAD(node) )
  ------------------
  |  |  371|  69.4k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|  69.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 69.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 49.4k, False: 19.9k]
  |  |  |  |  |  Branch (275:54): [True: 1.76k, False: 47.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  983|  1.76k|    return yes;
  984|       |
  985|  67.7k|  if ( node->parent != NULL )
  ------------------
  |  Branch (985:8): [True: 65.6k, False: 2.03k]
  ------------------
  986|  65.6k|    return InsideHead( doc, node->parent );
  987|       |
  988|  2.03k|  return no;
  989|  67.7k|}
pprint.c:HasCDATA:
 1065|  2.37k|{
 1066|       |    /* Scan forward through the textarray. Since the characters we're
 1067|       |    ** looking for are < 0x7f, we don't have to do any UTF-8 decoding.
 1068|       |    */
 1069|  2.37k|    ctmbstr start = lexer->lexbuf + node->start;
 1070|  2.37k|    int len = node->end - node->start + 1;
 1071|       |
 1072|  2.37k|    if ( node->type != TextNode )
  ------------------
  |  Branch (1072:10): [True: 914, False: 1.45k]
  ------------------
 1073|    914|        return no;
 1074|       |
 1075|  1.45k|    return ( NULL != TY_(tmbsubstrn)( start, len, CDATA_START ));
  ------------------
  |  |   23|  1.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1076|  2.37k|}
pprint.c:ShouldIndent:
 1083|  3.11M|{
 1084|  3.11M|    TidyTriState indentContent = cfgAutoBool( doc, TidyIndentContent );
  ------------------
  |  |  421|  3.11M|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.11M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1085|  3.11M|    if ( indentContent == TidyNoState )
  ------------------
  |  Branch (1085:10): [True: 3.11M, False: 0]
  ------------------
 1086|  3.11M|        return no;
 1087|       |
 1088|      0|    if ( nodeIsTEXTAREA(node) )
  ------------------
  |  |  425|      0|#define nodeIsTEXTAREA( node )   TagIsId( node, TidyTag_TEXTAREA )
  |  |  ------------------
  |  |  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1089|      0|        return no;
 1090|       |
 1091|      0|    if ( indentContent == TidyAutoState )
  ------------------
  |  Branch (1091:10): [True: 0, False: 0]
  ------------------
 1092|      0|    {
 1093|      0|        if ( node->content && TY_(nodeHasCM)(node, CM_NO_INDENT) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( node->content && TY_(nodeHasCM)(node, CM_NO_INDENT) )
  ------------------
  |  |  157|      0|#define CM_NO_INDENT    (1 << 18)  /**< Elements whose content needs to be indented only if containing one CM_BLOCK element. */
  ------------------
  |  Branch (1093:14): [True: 0, False: 0]
  |  Branch (1093:31): [True: 0, False: 0]
  ------------------
 1094|      0|        {
 1095|      0|            for ( node = node->content; node; node = node->next )
  ------------------
  |  Branch (1095:41): [True: 0, False: 0]
  ------------------
 1096|      0|                if ( TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |  142|      0|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (1096:22): [True: 0, False: 0]
  ------------------
 1097|      0|                    return yes;
 1098|      0|            return no;
 1099|      0|        }
 1100|       |
 1101|      0|        if ( TY_(nodeHasCM)(node, CM_HEADING) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( TY_(nodeHasCM)(node, CM_HEADING) )
  ------------------
  |  |  153|      0|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
  |  Branch (1101:14): [True: 0, False: 0]
  ------------------
 1102|      0|            return no;
 1103|       |
 1104|      0|        if ( nodeIsHTML(node) )
  ------------------
  |  |  370|      0|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1105|      0|            return no;
 1106|       |
 1107|      0|        if ( nodeIsP(node) )
  ------------------
  |  |  385|      0|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1108|      0|            return no;
 1109|       |
 1110|      0|        if ( nodeIsTITLE(node) )
  ------------------
  |  |  372|      0|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1111|      0|            return no;
 1112|       |
 1113|       |        /* http://tidy.sf.net/issue/1610888
 1114|       |           Indenting <div><img /></div> produces spurious lines with IE 6.x */
 1115|      0|        if ( nodeIsDIV(node) && node->last && nodeIsIMG(node->last) )
  ------------------
  |  |  429|      0|#define nodeIsDIV( node )        TagIsId( node, TidyTag_DIV )
  |  |  ------------------
  |  |  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsDIV(node) && node->last && nodeIsIMG(node->last) )
  ------------------
  |  |  412|      0|#define nodeIsIMG( node )        TagIsId( node, TidyTag_IMG )
  |  |  ------------------
  |  |  |  |  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 (1115:33): [True: 0, False: 0]
  ------------------
 1116|      0|            return no;
 1117|      0|    }
 1118|       |
 1119|      0|    if ( TY_(nodeHasCM)(node, CM_FIELD | CM_OBJECT) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if ( TY_(nodeHasCM)(node, CM_FIELD | CM_OBJECT) )
  ------------------
  |  |  149|      0|#define CM_FIELD        (1 << 10)  /**< Elements whose content must be protected against white space movement. Includes some elements that can found in forms. */
  ------------------
                  if ( TY_(nodeHasCM)(node, CM_FIELD | CM_OBJECT) )
  ------------------
  |  |  150|      0|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1119:10): [True: 0, False: 0]
  ------------------
 1120|      0|        return yes;
 1121|       |
 1122|      0|    if ( nodeIsMAP(node) )
  ------------------
  |  |  413|      0|#define nodeIsMAP( node )        TagIsId( node, TidyTag_MAP )
  |  |  ------------------
  |  |  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1123|      0|        return yes;
 1124|       |
 1125|      0|    return ( !TY_(nodeHasCM)( node, CM_INLINE ) && node->content );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  return ( !TY_(nodeHasCM)( node, CM_INLINE ) && node->content );
  ------------------
  |  |  143|      0|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1125:14): [True: 0, False: 0]
  |  Branch (1125:52): [True: 0, False: 0]
  ------------------
 1126|      0|}

prvTidyStdErrOutput:
   68|  20.2k|{
   69|  20.2k|  if ( stderrStreamOut.sink.sinkData == 0 )
  ------------------
  |  Branch (69:8): [True: 1, False: 20.2k]
  ------------------
   70|      1|      stderrStreamOut.sink.sinkData = stderr;
   71|  20.2k|  return &stderrStreamOut;
   72|  20.2k|}
prvTidyReleaseStreamOut:
   75|  40.4k|{
   76|  40.4k|    if ( out && out != &stderrStreamOut && out != &stdoutStreamOut )
  ------------------
  |  Branch (76:10): [True: 40.4k, False: 0]
  |  Branch (76:17): [True: 20.2k, False: 20.2k]
  |  Branch (76:44): [True: 20.2k, False: 0]
  ------------------
   77|  20.2k|    {
   78|  20.2k|        if ( out->iotype == FileIO )
  ------------------
  |  Branch (78:14): [True: 0, False: 20.2k]
  ------------------
   79|      0|            fclose( (FILE*) out->sink.sinkData );
   80|  20.2k|        TidyDocFree( doc, out );
  ------------------
  |  |  159|  20.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   81|  20.2k|    }
   82|  40.4k|}
prvTidyinitStreamIn:
   91|  20.2k|{
   92|  20.2k|    StreamIn *in = (StreamIn*) TidyDocAlloc( doc, sizeof(StreamIn) );
  ------------------
  |  |  157|  20.2k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  20.2k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
   93|       |
   94|  20.2k|    TidyClearMemory( in, sizeof(StreamIn) );
  ------------------
  |  |   70|  20.2k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
   95|  20.2k|    in->curline = 1;
   96|  20.2k|    in->curcol = 1;
   97|  20.2k|    in->encoding = encoding;
   98|  20.2k|    in->state = FSM_ASCII;
   99|  20.2k|    in->doc = doc;
  100|  20.2k|    in->bufsize = CHARBUF_SIZE;
  101|  20.2k|    in->allocator = doc->allocator;
  102|  20.2k|    in->charbuf = (tchar*)TidyDocAlloc(doc, sizeof(tchar) * in->bufsize);
  ------------------
  |  |  157|  20.2k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  20.2k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  103|  20.2k|    InitLastPos( in );
  104|  20.2k|    return in;
  105|  20.2k|}
prvTidyfreeStreamIn:
  108|  20.2k|{
  109|  20.2k|    TidyFree(in->allocator, in->charbuf);
  ------------------
  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  110|  20.2k|    TidyFree(in->allocator, in);
  ------------------
  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  111|  20.2k|}
prvTidyFileInput:
  114|  20.2k|{
  115|  20.2k|    StreamIn *in = TY_(initStreamIn)( doc, encoding );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  116|  20.2k|    if ( TY_(initFileSource)( doc->allocator, &in->source, fp ) != 0 )
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (116:10): [True: 0, False: 20.2k]
  ------------------
  117|      0|    {
  118|      0|        TY_(freeStreamIn)( in );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  119|      0|        return NULL;
  120|      0|    }
  121|  20.2k|    in->iotype = FileIO;
  122|  20.2k|    return in;
  123|  20.2k|}
prvTidyReadBOMEncoding:
  142|  20.2k|{
  143|  20.2k|    uint c, c1;
  144|  20.2k|    uint bom;
  145|       |
  146|  20.2k|    c = ReadByte(in);
  147|  20.2k|    if (c == EndOfStream)
  ------------------
  |  | 1064|  20.2k|#define EndOfStream (~0u)
  ------------------
  |  Branch (147:9): [True: 0, False: 20.2k]
  ------------------
  148|      0|        return -1;
  149|       |
  150|  20.2k|    c1 = ReadByte( in );
  151|  20.2k|    if (c1 == EndOfStream)
  ------------------
  |  | 1064|  20.2k|#define EndOfStream (~0u)
  ------------------
  |  Branch (151:9): [True: 0, False: 20.2k]
  ------------------
  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|  20.2k|    bom = (c << 8) + c1;
  161|       |
  162|  20.2k|    if ( bom == UNICODE_BOM_BE )
  ------------------
  |  |   28|  20.2k|#define UNICODE_BOM_BE   0xFEFF   /* big-endian (default) UNICODE BOM */
  ------------------
  |  Branch (162:10): [True: 117, False: 20.0k]
  ------------------
  163|    117|    {
  164|       |        /* big-endian UTF-16 */
  165|    117|        if ( in->encoding != UTF16 && in->encoding != UTF16BE )
  ------------------
  |  |  144|    234|#define UTF16       11
  ------------------
                      if ( in->encoding != UTF16 && in->encoding != UTF16BE )
  ------------------
  |  |  143|    117|#define UTF16BE     10
  ------------------
  |  Branch (165:14): [True: 117, False: 0]
  |  Branch (165:39): [True: 117, False: 0]
  ------------------
  166|    117|            TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16BE);
  ------------------
  |  |   23|    117|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    117|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16BE);
  ------------------
  |  |  143|    117|#define UTF16BE     10
  ------------------
  167|       |
  168|    117|        return UTF16BE; /* return decoded BOM */
  ------------------
  |  |  143|    117|#define UTF16BE     10
  ------------------
  169|    117|    }
  170|  20.0k|    else if (bom == UNICODE_BOM_LE)
  ------------------
  |  |   30|  20.0k|#define UNICODE_BOM_LE   0xFFFE   /* little-endian UNICODE BOM */
  ------------------
  |  Branch (170:14): [True: 61, False: 20.0k]
  ------------------
  171|     61|    {
  172|       |        /* little-endian UTF-16 */
  173|     61|        if (in->encoding != UTF16 && in->encoding != UTF16LE)
  ------------------
  |  |  144|    122|#define UTF16       11
  ------------------
                      if (in->encoding != UTF16 && in->encoding != UTF16LE)
  ------------------
  |  |  142|     61|#define UTF16LE     9
  ------------------
  |  Branch (173:13): [True: 61, False: 0]
  |  Branch (173:38): [True: 61, False: 0]
  ------------------
  174|     61|            TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16LE);
  ------------------
  |  |   23|     61|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     61|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16LE);
  ------------------
  |  |  142|     61|#define UTF16LE     9
  ------------------
  175|       |
  176|     61|        return UTF16LE; /* return decoded BOM */
  ------------------
  |  |  142|     61|#define UTF16LE     9
  ------------------
  177|     61|    }
  178|  20.0k|    else
  179|  20.0k|    {
  180|  20.0k|        uint c2 = ReadByte(in);
  181|       |
  182|  20.0k|        if (c2 == EndOfStream)
  ------------------
  |  | 1064|  20.0k|#define EndOfStream (~0u)
  ------------------
  |  Branch (182:13): [True: 0, False: 20.0k]
  ------------------
  183|      0|        {
  184|      0|            UngetByte(in, c1);
  185|      0|            UngetByte(in, c);
  186|      0|            return -1;
  187|      0|        }
  188|       |
  189|  20.0k|        if (((c << 16) + (c1 << 8) + c2) == UNICODE_BOM_UTF8)
  ------------------
  |  |   31|  20.0k|#define UNICODE_BOM_UTF8 0xEFBBBF /* UTF-8 UNICODE BOM */
  ------------------
  |  Branch (189:13): [True: 3, False: 20.0k]
  ------------------
  190|      3|        {
  191|       |            /* UTF-8 */
  192|      3|            if (in->encoding != UTF8)
  ------------------
  |  |  137|      3|#define UTF8        4
  ------------------
  |  Branch (192:17): [True: 0, False: 3]
  ------------------
  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|      3|            return UTF8;
  ------------------
  |  |  137|      3|#define UTF8        4
  ------------------
  196|      3|        }
  197|  20.0k|        else
  198|  20.0k|            UngetByte( in, c2 );
  199|  20.0k|    }
  200|       |
  201|  20.0k|    UngetByte(in, c1);
  202|  20.0k|    UngetByte(in, c);
  203|       |
  204|  20.0k|    return -1;
  205|  20.2k|}
prvTidyReadChar:
  240|   323M|{
  241|   323M|    uint c = EndOfStream;
  ------------------
  |  | 1064|   323M|#define EndOfStream (~0u)
  ------------------
  242|       |
  243|   323M|    if ( in->pushed )
  ------------------
  |  Branch (243:10): [True: 4.89M, False: 318M]
  ------------------
  244|  4.89M|        return PopChar( in );
  245|       |
  246|   318M|    SaveLastPos( in );
  247|       |
  248|   318M|    if ( in->tabs > 0 )
  ------------------
  |  Branch (248:10): [True: 245M, False: 72.9M]
  ------------------
  249|   245M|    {
  250|   245M|        in->curcol++;
  251|   245M|        in->tabs--;
  252|   245M|        return ' ';
  253|   245M|    }
  254|       |    
  255|  72.9M|    for (;;)
  256|  75.6M|    {
  257|  75.6M|        c = ReadCharFromStream(in);
  258|       |
  259|  75.6M|        if ( EndOfStream == c )
  ------------------
  |  | 1064|  75.6M|#define EndOfStream (~0u)
  ------------------
  |  Branch (259:14): [True: 1.74M, False: 73.9M]
  ------------------
  260|  1.74M|            return EndOfStream;
  ------------------
  |  | 1064|  1.74M|#define EndOfStream (~0u)
  ------------------
  261|       |
  262|  73.9M|        if (c == '\n')
  ------------------
  |  Branch (262:13): [True: 1.10M, False: 72.8M]
  ------------------
  263|  1.10M|        {
  264|  1.10M|            in->curcol = 1;
  265|  1.10M|            in->curline++;
  266|  1.10M|            break;
  267|  1.10M|        }
  268|       |
  269|  72.8M|        if (c == '\t')
  ------------------
  |  Branch (269:13): [True: 35.1M, False: 37.6M]
  ------------------
  270|  35.1M|        {
  271|  35.1M|            Bool keeptabs = cfg( in->doc, TidyKeepTabs );
  ------------------
  |  |  415|  35.1M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  272|  35.1M|            if (!keeptabs) {
  ------------------
  |  Branch (272:17): [True: 35.1M, False: 0]
  ------------------
  273|  35.1M|                uint tabsize = cfg(in->doc, TidyTabSize);
  ------------------
  |  |  415|  35.1M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  274|  35.1M|                in->tabs = tabsize > 0 ?
  ------------------
  |  Branch (274:28): [True: 35.1M, False: 0]
  ------------------
  275|  35.1M|                    tabsize - ((in->curcol - 1) % tabsize) - 1
  276|  35.1M|                    : 0;
  277|  35.1M|                c = ' ';
  278|  35.1M|            }
  279|  35.1M|            in->curcol++;
  280|  35.1M|            break;
  281|  35.1M|        }
  282|       |
  283|       |        /* #427663 - map '\r' to '\n' - Andy Quick 11 Aug 00 */
  284|  37.6M|        if (c == '\r')
  ------------------
  |  Branch (284:13): [True: 18.7k, False: 37.6M]
  ------------------
  285|  18.7k|        {
  286|  18.7k|            c = ReadCharFromStream(in);
  287|  18.7k|            if (c != '\n')
  ------------------
  |  Branch (287:17): [True: 17.0k, False: 1.67k]
  ------------------
  288|  17.0k|            {
  289|  17.0k|                TY_(UngetChar)( c, in );
  ------------------
  |  |   23|  17.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  290|  17.0k|                c = '\n';
  291|  17.0k|            }
  292|  1.67k|            else
  293|  1.67k|            {
  294|  1.67k|            }
  295|  18.7k|            in->curcol = 1;
  296|  18.7k|            in->curline++;
  297|  18.7k|            break;
  298|  18.7k|        }
  299|       |
  300|  37.6M|#ifndef NO_NATIVE_ISO2022_SUPPORT
  301|       |        /* strip control characters, except for Esc */
  302|  37.6M|        if (c == '\033')
  ------------------
  |  Branch (302:13): [True: 5.75k, False: 37.6M]
  ------------------
  303|  5.75k|            break;
  304|  37.6M|#endif
  305|       |
  306|       |        /* Form Feed is allowed in HTML */
  307|  37.6M|        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: 37.6M]
  |  Branch (307:29): [True: 0, False: 0]
  ------------------
  308|      0|            break;
  309|       |            
  310|  37.6M|        if ( c < 32 )
  ------------------
  |  Branch (310:14): [True: 2.71M, False: 34.9M]
  ------------------
  311|  2.71M|            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|  34.9M|        if (
  317|  34.9M|            in->encoding == RAW
  ------------------
  |  |  133|  69.8M|#define RAW         0
  ------------------
  |  Branch (317:13): [True: 0, False: 34.9M]
  ------------------
  318|  34.9M|#ifndef NO_NATIVE_ISO2022_SUPPORT
  319|  34.9M|         || in->encoding == ISO2022
  ------------------
  |  |  138|  69.8M|#define ISO2022     5
  ------------------
  |  Branch (319:13): [True: 0, False: 34.9M]
  ------------------
  320|  34.9M|#endif
  321|  34.9M|         || in->encoding == UTF8
  ------------------
  |  |  137|  69.8M|#define UTF8        4
  ------------------
  |  Branch (321:13): [True: 34.5M, False: 398k]
  ------------------
  322|   398k|         || in->encoding == SHIFTJIS /* #431953 - RJ */
  ------------------
  |  |  146|  35.3M|#define SHIFTJIS    13
  ------------------
  |  Branch (322:13): [True: 0, False: 398k]
  ------------------
  323|   398k|         || in->encoding == BIG5     /* #431953 - RJ */
  ------------------
  |  |  145|   398k|#define BIG5        12
  ------------------
  |  Branch (323:13): [True: 0, False: 398k]
  ------------------
  324|  34.9M|           )
  325|  34.5M|        {
  326|  34.5M|            in->curcol++;
  327|  34.5M|            break;
  328|  34.5M|        }
  329|       |
  330|       |        /* handle surrogate pairs */
  331|   398k|        if ( in->encoding == UTF16LE ||
  ------------------
  |  |  142|   797k|#define UTF16LE     9
  ------------------
  |  Branch (331:14): [True: 396k, False: 1.66k]
  ------------------
  332|  1.66k|             in->encoding == UTF16   ||
  ------------------
  |  |  144|   400k|#define UTF16       11
  ------------------
  |  Branch (332:14): [True: 0, False: 1.66k]
  ------------------
  333|  1.66k|             in->encoding == UTF16BE )
  ------------------
  |  |  143|  1.66k|#define UTF16BE     10
  ------------------
  |  Branch (333:14): [True: 1.66k, False: 0]
  ------------------
  334|   398k|        {
  335|   398k|            if ( !TY_(IsValidUTF16FromUCS4)(c) )
  ------------------
  |  |   23|   398k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   398k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (335:18): [True: 0, False: 398k]
  ------------------
  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|   398k|            else if ( TY_(IsLowSurrogate)(c) )
  ------------------
  |  |   23|   398k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   398k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (341:23): [True: 7.11k, False: 391k]
  ------------------
  342|  7.11k|            {
  343|  7.11k|                uint n = c;
  344|  7.11k|                uint m = ReadCharFromStream( in );
  345|  7.11k|                if ( m == EndOfStream )
  ------------------
  |  | 1064|  7.11k|#define EndOfStream (~0u)
  ------------------
  |  Branch (345:22): [True: 7, False: 7.11k]
  ------------------
  346|      7|                   return EndOfStream;
  ------------------
  |  | 1064|      7|#define EndOfStream (~0u)
  ------------------
  347|       |
  348|  7.11k|                c = 0;
  349|  7.11k|                if ( TY_(IsHighSurrogate)(m) )
  ------------------
  |  |   23|  7.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (349:22): [True: 770, False: 6.34k]
  ------------------
  350|    770|                {
  351|    770|                    n = TY_(CombineSurrogatePair)( m, n );
  ------------------
  |  |   23|    770|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    770|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  352|    770|                    if ( TY_(IsValidCombinedChar)(n) )
  ------------------
  |  |   23|    770|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    770|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (352:26): [True: 361, False: 409]
  ------------------
  353|    361|                        c = n;
  354|    770|                }
  355|       |                /* not a valid pair */
  356|  7.11k|                if ( 0 == c )
  ------------------
  |  Branch (356:22): [True: 6.75k, False: 361]
  ------------------
  357|  6.75k|                    TY_(ReportEncodingError)( in->doc, INVALID_UTF16, c, yes );
  ------------------
  |  |   23|  6.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  358|  7.11k|            }
  359|   398k|        }
  360|       |
  361|       |        /* Do first: acts on range 128 - 255 */
  362|   398k|        switch ( in->encoding )
  ------------------
  |  Branch (362:18): [True: 0, False: 398k]
  ------------------
  363|   398k|        {
  364|      0|        case MACROMAN:
  ------------------
  |  |  139|      0|#define MACROMAN    6
  ------------------
  |  Branch (364:9): [True: 0, False: 398k]
  ------------------
  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: 398k]
  ------------------
  368|      0|            c = DecodeIbm850( c );
  369|      0|            break;
  370|      0|        case LATIN0:
  ------------------
  |  |  135|      0|#define LATIN0      2
  ------------------
  |  Branch (370:9): [True: 0, False: 398k]
  ------------------
  371|      0|            c = DecodeLatin0( c );
  372|      0|            break;
  373|   398k|        }
  374|       |
  375|       |        /* produced e.g. as a side-effect of smart quotes in Word */
  376|       |        /* but can't happen if using MACROMAN encoding */
  377|   398k|        if ( 127 < c && c < 160 )
  ------------------
  |  Branch (377:14): [True: 390k, False: 7.94k]
  |  Branch (377:25): [True: 923, False: 389k]
  ------------------
  378|    923|        {
  379|    923|            uint c1 = 0, replMode = DISCARDED_CHAR;
  ------------------
  |  |  314|    923|#define DISCARDED_CHAR          1
  ------------------
  380|    923|            Bool isVendorChar = ( in->encoding == WIN1252 ||
  ------------------
  |  |  140|  1.84k|#define WIN1252     7
  ------------------
  |  Branch (380:35): [True: 0, False: 923]
  ------------------
  381|    923|                                  in->encoding == MACROMAN );
  ------------------
  |  |  139|    923|#define MACROMAN    6
  ------------------
  |  Branch (381:35): [True: 0, False: 923]
  ------------------
  382|    923|            Bool isMacChar    = ( in->encoding == MACROMAN );
  ------------------
  |  |  139|    923|#define MACROMAN    6
  ------------------
  383|       |            
  384|       |            /* set error position just before offending character */
  385|    923|            if (in->doc->lexer)
  ------------------
  |  Branch (385:17): [True: 923, False: 0]
  ------------------
  386|    923|            {
  387|    923|                in->doc->lexer->lines = in->curline;
  388|    923|                in->doc->lexer->columns = in->curcol;
  389|    923|            }
  390|       |                
  391|    923|            if ( isMacChar )
  ------------------
  |  Branch (391:18): [True: 0, False: 923]
  ------------------
  392|      0|                c1 = TY_(DecodeMacRoman)( c );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  393|    923|            else
  394|    923|                c1 = TY_(DecodeWin1252)( c );
  ------------------
  |  |   23|    923|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    923|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  395|    923|            if ( c1 )
  ------------------
  |  Branch (395:18): [True: 494, False: 429]
  ------------------
  396|    494|                replMode = REPLACED_CHAR;
  ------------------
  |  |  313|    494|#define REPLACED_CHAR           0
  ------------------
  397|       |                
  398|    923|            if ( c1 == 0 && isVendorChar )
  ------------------
  |  Branch (398:18): [True: 429, False: 494]
  |  Branch (398:29): [True: 0, False: 429]
  ------------------
  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|    923|            else if ( ! isVendorChar )
  ------------------
  |  Branch (400:23): [True: 923, False: 0]
  ------------------
  401|    923|                TY_(ReportEncodingError)(in->doc, INVALID_SGML_CHARS, c, replMode == DISCARDED_CHAR);
  ------------------
  |  |   23|    923|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    923|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportEncodingError)(in->doc, INVALID_SGML_CHARS, c, replMode == DISCARDED_CHAR);
  ------------------
  |  |  314|    923|#define DISCARDED_CHAR          1
  ------------------
  402|       |                
  403|    923|            c = c1;
  404|    923|        }
  405|       |
  406|   398k|        if ( c == 0 )
  ------------------
  |  Branch (406:14): [True: 7.17k, False: 391k]
  ------------------
  407|  7.17k|            continue; /* illegal char is discarded */
  408|       |        
  409|   391k|        in->curcol++;
  410|   391k|        break;
  411|   398k|    }
  412|       |
  413|  71.2M|    return c;
  414|  72.9M|}
prvTidyUngetChar:
  440|  4.91M|{
  441|  4.91M|    if (c == EndOfStream)
  ------------------
  |  | 1064|  4.91M|#define EndOfStream (~0u)
  ------------------
  |  Branch (441:9): [True: 18.9k, False: 4.89M]
  ------------------
  442|  18.9k|    {
  443|       |        /* fprintf(stderr, "Attempt to UngetChar EOF\n"); */
  444|  18.9k|        return;
  445|  18.9k|    }
  446|       |    
  447|  4.89M|    in->pushed = yes;
  448|       |
  449|  4.89M|    if (in->bufpos + 1 >= in->bufsize)
  ------------------
  |  Branch (449:9): [True: 246k, False: 4.64M]
  ------------------
  450|   246k|        in->charbuf = (tchar*)TidyRealloc(in->allocator, in->charbuf, sizeof(tchar) * ++(in->bufsize));
  ------------------
  |  |   67|   246k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  451|       |
  452|  4.89M|    in->charbuf[(in->bufpos)++] = c;
  453|       |
  454|  4.89M|    if (c == '\n')
  ------------------
  |  Branch (454:9): [True: 6.70k, False: 4.88M]
  ------------------
  455|  6.70k|        --(in->curline);
  456|       |
  457|  4.89M|    RestoreLastPos( in );
  458|  4.89M|}
prvTidyBufferOutput:
  484|  40.4k|{
  485|  40.4k|    StreamOut* out = initStreamOut( doc, encoding, nl );
  486|  40.4k|    tidyInitOutputBuffer( &out->sink, buf );
  487|  40.4k|    out->iotype = BufferIO;
  488|  40.4k|    return out;
  489|  40.4k|}
prvTidyWriteChar:
  499|   325M|{
  500|       |    /* Translate outgoing newlines */
  501|   325M|    if ( LF == c )
  ------------------
  |  |  163|   325M|#define LF    0xA
  ------------------
  |  Branch (501:10): [True: 5.35M, False: 320M]
  ------------------
  502|  5.35M|    {
  503|  5.35M|      if ( out->nl == TidyCRLF )
  ------------------
  |  Branch (503:12): [True: 0, False: 5.35M]
  ------------------
  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|  5.35M|      else if ( out->nl == TidyCR )
  ------------------
  |  Branch (505:17): [True: 0, False: 5.35M]
  ------------------
  506|      0|          c = CR;
  ------------------
  |  |  162|      0|#define CR    0xD
  ------------------
  507|  5.35M|    }
  508|       |
  509|   325M|    if (out->encoding == MACROMAN)
  ------------------
  |  |  139|   325M|#define MACROMAN    6
  ------------------
  |  Branch (509:9): [True: 0, False: 325M]
  ------------------
  510|      0|    {
  511|      0|        EncodeMacRoman( c, out );
  512|      0|    }
  513|   325M|    else if (out->encoding == WIN1252)
  ------------------
  |  |  140|   325M|#define WIN1252     7
  ------------------
  |  Branch (513:14): [True: 0, False: 325M]
  ------------------
  514|      0|    {
  515|      0|        EncodeWin1252( c, out );
  516|      0|    }
  517|   325M|    else if (out->encoding == IBM858)
  ------------------
  |  |  141|   325M|#define IBM858      8
  ------------------
  |  Branch (517:14): [True: 0, False: 325M]
  ------------------
  518|      0|    {
  519|      0|        EncodeIbm858( c, out );
  520|      0|    }
  521|   325M|    else if (out->encoding == LATIN0)
  ------------------
  |  |  135|   325M|#define LATIN0      2
  ------------------
  |  Branch (521:14): [True: 0, False: 325M]
  ------------------
  522|      0|    {
  523|      0|        EncodeLatin0( c, out );
  524|      0|    }
  525|       |
  526|   325M|    else if (out->encoding == UTF8)
  ------------------
  |  |  137|   325M|#define UTF8        4
  ------------------
  |  Branch (526:14): [True: 325M, False: 0]
  ------------------
  527|   325M|    {
  528|   325M|        int count = 0;
  529|       |        
  530|   325M|        TY_(EncodeCharToUTF8Bytes)( c, NULL, &out->sink, &count );
  ------------------
  |  |   23|   325M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   325M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  531|   325M|        if (count <= 0)
  ------------------
  |  Branch (531:13): [True: 19.2k, False: 325M]
  ------------------
  532|  19.2k|        {
  533|       |            /* replacement char 0xFFFD encoded as UTF-8 */
  534|  19.2k|            PutByte(0xEF, out); PutByte(0xBF, out); PutByte(0xBF, out);
  535|  19.2k|        }
  536|   325M|    }
  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|   325M|}
prvTidyDecodeWin1252:
  660|  1.73k|{
  661|  1.73k|    if (127 < c && c < 160)
  ------------------
  |  Branch (661:9): [True: 1.73k, False: 0]
  |  Branch (661:20): [True: 1.73k, False: 0]
  ------------------
  662|  1.73k|        c = Win2Unicode[c - 128];
  663|       |        
  664|  1.73k|    return c;
  665|  1.73k|}
tidyGetByte:
  879|  74.4M|{
  880|  74.4M|  int bv = source->getByte( source->sourceData );
  881|  74.4M|  return (uint) bv;
  882|  74.4M|}
tidyIsEOF:
  884|  76.0M|{
  885|  76.0M|  return source->eof( source->sourceData );
  886|  76.0M|}
tidyUngetByte:
  888|  60.0k|{
  889|  60.0k|    source->ungetByte( source->sourceData, (byte) ch );
  890|  60.0k|}
tidyPutByte:
  892|  57.8k|{
  893|  57.8k|    sink->putByte( sink->sinkData, (byte) ch );
  894|  57.8k|}
prvTidyIsEOF:
  901|  76.0M|{
  902|  76.0M|    return tidyIsEOF( &in->source );
  903|  76.0M|}
prvTidyGetEncodingNameFromTidyId:
 1110|  20.5k|{
 1111|  20.5k|    uint i;
 1112|       |
 1113|  83.0k|    for (i = 0; enc2iana[i].name; ++i)
  ------------------
  |  Branch (1113:17): [True: 83.0k, False: 0]
  ------------------
 1114|  83.0k|        if (enc2iana[i].id == id)
  ------------------
  |  Branch (1114:13): [True: 20.5k, False: 62.5k]
  ------------------
 1115|  20.5k|            return enc2iana[i].name;
 1116|       |
 1117|      0|    return NULL;
 1118|  20.5k|}
streamio.c:InitLastPos:
  208|  20.2k|{
  209|  20.2k|    in->curlastpos = 0;
  210|  20.2k|    in->firstlastpos = 0;
  211|  20.2k|}
streamio.c:SaveLastPos:
  221|   318M|{
  222|   318M|    PopLastPos( in );
  223|   318M|    in->lastcols[in->curlastpos] = in->curcol;
  224|   318M|}
streamio.c:PopLastPos:
  214|   323M|{
  215|   323M|    in->curlastpos = (in->curlastpos+1)%LASTPOS_SIZE;
  216|   323M|    if ( in->curlastpos == in->firstlastpos )
  ------------------
  |  Branch (216:10): [True: 317M, False: 5.45M]
  ------------------
  217|   317M|        in->firstlastpos = (in->firstlastpos+1)%LASTPOS_SIZE;
  218|   323M|}
streamio.c:PopChar:
  417|  4.89M|{
  418|  4.89M|    uint c = EndOfStream;
  ------------------
  |  | 1064|  4.89M|#define EndOfStream (~0u)
  ------------------
  419|  4.89M|    if ( in->pushed )
  ------------------
  |  Branch (419:10): [True: 4.89M, False: 0]
  ------------------
  420|  4.89M|    {
  421|  4.89M|        assert( in->bufpos > 0 );
  ------------------
  |  Branch (421:9): [True: 0, False: 4.89M]
  |  Branch (421:9): [True: 4.89M, False: 0]
  ------------------
  422|  4.89M|        c = in->charbuf[ --in->bufpos ];
  423|  4.89M|        if ( in->bufpos == 0 )
  ------------------
  |  Branch (423:14): [True: 2.96M, False: 1.92M]
  ------------------
  424|  2.96M|            in->pushed = no;
  425|       |
  426|  4.89M|        if ( c == '\n' )
  ------------------
  |  Branch (426:14): [True: 6.70k, False: 4.88M]
  ------------------
  427|  6.70k|        {
  428|  6.70k|            in->curcol = 1;
  429|  6.70k|            in->curline++;
  430|  6.70k|            PopLastPos( in );
  431|  6.70k|            return c;
  432|  6.70k|        }
  433|  4.88M|        in->curcol++;
  434|  4.88M|        PopLastPos( in );
  435|  4.88M|    }
  436|  4.88M|    return c;
  437|  4.89M|}
streamio.c:RestoreLastPos:
  227|  4.89M|{
  228|  4.89M|    if ( in->firstlastpos == in->curlastpos )
  ------------------
  |  Branch (228:10): [True: 268k, False: 4.62M]
  ------------------
  229|   268k|        in->curcol = 0;
  230|  4.62M|    else
  231|  4.62M|    {
  232|  4.62M|        in->curcol = in->lastcols[in->curlastpos];
  233|  4.62M|        if ( in->curlastpos == 0 )
  ------------------
  |  Branch (233:14): [True: 69.1k, False: 4.55M]
  ------------------
  234|  69.1k|            in->curlastpos = LASTPOS_SIZE;
  235|  4.62M|        in->curlastpos--;
  236|  4.62M|    }
  237|  4.89M|}
streamio.c:initStreamOut:
  467|  40.4k|{
  468|  40.4k|    StreamOut* out = (StreamOut*) TidyDocAlloc( doc, sizeof(StreamOut) );
  ------------------
  |  |  157|  40.4k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  40.4k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  469|  40.4k|    TidyClearMemory( out, sizeof(StreamOut) );
  ------------------
  |  |   70|  40.4k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  470|  40.4k|    out->encoding = encoding;
  471|  40.4k|    out->state = FSM_ASCII;
  472|  40.4k|    out->nl = nl;
  473|  40.4k|    return out;
  474|  40.4k|}
streamio.c:ReadByte:
  897|  74.4M|{
  898|  74.4M|    return tidyGetByte( &in->source );
  899|  74.4M|}
streamio.c:UngetByte:
  905|  60.0k|{
  906|  60.0k|    tidyUngetByte( &in->source, byteValue );
  907|  60.0k|}
streamio.c:PutByte:
  909|  57.8k|{
  910|  57.8k|    tidyPutByte( &out->sink, byteValue );
  911|  57.8k|}
streamio.c:ReadCharFromStream:
  915|  75.6M|{
  916|  75.6M|    uint c, n;
  917|       |
  918|  75.6M|    if ( TY_(IsEOF)(in) )
  ------------------
  |  |   23|  75.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  75.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (918:10): [True: 1.74M, False: 73.9M]
  ------------------
  919|  1.74M|        return EndOfStream;
  ------------------
  |  | 1064|  1.74M|#define EndOfStream (~0u)
  ------------------
  920|       |    
  921|  73.9M|    c = ReadByte( in );
  922|       |
  923|  73.9M|    if (c == EndOfStream)
  ------------------
  |  | 1064|  73.9M|#define EndOfStream (~0u)
  ------------------
  |  Branch (923:9): [True: 0, False: 73.9M]
  ------------------
  924|      0|        return c;
  925|       |
  926|  73.9M|#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|  73.9M|    if (in->encoding == ISO2022)
  ------------------
  |  |  138|  73.9M|#define ISO2022     5
  ------------------
  |  Branch (946:9): [True: 0, False: 73.9M]
  ------------------
  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|  73.9M|#endif /* NO_NATIVE_ISO2022_SUPPORT */
  991|       |
  992|  73.9M|    if ( in->encoding == UTF16LE )
  ------------------
  |  |  142|  73.9M|#define UTF16LE     9
  ------------------
  |  Branch (992:10): [True: 406k, False: 73.5M]
  ------------------
  993|   406k|    {
  994|   406k|        uint c1 = ReadByte( in );
  995|   406k|        if ( EndOfStream == c1 )
  ------------------
  |  | 1064|   406k|#define EndOfStream (~0u)
  ------------------
  |  Branch (995:14): [True: 0, False: 406k]
  ------------------
  996|      0|            return EndOfStream;
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
  997|   406k|        n = (c1 << 8) + c;
  998|   406k|        return n;
  999|   406k|    }
 1000|       |
 1001|  73.5M|    if ((in->encoding == UTF16) || (in->encoding == UTF16BE)) /* UTF-16 is big-endian by default */
  ------------------
  |  |  144|  73.5M|#define UTF16       11
  ------------------
                  if ((in->encoding == UTF16) || (in->encoding == UTF16BE)) /* UTF-16 is big-endian by default */
  ------------------
  |  |  143|  73.5M|#define UTF16BE     10
  ------------------
  |  Branch (1001:9): [True: 0, False: 73.5M]
  |  Branch (1001:36): [True: 2.08k, False: 73.5M]
  ------------------
 1002|  2.08k|    {
 1003|  2.08k|        uint c1 = ReadByte( in );
 1004|  2.08k|        if ( EndOfStream == c1 )
  ------------------
  |  | 1064|  2.08k|#define EndOfStream (~0u)
  ------------------
  |  Branch (1004:14): [True: 0, False: 2.08k]
  ------------------
 1005|      0|            return EndOfStream;
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
 1006|  2.08k|        n = (c << 8) + c1;
 1007|  2.08k|        return n;
 1008|  2.08k|    }
 1009|       |
 1010|  73.5M|    if ( in->encoding == UTF8 )
  ------------------
  |  |  137|  73.5M|#define UTF8        4
  ------------------
  |  Branch (1010:10): [True: 73.5M, False: 0]
  ------------------
 1011|  73.5M|    {
 1012|       |        /* deal with UTF-8 encoded char */
 1013|       |
 1014|  73.5M|        int err, count = 0;
 1015|       |        
 1016|       |        /* first byte "c" is passed in separately */
 1017|  73.5M|        err = TY_(DecodeUTF8BytesToChar)( &n, c, NULL, &in->source, &count );
  ------------------
  |  |   23|  73.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1018|  73.5M|        if (!err && (n == (uint)EndOfStream) && (count == 1)) /* EOF */
  ------------------
  |  | 1064|  71.7M|#define EndOfStream (~0u)
  ------------------
  |  Branch (1018:13): [True: 71.7M, False: 1.77M]
  |  Branch (1018:21): [True: 0, False: 71.7M]
  |  Branch (1018:49): [True: 0, False: 0]
  ------------------
 1019|      0|            return EndOfStream;
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
 1020|  73.5M|        else if (err)
  ------------------
  |  Branch (1020:18): [True: 1.77M, False: 71.7M]
  ------------------
 1021|  1.77M|        {
 1022|       |            /* set error position just before offending character */
 1023|  1.77M|            in->doc->lexer->lines = in->curline;
 1024|  1.77M|            in->doc->lexer->columns = in->curcol;
 1025|       |
 1026|  1.77M|            TY_(ReportEncodingError)(in->doc, INVALID_UTF8, n, no);
  ------------------
  |  |   23|  1.77M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.77M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1027|  1.77M|            n = 0xFFFD; /* replacement char */
 1028|  1.77M|        }
 1029|       |        
 1030|  73.5M|        return n;
 1031|  73.5M|    }
 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|  1.02M|{
  565|  1.02M|    const Dict *np = NULL;
  566|       |
  567|  1.02M|    if ( cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  1.02M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.02M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 1.02M]
  |  |  ------------------
  ------------------
  568|      0|    {
  569|      0|        node->tag = doc->tags.xml_tags;
  570|      0|        return yes;
  571|      0|    }
  572|       |
  573|  1.02M|    if ( node->element && (np = tagsLookup(doc, &doc->tags, node->element)) )
  ------------------
  |  Branch (573:10): [True: 1.02M, False: 0]
  |  Branch (573:27): [True: 849k, False: 170k]
  ------------------
  574|   849k|    {
  575|   849k|        node->tag = np;
  576|   849k|        return yes;
  577|   849k|    }
  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|   170k|    if ( TY_(nodeIsAutonomousCustomTag)( doc, node) )
  ------------------
  |  |   23|   170k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   170k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (581:10): [True: 0, False: 170k]
  ------------------
  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|   170k|    return no;
  596|   170k|}
prvTidyLookupTagDef:
  599|   557k|{
  600|   557k|    const Dict *np;
  601|       |
  602|  22.9M|    for (np = tag_defs + 1; np < tag_defs + N_TIDY_TAGS; ++np )
  ------------------
  |  Branch (602:29): [True: 22.9M, False: 0]
  ------------------
  603|  22.9M|        if (np->id == tid)
  ------------------
  |  Branch (603:13): [True: 557k, False: 22.3M]
  ------------------
  604|   557k|            return np;
  605|       |
  606|      0|    return NULL;
  607|   557k|}
prvTidyInitTags:
  697|  20.2k|{
  698|  20.2k|    Dict* xml;
  699|  20.2k|    TidyTagImpl* tags = &doc->tags;
  700|       |
  701|  20.2k|    TidyClearMemory( tags, sizeof(TidyTagImpl) );
  ------------------
  |  |   70|  20.2k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  702|       |
  703|       |    /* create dummy entry for all xml tags */
  704|  20.2k|    xml =  NewDict( doc, NULL );
  705|  20.2k|    xml->versions = VERS_XML;
  ------------------
  |  |  197|  20.2k|#define VERS_XML           65536u
  ------------------
  706|  20.2k|    xml->model = CM_BLOCK;
  ------------------
  |  |  142|  20.2k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  707|  20.2k|    xml->parser = 0;
  708|  20.2k|    xml->chkattrs = 0;
  709|       |    xml->attrvers = NULL;
  710|  20.2k|    tags->xml_tags = xml;
  711|  20.2k|}
prvTidyFreeDeclaredTags:
  717|  60.6k|{
  718|  60.6k|    TidyTagImpl* tags = &doc->tags;
  719|  60.6k|    Dict *curr, *next = NULL, *prev = NULL;
  720|       |
  721|  60.6k|    for ( curr=tags->declared_tag_list; curr; curr = next )
  ------------------
  |  Branch (721:41): [True: 0, False: 60.6k]
  ------------------
  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|  60.6k|}
prvTidyAdjustTags:
  773|  16.0k|{
  774|  16.0k|    Dict *np = (Dict *)TY_(LookupTagDef)( TidyTag_A );
  ------------------
  |  |   23|  16.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  775|  16.0k|    TidyTagImpl* tags = &doc->tags;
  776|  16.0k|    if (np) 
  ------------------
  |  Branch (776:9): [True: 16.0k, False: 0]
  ------------------
  777|  16.0k|    {
  778|  16.0k|        np->parser = TY_(ParseInline);
  ------------------
  |  |   23|  16.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  779|  16.0k|        np->model  = CM_INLINE;
  ------------------
  |  |  143|  16.0k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  780|  16.0k|    }
  781|       |
  782|       |/*\
  783|       | * Issue #196
  784|       | * TidyTag_CAPTION allows %flow; in HTML5,
  785|       | * but only %inline; in HTML4
  786|       |\*/
  787|  16.0k|    np = (Dict *)TY_(LookupTagDef)( TidyTag_CAPTION );
  ------------------
  |  |   23|  16.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  788|  16.0k|    if (np)
  ------------------
  |  Branch (788:9): [True: 16.0k, False: 0]
  ------------------
  789|  16.0k|    {
  790|  16.0k|        np->parser = TY_(ParseInline);
  ------------------
  |  |   23|  16.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  791|  16.0k|    }
  792|       |
  793|       |/*\
  794|       | * Issue #232
  795|       | * TidyTag_OBJECT not in head in HTML5,
  796|       | * but still allowed in HTML4
  797|       |\*/
  798|  16.0k|    np = (Dict *)TY_(LookupTagDef)( TidyTag_OBJECT );
  ------------------
  |  |   23|  16.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  799|  16.0k|    if (np)
  ------------------
  |  Branch (799:9): [True: 16.0k, False: 0]
  ------------------
  800|  16.0k|    {
  801|  16.0k|        np->model |= CM_HEAD; /* add back allowed in head */
  ------------------
  |  |  141|  16.0k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  802|  16.0k|    }
  803|       |
  804|       |/*\
  805|       | * Issue #461
  806|       | * TidyTag_BUTTON is a block in HTML4,
  807|       | * whereas it is inline in HTML5
  808|       |\*/
  809|  16.0k|    np = (Dict *)TY_(LookupTagDef)(TidyTag_BUTTON);
  ------------------
  |  |   23|  16.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  810|  16.0k|    if (np)
  ------------------
  |  Branch (810:9): [True: 16.0k, False: 0]
  ------------------
  811|  16.0k|    {
  812|  16.0k|        np->parser = TY_(ParseBlock);
  ------------------
  |  |   23|  16.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  813|  16.0k|    }
  814|       |
  815|  16.0k|    tagsEmptyHash(doc, tags); /* not sure this is really required, but to be sure */
  816|  16.0k|    doc->HTML5Mode = no;   /* set *NOT* HTML5 mode */
  817|       |
  818|  16.0k|}
prvTidyIsHTML5Mode:
  821|   142k|{
  822|   142k|    return doc->HTML5Mode;
  823|   142k|}
prvTidyResetTags:
  833|  20.2k|{
  834|  20.2k|    Dict *np = (Dict *)TY_(LookupTagDef)( TidyTag_A );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  835|  20.2k|    TidyTagImpl* tags = &doc->tags;
  836|  20.2k|    if (np) 
  ------------------
  |  Branch (836:9): [True: 20.2k, False: 0]
  ------------------
  837|  20.2k|    {
  838|  20.2k|        np->parser = TY_(ParseBlock);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  839|  20.2k|        np->model  = (CM_INLINE|CM_BLOCK|CM_MIXED);
  ------------------
  |  |  143|  20.2k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                      np->model  = (CM_INLINE|CM_BLOCK|CM_MIXED);
  ------------------
  |  |  142|  20.2k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                      np->model  = (CM_INLINE|CM_BLOCK|CM_MIXED);
  ------------------
  |  |  156|  20.2k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  840|  20.2k|    }
  841|  20.2k|    np = (Dict *)TY_(LookupTagDef)( TidyTag_CAPTION );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  842|  20.2k|    if (np)
  ------------------
  |  Branch (842:9): [True: 20.2k, False: 0]
  ------------------
  843|  20.2k|    {
  844|  20.2k|        np->parser = TY_(ParseBlock);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  845|  20.2k|    }
  846|       |
  847|  20.2k|    np = (Dict *)TY_(LookupTagDef)( TidyTag_OBJECT );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  848|  20.2k|    if (np)
  ------------------
  |  Branch (848:9): [True: 20.2k, False: 0]
  ------------------
  849|  20.2k|    {
  850|  20.2k|        np->model = (CM_OBJECT|CM_IMG|CM_INLINE|CM_PARAM); /* reset */
  ------------------
  |  |  150|  20.2k|#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|  20.2k|#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|  20.2k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                      np->model = (CM_OBJECT|CM_IMG|CM_INLINE|CM_PARAM); /* reset */
  ------------------
  |  |  151|  20.2k|#define CM_PARAM        (1 << 12)  /**< Elements that allows "PARAM". */
  ------------------
  851|  20.2k|    }
  852|       |    /*\
  853|       |     * Issue #461
  854|       |     * TidyTag_BUTTON reset to inline in HTML5
  855|       |    \*/
  856|  20.2k|    np = (Dict *)TY_(LookupTagDef)(TidyTag_BUTTON);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  857|  20.2k|    if (np)
  ------------------
  |  Branch (857:9): [True: 20.2k, False: 0]
  ------------------
  858|  20.2k|    {
  859|  20.2k|        np->parser = TY_(ParseInline);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  860|  20.2k|    }
  861|       |
  862|  20.2k|    tagsEmptyHash( doc, tags ); /* not sure this is really required, but to be sure */
  863|  20.2k|    doc->HTML5Mode = yes;   /* set HTML5 mode */
  864|  20.2k|}
prvTidyFreeTags:
  867|  20.2k|{
  868|  20.2k|    TidyTagImpl* tags = &doc->tags;
  869|       |
  870|  20.2k|    tagsEmptyHash( doc, tags );
  871|  20.2k|    TY_(FreeDeclaredTags)( doc, tagtype_null );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  872|  20.2k|    FreeDict( doc, tags->xml_tags );
  873|       |
  874|       |    /* get rid of dangling tag references */
  875|  20.2k|    TidyClearMemory( tags, sizeof(TidyTagImpl) );
  ------------------
  |  |   70|  20.2k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  876|       |
  877|  20.2k|}
prvTidyCheckAttributes:
  882|  2.80M|{
  883|  2.80M|    AttVal *next, *attval = node->attributes;
  884|  3.13M|    while (attval)
  ------------------
  |  Branch (884:12): [True: 327k, False: 2.80M]
  ------------------
  885|   327k|    {
  886|   327k|        next = attval->next;
  887|   327k|        TY_(CheckAttribute)( doc, node, attval );
  ------------------
  |  |   23|   327k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   327k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  888|   327k|        attval = next;
  889|   327k|    }
  890|  2.80M|}
prvTidynodeIsText:
 1031|  21.7M|{
 1032|  21.7M|  return ( node && node->type == TextNode );
  ------------------
  |  Branch (1032:12): [True: 21.4M, False: 341k]
  |  Branch (1032:20): [True: 4.12M, False: 17.3M]
  ------------------
 1033|  21.7M|}
prvTidynodeIsElement:
 1052|  36.1M|{
 1053|  36.1M|  return ( node &&
  ------------------
  |  Branch (1053:12): [True: 36.1M, False: 0]
  ------------------
 1054|  36.1M|           (node->type == StartTag || node->type == StartEndTag) );
  ------------------
  |  Branch (1054:13): [True: 32.3M, False: 3.80M]
  |  Branch (1054:39): [True: 279k, False: 3.52M]
  ------------------
 1055|  36.1M|}
prvTidyelementIsAutonomousCustomFormat:
 1058|   228k|{
 1059|   228k|    if ( element )
  ------------------
  |  Branch (1059:10): [True: 228k, False: 0]
  ------------------
 1060|   228k|    {
 1061|   228k|        const char *ptr = strchr(element, '-');
 1062|       |
 1063|       |        /* Tag must contain hyphen not in first character. */
 1064|   228k|        if ( ptr && (ptr - element > 0) )
  ------------------
  |  Branch (1064:14): [True: 112k, False: 116k]
  |  Branch (1064:21): [True: 111k, False: 373]
  ------------------
 1065|   111k|        {
 1066|   111k|            return yes;
 1067|   111k|        }
 1068|   228k|    }
 1069|       |
 1070|   116k|    return no;
 1071|   228k|}
prvTidynodeIsAutonomousCustomFormat:
 1074|   171k|{
 1075|   171k|    if ( node->element )
  ------------------
  |  Branch (1075:10): [True: 171k, False: 0]
  ------------------
 1076|   171k|        return TY_(elementIsAutonomousCustomFormat)( node->element );
  ------------------
  |  |   23|   171k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   171k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1077|       |
 1078|      0|    return no;
 1079|   171k|}
prvTidynodeIsAutonomousCustomTag:
 1082|   170k|{
 1083|   170k|    return TY_(nodeIsAutonomousCustomFormat)( node )
  ------------------
  |  |   23|   170k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   170k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1083:12): [True: 56.2k, False: 114k]
  ------------------
 1084|  56.2k|            && ( cfg( doc, TidyUseCustomTags ) != TidyCustomNo );
  ------------------
  |  |  415|  56.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1084:16): [True: 0, False: 56.2k]
  ------------------
 1085|   170k|}
prvTidynodeHasCM:
 1092|  1.82G|{
 1093|  1.82G|  return ( node && node->tag &&
  ------------------
  |  Branch (1093:12): [True: 1.82G, False: 0]
  |  Branch (1093:20): [True: 1.82G, False: 325k]
  ------------------
 1094|  1.82G|           (node->tag->model & contentModel) != 0 );
  ------------------
  |  Branch (1094:12): [True: 1.81G, False: 17.5M]
  ------------------
 1095|  1.82G|}
prvTidynodeCMIsInline:
 1102|  1.80G|{
 1103|  1.80G|  return TY_(nodeHasCM)( node, CM_INLINE );
  ------------------
  |  |   23|  1.80G|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.80G|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                return TY_(nodeHasCM)( node, CM_INLINE );
  ------------------
  |  |  143|  1.80G|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
 1104|  1.80G|}
prvTidynodeCMIsEmpty:
 1106|  9.64M|{
 1107|  9.64M|  return TY_(nodeHasCM)( node, CM_EMPTY );
  ------------------
  |  |   23|  9.64M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.64M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                return TY_(nodeHasCM)( node, CM_EMPTY );
  ------------------
  |  |  139|  9.64M|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
 1108|  9.64M|}
prvTidyTraverseNodeTree:
 1149|  5.10k|{
 1150|  37.1k|    while (node)
  ------------------
  |  Branch (1150:12): [True: 35.2k, False: 1.89k]
  ------------------
 1151|  35.2k|    {
 1152|  35.2k|        NodeTraversalSignal s = (*cb)(doc, node, propagate);
 1153|       |
 1154|  35.2k|        if (node->content && (s == ContinueTraversal || s == SkipSiblings))
  ------------------
  |  Branch (1154:13): [True: 32.6k, False: 2.59k]
  |  Branch (1154:31): [True: 0, False: 32.6k]
  |  Branch (1154:57): [True: 0, False: 32.6k]
  ------------------
 1155|      0|        {
 1156|      0|            s = TY_(TraverseNodeTree)(doc, node->content, cb, propagate);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1157|      0|        }
 1158|       |
 1159|  35.2k|        switch (s)
 1160|  35.2k|        {
 1161|  3.21k|        case ExitTraversal:
  ------------------
  |  Branch (1161:9): [True: 3.21k, False: 31.9k]
  ------------------
 1162|  3.21k|            return ExitTraversal;
 1163|       |
 1164|  31.9k|        case VisitParent:
  ------------------
  |  Branch (1164:9): [True: 31.9k, False: 3.21k]
  ------------------
 1165|  31.9k|            node = node->parent;
 1166|  31.9k|            continue;
 1167|       |
 1168|      0|        case SkipSiblings:
  ------------------
  |  Branch (1168:9): [True: 0, False: 35.2k]
  ------------------
 1169|      0|        case SkipChildrenAndSiblings:
  ------------------
  |  Branch (1169:9): [True: 0, False: 35.2k]
  ------------------
 1170|      0|            return ContinueTraversal;
 1171|       |
 1172|      0|        default:
  ------------------
  |  Branch (1172:9): [True: 0, False: 35.2k]
  ------------------
 1173|      0|            node = node->next;
 1174|      0|            break;
 1175|  35.2k|        }
 1176|  35.2k|    }
 1177|  1.89k|    return ContinueTraversal;
 1178|  5.10k|}
tags.c:tagsLookup:
  408|  1.02M|{
  409|  1.02M|    const Dict *np;
  410|  1.02M|    const DictHash* p;
  411|       |
  412|  1.02M|    if (!s)
  ------------------
  |  Branch (412:9): [True: 0, False: 1.02M]
  ------------------
  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|  1.02M|    for (p = tags->hashtab[tagsHash(s)]; p && p->tag; p = p->next)
  ------------------
  |  Branch (420:42): [True: 821k, False: 202k]
  |  Branch (420:47): [True: 821k, False: 0]
  ------------------
  421|   821k|        if (TY_(tmbstrcmp)(s, p->tag->name) == 0)
  ------------------
  |  |   23|   821k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   821k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (421:13): [True: 817k, False: 3.62k]
  ------------------
  422|   817k|            return p->tag;
  423|       |
  424|  27.8M|    for (np = tag_defs + 1; np < tag_defs + N_TIDY_TAGS; ++np)
  ------------------
  |  Branch (424:29): [True: 27.7M, False: 170k]
  ------------------
  425|  27.7M|        if (TY_(tmbstrcmp)(s, np->name) == 0)
  ------------------
  |  |   23|  27.7M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.7M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (425:13): [True: 32.1k, False: 27.6M]
  ------------------
  426|  32.1k|            return tagsInstall(doc, tags, np);
  427|       |
  428|   170k|    for (np = tags->declared_tag_list; np; np = np->next)
  ------------------
  |  Branch (428:40): [True: 0, False: 170k]
  ------------------
  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|   170k|    return NULL;
  433|   170k|}
tags.c:tagsHash:
  339|  1.05M|{
  340|  1.05M|    uint hashval;
  341|       |
  342|  8.43M|    for (hashval = 0; *s != '\0'; s++)
  ------------------
  |  Branch (342:23): [True: 7.37M, False: 1.05M]
  ------------------
  343|  7.37M|        hashval = *s + 31*hashval;
  344|       |
  345|  1.05M|    return hashval % ELEMENT_HASH_SIZE;
  346|  1.05M|}
tags.c:tagsInstall:
  349|  32.1k|{
  350|  32.1k|    DictHash *np;
  351|  32.1k|    uint hashval;
  352|       |
  353|  32.1k|    if (old)
  ------------------
  |  Branch (353:9): [True: 32.1k, False: 0]
  ------------------
  354|  32.1k|    {
  355|  32.1k|        np = (DictHash *)TidyDocAlloc(doc, sizeof(*np));
  ------------------
  |  |  157|  32.1k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  32.1k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  356|  32.1k|        np->tag = old;
  357|       |
  358|  32.1k|        hashval = tagsHash(old->name);
  359|  32.1k|        np->next = tags->hashtab[hashval];
  360|  32.1k|        tags->hashtab[hashval] = np;
  361|  32.1k|    }
  362|       |
  363|  32.1k|    return old;
  364|  32.1k|}
tags.c:CheckAREA:
  957|  1.38k|{
  958|  1.38k|    Bool HasAlt = TY_(AttrGetById)(node, TidyAttr_ALT) != NULL;
  ------------------
  |  |   23|  1.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  959|  1.38k|    Bool HasHref = TY_(AttrGetById)(node, TidyAttr_HREF) != NULL;
  ------------------
  |  |   23|  1.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  960|  1.38k|    Bool HasNohref = TY_(AttrGetById)(node, TidyAttr_NOHREF) != NULL;
  ------------------
  |  |   23|  1.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  961|       |
  962|  1.38k|    TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  1.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  963|       |
  964|  1.38k|    if ( !HasAlt )
  ------------------
  |  Branch (964:10): [True: 1.19k, False: 197]
  ------------------
  965|  1.19k|    {
  966|  1.19k|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  1.19k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (966:14): [True: 1.19k, False: 0]
  ------------------
  967|  1.19k|        {
  968|  1.19k|            doc->badAccess |= BA_MISSING_LINK_ALT;
  ------------------
  |  |  281|  1.19k|#define BA_MISSING_LINK_ALT        2
  ------------------
  969|  1.19k|            TY_(ReportMissingAttr)( doc, node, "alt" );
  ------------------
  |  |   23|  1.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  970|  1.19k|        }
  971|  1.19k|    }
  972|       |
  973|  1.38k|    if ( !HasHref && !HasNohref )
  ------------------
  |  Branch (973:10): [True: 1.18k, False: 208]
  |  Branch (973:22): [True: 1.11k, False: 67]
  ------------------
  974|  1.11k|        TY_(ReportMissingAttr)( doc, node, "href" );
  ------------------
  |  |   23|  1.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  975|  1.38k|}
tags.c:CheckCaption:
  933|  11.5k|{
  934|  11.5k|    AttVal *attval;
  935|       |
  936|  11.5k|    TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  11.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  937|       |
  938|  11.5k|    attval = TY_(AttrGetById)(node, TidyAttr_ALIGN);
  ------------------
  |  |   23|  11.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  939|       |
  940|  11.5k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  11.5k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 9.91k, False: 1.59k]
  |  |  |  Branch (171:44): [True: 9.71k, False: 197]
  |  |  ------------------
  ------------------
  941|  1.79k|        return;
  942|       |
  943|  9.71k|    if (AttrValueIs(attval, "left") || AttrValueIs(attval, "right"))
  ------------------
  |  |  172|  19.4k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  19.4k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 9.71k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 9.71k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  19.4k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  9.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  9.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 197, False: 9.52k]
  |  |  ------------------
  ------------------
                  if (AttrValueIs(attval, "left") || AttrValueIs(attval, "right"))
  ------------------
  |  |  172|  9.52k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  19.0k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 9.52k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 9.52k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  9.52k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  9.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  9.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 5.76k, False: 3.75k]
  |  |  ------------------
  ------------------
  944|  5.96k|        TY_(ConstrainVersion)(doc, VERS_HTML40_LOOSE);
  ------------------
  |  |   23|  5.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(ConstrainVersion)(doc, VERS_HTML40_LOOSE);
  ------------------
  |  |  208|  5.96k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  ------------------
  |  |  |  |  180|  5.96k|#define H40T                   8u
  |  |  ------------------
  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  ------------------
  |  |  |  |  183|  5.96k|#define H41T                  64u
  |  |  ------------------
  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  ------------------
  |  |  |  |  186|  5.96k|#define X10T                 512u
  |  |  ------------------
  ------------------
  945|  3.75k|    else if (AttrValueIs(attval, "top") || AttrValueIs(attval, "bottom"))
  ------------------
  |  |  172|  7.50k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  7.50k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 3.75k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 3.75k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  7.50k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  3.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  3.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 246, False: 3.50k]
  |  |  ------------------
  ------------------
                  else if (AttrValueIs(attval, "top") || AttrValueIs(attval, "bottom"))
  ------------------
  |  |  172|  3.50k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  7.01k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 3.50k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 3.50k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  3.50k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  3.50k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  3.50k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 253, False: 3.25k]
  |  |  ------------------
  ------------------
  946|    499|        TY_(ConstrainVersion)(doc, ~(VERS_HTML20|VERS_HTML32));
  ------------------
  |  |   23|    499|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    499|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(ConstrainVersion)(doc, ~(VERS_HTML20|VERS_HTML32));
  ------------------
  |  |  205|    499|#define VERS_HTML20        (HT20)
  |  |  ------------------
  |  |  |  |  177|    499|#define HT20                   1u
  |  |  ------------------
  ------------------
                      TY_(ConstrainVersion)(doc, ~(VERS_HTML20|VERS_HTML32));
  ------------------
  |  |  206|    499|#define VERS_HTML32        (HT32)
  |  |  ------------------
  |  |  |  |  178|    499|#define HT32                   2u
  |  |  ------------------
  ------------------
  947|  3.25k|    else
  948|  3.25k|        TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  3.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  949|  9.71k|}
tags.c:CheckHTML:
  952|  46.0k|{
  953|  46.0k|    TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  46.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  954|  46.0k|}
tags.c:CheckIMG:
  895|  2.61k|{
  896|  2.61k|    Bool HasAlt = TY_(AttrGetById)(node, TidyAttr_ALT) != NULL;
  ------------------
  |  |   23|  2.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  897|  2.61k|    Bool HasSrc = TY_(AttrGetById)(node, TidyAttr_SRC) != NULL;
  ------------------
  |  |   23|  2.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  898|  2.61k|    Bool HasUseMap = TY_(AttrGetById)(node, TidyAttr_USEMAP) != NULL;
  ------------------
  |  |   23|  2.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  899|  2.61k|    Bool HasIsMap = TY_(AttrGetById)(node, TidyAttr_ISMAP) != NULL;
  ------------------
  |  |   23|  2.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  900|  2.61k|    Bool HasDataFld = TY_(AttrGetById)(node, TidyAttr_DATAFLD) != NULL;
  ------------------
  |  |   23|  2.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  901|       |
  902|  2.61k|    TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  2.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  903|       |
  904|  2.61k|    if ( !HasAlt )
  ------------------
  |  Branch (904:10): [True: 2.39k, False: 225]
  ------------------
  905|  2.39k|    {
  906|  2.39k|        ctmbstr alttext = cfgStr(doc, TidyAltText);
  ------------------
  |  |  424|  2.39k|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  ------------------
  907|  2.39k|        if ( ( cfg(doc, TidyAccessibilityCheckLevel) == 0 ) && ( !alttext ) )
  ------------------
  |  |  415|  2.39k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (907:14): [True: 2.39k, False: 0]
  |  Branch (907:64): [True: 2.39k, False: 0]
  ------------------
  908|  2.39k|        {
  909|  2.39k|            doc->badAccess |= BA_MISSING_IMAGE_ALT;
  ------------------
  |  |  280|  2.39k|#define BA_MISSING_IMAGE_ALT       1
  ------------------
  910|  2.39k|            TY_(ReportMissingAttr)( doc, node, "alt" );
  ------------------
  |  |   23|  2.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  911|  2.39k|        }
  912|       |
  913|  2.39k|        if ( alttext ) {
  ------------------
  |  Branch (913:14): [True: 0, False: 2.39k]
  ------------------
  914|      0|            AttVal *attval = TY_(AddAttribute)( doc, node, "alt", alttext );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  915|      0|            TY_(ReportAttrError)( doc, node, attval, INSERTING_AUTO_ATTRIBUTE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  916|      0|        }
  917|  2.39k|    }
  918|       |
  919|  2.61k|    if ( !HasSrc && !HasDataFld )
  ------------------
  |  Branch (919:10): [True: 2.41k, False: 200]
  |  Branch (919:21): [True: 2.41k, False: 0]
  ------------------
  920|  2.41k|        TY_(ReportMissingAttr)( doc, node, "src" );
  ------------------
  |  |   23|  2.41k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.41k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  921|       |
  922|  2.61k|    if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  2.61k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (922:10): [True: 2.61k, False: 0]
  ------------------
  923|  2.61k|    {
  924|  2.61k|        if ( HasIsMap && !HasUseMap )
  ------------------
  |  Branch (924:14): [True: 401, False: 2.21k]
  |  Branch (924:26): [True: 201, False: 200]
  ------------------
  925|    201|        {
  926|    201|            TY_(ReportAttrError)( doc, node, NULL, MISSING_IMAGEMAP);
  ------------------
  |  |   23|    201|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    201|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  927|    201|            doc->badAccess |= BA_MISSING_IMAGE_MAP;
  ------------------
  |  |  283|    201|#define BA_MISSING_IMAGE_MAP       8
  ------------------
  928|    201|        }
  929|  2.61k|    }
  930|  2.61k|}
tags.c:CheckLINK:
 1014|    789|{
 1015|    789|    Bool HasHref = TY_(AttrGetById)(node, TidyAttr_HREF) != NULL;
  ------------------
  |  |   23|    789|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    789|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1016|    789|    Bool HasRel = TY_(AttrGetById)(node, TidyAttr_REL) != NULL;
  ------------------
  |  |   23|    789|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    789|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1017|    789|    Bool HasItemprop = TY_(AttrGetById)(node, TidyAttr_ITEMPROP) != NULL;
  ------------------
  |  |   23|    789|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    789|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1018|       |
 1019|    789|    if (!HasHref)
  ------------------
  |  Branch (1019:9): [True: 588, False: 201]
  ------------------
 1020|    588|    {
 1021|    588|      TY_(ReportMissingAttr)( doc, node, "href" );
  ------------------
  |  |   23|    588|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    588|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1022|    588|    }
 1023|       |
 1024|    789|    if (!HasItemprop && !HasRel)
  ------------------
  |  Branch (1024:9): [True: 578, False: 211]
  |  Branch (1024:25): [True: 480, False: 98]
  ------------------
 1025|    480|    {
 1026|    480|      TY_(ReportMissingAttr)( doc, node, "rel" );
  ------------------
  |  |   23|    480|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    480|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1027|    480|    }
 1028|    789|}
tags.c:CheckTABLE:
  978|  22.2k|{
  979|  22.2k|    AttVal* attval;
  980|  22.2k|    Bool HasSummary = (TY_(AttrGetById)(node, TidyAttr_SUMMARY) != NULL) ? yes : no;
  ------------------
  |  |   23|  22.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (980:23): [True: 388, False: 21.8k]
  ------------------
  981|  22.2k|    uint vers = TY_(HTMLVersion)(doc);  /* Issue #377 - Also applies to XHTML5 */
  ------------------
  |  |   23|  22.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  982|  22.2k|    Bool isHTML5 = ((vers == HT50)||(vers == XH50)) ? yes : no;
  ------------------
  |  |  200|  22.2k|#define HT50              131072u
  ------------------
                  Bool isHTML5 = ((vers == HT50)||(vers == XH50)) ? yes : no;
  ------------------
  |  |  201|  22.2k|#define XH50              262144u
  ------------------
  |  Branch (982:21): [True: 0, False: 22.2k]
  |  Branch (982:37): [True: 21.8k, False: 434]
  ------------------
  983|       |
  984|  22.2k|    TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  22.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  985|       |
  986|       |    /* Issue #210 - a missing summary attribute is bad accessibility, no matter
  987|       |       what HTML version is involved; a document without is valid 
  988|       |       EXCEPT for HTML5, when to have a summary is wrong */
  989|  22.2k|    if (cfg(doc, TidyAccessibilityCheckLevel) == 0)
  ------------------
  |  |  415|  22.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (989:9): [True: 22.2k, False: 0]
  ------------------
  990|  22.2k|    {
  991|  22.2k|        if (HasSummary && isHTML5)
  ------------------
  |  Branch (991:13): [True: 388, False: 21.8k]
  |  Branch (991:27): [True: 194, False: 194]
  ------------------
  992|    194|        {
  993|       |            /* #210 - has summary, and is HTML5, then report obsolete */
  994|    194|            TY_(Report)(doc, node, node, BAD_SUMMARY_HTML5);
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  995|    194|        } 
  996|  22.0k|        else if (!HasSummary && !isHTML5) 
  ------------------
  |  Branch (996:18): [True: 21.8k, False: 194]
  |  Branch (996:33): [True: 240, False: 21.6k]
  ------------------
  997|    240|        {
  998|       |            /* #210 - No summary, and NOT HTML5, then report as before */
  999|    240|            doc->badAccess |= BA_MISSING_SUMMARY;
  ------------------
  |  |  282|    240|#define BA_MISSING_SUMMARY         4
  ------------------
 1000|    240|            TY_(ReportMissingAttr)( doc, node, "summary");
  ------------------
  |  |   23|    240|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    240|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1001|    240|        }
 1002|  22.2k|    }
 1003|       |
 1004|       |    /* convert <table border> to <table border="1"> */
 1005|  22.2k|    if ( cfgBool(doc, TidyXmlOut) && (attval = TY_(AttrGetById)(node, TidyAttr_BORDER)) )
  ------------------
  |  |  418|  44.5k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  22.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 22.2k, False: 0]
  |  |  ------------------
  ------------------
                  if ( cfgBool(doc, TidyXmlOut) && (attval = TY_(AttrGetById)(node, TidyAttr_BORDER)) )
  ------------------
  |  |   23|  22.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1005:38): [True: 465, False: 21.8k]
  ------------------
 1006|    465|    {
 1007|    465|        if (attval->value == NULL)
  ------------------
  |  Branch (1007:13): [True: 196, False: 269]
  ------------------
 1008|    196|            attval->value = TY_(tmbstrdup)(doc->allocator, "1");
  ------------------
  |  |   23|    196|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    196|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1009|    465|    }
 1010|  22.2k|}
tags.c:NewDict:
  436|  20.2k|{
  437|  20.2k|    Dict *np = (Dict*) TidyDocAlloc( doc, sizeof(Dict) );
  ------------------
  |  |  157|  20.2k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  20.2k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  438|  20.2k|    np->id = TidyTag_UNKNOWN;
  439|  20.2k|    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: 20.2k]
  ------------------
  440|  20.2k|    np->versions = VERS_UNKNOWN;
  ------------------
  |  |  204|  20.2k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  20.2k|#define xxxx                   0u
  |  |  ------------------
  ------------------
  441|  20.2k|    np->attrvers = NULL;
  442|  20.2k|    np->model = CM_UNKNOWN;
  ------------------
  |  |  138|  20.2k|#define CM_UNKNOWN      0
  ------------------
  443|  20.2k|    np->parser = 0;
  444|  20.2k|    np->chkattrs = 0;
  445|       |    np->next = NULL;
  446|  20.2k|    return np;
  447|  20.2k|}
tags.c:FreeDict:
  450|  20.2k|{
  451|  20.2k|    if ( d )
  ------------------
  |  Branch (451:10): [True: 20.2k, False: 0]
  ------------------
  452|  20.2k|        TidyDocFree( doc, d->name );
  ------------------
  |  |  159|  20.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  453|  20.2k|    TidyDocFree( doc, d );
  ------------------
  |  |  159|  20.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  454|  20.2k|}
tags.c:tagsEmptyHash:
  387|  56.4k|{
  388|  56.4k|    uint i;
  389|  56.4k|    DictHash *prev, *next;
  390|       |
  391|  10.1M|    for (i = 0; i < ELEMENT_HASH_SIZE; ++i)
  ------------------
  |  Branch (391:17): [True: 10.0M, False: 56.4k]
  ------------------
  392|  10.0M|    {
  393|  10.0M|        prev = NULL;
  394|  10.0M|        next = tags->hashtab[i];
  395|       |
  396|  10.0M|        while(next)
  ------------------
  |  Branch (396:15): [True: 32.1k, False: 10.0M]
  ------------------
  397|  32.1k|        {
  398|  32.1k|            prev = next->next;
  399|  32.1k|            TidyDocFree(doc, next);
  ------------------
  |  |  159|  32.1k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  32.1k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  400|  32.1k|            next = prev;
  401|  32.1k|        }
  402|       |
  403|       |        tags->hashtab[i] = NULL;
  404|  10.0M|    }
  405|  56.4k|}

tidyCreate:
   87|  20.2k|{
   88|  20.2k|  TidyDocImpl* impl = tidyDocCreate( &TY_(g_default_allocator) );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   89|  20.2k|  return tidyImplToDoc( impl );
  ------------------
  |  |  141|  20.2k|#define tidyImplToDoc( doc )            ((TidyDoc)(doc))
  ------------------
   90|  20.2k|}
tidyRelease:
   99|  20.2k|{
  100|  20.2k|  TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.2k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  101|  20.2k|  tidyDocRelease( impl );
  102|  20.2k|}
tidyLibraryVersion:
  204|  20.2k|{
  205|  20.2k|    return TY_(tidyLibraryVersion)();
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  206|  20.2k|}
tidyOptSetBool:
  530|  40.4k|{
  531|  40.4k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  40.4k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  532|  40.4k|    if ( impl )
  ------------------
  |  Branch (532:10): [True: 40.4k, False: 0]
  ------------------
  533|  40.4k|        return TY_(SetOptionBool)( impl, optId, val );
  ------------------
  |  |   23|  40.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  534|      0|    return no;
  535|  40.4k|}
tidySetErrorBuffer:
  974|  20.2k|{
  975|  20.2k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.2k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  976|  20.2k|    if ( impl )
  ------------------
  |  Branch (976:10): [True: 20.2k, False: 0]
  ------------------
  977|  20.2k|    {
  978|  20.2k|        uint outenc = cfg( impl, TidyOutCharEncoding );
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  979|  20.2k|        uint nl = cfg( impl, TidyNewline );
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  980|  20.2k|        TY_(ReleaseStreamOut)( impl, impl->errout );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  981|  20.2k|        impl->errout = TY_(BufferOutput)( impl, errbuf, outenc, nl );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  982|  20.2k|        return ( impl->errout ? 0 : -ENOMEM );
  ------------------
  |  Branch (982:18): [True: 20.2k, False: 0]
  ------------------
  983|  20.2k|    }
  984|      0|    return -EINVAL;
  985|  20.2k|}
tidyParseFile:
 1105|  20.2k|{
 1106|  20.2k|    TidyDocImpl* doc = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.2k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1107|  20.2k|    return tidyDocParseFile( doc, filnam );
 1108|  20.2k|}
tidySaveBuffer:
 1255|  20.2k|{
 1256|  20.2k|    TidyDocImpl* doc = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.2k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1257|  20.2k|    return tidyDocSaveBuffer( doc, outbuf );
 1258|  20.2k|}
tidyCleanAndRepair:
 1419|  20.2k|{
 1420|  20.2k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.2k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1421|  20.2k|    if ( impl )
  ------------------
  |  Branch (1421:10): [True: 20.2k, False: 0]
  ------------------
 1422|  20.2k|      return tidyDocCleanAndRepair( impl );
 1423|      0|    return -EINVAL;
 1424|  20.2k|}
tidyRunDiagnostics:
 1427|  20.2k|{
 1428|  20.2k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.2k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1429|  20.2k|    if ( impl )
  ------------------
  |  Branch (1429:10): [True: 20.2k, False: 0]
  ------------------
 1430|  20.2k|      return tidyDocRunDiagnostics( impl );
 1431|      0|    return -EINVAL;
 1432|  20.2k|}
prvTidyDocParseStream:
 1456|  20.2k|{
 1457|  20.2k|    Bool xmlIn = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1458|  20.2k|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 1459|       |    
 1460|  20.2k|    int bomEnc;
 1461|  20.2k|    doc->pConfigChangeCallback = NULL;
 1462|       |
 1463|  20.2k|    assert( doc != NULL && in != NULL );
  ------------------
  |  Branch (1463:5): [True: 0, False: 20.2k]
  |  Branch (1463:5): [True: 0, False: 0]
  |  Branch (1463:5): [True: 20.2k, False: 0]
  |  Branch (1463:5): [True: 20.2k, False: 0]
  ------------------
 1464|  20.2k|    assert( doc->docIn == NULL );
  ------------------
  |  Branch (1464:5): [True: 0, False: 20.2k]
  |  Branch (1464:5): [True: 20.2k, False: 0]
  ------------------
 1465|  20.2k|    doc->docIn = in;
 1466|       |
 1467|  20.2k|    TY_(ResetTags)(doc);             /* Reset table to html5 mode */
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1468|  20.2k|    TY_(TakeConfigSnapshot)( doc );  /* Save config state */
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1469|  20.2k|    TY_(AdjustConfig)( doc );        /* Ensure config internal consistency */
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1470|  20.2k|    TY_(FreeAnchors)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1471|       |
 1472|  20.2k|    TY_(FreeNode)(doc, &doc->root);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1473|  20.2k|    TidyClearMemory(&doc->root, sizeof(Node));
  ------------------
  |  |   70|  20.2k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1474|       |
 1475|  20.2k|    if (doc->givenDoctype)
  ------------------
  |  Branch (1475:9): [True: 0, False: 20.2k]
  ------------------
 1476|  20.2k|        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|  20.2k|    TY_(FreeLexer)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1482|  20.2k|    doc->givenDoctype = NULL;
 1483|       |
 1484|  20.2k|    doc->lexer = TY_(NewLexer)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1485|       |    /* doc->lexer->root = &doc->root; */
 1486|  20.2k|    doc->root.line = doc->lexer->lines;
 1487|  20.2k|    doc->root.column = doc->lexer->columns;
 1488|  20.2k|    doc->inputHadBOM = no;
 1489|  20.2k|    doc->xmlDetected = no;
 1490|       |
 1491|  20.2k|    bomEnc = TY_(ReadBOMEncoding)(in);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1492|       |
 1493|  20.2k|    if (bomEnc != -1)
  ------------------
  |  Branch (1493:9): [True: 181, False: 20.0k]
  ------------------
 1494|    181|    {
 1495|    181|        in->encoding = bomEnc;
 1496|    181|        TY_(SetOptionInt)(doc, TidyInCharEncoding, bomEnc);
  ------------------
  |  |   23|    181|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    181|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1497|    181|    }
 1498|       |
 1499|       |    /* Tidy doesn't alter the doctype for generic XML docs */
 1500|  20.2k|    if ( xmlIn )
  ------------------
  |  Branch (1500:10): [True: 0, False: 20.2k]
  ------------------
 1501|      0|    {
 1502|      0|        TY_(ParseXMLDocument)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1503|      0|        if ( !TY_(CheckNodeIntegrity)( &doc->root ) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1503:14): [True: 0, False: 0]
  ------------------
 1504|      0|            TidyPanic( doc->allocator, integrity );
  ------------------
  |  |   69|      0|#define TidyPanic(allocator, msg) ((allocator)->vtbl->panic((allocator), (msg)))
  ------------------
 1505|      0|    }
 1506|  20.2k|    else
 1507|  20.2k|    {
 1508|  20.2k|        doc->warnings = 0;
 1509|  20.2k|        TY_(ParseDocument)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1510|  20.2k|        if ( !TY_(CheckNodeIntegrity)( &doc->root ) )
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1510:14): [True: 0, False: 20.2k]
  ------------------
 1511|      0|            TidyPanic( doc->allocator, integrity );
  ------------------
  |  |   69|      0|#define TidyPanic(allocator, msg) ((allocator)->vtbl->panic((allocator), (msg)))
  ------------------
 1512|  20.2k|    }
 1513|       |
 1514|  20.2k|    doc->docIn = NULL;
 1515|  20.2k|    doc->pConfigChangeCallback = callback;
 1516|       |
 1517|  20.2k|    return tidyDocStatus( doc );
 1518|  20.2k|}
tidyLocalizedStringN:
 2686|  20.6M|{
 2687|  20.6M|    return TY_(tidyLocalizedStringN)( messageType, quantity);
  ------------------
  |  |   23|  20.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2688|  20.6M|}
tidyLocalizedString:
 2691|  53.5M|{
 2692|  53.5M|    return TY_(tidyLocalizedString)( messageType );
  ------------------
  |  |   23|  53.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  53.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2693|  53.5M|}
tidyDefaultStringN:
 2696|  20.6M|{
 2697|  20.6M|    return TY_(tidyDefaultStringN)( messageType, quantity);
  ------------------
  |  |   23|  20.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2698|  20.6M|}
tidyDefaultString:
 2701|  62.0M|{
 2702|  62.0M|    return TY_(tidyDefaultString)( messageType );
  ------------------
  |  |   23|  62.0M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  62.0M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2703|  62.0M|}
tidylib.c:tidyDocCreate:
  105|  20.2k|{
  106|  20.2k|    TidyDocImpl* doc = (TidyDocImpl*)TidyAlloc( allocator, sizeof(TidyDocImpl) );
  ------------------
  |  |   66|  20.2k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  107|  20.2k|    TidyClearMemory( doc, sizeof(*doc) );
  ------------------
  |  |   70|  20.2k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  108|  20.2k|    doc->allocator = allocator;
  109|       |
  110|  20.2k|    TY_(InitMap)();
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  111|  20.2k|    TY_(InitTags)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  112|  20.2k|    TY_(InitAttrs)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  113|  20.2k|    TY_(InitConfig)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  114|  20.2k|    TY_(InitPrintBuf)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  115|  20.2k|    TY_(InitParserStack)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#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|  20.2k|#if SUPPORT_LOCALIZATIONS
  122|  20.2k|    if ( TY_(tidyGetLanguageSetByUser)() == no )
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (122:10): [True: 20.2k, False: 0]
  ------------------
  123|  20.2k|    {
  124|  20.2k|        if( ! TY_(tidySetLanguage)( getenv( "LC_MESSAGES" ) ) )
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (124:13): [True: 20.2k, False: 0]
  ------------------
  125|  20.2k|        {
  126|  20.2k|            if( ! TY_(tidySetLanguage)( getenv( "LANG" ) ) )
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (126:17): [True: 20.2k, False: 0]
  ------------------
  127|  20.2k|            {
  128|       |                /*\
  129|       |                *  Is. #770 #783 #780 #790 and maybe others -
  130|       |                *  TY_(tidySetLanguage)( setlocale( LC_ALL, "" ) );
  131|       |                *  this seems a 'bad' choice!
  132|       |               \*/
  133|  20.2k|            }
  134|  20.2k|        }
  135|  20.2k|    }
  136|  20.2k|#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|  20.2k|    doc->errout = TY_(StdErrOutput)();
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  145|  20.2k|    return doc;
  146|  20.2k|}
tidylib.c:tidyDocRelease:
  149|  20.2k|{
  150|       |    /* doc in/out opened and closed by parse/print routines */
  151|  20.2k|    if ( doc )
  ------------------
  |  Branch (151:10): [True: 20.2k, False: 0]
  ------------------
  152|  20.2k|    {
  153|  20.2k|        assert( doc->docIn == NULL );
  ------------------
  |  Branch (153:9): [True: 0, False: 20.2k]
  |  Branch (153:9): [True: 20.2k, False: 0]
  ------------------
  154|  20.2k|        assert( doc->docOut == NULL );
  ------------------
  |  Branch (154:9): [True: 0, False: 20.2k]
  |  Branch (154:9): [True: 20.2k, False: 0]
  ------------------
  155|       |
  156|  20.2k|        TY_(ReleaseStreamOut)( doc, doc->errout );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  157|  20.2k|        doc->errout = NULL;
  158|       |
  159|  20.2k|        TY_(FreePrintBuf)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  160|  20.2k|        TY_(FreeNode)(doc, &doc->root);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  161|  20.2k|        TidyClearMemory(&doc->root, sizeof(Node));
  ------------------
  |  |   70|  20.2k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  162|       |
  163|  20.2k|        if (doc->givenDoctype)
  ------------------
  |  Branch (163:13): [True: 134, False: 20.0k]
  ------------------
  164|  20.2k|            TidyDocFree(doc, doc->givenDoctype);
  ------------------
  |  |  159|    134|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|    134|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  165|       |
  166|  20.2k|        TY_(FreeConfig)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  167|  20.2k|        TY_(FreeAttrTable)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  168|  20.2k|        TY_(FreeAttrPriorityList)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  169|  20.2k|        TY_(FreeMutedMessageList( doc ));
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  170|  20.2k|        TY_(FreeTags)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#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|  20.2k|        TY_(FreeLexer)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  176|  20.2k|        TY_(FreeParserStack)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  177|  20.2k|        TidyDocFree( doc, doc );
  ------------------
  |  |  159|  20.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  178|  20.2k|    }
  179|  20.2k|}
tidylib.c:tidyDocParseFile:
 1136|  20.2k|{
 1137|  20.2k|    int status = -ENOENT;
 1138|  20.2k|    FILE* fin = 0;
 1139|  20.2k|    struct stat sbuf = { 0 }; /* Is. #681 - read-only files */
 1140|  20.2k|    if ( stat(filnam,&sbuf) != 0 )
  ------------------
  |  Branch (1140:10): [True: 0, False: 20.2k]
  ------------------
 1141|      0|    {
 1142|      0|        TY_(ReportFileError)( doc, filnam, FILE_NOT_FILE );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1143|      0|        return status;
 1144|      0|    }
 1145|  20.2k|    if (sbuf.st_mode & M_IS_DIR) /* and /NOT/ if a DIRECTORY */
  ------------------
  |  | 1133|  20.2k|#define M_IS_DIR S_IFDIR
  ------------------
  |  Branch (1145:9): [True: 0, False: 20.2k]
  ------------------
 1146|      0|    {
 1147|      0|        TY_(ReportFileError)(doc, filnam, FILE_NOT_FILE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1148|      0|        return status;
 1149|      0|    }
 1150|       |
 1151|       |#ifdef _WIN32
 1152|       |    return TY_(DocParseFileWithMappedFile)( doc, filnam );
 1153|       |#else
 1154|       |
 1155|  20.2k|    fin = fopen( filnam, "rb" );
 1156|       |
 1157|  20.2k|#if PRESERVE_FILE_TIMES
 1158|  20.2k|    {
 1159|       |        /* get last modified time */
 1160|  20.2k|        TidyClearMemory(&doc->filetimes, sizeof(doc->filetimes));
  ------------------
  |  |   70|  20.2k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1161|  20.2k|        if (fin && cfgBool(doc, TidyKeepFileTimes) &&
  ------------------
  |  |  418|  40.4k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.2k]
  |  |  ------------------
  ------------------
  |  Branch (1161:13): [True: 20.2k, False: 0]
  ------------------
 1162|      0|            fstat(fileno(fin), &sbuf) != -1)
  ------------------
  |  Branch (1162:13): [True: 0, False: 0]
  ------------------
 1163|      0|        {
 1164|      0|            doc->filetimes.actime = sbuf.st_atime;
 1165|      0|            doc->filetimes.modtime = sbuf.st_mtime;
 1166|      0|        }
 1167|  20.2k|    }
 1168|  20.2k|#endif
 1169|       |
 1170|  20.2k|    if ( fin )
  ------------------
  |  Branch (1170:10): [True: 20.2k, False: 0]
  ------------------
 1171|  20.2k|    {
 1172|  20.2k|        StreamIn* in = TY_(FileInput)( doc, fin, cfg( doc, TidyInCharEncoding ));
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      StreamIn* in = TY_(FileInput)( doc, fin, cfg( doc, TidyInCharEncoding ));
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1173|  20.2k|        if ( !in )
  ------------------
  |  Branch (1173:14): [True: 0, False: 20.2k]
  ------------------
 1174|      0|        {
 1175|      0|            fclose( fin );
 1176|      0|            return status;
 1177|      0|        }
 1178|  20.2k|        status = TY_(DocParseStream)( doc, in );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1179|  20.2k|        TY_(freeFileSource)(&in->source, yes);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1180|  20.2k|        TY_(freeStreamIn)(in);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1181|  20.2k|    }
 1182|      0|    else /* Error message! */
 1183|      0|        TY_(ReportFileError)( doc, filnam, FILE_CANT_OPEN );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1184|  20.2k|    return status;
 1185|  20.2k|#endif
 1186|  20.2k|}
tidylib.c:tidyDocSaveStream:
 2270|  20.2k|{
 2271|  20.2k|    Bool showMarkup  = cfgBool( doc, TidyShowMarkup );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2272|  20.2k|    Bool forceOutput = cfgBool( doc, TidyForceOutput );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2273|  20.2k|    Bool outputBOM   = ( cfgAutoBool(doc, TidyOutputBOM) == TidyYesState );
  ------------------
  |  |  421|  20.2k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2274|  20.2k|    Bool smartBOM    = ( cfgAutoBool(doc, TidyOutputBOM) == TidyAutoState );
  ------------------
  |  |  421|  20.2k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2275|  20.2k|    Bool xmlOut      = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2276|  20.2k|    Bool xhtmlOut    = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2277|  20.2k|    TidyTriState bodyOnly    = cfgAutoBool( doc, TidyBodyOnly );
  ------------------
  |  |  421|  20.2k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2278|       |
 2279|  20.2k|    Bool dropComments = cfgBool(doc, TidyHideComments);
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2280|  20.2k|    Bool makeClean    = cfgBool(doc, TidyMakeClean);
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2281|  20.2k|    Bool asciiChars   = cfgBool(doc, TidyAsciiChars);
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2282|  20.2k|    Bool makeBare     = cfgBool(doc, TidyMakeBare);
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2283|  20.2k|    Bool escapeCDATA  = cfgBool(doc, TidyEscapeCdata);
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2284|  20.2k|    TidyAttrSortStrategy sortAttrStrat = cfg(doc, TidySortAttributes);
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 2285|  20.2k|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 2286|  20.2k|    doc->pConfigChangeCallback = NULL;
 2287|       |
 2288|       |    
 2289|  20.2k|    if (escapeCDATA)
  ------------------
  |  Branch (2289:9): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|    if (dropComments)
  ------------------
  |  Branch (2292:9): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|    if (makeClean)
  ------------------
  |  Branch (2295:9): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|    if ((makeClean && asciiChars) || makeBare)
  ------------------
  |  Branch (2301:10): [True: 0, False: 20.2k]
  |  Branch (2301:23): [True: 0, False: 0]
  |  Branch (2301:38): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|    if (makeBare)
  ------------------
  |  Branch (2304:9): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|    else
 2309|  20.2k|        TY_(ReplacePreformattedSpaces)(doc, &doc->root);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2310|       |
 2311|  20.2k|    TY_(SortAttributes)(doc, &doc->root, sortAttrStrat);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2312|       |
 2313|  20.2k|    if ( showMarkup && (doc->errors == 0 || forceOutput) )
  ------------------
  |  Branch (2313:10): [True: 20.2k, False: 0]
  |  Branch (2313:25): [True: 14.8k, False: 5.34k]
  |  Branch (2313:45): [True: 5.34k, False: 0]
  ------------------
 2314|  20.2k|    {
 2315|       |        /* Output a Byte Order Mark if required */
 2316|  20.2k|        if ( outputBOM || (doc->inputHadBOM && smartBOM) )
  ------------------
  |  Branch (2316:14): [True: 0, False: 20.2k]
  |  Branch (2316:28): [True: 0, False: 20.2k]
  |  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|  20.2k|        doc->docOut = out;
 2327|  20.2k|        if ( xmlOut && !xhtmlOut )
  ------------------
  |  Branch (2327:14): [True: 20.2k, False: 0]
  |  Branch (2327:24): [True: 0, False: 20.2k]
  ------------------
 2328|      0|            TY_(PPrintXMLTree)( doc, NORMAL, 0, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2329|  20.2k|        else if ( showBodyOnly( doc, bodyOnly ) )
  ------------------
  |  Branch (2329:19): [True: 0, False: 20.2k]
  ------------------
 2330|      0|            TY_(PrintBody)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2331|  20.2k|        else
 2332|  20.2k|            TY_(PPrintTree)( doc, NORMAL, 0, &doc->root );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2333|       |
 2334|  20.2k|        TY_(PFlushLine)( doc, 0 );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2335|  20.2k|        doc->docOut = NULL;
 2336|  20.2k|    }
 2337|       |
 2338|       |    /* @jsd: removing this should solve #673, and allow saving of the buffer multiple times. */
 2339|       |//    TY_(ResetConfigToSnapshot)( doc );
 2340|  20.2k|    doc->pConfigChangeCallback = callback;
 2341|       |    
 2342|  20.2k|    return tidyDocStatus( doc );
 2343|  20.2k|}
tidylib.c:showBodyOnly:
 2251|  20.2k|{
 2252|  20.2k|    Node* node;
 2253|       |
 2254|  20.2k|    switch( bodyOnly )
 2255|  20.2k|    {
 2256|  20.2k|    case TidyNoState:
  ------------------
  |  Branch (2256:5): [True: 20.2k, False: 0]
  ------------------
 2257|  20.2k|        return no;
 2258|      0|    case TidyYesState:
  ------------------
  |  Branch (2258:5): [True: 0, False: 20.2k]
  ------------------
 2259|      0|        return yes;
 2260|      0|    default:
  ------------------
  |  Branch (2260:5): [True: 0, False: 20.2k]
  ------------------
 2261|      0|        node = TY_(FindBody)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2262|      0|        if (node && node->implicit )
  ------------------
  |  Branch (2262:13): [True: 0, False: 0]
  |  Branch (2262:21): [True: 0, False: 0]
  ------------------
 2263|      0|            return yes;
 2264|  20.2k|    }
 2265|      0|    return no;
 2266|  20.2k|}
tidylib.c:tidyDocSaveBuffer:
 1383|  20.2k|{
 1384|  20.2k|    int status = -EINVAL;
 1385|  20.2k|    if ( outbuf )
  ------------------
  |  Branch (1385:10): [True: 20.2k, False: 0]
  ------------------
 1386|  20.2k|    {
 1387|  20.2k|        uint outenc = cfg( doc, TidyOutCharEncoding );
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1388|  20.2k|        uint nl = cfg( doc, TidyNewline );
  ------------------
  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1389|  20.2k|        StreamOut* out = TY_(BufferOutput)( doc, outbuf, outenc, nl );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1390|       |
 1391|  20.2k|        status = tidyDocSaveStream( doc, out );
 1392|  20.2k|        TidyDocFree( doc, out );
  ------------------
  |  |  159|  20.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1393|  20.2k|    }
 1394|  20.2k|    return status;
 1395|  20.2k|}
tidylib.c:tidyDocStatus:
 1408|  80.8k|{
 1409|  80.8k|    if ( doc->errors > 0 )
  ------------------
  |  Branch (1409:10): [True: 21.3k, False: 59.4k]
  ------------------
 1410|  21.3k|        return 2;
 1411|  59.4k|    if ( doc->warnings > 0 || doc->accessErrors > 0 )
  ------------------
  |  Branch (1411:10): [True: 59.4k, False: 4]
  |  Branch (1411:31): [True: 0, False: 4]
  ------------------
 1412|  59.4k|        return 1;
 1413|      4|    return 0;
 1414|  59.4k|}
tidylib.c:tidyDocRunDiagnostics:
 1521|  20.2k|{
 1522|  20.2k|    TY_(ReportMarkupVersion)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1523|  20.2k|    TY_(ReportNumWarnings)( doc );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1524|       |
 1525|  20.2k|    if ( doc->errors > 0 && !cfgBool( doc, TidyForceOutput ) )
  ------------------
  |  |  418|  5.34k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.34k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1525:10): [True: 5.34k, False: 14.8k]
  |  Branch (1525:29): [True: 5.34k, False: 0]
  ------------------
 1526|  5.34k|        TY_(Dialogue)(doc, STRING_NEEDS_INTERVENTION );
  ------------------
  |  |   23|  5.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1527|       |
 1528|  20.2k|     return tidyDocStatus( doc );
 1529|  20.2k|}
tidylib.c:tidyDocCleanAndRepair:
 2100|  20.2k|{
 2101|  20.2k|    Bool word2K   = cfgBool( doc, TidyWord2000 );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2102|  20.2k|    Bool logical  = cfgBool( doc, TidyLogicalEmphasis );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2103|  20.2k|    Bool clean    = cfgBool( doc, TidyMakeClean );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2104|  20.2k|    Bool gdoc     = cfgBool( doc, TidyGDocClean );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2105|  20.2k|    Bool htmlOut  = cfgBool( doc, TidyHtmlOut );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2106|  20.2k|    Bool xmlOut   = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2107|  20.2k|    Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2108|  20.2k|    Bool xmlDecl  = cfgBool( doc, TidyXmlDecl );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2109|  20.2k|    Bool tidyMark = cfgBool( doc, TidyMark );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2110|  20.2k|    Bool tidyXmlTags = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2111|  20.2k|    Bool wantNameAttr = cfgBool( doc, TidyAnchorAsName );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2112|  20.2k|    Bool mergeEmphasis = cfgBool( doc, TidyMergeEmphasis );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2113|  20.2k|    Node* node;
 2114|  20.2k|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 2115|  20.2k|    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|  20.2k|    if (tidyXmlTags)
  ------------------
  |  Branch (2121:9): [True: 0, False: 20.2k]
  ------------------
 2122|      0|    {
 2123|      0|        doc->pConfigChangeCallback = callback;
 2124|      0|        return tidyDocStatus( doc );
 2125|      0|    }
 2126|       |
 2127|       |    /* Issue #567 - move style elements from body to head */
 2128|  20.2k|    TY_(CleanStyle)(doc, &doc->root);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2129|       |
 2130|       |    /* simplifies <b><b> ... </b> ...</b> etc. */
 2131|  20.2k|    if ( mergeEmphasis )
  ------------------
  |  Branch (2131:10): [True: 20.2k, False: 0]
  ------------------
 2132|  20.2k|        TY_(NestedEmphasis)( doc, &doc->root );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2133|       |
 2134|       |    /* cleans up <dir>indented text</dir> etc. */
 2135|  20.2k|    TY_(List2BQ)( doc, &doc->root );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2136|  20.2k|    TY_(BQ2Div)( doc, &doc->root );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2137|       |
 2138|       |    /* replaces i by em and b by strong */
 2139|  20.2k|    if ( logical )
  ------------------
  |  Branch (2139:10): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|    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: 20.2k]
  |  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|  20.2k|    if ( clean )
  ------------------
  |  Branch (2153:10): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|    if ( gdoc )
  ------------------
  |  Branch (2157:10): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|    TY_(TidyMetaCharset)(doc);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2162|       |
 2163|  20.2k|    if ( !TY_(CheckNodeIntegrity)( &doc->root ) )
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2163:10): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|    node = TY_(FindDocType)(doc);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2168|       |
 2169|  20.2k|    if (node)
  ------------------
  |  Branch (2169:9): [True: 2.19k, False: 18.0k]
  ------------------
 2170|  2.19k|    {
 2171|  2.19k|        AttVal* fpi = TY_(GetAttrByName)(node, "PUBLIC");
  ------------------
  |  |   23|  2.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2172|  2.19k|        if (AttrHasValue(fpi))
  ------------------
  |  |  171|  2.19k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 232, False: 1.96k]
  |  |  |  Branch (171:44): [True: 134, False: 98]
  |  |  ------------------
  ------------------
 2173|    134|        {
 2174|    134|            if (doc->givenDoctype)
  ------------------
  |  Branch (2174:17): [True: 0, False: 134]
  ------------------
 2175|    134|                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|    134|            doc->givenDoctype = TY_(tmbstrdup)(doc->allocator,fpi->value);
  ------------------
  |  |   23|    134|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    134|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2177|    134|        }
 2178|  2.19k|    }
 2179|       |
 2180|  20.2k|    if ( doc->root.content )
  ------------------
  |  Branch (2180:10): [True: 20.2k, False: 0]
  ------------------
 2181|  20.2k|    {
 2182|       |        /* If we had XHTML input but want HTML output */
 2183|  20.2k|        if ( htmlOut && doc->lexer->isvoyager )
  ------------------
  |  Branch (2183:14): [True: 0, False: 20.2k]
  |  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|  20.2k|        if (xhtmlOut && !htmlOut)
  ------------------
  |  Branch (2191:13): [True: 20.2k, False: 0]
  |  Branch (2191:25): [True: 20.2k, False: 0]
  ------------------
 2192|  20.2k|        {
 2193|  20.2k|            TY_(SetXHTMLDocType)(doc);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2194|  20.2k|            TY_(FixAnchors)(doc, &doc->root, wantNameAttr, yes);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2195|  20.2k|            TY_(FixXhtmlNamespace)(doc, yes);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2196|  20.2k|            TY_(FixLanguageInformation)(doc, &doc->root, yes, yes);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2197|  20.2k|        }
 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|  20.2k|        if (tidyMark )
  ------------------
  |  Branch (2206:13): [True: 20.2k, False: 0]
  ------------------
 2207|  20.2k|            TY_(AddGenerator)(doc);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2208|       |
 2209|  20.2k|    }
 2210|       |
 2211|       |    /* ensure presence of initial <?xml version="1.0"?> */
 2212|  20.2k|    if ( xmlOut && xmlDecl )
  ------------------
  |  Branch (2212:10): [True: 20.2k, False: 0]
  |  Branch (2212:20): [True: 0, False: 20.2k]
  ------------------
 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|  20.2k|    if (doc->lexer) 
  ------------------
  |  Branch (2219:9): [True: 20.2k, False: 0]
  ------------------
 2220|  20.2k|    {
 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|  20.2k|        if (doc->lexer->versionEmitted & VERS_HTML5)
  ------------------
  |  |  213|  20.2k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  20.2k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  20.2k|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (2227:13): [True: 20.0k, False: 164]
  ------------------
 2228|  20.0k|            TY_(CheckHTML5)( doc, &doc->root );
  ------------------
  |  |   23|  20.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2229|  20.2k|        TY_(CheckHTMLTagsAttribsVersions)( doc, &doc->root );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2230|       |
 2231|  20.2k|        if ( !doc->lexer->isvoyager && doc->xmlDetected )
  ------------------
  |  Branch (2231:14): [True: 18.7k, False: 1.44k]
  |  Branch (2231:40): [True: 133, False: 18.6k]
  ------------------
 2232|    133|        {
 2233|    133|            TY_(Report)(doc, NULL, TY_(FindXmlDecl)(doc), XML_DECLARATION_DETECTED );
  ------------------
  |  |   23|    133|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    133|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(Report)(doc, NULL, TY_(FindXmlDecl)(doc), XML_DECLARATION_DETECTED );
  ------------------
  |  |   23|    133|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    133|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2234|       |
 2235|    133|        }
 2236|  20.2k|    }
 2237|       |
 2238|  20.2k|    TY_(CleanHead)(doc); /* Is #692 - discard multiple <title> tags */
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#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|  20.2k|    doc->pConfigChangeCallback = callback;
 2246|  20.2k|    return tidyDocStatus( doc );
 2247|  20.2k|}
tidylib.c:prvTidyCheckHTML5:
 1632|  20.0k|{
 1633|  20.0k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1634|  20.0k|    Bool clean = cfgBool( doc, TidyMakeClean );
  ------------------
  |  |  418|  20.0k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.0k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1635|  20.0k|    Bool already_strict = cfgBool( doc, TidyStrictTagsAttr );
  ------------------
  |  |  418|  20.0k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.0k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1636|  20.0k|    Node* body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  20.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1637|  20.0k|    Node* next;
 1638|  20.0k|    Bool warn = yes;    /* should this be a warning, error, or report??? */
 1639|  20.0k|    AttVal* attr = NULL;
 1640|  20.0k|    int i = 0;
 1641|       |
 1642|  2.73M|    while (node)
  ------------------
  |  Branch (1642:12): [True: 2.71M, False: 20.0k]
  ------------------
 1643|  2.71M|    {
 1644|  2.71M|        next = node->next;
 1645|       |        
 1646|  2.71M|        if ( nodeHasAlignAttr( node ) ) {
  ------------------
  |  Branch (1646:14): [True: 11.2k, False: 2.70M]
  ------------------
 1647|       |            /* @todo: Is this for ALL elements that accept an 'align' attribute,
 1648|       |             * or should this be a sub-set test?
 1649|       |             */
 1650|       |
 1651|       |            /* We will only emit this message if `--strict-tags-attributes==no`;
 1652|       |             * otherwise if yes this message will be output during later
 1653|       |             * checking.
 1654|       |             */
 1655|  11.2k|            if ( !already_strict )
  ------------------
  |  Branch (1655:18): [True: 11.2k, False: 0]
  ------------------
 1656|  11.2k|                TY_(ReportAttrError)(doc, node, TY_(AttrGetById)(node, TidyAttr_ALIGN), MISMATCHED_ATTRIBUTE_WARN);
  ------------------
  |  |   23|  11.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportAttrError)(doc, node, TY_(AttrGetById)(node, TidyAttr_ALIGN), MISMATCHED_ATTRIBUTE_WARN);
  ------------------
  |  |   23|  11.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1657|  11.2k|        }
 1658|  2.71M|        if ( node == body ) {
  ------------------
  |  Branch (1658:14): [True: 19.8k, False: 2.69M]
  ------------------
 1659|  19.8k|            i = 0;
 1660|       |            /* We will only emit these messages if `--strict-tags-attributes==no`;
 1661|       |             * otherwise if yes these messages will be output during later
 1662|       |             * checking.
 1663|       |             */
 1664|  19.8k|            if ( !already_strict ) {
  ------------------
  |  Branch (1664:18): [True: 19.8k, False: 0]
  ------------------
 1665|   138k|                while ( BadBody5Attribs[i] != TidyAttr_UNKNOWN ) {
  ------------------
  |  Branch (1665:25): [True: 118k, False: 19.8k]
  ------------------
 1666|   118k|                    attr = TY_(AttrGetById)(node, BadBody5Attribs[i]);
  ------------------
  |  |   23|   118k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   118k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1667|   118k|                    if ( attr )
  ------------------
  |  Branch (1667:26): [True: 1, False: 118k]
  ------------------
 1668|      1|                        TY_(ReportAttrError)(doc, node, attr , MISMATCHED_ATTRIBUTE_WARN);
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1669|   118k|                    i++;
 1670|   118k|                }
 1671|  19.8k|            }
 1672|  19.8k|        } else
 1673|  2.69M|        if ( nodeIsACRONYM(node) ) {
  ------------------
  |  |  469|  2.69M|#define nodeIsACRONYM( node )    TagIsId( node, TidyTag_ACRONYM )
  |  |  ------------------
  |  |  |  |  275|  2.69M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.69M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.21M, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 2.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1674|      0|            if (clean) {
  ------------------
  |  Branch (1674:17): [True: 0, False: 0]
  ------------------
 1675|       |                /* Replace with 'abbr' with warning to that effect.
 1676|       |                 * Maybe should use static void RenameElem( TidyDocImpl* doc, Node* node, TidyTagId tid )
 1677|       |                 */
 1678|      0|                TY_(CoerceNode)(doc, node, TidyTag_ABBR, warn, no);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1679|      0|            } else {
 1680|      0|                if ( !already_strict )
  ------------------
  |  Branch (1680:22): [True: 0, False: 0]
  ------------------
 1681|      0|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1682|      0|            }
 1683|      0|        } else
 1684|  2.69M|        if ( nodeIsAPPLET(node) ) {
  ------------------
  |  |  427|  2.69M|#define nodeIsAPPLET( node )     TagIsId( node, TidyTag_APPLET )
  |  |  ------------------
  |  |  |  |  275|  2.69M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.69M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.21M, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 676, False: 2.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1685|    676|            if (clean) {
  ------------------
  |  Branch (1685:17): [True: 0, False: 676]
  ------------------
 1686|       |                /* replace with 'object' with warning to that effect
 1687|       |                 * maybe should use static void RenameElem( TidyDocImpl* doc, Node* node, TidyTagId tid )
 1688|       |                 */
 1689|      0|                TY_(CoerceNode)(doc, node, TidyTag_OBJECT, warn, no);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1690|    676|            } else {
 1691|    676|                if ( !already_strict )
  ------------------
  |  Branch (1691:22): [True: 676, False: 0]
  ------------------
 1692|    676|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    676|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    676|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1693|    676|            }
 1694|    676|        } else
 1695|  2.69M|        if ( nodeIsBASEFONT(node) ) {
  ------------------
  |  |  444|  2.69M|#define nodeIsBASEFONT( node )   TagIsId( node, TidyTag_BASEFONT )
  |  |  ------------------
  |  |  |  |  275|  2.69M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.69M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.21M, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 214, False: 2.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1696|       |            /* basefont: CSS equivalent 'font-size', 'font-family' and 'color' 
 1697|       |             * on body or class on each subsequent element.
 1698|       |             * Difficult - If it is the first body element, then could consider
 1699|       |             * adding that to the <body> as a whole, else could perhaps apply it
 1700|       |             * to all subsequent elements. But also in consideration is the fact
 1701|       |             * that it was NOT supported in many browsers.
 1702|       |             * - For now just report a warning
 1703|       |             */
 1704|    214|            if ( !already_strict )
  ------------------
  |  Branch (1704:18): [True: 214, False: 0]
  ------------------
 1705|    214|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    214|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    214|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1706|    214|        } else
 1707|  2.69M|        if ( nodeIsBIG(node) ) {
  ------------------
  |  |  407|  2.69M|#define nodeIsBIG( node )        TagIsId( node, TidyTag_BIG )
  |  |  ------------------
  |  |  |  |  275|  2.69M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.69M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.21M, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 374, False: 2.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1708|       |            /* big: CSS equivalent 'font-size:larger'
 1709|       |             * so could replace the <big> ... </big> with
 1710|       |             * <span style="font-size: larger"> ... </span>
 1711|       |             * then replace <big> with <span>
 1712|       |             * Need to think about that...
 1713|       |             * Could use -
 1714|       |             *   TY_(AddStyleProperty)( doc, node, "font-size: larger" );
 1715|       |             *   TY_(CoerceNode)(doc, node, TidyTag_SPAN, no, no);
 1716|       |             * Alternatively generated a <style> but how to get the style name
 1717|       |             * TY_(AddAttribute)( doc, node, "class", "????" );
 1718|       |             * Also maybe need a specific message like
 1719|       |             * Element '%s' replaced with 'span' with a 'font-size: larger style attribute
 1720|       |             * maybe should use static void RenameElem( TidyDocImpl* doc, Node* node, TidyTagId tid )
 1721|       |             */
 1722|    374|            if (clean) {
  ------------------
  |  Branch (1722:17): [True: 0, False: 374]
  ------------------
 1723|      0|                TY_(AddStyleProperty)( doc, node, "font-size: larger" );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1724|      0|                TY_(CoerceNode)(doc, node, TidyTag_SPAN, warn, no);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1725|    374|            } else {
 1726|    374|                if ( !already_strict )
  ------------------
  |  Branch (1726:22): [True: 374, False: 0]
  ------------------
 1727|    374|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    374|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    374|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1728|    374|            }
 1729|    374|        } else
 1730|  2.69M|        if ( nodeIsCENTER(node) ) {
  ------------------
  |  |  420|  2.69M|#define nodeIsCENTER( node )     TagIsId( node, TidyTag_CENTER )
  |  |  ------------------
  |  |  |  |  275|  2.69M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.69M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.21M, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 605, False: 2.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1731|       |            /* center: CSS equivalent 'text-align:center'
 1732|       |             * and 'margin-left:auto; margin-right:auto' on descendant blocks
 1733|       |             * Tidy already handles this if 'clean' by SILENTLY generating the
 1734|       |             * <style> and adding a <div class="c1"> around the elements.
 1735|       |             * see: static Bool Center2Div( TidyDocImpl* doc, Node *node, Node **pnode)
 1736|       |             */
 1737|    605|            if ( !already_strict )
  ------------------
  |  Branch (1737:18): [True: 605, False: 0]
  ------------------
 1738|    605|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    605|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    605|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1739|    605|        } else
 1740|  2.69M|        if ( nodeIsDIR(node) ) {
  ------------------
  |  |  389|  2.69M|#define nodeIsDIR( node )        TagIsId( node, TidyTag_DIR )
  |  |  ------------------
  |  |  |  |  275|  2.69M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.69M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.21M, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 2.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1741|       |            /* dir: replace by <ul>
 1742|       |             * Tidy already actions this and issues a warning
 1743|       |             * Should this be CHANGED???
 1744|       |             */
 1745|      0|            if ( !already_strict )
  ------------------
  |  Branch (1745:18): [True: 0, False: 0]
  ------------------
 1746|      0|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1747|      0|        } else
 1748|  2.69M|        if ( nodeIsFONT(node) ) {
  ------------------
  |  |  417|  2.69M|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  2.69M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.69M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.21M, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 1.59M, False: 619k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1749|       |            /* Tidy already handles this -
 1750|       |             * If 'clean' replaced by CSS, else
 1751|       |             * if is NOT clean, and doctype html5 then warnings issued
 1752|       |             * done in Bool Font2Span( TidyDocImpl* doc, Node *node, Node **pnode ) (I think?)
 1753|       |             */
 1754|  1.59M|            if ( !already_strict )
  ------------------
  |  Branch (1754:18): [True: 1.59M, False: 0]
  ------------------
 1755|  1.59M|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|  1.59M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.59M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1756|  1.59M|        } else
 1757|  1.10M|        if (( nodesIsFRAME(node) ) || ( nodeIsFRAMESET(node) ) || ( nodeIsNOFRAMES(node) )) {
  ------------------
  |  |  470|  1.10M|#define nodesIsFRAME( node )     TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|  1.10M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.10M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 619k, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 2.25k, False: 616k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (( nodesIsFRAME(node) ) || ( nodeIsFRAMESET(node) ) || ( nodeIsNOFRAMES(node) )) {
  ------------------
  |  |  376|  1.09M|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  1.09M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.09M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 616k, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 12.9k, False: 603k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (( nodesIsFRAME(node) ) || ( nodeIsFRAMESET(node) ) || ( nodeIsNOFRAMES(node) )) {
  ------------------
  |  |  379|  1.08M|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  1.08M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.08M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 603k, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 13.4k, False: 590k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1758|       |            /* YOW: What to do here?????? Maybe <iframe>????
 1759|       |             */
 1760|  28.6k|            if ( !already_strict )
  ------------------
  |  Branch (1760:18): [True: 28.6k, False: 0]
  ------------------
 1761|  28.6k|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|  28.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1762|  28.6k|        } else
 1763|  1.07M|        if ( nodeIsSTRIKE(node) ) {
  ------------------
  |  |  447|  1.07M|#define nodeIsSTRIKE( node )     TagIsId( node, TidyTag_STRIKE )
  |  |  ------------------
  |  |  |  |  275|  1.07M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.07M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 590k, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 544, False: 590k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1764|       |            /* strike: CSS equivalent 'text-decoration:line-through'
 1765|       |             * maybe should use static void RenameElem( TidyDocImpl* doc, Node* node, TidyTagId tid )
 1766|       |             */
 1767|    544|            if (clean) {
  ------------------
  |  Branch (1767:17): [True: 0, False: 544]
  ------------------
 1768|      0|                TY_(AddStyleProperty)( doc, node, "text-decoration: line-through" );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1769|      0|                TY_(CoerceNode)(doc, node, TidyTag_SPAN, warn, no);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1770|    544|            } else {
 1771|    544|                if ( !already_strict )
  ------------------
  |  Branch (1771:22): [True: 544, False: 0]
  ------------------
 1772|    544|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    544|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    544|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1773|    544|            }
 1774|    544|        } else
 1775|  1.07M|        if ( nodeIsTT(node) ) {
  ------------------
  |  |  471|  1.07M|#define nodeIsTT( node )         TagIsId( node, TidyTag_TT )
  |  |  ------------------
  |  |  |  |  275|  1.07M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.07M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 590k, False: 482k]
  |  |  |  |  |  Branch (275:54): [True: 2.17k, False: 587k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1776|       |            /* tt: CSS equivalent 'font-family:monospace'
 1777|       |             * Tidy presently does nothing. Tidy5 issues a warning
 1778|       |             * But like the 'clean' <font> replacement this could also be replaced with CSS
 1779|       |             * maybe should use static void RenameElem( TidyDocImpl* doc, Node* node, TidyTagId tid )
 1780|       |             */
 1781|  2.17k|            if (clean) {
  ------------------
  |  Branch (1781:17): [True: 0, False: 2.17k]
  ------------------
 1782|      0|                TY_(AddStyleProperty)( doc, node, "font-family: monospace" );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1783|      0|                TY_(CoerceNode)(doc, node, TidyTag_SPAN, warn, no);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1784|  2.17k|            } else {
 1785|  2.17k|                if ( !already_strict )
  ------------------
  |  Branch (1785:22): [True: 2.17k, False: 0]
  ------------------
 1786|  2.17k|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|  2.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1787|  2.17k|            }
 1788|  2.17k|        } else
 1789|  1.06M|            if (TY_(nodeIsElement)(node)) {
  ------------------
  |  |   23|  1.06M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.06M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1789:17): [True: 591k, False: 478k]
  ------------------
 1790|   591k|                if (node->tag) {
  ------------------
  |  Branch (1790:21): [True: 587k, False: 4.18k]
  ------------------
 1791|   587k|                    if ( (!(node->tag->versions & VERS_HTML5) && !(node->tag->versions & VERS_PROPRIETARY)) || (inRemovedInfo(node->tag->id)) ) {
  ------------------
  |  |  213|   587k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|   587k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|   587k|#define XH50              262144u
  |  |  ------------------
  ------------------
                                  if ( (!(node->tag->versions & VERS_HTML5) && !(node->tag->versions & VERS_PROPRIETARY)) || (inRemovedInfo(node->tag->id)) ) {
  ------------------
  |  |  231|  1.27k|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  1.27k|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  1.27k|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  1.27k|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  |  Branch (1791:27): [True: 1.27k, False: 586k]
  |  Branch (1791:66): [True: 236, False: 1.04k]
  |  Branch (1791:112): [True: 0, False: 587k]
  ------------------
 1792|    236|                        if ( !already_strict )
  ------------------
  |  Branch (1792:30): [True: 236, False: 0]
  ------------------
 1793|    236|                            TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    236|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    236|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1794|    236|                    }
 1795|   587k|                }
 1796|   591k|            }
 1797|       |
 1798|  2.71M|        if (node->content)
  ------------------
  |  Branch (1798:13): [True: 2.07M, False: 636k]
  ------------------
 1799|  2.07M|        {
 1800|  2.07M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.07M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.07M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1801|  2.07M|            node = node->content;
 1802|  2.07M|            continue;
 1803|  2.07M|        }
 1804|       |
 1805|   636k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   150k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   150k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1805:16): [True: 485k, False: 150k]
  ------------------
 1806|   636k|    }
 1807|  20.0k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1808|  20.0k|}
tidylib.c:nodeHasAlignAttr:
 1610|  2.71M|{
 1611|       |    /* #define attrIsALIGN(av) AttrIsId( av, TidyAttr_ALIGN  ) */
 1612|  2.71M|    AttVal* av;
 1613|  3.05M|    for ( av = node->attributes; av != NULL; av = av->next ) {
  ------------------
  |  Branch (1613:34): [True: 347k, False: 2.70M]
  ------------------
 1614|   347k|        if (attrIsALIGN(av))
  ------------------
  |  |  187|   347k|#define attrIsALIGN(av)             AttrIsId( av, TidyAttr_ALIGN  )
  |  |  ------------------
  |  |  |  |  169|   347k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 347k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 274k, False: 73.0k]
  |  |  |  |  |  Branch (169:51): [True: 11.2k, False: 263k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1615|  11.2k|            return yes;
 1616|   347k|    }
 1617|  2.70M|    return no;
 1618|  2.71M|}
tidylib.c:inRemovedInfo:
 1584|   587k|{
 1585|   587k|    int i;
 1586|  7.63M|    for (i = 0; ; i++) {
 1587|  7.63M|        if (html5Info[i].tag == 0)
  ------------------
  |  Branch (1587:13): [True: 587k, False: 7.04M]
  ------------------
 1588|   587k|            break;
 1589|  7.04M|        if (html5Info[i].id == tid)
  ------------------
  |  Branch (1589:13): [True: 0, False: 7.04M]
  ------------------
 1590|      0|            return yes;
 1591|  7.04M|    }
 1592|   587k|    return no;
 1593|   587k|}
tidylib.c:prvTidyCheckHTMLTagsAttribsVersions:
 1827|  20.2k|{
 1828|  20.2k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1829|  20.2k|    Node *next;
 1830|  20.2k|    uint versionEmitted = doc->lexer->versionEmitted;
 1831|  20.2k|    uint declared = doc->lexer->doctype;
 1832|  20.2k|    uint version = versionEmitted == 0 ? declared : versionEmitted;
  ------------------
  |  Branch (1832:20): [True: 18, False: 20.1k]
  ------------------
 1833|  20.2k|    int tagReportType = VERS_STRICT & version ? ELEMENT_VERS_MISMATCH_ERROR : ELEMENT_VERS_MISMATCH_WARN;
  ------------------
  |  |  225|  20.2k|#define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  213|  20.2k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  200|  20.2k|#define HT50              131072u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  201|  20.2k|#define XH50              262144u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  207|  20.2k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  20.2k|#define H40S                   4u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  20.2k|#define H41S                  32u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  185|  20.2k|#define X10S                 256u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1833:25): [True: 20.0k, False: 146]
  ------------------
 1834|  20.2k|    int attrReportType = VERS_STRICT & version ? MISMATCHED_ATTRIBUTE_ERROR : MISMATCHED_ATTRIBUTE_WARN;
  ------------------
  |  |  225|  20.2k|#define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  213|  20.2k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  200|  20.2k|#define HT50              131072u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  201|  20.2k|#define XH50              262144u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  207|  20.2k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  20.2k|#define H40S                   4u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  20.2k|#define H41S                  32u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  185|  20.2k|#define X10S                 256u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1834:26): [True: 20.0k, False: 146]
  ------------------
 1835|  20.2k|    Bool check_versions = cfgBool( doc, TidyStrictTagsAttr );
  ------------------
  |  |  418|  20.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1836|  20.2k|    AttVal *next_attr, *attval;
 1837|  20.2k|    Bool attrIsProprietary = no;
 1838|  20.2k|    Bool attrIsMismatched = yes;
 1839|  20.2k|    Bool tagLooksCustom = no;
 1840|  20.2k|    Bool htmlIs5 = (doc->lexer->doctype & VERS_HTML5) > 0;
  ------------------
  |  |  213|  20.2k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  20.2k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  20.2k|#define XH50              262144u
  |  |  ------------------
  ------------------
 1841|       |
 1842|  2.75M|    while (node)
  ------------------
  |  Branch (1842:12): [True: 2.73M, False: 20.2k]
  ------------------
 1843|  2.73M|    {
 1844|  2.73M|        next = node->next;
 1845|       |
 1846|       |        /* This bit here handles our HTML tags */
 1847|  2.73M|        if ( TY_(nodeIsElement)(node) && node->tag ) {
  ------------------
  |  |   23|  2.73M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.73M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1847:14): [True: 2.24M, False: 494k]
  |  Branch (1847:42): [True: 2.23M, False: 4.72k]
  ------------------
 1848|       |
 1849|       |            /* Leave XML stuff alone. */
 1850|  2.23M|            if ( !cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  2.23M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.23M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1850:18): [True: 2.23M, False: 0]
  ------------------
 1851|  2.23M|            {
 1852|       |                /* Version mismatches take priority. */
 1853|  2.23M|                if ( check_versions && !(node->tag->versions & version) )
  ------------------
  |  Branch (1853:22): [True: 0, False: 2.23M]
  |  Branch (1853:40): [True: 0, False: 0]
  ------------------
 1854|      0|                {
 1855|      0|                    TY_(Report)(doc, NULL, node, tagReportType );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1856|      0|                }
 1857|       |                /* If it's not mismatched, it could still be proprietary. */
 1858|  2.23M|                else if ( node->tag->versions & VERS_PROPRIETARY )
  ------------------
  |  |  231|  2.23M|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  2.23M|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  2.23M|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  2.23M|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  |  Branch (1858:27): [True: 1.04k, False: 2.23M]
  ------------------
 1859|  1.04k|                {
 1860|  1.04k|                    if ( !cfgBool(doc, TidyMakeClean) ||
  ------------------
  |  |  418|  2.08k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.04k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1860:26): [True: 1.04k, False: 0]
  ------------------
 1861|      0|                        ( !nodeIsNOBR(node) && !nodeIsWBR(node) ) )
  ------------------
  |  |  415|      0|#define nodeIsNOBR( node )       TagIsId( node, TidyTag_NOBR )
  |  |  ------------------
  |  |  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                      ( !nodeIsNOBR(node) && !nodeIsWBR(node) ) )
  ------------------
  |  |  416|      0|#define nodeIsWBR( node )        TagIsId( node, TidyTag_WBR )
  |  |  ------------------
  |  |  |  |  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]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1862|  1.04k|                    {
 1863|       |                        /* It looks custom, despite whether it's a known tag. */
 1864|  1.04k|                        tagLooksCustom = TY_(nodeIsAutonomousCustomFormat)( node );
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1865|       |
 1866|       |                        /* If we're in HTML5 mode and the tag does not look
 1867|       |                           like a valid custom tag, then issue a warning.
 1868|       |                           Appearance is good enough because invalid tags have
 1869|       |                           been dropped. Also, if we're not in HTML5 mode, then
 1870|       |                           then everything that reaches here gets the warning.
 1871|       |                           Everything else can be ignored. */
 1872|       |
 1873|  1.04k|                        if ( (htmlIs5 && !tagLooksCustom) || !htmlIs5 )
  ------------------
  |  Branch (1873:31): [True: 252, False: 790]
  |  Branch (1873:42): [True: 252, False: 0]
  |  Branch (1873:62): [True: 790, False: 0]
  ------------------
 1874|  1.04k|                        {
 1875|  1.04k|                            TY_(Report)(doc, NULL, node, PROPRIETARY_ELEMENT );
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1876|  1.04k|                        }
 1877|       |
 1878|  1.04k|                        if ( nodeIsLAYER(node) )
  ------------------
  |  |  418|  1.04k|#define nodeIsLAYER( node )      TagIsId( node, TidyTag_LAYER )
  |  |  ------------------
  |  |  |  |  275|  1.04k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.04k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.04k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 1.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1879|      0|                            doc->badLayout |= USING_LAYER;
  ------------------
  |  |  292|      0|#define USING_LAYER             2
  ------------------
 1880|  1.04k|                        else if ( nodeIsSPACER(node) )
  ------------------
  |  |  419|  1.04k|#define nodeIsSPACER( node )     TagIsId( node, TidyTag_SPACER )
  |  |  ------------------
  |  |  |  |  275|  1.04k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.04k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.04k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 1.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1881|      0|                            doc->badLayout |= USING_SPACER;
  ------------------
  |  |  291|      0|#define USING_SPACER            1
  ------------------
 1882|  1.04k|                        else if ( nodeIsNOBR(node) )
  ------------------
  |  |  415|  1.04k|#define nodeIsNOBR( node )       TagIsId( node, TidyTag_NOBR )
  |  |  ------------------
  |  |  |  |  275|  1.04k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.04k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.04k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 911, False: 131]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1883|    911|                            doc->badLayout |= USING_NOBR;
  ------------------
  |  |  293|    911|#define USING_NOBR              4
  ------------------
 1884|  1.04k|                    }
 1885|  1.04k|                }
 1886|  2.23M|            }
 1887|  2.23M|        }
 1888|       |
 1889|       |        /* And this bit here handles our attributes */
 1890|  2.73M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  2.73M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.73M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1890:13): [True: 2.24M, False: 494k]
  ------------------
 1891|  2.24M|        {
 1892|  2.24M|            attval = node->attributes;
 1893|       |
 1894|  2.58M|            while (attval)
  ------------------
  |  Branch (1894:20): [True: 337k, False: 2.24M]
  ------------------
 1895|   337k|            {
 1896|   337k|                next_attr = attval->next;
 1897|       |
 1898|   337k|                attrIsProprietary = TY_(AttributeIsProprietary)(node, attval);
  ------------------
  |  |   23|   337k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   337k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1899|       |                /* Is. #729 - always check version match if HTML5 */
 1900|   337k|                attrIsMismatched = (check_versions | htmlIs5) ? TY_(AttributeIsMismatched)(node, attval, doc) : no;
  ------------------
  |  |   23|  7.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1900:36): [True: 7.54k, False: 329k]
  ------------------
 1901|       |                /* Let the PROPRIETARY_ATTRIBUTE warning have precedence. */
 1902|   337k|                if ( attrIsProprietary )
  ------------------
  |  Branch (1902:22): [True: 94.0k, False: 243k]
  ------------------
 1903|  94.0k|                {
 1904|  94.0k|                    if ( cfgBool(doc, TidyWarnPropAttrs) )
  ------------------
  |  |  418|  94.0k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  94.0k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 94.0k, False: 0]
  |  |  ------------------
  ------------------
 1905|  94.0k|                        TY_(ReportAttrError)(doc, node, attval, PROPRIETARY_ATTRIBUTE);
  ------------------
  |  |   23|  94.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  94.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1906|  94.0k|                }
 1907|   243k|                else if ( attrIsMismatched )
  ------------------
  |  Branch (1907:27): [True: 448, False: 242k]
  ------------------
 1908|    448|                {
 1909|    448|                    if (htmlIs5) 
  ------------------
  |  Branch (1909:25): [True: 448, False: 0]
  ------------------
 1910|    448|                    { 
 1911|       |                        /* Is. #729 - In html5 TidyStrictTagsAttr controls error or warn */
 1912|    448|                        TY_(ReportAttrError)(doc, node, attval,
  ------------------
  |  |   23|    448|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    448|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1913|    448|                            check_versions ? MISMATCHED_ATTRIBUTE_ERROR : MISMATCHED_ATTRIBUTE_WARN);
  ------------------
  |  Branch (1913:29): [True: 0, False: 448]
  ------------------
 1914|    448|                    }
 1915|      0|                    else
 1916|      0|                        TY_(ReportAttrError)(doc, node, attval, attrReportType);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1917|       |
 1918|    448|                }
 1919|       |
 1920|       |                /* @todo: do we need a new option to drop mismatches? Or should we
 1921|       |                 simply drop them? */
 1922|   337k|                if ( ( attrIsProprietary || attrIsMismatched ) && cfgBool(doc, TidyDropPropAttrs) )
  ------------------
  |  |  418|  94.4k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  94.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 94.4k]
  |  |  ------------------
  ------------------
  |  Branch (1922:24): [True: 94.0k, False: 243k]
  |  Branch (1922:45): [True: 448, False: 242k]
  ------------------
 1923|      0|                    TY_(RemoveAttribute)( doc, node, attval );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1924|       |
 1925|   337k|                attval = next_attr;
 1926|   337k|            }
 1927|  2.24M|        }
 1928|       |
 1929|  2.73M|        if (node->content)
  ------------------
  |  Branch (1929:13): [True: 2.08M, False: 654k]
  ------------------
 1930|  2.08M|        {
 1931|  2.08M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.08M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.08M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1932|  2.08M|            node = node->content;
 1933|  2.08M|            continue;
 1934|  2.08M|        }
 1935|       |
 1936|   654k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   151k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   151k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1936:16): [True: 503k, False: 151k]
  ------------------
 1937|   654k|    }
 1938|  20.2k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1939|  20.2k|}

prvTidytmbstrdup:
   14|  3.39M|{
   15|  3.39M|    tmbstr s = NULL;
   16|  3.39M|    if ( str )
  ------------------
  |  Branch (16:10): [True: 3.28M, False: 109k]
  ------------------
   17|  3.28M|    {
   18|  3.28M|        uint len = TY_(tmbstrlen)( str );
  ------------------
  |  |   23|  3.28M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.28M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   19|  3.28M|        tmbstr cp = s = (tmbstr) TidyAlloc( allocator, 1+len );
  ------------------
  |  |   66|  3.28M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
   20|  30.2M|        while ( 0 != (*cp++ = *str++) )
  ------------------
  |  Branch (20:17): [True: 26.9M, False: 3.28M]
  ------------------
   21|  26.9M|            /**/;
   22|  3.28M|    }
   23|  3.39M|    return s;
   24|  3.39M|}
prvTidytmbstrndup:
   28|  1.43M|{
   29|  1.43M|    tmbstr s = NULL;
   30|  1.43M|    if ( str && len > 0 )
  ------------------
  |  Branch (30:10): [True: 1.43M, False: 0]
  |  Branch (30:17): [True: 1.31M, False: 120k]
  ------------------
   31|  1.31M|    {
   32|  1.31M|        tmbstr cp = s = (tmbstr) TidyAlloc( allocator, 1+len );
  ------------------
  |  |   66|  1.31M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
   33|  17.5M|        while ( len-- > 0 &&  (*cp++ = *str++) )
  ------------------
  |  Branch (33:17): [True: 16.1M, False: 1.31M]
  |  Branch (33:31): [True: 16.1M, False: 2.04k]
  ------------------
   34|  16.1M|          /**/;
   35|  1.31M|        *cp = 0;
   36|  1.31M|    }
   37|  1.43M|    return s;
   38|  1.43M|}
prvTidytmbstrcpy:
   56|  1.25k|{
   57|  1.25k|    uint ncpy = 0;
   58|   573k|    while (0 != (*s1++ = *s2++) )
  ------------------
  |  Branch (58:12): [True: 572k, False: 1.25k]
  ------------------
   59|   572k|        ++ncpy;
   60|  1.25k|    return ncpy;
   61|  1.25k|}
prvTidytmbstrcat:
   66|  2.96k|{
   67|  2.96k|    uint ncpy = 0;
   68|  1.19M|    while ( *s1 )
  ------------------
  |  Branch (68:13): [True: 1.19M, False: 2.96k]
  ------------------
   69|  1.19M|        ++s1;
   70|       |
   71|  16.4k|    while (0 != (*s1++ = *s2++) )
  ------------------
  |  Branch (71:12): [True: 13.4k, False: 2.96k]
  ------------------
   72|  13.4k|        ++ncpy;
   73|  2.96k|    return ncpy;
   74|  2.96k|}
prvTidytmbstrcmp:
   78|  48.2M|{
   79|  48.2M|    int c;
   80|   695M|    while ((c = *s1) == *s2)
  ------------------
  |  Branch (80:12): [True: 647M, False: 47.3M]
  ------------------
   81|   647M|    {
   82|   647M|        if (c == '\0')
  ------------------
  |  Branch (82:13): [True: 921k, False: 646M]
  ------------------
   83|   921k|            return 0;
   84|       |
   85|   646M|        ++s1;
   86|   646M|        ++s2;
   87|   646M|    }
   88|       |
   89|  47.3M|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (89:13): [True: 12.5M, False: 34.8M]
  ------------------
   90|  48.2M|}
prvTidytmbstrlen:
   94|  23.5M|{
   95|  23.5M|    uint len = 0;
   96|  23.5M|    if ( str ) 
  ------------------
  |  Branch (96:10): [True: 23.5M, False: 0]
  ------------------
   97|  23.5M|    {
   98|  45.9G|        while ( *str++ )
  ------------------
  |  Branch (98:17): [True: 45.9G, False: 23.5M]
  ------------------
   99|  45.9G|            ++len;
  100|  23.5M|    }
  101|  23.5M|    return len;
  102|  23.5M|}
prvTidytmbstrcasecmp:
  112|  59.6M|{
  113|  59.6M|    uint c;
  114|       |
  115|  65.1M|    while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  65.1M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  65.1M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  65.1M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  65.1M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (115:12): [True: 5.93M, False: 59.2M]
  ------------------
  116|  5.93M|    {
  117|  5.93M|        if (c == '\0')
  ------------------
  |  Branch (117:13): [True: 391k, False: 5.54M]
  ------------------
  118|   391k|            return 0;
  119|       |
  120|  5.54M|        ++s1;
  121|  5.54M|        ++s2;
  122|  5.54M|    }
  123|       |
  124|  59.2M|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (124:13): [True: 25.3M, False: 33.8M]
  ------------------
  125|  59.6M|}
prvTidytmbstrncmp:
  128|  9.20M|{
  129|  9.20M|    uint c;
  130|       |
  131|  9.20M|	if (s1 == NULL || s2 == NULL)
  ------------------
  |  Branch (131:6): [True: 0, False: 9.20M]
  |  Branch (131:20): [True: 0, False: 9.20M]
  ------------------
  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|  9.37M|    while ((c = (byte)*s1) == (byte)*s2)
  ------------------
  |  Branch (138:12): [True: 174k, False: 9.19M]
  ------------------
  139|   174k|    {
  140|   174k|        if (c == '\0')
  ------------------
  |  Branch (140:13): [True: 2.73k, False: 172k]
  ------------------
  141|  2.73k|            return 0;
  142|       |
  143|   172k|        if (n == 0)
  ------------------
  |  Branch (143:13): [True: 0, False: 172k]
  ------------------
  144|      0|            return 0;
  145|       |
  146|   172k|        ++s1;
  147|   172k|        ++s2;
  148|   172k|        --n;
  149|   172k|    }
  150|       |
  151|  9.19M|    if (n == 0)
  ------------------
  |  Branch (151:9): [True: 25.7k, False: 9.17M]
  ------------------
  152|  25.7k|        return 0;
  153|       |
  154|  9.17M|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (154:13): [True: 766k, False: 8.40M]
  ------------------
  155|  9.19M|}
prvTidytmbstrncasecmp:
  158|  15.0k|{
  159|  15.0k|    uint c;
  160|       |
  161|  40.3k|    while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  40.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  40.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (161:12): [True: 25.5k, False: 14.8k]
  ------------------
  162|  25.5k|    {
  163|  25.5k|        if (c == '\0')
  ------------------
  |  Branch (163:13): [True: 208, False: 25.3k]
  ------------------
  164|    208|            return 0;
  165|       |
  166|  25.3k|        if (n == 0)
  ------------------
  |  Branch (166:13): [True: 0, False: 25.3k]
  ------------------
  167|      0|            return 0;
  168|       |
  169|  25.3k|        ++s1;
  170|  25.3k|        ++s2;
  171|  25.3k|        --n;
  172|  25.3k|    }
  173|       |
  174|  14.8k|    if (n == 0)
  ------------------
  |  Branch (174:9): [True: 3.59k, False: 11.2k]
  ------------------
  175|  3.59k|        return 0;
  176|       |
  177|  11.2k|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (177:13): [True: 8.96k, False: 2.23k]
  ------------------
  178|  14.8k|}
prvTidytmbsubstrn:
  181|  1.45k|{
  182|  1.45k|    uint len2 = TY_(tmbstrlen)(s2);
  ------------------
  |  |   23|  1.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  183|  1.45k|    int ix, diff = len1 - len2;
  184|       |
  185|  8.51M|    for ( ix = 0; ix <= diff; ++ix )
  ------------------
  |  Branch (185:19): [True: 8.51M, False: 1.38k]
  ------------------
  186|  8.51M|    {
  187|  8.51M|        if ( TY_(tmbstrncmp)(s1+ix, s2, len2) == 0 )
  ------------------
  |  |   23|  8.51M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.51M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (187:14): [True: 71, False: 8.51M]
  ------------------
  188|     71|            return (ctmbstr) s1+ix;
  189|  8.51M|    }
  190|  1.38k|    return NULL;
  191|  1.45k|}
prvTidytmbsubstr:
  194|  1.25k|{
  195|  1.25k|    uint len1 = TY_(tmbstrlen)(s1), len2 = TY_(tmbstrlen)(s2);
  ------------------
  |  |   23|  1.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  uint len1 = TY_(tmbstrlen)(s1), len2 = TY_(tmbstrlen)(s2);
  ------------------
  |  |   23|  1.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  196|  1.25k|    int ix, diff = len1 - len2;
  197|       |
  198|  2.99k|    for ( ix = 0; ix <= diff; ++ix )
  ------------------
  |  Branch (198:19): [True: 2.01k, False: 980]
  ------------------
  199|  2.01k|    {
  200|  2.01k|        if ( TY_(tmbstrncasecmp)(s1+ix, s2, len2) == 0 )
  ------------------
  |  |   23|  2.01k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.01k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (200:14): [True: 277, False: 1.73k]
  ------------------
  201|    277|            return (ctmbstr) s1+ix;
  202|  2.01k|    }
  203|    980|    return NULL;
  204|  1.25k|}
prvTidytmbstrtolower:
  208|  89.7k|{
  209|  89.7k|    tmbstr cp;
  210|  2.97M|    for ( cp=s; *cp; ++cp )
  ------------------
  |  Branch (210:17): [True: 2.88M, False: 89.7k]
  ------------------
  211|  2.88M|        *cp = (tmbchar) TY_(ToLower)( *cp );
  ------------------
  |  |   23|  2.88M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.88M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  212|  89.7k|    return s;
  213|  89.7k|}
prvTidytmbstrtoupper:
  217|  1.18k|{
  218|  1.18k|    tmbstr cp;
  219|       |
  220|  9.44k|    for (cp = s; *cp; ++cp)
  ------------------
  |  Branch (220:18): [True: 8.26k, False: 1.18k]
  ------------------
  221|  8.26k|        *cp = (tmbchar)TY_(ToUpper)(*cp);
  ------------------
  |  |   23|  8.26k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.26k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  222|       |
  223|  1.18k|    return s;
  224|  1.18k|}
prvTidytmbvsnprintf:
  227|  76.9M|{
  228|  76.9M|    int retval;
  229|       |
  230|  76.9M|#if HAS_VSNPRINTF
  231|  76.9M|    retval = vsnprintf(buffer, count - 1, format, args);
  232|       |    /* todo: conditionally null-terminate the string? */
  233|  76.9M|    buffer[count - 1] = 0;
  234|       |#else
  235|       |    retval = vsprintf(buffer, format, args);
  236|       |#endif /* HAS_VSNPRINTF */
  237|  76.9M|    return retval;
  238|  76.9M|}
prvTidytmbsnprintf:
  241|  56.2M|{
  242|  56.2M|    int retval;
  243|  56.2M|    va_list args;
  244|  56.2M|    va_start(args, format);
  245|  56.2M|    retval = TY_(tmbvsnprintf)(buffer, count, format, args);
  ------------------
  |  |   23|  56.2M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  56.2M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  246|       |    va_end(args);
  247|  56.2M|    return retval;
  248|  56.2M|}
prvTidystrrep:
  251|  82.7M|{
  252|  82.7M|    char *p = strstr(buffer, str);
  253|  82.7M|    do
  254|  82.7M|    {
  255|  82.7M|        if(p)
  ------------------
  |  Branch (255:12): [True: 306k, False: 82.4M]
  ------------------
  256|   306k|        {
  257|   306k|            char buf[1024];
  258|   306k|            memset(buf,'\0',strlen(buf));
  259|       |
  260|   306k|            if(buffer == p)
  ------------------
  |  Branch (260:16): [True: 181k, False: 125k]
  ------------------
  261|   181k|            {
  262|   181k|                strcpy(buf,rep);
  263|   181k|                strcat(buf,p+strlen(str));
  264|   181k|            }
  265|   125k|            else
  266|   125k|            {
  267|   125k|                strncpy(buf,buffer,strlen(buffer) - strlen(p));
  268|   125k|                strcat(buf,rep);
  269|   125k|                strcat(buf,p+strlen(str));
  270|   125k|            }
  271|       |
  272|   306k|            memset(buffer,'\0',strlen(buffer));
  273|   306k|            strcpy(buffer,buf);
  274|   306k|        }
  275|       |
  276|  82.7M|    } while(p && (p = strstr(buffer, str)));
  ------------------
  |  Branch (276:13): [True: 306k, False: 82.4M]
  |  Branch (276:18): [True: 278, False: 306k]
  ------------------
  277|  82.7M|}

prvTidyDecodeUTF8BytesToChar:
  166|  80.5M|{
  167|  80.5M|    byte tempbuf[10];
  168|  80.5M|    byte *buf = &tempbuf[0];
  169|  80.5M|    uint ch = 0, n = 0;
  170|  80.5M|    int i, bytes = 0;
  171|  80.5M|    Bool hasError = no;
  172|       |    
  173|  80.5M|    if ( successorBytes )
  ------------------
  |  Branch (173:10): [True: 7.00M, False: 73.5M]
  ------------------
  174|  7.00M|        buf = (byte*) successorBytes;
  175|       |        
  176|       |    /* special check if we have been passed an EOF char */
  177|  80.5M|    if ( firstByte == EndOfStream )
  ------------------
  |  | 1064|  80.5M|#define EndOfStream (~0u)
  ------------------
  |  Branch (177:10): [True: 0, False: 80.5M]
  ------------------
  178|      0|    {
  179|       |        /* at present */
  180|      0|        *c = firstByte;
  181|      0|        *count = 1;
  182|      0|        return 0;
  183|      0|    }
  184|       |
  185|  80.5M|    ch = firstByte; /* first byte is passed in separately */
  186|       |    
  187|  80.5M|    if (ch <= 0x7F) /* 0XXX XXXX one byte */
  ------------------
  |  Branch (187:9): [True: 73.6M, False: 6.91M]
  ------------------
  188|  73.6M|    {
  189|  73.6M|        n = ch;
  190|  73.6M|        bytes = 1;
  191|  73.6M|    }
  192|  6.91M|    else if ((ch & 0xE0) == 0xC0)  /* 110X XXXX  two bytes */
  ------------------
  |  Branch (192:14): [True: 582k, False: 6.32M]
  ------------------
  193|   582k|    {
  194|   582k|        n = ch & 31;
  195|   582k|        bytes = 2;
  196|   582k|    }
  197|  6.32M|    else if ((ch & 0xF0) == 0xE0)  /* 1110 XXXX  three bytes */
  ------------------
  |  Branch (197:14): [True: 4.80M, False: 1.51M]
  ------------------
  198|  4.80M|    {
  199|  4.80M|        n = ch & 15;
  200|  4.80M|        bytes = 3;
  201|  4.80M|    }
  202|  1.51M|    else if ((ch & 0xF8) == 0xF0)  /* 1111 0XXX  four bytes */
  ------------------
  |  Branch (202:14): [True: 314k, False: 1.20M]
  ------------------
  203|   314k|    {
  204|   314k|        n = ch & 7;
  205|   314k|        bytes = 4;
  206|   314k|    }
  207|  1.20M|    else if ((ch & 0xFC) == 0xF8)  /* 1111 10XX  five bytes */
  ------------------
  |  Branch (207:14): [True: 35.4k, False: 1.16M]
  ------------------
  208|  35.4k|    {
  209|  35.4k|        n = ch & 3;
  210|  35.4k|        bytes = 5;
  211|  35.4k|        hasError = yes;
  212|  35.4k|    }
  213|  1.16M|    else if ((ch & 0xFE) == 0xFC)  /* 1111 110X  six bytes */
  ------------------
  |  Branch (213:14): [True: 12.4k, False: 1.15M]
  ------------------
  214|  12.4k|    {
  215|  12.4k|        n = ch & 1;
  216|  12.4k|        bytes = 6;
  217|  12.4k|        hasError = yes;
  218|  12.4k|    }
  219|  1.15M|    else
  220|  1.15M|    {
  221|       |        /* not a valid first byte of a UTF-8 sequence */
  222|  1.15M|        n = ch;
  223|  1.15M|        bytes = 1;
  224|  1.15M|        hasError = yes;
  225|  1.15M|    }
  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|  80.5M|    if ( successorBytes )
  ------------------
  |  Branch (232:10): [True: 7.00M, False: 73.5M]
  ------------------
  233|  7.00M|    {
  234|  16.5M|        for ( i=0; i < bytes-1; ++i )
  ------------------
  |  Branch (234:20): [True: 9.61M, False: 6.89M]
  ------------------
  235|  9.61M|        {
  236|  9.61M|            if ( !buf[i] || (buf[i] & 0xC0) != 0x80 )
  ------------------
  |  Branch (236:18): [True: 0, False: 9.61M]
  |  Branch (236:29): [True: 116k, False: 9.50M]
  ------------------
  237|   116k|            {
  238|   116k|                hasError = yes;
  239|   116k|                bytes = i+1;
  240|   116k|                break;
  241|   116k|            }
  242|  9.50M|            n = (n << 6) | (buf[i] & 0x3F);
  243|  9.50M|        }
  244|  7.00M|    }
  245|  73.5M|    else if ( inp )
  ------------------
  |  Branch (245:15): [True: 73.5M, False: 0]
  ------------------
  246|  73.5M|    {
  247|  74.1M|        for ( i=0; i < bytes-1 && !inp->eof(inp->sourceData); ++i )
  ------------------
  |  Branch (247:20): [True: 1.21M, False: 72.9M]
  |  Branch (247:35): [True: 1.21M, False: 624]
  ------------------
  248|  1.21M|        {
  249|  1.21M|            int b = inp->getByte( inp->sourceData );
  250|  1.21M|            buf[i] = (tmbchar) b;
  251|       |
  252|       |            /* End of data or illegal successor byte value */
  253|  1.21M|            if ( b == EOF || (buf[i] & 0xC0) != 0x80 )
  ------------------
  |  Branch (253:18): [True: 0, False: 1.21M]
  |  Branch (253:30): [True: 623k, False: 592k]
  ------------------
  254|   623k|            {
  255|   623k|                hasError = yes;
  256|   623k|                bytes = i+1;
  257|   623k|                if ( b != EOF )
  ------------------
  |  Branch (257:22): [True: 623k, False: 0]
  ------------------
  258|   623k|                    inp->ungetByte( inp->sourceData, buf[i] );
  259|   623k|                break;
  260|   623k|            }
  261|   592k|            n = (n << 6) | (buf[i] & 0x3F);
  262|   592k|        }
  263|  73.5M|    }
  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|  80.5M|    if (!hasError && ((n == kUTF8ByteSwapNotAChar) || (n == kUTF8NotAChar)))
  ------------------
  |  |  121|  78.6M|#define kUTF8ByteSwapNotAChar    0xFFFE
  ------------------
                  if (!hasError && ((n == kUTF8ByteSwapNotAChar) || (n == kUTF8NotAChar)))
  ------------------
  |  |  122|  78.6M|#define kUTF8NotAChar            0xFFFF
  ------------------
  |  Branch (270:9): [True: 78.6M, False: 1.89M]
  |  Branch (270:23): [True: 202, False: 78.6M]
  |  Branch (270:55): [True: 277, False: 78.6M]
  ------------------
  271|    479|        hasError = yes;
  272|       |        
  273|  80.5M|    if (!hasError && (n > kMaxUTF8FromUCS4))
  ------------------
  |  |  124|  78.6M|#define kMaxUTF8FromUCS4         0x10FFFF
  ------------------
  |  Branch (273:9): [True: 78.6M, False: 1.89M]
  |  Branch (273:22): [True: 359, False: 78.6M]
  ------------------
  274|    359|        hasError = yes;
  275|       |
  276|  80.5M|    if (!hasError)
  ------------------
  |  Branch (276:9): [True: 78.6M, False: 1.89M]
  ------------------
  277|  78.6M|    {
  278|  78.6M|        int lo, hi;
  279|       |        
  280|  78.6M|        lo = offsetUTF8Sequences[bytes - 1];
  281|  78.6M|        hi = offsetUTF8Sequences[bytes] - 1;
  282|       |        
  283|       |        /* check for overlong sequences */
  284|  78.6M|        if ((n < validUTF8[lo].lowChar) || (n > validUTF8[hi].highChar))
  ------------------
  |  Branch (284:13): [True: 4.11k, False: 78.6M]
  |  Branch (284:44): [True: 0, False: 78.6M]
  ------------------
  285|  4.11k|            hasError = yes;
  286|  78.6M|        else
  287|  78.6M|        {
  288|  78.6M|            hasError = yes; /* assume error until proven otherwise */
  289|       |        
  290|   162M|            for (i = lo; i <= hi; i++)
  ------------------
  |  Branch (290:26): [True: 83.6M, False: 78.6M]
  ------------------
  291|  83.6M|            {
  292|  83.6M|                int tempCount;
  293|  83.6M|                byte theByte;
  294|       |                
  295|   174M|                for (tempCount = 0; tempCount < bytes; tempCount++)
  ------------------
  |  Branch (295:37): [True: 94.9M, False: 79.2M]
  ------------------
  296|  94.9M|                {
  297|  94.9M|                    if (!tempCount)
  ------------------
  |  Branch (297:25): [True: 83.6M, False: 11.3M]
  ------------------
  298|  83.6M|                        theByte = (tmbchar) firstByte;
  299|  11.3M|                    else
  300|  11.3M|                        theByte = buf[tempCount - 1];
  301|       |                        
  302|  94.9M|                    if ( theByte >= validUTF8[i].validBytes[(tempCount * 2)] &&
  ------------------
  |  Branch (302:26): [True: 94.3M, False: 601k]
  ------------------
  303|  94.3M|                         theByte <= validUTF8[i].validBytes[(tempCount * 2) + 1] )
  ------------------
  |  Branch (303:26): [True: 89.8M, False: 4.56M]
  ------------------
  304|  89.8M|                        hasError = no;
  305|  94.9M|                    if (hasError)
  ------------------
  |  Branch (305:25): [True: 4.36M, False: 90.6M]
  ------------------
  306|  4.36M|                        break;
  307|  94.9M|                }
  308|  83.6M|            }
  309|  78.6M|        }
  310|  78.6M|    }
  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|  80.5M|    *count = bytes;
  325|  80.5M|    *c = n;
  326|  80.5M|    if ( hasError )
  ------------------
  |  Branch (326:10): [True: 1.90M, False: 78.6M]
  ------------------
  327|  1.90M|        return -1;
  328|  78.6M|    return 0;
  329|  80.5M|}
prvTidyEncodeCharToUTF8Bytes:
  333|   645M|{
  334|   645M|    byte tempbuf[10] = {0};
  335|   645M|    byte* buf = &tempbuf[0];
  336|   645M|    int bytes = 0;
  337|   645M|    Bool hasError = no;
  338|       |    
  339|   645M|    if ( encodebuf )
  ------------------
  |  Branch (339:10): [True: 320M, False: 325M]
  ------------------
  340|   320M|        buf = (byte*) encodebuf;
  341|       |        
  342|   645M|    if (c <= 0x7F)  /* 0XXX XXXX one byte */
  ------------------
  |  Branch (342:9): [True: 640M, False: 5.31M]
  ------------------
  343|   640M|    {
  344|   640M|        buf[0] = (tmbchar) c;
  345|   640M|        bytes = 1;
  346|   640M|    }
  347|  5.31M|    else if (c <= 0x7FF)  /* 110X XXXX  two bytes */
  ------------------
  |  Branch (347:14): [True: 182k, False: 5.13M]
  ------------------
  348|   182k|    {
  349|   182k|        buf[0] = (tmbchar) ( 0xC0 | (c >> 6) );
  350|   182k|        buf[1] = (tmbchar) ( 0x80 | (c & 0x3F) );
  351|   182k|        bytes = 2;
  352|   182k|    }
  353|  5.13M|    else if (c <= 0xFFFF)  /* 1110 XXXX  three bytes */
  ------------------
  |  Branch (353:14): [True: 4.93M, False: 199k]
  ------------------
  354|  4.93M|    {
  355|  4.93M|        buf[0] = (tmbchar) (0xE0 | (c >> 12));
  356|  4.93M|        buf[1] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  357|  4.93M|        buf[2] = (tmbchar) (0x80 | (c & 0x3F));
  358|  4.93M|        bytes = 3;
  359|  4.93M|        if ( c == kUTF8ByteSwapNotAChar || c == kUTF8NotAChar )
  ------------------
  |  |  121|  9.86M|#define kUTF8ByteSwapNotAChar    0xFFFE
  ------------------
                      if ( c == kUTF8ByteSwapNotAChar || c == kUTF8NotAChar )
  ------------------
  |  |  122|  4.93M|#define kUTF8NotAChar            0xFFFF
  ------------------
  |  Branch (359:14): [True: 212, False: 4.93M]
  |  Branch (359:44): [True: 608, False: 4.93M]
  ------------------
  360|    820|            hasError = yes;
  361|  4.93M|    }
  362|   199k|    else if (c <= 0x1FFFFF)  /* 1111 0XXX  four bytes */
  ------------------
  |  Branch (362:14): [True: 174k, False: 24.1k]
  ------------------
  363|   174k|    {
  364|   174k|        buf[0] = (tmbchar) (0xF0 | (c >> 18));
  365|   174k|        buf[1] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  366|   174k|        buf[2] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  367|   174k|        buf[3] = (tmbchar) (0x80 | (c & 0x3F));
  368|   174k|        bytes = 4;
  369|   174k|        if (c > kMaxUTF8FromUCS4)
  ------------------
  |  |  124|   174k|#define kMaxUTF8FromUCS4         0x10FFFF
  ------------------
  |  Branch (369:13): [True: 200, False: 174k]
  ------------------
  370|    200|            hasError = yes;
  371|   174k|    }
  372|  24.1k|    else if (c <= 0x3FFFFFF)  /* 1111 10XX  five bytes */
  ------------------
  |  Branch (372:14): [True: 1.80k, False: 22.3k]
  ------------------
  373|  1.80k|    {
  374|  1.80k|        buf[0] = (tmbchar) (0xF8 | (c >> 24));
  375|  1.80k|        buf[1] = (tmbchar) (0x80 | (c >> 18));
  376|  1.80k|        buf[2] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  377|  1.80k|        buf[3] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  378|  1.80k|        buf[4] = (tmbchar) (0x80 | (c & 0x3F));
  379|  1.80k|        bytes = 5;
  380|  1.80k|        hasError = yes;
  381|  1.80k|    }
  382|  22.3k|    else if (c <= 0x7FFFFFFF)  /* 1111 110X  six bytes */
  ------------------
  |  Branch (382:14): [True: 382, False: 21.9k]
  ------------------
  383|    382|    {
  384|    382|        buf[0] = (tmbchar) (0xFC | (c >> 30));
  385|    382|        buf[1] = (tmbchar) (0x80 | ((c >> 24) & 0x3F));
  386|    382|        buf[2] = (tmbchar) (0x80 | ((c >> 18) & 0x3F));
  387|    382|        buf[3] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  388|    382|        buf[4] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  389|    382|        buf[5] = (tmbchar) (0x80 | (c & 0x3F));
  390|    382|        bytes = 6;
  391|    382|        hasError = yes;
  392|    382|    }
  393|  21.9k|    else
  394|  21.9k|        hasError = yes;
  395|       |        
  396|       |    /* don't output invalid UTF-8 byte sequence to a stream */
  397|   645M|    if ( !hasError && outp != NULL )
  ------------------
  |  Branch (397:10): [True: 645M, False: 25.1k]
  |  Branch (397:23): [True: 325M, False: 320M]
  ------------------
  398|   325M|    {
  399|   325M|        int ix;
  400|   656M|        for ( ix=0; ix < bytes; ++ix )
  ------------------
  |  Branch (400:21): [True: 331M, False: 325M]
  ------------------
  401|   331M|          outp->putByte( outp->sinkData, buf[ix] );
  402|   325M|    }
  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|   645M|    *count = bytes;
  416|   645M|    if (hasError)
  ------------------
  |  Branch (416:9): [True: 25.1k, False: 645M]
  ------------------
  417|  25.1k|        return -1;
  418|   645M|    return 0;
  419|   645M|}
prvTidyGetUTF8:
  426|  7.00M|{
  427|  7.00M|    uint n;
  428|  7.00M|    int bytes;
  429|       |
  430|  7.00M|    int err;
  431|       |    
  432|  7.00M|    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|  7.00M|    err = TY_(DecodeUTF8BytesToChar)( &n, str[0], str+1, NULL, &bytes );
  ------------------
  |  |   23|  7.00M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.00M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  437|  7.00M|    if (err)
  ------------------
  |  Branch (437:9): [True: 127k, False: 6.88M]
  ------------------
  438|   127k|    {
  439|       |#if 1 && defined(_DEBUG)
  440|       |        fprintf(stderr, "pprint UTF-8 decoding error for U+%x : ", n);
  441|       |#endif
  442|   127k|        n = 0xFFFD; /* replacement char */
  443|   127k|    }
  444|       |
  445|  7.00M|    *ch = n;
  446|  7.00M|    return bytes - 1;
  447|  7.00M|}
prvTidyPutUTF8:
  451|  8.01M|{
  452|  8.01M|    int err, count = 0;
  453|       |        
  454|  8.01M|    err = TY_(EncodeCharToUTF8Bytes)( c, buf, NULL, &count );
  ------------------
  |  |   23|  8.01M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.01M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  455|  8.01M|    if (err)
  ------------------
  |  Branch (455:9): [True: 0, False: 8.01M]
  ------------------
  456|      0|    {
  457|       |#if 1 && defined(_DEBUG)
  458|       |        fprintf(stderr, "pprint UTF-8 encoding error for U+%x : ", c);
  459|       |#endif
  460|       |        /* replacement char 0xFFFD encoded as UTF-8 */
  461|      0|        buf[0] = (byte) 0xEF;
  462|      0|        buf[1] = (byte) 0xBF;
  463|      0|        buf[2] = (byte) 0xBD;
  464|      0|        count = 3;
  465|      0|    }
  466|       |    
  467|  8.01M|    buf += count;
  468|  8.01M|    return buf;
  469|  8.01M|}
prvTidyIsValidUTF16FromUCS4:
  472|   398k|{
  473|   398k|  return ( ucs4 <= kMaxUTF16FromUCS4 );
  ------------------
  |  |  127|   398k|#define kMaxUTF16FromUCS4        0x10FFFF
  ------------------
  474|   398k|}
prvTidyIsHighSurrogate:
  477|  25.6k|{
  478|  25.6k|    return ( ch >= kUTF16HighSurrogateBegin && ch <= kUTF16HighSurrogateEnd );
  ------------------
  |  |  132|  51.3k|#define kUTF16HighSurrogateBegin 0xDC00
  ------------------
                  return ( ch >= kUTF16HighSurrogateBegin && ch <= kUTF16HighSurrogateEnd );
  ------------------
  |  |  133|  7.14k|#define kUTF16HighSurrogateEnd   0xDFFF
  ------------------
  |  Branch (478:14): [True: 7.14k, False: 18.5k]
  |  Branch (478:48): [True: 2.77k, False: 4.37k]
  ------------------
  479|  25.6k|}
prvTidyIsLowSurrogate:
  481|   454k|{
  482|   454k|    return ( ch >= kUTF16LowSurrogateBegin && ch <= kUTF16LowSurrogateEnd );
  ------------------
  |  |  130|   909k|#define kUTF16LowSurrogateBegin  0xD800
  ------------------
                  return ( ch >= kUTF16LowSurrogateBegin && ch <= kUTF16LowSurrogateEnd );
  ------------------
  |  |  131|   108k|#define kUTF16LowSurrogateEnd    0xDBFF
  ------------------
  |  Branch (482:14): [True: 108k, False: 345k]
  |  Branch (482:47): [True: 46.3k, False: 62.4k]
  ------------------
  483|   454k|}
prvTidyCombineSurrogatePair:
  486|  1.16k|{
  487|  1.16k|    assert( TY_(IsHighSurrogate)(high) && TY_(IsLowSurrogate)(low) );
  ------------------
  |  Branch (487:5): [True: 0, False: 1.16k]
  |  Branch (487:5): [True: 0, False: 0]
  |  Branch (487:5): [True: 1.16k, False: 0]
  |  Branch (487:5): [True: 1.16k, False: 0]
  ------------------
  488|  1.16k|    return ( ((low - kUTF16LowSurrogateBegin) * 0x400) + 
  ------------------
  |  |  130|  1.16k|#define kUTF16LowSurrogateBegin  0xD800
  ------------------
  489|  1.16k|             high - kUTF16HighSurrogateBegin + 0x10000 );
  ------------------
  |  |  132|  1.16k|#define kUTF16HighSurrogateBegin 0xDC00
  ------------------
  490|  1.16k|}
prvTidyIsValidCombinedChar:
  504|  1.16k|{
  505|  1.16k|    return ( ch >= kUTF16SurrogatesBegin &&
  ------------------
  |  |  126|  2.32k|#define kUTF16SurrogatesBegin    0x10000
  ------------------
  |  Branch (505:14): [True: 1.16k, False: 0]
  ------------------
  506|  1.16k|             (ch & 0x0000FFFE) != 0x0000FFFE &&
  ------------------
  |  Branch (506:14): [True: 555, False: 605]
  ------------------
  507|    555|             (ch & 0x0000FFFF) != 0x0000FFFF );
  ------------------
  |  Branch (507:14): [True: 555, False: 0]
  ------------------
  508|  1.16k|}

TidyXhtml:
   25|  20.2k|int TidyXhtml(const uint8_t* data, size_t size, TidyBuffer* output, TidyBuffer* errbuf) {
   26|  20.2k|  Bool ok;
   27|       |
   28|  20.2k|  TidyDoc tdoc = tidyCreate();
   29|       |
   30|  20.2k|  ok = tidyOptSetBool( tdoc, TidyXhtmlOut, yes );
   31|  20.2k|  tidySetErrorBuffer(tdoc, errbuf);
   32|       |
   33|  20.2k|  char filename[256];
   34|  20.2k|  sprintf(filename, "/tmp/libfuzzer.%d", getpid());
   35|       |
   36|  20.2k|  FILE *fp = fopen(filename, "wb");
   37|  20.2k|  if (!fp) {
  ------------------
  |  Branch (37:7): [True: 0, False: 20.2k]
  ------------------
   38|      0|    tidyRelease( tdoc );
   39|      0|    return 0;
   40|      0|  }
   41|  20.2k|  fwrite(data, size, 1, fp);
   42|  20.2k|  fclose(fp);
   43|       |
   44|  20.2k|  tidyParseFile(tdoc, filename);
   45|  20.2k|  tidyCleanAndRepair(tdoc);
   46|  20.2k|  tidyRunDiagnostics(tdoc);
   47|  20.2k|  tidyOptSetBool(tdoc, TidyForceOutput, yes);
   48|  20.2k|  tidySaveBuffer(tdoc, output);
   49|       |
   50|  20.2k|  tidyRelease( tdoc );
   51|  20.2k|  unlink(filename);
   52|       |
   53|  20.2k|  return 0;
   54|  20.2k|}
LLVMFuzzerTestOneInput:
   56|  20.2k|int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   57|  20.2k|  TidyBuffer fuzz_toutput;
   58|  20.2k|  TidyBuffer fuzz_terror;
   59|       |
   60|  20.2k|  tidyBufInit(&fuzz_toutput);
   61|  20.2k|  tidyBufInit(&fuzz_terror);
   62|       |
   63|  20.2k|  TidyXhtml(data, size, &fuzz_toutput, &fuzz_terror);
   64|       |
   65|  20.2k|  tidyBufFree(&fuzz_toutput);
   66|  20.2k|  tidyBufFree(&fuzz_terror);
   67|  20.2k|  return 0;
   68|  20.2k|}

