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

prvTidyNodeAttributeVersions:
  503|  36.2k|{
  504|  36.2k|    uint i;
  505|       |
  506|  36.2k|    if (!node || !node->tag || !node->tag->attrvers)
  ------------------
  |  Branch (506:9): [True: 0, False: 36.2k]
  |  Branch (506:18): [True: 0, False: 36.2k]
  |  Branch (506:32): [True: 433, False: 35.7k]
  ------------------
  507|    433|        return VERS_UNKNOWN;
  ------------------
  |  |  204|    433|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|    433|#define xxxx                   0u
  |  |  ------------------
  ------------------
  508|       |
  509|  1.61M|    for (i = 0; node->tag->attrvers[i].attribute; ++i)
  ------------------
  |  Branch (509:17): [True: 1.61M, False: 0]
  ------------------
  510|  1.61M|        if (node->tag->attrvers[i].attribute == id)
  ------------------
  |  Branch (510:13): [True: 35.7k, False: 1.57M]
  ------------------
  511|  35.7k|            return node->tag->attrvers[i].versions;
  512|       |
  513|      0|    return VERS_UNKNOWN;
  ------------------
  |  |  204|      0|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|      0|#define xxxx                   0u
  |  |  ------------------
  ------------------
  514|  35.7k|}
prvTidyAttributeIsProprietary:
  522|   472k|{
  523|   472k|    if (!node || !attval)
  ------------------
  |  Branch (523:9): [True: 0, False: 472k]
  |  Branch (523:18): [True: 0, False: 472k]
  ------------------
  524|      0|        return no;
  525|       |
  526|   472k|    if (!node->tag)
  ------------------
  |  Branch (526:9): [True: 2.39k, False: 470k]
  ------------------
  527|  2.39k|        return no;
  528|       |
  529|   470k|    if (!(node->tag->versions & VERS_ALL))
  ------------------
  |  |  228|   470k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|   470k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|   470k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|   470k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|   470k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|   470k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|   470k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|   470k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|   470k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|   470k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|   470k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|   470k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|   470k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|   470k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|   470k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|   470k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|   470k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|   470k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|   470k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|   470k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|   470k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|   470k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|   470k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|   470k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|   470k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|   470k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|   470k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|   470k|#define HT50              131072u
  |  |  ------------------
  ------------------
  |  Branch (529:9): [True: 1.38k, False: 468k]
  ------------------
  530|  1.38k|        return no;
  531|       |
  532|   468k|    if (AttributeVersions(node, attval) & VERS_ALL)
  ------------------
  |  |  228|   468k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|   468k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|   468k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|   468k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|   468k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|   468k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|   468k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|   468k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|   468k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|   468k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|   468k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|   468k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|   468k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|   468k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|   468k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|   468k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|   468k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|   468k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|   468k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|   468k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|   468k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|   468k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|   468k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|   468k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|   468k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|   468k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|   468k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|   468k|#define HT50              131072u
  |  |  ------------------
  ------------------
  |  Branch (532:9): [True: 223k, False: 245k]
  ------------------
  533|   223k|        return no;
  534|       |
  535|   245k|    return yes;
  536|   468k|}
prvTidyAttributeIsMismatched:
  545|  8.41k|{
  546|  8.41k|    uint doctype;
  547|       |    
  548|  8.41k|    if (!node || !attval)
  ------------------
  |  Branch (548:9): [True: 0, False: 8.41k]
  |  Branch (548:18): [True: 0, False: 8.41k]
  ------------------
  549|      0|        return no;
  550|       |    
  551|  8.41k|    if (!node->tag)
  ------------------
  |  Branch (551:9): [True: 478, False: 7.93k]
  ------------------
  552|    478|        return no;
  553|       |    
  554|  7.93k|    if (!(node->tag->versions & VERS_ALL))
  ------------------
  |  |  228|  7.93k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|  7.93k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|  7.93k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|  7.93k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  7.93k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|  7.93k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|  7.93k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|  7.93k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|  7.93k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|  7.93k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|  7.93k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|  7.93k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|  7.93k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  7.93k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|  7.93k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|  7.93k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|  7.93k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|  7.93k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|  7.93k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|  7.93k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|  7.93k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|  7.93k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|  7.93k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|  7.93k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|  7.93k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|  7.93k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|  7.93k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|  7.93k|#define HT50              131072u
  |  |  ------------------
  ------------------
  |  Branch (554:9): [True: 225, False: 7.71k]
  ------------------
  555|    225|        return no;
  556|       |
  557|  7.71k|    doctype = doc->lexer->versionEmitted == 0 ? doc->lexer->doctype : doc->lexer->versionEmitted;
  ------------------
  |  Branch (557:15): [True: 0, False: 7.71k]
  ------------------
  558|       |
  559|  7.71k|    if (AttributeVersions(node, attval) & doctype)
  ------------------
  |  Branch (559:9): [True: 3.99k, False: 3.72k]
  ------------------
  560|  3.99k|        return no;
  561|       |    
  562|  3.72k|    return yes;
  563|  7.71k|}
prvTidyAttrGetById:
  857|  6.81M|{
  858|  6.81M|   AttVal* av;
  859|  7.87M|   for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (859:33): [True: 1.16M, False: 6.71M]
  ------------------
  860|  1.16M|   {
  861|  1.16M|     if ( AttrIsId(av, id) )
  ------------------
  |  |  169|  1.16M|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  ------------------
  |  |  |  Branch (169:29): [True: 1.16M, False: 0]
  |  |  |  Branch (169:37): [True: 743k, False: 421k]
  |  |  |  Branch (169:51): [True: 106k, False: 636k]
  |  |  ------------------
  ------------------
  862|   106k|         return av;
  863|  1.16M|   }
  864|  6.71M|   return NULL;
  865|  6.81M|}
prvTidyFindAttribute:
  869|   518k|{
  870|   518k|    if ( attval )
  ------------------
  |  Branch (870:10): [True: 518k, False: 0]
  ------------------
  871|   518k|       return attrsLookup( doc, &doc->attribs, attval->attribute );
  872|      0|    return NULL;
  873|   518k|}
prvTidyGetAttrByName:
  876|   182k|{
  877|   182k|    AttVal *attr;
  878|   266k|    for (attr = node->attributes; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (878:35): [True: 107k, False: 159k]
  ------------------
  879|   107k|    {
  880|   107k|        if (attr->attribute && TY_(tmbstrcmp)(attr->attribute, name) == 0)
  ------------------
  |  |   23|   105k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   105k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (880:13): [True: 105k, False: 2.27k]
  |  Branch (880:32): [True: 23.6k, False: 81.4k]
  ------------------
  881|  23.6k|            break;
  882|   107k|    }
  883|   182k|    return attr;
  884|   182k|}
prvTidyAddAttribute:
  909|   114k|{
  910|   114k|    AttVal *av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|   114k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   114k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  911|   114k|    av->delim = '"';
  912|   114k|    av->attribute = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|   114k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   114k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  913|       |
  914|   114k|    if (value)
  ------------------
  |  Branch (914:9): [True: 83.1k, False: 31.1k]
  ------------------
  915|  83.1k|        av->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|  83.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  83.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  916|  31.1k|    else
  917|  31.1k|        av->value = NULL;
  918|       |
  919|   114k|    av->dict = attrsLookup(doc, &doc->attribs, name);
  920|       |
  921|   114k|    TY_(InsertAttributeAtEnd)(node, av);
  ------------------
  |  |   23|   114k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   114k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  922|   114k|    return av;
  923|   114k|}
prvTidyRepairAttrValue:
  926|  53.8k|{
  927|  53.8k|    AttVal* old = TY_(GetAttrByName)(node, name);
  ------------------
  |  |   23|  53.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  53.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  928|       |
  929|  53.8k|    if (old)
  ------------------
  |  Branch (929:9): [True: 83, False: 53.7k]
  ------------------
  930|     83|    {
  931|     83|        if (old->value)
  ------------------
  |  Branch (931:13): [True: 78, False: 5]
  ------------------
  932|     83|            TidyDocFree(doc, old->value);
  ------------------
  |  |  159|     78|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     78|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  933|     83|        if (value)
  ------------------
  |  Branch (933:13): [True: 83, False: 0]
  ------------------
  934|     83|            old->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|     83|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     83|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  935|      0|        else
  936|      0|            old->value = NULL;
  937|       |
  938|     83|        return old;
  939|     83|    }
  940|  53.7k|    else
  941|  53.7k|        return TY_(AddAttribute)(doc, node, name, value);
  ------------------
  |  |   23|  53.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  53.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  942|  53.8k|}
prvTidyFreeAttrPriorityList:
  946|  21.3k|{
  947|  21.3k|    PriorityAttribs *priorities = &(doc->attribs.priorityAttribs);
  948|       |
  949|  21.3k|    if ( priorities->list )
  ------------------
  |  Branch (949:10): [True: 0, False: 21.3k]
  ------------------
  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|  21.3k|}
prvTidyIsUrl:
 1024|  16.4k|{
 1025|  16.4k|    return CheckAttrType( doc, attrname, CH_URL );
  ------------------
  |  |   64|  16.4k|#define CH_URL         TY_(CheckUrl)
  |  |  ------------------
  |  |  |  |   23|  16.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  16.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1026|  16.4k|}
prvTidyIsScript:
 1036|    937|{
 1037|    937|    return CheckAttrType( doc, attrname, CH_SCRIPT );
  ------------------
  |  |   65|    937|#define CH_SCRIPT      CheckScript
  ------------------
 1038|    937|}
prvTidyIsAnchorElement:
 1042|  2.76M|{
 1043|  2.76M|    TidyTagId tid = TagId( node );
  ------------------
  |  |  270|  2.76M|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 2.76M, False: 0]
  |  |  |  Branch (270:39): [True: 2.27M, False: 492k]
  |  |  ------------------
  ------------------
 1044|  2.76M|    if ( tid == TidyTag_A      ||
  ------------------
  |  Branch (1044:10): [True: 54.7k, False: 2.71M]
  ------------------
 1045|  2.71M|         tid == TidyTag_APPLET ||
  ------------------
  |  Branch (1045:10): [True: 1.26k, False: 2.71M]
  ------------------
 1046|  2.71M|         tid == TidyTag_FORM   ||
  ------------------
  |  Branch (1046:10): [True: 8.33k, False: 2.70M]
  ------------------
 1047|  2.70M|         tid == TidyTag_FRAME  ||
  ------------------
  |  Branch (1047:10): [True: 2.99k, False: 2.70M]
  ------------------
 1048|  2.70M|         tid == TidyTag_IFRAME ||
  ------------------
  |  Branch (1048:10): [True: 1.22k, False: 2.69M]
  ------------------
 1049|  2.69M|         tid == TidyTag_IMG    ||
  ------------------
  |  Branch (1049:10): [True: 3.20k, False: 2.69M]
  ------------------
 1050|  2.69M|         tid == TidyTag_MAP )
  ------------------
  |  Branch (1050:10): [True: 159k, False: 2.53M]
  ------------------
 1051|   231k|        return yes;
 1052|       |
 1053|  2.53M|    return no;
 1054|  2.76M|}
prvTidyRemoveAnchorByNode:
 1153|  11.7k|{
 1154|  11.7k|    TidyAttribImpl* attribs = &doc->attribs;
 1155|  11.7k|    Anchor *delme = NULL, *curr, *prev = NULL;
 1156|  11.7k|    uint h;
 1157|  11.7k|    if (TY_(HTMLVersion)(doc) == HT50)
  ------------------
  |  |   23|  11.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (TY_(HTMLVersion)(doc) == HT50)
  ------------------
  |  |  200|  11.7k|#define HT50              131072u
  ------------------
  |  Branch (1157:9): [True: 0, False: 11.7k]
  ------------------
 1158|      0|        h = anchorNameHash5(name);
 1159|  11.7k|    else
 1160|  11.7k|        h = anchorNameHash(name);
 1161|       |
 1162|  21.6k|    for ( curr=attribs->anchor_hash[h]; curr!=NULL; curr=curr->next )
  ------------------
  |  Branch (1162:41): [True: 10.9k, False: 10.6k]
  ------------------
 1163|  10.9k|    {
 1164|  10.9k|        if ( curr->node == node )
  ------------------
  |  Branch (1164:14): [True: 1.09k, False: 9.82k]
  ------------------
 1165|  1.09k|        {
 1166|  1.09k|            if ( prev )
  ------------------
  |  Branch (1166:18): [True: 206, False: 885]
  ------------------
 1167|    206|                prev->next = curr->next;
 1168|    885|            else
 1169|    885|                attribs->anchor_hash[h] = curr->next;
 1170|  1.09k|            delme = curr;
 1171|  1.09k|            break;
 1172|  1.09k|        }
 1173|  9.82k|        prev = curr;
 1174|  9.82k|    }
 1175|  11.7k|    FreeAnchor( doc, delme );
 1176|  11.7k|}
prvTidyFreeAnchors:
 1256|  42.6k|{
 1257|  42.6k|    TidyAttribImpl* attribs = &doc->attribs;
 1258|  42.6k|    Anchor* a;
 1259|  42.6k|    uint h;
 1260|  43.5M|    for (h = 0; h < ANCHOR_HASH_SIZE; h++) {
  ------------------
  |  Branch (1260:17): [True: 43.5M, False: 42.6k]
  ------------------
 1261|  43.5M|        while (NULL != (a = attribs->anchor_hash[h]) )
  ------------------
  |  Branch (1261:16): [True: 40.4k, False: 43.5M]
  ------------------
 1262|  40.4k|        {
 1263|  40.4k|            attribs->anchor_hash[h] = a->next;
 1264|  40.4k|            FreeAnchor(doc, a);
 1265|  40.4k|        }
 1266|  43.5M|    }
 1267|  42.6k|}
prvTidyInitAttrs:
 1271|  21.3k|{
 1272|  21.3k|    TidyClearMemory( &doc->attribs, sizeof(TidyAttribImpl) );
  ------------------
  |  |   70|  21.3k|#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|  21.3k|}
prvTidyFreeAttrTable:
 1301|  21.3k|{
 1302|  21.3k|    attrsEmptyHash( doc, &doc->attribs );
 1303|  21.3k|    TY_(FreeAnchors)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1304|  21.3k|    FreeDeclaredAttributes( doc );
 1305|  21.3k|}
prvTidyRepairDuplicateAttributes:
 1388|   901k|{
 1389|   901k|    AttVal *first;
 1390|       |
 1391|  1.00M|    for (first = node->attributes; first != NULL;)
  ------------------
  |  Branch (1391:36): [True: 107k, False: 901k]
  ------------------
 1392|   107k|    {
 1393|   107k|        AttVal *second;
 1394|   107k|        Bool firstRedefined = no;
 1395|       |
 1396|   107k|        if (!(first->asp == NULL && first->php == NULL))
  ------------------
  |  Branch (1396:15): [True: 106k, False: 982]
  |  Branch (1396:37): [True: 102k, False: 4.17k]
  ------------------
 1397|  5.15k|        {
 1398|  5.15k|            first = first->next;
 1399|  5.15k|            continue;
 1400|  5.15k|        }
 1401|       |
 1402|   144k|        for (second = first->next; second != NULL;)
  ------------------
  |  Branch (1402:36): [True: 41.8k, False: 102k]
  ------------------
 1403|  41.8k|        {
 1404|  41.8k|            AttVal *temp;
 1405|       |
 1406|  41.8k|            if (!(second->asp == NULL && second->php == NULL
  ------------------
  |  Branch (1406:19): [True: 41.3k, False: 518]
  |  Branch (1406:42): [True: 40.6k, False: 651]
  ------------------
 1407|  40.6k|                  && AttrsHaveSameName(first, second)))
  ------------------
  |  Branch (1407:22): [True: 6.19k, False: 34.4k]
  ------------------
 1408|  35.6k|            {
 1409|  35.6k|                second = second->next;
 1410|  35.6k|                continue;
 1411|  35.6k|            }
 1412|       |
 1413|       |            /* first and second attribute have same local name */
 1414|       |            /* now determine what to do with this duplicate... */
 1415|       |
 1416|  6.19k|            if (!isXml
  ------------------
  |  Branch (1416:17): [True: 6.19k, False: 0]
  ------------------
 1417|  6.19k|                && attrIsCLASS(first) && cfgBool(doc, TidyJoinClasses)
  ------------------
  |  |  206|  6.19k|#define attrIsCLASS(av)             AttrIsId( av, TidyAttr_CLASS  )
  |  |  ------------------
  |  |  |  |  169|  12.3k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 6.19k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.96k, False: 2.23k]
  |  |  |  |  |  Branch (169:51): [True: 194, False: 3.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              && attrIsCLASS(first) && cfgBool(doc, TidyJoinClasses)
  ------------------
  |  |  418|  6.39k|#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|  6.19k|#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|  6.19k|            else if (!isXml
  ------------------
  |  Branch (1429:22): [True: 6.19k, False: 0]
  ------------------
 1430|  6.19k|                     && attrIsSTYLE(first) && cfgBool(doc, TidyJoinStyles)
  ------------------
  |  |  323|  6.19k|#define attrIsSTYLE(av)             AttrIsId( av, TidyAttr_STYLE  )
  |  |  ------------------
  |  |  |  |  169|  12.3k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 6.19k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.96k, False: 2.23k]
  |  |  |  |  |  Branch (169:51): [True: 1.67k, False: 2.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                   && attrIsSTYLE(first) && cfgBool(doc, TidyJoinStyles)
  ------------------
  |  |  418|  7.87k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.67k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 1.67k, False: 0]
  |  |  ------------------
  ------------------
 1431|  1.67k|                     && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|  7.87k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.67k, False: 0]
  |  |  |  Branch (171:44): [True: 1.47k, False: 198]
  |  |  ------------------
  ------------------
                                   && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|  1.47k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.47k, False: 0]
  |  |  |  Branch (171:44): [True: 1.24k, False: 226]
  |  |  ------------------
  ------------------
 1432|  1.24k|            {
 1433|  1.24k|                AppendToStyleAttr( doc, first, second->value );
 1434|       |
 1435|  1.24k|                temp = second->next;
 1436|  1.24k|                TY_(ReportAttrError)( doc, node, second, JOINING_ATTRIBUTE);
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1437|  1.24k|                TY_(RemoveAttribute)( doc, node, second );
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1438|  1.24k|                second = temp;
 1439|  1.24k|            }
 1440|  4.95k|            else if ( cfg(doc, TidyDuplicateAttrs) == TidyKeepLast )
  ------------------
  |  |  415|  4.95k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1440:23): [True: 4.95k, False: 0]
  ------------------
 1441|  4.95k|            {
 1442|  4.95k|                temp = first->next;
 1443|  4.95k|                TY_(ReportAttrError)( doc, node, first, REPEATED_ATTRIBUTE);
  ------------------
  |  |   23|  4.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1444|  4.95k|                TY_(RemoveAttribute)( doc, node, first );
  ------------------
  |  |   23|  4.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1445|  4.95k|                firstRedefined = yes;
 1446|  4.95k|                first = temp;
 1447|  4.95k|                second = second->next;
 1448|  4.95k|            }
 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|  6.19k|        }
 1457|   102k|        if (!firstRedefined)
  ------------------
  |  Branch (1457:13): [True: 100k, False: 1.94k]
  ------------------
 1458|   100k|            first = first->next;
 1459|   102k|    }
 1460|   901k|}
prvTidyCheckAttribute:
 1464|   468k|{
 1465|   468k|    const Attribute* attribute = attval->dict;
 1466|       |
 1467|   468k|    if ( attribute != NULL )
  ------------------
  |  Branch (1467:10): [True: 316k, False: 152k]
  ------------------
 1468|   316k|    {
 1469|   316k|        if (attrIsXML_LANG(attval) || attrIsXML_SPACE(attval))
  ------------------
  |  |  341|   316k|#define attrIsXML_LANG(av)          AttrIsId( av, TidyAttr_XML_LANG  )
  |  |  ------------------
  |  |  |  |  169|   632k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 316k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 316k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 31.0k, False: 285k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (attrIsXML_LANG(attval) || attrIsXML_SPACE(attval))
  ------------------
  |  |  342|   285k|#define attrIsXML_SPACE(av)         AttrIsId( av, TidyAttr_XML_SPACE  )
  |  |  ------------------
  |  |  |  |  169|   285k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 285k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 285k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 195, False: 284k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1470|  31.2k|        {
 1471|  31.2k|            doc->lexer->isvoyager = yes;
 1472|  31.2k|            if (!cfgBool(doc, TidyHtmlOut))
  ------------------
  |  |  418|  31.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  31.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1472:17): [True: 31.2k, False: 0]
  ------------------
 1473|  31.2k|            {
 1474|  31.2k|                TY_(SetOptionBool)(doc, TidyXhtmlOut, yes);
  ------------------
  |  |   23|  31.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1475|  31.2k|                TY_(SetOptionBool)(doc, TidyXmlOut, yes);
  ------------------
  |  |   23|  31.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1476|  31.2k|            }
 1477|  31.2k|        }
 1478|       |
 1479|   316k|        TY_(ConstrainVersion)(doc, AttributeVersions(node, attval));
  ------------------
  |  |   23|   316k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   316k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1480|       |        
 1481|   316k|        if (attribute->attrchk)
  ------------------
  |  Branch (1481:13): [True: 268k, False: 47.5k]
  ------------------
 1482|   268k|            attribute->attrchk( doc, node, attval );
 1483|   316k|    }
 1484|       |
 1485|   468k|    return attribute;
 1486|   468k|}
prvTidyIsBoolAttribute:
 1489|   157k|{
 1490|   157k|    const Attribute *attribute = ( attval ? attval->dict : NULL );
  ------------------
  |  Branch (1490:36): [True: 157k, False: 0]
  ------------------
 1491|   157k|    if ( attribute && attribute->attrchk == CH_BOOL )
  ------------------
  |  |   73|  71.7k|#define CH_BOOL        CheckBool
  ------------------
  |  Branch (1491:10): [True: 71.7k, False: 85.8k]
  |  Branch (1491:23): [True: 888, False: 70.8k]
  ------------------
 1492|    888|        return yes;
 1493|   156k|    return no;
 1494|   157k|}
prvTidyattrIsEvent:
 1497|   157k|{
 1498|   157k|    TidyAttrId atid = AttrId( attval );
  ------------------
  |  |  168|   157k|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 157k, False: 0]
  |  |  |  Branch (168:29): [True: 71.7k, False: 85.8k]
  |  |  ------------------
  ------------------
 1499|       |
 1500|   157k|    return (atid == TidyAttr_OnAFTERUPDATE     ||
  ------------------
  |  Branch (1500:13): [True: 0, False: 157k]
  ------------------
 1501|   157k|            atid == TidyAttr_OnBEFOREUNLOAD    ||
  ------------------
  |  Branch (1501:13): [True: 0, False: 157k]
  ------------------
 1502|   157k|            atid == TidyAttr_OnBEFOREUPDATE    ||
  ------------------
  |  Branch (1502:13): [True: 0, False: 157k]
  ------------------
 1503|   157k|            atid == TidyAttr_OnBLUR            ||
  ------------------
  |  Branch (1503:13): [True: 0, False: 157k]
  ------------------
 1504|   157k|            atid == TidyAttr_OnCHANGE          ||
  ------------------
  |  Branch (1504:13): [True: 0, False: 157k]
  ------------------
 1505|   157k|            atid == TidyAttr_OnCLICK           ||
  ------------------
  |  Branch (1505:13): [True: 395, False: 157k]
  ------------------
 1506|   157k|            atid == TidyAttr_OnDATAAVAILABLE   ||
  ------------------
  |  Branch (1506:13): [True: 0, False: 157k]
  ------------------
 1507|   157k|            atid == TidyAttr_OnDATASETCHANGED  ||
  ------------------
  |  Branch (1507:13): [True: 0, False: 157k]
  ------------------
 1508|   157k|            atid == TidyAttr_OnDATASETCOMPLETE ||
  ------------------
  |  Branch (1508:13): [True: 0, False: 157k]
  ------------------
 1509|   157k|            atid == TidyAttr_OnDBLCLICK        ||
  ------------------
  |  Branch (1509:13): [True: 0, False: 157k]
  ------------------
 1510|   157k|            atid == TidyAttr_OnERRORUPDATE     ||
  ------------------
  |  Branch (1510:13): [True: 0, False: 157k]
  ------------------
 1511|   157k|            atid == TidyAttr_OnFOCUS           ||
  ------------------
  |  Branch (1511:13): [True: 0, False: 157k]
  ------------------
 1512|   157k|            atid == TidyAttr_OnKEYDOWN         ||
  ------------------
  |  Branch (1512:13): [True: 0, False: 157k]
  ------------------
 1513|   157k|            atid == TidyAttr_OnKEYPRESS        ||
  ------------------
  |  Branch (1513:13): [True: 0, False: 157k]
  ------------------
 1514|   157k|            atid == TidyAttr_OnKEYUP           ||
  ------------------
  |  Branch (1514:13): [True: 0, False: 157k]
  ------------------
 1515|   157k|            atid == TidyAttr_OnLOAD            ||
  ------------------
  |  Branch (1515:13): [True: 0, False: 157k]
  ------------------
 1516|   157k|            atid == TidyAttr_OnMOUSEDOWN       ||
  ------------------
  |  Branch (1516:13): [True: 0, False: 157k]
  ------------------
 1517|   157k|            atid == TidyAttr_OnMOUSEMOVE       ||
  ------------------
  |  Branch (1517:13): [True: 0, False: 157k]
  ------------------
 1518|   157k|            atid == TidyAttr_OnMOUSEOUT        ||
  ------------------
  |  Branch (1518:13): [True: 0, False: 157k]
  ------------------
 1519|   157k|            atid == TidyAttr_OnMOUSEOVER       ||
  ------------------
  |  Branch (1519:13): [True: 0, False: 157k]
  ------------------
 1520|   157k|            atid == TidyAttr_OnMOUSEUP         ||
  ------------------
  |  Branch (1520:13): [True: 0, False: 157k]
  ------------------
 1521|   157k|            atid == TidyAttr_OnRESET           ||
  ------------------
  |  Branch (1521:13): [True: 0, False: 157k]
  ------------------
 1522|   157k|            atid == TidyAttr_OnROWENTER        ||
  ------------------
  |  Branch (1522:13): [True: 0, False: 157k]
  ------------------
 1523|   157k|            atid == TidyAttr_OnROWEXIT         ||
  ------------------
  |  Branch (1523:13): [True: 0, False: 157k]
  ------------------
 1524|   157k|            atid == TidyAttr_OnSELECT          ||
  ------------------
  |  Branch (1524:13): [True: 0, False: 157k]
  ------------------
 1525|   157k|            atid == TidyAttr_OnSUBMIT          ||
  ------------------
  |  Branch (1525:13): [True: 0, False: 157k]
  ------------------
 1526|   157k|            atid == TidyAttr_OnUNLOAD);
  ------------------
  |  Branch (1526:13): [True: 0, False: 157k]
  ------------------
 1527|   157k|}
prvTidyCheckUrl:
 1620|   127k|{
 1621|   127k|    tmbchar c;
 1622|   127k|    tmbstr dest, p;
 1623|   127k|    uint escape_count = 0, backslash_count = 0, bad_codepoint_count = 0;
 1624|   127k|    uint i, pos = 0;
 1625|   127k|    uint len;
 1626|   127k|    uint increment;
 1627|   127k|    Bool isJavascript = no;
 1628|       |
 1629|   127k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|   127k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 127k, False: 0]
  |  |  |  Branch (171:44): [True: 124k, False: 2.98k]
  |  |  ------------------
  ------------------
 1630|  2.98k|    {
 1631|  2.98k|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  2.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1632|  2.98k|        return;
 1633|  2.98k|    }
 1634|       |
 1635|   124k|    p = attval->value;
 1636|       |
 1637|   124k|    isJavascript =
 1638|   124k|        TY_(tmbstrncmp)(p,"javascript:",sizeof("javascript:")-1)==0;
  ------------------
  |  |   23|   124k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   124k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1639|       |
 1640|  21.2M|    for (i = 0; '\0' != (c = p[i]); ++i)
  ------------------
  |  Branch (1640:17): [True: 21.1M, False: 124k]
  ------------------
 1641|  21.1M|    {
 1642|  21.1M|        if (c == '\\')
  ------------------
  |  Branch (1642:13): [True: 114k, False: 21.0M]
  ------------------
 1643|   114k|        {
 1644|   114k|            ++backslash_count;
 1645|   114k|            if ( cfgBool(doc, TidyFixBackslash) && !isJavascript)
  ------------------
  |  |  418|   228k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   114k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 114k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1645:52): [True: 113k, False: 608]
  ------------------
 1646|   113k|                p[i] = '/';
 1647|   114k|        }
 1648|  21.0M|        else if ((c > 0x7e) || (c <= 0x20) || (strchr("<>", c)))
  ------------------
  |  Branch (1648:18): [True: 414, False: 21.0M]
  |  Branch (1648:32): [True: 18.6M, False: 2.34M]
  |  Branch (1648:47): [True: 20.9k, False: 2.32M]
  ------------------
 1649|  18.6M|            ++escape_count;
 1650|  21.1M|    }
 1651|       |
 1652|  12.8M|    while ( *p != 0 )
  ------------------
  |  Branch (1652:13): [True: 12.7M, False: 124k]
  ------------------
 1653|  12.7M|    {
 1654|  12.7M|        if ( !IsURLCodePoint( p, &increment ) )
  ------------------
  |  Branch (1654:14): [True: 10.3M, False: 2.32M]
  ------------------
 1655|  10.3M|            ++bad_codepoint_count;
 1656|  12.7M|         p = p + increment;
 1657|  12.7M|    }
 1658|   124k|    p = attval->value;
 1659|       |
 1660|   124k|    if ( cfgBool(doc, TidyFixUri) && escape_count )
  ------------------
  |  |  418|   249k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   124k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 124k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1660:38): [True: 123k, False: 1.70k]
  ------------------
 1661|   123k|    {
 1662|   123k|        Bool hadnonspace = no;
 1663|   123k|        len = TY_(tmbstrlen)(p) + escape_count * 2 + 1;
  ------------------
  |  |   23|   123k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   123k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1664|   123k|        dest = (tmbstr) TidyDocAlloc(doc, len);
  ------------------
  |  |  157|   123k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   123k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 1665|       | 
 1666|  21.2M|        for (i = 0; 0 != (c = p[i]); ++i)
  ------------------
  |  Branch (1666:21): [True: 21.1M, False: 123k]
  ------------------
 1667|  21.1M|        {
 1668|  21.1M|            if ((c > 0x7e) || (c <= 0x20) || (strchr("<>", c)))
  ------------------
  |  Branch (1668:17): [True: 414, False: 21.1M]
  |  Branch (1668:31): [True: 18.6M, False: 2.44M]
  |  Branch (1668:46): [True: 20.9k, False: 2.42M]
  ------------------
 1669|  18.6M|            {
 1670|  18.6M|                if (c == 0x20)
  ------------------
  |  Branch (1670:21): [True: 6.04M, False: 12.6M]
  ------------------
 1671|  6.04M|                {
 1672|       |                    /* #345 - special case for leading spaces - discard */
 1673|  6.04M|                    if (hadnonspace)
  ------------------
  |  Branch (1673:25): [True: 6.04M, False: 2.48k]
  ------------------
 1674|  6.04M|                        pos += sprintf( dest + pos, "%%%02X", (byte)c );
 1675|  6.04M|                }
 1676|  12.6M|                else
 1677|  12.6M|                {
 1678|  12.6M|                    pos += sprintf( dest + pos, "%%%02X", (byte)c );
 1679|  12.6M|                    hadnonspace = yes;
 1680|  12.6M|                }
 1681|  18.6M|            }
 1682|  2.42M|            else
 1683|  2.42M|            {
 1684|  2.42M|                hadnonspace = yes;
 1685|  2.42M|                dest[pos++] = c;
 1686|  2.42M|            }
 1687|  21.1M|        }
 1688|   123k|        dest[pos] = 0;
 1689|       |
 1690|   123k|        TidyDocFree(doc, attval->value);
  ------------------
  |  |  159|   123k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   123k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1691|   123k|        attval->value = dest;
 1692|   123k|    }
 1693|   124k|    if ( backslash_count )
  ------------------
  |  Branch (1693:10): [True: 113k, False: 11.8k]
  ------------------
 1694|   113k|    {
 1695|   113k|        if ( cfgBool(doc, TidyFixBackslash) && !isJavascript )
  ------------------
  |  |  418|   226k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   113k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 113k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1695:48): [True: 112k, False: 282]
  ------------------
 1696|   112k|            TY_(ReportAttrError)( doc, node, attval, FIXED_BACKSLASH );
  ------------------
  |  |   23|   112k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   112k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1697|    282|        else
 1698|    282|            TY_(ReportAttrError)( doc, node, attval, BACKSLASH_IN_URI );
  ------------------
  |  |   23|    282|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    282|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1699|   113k|    }
 1700|   124k|    if ( escape_count )
  ------------------
  |  Branch (1700:10): [True: 123k, False: 1.70k]
  ------------------
 1701|   123k|    {
 1702|   123k|        if ( cfgBool(doc, TidyFixUri) )
  ------------------
  |  |  418|   123k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   123k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 123k, False: 0]
  |  |  ------------------
  ------------------
 1703|   123k|            TY_(ReportAttrError)( doc, node, attval, ESCAPED_ILLEGAL_URI);
  ------------------
  |  |   23|   123k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   123k|#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|   123k|        doc->badChars |= BC_INVALID_URI;
  ------------------
  |  |  304|   123k|#define BC_INVALID_URI             32
  ------------------
 1708|   123k|    }
 1709|   124k|    if ( bad_codepoint_count )
  ------------------
  |  Branch (1709:10): [True: 121k, False: 2.95k]
  ------------------
 1710|   121k|    {
 1711|   121k|        TY_(ReportAttrError)( doc, node, attval, ILLEGAL_URI_CODEPOINT );
  ------------------
  |  |   23|   121k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   121k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1712|   121k|    }
 1713|   124k|}
prvTidyIsValidHTMLID:
 1733|  68.7k|{
 1734|  68.7k|    ctmbstr s = id;
 1735|       |
 1736|  68.7k|    if (!s)
  ------------------
  |  Branch (1736:9): [True: 212, False: 68.5k]
  ------------------
 1737|    212|        return no;
 1738|       |
 1739|  1.65M|    while (*s)
  ------------------
  |  Branch (1739:12): [True: 1.63M, False: 18.8k]
  ------------------
 1740|  1.63M|        if (TY_(IsHTMLSpace)(*s++))
  ------------------
  |  |   23|  1.63M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.63M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1740:13): [True: 49.7k, False: 1.58M]
  ------------------
 1741|  49.7k|            return no;
 1742|       |
 1743|  18.8k|    return yes;
 1744|       |
 1745|  68.5k|}
prvTidyIsValidXMLID:
 1748|  54.1k|{
 1749|  54.1k|    ctmbstr s = id;
 1750|  54.1k|    tchar c;
 1751|       |
 1752|  54.1k|    if (!s)
  ------------------
  |  Branch (1752:9): [True: 0, False: 54.1k]
  ------------------
 1753|      0|        return no;
 1754|       |
 1755|  54.1k|    c = *s++;
 1756|  54.1k|    if (c > 0x7F)
  ------------------
  |  Branch (1756:9): [True: 768, False: 53.3k]
  ------------------
 1757|    768|        s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|    768|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    768|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1758|       |
 1759|  54.1k|    if (!(TY_(IsXMLLetter)(c) || c == '_' || c == ':'))
  ------------------
  |  |   23|  54.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  54.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1759:11): [True: 47.1k, False: 7.01k]
  |  Branch (1759:34): [True: 574, False: 6.43k]
  |  Branch (1759:46): [True: 4.33k, False: 2.10k]
  ------------------
 1760|  2.10k|        return no;
 1761|       |
 1762|   878k|    while (*s)
  ------------------
  |  Branch (1762:12): [True: 858k, False: 20.2k]
  ------------------
 1763|   858k|    {
 1764|   858k|        c = (unsigned char)*s;
 1765|       |
 1766|   858k|        if (c > 0x7F)
  ------------------
  |  Branch (1766:13): [True: 190k, False: 667k]
  ------------------
 1767|   190k|            s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|   190k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   190k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1768|       |
 1769|   858k|        ++s;
 1770|       |
 1771|   858k|        if (!TY_(IsXMLNamechar)(c))
  ------------------
  |  |   23|   858k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   858k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1771:13): [True: 31.7k, False: 826k]
  ------------------
 1772|  31.7k|            return no;
 1773|   858k|    }
 1774|       |
 1775|  20.2k|    return yes;
 1776|  52.0k|}
prvTidySortAttributes:
 2460|  2.06M|{
 2461|  4.73M|    while (node)
  ------------------
  |  Branch (2461:12): [True: 2.67M, False: 2.06M]
  ------------------
 2462|  2.67M|    {
 2463|  2.67M|        node->attributes = SortAttVal( doc, node->attributes, strat );
 2464|  2.67M|        if (node->content)
  ------------------
  |  Branch (2464:13): [True: 2.03M, False: 636k]
  ------------------
 2465|  2.03M|            TY_(SortAttributes)(doc, node->content, strat);
  ------------------
  |  |   23|  2.03M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.03M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2466|  2.67M|        node = node->next;
 2467|  2.67M|    }
 2468|  2.06M|}
attrs.c:AttributeVersions:
  479|   792k|{
  480|   792k|    uint i;
  481|       |
  482|       |    /* Override or add to items in attrdict.c */
  483|   792k|    if (attval && attval->attribute) {
  ------------------
  |  Branch (483:9): [True: 792k, False: 0]
  |  Branch (483:19): [True: 765k, False: 27.6k]
  ------------------
  484|       |        /* HTML5 data-* attributes can't be added generically; handle here. */
  485|   765k|        if (TY_(tmbstrncmp)(attval->attribute, "data-", 5) == 0)
  ------------------
  |  |   23|   765k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   765k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (485:13): [True: 650, False: 764k]
  ------------------
  486|    650|            return (XH50 | HT50);
  ------------------
  |  |  201|    650|#define XH50              262144u
  ------------------
                          return (XH50 | HT50);
  ------------------
  |  |  200|    650|#define HT50              131072u
  ------------------
  487|   765k|    }
  488|       |    /* TODO: maybe this should return VERS_PROPRIETARY instead? */
  489|   792k|    if (!attval || !attval->dict)
  ------------------
  |  Branch (489:9): [True: 0, False: 792k]
  |  Branch (489:20): [True: 123k, False: 668k]
  ------------------
  490|   123k|        return VERS_UNKNOWN;
  ------------------
  |  |  204|   123k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|   123k|#define xxxx                   0u
  |  |  ------------------
  ------------------
  491|       |
  492|   668k|    if (!(!node || !node->tag || !node->tag->attrvers))
  ------------------
  |  Branch (492:11): [True: 0, False: 668k]
  |  Branch (492:20): [True: 0, False: 668k]
  |  Branch (492:34): [True: 1.34k, False: 666k]
  ------------------
  493|  58.0M|        for (i = 0; node->tag->attrvers[i].attribute; ++i)
  ------------------
  |  Branch (493:21): [True: 57.8M, False: 265k]
  ------------------
  494|  57.8M|            if (node->tag->attrvers[i].attribute == attval->dict->id)
  ------------------
  |  Branch (494:17): [True: 401k, False: 57.4M]
  ------------------
  495|   401k|                return node->tag->attrvers[i].versions;
  496|       |
  497|   266k|    return VERS_PROPRIETARY;
  ------------------
  |  |  231|   266k|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|   266k|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|   266k|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|   266k|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  498|   668k|}
attrs.c:attrsLookup:
  836|   650k|{
  837|   650k|    const Attribute *np;
  838|   650k|    const AttrHash *p;
  839|       |
  840|   650k|    if (!atnam)
  ------------------
  |  Branch (840:9): [True: 25.9k, False: 624k]
  ------------------
  841|  25.9k|        return NULL;
  842|       |
  843|   625k|    for (p = attribs->hashtab[attrsHash(atnam)]; p && p->attr; p = p->next)
  ------------------
  |  Branch (843:50): [True: 372k, False: 253k]
  |  Branch (843:55): [True: 372k, False: 0]
  ------------------
  844|   372k|        if (TY_(tmbstrcasecmp)(atnam, p->attr->name) == 0)
  ------------------
  |  |   23|   372k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   372k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (844:13): [True: 371k, False: 811]
  ------------------
  845|   371k|            return p->attr;
  846|       |
  847|  69.9M|    for (np = attribute_defs; np && np->name; ++np)
  ------------------
  |  Branch (847:31): [True: 69.9M, False: 0]
  |  Branch (847:37): [True: 69.7M, False: 180k]
  ------------------
  848|  69.7M|        if (TY_(tmbstrcasecmp)(atnam, np->name) == 0)
  ------------------
  |  |   23|  69.7M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  69.7M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (848:13): [True: 72.5k, False: 69.7M]
  ------------------
  849|  72.5k|            return attrsInstall(doc, attribs, np);
  850|       |
  851|   180k|    return NULL;
  852|   253k|}
attrs.c:attrsHash:
  764|   697k|{
  765|   697k|    uint hashval;
  766|       |
  767|  18.5M|    for (hashval = 0; *s != '\0'; s++)
  ------------------
  |  Branch (767:23): [True: 17.8M, False: 697k]
  ------------------
  768|  17.8M|        hashval = *s + 31*hashval;
  769|       |
  770|   697k|    return hashval % ATTRIBUTE_HASH_SIZE;
  771|   697k|}
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: 204, False: 196]
  |  |  ------------------
  ------------------
 1724|    204|        TY_(CheckUrl)( doc, node, attval );
  ------------------
  |  |   23|    204|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    204|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1725|    400|}
attrs.c:CheckAlign:
 1926|  6.49k|{
 1927|  6.49k|    ctmbstr const values[] = {"left", "right", "center", "justify", NULL};
 1928|       |
 1929|       |    /* IMG, OBJECT, APPLET and EMBED use align for vertical position */
 1930|  6.49k|    if (node->tag && (node->tag->model & CM_IMG))
  ------------------
  |  |  155|  6.49k|#define CM_IMG          (1 << 16)  /**< Elements that use "align" attribute for vertical position. */
  ------------------
  |  Branch (1930:9): [True: 6.49k, False: 0]
  |  Branch (1930:22): [True: 609, False: 5.88k]
  ------------------
 1931|    609|    {
 1932|    609|        CheckValign( doc, node, attval );
 1933|    609|        return;
 1934|    609|    }
 1935|       |
 1936|  5.88k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  5.88k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 5.88k, False: 0]
  |  |  |  Branch (171:44): [True: 5.45k, False: 427]
  |  |  ------------------
  ------------------
 1937|    427|    {
 1938|    427|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    427|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    427|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1939|    427|        return;
 1940|    427|    }
 1941|       |
 1942|  5.45k|    CheckLowerCaseAttrValue( doc, node, attval);
 1943|       |
 1944|       |    /* currently CheckCaption(...) takes care of the remaining cases */
 1945|  5.45k|    if (nodeIsCAPTION(node))
  ------------------
  |  |  394|  5.45k|#define nodeIsCAPTION( node )    TagIsId( node, TidyTag_CAPTION )
  |  |  ------------------
  |  |  |  |  275|  5.45k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.45k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.45k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.27k, False: 2.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1946|  3.27k|        return;
 1947|       |
 1948|  2.17k|    if (!AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (1948:9): [True: 1.54k, False: 634]
  ------------------
 1949|  1.54k|    {
 1950|       |        /* align="char" is allowed for elements with CM_TABLE|CM_ROW
 1951|       |           except CAPTION which is excluded above, */
 1952|  1.54k|        if( !(AttrValueIs(attval, "char")
  ------------------
  |  |  172|  3.08k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  3.08k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 1.54k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 1.54k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  3.08k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  1.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 422, False: 1.12k]
  |  |  ------------------
  ------------------
 1953|    422|              && TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)) )
  ------------------
  |  |   23|    422|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    422|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                            && TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)) )
  ------------------
  |  |  146|    422|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                            && TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)) )
  ------------------
  |  |  148|    422|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (1953:18): [True: 195, False: 227]
  ------------------
 1954|  1.34k|             TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  1.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1955|  1.54k|    }
 1956|  2.17k|}
attrs.c:CheckLowerCaseAttrValue:
 1530|  12.6k|{
 1531|  12.6k|    tmbstr p;
 1532|  12.6k|    Bool hasUpper = no;
 1533|       |    
 1534|  12.6k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  12.6k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 12.6k, False: 0]
  |  |  |  Branch (171:44): [True: 12.6k, False: 0]
  |  |  ------------------
  ------------------
 1535|      0|        return;
 1536|       |
 1537|  12.6k|    p = attval->value;
 1538|       |    
 1539|  49.6k|    while (*p)
  ------------------
  |  Branch (1539:12): [True: 43.8k, False: 5.87k]
  ------------------
 1540|  43.8k|    {
 1541|  43.8k|        if (TY_(IsUpper)(*p)) /* #501230 - fix by Terry Teague - 09 Jan 02 */
  ------------------
  |  |   23|  43.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  43.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1541:13): [True: 6.81k, False: 37.0k]
  ------------------
 1542|  6.81k|        {
 1543|  6.81k|            hasUpper = yes;
 1544|  6.81k|            break;
 1545|  6.81k|        }
 1546|  37.0k|        p++;
 1547|  37.0k|    }
 1548|       |
 1549|  12.6k|    if (hasUpper)
  ------------------
  |  Branch (1549:9): [True: 6.81k, False: 5.87k]
  ------------------
 1550|  6.81k|    {
 1551|  6.81k|        Lexer* lexer = doc->lexer;
 1552|  6.81k|        if (lexer->isvoyager)
  ------------------
  |  Branch (1552:13): [True: 1.48k, False: 5.32k]
  ------------------
 1553|  1.48k|            TY_(ReportAttrError)( doc, node, attval, ATTR_VALUE_NOT_LCASE);
  ------------------
  |  |   23|  1.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1554|       |  
 1555|  6.81k|        if ( lexer->isvoyager || cfgBool(doc, TidyLowerLiterals) )
  ------------------
  |  |  418|  5.32k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.32k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 5.32k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1555:14): [True: 1.48k, False: 5.32k]
  ------------------
 1556|  6.81k|            attval->value = TY_(tmbstrtolower)(attval->value);
  ------------------
  |  |   23|  6.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1557|  6.81k|    }
 1558|  12.6k|}
attrs.c:AttrValueIsAmong:
 1803|  15.3k|{
 1804|  15.3k|    const ctmbstr *v;   
 1805|  56.9k|    for (v = list; *v; ++v)
  ------------------
  |  Branch (1805:20): [True: 46.0k, False: 10.9k]
  ------------------
 1806|  46.0k|        if (AttrValueIs(attval, *v))
  ------------------
  |  |  172|  46.0k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  92.0k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 46.0k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 46.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  46.0k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  46.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  46.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 4.37k, False: 41.6k]
  |  |  ------------------
  ------------------
 1807|  4.37k|            return yes;
 1808|  10.9k|    return no;
 1809|  15.3k|}
attrs.c:CheckColor:
 2139|  4.36k|{
 2140|  4.36k|    Bool valid = no;
 2141|  4.36k|    tmbstr given;
 2142|       |
 2143|  4.36k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  4.36k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 4.36k, False: 0]
  |  |  |  Branch (171:44): [True: 4.12k, False: 236]
  |  |  ------------------
  ------------------
 2144|    236|    {
 2145|    236|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    236|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    236|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2146|    236|        return;
 2147|    236|    }
 2148|       |
 2149|  4.12k|    given = attval->value;
 2150|       |
 2151|       |    /* 727851 - add hash to hash-less color values */
 2152|  4.12k|    if (given[0] != '#' && (valid = IsValidColorCode(given)))
  ------------------
  |  Branch (2152:9): [True: 3.40k, False: 721]
  |  Branch (2152:28): [True: 1.01k, False: 2.39k]
  ------------------
 2153|  1.01k|    {
 2154|  1.01k|        tmbstr cp, s;
 2155|       |
 2156|  1.01k|        cp = s = (tmbstr) TidyDocAlloc(doc, 2 + TY_(tmbstrlen)(given));
  ------------------
  |  |  157|  1.01k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  1.01k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 2157|  1.01k|        *cp++ = '#';
 2158|  7.09k|        while ('\0' != (*cp++ = *given++))
  ------------------
  |  Branch (2158:16): [True: 6.07k, False: 1.01k]
  ------------------
 2159|  6.07k|            continue;
 2160|       |
 2161|  1.01k|        TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE_REPLACED);
  ------------------
  |  |   23|  1.01k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.01k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2162|       |
 2163|  1.01k|        TidyDocFree(doc, attval->value);
  ------------------
  |  |  159|  1.01k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  1.01k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2164|  1.01k|        given = attval->value = s;
 2165|  1.01k|    }
 2166|       |
 2167|  4.12k|    if (!valid && given[0] == '#')
  ------------------
  |  Branch (2167:9): [True: 3.11k, False: 1.01k]
  |  Branch (2167:19): [True: 721, False: 2.39k]
  ------------------
 2168|    721|        valid = IsValidColorCode(given + 1);
 2169|       |
 2170|  4.12k|    if (valid && given[0] == '#' && cfgBool(doc, TidyReplaceColor))
  ------------------
  |  |  418|  1.32k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.32k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 1.32k]
  |  |  ------------------
  ------------------
  |  Branch (2170:9): [True: 1.32k, False: 2.80k]
  |  Branch (2170:18): [True: 1.32k, 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.12k|    if (!valid)
  ------------------
  |  Branch (2182:9): [True: 2.80k, False: 1.32k]
  ------------------
 2183|  2.80k|        valid = GetColorCode(given, TY_(IsHTML5Mode)(doc)) != NULL;
  ------------------
  |  |   23|  2.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2184|       |
 2185|  4.12k|    if (valid && given[0] == '#')
  ------------------
  |  Branch (2185:9): [True: 2.01k, False: 2.11k]
  |  Branch (2185:18): [True: 1.32k, False: 694]
  ------------------
 2186|  1.32k|        attval->value = TY_(tmbstrtoupper)(attval->value);
  ------------------
  |  |   23|  1.32k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.32k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2187|  2.80k|    else if (valid)
  ------------------
  |  Branch (2187:14): [True: 694, False: 2.11k]
  ------------------
 2188|    694|        attval->value = TY_(tmbstrtolower)(attval->value);
  ------------------
  |  |   23|    694|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    694|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2189|       |
 2190|  4.12k|    if (!valid)
  ------------------
  |  Branch (2190:9): [True: 2.11k, False: 2.01k]
  ------------------
 2191|  2.11k|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  2.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2192|  4.12k|}
attrs.c:IsValidColorCode:
 2123|  4.12k|{
 2124|  4.12k|    uint i;
 2125|       |
 2126|  4.12k|    if (TY_(tmbstrlen)(color) != 6)
  ------------------
  |  |   23|  4.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2126:9): [True: 1.83k, False: 2.29k]
  ------------------
 2127|  1.83k|        return no;
 2128|       |
 2129|       |    /* check if valid hex digits and letters */
 2130|  13.1k|    for (i = 0; i < 6; i++)
  ------------------
  |  Branch (2130:17): [True: 11.8k, False: 1.32k]
  ------------------
 2131|  11.8k|        if (!TY_(IsDigit)(color[i]) && !strchr("abcdef", TY_(ToLower)(color[i])))
  ------------------
  |  |   23|  11.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      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
  |  |  ------------------
  ------------------
  |  Branch (2131:13): [True: 10.8k, False: 1.01k]
  |  Branch (2131:40): [True: 971, False: 9.85k]
  ------------------
 2132|    971|            return no;
 2133|       |
 2134|  1.32k|    return yes;
 2135|  2.29k|}
attrs.c:GetColorCode:
  732|  2.80k|{
  733|  2.80k|    uint i;
  734|       |
  735|  40.8k|    for (i = 0; colors[i].name; ++i)
  ------------------
  |  Branch (735:17): [True: 38.5k, False: 2.30k]
  ------------------
  736|  38.5k|        if (TY_(tmbstrcasecmp)(name, colors[i].name) == 0)
  ------------------
  |  |   23|  38.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (736:13): [True: 500, False: 38.0k]
  ------------------
  737|    500|            return colors[i].hex;
  738|       |
  739|  2.30k|    if (use_css_colors)
  ------------------
  |  Branch (739:9): [True: 2.08k, False: 218]
  ------------------
  740|   272k|        for (i = 0; extended_colors[i].name; ++i)
  ------------------
  |  Branch (740:21): [True: 270k, False: 1.89k]
  ------------------
  741|   270k|            if (TY_(tmbstrcasecmp)(name, extended_colors[i].name) == 0)
  ------------------
  |  |   23|   270k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   270k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (741:17): [True: 194, False: 270k]
  ------------------
  742|    194|                return extended_colors[i].hex;
  743|       |
  744|  2.11k|    return NULL;
  745|  2.30k|}
attrs.c:CheckNumber:
 2087|  2.57k|{
 2088|  2.57k|    tmbstr p;
 2089|       |    
 2090|  2.57k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  2.57k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 2.57k, False: 0]
  |  |  |  Branch (171:44): [True: 2.36k, False: 206]
  |  |  ------------------
  ------------------
 2091|    206|    {
 2092|    206|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    206|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    206|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2093|    206|        return;
 2094|    206|    }
 2095|       |
 2096|       |    /* don't check <frameset cols=... rows=...> */
 2097|  2.36k|    if ( nodeIsFRAMESET(node) &&
  ------------------
  |  |  376|  2.36k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  4.73k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.36k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.36k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 391, False: 1.97k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2098|    391|        (attrIsCOLS(attval) || attrIsROWS(attval)))
  ------------------
  |  |  213|    391|#define attrIsCOLS(av)              AttrIsId( av, TidyAttr_COLS  )
  |  |  ------------------
  |  |  |  |  169|    782|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 391, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 391, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 391]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (attrIsCOLS(attval) || attrIsROWS(attval)))
  ------------------
  |  |  306|    391|#define attrIsROWS(av)              AttrIsId( av, TidyAttr_ROWS  )
  |  |  ------------------
  |  |  |  |  169|    391|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 391, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 391, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 194, False: 197]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2099|    194|     return;
 2100|       |
 2101|  2.17k|    p  = attval->value;
 2102|       |    
 2103|       |    /* font size may be preceded by + or - */
 2104|  2.17k|    if ( nodeIsFONT(node) && (*p == '+' || *p == '-') )
  ------------------
  |  |  417|  2.17k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  4.34k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.17k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.17k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 851, False: 1.32k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2104:31): [True: 228, False: 623]
  |  Branch (2104:44): [True: 228, False: 395]
  ------------------
 2105|    456|        ++p;
 2106|       |    /* tabindex may be preceded by - */
 2107|  2.17k|    if (attval->attribute && (strcmp(attval->attribute,"tabindex") == 0) && (*p == '-'))
  ------------------
  |  Branch (2107:9): [True: 2.17k, False: 0]
  |  Branch (2107:30): [True: 528, False: 1.64k]
  |  Branch (2107:77): [True: 197, False: 331]
  ------------------
 2108|    197|        ++p;
 2109|       |
 2110|  3.79k|    while (*p)
  ------------------
  |  Branch (2110:12): [True: 3.04k, False: 751]
  ------------------
 2111|  3.04k|    {
 2112|  3.04k|        if (!TY_(IsDigit)(*p))
  ------------------
  |  |   23|  3.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2112:13): [True: 1.42k, False: 1.62k]
  ------------------
 2113|  1.42k|        {
 2114|  1.42k|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  1.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2115|  1.42k|            break;
 2116|  1.42k|        }
 2117|  1.62k|        ++p;
 2118|  1.62k|    }
 2119|  2.17k|}
attrs.c:CheckLength:
 1992|  3.80k|{
 1993|  3.80k|    tmbstr p;
 1994|       |    
 1995|  3.80k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  3.80k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 3.80k, False: 0]
  |  |  |  Branch (171:44): [True: 3.61k, False: 195]
  |  |  ------------------
  ------------------
 1996|    195|    {
 1997|    195|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    195|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    195|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1998|    195|        return;
 1999|    195|    }
 2000|       |
 2001|       |    /* don't check for <col width=...> and <colgroup width=...> */
 2002|  3.61k|    if (attrIsWIDTH(attval) && (nodeIsCOL(node) || nodeIsCOLGROUP(node)))
  ------------------
  |  |  338|  3.61k|#define attrIsWIDTH(av)             AttrIsId( av, TidyAttr_WIDTH  )
  |  |  ------------------
  |  |  |  |  169|  7.22k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.61k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.61k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 2.94k, False: 673]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (attrIsWIDTH(attval) && (nodeIsCOL(node) || nodeIsCOLGROUP(node)))
  ------------------
  |  |  398|  2.94k|#define nodeIsCOL( node )        TagIsId( node, TidyTag_COL )
  |  |  ------------------
  |  |  |  |  275|  5.88k|#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: 1.51k, False: 1.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (attrIsWIDTH(attval) && (nodeIsCOL(node) || nodeIsCOLGROUP(node)))
  ------------------
  |  |  399|  1.42k|#define nodeIsCOLGROUP( node )   TagIsId( node, TidyTag_COLGROUP )
  |  |  ------------------
  |  |  |  |  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: 194, False: 1.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2003|  1.70k|        return;
 2004|       |
 2005|  1.90k|    p = attval->value;
 2006|       |    
 2007|  1.90k|    if (!TY_(IsDigit)(*p++))
  ------------------
  |  |   23|  1.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2007:9): [True: 767, False: 1.13k]
  ------------------
 2008|    767|    {
 2009|    767|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    767|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    767|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2010|    767|    }
 2011|  1.13k|    else
 2012|  1.13k|    {
 2013|  1.13k|        Bool percentFound = no;
 2014|  2.36k|        while (*p)
  ------------------
  |  Branch (2014:16): [True: 1.63k, False: 727]
  ------------------
 2015|  1.63k|        {
 2016|  1.63k|            if (!percentFound && *p == '%')
  ------------------
  |  Branch (2016:17): [True: 1.43k, False: 203]
  |  Branch (2016:34): [True: 203, False: 1.23k]
  ------------------
 2017|    203|            {
 2018|    203|                percentFound = yes;
 2019|    203|            }
 2020|  1.43k|            else if (percentFound || !TY_(IsDigit)(*p))
  ------------------
  |  |   23|  1.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2020:22): [True: 203, False: 1.23k]
  |  Branch (2020:38): [True: 207, False: 1.02k]
  ------------------
 2021|    410|            {
 2022|    410|                TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    410|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    410|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2023|    410|                break;
 2024|    410|            }
 2025|       |
 2026|  1.22k|            ++p;
 2027|  1.22k|        }
 2028|  1.13k|    }
 2029|  1.90k|}
attrs.c:CheckClear:
 2057|  1.38k|{
 2058|  1.38k|    ctmbstr const values[] = {"none", "left", "right", "all", NULL};
 2059|       |
 2060|  1.38k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.38k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.38k, False: 0]
  |  |  |  Branch (171:44): [True: 1.17k, False: 208]
  |  |  ------------------
  ------------------
 2061|    208|    {
 2062|    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
  |  |  ------------------
  ------------------
 2063|    208|        if (attval->value == NULL)
  ------------------
  |  Branch (2063:13): [True: 208, False: 0]
  ------------------
 2064|    208|            attval->value = TY_(tmbstrdup)( doc->allocator, "none" );
  ------------------
  |  |   23|    208|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    208|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2065|    208|        return;
 2066|    208|    }
 2067|       |
 2068|  1.17k|    CheckLowerCaseAttrValue( doc, node, attval );
 2069|       |        
 2070|  1.17k|    if (!AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2070:9): [True: 944, False: 232]
  ------------------
 2071|    944|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    944|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    944|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2072|  1.17k|}
attrs.c:CheckTextDir:
 2210|  1.27k|{
 2211|  1.27k|    ctmbstr const values4[] = { "rtl", "ltr", NULL };
 2212|       |    /* PR #712 - add 'auto' for HTML5 - @doronbehar */
 2213|  1.27k|    ctmbstr const values5[] = { "rtl", "ltr", "auto", NULL };
 2214|  1.27k|    CheckAttrValidity(doc, node, attval,
 2215|  1.27k|        (TY_(IsHTML5Mode)(doc) ? values5 : values4));
  ------------------
  |  |   23|  1.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2215:10): [True: 942, False: 336]
  ------------------
 2216|  1.27k|}
attrs.c:CheckAttrValidity:
 1813|  3.75k|{
 1814|  3.75k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  3.75k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 3.75k, False: 0]
  |  |  |  Branch (171:44): [True: 1.45k, False: 2.30k]
  |  |  ------------------
  ------------------
 1815|  2.30k|    {
 1816|  2.30k|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  2.30k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.30k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1817|  2.30k|        return;
 1818|  2.30k|    }
 1819|       |
 1820|  1.45k|    CheckLowerCaseAttrValue( doc, node, attval );
 1821|       |
 1822|  1.45k|    if (!AttrValueIsAmong(attval, list))
  ------------------
  |  Branch (1822:9): [True: 1.18k, False: 265]
  ------------------
 1823|  1.18k|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  1.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1824|  1.45k|}
attrs.c:CheckLang:
 2220|  32.2k|{
 2221|       |    /* empty xml:lang is allowed through XML 1.0 SE errata */
 2222|  32.2k|    if (!AttrHasValue(attval) && !attrIsXML_LANG(attval))
  ------------------
  |  |  171|  64.4k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 32.2k, False: 0]
  |  |  |  Branch (171:44): [True: 500, False: 31.7k]
  |  |  ------------------
  ------------------
                  if (!AttrHasValue(attval) && !attrIsXML_LANG(attval))
  ------------------
  |  |  341|  31.7k|#define attrIsXML_LANG(av)          AttrIsId( av, TidyAttr_XML_LANG  )
  |  |  ------------------
  |  |  |  |  169|  31.7k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 31.7k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 31.7k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 30.7k, False: 988]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2223|    988|    {
 2224|    988|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|    988|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (2224:14): [True: 988, False: 0]
  ------------------
 2225|    988|        {
 2226|    988|            TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE );
  ------------------
  |  |   23|    988|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    988|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2227|    988|        }
 2228|    988|        return;
 2229|    988|    }
 2230|  32.2k|}
attrs.c:CheckId:
 1854|  67.6k|{
 1855|  67.6k|    Lexer* lexer = doc->lexer;
 1856|  67.6k|    Node *old;
 1857|       |
 1858|  67.6k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  67.6k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 67.6k, False: 0]
  |  |  |  Branch (171:44): [True: 64.4k, False: 3.19k]
  |  |  ------------------
  ------------------
 1859|  3.19k|    {
 1860|  3.19k|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  3.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1861|  3.19k|        return;
 1862|  3.19k|    }
 1863|       |
 1864|  64.4k|    if (!TY_(IsValidHTMLID)(attval->value))
  ------------------
  |  |   23|  64.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  64.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1864:9): [True: 49.5k, False: 14.9k]
  ------------------
 1865|  49.5k|    {
 1866|  49.5k|        if (lexer->isvoyager && TY_(IsValidXMLID)(attval->value))
  ------------------
  |  |   23|  29.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1866:13): [True: 29.8k, False: 19.6k]
  |  Branch (1866:33): [True: 0, False: 29.8k]
  ------------------
 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|  49.5k|        else
 1869|  49.5k|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  49.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1870|  49.5k|    }
 1871|       |
 1872|  64.4k|    if ((old = GetNodeByAnchor(doc, attval->value)) &&  old != node)
  ------------------
  |  Branch (1872:9): [True: 23.6k, False: 40.8k]
  |  Branch (1872:57): [True: 23.6k, False: 8]
  ------------------
 1873|  23.6k|    {
 1874|  23.6k|        if (node->implicit) /* Is #709 - improve warning text */
  ------------------
  |  Branch (1874:13): [True: 22.6k, False: 965]
  ------------------
 1875|  22.6k|            TY_(ReportAttrError)(doc, node, attval, ANCHOR_DUPLICATED);
  ------------------
  |  |   23|  22.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1876|    965|        else
 1877|    965|            TY_(ReportAttrError)( doc, node, attval, ANCHOR_NOT_UNIQUE);
  ------------------
  |  |   23|    965|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    965|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1878|  23.6k|    }
 1879|  40.8k|    else
 1880|  40.8k|        AddAnchor( doc, attval->value, node );
 1881|  64.4k|}
attrs.c:GetNodeByAnchor:
 1228|  69.5k|{
 1229|  69.5k|    TidyAttribImpl* attribs = &doc->attribs;
 1230|  69.5k|    Anchor *found;
 1231|  69.5k|    uint h;
 1232|  69.5k|    tmbstr lname = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|  69.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  69.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1233|  69.5k|    if (TY_(HTMLVersion)(doc) == HT50) {
  ------------------
  |  |   23|  69.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  69.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (TY_(HTMLVersion)(doc) == HT50) {
  ------------------
  |  |  200|  69.5k|#define HT50              131072u
  ------------------
  |  Branch (1233:9): [True: 0, False: 69.5k]
  ------------------
 1234|      0|        h = anchorNameHash5(name);
 1235|      0|    }
 1236|  69.5k|    else
 1237|  69.5k|    {
 1238|  69.5k|        h = anchorNameHash(name);
 1239|  69.5k|        lname = TY_(tmbstrtolower)(lname);
  ------------------
  |  |   23|  69.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  69.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1240|  69.5k|    }
 1241|       |
 1242|  21.6M|    for ( found = attribs->anchor_hash[h]; found != NULL; found = found->next )
  ------------------
  |  Branch (1242:44): [True: 21.5M, False: 41.5k]
  ------------------
 1243|  21.5M|    {
 1244|  21.5M|        if ( TY_(tmbstrcmp)(found->name, lname) == 0 )
  ------------------
  |  |   23|  21.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1244:14): [True: 28.0k, False: 21.5M]
  ------------------
 1245|  28.0k|            break;
 1246|  21.5M|    }
 1247|       |    
 1248|  69.5k|    TidyDocFree(doc, lname);
  ------------------
  |  |  159|  69.5k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  69.5k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1249|  69.5k|    if ( found )
  ------------------
  |  Branch (1249:10): [True: 28.0k, False: 41.5k]
  ------------------
 1250|  28.0k|        return found->node;
 1251|  41.5k|    return NULL;
 1252|  69.5k|}
attrs.c:AddAnchor:
 1200|  41.5k|{
 1201|  41.5k|    TidyAttribImpl* attribs = &doc->attribs;
 1202|  41.5k|    Anchor *a = NewAnchor( doc, name, node );
 1203|  41.5k|    uint h;
 1204|  41.5k|    if (TY_(HTMLVersion)(doc) == HT50)
  ------------------
  |  |   23|  41.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (TY_(HTMLVersion)(doc) == HT50)
  ------------------
  |  |  200|  41.5k|#define HT50              131072u
  ------------------
  |  Branch (1204:9): [True: 0, False: 41.5k]
  ------------------
 1205|      0|        h = anchorNameHash5(name);
 1206|  41.5k|    else
 1207|  41.5k|        h = anchorNameHash(name);
 1208|       |
 1209|  41.5k|    if ( attribs->anchor_hash[h] == NULL)
  ------------------
  |  Branch (1209:10): [True: 2.45k, False: 39.0k]
  ------------------
 1210|  2.45k|         attribs->anchor_hash[h] = a;
 1211|  39.0k|    else
 1212|  39.0k|    {
 1213|  39.0k|        Anchor *here =  attribs->anchor_hash[h];
 1214|  21.5M|        while (here->next)
  ------------------
  |  Branch (1214:16): [True: 21.5M, False: 39.0k]
  ------------------
 1215|  21.5M|            here = here->next;
 1216|  39.0k|        here->next = a;
 1217|  39.0k|    }
 1218|       |
 1219|  41.5k|    return attribs->anchor_hash[h];
 1220|  41.5k|}
attrs.c:NewAnchor:
 1182|  41.5k|{
 1183|  41.5k|    Anchor *a = (Anchor*) TidyDocAlloc( doc, sizeof(Anchor) );
  ------------------
  |  |  157|  41.5k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  41.5k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 1184|       |
 1185|  41.5k|    a->name = TY_(tmbstrdup)( doc->allocator, name );
  ------------------
  |  |   23|  41.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1186|  41.5k|    if (!TY_(IsHTML5Mode)(doc)) /* Is. #726 - if NOT HTML5, to lowercase */
  ------------------
  |  |   23|  41.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1186:9): [True: 213, False: 41.3k]
  ------------------
 1187|    213|        a->name = TY_(tmbstrtolower)(a->name);
  ------------------
  |  |   23|    213|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    213|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1188|  41.5k|    a->node = node;
 1189|  41.5k|    a->next = NULL;
 1190|       |
 1191|  41.5k|    return a;
 1192|  41.5k|}
attrs.c:CheckIs:
 1884|    826|{
 1885|    826|    const char *ptr;
 1886|    826|    Bool go = yes;
 1887|       |
 1888|       |    /* `is` MUST NOT be in an autonomous custom tag */
 1889|    826|    ptr = strchr(node->element, '-');
 1890|    826|    if ( ( ptr && (ptr - node->element > 0) ) )
  ------------------
  |  Branch (1890:12): [True: 0, False: 826]
  |  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|    826|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|    826|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 826, False: 0]
  |  |  |  Branch (171:44): [True: 618, False: 208]
  |  |  ------------------
  ------------------
 1901|    208|    {
 1902|    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
  |  |  ------------------
  ------------------
 1903|    208|        return;
 1904|    208|    }
 1905|       |
 1906|       |    /* `is` MUST contain a hyphen and no space. */
 1907|    618|    ptr = strchr(attval->value, '-');
 1908|    618|    go = ( ptr && (ptr - attval->value > 0) );
  ------------------
  |  Branch (1908:12): [True: 199, False: 419]
  |  Branch (1908:19): [True: 198, False: 1]
  ------------------
 1909|    618|    ptr = strchr(attval->value, ' ');
 1910|    618|    go = go & (ptr == NULL);
 1911|    618|    if ( !go )
  ------------------
  |  Branch (1911:10): [True: 420, False: 198]
  ------------------
 1912|    420|    {
 1913|    420|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    420|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    420|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1914|    420|    }
 1915|    618|}
attrs.c:CheckFsubmit:
 2051|    277|{
 2052|       |    ctmbstr const values[] = {"get", "post", NULL};
 2053|    277|    CheckAttrValidity( doc, node, attval, values );
 2054|    277|}
attrs.c:CheckName:
 1827|  6.40k|{
 1828|  6.40k|    Node *old;
 1829|       |
 1830|  6.40k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  6.40k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 6.40k, False: 0]
  |  |  |  Branch (171:44): [True: 5.43k, False: 973]
  |  |  ------------------
  ------------------
 1831|    973|    {
 1832|    973|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    973|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    973|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1833|    973|        return;
 1834|    973|    }
 1835|       |
 1836|  5.43k|    if ( TY_(IsAnchorElement)(doc, node) )
  ------------------
  |  |   23|  5.43k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.43k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1836:10): [True: 5.12k, False: 308]
  ------------------
 1837|  5.12k|    {
 1838|  5.12k|        if (cfgBool(doc, TidyXmlOut) && !IsValidNMTOKEN(attval->value))
  ------------------
  |  |  418|  10.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.12k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 5.12k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1838:41): [True: 3.55k, False: 1.57k]
  ------------------
 1839|  3.55k|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  3.55k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.55k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1840|       |
 1841|  5.12k|        if ((old = GetNodeByAnchor(doc, attval->value)) &&  old != node)
  ------------------
  |  Branch (1841:13): [True: 4.39k, False: 731]
  |  Branch (1841:61): [True: 4.39k, False: 2]
  ------------------
 1842|  4.39k|        {
 1843|  4.39k|            if (node->implicit) /* Is #709 - improve warning text */
  ------------------
  |  Branch (1843:17): [True: 2.75k, False: 1.64k]
  ------------------
 1844|  2.75k|                TY_(ReportAttrError)(doc, node, attval, ANCHOR_DUPLICATED);
  ------------------
  |  |   23|  2.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1845|  1.64k|            else
 1846|  1.64k|                TY_(ReportAttrError)( doc, node, attval, ANCHOR_NOT_UNIQUE);
  ------------------
  |  |   23|  1.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1847|  4.39k|        }
 1848|    733|        else
 1849|    733|            AddAnchor( doc, attval->value, node );
 1850|  5.12k|    }
 1851|  5.43k|}
attrs.c:IsValidNMTOKEN:
 1779|  5.12k|{
 1780|  5.12k|    ctmbstr s = name;
 1781|  5.12k|    tchar c;
 1782|       |
 1783|  5.12k|    if (!s)
  ------------------
  |  Branch (1783:9): [True: 0, False: 5.12k]
  ------------------
 1784|      0|        return no;
 1785|       |
 1786|  23.8k|    while (*s)
  ------------------
  |  Branch (1786:12): [True: 22.2k, False: 1.57k]
  ------------------
 1787|  22.2k|    {
 1788|  22.2k|        c = (unsigned char)*s;
 1789|       |
 1790|  22.2k|        if (c > 0x7F)
  ------------------
  |  Branch (1790:13): [True: 17.8k, False: 4.41k]
  ------------------
 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|  22.2k|        ++s;
 1794|       |
 1795|  22.2k|        if (!TY_(IsXMLNamechar)(c))
  ------------------
  |  |   23|  22.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1795:13): [True: 3.55k, False: 18.7k]
  ------------------
 1796|  3.55k|            return no;
 1797|  22.2k|    }
 1798|       |
 1799|  1.57k|    return yes;
 1800|  5.12k|}
attrs.c:CheckScope:
 2081|    204|{
 2082|       |    ctmbstr const values[] = {"row", "rowgroup", "col", "colgroup", NULL};
 2083|    204|    CheckAttrValidity( doc, node, attval, values );
 2084|    204|}
attrs.c:CheckScroll:
 2203|    402|{
 2204|       |    ctmbstr const values[] = {"no", "auto", "yes", NULL};
 2205|    402|    CheckAttrValidity( doc, node, attval, values );
 2206|    402|}
attrs.c:CheckShape:
 2075|    217|{
 2076|       |    ctmbstr const values[] = {"rect", "default", "circle", "poly", NULL};
 2077|    217|    CheckAttrValidity( doc, node, attval, values );
 2078|    217|}
attrs.c:CheckTarget:
 2032|  1.68k|{
 2033|  1.68k|    ctmbstr const values[] = {"_blank", "_self", "_parent", "_top", NULL};
 2034|       |
 2035|  1.68k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.68k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.68k, False: 0]
  |  |  |  Branch (171:44): [True: 1.29k, False: 388]
  |  |  ------------------
  ------------------
 2036|    388|    {
 2037|    388|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    388|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    388|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2038|    388|        return;
 2039|    388|    }
 2040|       |
 2041|       |    /* target names must begin with A-Za-z ... */
 2042|  1.29k|    if (TY_(IsLetter)(attval->value[0]))
  ------------------
  |  |   23|  1.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2042:9): [True: 196, False: 1.09k]
  ------------------
 2043|    196|        return;
 2044|       |
 2045|       |    /* or be one of the allowed list */
 2046|  1.09k|    if (!AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2046:9): [True: 646, False: 453]
  ------------------
 2047|    646|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    646|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    646|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2048|  1.09k|}
attrs.c:CheckType:
 2241|  3.60k|{
 2242|  3.60k|    ctmbstr const valuesINPUT[] = {
 2243|  3.60k|        "text", "password", "checkbox", "radio", "submit", "reset", "file",
 2244|  3.60k|        "hidden", "image", "button", "color", "date", "datetime",
 2245|  3.60k|        "datetime-local", "email", "month", "number", "range", "search",
 2246|  3.60k|        "tel", "time", "url", "week", NULL};
 2247|  3.60k|    ctmbstr const valuesBUTTON[] = {"button", "submit", "reset", NULL};
 2248|  3.60k|    ctmbstr const valuesUL[] = {"disc", "square", "circle", NULL};
 2249|  3.60k|    ctmbstr const valuesOL[] = {"1", "a", "i", NULL};
 2250|       |
 2251|  3.60k|    if (nodeIsINPUT(node))
  ------------------
  |  |  431|  3.60k|#define nodeIsINPUT( node )      TagIsId( node, TidyTag_INPUT )
  |  |  ------------------
  |  |  |  |  275|  3.60k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.60k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.60k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 230, False: 3.37k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2252|    230|        CheckAttrValidity( doc, node, attval, valuesINPUT );
 2253|  3.37k|    else if (nodeIsBUTTON(node))
  ------------------
  |  |  453|  3.37k|#define nodeIsBUTTON( node )     TagIsId( node, TidyTag_BUTTON )
  |  |  ------------------
  |  |  |  |  275|  3.37k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.37k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.37k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 268, False: 3.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2254|    268|        CheckAttrValidity( doc, node, attval, valuesBUTTON );
 2255|  3.10k|    else if (nodeIsUL(node))
  ------------------
  |  |  386|  3.10k|#define nodeIsUL( node )         TagIsId( node, TidyTag_UL )
  |  |  ------------------
  |  |  |  |  275|  3.10k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.10k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.10k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 215, False: 2.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2256|    215|        CheckAttrValidity( doc, node, attval, valuesUL );
 2257|  2.89k|    else if (nodeIsOL(node))
  ------------------
  |  |  387|  2.89k|#define nodeIsOL( node )         TagIsId( node, TidyTag_OL )
  |  |  ------------------
  |  |  |  |  275|  2.89k|#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: 728, False: 2.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2258|    728|    {
 2259|    728|        if (!AttrHasValue(attval))
  ------------------
  |  |  171|    728|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 728, False: 0]
  |  |  |  Branch (171:44): [True: 532, 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|    532|        if (!AttrValueIsAmong(attval, valuesOL))
  ------------------
  |  Branch (2264:13): [True: 272, False: 260]
  ------------------
 2265|    272|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    272|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    272|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2266|    532|    }
 2267|  2.16k|    else if (nodeIsLI(node))
  ------------------
  |  |  390|  2.16k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|  2.16k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.16k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.16k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.24k, False: 922]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2268|  1.24k|    {
 2269|  1.24k|        if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.24k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.24k, False: 0]
  |  |  |  Branch (171:44): [True: 1.04k, False: 196]
  |  |  ------------------
  ------------------
 2270|    196|        {
 2271|    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
  |  |  ------------------
  ------------------
 2272|    196|            return;
 2273|    196|        }
 2274|  1.04k|        if (AttrValueIsAmong(attval, valuesUL))
  ------------------
  |  Branch (2274:13): [True: 496, False: 551]
  ------------------
 2275|    496|            CheckLowerCaseAttrValue( doc, node, attval );
 2276|    551|        else if (!AttrValueIsAmong(attval, valuesOL))
  ------------------
  |  Branch (2276:18): [True: 356, False: 195]
  ------------------
 2277|    356|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    356|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    356|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2278|  1.04k|    }
 2279|  3.21k|    return;
 2280|  3.60k|}
attrs.c:CheckValign:
 1959|  2.28k|{
 1960|  2.28k|    ctmbstr const values[] = {"top", "middle", "bottom", "baseline", NULL};
 1961|  2.28k|    ctmbstr const values2[] = {"left", "right", NULL};
 1962|  2.28k|    ctmbstr const valuesp[] = {"texttop", "absmiddle", "absbottom",
 1963|  2.28k|                               "textbottom", NULL};
 1964|       |
 1965|  2.28k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  2.28k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 2.28k, False: 0]
  |  |  |  Branch (171:44): [True: 1.88k, False: 394]
  |  |  ------------------
  ------------------
 1966|    394|    {
 1967|    394|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    394|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    394|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1968|    394|        return;
 1969|    394|    }
 1970|       |
 1971|  1.88k|    CheckLowerCaseAttrValue( doc, node, attval );
 1972|       |
 1973|  1.88k|    if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (1973:9): [True: 214, False: 1.67k]
  ------------------
 1974|    214|    {
 1975|       |            /* all is fine */
 1976|    214|    }
 1977|  1.67k|    else if (AttrValueIsAmong(attval, values2))
  ------------------
  |  Branch (1977:14): [True: 391, False: 1.28k]
  ------------------
 1978|    391|    {
 1979|    391|        if (!(node->tag && (node->tag->model & CM_IMG)))
  ------------------
  |  |  155|    391|#define CM_IMG          (1 << 16)  /**< Elements that use "align" attribute for vertical position. */
  ------------------
  |  Branch (1979:15): [True: 391, False: 0]
  |  Branch (1979:28): [True: 195, False: 196]
  ------------------
 1980|    196|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    196|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    196|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1981|    391|    }
 1982|  1.28k|    else if (AttrValueIsAmong(attval, valuesp))
  ------------------
  |  Branch (1982:14): [True: 199, False: 1.08k]
  ------------------
 1983|    199|    {
 1984|    199|        TY_(ConstrainVersion)( doc, VERS_PROPRIETARY );
  ------------------
  |  |   23|    199|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    199|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(ConstrainVersion)( doc, VERS_PROPRIETARY );
  ------------------
  |  |  231|    199|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|    199|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|    199|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|    199|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
 1985|    199|        TY_(ReportAttrError)( doc, node, attval, PROPRIETARY_ATTR_VALUE);
  ------------------
  |  |   23|    199|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    199|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1986|    199|    }
 1987|  1.08k|    else
 1988|  1.08k|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  1.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1989|  1.88k|}
attrs.c:CheckVType:
 2196|    473|{
 2197|       |    ctmbstr const values[] = {"data", "object", "ref", NULL};
 2198|    473|    CheckAttrValidity( doc, node, attval, values );
 2199|    473|}
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|    404|{
 2748|    404|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|    404|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 404, False: 0]
  |  |  |  Branch (171:44): [True: 199, False: 205]
  |  |  ------------------
  ------------------
 2749|    205|    {
 2750|    205|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    205|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    205|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2751|    205|        return;
 2752|    205|    }
 2753|       |
 2754|    404|}
attrs.c:CheckRDFaPrefix:
 2691|  1.57k|{
 2692|  1.57k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.57k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.57k, False: 0]
  |  |  |  Branch (171:44): [True: 1.36k, False: 206]
  |  |  ------------------
  ------------------
 2693|    206|    {
 2694|    206|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    206|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    206|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2695|    206|        return;
 2696|    206|    }
 2697|       |
 2698|       |    /* Copy the attribute value so we can split it */
 2699|  1.36k|    if (attval->value) {
  ------------------
  |  Branch (2699:9): [True: 1.36k, False: 0]
  ------------------
 2700|  1.36k|        tmbstr t, tPtr ;
 2701|       |
 2702|  1.36k|        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.36k|        uint isPrefix = 1;
 2706|       |
 2707|       |        /* Copy it over */
 2708|       |
 2709|  1.36k|        uint len = TY_(tmbstrlen)(attval->value);
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2710|  1.36k|        tmbstr s = (tmbstr) TidyDocAlloc( doc, len + 1 );
  ------------------
  |  |  157|  1.36k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  1.36k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 2711|  1.36k|        s[0] = '\0';
 2712|  1.36k|        TY_(tmbstrcpy)( s, attval->value );
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2713|       |
 2714|       |        /* iterate over value */
 2715|  1.36k|        tPtr = s;
 2716|       |
 2717|  69.0k|        while ( ( t = strtok(tPtr, " ") ) != NULL ) {
  ------------------
  |  Branch (2717:17): [True: 67.7k, False: 1.36k]
  ------------------
 2718|  67.7k|            tPtr = NULL;
 2719|  67.7k|            if (isPrefix) {
  ------------------
  |  Branch (2719:17): [True: 34.3k, False: 33.3k]
  ------------------
 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|  34.3k|                tmbstr i = strchr(t, ':') ;
 2725|  34.3k|                if (i == NULL) {
  ------------------
  |  Branch (2725:21): [True: 33.4k, False: 893]
  ------------------
 2726|       |                    /* no colon - bad! */
 2727|  33.4k|                    TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  33.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  33.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2728|  33.4k|                } else if (i != ( t + TY_(tmbstrlen)(t) - 1) ) {
  ------------------
  |  |   23|    893|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    893|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2728:28): [True: 196, False: 697]
  ------------------
 2729|       |                    /* not at the end - also bad */
 2730|    196|                    TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    196|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    196|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2731|    196|                }
 2732|  34.3k|            } else {
 2733|       |                /* this piece should be a URL */
 2734|  33.3k|                prefixCount ++;
 2735|  33.3k|            }
 2736|  67.7k|            isPrefix = !isPrefix;
 2737|  67.7k|        }
 2738|  1.36k|        TidyDocFree( doc, s ) ;
  ------------------
  |  |  159|  1.36k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  1.36k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2739|  1.36k|    }
 2740|  1.36k|}
attrs.c:CheckLoading:
 2234|    194|{
 2235|       |    ctmbstr const values[] = {"lazy", "eager", NULL};
 2236|    194|    CheckAttrValidity( doc, node, attval, values );
 2237|    194|}
attrs.c:CheckSvgAttr:
 2335|  5.06k|{
 2336|  5.06k|    if (!nodeIsSVG(node))
  ------------------
  |  |  460|  5.06k|#define nodeIsSVG( node )        TagIsId( node, TidyTag_SVG )
  |  |  ------------------
  |  |  |  |  275|  5.06k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.06k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.06k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.86k, False: 198]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2337|    198|    {
 2338|    198|        TY_(ReportAttrError)(doc, node, attval, ATTRIBUTE_IS_NOT_ALLOWED);
  ------------------
  |  |   23|    198|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    198|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2339|    198|        return;
 2340|    198|    }
 2341|       |
 2342|       |    /* Issue #903 - check SVG paint attributes */
 2343|  4.86k|    if (IsSvgPaintAttr(attval))
  ------------------
  |  Branch (2343:9): [True: 4.86k, False: 0]
  ------------------
 2344|  4.86k|    {
 2345|       |        /* all valid paint attributes have values */
 2346|  4.86k|        if (!AttrHasValue(attval))
  ------------------
  |  |  171|  4.86k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 4.86k, False: 0]
  |  |  |  Branch (171:44): [True: 4.63k, False: 233]
  |  |  ------------------
  ------------------
 2347|    233|        {
 2348|    233|            TY_(ReportAttrError)(doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    233|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    233|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2349|    233|            return;
 2350|    233|        }
 2351|       |        /* all paint attributes support an 'inherit' value,
 2352|       |        per https://dev.w3.org/SVG/profiles/1.1F2/publish/painting.html#SpecifyingPaint */
 2353|  4.63k|        if (AttrValueIs(attval, "inherit"))
  ------------------
  |  |  172|  4.63k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  9.26k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 4.63k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 4.63k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  4.63k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  4.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  4.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 4.63k]
  |  |  ------------------
  ------------------
 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.63k|        if (attrIsSVG_FILL(attval) || attrIsSVG_STROKE(attval))
  ------------------
  |  |  378|  4.63k|#define attrIsSVG_FILL(av)              AttrIsId( av,  TidyAttr_FILL  )
  |  |  ------------------
  |  |  |  |  169|  9.26k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.63k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.63k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 232, False: 4.40k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (attrIsSVG_FILL(attval) || attrIsSVG_STROKE(attval))
  ------------------
  |  |  380|  4.40k|#define attrIsSVG_STROKE(av)            AttrIsId( av,  TidyAttr_STROKE  )
  |  |  ------------------
  |  |  |  |  169|  4.40k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.40k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.40k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 390, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2362|    622|        {
 2363|       |            /* TODO: support funciri */
 2364|    622|            static ctmbstr const values[] = {
 2365|    622|                "none", "currentColor", NULL};
 2366|       |
 2367|    622|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2367:17): [True: 335, False: 287]
  ------------------
 2368|    335|                CheckLowerCaseAttrValue(doc, node, attval);
 2369|    287|            else
 2370|    287|                CheckColor(doc, node, attval);
 2371|    622|        } 
 2372|  4.01k|        else if (attrIsSVG_FILLRULE(attval))
  ------------------
  |  |  379|  4.01k|#define attrIsSVG_FILLRULE(av)          AttrIsId( av,  TidyAttr_FILLRULE  )
  |  |  ------------------
  |  |  |  |  169|  4.01k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.01k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.01k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 264, False: 3.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2373|    264|        {
 2374|    264|            static ctmbstr const values[] = {"nonzero", "evenodd", NULL};
 2375|       |
 2376|    264|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2376:17): [True: 67, False: 197]
  ------------------
 2377|     67|                CheckLowerCaseAttrValue(doc, node, attval);
 2378|    197|            else
 2379|    197|                TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    197|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    197|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2380|    264|        }
 2381|  3.74k|        else if (attrIsSVG_STROKEDASHARRAY(attval))
  ------------------
  |  |  381|  3.74k|#define attrIsSVG_STROKEDASHARRAY(av)   AttrIsId( av,  TidyAttr_STROKEDASHARRAY  )
  |  |  ------------------
  |  |  |  |  169|  3.74k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.74k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.74k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 579, False: 3.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2382|    579|        {
 2383|    579|            static ctmbstr const values[] = {"none", NULL};
 2384|       |
 2385|    579|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2385:17): [True: 216, False: 363]
  ------------------
 2386|    216|                CheckLowerCaseAttrValue(doc, node, attval);
 2387|    363|            else
 2388|    363|            {
 2389|       |                /* TODO: process dash arrays */
 2390|    363|            }
 2391|    579|        }
 2392|  3.16k|        else if (attrIsSVG_STROKEDASHOFFSET(attval))
  ------------------
  |  |  382|  3.16k|#define attrIsSVG_STROKEDASHOFFSET(av)  AttrIsId( av,  TidyAttr_STROKEDASHOFFSET  )
  |  |  ------------------
  |  |  |  |  169|  3.16k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.16k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.16k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 202, False: 2.96k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2393|    202|        {
 2394|    202|            CheckLength(doc, node, attval);
 2395|    202|        }
 2396|  2.96k|        else if (attrIsSVG_STROKELINECAP(attval))
  ------------------
  |  |  383|  2.96k|#define attrIsSVG_STROKELINECAP(av)     AttrIsId( av,  TidyAttr_STROKELINECAP  )
  |  |  ------------------
  |  |  |  |  169|  2.96k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.96k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.96k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 439, False: 2.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2397|    439|        {
 2398|    439|            static ctmbstr const values[] = {"butt", "round", "square", NULL};
 2399|       |
 2400|    439|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2400:17): [True: 206, False: 233]
  ------------------
 2401|    206|                CheckLowerCaseAttrValue(doc, node, attval);
 2402|    233|            else
 2403|    233|                TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    233|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    233|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2404|    439|        }
 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: 576, False: 1.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2406|    576|        {
 2407|    576|            static ctmbstr const values[] = {"miter", "round", "bevel", NULL};
 2408|       |
 2409|    576|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2409:17): [True: 216, False: 360]
  ------------------
 2410|    216|                CheckLowerCaseAttrValue(doc, node, attval);
 2411|    360|            else
 2412|    360|                TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    360|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    360|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2413|    576|        }
 2414|  1.95k|        else if (attrIsSVG_STROKEMITERLIMIT(attval))
  ------------------
  |  |  385|  1.95k|#define attrIsSVG_STROKEMITERLIMIT(av)  AttrIsId( av,  TidyAttr_STROKEMITERLIMIT  )
  |  |  ------------------
  |  |  |  |  169|  1.95k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.95k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.95k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 305, False: 1.64k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2415|    305|        {
 2416|    305|            CheckNumber(doc, node, attval);
 2417|    305|        }
 2418|  1.64k|        else if (attrIsSVG_STROKEWIDTH(attval))
  ------------------
  |  |  386|  1.64k|#define attrIsSVG_STROKEWIDTH(av)       AttrIsId( av,  TidyAttr_STROKEWIDTH  )
  |  |  ------------------
  |  |  |  |  169|  1.64k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.64k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.64k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 203, False: 1.44k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2419|    203|        {
 2420|    203|            CheckLength(doc, node, attval);
 2421|    203|        }
 2422|  1.44k|        else if (attrIsSVG_COLORINTERPOLATION(attval))
  ------------------
  |  |  387|  1.44k|#define attrIsSVG_COLORINTERPOLATION(a) AttrIsId(  a,  TidyAttr_COLORINTERPOLATION  )
  |  |  ------------------
  |  |  |  |  169|  1.44k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.44k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.44k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.44k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.44k|        else if (attrIsSVG_COLORRENDERING(attval))
  ------------------
  |  |  388|  1.44k|#define attrIsSVG_COLORRENDERING(av)    AttrIsId( av,  TidyAttr_COLORRENDERING  )
  |  |  ------------------
  |  |  |  |  169|  1.44k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.44k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.44k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.44k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.44k|        else if(attrIsSVG_OPACITY(attval))
  ------------------
  |  |  389|  1.44k|#define attrIsSVG_OPACITY(av)           AttrIsId( av,  TidyAttr_OPACITY  )
  |  |  ------------------
  |  |  |  |  169|  1.44k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.44k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.44k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 804, False: 638]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2442|    804|        {
 2443|    804|            CheckDecimal(doc, node, attval);
 2444|    804|        }
 2445|    638|        else if(attrIsSVG_STROKEOPACITY(attval))
  ------------------
  |  |  390|    638|#define attrIsSVG_STROKEOPACITY(av)     AttrIsId( av,  TidyAttr_STROKEOPACITY  )
  |  |  ------------------
  |  |  |  |  169|    638|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 638, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 638, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 201, False: 437]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2446|    201|        {
 2447|    201|            CheckDecimal(doc, node, attval);
 2448|    201|        }
 2449|    437|        else if(attrIsSVG_FILLOPACITY(attval))
  ------------------
  |  |  391|    437|#define attrIsSVG_FILLOPACITY(av)       AttrIsId( av,  TidyAttr_FILLOPACITY  )
  |  |  ------------------
  |  |  |  |  169|    437|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 437, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 437, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 437, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2450|    437|        {
 2451|    437|            CheckDecimal(doc, node, attval);
 2452|    437|        }
 2453|  4.63k|    }
 2454|  4.86k|}
attrs.c:IsSvgPaintAttr:
 2315|  4.86k|{
 2316|  4.86k|    return attrIsCOLOR(attval)
  ------------------
  |  |  212|  4.86k|#define attrIsCOLOR(av)             AttrIsId( av, TidyAttr_COLOR  )
  |  |  ------------------
  |  |  |  |  169|  9.73k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.86k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.86k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 4.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2317|  4.86k|        || attrIsSVG_FILL(attval)
  ------------------
  |  |  378|  4.86k|#define attrIsSVG_FILL(av)              AttrIsId( av,  TidyAttr_FILL  )
  |  |  ------------------
  |  |  |  |  169|  9.73k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.86k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.86k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 427, False: 4.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2318|  4.86k|        || attrIsSVG_FILLRULE(attval)
  ------------------
  |  |  379|  4.43k|#define attrIsSVG_FILLRULE(av)          AttrIsId( av,  TidyAttr_FILLRULE  )
  |  |  ------------------
  |  |  |  |  169|  9.30k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.43k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.43k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 265, False: 4.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2319|  4.86k|        || attrIsSVG_STROKE(attval)
  ------------------
  |  |  380|  4.17k|#define attrIsSVG_STROKE(av)            AttrIsId( av,  TidyAttr_STROKE  )
  |  |  ------------------
  |  |  |  |  169|  9.03k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.17k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.17k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 402, False: 3.77k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2320|  4.86k|        || attrIsSVG_STROKEDASHARRAY(attval)
  ------------------
  |  |  381|  3.77k|#define attrIsSVG_STROKEDASHARRAY(av)   AttrIsId( av,  TidyAttr_STROKEDASHARRAY  )
  |  |  ------------------
  |  |  |  |  169|  8.63k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.77k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.77k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 579, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2321|  4.86k|        || attrIsSVG_STROKEDASHOFFSET(attval)
  ------------------
  |  |  382|  3.19k|#define attrIsSVG_STROKEDASHOFFSET(av)  AttrIsId( av,  TidyAttr_STROKEDASHOFFSET  )
  |  |  ------------------
  |  |  |  |  169|  8.05k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.19k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.19k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 203, False: 2.98k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2322|  4.86k|        || attrIsSVG_STROKELINECAP(attval)
  ------------------
  |  |  383|  2.98k|#define attrIsSVG_STROKELINECAP(av)     AttrIsId( av,  TidyAttr_STROKELINECAP  )
  |  |  ------------------
  |  |  |  |  169|  7.85k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.98k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.98k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 444, False: 2.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2323|  4.86k|        || attrIsSVG_STROKELINEJOIN(attval)
  ------------------
  |  |  384|  2.54k|#define attrIsSVG_STROKELINEJOIN(av)    AttrIsId( av,  TidyAttr_STROKELINEJOIN  )
  |  |  ------------------
  |  |  |  |  169|  7.41k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.54k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.54k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 578, False: 1.96k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2324|  4.86k|        || attrIsSVG_STROKEMITERLIMIT(attval)
  ------------------
  |  |  385|  1.96k|#define attrIsSVG_STROKEMITERLIMIT(av)  AttrIsId( av,  TidyAttr_STROKEMITERLIMIT  )
  |  |  ------------------
  |  |  |  |  169|  6.83k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.96k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.96k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 305, False: 1.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2325|  4.86k|        || attrIsSVG_STROKEWIDTH(attval)
  ------------------
  |  |  386|  1.66k|#define attrIsSVG_STROKEWIDTH(av)       AttrIsId( av,  TidyAttr_STROKEWIDTH  )
  |  |  ------------------
  |  |  |  |  169|  6.52k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.66k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.66k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 204, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2326|  4.86k|        || attrIsSVG_COLORINTERPOLATION(attval)
  ------------------
  |  |  387|  1.45k|#define attrIsSVG_COLORINTERPOLATION(a) AttrIsId(  a,  TidyAttr_COLORINTERPOLATION  )
  |  |  ------------------
  |  |  |  |  169|  6.32k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.45k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.45k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2327|  4.86k|        || attrIsSVG_COLORRENDERING(attval)
  ------------------
  |  |  388|  1.45k|#define attrIsSVG_COLORRENDERING(av)    AttrIsId( av,  TidyAttr_COLORRENDERING  )
  |  |  ------------------
  |  |  |  |  169|  6.32k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.45k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.45k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2328|  4.86k|        || attrIsSVG_OPACITY(attval)
  ------------------
  |  |  389|  1.45k|#define attrIsSVG_OPACITY(av)           AttrIsId( av,  TidyAttr_OPACITY  )
  |  |  ------------------
  |  |  |  |  169|  6.32k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.45k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.45k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 808, False: 650]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2329|  4.86k|        || attrIsSVG_STROKEOPACITY(attval)
  ------------------
  |  |  390|    650|#define attrIsSVG_STROKEOPACITY(av)     AttrIsId( av,  TidyAttr_STROKEOPACITY  )
  |  |  ------------------
  |  |  |  |  169|  5.51k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 650, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 650, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 201, False: 449]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2330|  4.86k|        || attrIsSVG_FILLOPACITY(attval);
  ------------------
  |  |  391|    449|#define attrIsSVG_FILLOPACITY(av)       AttrIsId( av,  TidyAttr_FILLOPACITY  )
  |  |  ------------------
  |  |  |  |  169|  5.31k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 449, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 449, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 449, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2331|  4.86k|}
attrs.c:CheckDecimal:
 2283|  1.44k|{
 2284|  1.44k|    tmbstr p;
 2285|  1.44k|    Bool hasPoint = no;
 2286|       |
 2287|  1.44k|    p  = attval->value;
 2288|       |
 2289|       |    /* Allow leading sign */
 2290|  1.44k|    if (*p == '+' || *p == '-')
  ------------------
  |  Branch (2290:9): [True: 401, False: 1.04k]
  |  Branch (2290:22): [True: 245, False: 796]
  ------------------
 2291|    646|        ++p;
 2292|       |
 2293|  2.54k|    while (*p)
  ------------------
  |  Branch (2293:12): [True: 2.12k, False: 415]
  ------------------
 2294|  2.12k|    {
 2295|       |        /* Allow a single decimal point */
 2296|  2.12k|        if (*p == '.')
  ------------------
  |  Branch (2296:13): [True: 197, False: 1.92k]
  ------------------
 2297|    197|        {
 2298|    197|            if (!hasPoint)
  ------------------
  |  Branch (2298:17): [True: 197, False: 0]
  ------------------
 2299|    197|                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|    197|                break;
 2303|    197|        }
 2304|       |        
 2305|  1.92k|        if (!TY_(IsDigit)(*p))
  ------------------
  |  |   23|  1.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2305:13): [True: 830, False: 1.09k]
  ------------------
 2306|    830|        {
 2307|    830|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    830|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    830|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2308|    830|            break;
 2309|    830|        }
 2310|  1.09k|        ++p;
 2311|  1.09k|    }
 2312|  1.44k|}
attrs.c:attrsInstall:
  775|  72.5k|{
  776|  72.5k|    AttrHash *np;
  777|  72.5k|    uint hashval;
  778|       |
  779|  72.5k|    if (old)
  ------------------
  |  Branch (779:9): [True: 72.5k, False: 0]
  ------------------
  780|  72.5k|    {
  781|  72.5k|        np = (AttrHash *)TidyDocAlloc(doc, sizeof(*np));
  ------------------
  |  |  157|  72.5k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  72.5k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  782|  72.5k|        np->attr = old;
  783|       |
  784|  72.5k|        hashval = attrsHash(old->name);
  785|  72.5k|        np->next = attribs->hashtab[hashval];
  786|  72.5k|        attribs->hashtab[hashval] = np;
  787|  72.5k|    }
  788|       |
  789|  72.5k|    return old;
  790|  72.5k|}
attrs.c:CheckAttrType:
 1018|  17.4k|{
 1019|  17.4k|    const Attribute* np = attrsLookup( doc, &doc->attribs, attrname );
 1020|  17.4k|    return (Bool)( np && np->attrchk == type );
  ------------------
  |  Branch (1020:20): [True: 8.82k, False: 8.59k]
  |  Branch (1020:26): [True: 7.13k, False: 1.68k]
  ------------------
 1021|  17.4k|}
attrs.c:anchorNameHash:
 1114|   122k|{
 1115|   122k|    uint hashval = 0;
 1116|       |    /* Issue #149 - an inferred name can be null. avoid crash */
 1117|   122k|    if (s) 
  ------------------
  |  Branch (1117:9): [True: 121k, False: 1.91k]
  ------------------
 1118|   121k|    {
 1119|  3.26M|        for ( ; *s != '\0'; s++) {
  ------------------
  |  Branch (1119:17): [True: 3.14M, False: 121k]
  ------------------
 1120|  3.14M|            tmbchar c = TY_(ToLower)( *s );
  ------------------
  |  |   23|  3.14M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.14M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1121|  3.14M|            hashval = c + 31*hashval;
 1122|  3.14M|        }
 1123|   121k|    }
 1124|   122k|    return hashval % ANCHOR_HASH_SIZE;
 1125|   122k|}
attrs.c:FreeAnchor:
 1107|  52.2k|{
 1108|  52.2k|    if ( a )
  ------------------
  |  Branch (1108:10): [True: 41.5k, False: 10.6k]
  ------------------
 1109|  52.2k|        TidyDocFree( doc, a->name );
  ------------------
  |  |  159|  41.5k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  41.5k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1110|  52.2k|    TidyDocFree( doc, a );
  ------------------
  |  |  159|  52.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  52.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1111|  52.2k|}
attrs.c:attrsEmptyHash:
  814|  21.3k|{
  815|  21.3k|    AttrHash *dict, *next;
  816|  21.3k|    uint i;
  817|       |
  818|  3.81M|    for (i = 0; i < ATTRIBUTE_HASH_SIZE; ++i)
  ------------------
  |  Branch (818:17): [True: 3.79M, False: 21.3k]
  ------------------
  819|  3.79M|    {
  820|  3.79M|        dict = attribs->hashtab[i];
  821|       |
  822|  3.86M|        while(dict)
  ------------------
  |  Branch (822:15): [True: 72.5k, False: 3.79M]
  ------------------
  823|  72.5k|        {
  824|  72.5k|            next = dict->next;
  825|  72.5k|            TidyDocFree(doc, dict);
  ------------------
  |  |  159|  72.5k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  72.5k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  826|  72.5k|            dict = next;
  827|  72.5k|        }
  828|       |
  829|       |        attribs->hashtab[i] = NULL;
  830|  3.79M|    }
  831|  21.3k|}
attrs.c:FreeDeclaredAttributes:
 1288|  21.3k|{
 1289|  21.3k|    TidyAttribImpl* attribs = &doc->attribs;
 1290|  21.3k|    Attribute* dict;
 1291|  21.3k|    while ( NULL != (dict = attribs->declared_attr_list) )
  ------------------
  |  Branch (1291:13): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|}
attrs.c:AttrsHaveSameName:
 1373|  40.6k|{
 1374|  40.6k|    TidyAttrId id1, id2;
 1375|       |
 1376|  40.6k|    id1 = AttrId(av1);
  ------------------
  |  |  168|  40.6k|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 40.6k, False: 0]
  |  |  |  Branch (168:29): [True: 13.2k, False: 27.4k]
  |  |  ------------------
  ------------------
 1377|  40.6k|    id2 = AttrId(av2);
  ------------------
  |  |  168|  40.6k|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 40.6k, False: 0]
  |  |  |  Branch (168:29): [True: 15.4k, False: 25.2k]
  |  |  ------------------
  ------------------
 1378|  40.6k|    if (id1 != TidyAttr_UNKNOWN && id2 != TidyAttr_UNKNOWN)
  ------------------
  |  Branch (1378:9): [True: 13.2k, False: 27.4k]
  |  Branch (1378:36): [True: 9.43k, False: 3.77k]
  ------------------
 1379|  9.43k|        return AttrsHaveSameId(av1, av2);
  ------------------
  |  |  178|  9.43k|#define AttrsHaveSameId(a, b) (a && b && a->dict && b->dict && a->dict->id && \
  |  |  ------------------
  |  |  |  Branch (178:32): [True: 9.43k, False: 0]
  |  |  |  Branch (178:37): [True: 9.43k, False: 0]
  |  |  |  Branch (178:42): [True: 9.43k, False: 0]
  |  |  |  Branch (178:53): [True: 9.43k, False: 0]
  |  |  |  Branch (178:64): [True: 9.43k, False: 0]
  |  |  ------------------
  |  |  179|  9.43k|                               b->dict->id && a->dict->id == b->dict->id)
  |  |  ------------------
  |  |  |  Branch (179:32): [True: 9.43k, False: 0]
  |  |  |  Branch (179:47): [True: 3.96k, False: 5.47k]
  |  |  ------------------
  ------------------
 1380|  31.2k|    if (id1 != TidyAttr_UNKNOWN || id2 != TidyAttr_UNKNOWN)
  ------------------
  |  Branch (1380:9): [True: 3.77k, False: 27.4k]
  |  Branch (1380:36): [True: 5.97k, False: 21.5k]
  ------------------
 1381|  9.74k|        return no;
 1382|  21.5k|    if (av1->attribute && av2->attribute)
  ------------------
  |  Branch (1382:9): [True: 20.9k, False: 535]
  |  Branch (1382:27): [True: 20.9k, False: 0]
  ------------------
 1383|  20.9k|        return TY_(tmbstrcmp)(av1->attribute, av2->attribute) == 0;
  ------------------
  |  |   23|  20.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1384|    535|     return no;
 1385|  21.5k|}
attrs.c:AppendToStyleAttr:
 1326|  1.24k|{
 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.24k|    uint end = TY_(tmbstrlen)(styleattr->value);
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1333|       |
 1334|  1.24k|    if (end >0 && styleattr->value[end - 1] == ';')
  ------------------
  |  Branch (1334:9): [True: 1.01k, False: 237]
  |  Branch (1334:19): [True: 222, False: 790]
  ------------------
 1335|    222|    {
 1336|       |        /* attribute ends with declaration separator */
 1337|       |
 1338|    222|        styleattr->value = (tmbstr) TidyDocRealloc(doc, styleattr->value,
  ------------------
  |  |  158|    222|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|    222|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
 1339|    222|            end + TY_(tmbstrlen)(styleprop) + 2);
 1340|       |
 1341|    222|        TY_(tmbstrcat)(styleattr->value, " ");
  ------------------
  |  |   23|    222|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    222|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1342|    222|        TY_(tmbstrcat)(styleattr->value, styleprop);
  ------------------
  |  |   23|    222|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    222|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1343|    222|    }
 1344|  1.02k|    else if (end >0 && styleattr->value[end - 1] == '}')
  ------------------
  |  Branch (1344:14): [True: 790, False: 237]
  |  Branch (1344:24): [True: 266, False: 524]
  ------------------
 1345|    266|    {
 1346|       |        /* attribute ends with rule set */
 1347|       |
 1348|    266|        styleattr->value = (tmbstr) TidyDocRealloc(doc, styleattr->value,
  ------------------
  |  |  158|    266|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|    266|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
 1349|    266|            end + TY_(tmbstrlen)(styleprop) + 6);
 1350|       |
 1351|    266|        TY_(tmbstrcat)(styleattr->value, " { ");
  ------------------
  |  |   23|    266|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    266|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1352|    266|        TY_(tmbstrcat)(styleattr->value, styleprop);
  ------------------
  |  |   23|    266|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    266|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1353|    266|        TY_(tmbstrcat)(styleattr->value, " }");
  ------------------
  |  |   23|    266|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    266|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1354|    266|    }
 1355|    761|    else
 1356|    761|    {
 1357|       |        /* attribute ends with property value */
 1358|       |
 1359|    761|        styleattr->value = (tmbstr) TidyDocRealloc(doc, styleattr->value,
  ------------------
  |  |  158|    761|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|    761|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
 1360|    761|            end + TY_(tmbstrlen)(styleprop) + 3);
 1361|       |
 1362|    761|        if (end > 0)
  ------------------
  |  Branch (1362:13): [True: 524, False: 237]
  ------------------
 1363|    524|            TY_(tmbstrcat)(styleattr->value, "; ");
  ------------------
  |  |   23|    524|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    524|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1364|    761|        TY_(tmbstrcat)(styleattr->value, styleprop);
  ------------------
  |  |   23|    761|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    761|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1365|    761|    }
 1366|  1.24k|}
attrs.c:IsURLCodePoint:
 1572|  12.7M|{
 1573|  12.7M|    uint c;
 1574|  12.7M|    *increment = TY_(GetUTF8)( p, &c ) + 1;
  ------------------
  |  |   23|  12.7M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.7M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1575|       |
 1576|  12.7M|    return ISALNUM( c ) ||
  ------------------
  |  | 1569|  25.4M|#define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1566|  25.4M|#define ISUPPER(a) ((a >= 'A') && (a <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1566:21): [True: 6.24M, False: 6.46M]
  |  |  |  |  |  Branch (1566:35): [True: 1.75M, False: 4.49M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1567|  23.6M|#define ISLOWER(a) ((a >= 'a') && (a <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1567:21): [True: 4.25M, False: 6.69M]
  |  |  |  |  |  Branch (1567:35): [True: 51.8k, False: 4.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1568|  10.9M|#define ISNUMERIC(a) ((a >= '0') && (a <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1568:23): [True: 4.70M, False: 6.20M]
  |  |  |  |  |  Branch (1568:37): [True: 9.05k, False: 4.69M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1577|  10.8M|        c == '%' ||    /* not a valid codepoint, but an escape sequence */
  ------------------
  |  Branch (1577:9): [True: 5.11k, False: 10.8M]
  ------------------
 1578|  10.8M|        c == '#' ||    /* not a valid codepoint, but a delimiter */
  ------------------
  |  Branch (1578:9): [True: 8.14k, False: 10.8M]
  ------------------
 1579|  10.8M|        c == '!' ||
  ------------------
  |  Branch (1579:9): [True: 3.36k, False: 10.8M]
  ------------------
 1580|  10.8M|        c == '$' ||
  ------------------
  |  Branch (1580:9): [True: 306, False: 10.8M]
  ------------------
 1581|  10.8M|        c == '&' ||
  ------------------
  |  Branch (1581:9): [True: 10.6k, False: 10.8M]
  ------------------
 1582|  10.8M|        c == '\'' ||
  ------------------
  |  Branch (1582:9): [True: 382, False: 10.8M]
  ------------------
 1583|  10.8M|        c == '(' ||
  ------------------
  |  Branch (1583:9): [True: 449, False: 10.8M]
  ------------------
 1584|  10.8M|        c == ')' ||
  ------------------
  |  Branch (1584:9): [True: 624, False: 10.8M]
  ------------------
 1585|  10.8M|        c == '*' ||
  ------------------
  |  Branch (1585:9): [True: 285, False: 10.8M]
  ------------------
 1586|  10.8M|        c == '+' ||
  ------------------
  |  Branch (1586:9): [True: 364, False: 10.8M]
  ------------------
 1587|  10.8M|        c == ',' ||
  ------------------
  |  Branch (1587:9): [True: 435, False: 10.8M]
  ------------------
 1588|  10.8M|        c == '-' ||
  ------------------
  |  Branch (1588:9): [True: 1.05k, False: 10.8M]
  ------------------
 1589|  10.8M|        c == '.' ||
  ------------------
  |  Branch (1589:9): [True: 1.39k, False: 10.8M]
  ------------------
 1590|  10.8M|        c == '/' ||
  ------------------
  |  Branch (1590:9): [True: 118k, False: 10.7M]
  ------------------
 1591|  10.7M|        c == ':' ||
  ------------------
  |  Branch (1591:9): [True: 973, False: 10.7M]
  ------------------
 1592|  10.7M|        c == ';' ||
  ------------------
  |  Branch (1592:9): [True: 112k, False: 10.6M]
  ------------------
 1593|  10.6M|        c == '=' ||
  ------------------
  |  Branch (1593:9): [True: 4.49k, False: 10.6M]
  ------------------
 1594|  10.6M|        c == '?' ||
  ------------------
  |  Branch (1594:9): [True: 783, False: 10.6M]
  ------------------
 1595|  10.6M|        c == '@' ||
  ------------------
  |  Branch (1595:9): [True: 113k, False: 10.5M]
  ------------------
 1596|  10.5M|        c == '_' ||
  ------------------
  |  Branch (1596:9): [True: 113k, False: 10.3M]
  ------------------
 1597|  10.3M|        c == '~' ||
  ------------------
  |  Branch (1597:9): [True: 529, False: 10.3M]
  ------------------
 1598|  10.3M|        (c >= 0x00A0 && c <= 0xD7FF) ||
  ------------------
  |  Branch (1598:10): [True: 4.20M, False: 6.19M]
  |  Branch (1598:25): [True: 5.38k, False: 4.19M]
  ------------------
 1599|  10.3M|        (c >= 0xE000 && c <= 0xFDCF) ||
  ------------------
  |  Branch (1599:10): [True: 4.19M, False: 6.19M]
  |  Branch (1599:25): [True: 589, False: 4.19M]
  ------------------
 1600|  10.3M|        (c >= 0xFDF0 && c <= 0xFFEF) ||
  ------------------
  |  Branch (1600:10): [True: 4.19M, False: 6.19M]
  |  Branch (1600:25): [True: 228, False: 4.19M]
  ------------------
 1601|  10.3M|        (c >= 0x10000 && c <= 0x1FFFD) ||
  ------------------
  |  Branch (1601:10): [True: 6.75k, False: 10.3M]
  |  Branch (1601:26): [True: 244, False: 6.51k]
  ------------------
 1602|  10.3M|        (c >= 0x20000 && c <= 0x2FFFD) ||
  ------------------
  |  Branch (1602:10): [True: 6.51k, False: 10.3M]
  |  Branch (1602:26): [True: 211, False: 6.30k]
  ------------------
 1603|  10.3M|        (c >= 0x30000 && c <= 0x3FFFD) ||
  ------------------
  |  Branch (1603:10): [True: 6.29k, False: 10.3M]
  |  Branch (1603:26): [True: 202, False: 6.09k]
  ------------------
 1604|  10.3M|        (c >= 0x40000 && c <= 0x4FFFD) ||
  ------------------
  |  Branch (1604:10): [True: 6.09k, False: 10.3M]
  |  Branch (1604:26): [True: 287, False: 5.80k]
  ------------------
 1605|  10.3M|        (c >= 0x50000 && c <= 0x5FFFD) ||
  ------------------
  |  Branch (1605:10): [True: 5.80k, False: 10.3M]
  |  Branch (1605:26): [True: 221, False: 5.58k]
  ------------------
 1606|  10.3M|        (c >= 0x60000 && c <= 0x6FFFD) ||
  ------------------
  |  Branch (1606:10): [True: 5.58k, False: 10.3M]
  |  Branch (1606:26): [True: 200, False: 5.38k]
  ------------------
 1607|  10.3M|        (c >= 0x70000 && c <= 0x7FFFD) ||
  ------------------
  |  Branch (1607:10): [True: 5.38k, False: 10.3M]
  |  Branch (1607:26): [True: 219, False: 5.16k]
  ------------------
 1608|  10.3M|        (c >= 0x80000 && c <= 0x8FFFD) ||
  ------------------
  |  Branch (1608:10): [True: 5.16k, False: 10.3M]
  |  Branch (1608:26): [True: 203, False: 4.96k]
  ------------------
 1609|  10.3M|        (c >= 0x90000 && c <= 0x9FFFD) ||
  ------------------
  |  Branch (1609:10): [True: 4.96k, False: 10.3M]
  |  Branch (1609:26): [True: 1.65k, False: 3.30k]
  ------------------
 1610|  10.3M|        (c >= 0xA0000 && c <= 0xAFFFD) ||
  ------------------
  |  Branch (1610:10): [True: 3.30k, False: 10.3M]
  |  Branch (1610:26): [True: 378, False: 2.92k]
  ------------------
 1611|  10.3M|        (c >= 0xB0000 && c <= 0xBFFFD) ||
  ------------------
  |  Branch (1611:10): [True: 2.92k, False: 10.3M]
  |  Branch (1611:26): [True: 323, False: 2.60k]
  ------------------
 1612|  10.3M|        (c >= 0xC0000 && c <= 0xCFFFD) ||
  ------------------
  |  Branch (1612:10): [True: 2.60k, False: 10.3M]
  |  Branch (1612:26): [True: 227, False: 2.37k]
  ------------------
 1613|  10.3M|        (c >= 0xD0000 && c <= 0xDFFFD) ||
  ------------------
  |  Branch (1613:10): [True: 2.37k, False: 10.3M]
  |  Branch (1613:26): [True: 232, False: 2.14k]
  ------------------
 1614|  10.3M|        (c >= 0xE0000 && c <= 0xEFFFD) ||
  ------------------
  |  Branch (1614:10): [True: 2.13k, False: 10.3M]
  |  Branch (1614:26): [True: 875, False: 1.26k]
  ------------------
 1615|  10.3M|        (c >= 0xF0000 && c <= 0xFFFFD) ||
  ------------------
  |  Branch (1615:10): [True: 1.26k, False: 10.3M]
  |  Branch (1615:26): [True: 754, False: 509]
  ------------------
 1616|  10.3M|        (c >= 0x100000 && c <= 0x10FFFD);
  ------------------
  |  Branch (1616:10): [True: 506, False: 10.3M]
  |  Branch (1616:27): [True: 493, False: 13]
  ------------------
 1617|  12.7M|}
attrs.c:CheckScript:
 1729|    764|{
 1730|    764|}
attrs.c:CheckBool:
 1918|  2.58k|{
 1919|  2.58k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  2.58k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 2.58k, False: 0]
  |  |  |  Branch (171:44): [True: 1.17k, False: 1.41k]
  |  |  ------------------
  ------------------
 1920|  1.41k|        return;
 1921|       |
 1922|  1.17k|    CheckLowerCaseAttrValue( doc, node, attval );
 1923|  1.17k|}
attrs.c:SortAttVal:
 2592|  2.67M|{
 2593|       |    /* Get the list from the passed-in tidyDoc. */
 2594|  2.67M|    ctmbstr* priorityList = (ctmbstr*)doc->attribs.priorityAttribs.list;
 2595|       |
 2596|  2.67M|    ptAttValComparator ptComparator = GetAttValComparator(strat, priorityList);
 2597|  2.67M|    AttVal *p, *q, *e, *tail;
 2598|  2.67M|    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.67M|    if (!list)
  ------------------
  |  Branch (2604:9): [True: 2.32M, False: 347k]
  ------------------
 2605|  2.32M|        return NULL;
 2606|       |
 2607|       |    /* If no comparator, return the list as-is */
 2608|   347k|    if (ptComparator == 0)
  ------------------
  |  Branch (2608:9): [True: 347k, False: 0]
  ------------------
 2609|   347k|        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.67M|{
 2577|  2.67M|    switch (strat)
  ------------------
  |  Branch (2577:13): [True: 2.67M, False: 0]
  ------------------
 2578|  2.67M|    {
 2579|      0|    case TidySortAttrAlpha:
  ------------------
  |  Branch (2579:5): [True: 0, False: 2.67M]
  ------------------
 2580|      0|        return AlphaComparator;
 2581|  2.67M|    case TidySortAttrNone:
  ------------------
  |  Branch (2581:5): [True: 2.67M, False: 0]
  ------------------
 2582|  2.67M|        if ( list && list[0] )
  ------------------
  |  Branch (2582:14): [True: 0, False: 2.67M]
  |  Branch (2582:22): [True: 0, False: 0]
  ------------------
 2583|      0|            return PriorityComparator;
 2584|  2.67M|        break;
 2585|  2.67M|    }
 2586|  2.67M|    return 0;
 2587|  2.67M|}

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

prvTidyFreeStyles:
  267|  21.3k|{
  268|  21.3k|    Lexer* lexer = doc->lexer;
  269|  21.3k|    if ( lexer )
  ------------------
  |  Branch (269:10): [True: 21.3k, False: 0]
  ------------------
  270|  21.3k|    {
  271|  21.3k|        TagStyle *style, *next;
  272|  21.3k|        for ( style = lexer->styles; style; style = next )
  ------------------
  |  Branch (272:38): [True: 0, False: 21.3k]
  ------------------
  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|  21.3k|    }
  281|  21.3k|}
prvTidyFixNodeLinks:
  559|  2.06k|{
  560|  2.06k|    Node *child;
  561|       |
  562|  2.06k|    if (node->prev)
  ------------------
  |  Branch (562:9): [True: 600, False: 1.46k]
  ------------------
  563|    600|        node->prev->next = node;
  564|  1.46k|    else
  565|  1.46k|        node->parent->content = node;
  566|       |
  567|  2.06k|    if (node->next)
  ------------------
  |  Branch (567:9): [True: 197, False: 1.86k]
  ------------------
  568|    197|        node->next->prev = node;
  569|  1.86k|    else
  570|  1.86k|        node->parent->last = node;
  571|       |
  572|  3.72k|    for (child = node->content; child; child = child->next)
  ------------------
  |  Branch (572:33): [True: 1.66k, False: 2.06k]
  ------------------
  573|  1.66k|        child->parent = node;
  574|  2.06k|}
prvTidyAddStyleProperty:
  661|  44.4k|{
  662|  44.4k|    AttVal *av = TY_(AttrGetById)(node, TidyAttr_STYLE);
  ------------------
  |  |   23|  44.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  663|       |
  664|       |    /* if style attribute already exists then insert property */
  665|       |
  666|  44.4k|    if ( av )
  ------------------
  |  Branch (666:10): [True: 1.68k, False: 42.7k]
  ------------------
  667|  1.68k|    {
  668|  1.68k|        if (av->value != NULL)
  ------------------
  |  Branch (668:13): [True: 1.44k, False: 241]
  ------------------
  669|  1.44k|        {
  670|  1.44k|            tmbstr s = MergeProperties( doc, av->value, property );
  671|  1.44k|            TidyDocFree( doc, av->value );
  ------------------
  |  |  159|  1.44k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  1.44k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  672|  1.44k|            av->value = s;
  673|  1.44k|        }
  674|    241|        else
  675|    241|        {
  676|    241|            av->value = TY_(tmbstrdup)( doc->allocator, property );
  ------------------
  |  |   23|    241|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    241|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  677|    241|        }
  678|  1.68k|    }
  679|  42.7k|    else /* else create new style attribute */
  680|  42.7k|    {
  681|  42.7k|        av = TY_(NewAttributeEx)( doc, "style", property, '"' );
  ------------------
  |  |   23|  42.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  682|  42.7k|        TY_(InsertAttributeAtStart)( node, av );
  ------------------
  |  |   23|  42.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  683|  42.7k|    }
  684|  44.4k|}
prvTidyNestedEmphasis:
 1507|  2.13M|{
 1508|  2.13M|    Node *next;
 1509|       |
 1510|  4.85M|    while (node)
  ------------------
  |  Branch (1510:12): [True: 2.71M, False: 2.13M]
  ------------------
 1511|  2.71M|    {
 1512|  2.71M|        next = node->next;
 1513|       |
 1514|  2.71M|        if ( (nodeIsB(node) || nodeIsI(node))
  ------------------
  |  |  403|  2.71M|#define nodeIsB( node )          TagIsId( node, TidyTag_B )
  |  |  ------------------
  |  |  |  |  275|  5.43M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.71M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.24M, False: 473k]
  |  |  |  |  |  Branch (275:54): [True: 49.0k, False: 2.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( (nodeIsB(node) || nodeIsI(node))
  ------------------
  |  |  404|  2.67M|#define nodeIsI( node )          TagIsId( node, TidyTag_I )
  |  |  ------------------
  |  |  |  |  275|  2.67M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.67M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.19M, False: 473k]
  |  |  |  |  |  Branch (275:54): [True: 13.1k, False: 2.18M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1515|  62.2k|             && node->parent && node->parent->tag == node->tag)
  ------------------
  |  Branch (1515:17): [True: 62.2k, False: 0]
  |  Branch (1515:33): [True: 2.55k, False: 59.6k]
  ------------------
 1516|  2.55k|        {
 1517|       |            /* strip redundant inner element */
 1518|  2.55k|            DiscardContainer( doc, node, &next );
 1519|  2.55k|            node = next;
 1520|  2.55k|            continue;
 1521|  2.55k|        }
 1522|       |
 1523|  2.71M|        if ( node->content )
  ------------------
  |  Branch (1523:14): [True: 2.11M, False: 603k]
  ------------------
 1524|  2.11M|            TY_(NestedEmphasis)( doc, node->content );
  ------------------
  |  |   23|  2.11M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.11M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1525|       |
 1526|  2.71M|        node = next;
 1527|  2.71M|    }
 1528|  2.13M|}
prvTidyList2BQ:
 1562|  2.13M|{
 1563|  4.85M|    while (node)
  ------------------
  |  Branch (1563:12): [True: 2.71M, False: 2.13M]
  ------------------
 1564|  2.71M|    {
 1565|  2.71M|        if (node->content)
  ------------------
  |  Branch (1565:13): [True: 2.11M, False: 603k]
  ------------------
 1566|  2.11M|            TY_(List2BQ)( doc, node->content );
  ------------------
  |  |   23|  2.11M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.11M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1567|       |
 1568|  2.71M|        if ( node->tag && node->tag->parser == TY_(ParseList) &&
  ------------------
  |  |   23|  2.24M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.24M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1568:14): [True: 2.24M, False: 473k]
  |  Branch (1568:27): [True: 48.9k, False: 2.19M]
  ------------------
 1569|  48.9k|             HasOneChild(node) && node->content->implicit )
  ------------------
  |  Branch (1569:14): [True: 45.3k, False: 3.58k]
  |  Branch (1569:35): [True: 39.2k, False: 6.14k]
  ------------------
 1570|  39.2k|        {
 1571|  39.2k|            StripOnlyChild( doc, node );
 1572|  39.2k|            RenameElem( doc, node, TidyTag_BLOCKQUOTE );
 1573|  39.2k|            node->implicit = yes;
 1574|  39.2k|        }
 1575|       |
 1576|  2.71M|        node = node->next;
 1577|  2.71M|    }
 1578|  2.13M|}
prvTidyBQ2Div:
 1587|  21.3k|{
 1588|  21.3k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1589|  21.3k|    Node *next;
 1590|       |    
 1591|  21.3k|    tmbchar indent_buf[ 32 ];
 1592|  21.3k|    uint indent;
 1593|       |
 1594|  2.66M|    while (node)
  ------------------
  |  Branch (1594:12): [True: 2.64M, False: 21.3k]
  ------------------
 1595|  2.64M|    {
 1596|  2.64M|        next = node->next;
 1597|       |        
 1598|  2.64M|        if ( nodeIsBLOCKQUOTE(node) && node->implicit )
  ------------------
  |  |  426|  2.64M|#define nodeIsBLOCKQUOTE( node ) TagIsId( node, TidyTag_BLOCKQUOTE )
  |  |  ------------------
  |  |  |  |  275|  5.28M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.64M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.17M, False: 473k]
  |  |  |  |  |  Branch (275:54): [True: 5.04k, False: 2.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1598:40): [True: 4.83k, False: 206]
  ------------------
 1599|  4.83k|        {
 1600|  4.83k|            indent = 1;
 1601|       |
 1602|  38.7k|            while( HasOneChild(node) &&
  ------------------
  |  Branch (1602:20): [True: 34.5k, False: 4.26k]
  ------------------
 1603|  38.7k|                   nodeIsBLOCKQUOTE(node->content) &&
  ------------------
  |  |  426|  34.5k|#define nodeIsBLOCKQUOTE( node ) TagIsId( node, TidyTag_BLOCKQUOTE )
  |  |  ------------------
  |  |  |  |  275|  73.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 34.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 34.1k, False: 342]
  |  |  |  |  |  Branch (275:54): [True: 33.9k, False: 232]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|  33.9k|                   node->implicit)
  ------------------
  |  Branch (1604:20): [True: 33.9k, False: 0]
  ------------------
 1605|  33.9k|            {
 1606|  33.9k|                ++indent;
 1607|  33.9k|                StripOnlyChild( doc, node );
 1608|  33.9k|            }
 1609|       |
 1610|  4.83k|            TY_(tmbsnprintf)(indent_buf, sizeof(indent_buf), "margin-left: %dem",
  ------------------
  |  |   23|  4.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1611|  4.83k|                             2*indent);
 1612|       |
 1613|  4.83k|            RenameElem( doc, node, TidyTag_DIV );
 1614|  4.83k|            TY_(AddStyleProperty)(doc, node, indent_buf );
  ------------------
  |  |   23|  4.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1615|       |
 1616|  4.83k|            if (node->content)
  ------------------
  |  Branch (1616:17): [True: 4.82k, False: 10]
  ------------------
 1617|  4.82k|            {
 1618|  4.82k|                TY_(push)(stack, next);
  ------------------
  |  |   23|  4.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1619|  4.82k|                node = node->content;
 1620|  4.82k|                continue;
 1621|  4.82k|            }
 1622|  4.83k|        }
 1623|  2.63M|        else if (node->content)
  ------------------
  |  Branch (1623:18): [True: 2.03M, False: 603k]
  ------------------
 1624|  2.03M|        {
 1625|  2.03M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.03M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.03M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1626|  2.03M|            node = node->content;
 1627|  2.03M|            continue;
 1628|  2.03M|        }
 1629|       |
 1630|   603k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   147k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   147k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1630:16): [True: 455k, False: 147k]
  ------------------
 1631|   603k|    }
 1632|  21.3k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1633|  21.3k|}
prvTidyNormalizeSpaces:
 1811|  9.64k|{
 1812|  26.6k|    while ( node )
  ------------------
  |  Branch (1812:13): [True: 16.9k, False: 9.64k]
  ------------------
 1813|  16.9k|    {
 1814|  16.9k|        if ( node->content )
  ------------------
  |  Branch (1814:14): [True: 7.12k, False: 9.86k]
  ------------------
 1815|  7.12k|            TY_(NormalizeSpaces)( lexer, node->content );
  ------------------
  |  |   23|  7.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1816|       |
 1817|  16.9k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  16.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1817:13): [True: 3.85k, False: 13.1k]
  ------------------
 1818|  3.85k|        {
 1819|  3.85k|            uint i, c;
 1820|  3.85k|            tmbstr p = lexer->lexbuf + node->start;
 1821|       |
 1822|  7.50M|            for (i = node->start; i < node->end; ++i)
  ------------------
  |  Branch (1822:35): [True: 7.50M, False: 3.85k]
  ------------------
 1823|  7.50M|            {
 1824|  7.50M|                c = (byte) lexer->lexbuf[i];
 1825|       |
 1826|       |                /* look for UTF-8 multibyte character */
 1827|  7.50M|                if ( c > 0x7F )
  ------------------
  |  Branch (1827:22): [True: 23.7k, False: 7.47M]
  ------------------
 1828|  23.7k|                    i += TY_(GetUTF8)( lexer->lexbuf + i, &c );
  ------------------
  |  |   23|  23.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1829|       |
 1830|  7.50M|                if ( c == 160 )
  ------------------
  |  Branch (1830:22): [True: 217, False: 7.50M]
  ------------------
 1831|    217|                    c = ' ';
 1832|       |
 1833|  7.50M|                p = TY_(PutUTF8)(p, c);
  ------------------
  |  |   23|  7.50M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.50M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1834|  7.50M|            }
 1835|  3.85k|            node->end = p - lexer->lexbuf;
 1836|  3.85k|        }
 1837|       |
 1838|  16.9k|        node = node->next;
 1839|  16.9k|    }
 1840|  9.64k|}
prvTidyBumpObject:
 2138|  69.3k|{
 2139|  69.3k|    Node *node, *next, *head = NULL, *body = NULL;
 2140|       |
 2141|  69.3k|    if (!html)
  ------------------
  |  Branch (2141:9): [True: 257, False: 69.1k]
  ------------------
 2142|    257|        return;
 2143|       |
 2144|   401k|    for ( node = html->content; node != NULL; node = node->next )
  ------------------
  |  Branch (2144:33): [True: 332k, False: 69.1k]
  ------------------
 2145|   332k|    {
 2146|   332k|        if ( nodeIsHEAD(node) )
  ------------------
  |  |  371|   332k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|   332k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 332k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 326k, False: 6.39k]
  |  |  |  |  |  Branch (275:54): [True: 59.2k, False: 267k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2147|  59.2k|            head = node;
 2148|       |
 2149|   332k|        if ( nodeIsBODY(node) )
  ------------------
  |  |  375|   332k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   332k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 332k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 326k, False: 6.39k]
  |  |  |  |  |  Branch (275:54): [True: 147k, False: 178k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2150|   147k|            body = node;
 2151|   332k|    }
 2152|       |
 2153|  69.1k|    if ( head != NULL && body != NULL )
  ------------------
  |  Branch (2153:10): [True: 59.2k, False: 9.83k]
  |  Branch (2153:26): [True: 59.2k, False: 0]
  ------------------
 2154|  59.2k|    {
 2155|  72.0k|        for (node = head->content; node != NULL; node = next)
  ------------------
  |  Branch (2155:36): [True: 12.7k, False: 59.2k]
  ------------------
 2156|  12.7k|        {
 2157|  12.7k|            next = node->next;
 2158|       |
 2159|  12.7k|            if ( nodeIsOBJECT(node) )
  ------------------
  |  |  428|  12.7k|#define nodeIsOBJECT( node )     TagIsId( node, TidyTag_OBJECT )
  |  |  ------------------
  |  |  |  |  275|  12.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 12.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 11.1k, False: 1.57k]
  |  |  |  |  |  Branch (275:54): [True: 1.45k, False: 9.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2160|  1.45k|            {
 2161|  1.45k|                Node *child;
 2162|  1.45k|                Bool bump = no;
 2163|       |
 2164|  1.88k|                for (child = node->content; child != NULL; child = child->next)
  ------------------
  |  Branch (2164:45): [True: 1.38k, False: 498]
  ------------------
 2165|  1.38k|                {
 2166|       |                    /* bump to body unless content is param */
 2167|  1.38k|                    if ( (TY_(nodeIsText)(child) && !TY_(IsBlank)(doc->lexer, node))
  ------------------
  |  |   23|  1.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( (TY_(nodeIsText)(child) && !TY_(IsBlank)(doc->lexer, node))
  ------------------
  |  |   23|    416|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    416|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2167:27): [True: 416, False: 970]
  |  Branch (2167:53): [True: 416, False: 0]
  ------------------
 2168|    970|                         || !nodeIsPARAM(child) )
  ------------------
  |  |  409|    970|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|    970|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 970, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 750, False: 220]
  |  |  |  |  |  Branch (275:54): [True: 433, False: 317]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2169|    953|                    {
 2170|    953|                            bump = yes;
 2171|    953|                            break;
 2172|    953|                    }
 2173|  1.38k|                }
 2174|       |
 2175|  1.45k|                if ( bump )
  ------------------
  |  Branch (2175:22): [True: 953, False: 498]
  ------------------
 2176|    953|                {
 2177|    953|                    TY_(RemoveNode)( node );
  ------------------
  |  |   23|    953|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    953|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2178|    953|                    TY_(InsertNodeAtStart)( body, node );
  ------------------
  |  |   23|    953|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    953|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2179|    953|                }
 2180|  1.45k|            }
 2181|  12.7k|        }
 2182|  59.2k|    }
 2183|  69.1k|}
prvTidyTidyMetaCharset:
 2194|  21.3k|{
 2195|  21.3k|    AttVal *charsetAttr;
 2196|  21.3k|    AttVal *contentAttr;
 2197|  21.3k|    AttVal *httpEquivAttr;
 2198|  21.3k|    Bool charsetFound = no;
 2199|  21.3k|    uint outenc = cfg(doc, TidyOutCharEncoding);
  ------------------
  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 2200|  21.3k|    ctmbstr enc = TY_(GetEncodingNameFromTidyId)(outenc);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2201|  21.3k|    Node *currentNode;
 2202|  21.3k|    Node *head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2203|  21.3k|    Node *metaTag;
 2204|  21.3k|    Node *prevNode;
 2205|  21.3k|    TidyBuffer buf;
 2206|  21.3k|    TidyBuffer charsetString;
 2207|       |    /* tmbstr httpEquivAttrValue; */
 2208|       |    /* tmbstr lcontent; */
 2209|  21.3k|    tmbstr newValue;
 2210|  21.3k|    Bool add_meta = cfgBool(doc, TidyMetaCharset);
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#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|  21.3k|    if (!head || !enc || !TY_(tmbstrlen)(enc))
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2213:9): [True: 0, False: 21.3k]
  |  Branch (2213:18): [True: 0, False: 21.3k]
  |  Branch (2213:26): [True: 0, False: 21.3k]
  ------------------
 2214|      0|        return no;
 2215|  21.3k|    if (outenc == RAW)
  ------------------
  |  |  133|  21.3k|#define RAW         0
  ------------------
  |  Branch (2215:9): [True: 0, False: 21.3k]
  ------------------
 2216|      0|        return no;
 2217|  21.3k|#ifndef NO_NATIVE_ISO2022_SUPPORT
 2218|  21.3k|    if (outenc == ISO2022)
  ------------------
  |  |  138|  21.3k|#define ISO2022     5
  ------------------
  |  Branch (2218:9): [True: 0, False: 21.3k]
  ------------------
 2219|      0|        return no;
 2220|  21.3k|#endif
 2221|  21.3k|    if (cfgAutoBool(doc, TidyBodyOnly) == TidyYesState)
  ------------------
  |  |  421|  21.3k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2221:9): [True: 0, False: 21.3k]
  ------------------
 2222|      0|        return no; /* nothing to do here if showing body only */
 2223|       |
 2224|  21.3k|    tidyBufInit(&charsetString);
 2225|       |    /* Set up the content test 'charset=value' */
 2226|  21.3k|    tidyBufClear(&charsetString);
 2227|  21.3k|    tidyBufAppend(&charsetString, "charset=", 8);
 2228|  21.3k|    tidyBufAppend(&charsetString, (char*)enc, TY_(tmbstrlen)(enc));
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2229|  21.3k|    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|  58.5k|    for (currentNode = head->content; currentNode; 
  ------------------
  |  Branch (2232:39): [True: 37.2k, False: 21.3k]
  ------------------
 2233|  37.2k|        currentNode = (currentNode ? currentNode->next : NULL))
  ------------------
  |  Branch (2233:24): [True: 37.2k, False: 0]
  ------------------
 2234|  37.2k|    {
 2235|  37.2k|        if (!nodeIsMETA(currentNode))
  ------------------
  |  |  374|  37.2k|#define nodeIsMETA( node )       TagIsId( node, TidyTag_META )
  |  |  ------------------
  |  |  |  |  275|  37.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 37.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 35.6k, False: 1.56k]
  |  |  |  |  |  Branch (275:54): [True: 626, False: 35.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2236|  36.5k|            continue;   /* not a meta node */
 2237|    626|        charsetAttr = attrGetCHARSET(currentNode);
  ------------------
  |  |  415|    626|#define attrGetCHARSET( nod )     TY_(AttrGetById)( nod, TidyAttr_CHARSET  )
  |  |  ------------------
  |  |  |  |   23|    626|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    626|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2238|    626|        httpEquivAttr = attrGetHTTP_EQUIV(currentNode);
  ------------------
  |  |  419|    626|#define attrGetHTTP_EQUIV( nod )  TY_(AttrGetById)( nod, TidyAttr_HTTP_EQUIV  )
  |  |  ------------------
  |  |  |  |   23|    626|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    626|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2239|    626|        if (!charsetAttr && !httpEquivAttr)
  ------------------
  |  Branch (2239:13): [True: 626, False: 0]
  |  Branch (2239:29): [True: 626, False: 0]
  ------------------
 2240|    626|            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|  21.3k|    if (add_meta && !charsetFound)
  ------------------
  |  Branch (2358:9): [True: 0, False: 21.3k]
  |  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|  21.3k|    tidyBufFree(&charsetString);
 2381|  21.3k|    return yes;
 2382|  21.3k|}
prvTidyReplacePreformattedSpaces:
 2547|  2.05M|{
 2548|  2.05M|    Node* next;
 2549|       |
 2550|  4.71M|    while (node)
  ------------------
  |  Branch (2550:12): [True: 2.65M, False: 2.05M]
  ------------------
 2551|  2.65M|    {
 2552|  2.65M|        next = node->next;
 2553|       |
 2554|  2.65M|        if (node->tag && node->tag->parser == TY_(ParsePre))
  ------------------
  |  |   23|  2.17M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.17M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2554:13): [True: 2.17M, False: 487k]
  |  Branch (2554:26): [True: 2.51k, False: 2.16M]
  ------------------
 2555|  2.51k|        {
 2556|  2.51k|            TY_(NormalizeSpaces)(doc->lexer, node->content);
  ------------------
  |  |   23|  2.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2557|  2.51k|            node = next;
 2558|  2.51k|            continue;
 2559|  2.51k|        }
 2560|       |
 2561|  2.65M|        if (node->content)
  ------------------
  |  Branch (2561:13): [True: 2.03M, False: 625k]
  ------------------
 2562|  2.03M|            TY_(ReplacePreformattedSpaces)(doc, node->content);
  ------------------
  |  |   23|  2.03M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.03M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2563|       |
 2564|  2.65M|        node = next;
 2565|  2.65M|    }
 2566|  2.05M|}
prvTidyFixLanguageInformation:
 2594|  21.3k|{
 2595|  21.3k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2596|  21.3k|    Node* next;
 2597|       |
 2598|  2.68M|    while (node)
  ------------------
  |  Branch (2598:12): [True: 2.66M, False: 21.3k]
  ------------------
 2599|  2.66M|    {
 2600|  2.66M|        next = node->next;
 2601|       |
 2602|       |        /* todo: report modifications made here to the report system */
 2603|       |
 2604|  2.66M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  2.66M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.66M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2604:13): [True: 2.17M, False: 486k]
  ------------------
 2605|  2.17M|        {
 2606|  2.17M|            AttVal* lang = TY_(AttrGetById)(node, TidyAttr_LANG);
  ------------------
  |  |   23|  2.17M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.17M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2607|  2.17M|            AttVal* xmlLang = TY_(AttrGetById)(node, TidyAttr_XML_LANG);
  ------------------
  |  |   23|  2.17M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.17M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2608|       |
 2609|  2.17M|            if (lang && xmlLang)
  ------------------
  |  Branch (2609:17): [True: 971, False: 2.17M]
  |  Branch (2609:25): [True: 252, False: 719]
  ------------------
 2610|    252|            {
 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|    252|            }
 2618|  2.17M|            else if (lang && wantXmlLang)
  ------------------
  |  Branch (2618:22): [True: 719, False: 2.17M]
  |  Branch (2618:30): [True: 719, False: 0]
  ------------------
 2619|    719|            {
 2620|    719|                if (TY_(NodeAttributeVersions)( node, TidyAttr_XML_LANG )
  ------------------
  |  |   23|    719|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    719|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2620:21): [True: 507, False: 212]
  ------------------
 2621|    719|                    & doc->lexer->versionEmitted)
 2622|    507|                    TY_(RepairAttrValue)(doc, node, "xml:lang", lang->value);
  ------------------
  |  |   23|    507|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    507|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2623|    719|            }
 2624|  2.17M|            else if (xmlLang && wantLang)
  ------------------
  |  Branch (2624:22): [True: 29.6k, False: 2.14M]
  |  Branch (2624:33): [True: 29.6k, False: 0]
  ------------------
 2625|  29.6k|            {
 2626|  29.6k|                if (TY_(NodeAttributeVersions)( node, TidyAttr_LANG )
  ------------------
  |  |   23|  29.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2626:21): [True: 27.6k, False: 2.03k]
  ------------------
 2627|  29.6k|                    & doc->lexer->versionEmitted)
 2628|  27.6k|                    TY_(RepairAttrValue)(doc, node, "lang", xmlLang->value);
  ------------------
  |  |   23|  27.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2629|  29.6k|            }
 2630|       |
 2631|  2.17M|            if (lang && !wantLang)
  ------------------
  |  Branch (2631:17): [True: 971, False: 2.17M]
  |  Branch (2631:25): [True: 0, False: 971]
  ------------------
 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.17M|            if (xmlLang && !wantXmlLang)
  ------------------
  |  Branch (2634:17): [True: 29.9k, False: 2.14M]
  |  Branch (2634:28): [True: 0, False: 29.9k]
  ------------------
 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.17M|        }
 2637|       |
 2638|  2.66M|        if (node->content)
  ------------------
  |  Branch (2638:13): [True: 2.04M, False: 622k]
  ------------------
 2639|  2.04M|        {
 2640|  2.04M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.04M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.04M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2641|  2.04M|            node = node->content;
 2642|  2.04M|            continue;
 2643|  2.04M|        }
 2644|       |
 2645|   622k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   147k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   147k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2645:16): [True: 474k, False: 147k]
  ------------------
 2646|   622k|    }
 2647|  21.3k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2648|  21.3k|}
prvTidyFixXhtmlNamespace:
 2654|  21.3k|{
 2655|  21.3k|    Node* html = TY_(FindHTML)(doc);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2656|  21.3k|    AttVal* xmlns;
 2657|       |
 2658|  21.3k|    if (!html)
  ------------------
  |  Branch (2658:9): [True: 0, False: 21.3k]
  ------------------
 2659|      0|        return;
 2660|       |
 2661|  21.3k|    xmlns = TY_(AttrGetById)(html, TidyAttr_XMLNS);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2662|       |
 2663|  21.3k|    if (wantXmlns)
  ------------------
  |  Branch (2663:9): [True: 21.3k, False: 0]
  ------------------
 2664|  21.3k|    {
 2665|  21.3k|        if (!AttrValueIs(xmlns, XHTML_NAMESPACE))
  ------------------
  |  |  172|  21.3k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  42.6k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 0, False: 21.3k]
  |  |  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  21.3k|                                 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|  21.3k|            TY_(RepairAttrValue)(doc, html, "xmlns", XHTML_NAMESPACE);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, html, "xmlns", XHTML_NAMESPACE);
  ------------------
  |  |   80|  21.3k|#define XHTML_NAMESPACE "http://www.w3.org/1999/xhtml"
  ------------------
 2667|  21.3k|    }
 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|  21.3k|}
prvTidyFixAnchors:
 2678|  21.3k|{
 2679|  21.3k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2680|  21.3k|    Node* next;
 2681|       |
 2682|  2.68M|    while (node)
  ------------------
  |  Branch (2682:12): [True: 2.66M, False: 21.3k]
  ------------------
 2683|  2.66M|    {
 2684|  2.66M|        next = node->next;
 2685|       |
 2686|  2.66M|        if (TY_(IsAnchorElement)(doc, node))
  ------------------
  |  |   23|  2.66M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.66M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2686:13): [True: 214k, False: 2.44M]
  ------------------
 2687|   214k|        {
 2688|   214k|            AttVal *name = TY_(AttrGetById)(node, TidyAttr_NAME);
  ------------------
  |  |   23|   214k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   214k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2689|   214k|            AttVal *id = TY_(AttrGetById)(node, TidyAttr_ID);
  ------------------
  |  |   23|   214k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   214k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2690|   214k|            Bool hadName = name!=NULL;
 2691|   214k|            Bool hadId = id!=NULL;
 2692|   214k|            Bool IdEmitted = no;
 2693|   214k|            Bool NameEmitted = no;
 2694|       |
 2695|       |            /* todo: how are empty name/id attributes handled? */
 2696|       |
 2697|   214k|            if (name && id)
  ------------------
  |  Branch (2697:17): [True: 5.68k, False: 208k]
  |  Branch (2697:25): [True: 909, False: 4.77k]
  ------------------
 2698|    909|            {
 2699|    909|                Bool NameHasValue = AttrHasValue(name);
  ------------------
  |  |  171|    909|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 909, False: 0]
  |  |  |  Branch (171:44): [True: 582, False: 327]
  |  |  ------------------
  ------------------
 2700|    909|                Bool IdHasValue = AttrHasValue(id);
  ------------------
  |  |  171|    909|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 909, False: 0]
  |  |  |  Branch (171:44): [True: 501, False: 408]
  |  |  ------------------
  ------------------
 2701|    909|                if ( (NameHasValue != IdHasValue) ||
  ------------------
  |  Branch (2701:22): [True: 203, False: 706]
  ------------------
 2702|    706|                     (NameHasValue && IdHasValue &&
  ------------------
  |  Branch (2702:23): [True: 440, False: 266]
  |  Branch (2702:39): [True: 440, False: 0]
  ------------------
 2703|    440|                     TY_(tmbstrcmp)(name->value, id->value) != 0 ) )
  ------------------
  |  |   23|    440|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    440|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2703:22): [True: 239, False: 201]
  ------------------
 2704|    442|                    TY_(ReportAttrError)( doc, node, name, ID_NAME_MISMATCH);
  ------------------
  |  |   23|    442|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    442|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2705|    909|            }
 2706|   213k|            else if (name && wantId)
  ------------------
  |  Branch (2706:22): [True: 4.77k, False: 208k]
  |  Branch (2706:30): [True: 4.77k, False: 0]
  ------------------
 2707|  4.77k|            {
 2708|  4.77k|                if (TY_(NodeAttributeVersions)( node, TidyAttr_ID )
  ------------------
  |  |   23|  4.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2708:21): [True: 4.26k, False: 505]
  ------------------
 2709|  4.77k|                    & doc->lexer->versionEmitted)
 2710|  4.26k|                {
 2711|  4.26k|                    if (TY_(IsValidHTMLID)(name->value))
  ------------------
  |  |   23|  4.26k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.26k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2711:25): [True: 3.85k, False: 411]
  ------------------
 2712|  3.85k|                    {
 2713|  3.85k|                        TY_(RepairAttrValue)(doc, node, "id", name->value);
  ------------------
  |  |   23|  3.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2714|  3.85k|                        IdEmitted = yes;
 2715|  3.85k|                    }
 2716|    411|                    else
 2717|    411|                        TY_(ReportAttrError)(doc, node, name, INVALID_XML_ID);
  ------------------
  |  |   23|    411|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    411|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2718|  4.26k|                 }
 2719|  4.77k|            }
 2720|   208k|            else if (id && wantName)
  ------------------
  |  Branch (2720:22): [True: 1.04k, False: 207k]
  |  Branch (2720:28): [True: 1.04k, False: 0]
  ------------------
 2721|  1.04k|            {
 2722|  1.04k|                if (TY_(NodeAttributeVersions)( node, TidyAttr_NAME )
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2722:21): [True: 259, False: 782]
  ------------------
 2723|  1.04k|                    & doc->lexer->versionEmitted)
 2724|    259|                {
 2725|       |                    /* todo: do not assume id is valid */
 2726|    259|                    TY_(RepairAttrValue)(doc, node, "name", id->value);
  ------------------
  |  |   23|    259|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    259|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2727|    259|                    NameEmitted = yes;
 2728|    259|                }
 2729|  1.04k|            }
 2730|       |
 2731|   214k|            if (id && !wantId
  ------------------
  |  Branch (2731:17): [True: 1.95k, False: 212k]
  |  Branch (2731:23): [True: 0, False: 1.95k]
  ------------------
 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|   214k|            if (name && !wantName
  ------------------
  |  Branch (2739:17): [True: 5.68k, False: 208k]
  |  Branch (2739:25): [True: 0, False: 5.68k]
  ------------------
 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|   214k|        }
 2747|       |
 2748|  2.66M|        if (node->content)
  ------------------
  |  Branch (2748:13): [True: 2.04M, False: 622k]
  ------------------
 2749|  2.04M|        {
 2750|  2.04M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.04M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.04M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2751|  2.04M|            node = node->content;
 2752|  2.04M|            continue;
 2753|  2.04M|        }
 2754|       |
 2755|   622k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   147k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   147k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2755:16): [True: 474k, False: 147k]
  ------------------
 2756|   622k|    }
 2757|  21.3k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2758|  21.3k|}
prvTidyCleanStyle:
 2806|  21.3k|{
 2807|  21.3k|    Node *head = NULL, *body = NULL;
 2808|  21.3k|    Bool fix = cfgBool(doc, TidyStyleTags);
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2809|       |
 2810|  21.3k|    if (!html)
  ------------------
  |  Branch (2810:9): [True: 0, False: 21.3k]
  ------------------
 2811|      0|        return; /* oops, not given a start node */
 2812|       |
 2813|  21.3k|    head = TY_(FindHEAD)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2814|  21.3k|    body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2815|       |
 2816|  21.3k|    if ((head != NULL) && (body != NULL))
  ------------------
  |  Branch (2816:9): [True: 21.3k, False: 0]
  |  Branch (2816:27): [True: 21.0k, False: 252]
  ------------------
 2817|  21.0k|    {
 2818|  21.0k|		StyleToHead(doc, head, body, fix, 0); /* found head and body */
 2819|  21.0k|    }
 2820|  21.3k|}
prvTidyCleanHead:
 2830|  21.3k|{
 2831|  21.3k|    Node *head, *node, *next;
 2832|  21.3k|    uint titles = 0;
 2833|  21.3k|    if (cfgAutoBool(doc, TidyBodyOnly) == TidyYesState)
  ------------------
  |  |  421|  21.3k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2833:9): [True: 0, False: 21.3k]
  ------------------
 2834|      0|        return; /* not going to show head, so forget it */
 2835|  21.3k|    head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2836|  21.3k|    if (!head)
  ------------------
  |  Branch (2836:9): [True: 0, False: 21.3k]
  ------------------
 2837|      0|        return;
 2838|  21.3k|    node = head->content;
 2839|  79.8k|    while (node)
  ------------------
  |  Branch (2839:12): [True: 58.5k, False: 21.3k]
  ------------------
 2840|  58.5k|    {
 2841|  58.5k|        next = node->next;  /* get any 'next' */
 2842|  58.5k|        if (nodeIsTITLE(node))
  ------------------
  |  |  372|  58.5k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  58.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 58.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 56.9k, False: 1.56k]
  |  |  |  |  |  Branch (275:54): [True: 28.5k, False: 28.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2843|  28.5k|        {
 2844|  28.5k|            titles++;
 2845|  28.5k|            if (titles > 1)
  ------------------
  |  Branch (2845:17): [True: 7.25k, False: 21.3k]
  ------------------
 2846|  7.25k|            {
 2847|  7.25k|                TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  7.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2848|  7.25k|                TY_(DiscardElement)(doc, node); /* delete this node */
  ------------------
  |  |   23|  7.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2849|  7.25k|            }
 2850|  28.5k|        }
 2851|  58.5k|        node = next;
 2852|  58.5k|    }
 2853|  21.3k|}
clean.c:MergeProperties:
  645|  1.44k|{
  646|  1.44k|    tmbstr s;
  647|  1.44k|    StyleProp *prop;
  648|       |
  649|       |    prop = CreateProps(doc, NULL, s1);
  650|  1.44k|    prop = CreateProps(doc, prop, s2);
  651|  1.44k|    s = CreatePropString(doc, prop);
  652|  1.44k|    FreeStyleProps(doc, prop);
  653|  1.44k|    return s;
  654|  1.44k|}
clean.c:CreateProps:
  140|  2.88k|{
  141|  2.88k|    tmbstr name, value = NULL, name_end, value_end, line;
  142|  2.88k|    Bool more;
  143|       |
  144|  2.88k|    line = TY_(tmbstrdup)(doc->allocator, style);
  ------------------
  |  |   23|  2.88k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.88k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  145|  2.88k|    name = line;
  146|       |
  147|  5.79k|    while (*name)
  ------------------
  |  Branch (147:12): [True: 5.11k, False: 684]
  ------------------
  148|  5.11k|    {
  149|  5.31k|        while (*name == ' ')
  ------------------
  |  Branch (149:16): [True: 204, False: 5.11k]
  ------------------
  150|    204|            ++name;
  151|       |
  152|  5.11k|        name_end = name;
  153|       |
  154|  37.5k|        while (*name_end)
  ------------------
  |  Branch (154:16): [True: 37.2k, False: 258]
  ------------------
  155|  37.2k|        {
  156|  37.2k|            if (*name_end == ':')
  ------------------
  |  Branch (156:17): [True: 4.85k, False: 32.4k]
  ------------------
  157|  4.85k|            {
  158|  4.85k|                value = name_end + 1;
  159|  4.85k|                break;
  160|  4.85k|            }
  161|       |
  162|  32.4k|            ++name_end;
  163|  32.4k|        }
  164|       |
  165|  5.11k|        if (*name_end != ':')
  ------------------
  |  Branch (165:13): [True: 258, False: 4.85k]
  ------------------
  166|    258|            break;
  167|       |
  168|  6.29k|        while ( value && *value == ' ')
  ------------------
  |  Branch (168:17): [True: 6.29k, False: 0]
  |  Branch (168:26): [True: 1.44k, False: 4.85k]
  ------------------
  169|  1.44k|            ++value;
  170|       |
  171|  4.85k|        value_end = value;
  172|  4.85k|        more = no;
  173|       |
  174|  29.2k|        while (*value_end)
  ------------------
  |  Branch (174:16): [True: 27.3k, False: 1.94k]
  ------------------
  175|  27.3k|        {
  176|  27.3k|            if (*value_end == ';')
  ------------------
  |  Branch (176:17): [True: 2.91k, False: 24.3k]
  ------------------
  177|  2.91k|            {
  178|  2.91k|                more = yes;
  179|  2.91k|                break;
  180|  2.91k|            }
  181|       |
  182|  24.3k|            ++value_end;
  183|  24.3k|        }
  184|       |
  185|  4.85k|        *name_end = '\0';
  186|  4.85k|        *value_end = '\0';
  187|       |
  188|  4.85k|        prop = InsertProperty(doc, prop, name, value);
  189|  4.85k|        *name_end = ':';
  190|       |
  191|  4.85k|        if (more)
  ------------------
  |  Branch (191:13): [True: 2.91k, False: 1.94k]
  ------------------
  192|  2.91k|        {
  193|  2.91k|            *value_end = ';';
  194|  2.91k|            name = value_end + 1;
  195|  2.91k|            continue;
  196|  2.91k|        }
  197|       |
  198|  1.94k|        break;
  199|  4.85k|    }
  200|       |
  201|  2.88k|    TidyDocFree(doc, line);  /* free temporary copy */
  ------------------
  |  |  159|  2.88k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  2.88k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  202|  2.88k|    return prop;
  203|  2.88k|}
clean.c:InsertProperty:
   81|  4.85k|{
   82|  4.85k|    StyleProp *first, *prev, *prop;
   83|  4.85k|    int cmp;
   84|       |
   85|  4.85k|    prev = NULL;
   86|  4.85k|    first = props;
   87|       |
   88|  8.39k|    while (props)
  ------------------
  |  Branch (88:12): [True: 6.60k, False: 1.78k]
  ------------------
   89|  6.60k|    {
   90|  6.60k|        cmp = TY_(tmbstrcmp)(props->name, name);
  ------------------
  |  |   23|  6.60k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.60k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   91|       |
   92|  6.60k|        if (cmp == 0)
  ------------------
  |  Branch (92:13): [True: 1.23k, False: 5.36k]
  ------------------
   93|  1.23k|        {
   94|       |            /* this property is already defined, ignore new value */
   95|  1.23k|            return first;
   96|  1.23k|        }
   97|       |
   98|  5.36k|        if (cmp > 0)
  ------------------
  |  Branch (98:13): [True: 1.83k, False: 3.53k]
  ------------------
   99|  1.83k|        {
  100|       |            /* insert before this */
  101|       |
  102|  1.83k|            prop = (StyleProp *)TidyDocAlloc(doc, sizeof(StyleProp));
  ------------------
  |  |  157|  1.83k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  1.83k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  103|  1.83k|            prop->name = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|  1.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  104|  1.83k|            prop->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|  1.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  105|  1.83k|            prop->next = props;
  106|       |
  107|  1.83k|            if (prev)
  ------------------
  |  Branch (107:17): [True: 681, False: 1.14k]
  ------------------
  108|    681|                prev->next = prop;
  109|  1.14k|            else
  110|  1.14k|                first = prop;
  111|       |
  112|  1.83k|            return first;
  113|  1.83k|        }
  114|       |
  115|  3.53k|        prev = props;
  116|  3.53k|        props = props->next;
  117|  3.53k|    }
  118|       |
  119|  1.78k|    prop = (StyleProp *)TidyDocAlloc(doc, sizeof(StyleProp));
  ------------------
  |  |  157|  1.78k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  1.78k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  120|  1.78k|    prop->name = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|  1.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  121|  1.78k|    prop->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|  1.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  122|  1.78k|    prop->next = NULL;
  123|       |
  124|  1.78k|    if (prev)
  ------------------
  |  Branch (124:9): [True: 344, False: 1.44k]
  ------------------
  125|    344|        prev->next = prop;
  126|  1.44k|    else
  127|  1.44k|        first = prop;
  128|       |
  129|  1.78k|    return first;
  130|  4.85k|}
clean.c:CreatePropString:
  206|  1.44k|{
  207|  1.44k|    tmbstr style, p, s;
  208|  1.44k|    uint len;
  209|  1.44k|    StyleProp *prop;
  210|       |
  211|       |    /* compute length */
  212|       |
  213|  5.06k|    for (len = 0, prop = props; prop; prop = prop->next)
  ------------------
  |  Branch (213:33): [True: 3.61k, False: 1.44k]
  ------------------
  214|  3.61k|    {
  215|  3.61k|        len += TY_(tmbstrlen)(prop->name) + 2;
  ------------------
  |  |   23|  3.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  216|  3.61k|        if (prop->value)
  ------------------
  |  Branch (216:13): [True: 3.61k, False: 0]
  ------------------
  217|  3.61k|            len += TY_(tmbstrlen)(prop->value) + 2;
  ------------------
  |  |   23|  3.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  218|  3.61k|    }
  219|       |
  220|  1.44k|    style = (tmbstr) TidyDocAlloc(doc, len+1);
  ------------------
  |  |  157|  1.44k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  1.44k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  221|  1.44k|    style[0] = '\0';
  222|       |
  223|  3.61k|    for (p = style, prop = props; prop; prop = prop->next)
  ------------------
  |  Branch (223:35): [True: 3.61k, False: 0]
  ------------------
  224|  3.61k|    {
  225|  3.61k|        s = prop->name;
  226|       |
  227|  33.0k|        while((*p++ = *s++))
  ------------------
  |  Branch (227:15): [True: 29.4k, False: 3.61k]
  ------------------
  228|  29.4k|            continue;
  229|       |
  230|  3.61k|        if (prop->value)
  ------------------
  |  Branch (230:13): [True: 3.61k, False: 0]
  ------------------
  231|  3.61k|        {
  232|  3.61k|            *--p = ':';
  233|  3.61k|            *++p = ' ';
  234|  3.61k|            ++p;
  235|       |
  236|  3.61k|            s = prop->value;
  237|  22.8k|            while((*p++ = *s++))
  ------------------
  |  Branch (237:19): [True: 19.2k, False: 3.61k]
  ------------------
  238|  19.2k|                continue;
  239|  3.61k|        }
  240|  3.61k|        if (prop->next == NULL)
  ------------------
  |  Branch (240:13): [True: 1.44k, False: 2.17k]
  ------------------
  241|  1.44k|            break;
  242|       |
  243|  2.17k|        *--p = ';';
  244|  2.17k|        *++p = ' ';
  245|  2.17k|        ++p;
  246|  2.17k|    }
  247|       |
  248|  1.44k|    return style;
  249|  1.44k|}
clean.c:FreeStyleProps:
   67|  1.44k|{
   68|  1.44k|    StyleProp *next;
   69|       |
   70|  5.06k|    while (props)
  ------------------
  |  Branch (70:12): [True: 3.61k, False: 1.44k]
  ------------------
   71|  3.61k|    {
   72|  3.61k|        next = props->next;
   73|  3.61k|        TidyDocFree(doc, props->name);
  ------------------
  |  |  159|  3.61k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.61k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   74|  3.61k|        TidyDocFree(doc, props->value);
  ------------------
  |  |  159|  3.61k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.61k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   75|  3.61k|        TidyDocFree(doc, props);
  ------------------
  |  |  159|  3.61k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.61k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   76|  3.61k|        props = next;
   77|  3.61k|    }
   78|  1.44k|}
clean.c:DiscardContainer:
  599|  2.55k|{
  600|  2.55k|    if (element->content)
  ------------------
  |  Branch (600:9): [True: 2.27k, False: 284]
  ------------------
  601|  2.27k|    {
  602|  2.27k|        Node *node, *parent = element->parent;
  603|       |
  604|  2.27k|        element->last->next = element->next;
  605|       |
  606|  2.27k|        if (element->next)
  ------------------
  |  Branch (606:13): [True: 417, False: 1.85k]
  ------------------
  607|    417|        {
  608|    417|            element->next->prev = element->last;
  609|    417|        }
  610|  1.85k|        else
  611|  1.85k|            parent->last = element->last;
  612|       |
  613|  2.27k|        if (element->prev)
  ------------------
  |  Branch (613:13): [True: 1.35k, False: 920]
  ------------------
  614|  1.35k|        {
  615|  1.35k|            element->content->prev = element->prev;
  616|  1.35k|            element->prev->next = element->content;
  617|  1.35k|        }
  618|    920|        else
  619|    920|            parent->content = element->content;
  620|       |
  621|  30.2k|        for (node = element->content; node; node = node->next)
  ------------------
  |  Branch (621:39): [True: 27.9k, False: 2.27k]
  ------------------
  622|  27.9k|            node->parent = parent;
  623|       |
  624|  2.27k|        *pnode = element->content;
  625|       |
  626|  2.27k|        element->next = element->content = NULL;
  627|  2.27k|        TY_(FreeNode)(doc, element);
  ------------------
  |  |   23|  2.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  628|  2.27k|    }
  629|    284|    else
  630|    284|    {
  631|    284|        *pnode = TY_(DiscardElement)(doc, element);
  ------------------
  |  |   23|    284|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    284|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  632|    284|    }
  633|  2.55k|}
clean.c:RenameElem:
   59|  44.0k|{
   60|  44.0k|    const Dict* dict = TY_(LookupTagDef)( tid );
  ------------------
  |  |   23|  44.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   61|  44.0k|    TidyDocFree( doc, node->element );
  ------------------
  |  |  159|  44.0k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  44.0k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   62|  44.0k|    node->element = TY_(tmbstrdup)( doc->allocator, dict->name );
  ------------------
  |  |   23|  44.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   63|  44.0k|    node->tag = dict;
   64|  44.0k|}
clean.c:HasOneChild:
 1550|  87.7k|{
 1551|  87.7k|    return (node->content && node->content->next == NULL);
  ------------------
  |  Branch (1551:13): [True: 87.4k, False: 315]
  |  Branch (1551:30): [True: 79.9k, False: 7.53k]
  ------------------
 1552|  87.7k|}
clean.c:StripOnlyChild:
  581|  73.2k|{
  582|  73.2k|    Node *child;
  583|       |
  584|  73.2k|    child = node->content;
  585|  73.2k|    node->content = child->content;
  586|  73.2k|    node->last = child->last;
  587|  73.2k|    child->content = NULL;
  588|  73.2k|    TY_(FreeNode)(doc, child);
  ------------------
  |  |   23|  73.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  589|       |
  590|   154k|    for (child = node->content; child; child = child->next)
  ------------------
  |  Branch (590:33): [True: 81.7k, False: 73.2k]
  ------------------
  591|  81.7k|        child->parent = node;
  592|  73.2k|}
clean.c:StyleToHead:
 2764|  21.0k|{
 2765|  21.0k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  21.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2766|  21.0k|    Node *next;
 2767|       |    
 2768|  2.55M|    while (node)
  ------------------
  |  Branch (2768:12): [True: 2.53M, False: 21.0k]
  ------------------
 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.13M, False: 400k]
  |  |  |  |  |  Branch (275:54): [True: 1.85k, False: 2.13M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2773|  1.85k|        {
 2774|  1.85k|            if (fix)
  ------------------
  |  Branch (2774:17): [True: 1.85k, False: 0]
  ------------------
 2775|  1.85k|            {
 2776|  1.85k|                TY_(RemoveNode)(node); /* unhook style node from body */
  ------------------
  |  |   23|  1.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2777|  1.85k|                TY_(InsertNodeAtEnd)(head, node);   /* add to end of head */
  ------------------
  |  |   23|  1.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2778|  1.85k|                TY_(Report)(doc, node, head, MOVED_STYLE_TO_HEAD); /* report move */
  ------------------
  |  |   23|  1.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2779|  1.85k|            }
 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|  1.85k|        }
 2785|  2.53M|        else if (node->content)
  ------------------
  |  Branch (2785:18): [True: 2.01M, False: 515k]
  ------------------
 2786|  2.01M|        {
 2787|  2.01M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.01M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.01M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2788|  2.01M|            node = node->content;
 2789|  2.01M|            indent++;
 2790|  2.01M|            continue;
 2791|  2.01M|        }
 2792|       |        
 2793|   517k|        if (next)
  ------------------
  |  Branch (2793:13): [True: 401k, False: 115k]
  ------------------
 2794|   401k|            node = next;
 2795|   115k|        else
 2796|   115k|        {
 2797|   115k|            node = TY_(pop)(stack);
  ------------------
  |  |   23|   115k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   115k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2798|   115k|            indent--;
 2799|   115k|        }
 2800|   517k|    }
 2801|  21.0k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  21.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2802|  21.0k|}

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

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

prvTidyDupAttrs:
   16|  2.27M|{
   17|  2.27M|    AttVal *newattrs;
   18|       |
   19|  2.27M|    if (attrs == NULL)
  ------------------
  |  Branch (19:9): [True: 1.93M, False: 340k]
  ------------------
   20|  1.93M|        return attrs;
   21|       |
   22|   340k|    newattrs = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|   340k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   340k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   23|   340k|    *newattrs = *attrs;
   24|   340k|    newattrs->next = TY_(DupAttrs)( doc, attrs->next );
  ------------------
  |  |   23|   340k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   340k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   25|   340k|    newattrs->attribute = TY_(tmbstrdup)(doc->allocator, attrs->attribute);
  ------------------
  |  |   23|   340k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   340k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   26|   340k|    newattrs->value = TY_(tmbstrdup)(doc->allocator, attrs->value);
  ------------------
  |  |   23|   340k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   340k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   27|   340k|    newattrs->dict = TY_(FindAttribute)(doc, newattrs);
  ------------------
  |  |   23|   340k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   340k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   28|   340k|    newattrs->asp = attrs->asp ? TY_(CloneNode)(doc, attrs->asp) : NULL;
  ------------------
  |  |   23|  4.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (28:21): [True: 4.06k, False: 336k]
  ------------------
   29|   340k|    newattrs->php = attrs->php ? TY_(CloneNode)(doc, attrs->php) : NULL;
  ------------------
  |  |   23|  21.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (29:21): [True: 21.8k, False: 318k]
  ------------------
   30|   340k|    return newattrs;
   31|  2.27M|}
prvTidyPushInline:
   70|  1.94M|{
   71|  1.94M|    Lexer* lexer = doc->lexer;
   72|  1.94M|    IStack *istack;
   73|       |
   74|  1.94M|    if (node->implicit)
  ------------------
  |  Branch (74:9): [True: 1.74M, False: 193k]
  ------------------
   75|  1.74M|        return;
   76|       |
   77|   193k|    if ( !IsNodePushable(node) )
  ------------------
  |  Branch (77:10): [True: 1.14k, False: 192k]
  ------------------
   78|  1.14k|        return;
   79|       |
   80|   192k|    if ( !nodeIsFONT(node) && TY_(IsPushed)(doc, node) )
  ------------------
  |  |  417|   192k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|   384k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 192k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 192k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 141k, False: 50.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( !nodeIsFONT(node) && TY_(IsPushed)(doc, node) )
  ------------------
  |  |   23|  50.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  50.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (80:31): [True: 36.0k, False: 14.3k]
  ------------------
   81|  36.0k|        return;
   82|       |
   83|       |    /* make sure there is enough space for the stack */
   84|   156k|    if (lexer->istacksize + 1 > lexer->istacklength)
  ------------------
  |  Branch (84:9): [True: 8.17k, False: 148k]
  ------------------
   85|  8.17k|    {
   86|  8.17k|        if (lexer->istacklength == 0)
  ------------------
  |  Branch (86:13): [True: 6.94k, False: 1.22k]
  ------------------
   87|  6.94k|            lexer->istacklength = 6;   /* this is perhaps excessive */
   88|       |
   89|  8.17k|        lexer->istacklength = lexer->istacklength * 2;
   90|  8.17k|        lexer->istack = (IStack *)TidyDocRealloc(doc, lexer->istack,
  ------------------
  |  |  158|  8.17k|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|  8.17k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
   91|  8.17k|                            sizeof(IStack)*(lexer->istacklength));
   92|  8.17k|    }
   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|   106k|{
  138|   106k|    Lexer* lexer = doc->lexer;
  139|       |
  140|   106k|    if (node)
  ------------------
  |  Branch (140:9): [True: 37.2k, False: 69.3k]
  ------------------
  141|  37.2k|    {
  142|  37.2k|        if ( !IsNodePushable(node) )
  ------------------
  |  Branch (142:14): [True: 802, False: 36.4k]
  ------------------
  143|    802|            return;
  144|       |
  145|       |        /* if node is </a> then pop until we find an <a> */
  146|  36.4k|        if ( nodeIsA(node) )
  ------------------
  |  |  401|  36.4k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  36.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 36.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 36.4k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 12.5k, False: 23.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  147|  12.5k|        {
  148|  12.5k|            PopIStackUntil( doc, TidyTag_A );
  149|  12.5k|            return;
  150|  12.5k|        }
  151|  36.4k|    }
  152|       |
  153|  93.1k|    if (lexer->istacksize > 0)
  ------------------
  |  Branch (153:9): [True: 90.4k, False: 2.68k]
  ------------------
  154|  90.4k|    {
  155|  90.4k|        PopIStack( doc );
  156|       |
  157|       |        /* #427822 - fix by Randy Waki 7 Aug 00 */
  158|  90.4k|        if (lexer->insert >= lexer->istack + lexer->istacksize)
  ------------------
  |  Branch (158:13): [True: 201, False: 90.2k]
  ------------------
  159|    201|            lexer->insert = NULL;
  160|  90.4k|    }
  161|  93.1k|}
prvTidyIsPushed:
  164|  4.67M|{
  165|  4.67M|    Lexer* lexer = doc->lexer;
  166|  4.67M|    int i;
  167|       |
  168|   332M|    for (i = lexer->istacksize - 1; i >= 0; --i)
  ------------------
  |  Branch (168:37): [True: 331M, False: 1.23M]
  ------------------
  169|   331M|    {
  170|   331M|        if (lexer->istack[i].tag == node->tag)
  ------------------
  |  Branch (170:13): [True: 3.44M, False: 328M]
  ------------------
  171|  3.44M|            return yes;
  172|   331M|    }
  173|       |
  174|  1.23M|    return no;
  175|  4.67M|}
prvTidyIsPushedLast:
  181|  23.1k|{
  182|  23.1k|    Lexer* lexer = doc->lexer;
  183|       |
  184|  23.1k|    if ( element && !IsNodePushable(element) )
  ------------------
  |  Branch (184:10): [True: 23.1k, False: 0]
  |  Branch (184:21): [True: 702, False: 22.4k]
  ------------------
  185|    702|        return no;
  186|       |
  187|  22.4k|    if (lexer->istacksize > 0) {
  ------------------
  |  Branch (187:9): [True: 22.2k, False: 195]
  ------------------
  188|  22.2k|        if (lexer->istack[lexer->istacksize - 1].tag == node->tag) {
  ------------------
  |  Branch (188:13): [True: 0, False: 22.2k]
  ------------------
  189|      0|            return yes;
  190|      0|        }
  191|  22.2k|    }
  192|       |
  193|  22.4k|    return no;
  194|  22.4k|}
prvTidyInlineDup:
  214|   507k|{
  215|   507k|    Lexer* lexer = doc->lexer;
  216|   507k|    int n;
  217|       |
  218|   507k|    if ((n = lexer->istacksize - lexer->istackbase) > 0)
  ------------------
  |  Branch (218:9): [True: 267k, False: 239k]
  ------------------
  219|   267k|    {
  220|   267k|        lexer->insert = &(lexer->istack[lexer->istackbase]);
  221|   267k|        lexer->inode = node;
  222|   267k|    }
  223|       |
  224|   507k|    return n;
  225|   507k|}
prvTidyDeferDup:
  232|  25.0k|{
  233|  25.0k|    doc->lexer->insert = NULL;
  234|       |    doc->lexer->inode = NULL;
  235|  25.0k|}
prvTidyInsertedToken:
  238|  1.75M|{
  239|  1.75M|    Lexer* lexer = doc->lexer;
  240|  1.75M|    Node *node;
  241|  1.75M|    IStack *istack;
  242|  1.75M|    uint n;
  243|       |
  244|       |    /* this will only be NULL if inode != NULL */
  245|  1.75M|    if (lexer->insert == NULL)
  ------------------
  |  Branch (245:9): [True: 3.71k, False: 1.74M]
  ------------------
  246|  3.71k|    {
  247|  3.71k|        node = lexer->inode;
  248|  3.71k|        lexer->inode = NULL;
  249|  3.71k|        return node;
  250|  3.71k|    }
  251|       |
  252|       |    /*
  253|       |      If this is the "latest" node then update
  254|       |      the position, otherwise use current values
  255|       |    */
  256|       |
  257|  1.74M|    if (lexer->inode == NULL)
  ------------------
  |  Branch (257:9): [True: 1.68M, False: 59.6k]
  ------------------
  258|  1.68M|    {
  259|  1.68M|        lexer->lines = doc->docIn->curline;
  260|  1.68M|        lexer->columns = doc->docIn->curcol;
  261|  1.68M|    }
  262|       |
  263|  1.74M|    node = TY_(NewNode)(doc->allocator, lexer);
  ------------------
  |  |   23|  1.74M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.74M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  264|  1.74M|    node->type = StartTag;
  265|  1.74M|    node->implicit = yes;
  266|  1.74M|    node->start = lexer->txtstart;
  267|       |    /* #431734 [JTidy bug #226261 (was 126261)] - fix by Gary Peskin 20 Dec 00 */ 
  268|  1.74M|    node->end = lexer->txtend; /* was : lexer->txtstart; */
  269|  1.74M|    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.74M|    node->element = TY_(tmbstrdup)(doc->allocator, istack->element);
  ------------------
  |  |   23|  1.74M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.74M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  280|  1.74M|    node->tag = istack->tag;
  281|  1.74M|    node->attributes = TY_(DupAttrs)( doc, istack->attributes );
  ------------------
  |  |   23|  1.74M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.74M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  282|       |
  283|       |    /* advance lexer to next item on the stack */
  284|  1.74M|    n = (uint)(lexer->insert - &(lexer->istack[0]));
  285|       |
  286|       |    /* and recover state if we have reached the end */
  287|  1.74M|    if (++n < lexer->istacksize)
  ------------------
  |  Branch (287:9): [True: 1.48M, False: 261k]
  ------------------
  288|  1.48M|        lexer->insert = &(lexer->istack[n]);
  289|   261k|    else
  290|   261k|        lexer->insert = NULL;
  291|       |
  292|  1.74M|    return node;
  293|  1.75M|}
prvTidySwitchInline:
  304|  16.5k|{
  305|  16.5k|    Lexer* lexer = doc->lexer;
  306|  16.5k|    if ( lexer
  ------------------
  |  Branch (306:10): [True: 16.5k, False: 0]
  ------------------
  307|  16.5k|         && element && element->tag
  ------------------
  |  Branch (307:13): [True: 16.5k, False: 0]
  |  Branch (307:24): [True: 16.5k, False: 0]
  ------------------
  308|  16.5k|         && node && node->tag
  ------------------
  |  Branch (308:13): [True: 16.5k, False: 0]
  |  Branch (308:21): [True: 16.5k, False: 0]
  ------------------
  309|  16.5k|         && TY_(IsPushed)( doc, element )
  ------------------
  |  |   23|  16.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (309:13): [True: 16.5k, False: 0]
  ------------------
  310|  16.5k|         && TY_(IsPushed)( doc, node ) 
  ------------------
  |  |   23|  16.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (310:13): [True: 16.5k, False: 0]
  ------------------
  311|  16.5k|         && ((lexer->istacksize - lexer->istackbase) >= 2) )
  ------------------
  |  Branch (311:13): [True: 16.3k, False: 203]
  ------------------
  312|  16.3k|    {
  313|       |        /* we have a chance of succeeding ... */
  314|  16.3k|        int i;
  315|  25.5k|        for (i = (lexer->istacksize - lexer->istackbase - 1); i >= 0; --i)
  ------------------
  |  Branch (315:63): [True: 24.4k, False: 1.12k]
  ------------------
  316|  24.4k|        {
  317|  24.4k|            if (lexer->istack[i].tag == element->tag) {
  ------------------
  |  Branch (317:17): [True: 16.0k, False: 8.31k]
  ------------------
  318|       |                /* found the element tag - phew */
  319|  16.0k|                IStack *istack1 = &lexer->istack[i];
  320|  16.0k|                IStack *istack2 = NULL;
  321|  16.0k|                --i; /* back one more, and continue */
  322|  97.6k|                for ( ; i >= 0; --i)
  ------------------
  |  Branch (322:25): [True: 96.7k, False: 886]
  ------------------
  323|  96.7k|                {
  324|  96.7k|                    if (lexer->istack[i].tag == node->tag)
  ------------------
  |  Branch (324:25): [True: 15.2k, False: 81.5k]
  ------------------
  325|  15.2k|                    {
  326|       |                        /* found the element tag - phew */
  327|  15.2k|                        istack2 = &lexer->istack[i];
  328|  15.2k|                        break;
  329|  15.2k|                    }
  330|  96.7k|                }
  331|  16.0k|                if ( istack2 )
  ------------------
  |  Branch (331:22): [True: 15.2k, False: 886]
  ------------------
  332|  15.2k|                {
  333|       |                    /* perform the swap */
  334|  15.2k|                    IStack tmp_istack = *istack2;
  335|  15.2k|                    *istack2 = *istack1;
  336|  15.2k|                    *istack1 = tmp_istack;
  337|  15.2k|                    return yes;
  338|  15.2k|                }
  339|  16.0k|            }
  340|  24.4k|        }
  341|  16.3k|    }
  342|  1.32k|    return no;
  343|  16.5k|}
prvTidyInlineDup1:
  351|  15.2k|{
  352|  15.2k|    Lexer* lexer = doc->lexer;
  353|  15.2k|    int n, i;
  354|  15.2k|    if ( element
  ------------------
  |  Branch (354:10): [True: 15.2k, False: 0]
  ------------------
  355|  15.2k|         && (element->tag != NULL)
  ------------------
  |  Branch (355:13): [True: 15.2k, False: 0]
  ------------------
  356|  15.2k|         && ((n = lexer->istacksize - lexer->istackbase) > 0) )
  ------------------
  |  Branch (356:13): [True: 15.2k, False: 0]
  ------------------
  357|  15.2k|    {
  358|  55.2k|        for ( i = n - 1; i >=0; --i ) {
  ------------------
  |  Branch (358:26): [True: 55.2k, False: 0]
  ------------------
  359|  55.2k|            if (lexer->istack[i].tag == element->tag) {
  ------------------
  |  Branch (359:17): [True: 15.2k, False: 40.0k]
  ------------------
  360|       |                /* found our element tag - insert it */
  361|  15.2k|                lexer->insert = &(lexer->istack[i]);
  362|  15.2k|                lexer->inode = node;
  363|  15.2k|                return yes;
  364|  15.2k|            }
  365|  55.2k|        }
  366|  15.2k|    }
  367|      0|    return no;
  368|  15.2k|}
istack.c:IsNodePushable:
   34|   253k|{
   35|   253k|    if (node->tag == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 253k]
  ------------------
   36|      0|        return no;
   37|       |
   38|   253k|    if (!(node->tag->model & CM_INLINE))
  ------------------
  |  |  143|   253k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (38:9): [True: 308, False: 253k]
  ------------------
   39|    308|        return no;
   40|       |
   41|   253k|    if (node->tag->model & CM_OBJECT)
  ------------------
  |  |  150|   253k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (41:9): [True: 196, False: 253k]
  ------------------
   42|    196|        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|   253k|    if (nodeIsINS(node) || nodeIsDEL(node))
  ------------------
  |  |  457|   253k|#define nodeIsINS( node )        TagIsId( node, TidyTag_INS )
  |  |  ------------------
  |  |  |  |  275|   506k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 253k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 253k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 880, False: 252k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (nodeIsINS(node) || nodeIsDEL(node))
  ------------------
  |  |  458|   252k|#define nodeIsDEL( node )        TagIsId( node, TidyTag_DEL )
  |  |  ------------------
  |  |  |  |  275|   252k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 252k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 252k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.26k, False: 251k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|  2.14k|        return no;
   49|       |
   50|   251k|    return yes;
   51|   253k|}
istack.c:PopIStackUntil:
  122|  12.5k|{
  123|  12.5k|    Lexer* lexer = doc->lexer;
  124|  12.5k|    IStack *istack;
  125|       |
  126|  77.3k|    while (lexer->istacksize > 0)
  ------------------
  |  Branch (126:12): [True: 65.8k, False: 11.4k]
  ------------------
  127|  65.8k|    {
  128|  65.8k|        PopIStack( doc );
  129|  65.8k|        istack = &(lexer->istack[lexer->istacksize]);
  130|  65.8k|        if ( istack->tag->id == tid )
  ------------------
  |  Branch (130:14): [True: 1.11k, False: 64.7k]
  ------------------
  131|  1.11k|            break;
  132|  65.8k|    }
  133|  12.5k|}
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.87k, False: 156k]
  ------------------
  112|  9.87k|    {
  113|  9.87k|        av = istack->attributes;
  114|  9.87k|        istack->attributes = av->next;
  115|  9.87k|        TY_(FreeAttribute)( doc, av );
  ------------------
  |  |   23|  9.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  116|  9.87k|    }
  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|  70.0M|{
  264|  70.0M|    ctmbstr result;
  265|       |    
  266|  70.0M|    result  = tidyLocalizedStringImpl( messageType, tidyLanguages.currentLanguage, quantity);
  267|       |    
  268|  70.0M|    if (!result && tidyLanguages.fallbackLanguage )
  ------------------
  |  Branch (268:9): [True: 0, False: 70.0M]
  |  Branch (268:20): [True: 0, False: 0]
  ------------------
  269|      0|    {
  270|      0|        result = tidyLocalizedStringImpl( messageType, tidyLanguages.fallbackLanguage, quantity);
  271|      0|    }
  272|       |    
  273|  70.0M|    if (!result)
  ------------------
  |  Branch (273:9): [True: 0, False: 70.0M]
  ------------------
  274|      0|    {
  275|       |        /* Fallback to en which is built in. */
  276|      0|        result = tidyLocalizedStringImpl( messageType, &language_en, quantity);
  277|      0|    }
  278|       |    
  279|  70.0M|    if (!result)
  ------------------
  |  Branch (279:9): [True: 0, False: 70.0M]
  ------------------
  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|  70.0M|    return result;
  286|  70.0M|}
prvTidytidyLocalizedString:
  298|  50.4M|{
  299|  50.4M|    return TY_(tidyLocalizedStringN)( messageType, 1 );
  ------------------
  |  |   23|  50.4M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  50.4M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  300|  50.4M|}
prvTidytidySetLanguage:
  399|  42.6k|{
  400|  42.6k|    languageDefinition *dict1 = NULL;
  401|  42.6k|    languageDefinition *dict2 = NULL;
  402|  42.6k|    tmbstr wantCode = NULL;
  403|  42.6k|    char lang[3] = "";
  404|       |    
  405|  42.6k|    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: 42.6k, False: 0]
  |  Branch (405:27): [True: 0, False: 0]
  ------------------
  406|  42.6k|    {
  407|  42.6k|        return no;
  408|  42.6k|    }
  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|  42.6k|}
prvTidytidyGetLanguageSetByUser:
  464|  21.3k|{
  465|  21.3k|    return tidyLanguages.manually_set;
  466|  21.3k|}
prvTidytidyDefaultStringN:
  484|  19.5M|{
  485|  19.5M|    return tidyLocalizedStringImpl( messageType, &language_en, quantity);
  486|  19.5M|}
prvTidytidyDefaultString:
  494|  58.7M|{
  495|  58.7M|    return tidyLocalizedStringImpl( messageType, &language_en, 1);
  496|  58.7M|}
language.c:tidyLocalizedStringImpl:
  237|   148M|{
  238|   148M|    int i;
  239|   148M|    languageDictionary *dictionary = &definition->messages;
  240|   148M|    uint pluralForm = definition->whichPluralForm(plural);
  241|       |    
  242|  20.0G|    for (i = 0; (*dictionary)[i].value; ++i)
  ------------------
  |  Branch (242:17): [True: 20.0G, False: 0]
  ------------------
  243|  20.0G|    {
  244|  20.0G|        if ( (*dictionary)[i].key == messageType && (*dictionary)[i].pluralForm == pluralForm )
  ------------------
  |  Branch (244:14): [True: 186M, False: 19.8G]
  |  Branch (244:53): [True: 148M, False: 38.0M]
  ------------------
  245|   148M|        {
  246|   148M|            return (*dictionary)[i].value;
  247|   148M|        }
  248|  20.0G|    }
  249|      0|    return NULL;
  250|   148M|}

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

prvTidyHTMLVersion:
  257|  3.70M|{
  258|  3.70M|    uint i;
  259|  3.70M|    uint j = 0;
  260|  3.70M|    uint score = 0;
  261|  3.70M|    uint vers = doc->lexer->versions;
  262|  3.70M|    uint dtver = doc->lexer->doctype;
  263|  3.70M|    TidyDoctypeModes dtmode = (TidyDoctypeModes)cfg(doc, TidyDoctypeMode);
  ------------------
  |  |  415|  3.70M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  264|  3.70M|    Bool xhtml = (cfgBool(doc, TidyXmlOut) || doc->lexer->isvoyager) &&
  ------------------
  |  |  418|  7.40M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.70M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 3.70M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (264:47): [True: 0, False: 0]
  ------------------
  265|  3.70M|                 !cfgBool(doc, TidyHtmlOut);
  ------------------
  |  |  418|  7.40M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.70M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (265:18): [True: 3.70M, False: 0]
  ------------------
  266|  3.70M|    Bool html4 = ((dtmode == TidyDoctypeStrict) || (dtmode == TidyDoctypeLoose) ||
  ------------------
  |  Branch (266:19): [True: 0, False: 3.70M]
  |  Branch (266:52): [True: 0, False: 3.70M]
  ------------------
  267|  3.70M|                  (VERS_HMTL40PX & dtver) ? yes : no);
  ------------------
  |  |  254|  3.70M|#define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  216|  3.70M|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  207|  3.70M|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  179|  3.70M|#define H40S                   4u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  182|  3.70M|#define H41S                  32u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  185|  3.70M|#define X10S                 256u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  3.70M|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  3.70M|#define H40T                   8u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  3.70M|#define H41T                  64u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|  3.70M|#define X10T                 512u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  209|  3.70M|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|  3.70M|#define H40F                  16u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|  3.70M|#define H41F                 128u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|  3.70M|#define X10F                1024u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  210|  3.70M|#define VERS_XHTML11       (XH11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  188|  3.70M|#define XH11                2048u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  211|  3.70M|#define VERS_BASIC         (XB10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|  3.70M|#define XB10                4096u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (267:19): [True: 42.5k, False: 3.66M]
  ------------------
  268|  3.70M|    Bool html5 = (!html4 && ((dtmode == TidyDoctypeAuto) ||
  ------------------
  |  Branch (268:19): [True: 3.66M, False: 42.5k]
  |  Branch (268:30): [True: 3.66M, False: 0]
  ------------------
  269|  3.66M|                  (dtmode == TidyDoctypeHtml5)) ? yes : no);
  ------------------
  |  Branch (269:19): [True: 0, False: 0]
  ------------------
  270|       |
  271|  3.70M|    if (xhtml && dtver == VERS_UNKNOWN) return XH50;
  ------------------
  |  |  204|  3.70M|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  3.70M|#define xxxx                   0u
  |  |  ------------------
  ------------------
                  if (xhtml && dtver == VERS_UNKNOWN) return XH50;
  ------------------
  |  |  201|  3.60M|#define XH50              262144u
  ------------------
  |  Branch (271:9): [True: 3.70M, False: 0]
  |  Branch (271:18): [True: 3.60M, False: 93.7k]
  ------------------
  272|  93.7k|    if (dtver == VERS_UNKNOWN) return HT50;
  ------------------
  |  |  204|  93.7k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  93.7k|#define xxxx                   0u
  |  |  ------------------
  ------------------
                  if (dtver == VERS_UNKNOWN) return HT50;
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
  |  Branch (272:9): [True: 0, False: 93.7k]
  ------------------
  273|       |    /* Issue #167 - if NOT XHTML, and doctype is default VERS_HTML5, then return HT50 */
  274|  93.7k|    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: 93.7k]
  |  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|  93.7k|    if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  213|  51.2k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  51.2k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  51.2k|#define XH50              262144u
  |  |  ------------------
  ------------------
                  if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  201|  51.2k|#define XH50              262144u
  ------------------
                  if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  201|    858|#define XH50              262144u
  ------------------
  |  Branch (277:9): [True: 93.7k, False: 0]
  |  Branch (277:18): [True: 51.2k, False: 42.5k]
  |  Branch (277:27): [True: 858, False: 50.3k]
  ------------------
  278|       |
  279|  1.85M|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (279:17): [True: 1.76M, False: 92.8k]
  ------------------
  280|  1.76M|    {
  281|  1.76M|        if ((xhtml && !(VERS_XHTML & W3C_Doctypes[i].vers)) ||
  ------------------
  |  |  222|  1.76M|#define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  185|  1.76M|#define X10S                 256u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  186|  1.76M|#define X10T                 512u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  187|  1.76M|#define X10F                1024u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  188|  1.76M|#define XH11                2048u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  189|  1.76M|#define XB10                4096u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  201|  1.76M|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (281:14): [True: 1.76M, False: 0]
  |  Branch (281:23): [True: 1.20M, False: 557k]
  ------------------
  282|   557k|            (html4 && !(VERS_HMTL40PX & W3C_Doctypes[i].vers)))
  ------------------
  |  |  254|   255k|#define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  216|   255k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  207|   255k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  179|   255k|#define H40S                   4u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  182|   255k|#define H41S                  32u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  185|   255k|#define X10S                 256u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|   255k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|   255k|#define H40T                   8u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|   255k|#define H41T                  64u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|   255k|#define X10T                 512u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  209|   255k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|   255k|#define H40F                  16u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|   255k|#define H41F                 128u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|   255k|#define X10F                1024u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  210|   255k|#define VERS_XHTML11       (XH11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  188|   255k|#define XH11                2048u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  211|   255k|#define VERS_BASIC         (XB10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|   255k|#define XB10                4096u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (282:14): [True: 255k, False: 302k]
  |  Branch (282:23): [True: 42.5k, False: 212k]
  ------------------
  283|  1.24M|            continue;
  284|       |
  285|   514k|        if (vers & W3C_Doctypes[i].vers &&
  ------------------
  |  Branch (285:13): [True: 228k, False: 286k]
  ------------------
  286|   228k|            (W3C_Doctypes[i].score < score || !score))
  ------------------
  |  Branch (286:14): [True: 3.53k, False: 224k]
  |  Branch (286:47): [True: 87.9k, False: 136k]
  ------------------
  287|  91.5k|        {
  288|  91.5k|            score = W3C_Doctypes[i].score;
  289|  91.5k|            j = i;
  290|  91.5k|        }
  291|   514k|    }
  292|       |
  293|  92.8k|    if (score)
  ------------------
  |  Branch (293:9): [True: 87.9k, False: 4.87k]
  ------------------
  294|  87.9k|        return W3C_Doctypes[j].vers;
  295|       |
  296|  4.87k|    return VERS_UNKNOWN;
  ------------------
  |  |  204|  4.87k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  4.87k|#define xxxx                   0u
  |  |  ------------------
  ------------------
  297|  92.8k|}
prvTidyConstrainVersion:
  442|  1.35M|{
  443|  1.35M|    doc->lexer->versions &= (vers | VERS_PROPRIETARY);
  ------------------
  |  |  231|  1.35M|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  1.35M|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  1.35M|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  1.35M|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  444|  1.35M|}
prvTidyIsWhite:
  448|   312M|{
  449|   312M|    uint map = MAP(c);
  ------------------
  |  |  206|   312M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 309M, False: 3.54M]
  |  |  ------------------
  ------------------
  450|       |
  451|   312M|    return (map & white)!=0;
  ------------------
  |  |   71|   312M|#define white       8u
  ------------------
  452|   312M|}
prvTidyIsDigit:
  461|  35.0k|{
  462|  35.0k|    uint map;
  463|       |
  464|  35.0k|    map = MAP(c);
  ------------------
  |  |  206|  35.0k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 32.6k, False: 2.42k]
  |  |  ------------------
  ------------------
  465|       |
  466|  35.0k|    return (map & digit)!=0;
  ------------------
  |  |   68|  35.0k|#define digit       1u
  ------------------
  467|  35.0k|}
prvTidyIsLetter:
  479|  2.04M|{
  480|  2.04M|    uint map;
  481|       |
  482|  2.04M|    map = MAP(c);
  ------------------
  |  |  206|  2.04M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 2.00M, False: 40.5k]
  |  |  ------------------
  ------------------
  483|       |
  484|  2.04M|    return (map & letter)!=0;
  ------------------
  |  |   69|  2.04M|#define letter      2u
  ------------------
  485|  2.04M|}
prvTidyIsHTMLSpace:
  488|  1.63M|{
  489|  1.63M|    return c == 0x020 || c == 0x009 || c == 0x00a || c == 0x00c || c == 0x00d;
  ------------------
  |  Branch (489:12): [True: 18.1k, False: 1.61M]
  |  Branch (489:26): [True: 662, False: 1.61M]
  |  Branch (489:40): [True: 1.00k, False: 1.61M]
  |  Branch (489:54): [True: 29.5k, False: 1.58M]
  |  Branch (489:68): [True: 350, False: 1.58M]
  ------------------
  490|  1.63M|}
prvTidyIsNamechar:
  493|  9.47M|{
  494|  9.47M|    uint map = MAP(c);
  ------------------
  |  |  206|  9.47M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 9.39M, False: 77.3k]
  |  |  ------------------
  ------------------
  495|  9.47M|    return (map & namechar)!=0;
  ------------------
  |  |   70|  9.47M|#define namechar    4u
  ------------------
  496|  9.47M|}
prvTidyIsXMLLetter:
  499|   934k|{
  500|   934k|    return ((c >= 0x41 && c <= 0x5a) ||
  ------------------
  |  Branch (500:14): [True: 911k, False: 23.1k]
  |  Branch (500:27): [True: 32.6k, False: 878k]
  ------------------
  501|   902k|        (c >= 0x61 && c <= 0x7a) ||
  ------------------
  |  Branch (501:10): [True: 877k, False: 24.9k]
  |  Branch (501:23): [True: 667k, False: 209k]
  ------------------
  502|   234k|        (c >= 0xc0 && c <= 0xd6) ||
  ------------------
  |  Branch (502:10): [True: 208k, False: 25.5k]
  |  Branch (502:23): [True: 465, False: 208k]
  ------------------
  503|   233k|        (c >= 0xd8 && c <= 0xf6) ||
  ------------------
  |  Branch (503:10): [True: 208k, False: 25.5k]
  |  Branch (503:23): [True: 508, False: 207k]
  ------------------
  504|   233k|        (c >= 0xf8 && c <= 0xff) ||
  ------------------
  |  Branch (504:10): [True: 207k, False: 25.5k]
  |  Branch (504:23): [True: 276, False: 207k]
  ------------------
  505|   233k|        (c >= 0x100 && c <= 0x131) ||
  ------------------
  |  Branch (505:10): [True: 207k, False: 25.5k]
  |  Branch (505:24): [True: 286, False: 207k]
  ------------------
  506|   232k|        (c >= 0x134 && c <= 0x13e) ||
  ------------------
  |  Branch (506:10): [True: 207k, False: 25.5k]
  |  Branch (506:24): [True: 295, False: 207k]
  ------------------
  507|   232k|        (c >= 0x141 && c <= 0x148) ||
  ------------------
  |  Branch (507:10): [True: 207k, False: 25.5k]
  |  Branch (507:24): [True: 211, False: 206k]
  ------------------
  508|   232k|        (c >= 0x14a && c <= 0x17e) ||
  ------------------
  |  Branch (508:10): [True: 206k, False: 25.5k]
  |  Branch (508:24): [True: 739, False: 206k]
  ------------------
  509|   231k|        (c >= 0x180 && c <= 0x1c3) ||
  ------------------
  |  Branch (509:10): [True: 206k, False: 25.5k]
  |  Branch (509:24): [True: 694, False: 205k]
  ------------------
  510|   230k|        (c >= 0x1cd && c <= 0x1f0) ||
  ------------------
  |  Branch (510:10): [True: 205k, False: 25.5k]
  |  Branch (510:24): [True: 984, False: 204k]
  ------------------
  511|   229k|        (c >= 0x1f4 && c <= 0x1f5) ||
  ------------------
  |  Branch (511:10): [True: 204k, False: 25.5k]
  |  Branch (511:24): [True: 212, False: 204k]
  ------------------
  512|   229k|        (c >= 0x1fa && c <= 0x217) ||
  ------------------
  |  Branch (512:10): [True: 204k, False: 25.5k]
  |  Branch (512:24): [True: 827, False: 203k]
  ------------------
  513|   228k|        (c >= 0x250 && c <= 0x2a8) ||
  ------------------
  |  Branch (513:10): [True: 203k, False: 25.5k]
  |  Branch (513:24): [True: 286, False: 203k]
  ------------------
  514|   228k|        (c >= 0x2bb && c <= 0x2c1) ||
  ------------------
  |  Branch (514:10): [True: 203k, False: 25.5k]
  |  Branch (514:24): [True: 1.08k, False: 202k]
  ------------------
  515|   227k|        c == 0x386 ||
  ------------------
  |  Branch (515:9): [True: 232, False: 227k]
  ------------------
  516|   227k|        (c >= 0x388 && c <= 0x38a) ||
  ------------------
  |  Branch (516:10): [True: 198k, False: 28.3k]
  |  Branch (516:24): [True: 343, False: 198k]
  ------------------
  517|   226k|        c == 0x38c ||
  ------------------
  |  Branch (517:9): [True: 212, False: 226k]
  ------------------
  518|   226k|        (c >= 0x38e && c <= 0x3a1) ||
  ------------------
  |  Branch (518:10): [True: 198k, False: 28.3k]
  |  Branch (518:24): [True: 1.09k, False: 197k]
  ------------------
  519|   225k|        (c >= 0x3a3 && c <= 0x3ce) ||
  ------------------
  |  Branch (519:10): [True: 197k, False: 28.3k]
  |  Branch (519:24): [True: 973, False: 196k]
  ------------------
  520|   224k|        (c >= 0x3d0 && c <= 0x3d6) ||
  ------------------
  |  Branch (520:10): [True: 196k, False: 28.3k]
  |  Branch (520:24): [True: 818, False: 195k]
  ------------------
  521|   223k|        c == 0x3da ||
  ------------------
  |  Branch (521:9): [True: 316, False: 223k]
  ------------------
  522|   223k|        c == 0x3dc ||
  ------------------
  |  Branch (522:9): [True: 200, False: 223k]
  ------------------
  523|   223k|        c == 0x3de ||
  ------------------
  |  Branch (523:9): [True: 418, False: 222k]
  ------------------
  524|   222k|        c == 0x3e0 ||
  ------------------
  |  Branch (524:9): [True: 354, False: 222k]
  ------------------
  525|   222k|        (c >= 0x3e2 && c <= 0x3f3) ||
  ------------------
  |  Branch (525:10): [True: 194k, False: 28.3k]
  |  Branch (525:24): [True: 334, False: 193k]
  ------------------
  526|   222k|        (c >= 0x401 && c <= 0x40c) ||
  ------------------
  |  Branch (526:10): [True: 193k, False: 28.3k]
  |  Branch (526:24): [True: 999, False: 192k]
  ------------------
  527|   221k|        (c >= 0x40e && c <= 0x44f) ||
  ------------------
  |  Branch (527:10): [True: 192k, False: 28.3k]
  |  Branch (527:24): [True: 201, False: 192k]
  ------------------
  528|   221k|        (c >= 0x451 && c <= 0x45c) ||
  ------------------
  |  Branch (528:10): [True: 192k, False: 28.3k]
  |  Branch (528:24): [True: 451, False: 192k]
  ------------------
  529|   220k|        (c >= 0x45e && c <= 0x481) ||
  ------------------
  |  Branch (529:10): [True: 192k, False: 28.3k]
  |  Branch (529:24): [True: 373, False: 191k]
  ------------------
  530|   220k|        (c >= 0x490 && c <= 0x4c4) ||
  ------------------
  |  Branch (530:10): [True: 191k, False: 28.5k]
  |  Branch (530:24): [True: 1.66k, False: 190k]
  ------------------
  531|   218k|        (c >= 0x4c7 && c <= 0x4c8) ||
  ------------------
  |  Branch (531:10): [True: 190k, False: 28.5k]
  |  Branch (531:24): [True: 219, False: 189k]
  ------------------
  532|   218k|        (c >= 0x4cb && c <= 0x4cc) ||
  ------------------
  |  Branch (532:10): [True: 189k, False: 28.5k]
  |  Branch (532:24): [True: 195, False: 189k]
  ------------------
  533|   218k|        (c >= 0x4d0 && c <= 0x4eb) ||
  ------------------
  |  Branch (533:10): [True: 189k, False: 28.5k]
  |  Branch (533:24): [True: 269, False: 189k]
  ------------------
  534|   217k|        (c >= 0x4ee && c <= 0x4f5) ||
  ------------------
  |  Branch (534:10): [True: 189k, False: 28.5k]
  |  Branch (534:24): [True: 274, False: 189k]
  ------------------
  535|   217k|        (c >= 0x4f8 && c <= 0x4f9) ||
  ------------------
  |  Branch (535:10): [True: 189k, False: 28.5k]
  |  Branch (535:24): [True: 245, False: 188k]
  ------------------
  536|   217k|        (c >= 0x531 && c <= 0x556) ||
  ------------------
  |  Branch (536:10): [True: 188k, False: 28.5k]
  |  Branch (536:24): [True: 978, False: 187k]
  ------------------
  537|   216k|        c == 0x559 ||
  ------------------
  |  Branch (537:9): [True: 641, False: 215k]
  ------------------
  538|   215k|        (c >= 0x561 && c <= 0x586) ||
  ------------------
  |  Branch (538:10): [True: 187k, False: 28.5k]
  |  Branch (538:24): [True: 216, False: 186k]
  ------------------
  539|   215k|        (c >= 0x5d0 && c <= 0x5ea) ||
  ------------------
  |  Branch (539:10): [True: 183k, False: 32.4k]
  |  Branch (539:24): [True: 698, False: 182k]
  ------------------
  540|   214k|        (c >= 0x5f0 && c <= 0x5f2) ||
  ------------------
  |  Branch (540:10): [True: 182k, False: 32.4k]
  |  Branch (540:24): [True: 486, False: 181k]
  ------------------
  541|   214k|        (c >= 0x621 && c <= 0x63a) ||
  ------------------
  |  Branch (541:10): [True: 181k, False: 32.4k]
  |  Branch (541:24): [True: 1.15k, False: 180k]
  ------------------
  542|   213k|        (c >= 0x641 && c <= 0x64a) ||
  ------------------
  |  Branch (542:10): [True: 180k, False: 32.6k]
  |  Branch (542:24): [True: 409, False: 180k]
  ------------------
  543|   212k|        (c >= 0x671 && c <= 0x6b7) ||
  ------------------
  |  Branch (543:10): [True: 178k, False: 34.2k]
  |  Branch (543:24): [True: 704, False: 177k]
  ------------------
  544|   212k|        (c >= 0x6ba && c <= 0x6be) ||
  ------------------
  |  Branch (544:10): [True: 177k, False: 34.2k]
  |  Branch (544:24): [True: 1.12k, False: 176k]
  ------------------
  545|   210k|        (c >= 0x6c0 && c <= 0x6ce) ||
  ------------------
  |  Branch (545:10): [True: 176k, False: 34.2k]
  |  Branch (545:24): [True: 885, False: 175k]
  ------------------
  546|   210k|        (c >= 0x6d0 && c <= 0x6d3) ||
  ------------------
  |  Branch (546:10): [True: 175k, False: 34.2k]
  |  Branch (546:24): [True: 216, False: 175k]
  ------------------
  547|   209k|        c == 0x6d5 ||
  ------------------
  |  Branch (547:9): [True: 656, False: 209k]
  ------------------
  548|   209k|        (c >= 0x6e5 && c <= 0x6e6) ||
  ------------------
  |  Branch (548:10): [True: 172k, False: 36.6k]
  |  Branch (548:24): [True: 300, False: 172k]
  ------------------
  549|   208k|        (c >= 0x905 && c <= 0x939) ||
  ------------------
  |  Branch (549:10): [True: 168k, False: 40.6k]
  |  Branch (549:24): [True: 446, False: 167k]
  ------------------
  550|   208k|        c == 0x93d ||
  ------------------
  |  Branch (550:9): [True: 205, False: 208k]
  ------------------
  551|   208k|        (c >= 0x958 && c <= 0x961) ||
  ------------------
  |  Branch (551:10): [True: 164k, False: 43.3k]
  |  Branch (551:24): [True: 215, False: 164k]
  ------------------
  552|   208k|        (c >= 0x985 && c <= 0x98c) ||
  ------------------
  |  Branch (552:10): [True: 163k, False: 44.4k]
  |  Branch (552:24): [True: 416, False: 163k]
  ------------------
  553|   207k|        (c >= 0x98f && c <= 0x990) ||
  ------------------
  |  Branch (553:10): [True: 163k, False: 44.4k]
  |  Branch (553:24): [True: 373, False: 162k]
  ------------------
  554|   207k|        (c >= 0x993 && c <= 0x9a8) ||
  ------------------
  |  Branch (554:10): [True: 162k, False: 44.4k]
  |  Branch (554:24): [True: 479, False: 162k]
  ------------------
  555|   206k|        (c >= 0x9aa && c <= 0x9b0) ||
  ------------------
  |  Branch (555:10): [True: 162k, False: 44.4k]
  |  Branch (555:24): [True: 657, False: 161k]
  ------------------
  556|   206k|        c == 0x9b2 ||
  ------------------
  |  Branch (556:9): [True: 579, False: 205k]
  ------------------
  557|   205k|        (c >= 0x9b6 && c <= 0x9b9) ||
  ------------------
  |  Branch (557:10): [True: 161k, False: 44.4k]
  |  Branch (557:24): [True: 370, False: 160k]
  ------------------
  558|   205k|        (c >= 0x9dc && c <= 0x9dd) ||
  ------------------
  |  Branch (558:10): [True: 157k, False: 47.1k]
  |  Branch (558:24): [True: 323, False: 157k]
  ------------------
  559|   204k|        (c >= 0x9df && c <= 0x9e1) ||
  ------------------
  |  Branch (559:10): [True: 157k, False: 47.1k]
  |  Branch (559:24): [True: 585, False: 157k]
  ------------------
  560|   204k|        (c >= 0x9f0 && c <= 0x9f1) ||
  ------------------
  |  Branch (560:10): [True: 156k, False: 48.0k]
  |  Branch (560:24): [True: 520, False: 155k]
  ------------------
  561|   203k|        (c >= 0xa05 && c <= 0xa0a) ||
  ------------------
  |  Branch (561:10): [True: 154k, False: 48.8k]
  |  Branch (561:24): [True: 1.32k, False: 153k]
  ------------------
  562|   202k|        (c >= 0xa0f && c <= 0xa10) ||
  ------------------
  |  Branch (562:10): [True: 153k, False: 48.8k]
  |  Branch (562:24): [True: 799, False: 152k]
  ------------------
  563|   201k|        (c >= 0xa13 && c <= 0xa28) ||
  ------------------
  |  Branch (563:10): [True: 152k, False: 48.8k]
  |  Branch (563:24): [True: 208, False: 152k]
  ------------------
  564|   201k|        (c >= 0xa2a && c <= 0xa30) ||
  ------------------
  |  Branch (564:10): [True: 152k, False: 48.8k]
  |  Branch (564:24): [True: 1.24k, False: 151k]
  ------------------
  565|   200k|        (c >= 0xa32 && c <= 0xa33) ||
  ------------------
  |  Branch (565:10): [True: 151k, False: 48.8k]
  |  Branch (565:24): [True: 363, False: 150k]
  ------------------
  566|   199k|        (c >= 0xa35 && c <= 0xa36) ||
  ------------------
  |  Branch (566:10): [True: 150k, False: 48.8k]
  |  Branch (566:24): [True: 645, False: 150k]
  ------------------
  567|   199k|        (c >= 0xa38 && c <= 0xa39) ||
  ------------------
  |  Branch (567:10): [True: 150k, False: 48.8k]
  |  Branch (567:24): [True: 583, False: 149k]
  ------------------
  568|   198k|        (c >= 0xa59 && c <= 0xa5c) ||
  ------------------
  |  Branch (568:10): [True: 147k, False: 51.1k]
  |  Branch (568:24): [True: 1.20k, False: 146k]
  ------------------
  569|   197k|        c == 0xa5e ||
  ------------------
  |  Branch (569:9): [True: 464, False: 196k]
  ------------------
  570|   196k|        (c >= 0xa72 && c <= 0xa74) ||
  ------------------
  |  Branch (570:10): [True: 144k, False: 52.6k]
  |  Branch (570:24): [True: 440, False: 143k]
  ------------------
  571|   196k|        (c >= 0xa85 && c <= 0xa8b) ||
  ------------------
  |  Branch (571:10): [True: 143k, False: 52.9k]
  |  Branch (571:24): [True: 1.21k, False: 142k]
  ------------------
  572|   195k|        c == 0xa8d ||
  ------------------
  |  Branch (572:9): [True: 244, False: 194k]
  ------------------
  573|   194k|        (c >= 0xa8f && c <= 0xa91) ||
  ------------------
  |  Branch (573:10): [True: 142k, False: 52.9k]
  |  Branch (573:24): [True: 883, False: 141k]
  ------------------
  574|   194k|        (c >= 0xa93 && c <= 0xaa8) ||
  ------------------
  |  Branch (574:10): [True: 141k, False: 52.9k]
  |  Branch (574:24): [True: 493, False: 140k]
  ------------------
  575|   193k|        (c >= 0xaaa && c <= 0xab0) ||
  ------------------
  |  Branch (575:10): [True: 140k, False: 52.9k]
  |  Branch (575:24): [True: 1.26k, False: 139k]
  ------------------
  576|   192k|        (c >= 0xab2 && c <= 0xab3) ||
  ------------------
  |  Branch (576:10): [True: 139k, False: 52.9k]
  |  Branch (576:24): [True: 476, False: 138k]
  ------------------
  577|   191k|        (c >= 0xab5 && c <= 0xab9) ||
  ------------------
  |  Branch (577:10): [True: 138k, False: 52.9k]
  |  Branch (577:24): [True: 904, False: 138k]
  ------------------
  578|   190k|        c == 0xabd ||
  ------------------
  |  Branch (578:9): [True: 195, False: 190k]
  ------------------
  579|   190k|        c == 0xae0 ||
  ------------------
  |  Branch (579:9): [True: 202, False: 190k]
  ------------------
  580|   190k|        (c >= 0xb05 && c <= 0xb0c) ||
  ------------------
  |  Branch (580:10): [True: 134k, False: 56.2k]
  |  Branch (580:24): [True: 1.07k, False: 133k]
  ------------------
  581|   189k|        (c >= 0xb0f && c <= 0xb10) ||
  ------------------
  |  Branch (581:10): [True: 133k, False: 56.2k]
  |  Branch (581:24): [True: 309, False: 132k]
  ------------------
  582|   189k|        (c >= 0xb13 && c <= 0xb28) ||
  ------------------
  |  Branch (582:10): [True: 132k, False: 56.2k]
  |  Branch (582:24): [True: 350, False: 132k]
  ------------------
  583|   188k|        (c >= 0xb2a && c <= 0xb30) ||
  ------------------
  |  Branch (583:10): [True: 132k, False: 56.2k]
  |  Branch (583:24): [True: 844, False: 131k]
  ------------------
  584|   187k|        (c >= 0xb32 && c <= 0xb33) ||
  ------------------
  |  Branch (584:10): [True: 131k, False: 56.2k]
  |  Branch (584:24): [True: 1.29k, False: 130k]
  ------------------
  585|   186k|        (c >= 0xb36 && c <= 0xb39) ||
  ------------------
  |  Branch (585:10): [True: 130k, False: 56.3k]
  |  Branch (585:24): [True: 1.14k, False: 129k]
  ------------------
  586|   185k|        c == 0xb3d ||
  ------------------
  |  Branch (586:9): [True: 388, False: 185k]
  ------------------
  587|   185k|        (c >= 0xb5c && c <= 0xb5d) ||
  ------------------
  |  Branch (587:10): [True: 125k, False: 59.2k]
  |  Branch (587:24): [True: 336, False: 125k]
  ------------------
  588|   184k|        (c >= 0xb5f && c <= 0xb61) ||
  ------------------
  |  Branch (588:10): [True: 125k, False: 59.2k]
  |  Branch (588:24): [True: 915, False: 124k]
  ------------------
  589|   183k|        (c >= 0xb85 && c <= 0xb8a) ||
  ------------------
  |  Branch (589:10): [True: 124k, False: 59.8k]
  |  Branch (589:24): [True: 877, False: 123k]
  ------------------
  590|   183k|        (c >= 0xb8e && c <= 0xb90) ||
  ------------------
  |  Branch (590:10): [True: 123k, False: 59.8k]
  |  Branch (590:24): [True: 1.42k, False: 121k]
  ------------------
  591|   181k|        (c >= 0xb92 && c <= 0xb95) ||
  ------------------
  |  Branch (591:10): [True: 121k, False: 59.8k]
  |  Branch (591:24): [True: 699, False: 121k]
  ------------------
  592|   180k|        (c >= 0xb99 && c <= 0xb9a) ||
  ------------------
  |  Branch (592:10): [True: 121k, False: 59.8k]
  |  Branch (592:24): [True: 734, False: 120k]
  ------------------
  593|   180k|        c == 0xb9c ||
  ------------------
  |  Branch (593:9): [True: 1.29k, False: 178k]
  ------------------
  594|   178k|        (c >= 0xb9e && c <= 0xb9f) ||
  ------------------
  |  Branch (594:10): [True: 119k, False: 59.8k]
  |  Branch (594:24): [True: 571, False: 118k]
  ------------------
  595|   178k|        (c >= 0xba3 && c <= 0xba4) ||
  ------------------
  |  Branch (595:10): [True: 118k, False: 59.8k]
  |  Branch (595:24): [True: 274, False: 118k]
  ------------------
  596|   178k|        (c >= 0xba8 && c <= 0xbaa) ||
  ------------------
  |  Branch (596:10): [True: 118k, False: 59.8k]
  |  Branch (596:24): [True: 259, False: 117k]
  ------------------
  597|   177k|        (c >= 0xbae && c <= 0xbb5) ||
  ------------------
  |  Branch (597:10): [True: 117k, False: 59.8k]
  |  Branch (597:24): [True: 199, False: 117k]
  ------------------
  598|   177k|        (c >= 0xbb7 && c <= 0xbb9) ||
  ------------------
  |  Branch (598:10): [True: 117k, False: 59.8k]
  |  Branch (598:24): [True: 625, False: 117k]
  ------------------
  599|   176k|        (c >= 0xc05 && c <= 0xc0c) ||
  ------------------
  |  Branch (599:10): [True: 112k, False: 64.0k]
  |  Branch (599:24): [True: 210, False: 112k]
  ------------------
  600|   176k|        (c >= 0xc0e && c <= 0xc10) ||
  ------------------
  |  Branch (600:10): [True: 112k, False: 64.0k]
  |  Branch (600:24): [True: 671, False: 112k]
  ------------------
  601|   176k|        (c >= 0xc12 && c <= 0xc28) ||
  ------------------
  |  Branch (601:10): [True: 112k, False: 64.0k]
  |  Branch (601:24): [True: 1.05k, False: 110k]
  ------------------
  602|   175k|        (c >= 0xc2a && c <= 0xc33) ||
  ------------------
  |  Branch (602:10): [True: 110k, False: 64.0k]
  |  Branch (602:24): [True: 220, False: 110k]
  ------------------
  603|   174k|        (c >= 0xc35 && c <= 0xc39) ||
  ------------------
  |  Branch (603:10): [True: 110k, False: 64.0k]
  |  Branch (603:24): [True: 225, False: 110k]
  ------------------
  604|   174k|        (c >= 0xc60 && c <= 0xc61) ||
  ------------------
  |  Branch (604:10): [True: 108k, False: 66.4k]
  |  Branch (604:24): [True: 235, False: 107k]
  ------------------
  605|   174k|        (c >= 0xc85 && c <= 0xc8c) ||
  ------------------
  |  Branch (605:10): [True: 106k, False: 67.4k]
  |  Branch (605:24): [True: 773, False: 106k]
  ------------------
  606|   173k|        (c >= 0xc8e && c <= 0xc90) ||
  ------------------
  |  Branch (606:10): [True: 106k, False: 67.4k]
  |  Branch (606:24): [True: 881, False: 105k]
  ------------------
  607|   172k|        (c >= 0xc92 && c <= 0xca8) ||
  ------------------
  |  Branch (607:10): [True: 105k, False: 67.4k]
  |  Branch (607:24): [True: 699, False: 104k]
  ------------------
  608|   171k|        (c >= 0xcaa && c <= 0xcb3) ||
  ------------------
  |  Branch (608:10): [True: 104k, False: 67.4k]
  |  Branch (608:24): [True: 2.53k, False: 102k]
  ------------------
  609|   169k|        (c >= 0xcb5 && c <= 0xcb9) ||
  ------------------
  |  Branch (609:10): [True: 102k, False: 67.4k]
  |  Branch (609:24): [True: 1.02k, False: 101k]
  ------------------
  610|   168k|        c == 0xcde ||
  ------------------
  |  Branch (610:9): [True: 231, False: 168k]
  ------------------
  611|   168k|        (c >= 0xce0 && c <= 0xce1) ||
  ------------------
  |  Branch (611:10): [True: 97.0k, False: 71.1k]
  |  Branch (611:24): [True: 507, False: 96.5k]
  ------------------
  612|   167k|        (c >= 0xd05 && c <= 0xd0c) ||
  ------------------
  |  Branch (612:10): [True: 95.1k, False: 72.5k]
  |  Branch (612:24): [True: 245, False: 94.9k]
  ------------------
  613|   167k|        (c >= 0xd0e && c <= 0xd10) ||
  ------------------
  |  Branch (613:10): [True: 94.9k, False: 72.5k]
  |  Branch (613:24): [True: 361, False: 94.5k]
  ------------------
  614|   167k|        (c >= 0xd12 && c <= 0xd28) ||
  ------------------
  |  Branch (614:10): [True: 94.5k, False: 72.5k]
  |  Branch (614:24): [True: 282, False: 94.2k]
  ------------------
  615|   166k|        (c >= 0xd2a && c <= 0xd39) ||
  ------------------
  |  Branch (615:10): [True: 94.2k, False: 72.5k]
  |  Branch (615:24): [True: 641, False: 93.6k]
  ------------------
  616|   166k|        (c >= 0xd60 && c <= 0xd61) ||
  ------------------
  |  Branch (616:10): [True: 90.6k, False: 75.5k]
  |  Branch (616:24): [True: 263, False: 90.3k]
  ------------------
  617|   165k|        (c >= 0xe01 && c <= 0xe2e) ||
  ------------------
  |  Branch (617:10): [True: 89.7k, False: 76.0k]
  |  Branch (617:24): [True: 621, False: 89.1k]
  ------------------
  618|   165k|        c == 0xe30 ||
  ------------------
  |  Branch (618:9): [True: 412, False: 164k]
  ------------------
  619|   164k|        (c >= 0xe32 && c <= 0xe33) ||
  ------------------
  |  Branch (619:10): [True: 88.5k, False: 76.3k]
  |  Branch (619:24): [True: 440, False: 88.0k]
  ------------------
  620|   164k|        (c >= 0xe40 && c <= 0xe45) ||
  ------------------
  |  Branch (620:10): [True: 86.8k, False: 77.5k]
  |  Branch (620:24): [True: 806, False: 86.0k]
  ------------------
  621|   163k|        (c >= 0xe81 && c <= 0xe82) ||
  ------------------
  |  Branch (621:10): [True: 84.3k, False: 79.2k]
  |  Branch (621:24): [True: 611, False: 83.7k]
  ------------------
  622|   162k|        c == 0xe84 ||
  ------------------
  |  Branch (622:9): [True: 450, False: 162k]
  ------------------
  623|   162k|        (c >= 0xe87 && c <= 0xe88) ||
  ------------------
  |  Branch (623:10): [True: 83.1k, False: 79.3k]
  |  Branch (623:24): [True: 390, False: 82.8k]
  ------------------
  624|   162k|        c == 0xe8a ||
  ------------------
  |  Branch (624:9): [True: 600, False: 161k]
  ------------------
  625|   161k|        c == 0xe8d ||
  ------------------
  |  Branch (625:9): [True: 385, False: 161k]
  ------------------
  626|   161k|        (c >= 0xe94 && c <= 0xe97) ||
  ------------------
  |  Branch (626:10): [True: 81.8k, False: 79.3k]
  |  Branch (626:24): [True: 281, False: 81.5k]
  ------------------
  627|   160k|        (c >= 0xe99 && c <= 0xe9f) ||
  ------------------
  |  Branch (627:10): [True: 81.5k, False: 79.3k]
  |  Branch (627:24): [True: 2.01k, False: 79.5k]
  ------------------
  628|   158k|        (c >= 0xea1 && c <= 0xea3) ||
  ------------------
  |  Branch (628:10): [True: 79.5k, False: 79.3k]
  |  Branch (628:24): [True: 815, False: 78.7k]
  ------------------
  629|   158k|        c == 0xea5 ||
  ------------------
  |  Branch (629:9): [True: 237, False: 157k]
  ------------------
  630|   157k|        c == 0xea7 ||
  ------------------
  |  Branch (630:9): [True: 291, False: 157k]
  ------------------
  631|   157k|        (c >= 0xeaa && c <= 0xeab) ||
  ------------------
  |  Branch (631:10): [True: 78.1k, False: 79.3k]
  |  Branch (631:24): [True: 541, False: 77.6k]
  ------------------
  632|   156k|        (c >= 0xead && c <= 0xeae) ||
  ------------------
  |  Branch (632:10): [True: 77.6k, False: 79.3k]
  |  Branch (632:24): [True: 533, False: 77.1k]
  ------------------
  633|   156k|        c == 0xeb0 ||
  ------------------
  |  Branch (633:9): [True: 431, False: 156k]
  ------------------
  634|   156k|        (c >= 0xeb2 && c <= 0xeb3) ||
  ------------------
  |  Branch (634:10): [True: 76.2k, False: 79.7k]
  |  Branch (634:24): [True: 541, False: 75.7k]
  ------------------
  635|   155k|        c == 0xebd ||
  ------------------
  |  Branch (635:9): [True: 985, False: 154k]
  ------------------
  636|   154k|        (c >= 0xec0 && c <= 0xec4) ||
  ------------------
  |  Branch (636:10): [True: 73.6k, False: 80.8k]
  |  Branch (636:24): [True: 299, False: 73.3k]
  ------------------
  637|   154k|        (c >= 0xf40 && c <= 0xf47) ||
  ------------------
  |  Branch (637:10): [True: 69.8k, False: 84.4k]
  |  Branch (637:24): [True: 234, False: 69.5k]
  ------------------
  638|   153k|        (c >= 0xf49 && c <= 0xf69) ||
  ------------------
  |  Branch (638:10): [True: 69.5k, False: 84.4k]
  |  Branch (638:24): [True: 200, False: 69.3k]
  ------------------
  639|   153k|        (c >= 0x10a0 && c <= 0x10c5) ||
  ------------------
  |  Branch (639:10): [True: 64.3k, False: 89.4k]
  |  Branch (639:25): [True: 377, False: 63.9k]
  ------------------
  640|   153k|        (c >= 0x10d0 && c <= 0x10f6) ||
  ------------------
  |  Branch (640:10): [True: 63.9k, False: 89.4k]
  |  Branch (640:25): [True: 617, False: 63.3k]
  ------------------
  641|   152k|        c == 0x1100 ||
  ------------------
  |  Branch (641:9): [True: 1.00k, False: 151k]
  ------------------
  642|   151k|        (c >= 0x1102 && c <= 0x1103) ||
  ------------------
  |  Branch (642:10): [True: 62.3k, False: 89.4k]
  |  Branch (642:25): [True: 1.03k, False: 61.2k]
  ------------------
  643|   150k|        (c >= 0x1105 && c <= 0x1107) ||
  ------------------
  |  Branch (643:10): [True: 61.2k, False: 89.4k]
  |  Branch (643:25): [True: 2.48k, False: 58.8k]
  ------------------
  644|   148k|        c == 0x1109 ||
  ------------------
  |  Branch (644:9): [True: 495, False: 147k]
  ------------------
  645|   147k|        (c >= 0x110b && c <= 0x110c) ||
  ------------------
  |  Branch (645:10): [True: 58.3k, False: 89.4k]
  |  Branch (645:25): [True: 558, False: 57.7k]
  ------------------
  646|   147k|        (c >= 0x110e && c <= 0x1112) ||
  ------------------
  |  Branch (646:10): [True: 57.7k, False: 89.4k]
  |  Branch (646:25): [True: 1.61k, False: 56.1k]
  ------------------
  647|   145k|        c == 0x113c ||
  ------------------
  |  Branch (647:9): [True: 205, False: 145k]
  ------------------
  648|   145k|        c == 0x113e ||
  ------------------
  |  Branch (648:9): [True: 472, False: 144k]
  ------------------
  649|   144k|        c == 0x1140 ||
  ------------------
  |  Branch (649:9): [True: 205, False: 144k]
  ------------------
  650|   144k|        c == 0x114c ||
  ------------------
  |  Branch (650:9): [True: 339, False: 144k]
  ------------------
  651|   144k|        c == 0x114e ||
  ------------------
  |  Branch (651:9): [True: 1.66k, False: 142k]
  ------------------
  652|   142k|        c == 0x1150 ||
  ------------------
  |  Branch (652:9): [True: 318, False: 142k]
  ------------------
  653|   142k|        (c >= 0x1154 && c <= 0x1155) ||
  ------------------
  |  Branch (653:10): [True: 52.9k, False: 89.4k]
  |  Branch (653:25): [True: 2.14k, False: 50.7k]
  ------------------
  654|   140k|        c == 0x1159 ||
  ------------------
  |  Branch (654:9): [True: 195, False: 140k]
  ------------------
  655|   140k|        (c >= 0x115f && c <= 0x1161) ||
  ------------------
  |  Branch (655:10): [True: 50.5k, False: 89.4k]
  |  Branch (655:25): [True: 258, False: 50.3k]
  ------------------
  656|   139k|        c == 0x1163 ||
  ------------------
  |  Branch (656:9): [True: 252, False: 139k]
  ------------------
  657|   139k|        c == 0x1165 ||
  ------------------
  |  Branch (657:9): [True: 280, False: 139k]
  ------------------
  658|   139k|        c == 0x1167 ||
  ------------------
  |  Branch (658:9): [True: 884, False: 138k]
  ------------------
  659|   138k|        c == 0x1169 ||
  ------------------
  |  Branch (659:9): [True: 320, False: 138k]
  ------------------
  660|   138k|        (c >= 0x116d && c <= 0x116e) ||
  ------------------
  |  Branch (660:10): [True: 48.5k, False: 89.4k]
  |  Branch (660:25): [True: 420, False: 48.1k]
  ------------------
  661|   137k|        (c >= 0x1172 && c <= 0x1173) ||
  ------------------
  |  Branch (661:10): [True: 48.1k, False: 89.4k]
  |  Branch (661:25): [True: 715, False: 47.4k]
  ------------------
  662|   136k|        c == 0x1175 ||
  ------------------
  |  Branch (662:9): [True: 478, False: 136k]
  ------------------
  663|   136k|        c == 0x119e ||
  ------------------
  |  Branch (663:9): [True: 220, False: 136k]
  ------------------
  664|   136k|        c == 0x11a8 ||
  ------------------
  |  Branch (664:9): [True: 515, False: 135k]
  ------------------
  665|   135k|        c == 0x11ab ||
  ------------------
  |  Branch (665:9): [True: 196, False: 135k]
  ------------------
  666|   135k|        (c >= 0x11ae && c <= 0x11af) ||
  ------------------
  |  Branch (666:10): [True: 46.0k, False: 89.4k]
  |  Branch (666:25): [True: 194, False: 45.8k]
  ------------------
  667|   135k|        (c >= 0x11b7 && c <= 0x11b8) ||
  ------------------
  |  Branch (667:10): [True: 45.8k, False: 89.4k]
  |  Branch (667:25): [True: 352, False: 45.4k]
  ------------------
  668|   134k|        c == 0x11ba ||
  ------------------
  |  Branch (668:9): [True: 203, False: 134k]
  ------------------
  669|   134k|        (c >= 0x11bc && c <= 0x11c2) ||
  ------------------
  |  Branch (669:10): [True: 45.2k, False: 89.4k]
  |  Branch (669:25): [True: 280, False: 44.9k]
  ------------------
  670|   134k|        c == 0x11eb ||
  ------------------
  |  Branch (670:9): [True: 194, False: 134k]
  ------------------
  671|   134k|        c == 0x11f0 ||
  ------------------
  |  Branch (671:9): [True: 564, False: 133k]
  ------------------
  672|   133k|        c == 0x11f9 ||
  ------------------
  |  Branch (672:9): [True: 198, False: 133k]
  ------------------
  673|   133k|        (c >= 0x1e00 && c <= 0x1e9b) ||
  ------------------
  |  Branch (673:10): [True: 43.9k, False: 89.6k]
  |  Branch (673:25): [True: 714, False: 43.2k]
  ------------------
  674|   132k|        (c >= 0x1ea0 && c <= 0x1ef9) ||
  ------------------
  |  Branch (674:10): [True: 43.2k, False: 89.6k]
  |  Branch (674:25): [True: 618, False: 42.5k]
  ------------------
  675|   132k|        (c >= 0x1f00 && c <= 0x1f15) ||
  ------------------
  |  Branch (675:10): [True: 42.5k, False: 89.6k]
  |  Branch (675:25): [True: 300, False: 42.2k]
  ------------------
  676|   131k|        (c >= 0x1f18 && c <= 0x1f1d) ||
  ------------------
  |  Branch (676:10): [True: 42.1k, False: 89.7k]
  |  Branch (676:25): [True: 338, False: 41.8k]
  ------------------
  677|   131k|        (c >= 0x1f20 && c <= 0x1f45) ||
  ------------------
  |  Branch (677:10): [True: 41.8k, False: 89.7k]
  |  Branch (677:25): [True: 1.05k, False: 40.7k]
  ------------------
  678|   130k|        (c >= 0x1f48 && c <= 0x1f4d) ||
  ------------------
  |  Branch (678:10): [True: 40.7k, False: 89.7k]
  |  Branch (678:25): [True: 428, False: 40.3k]
  ------------------
  679|   130k|        (c >= 0x1f50 && c <= 0x1f57) ||
  ------------------
  |  Branch (679:10): [True: 40.3k, False: 89.7k]
  |  Branch (679:25): [True: 641, False: 39.7k]
  ------------------
  680|   129k|        c == 0x1f59 ||
  ------------------
  |  Branch (680:9): [True: 287, False: 129k]
  ------------------
  681|   129k|        c == 0x1f5b ||
  ------------------
  |  Branch (681:9): [True: 215, False: 128k]
  ------------------
  682|   128k|        c == 0x1f5d ||
  ------------------
  |  Branch (682:9): [True: 202, False: 128k]
  ------------------
  683|   128k|        (c >= 0x1f5f && c <= 0x1f7d) ||
  ------------------
  |  Branch (683:10): [True: 38.9k, False: 89.7k]
  |  Branch (683:25): [True: 306, False: 38.6k]
  ------------------
  684|   128k|        (c >= 0x1f80 && c <= 0x1fb4) ||
  ------------------
  |  Branch (684:10): [True: 38.6k, False: 89.7k]
  |  Branch (684:25): [True: 986, False: 37.7k]
  ------------------
  685|   127k|        (c >= 0x1fb6 && c <= 0x1fbc) ||
  ------------------
  |  Branch (685:10): [True: 37.7k, False: 89.7k]
  |  Branch (685:25): [True: 731, False: 36.9k]
  ------------------
  686|   126k|        c == 0x1fbe ||
  ------------------
  |  Branch (686:9): [True: 846, False: 125k]
  ------------------
  687|   125k|        (c >= 0x1fc2 && c <= 0x1fc4) ||
  ------------------
  |  Branch (687:10): [True: 36.1k, False: 89.7k]
  |  Branch (687:25): [True: 256, False: 35.8k]
  ------------------
  688|   125k|        (c >= 0x1fc6 && c <= 0x1fcc) ||
  ------------------
  |  Branch (688:10): [True: 35.8k, False: 89.7k]
  |  Branch (688:25): [True: 200, False: 35.6k]
  ------------------
  689|   125k|        (c >= 0x1fd0 && c <= 0x1fd3) ||
  ------------------
  |  Branch (689:10): [True: 35.6k, False: 89.7k]
  |  Branch (689:25): [True: 250, False: 35.4k]
  ------------------
  690|   125k|        (c >= 0x1fd6 && c <= 0x1fdb) ||
  ------------------
  |  Branch (690:10): [True: 35.4k, False: 89.7k]
  |  Branch (690:25): [True: 861, False: 34.5k]
  ------------------
  691|   124k|        (c >= 0x1fe0 && c <= 0x1fec) ||
  ------------------
  |  Branch (691:10): [True: 34.5k, False: 89.7k]
  |  Branch (691:25): [True: 204, False: 34.3k]
  ------------------
  692|   124k|        (c >= 0x1ff2 && c <= 0x1ff4) ||
  ------------------
  |  Branch (692:10): [True: 34.3k, False: 89.7k]
  |  Branch (692:25): [True: 241, False: 34.0k]
  ------------------
  693|   123k|        (c >= 0x1ff6 && c <= 0x1ffc) ||
  ------------------
  |  Branch (693:10): [True: 34.0k, False: 89.7k]
  |  Branch (693:25): [True: 1.29k, False: 32.7k]
  ------------------
  694|   122k|        c == 0x2126 ||
  ------------------
  |  Branch (694:9): [True: 198, False: 122k]
  ------------------
  695|   122k|        (c >= 0x212a && c <= 0x212b) ||
  ------------------
  |  Branch (695:10): [True: 32.0k, False: 90.3k]
  |  Branch (695:25): [True: 565, False: 31.4k]
  ------------------
  696|   121k|        c == 0x212e ||
  ------------------
  |  Branch (696:9): [True: 196, False: 121k]
  ------------------
  697|   121k|        (c >= 0x2180 && c <= 0x2182) ||
  ------------------
  |  Branch (697:10): [True: 31.2k, False: 90.3k]
  |  Branch (697:25): [True: 380, False: 30.8k]
  ------------------
  698|   121k|        (c >= 0x3041 && c <= 0x3094) ||
  ------------------
  |  Branch (698:10): [True: 29.0k, False: 92.1k]
  |  Branch (698:25): [True: 512, False: 28.5k]
  ------------------
  699|   120k|        (c >= 0x30a1 && c <= 0x30fa) ||
  ------------------
  |  Branch (699:10): [True: 26.2k, False: 94.5k]
  |  Branch (699:25): [True: 575, False: 25.6k]
  ------------------
  700|   120k|        (c >= 0x3105 && c <= 0x312c) ||
  ------------------
  |  Branch (700:10): [True: 25.4k, False: 94.6k]
  |  Branch (700:25): [True: 868, False: 24.5k]
  ------------------
  701|   119k|        (c >= 0xac00 && c <= 0xd7a3) ||
  ------------------
  |  Branch (701:10): [True: 22.5k, False: 96.6k]
  |  Branch (701:25): [True: 760, False: 21.8k]
  ------------------
  702|   118k|        (c >= 0x4e00 && c <= 0x9fa5) ||
  ------------------
  |  Branch (702:10): [True: 23.8k, False: 94.6k]
  |  Branch (702:25): [True: 1.98k, False: 21.8k]
  ------------------
  703|   116k|        c == 0x3007 ||
  ------------------
  |  Branch (703:9): [True: 195, False: 116k]
  ------------------
  704|   116k|        (c >= 0x3021 && c <= 0x3029) ||
  ------------------
  |  Branch (704:10): [True: 25.7k, False: 90.5k]
  |  Branch (704:25): [True: 314, False: 25.4k]
  ------------------
  705|   116k|        (c >= 0x4e00 && c <= 0x9fa5) ||
  ------------------
  |  Branch (705:10): [True: 21.8k, False: 94.1k]
  |  Branch (705:25): [True: 0, False: 21.8k]
  ------------------
  706|   116k|        c == 0x3007 ||
  ------------------
  |  Branch (706:9): [True: 0, False: 116k]
  ------------------
  707|   116k|        (c >= 0x3021 && c <= 0x3029));
  ------------------
  |  Branch (707:10): [True: 25.4k, False: 90.5k]
  |  Branch (707:25): [True: 0, False: 25.4k]
  ------------------
  708|   934k|}
prvTidyIsXMLNamechar:
  711|   880k|{
  712|   880k|    return (TY_(IsXMLLetter)(c) ||
  ------------------
  |  |   23|   880k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   880k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (712:13): [True: 771k, False: 108k]
  ------------------
  713|   108k|        c == '.' || c == '_' ||
  ------------------
  |  Branch (713:9): [True: 422, False: 108k]
  |  Branch (713:21): [True: 1.12k, False: 107k]
  ------------------
  714|   107k|        c == ':' || c == '-' ||
  ------------------
  |  Branch (714:9): [True: 813, False: 106k]
  |  Branch (714:21): [True: 932, False: 105k]
  ------------------
  715|   105k|        (c >= 0x300 && c <= 0x345) ||
  ------------------
  |  Branch (715:10): [True: 88.4k, False: 17.2k]
  |  Branch (715:24): [True: 683, False: 87.7k]
  ------------------
  716|   105k|        (c >= 0x360 && c <= 0x361) ||
  ------------------
  |  Branch (716:10): [True: 87.7k, False: 17.2k]
  |  Branch (716:24): [True: 607, False: 87.1k]
  ------------------
  717|   104k|        (c >= 0x483 && c <= 0x486) ||
  ------------------
  |  Branch (717:10): [True: 86.8k, False: 17.5k]
  |  Branch (717:24): [True: 203, False: 86.6k]
  ------------------
  718|   104k|        (c >= 0x591 && c <= 0x5a1) ||
  ------------------
  |  Branch (718:10): [True: 86.6k, False: 17.5k]
  |  Branch (718:24): [True: 743, False: 85.9k]
  ------------------
  719|   103k|        (c >= 0x5a3 && c <= 0x5b9) ||
  ------------------
  |  Branch (719:10): [True: 85.9k, False: 17.5k]
  |  Branch (719:24): [True: 917, False: 84.9k]
  ------------------
  720|   102k|        (c >= 0x5bb && c <= 0x5bd) ||
  ------------------
  |  Branch (720:10): [True: 84.9k, False: 17.5k]
  |  Branch (720:24): [True: 274, False: 84.7k]
  ------------------
  721|   102k|        c == 0x5bf ||
  ------------------
  |  Branch (721:9): [True: 781, False: 101k]
  ------------------
  722|   101k|        (c >= 0x5c1 && c <= 0x5c2) ||
  ------------------
  |  Branch (722:10): [True: 83.9k, False: 17.5k]
  |  Branch (722:24): [True: 665, False: 83.2k]
  ------------------
  723|   100k|        c == 0x5c4 ||
  ------------------
  |  Branch (723:9): [True: 470, False: 100k]
  ------------------
  724|   100k|        (c >= 0x64b && c <= 0x652) ||
  ------------------
  |  Branch (724:10): [True: 82.5k, False: 17.8k]
  |  Branch (724:24): [True: 707, False: 81.8k]
  ------------------
  725|  99.6k|        c == 0x670 ||
  ------------------
  |  Branch (725:9): [True: 253, False: 99.3k]
  ------------------
  726|  99.3k|        (c >= 0x6d6 && c <= 0x6dc) ||
  ------------------
  |  Branch (726:10): [True: 80.9k, False: 18.4k]
  |  Branch (726:24): [True: 803, False: 80.1k]
  ------------------
  727|  98.5k|        (c >= 0x6dd && c <= 0x6df) ||
  ------------------
  |  Branch (727:10): [True: 80.1k, False: 18.4k]
  |  Branch (727:24): [True: 689, False: 79.4k]
  ------------------
  728|  97.9k|        (c >= 0x6e0 && c <= 0x6e4) ||
  ------------------
  |  Branch (728:10): [True: 79.4k, False: 18.4k]
  |  Branch (728:24): [True: 838, False: 78.6k]
  ------------------
  729|  97.0k|        (c >= 0x6e7 && c <= 0x6e8) ||
  ------------------
  |  Branch (729:10): [True: 78.6k, False: 18.4k]
  |  Branch (729:24): [True: 470, False: 78.1k]
  ------------------
  730|  96.5k|        (c >= 0x6ea && c <= 0x6ed) ||
  ------------------
  |  Branch (730:10): [True: 78.1k, False: 18.4k]
  |  Branch (730:24): [True: 1.52k, False: 76.6k]
  ------------------
  731|  95.0k|        (c >= 0x901 && c <= 0x903) ||
  ------------------
  |  Branch (731:10): [True: 75.4k, False: 19.6k]
  |  Branch (731:24): [True: 829, False: 74.6k]
  ------------------
  732|  94.2k|        c == 0x93c ||
  ------------------
  |  Branch (732:9): [True: 502, False: 93.7k]
  ------------------
  733|  93.7k|        (c >= 0x93e && c <= 0x94c) ||
  ------------------
  |  Branch (733:10): [True: 74.0k, False: 19.6k]
  |  Branch (733:24): [True: 300, False: 73.7k]
  ------------------
  734|  93.4k|        c == 0x94d ||
  ------------------
  |  Branch (734:9): [True: 934, False: 92.5k]
  ------------------
  735|  92.5k|        (c >= 0x951 && c <= 0x954) ||
  ------------------
  |  Branch (735:10): [True: 72.8k, False: 19.6k]
  |  Branch (735:24): [True: 1.00k, False: 71.8k]
  ------------------
  736|  91.5k|        (c >= 0x962 && c <= 0x963) ||
  ------------------
  |  Branch (736:10): [True: 71.8k, False: 19.6k]
  |  Branch (736:24): [True: 304, False: 71.5k]
  ------------------
  737|  91.2k|        (c >= 0x981 && c <= 0x983) ||
  ------------------
  |  Branch (737:10): [True: 71.3k, False: 19.8k]
  |  Branch (737:24): [True: 554, False: 70.7k]
  ------------------
  738|  90.6k|        c == 0x9bc ||
  ------------------
  |  Branch (738:9): [True: 238, False: 90.4k]
  ------------------
  739|  90.4k|        c == 0x9be ||
  ------------------
  |  Branch (739:9): [True: 525, False: 89.8k]
  ------------------
  740|  89.8k|        c == 0x9bf ||
  ------------------
  |  Branch (740:9): [True: 248, False: 89.6k]
  ------------------
  741|  89.6k|        (c >= 0x9c0 && c <= 0x9c4) ||
  ------------------
  |  Branch (741:10): [True: 69.7k, False: 19.8k]
  |  Branch (741:24): [True: 514, False: 69.2k]
  ------------------
  742|  89.1k|        (c >= 0x9c7 && c <= 0x9c8) ||
  ------------------
  |  Branch (742:10): [True: 69.2k, False: 19.8k]
  |  Branch (742:24): [True: 589, False: 68.6k]
  ------------------
  743|  88.5k|        (c >= 0x9cb && c <= 0x9cd) ||
  ------------------
  |  Branch (743:10): [True: 68.6k, False: 19.8k]
  |  Branch (743:24): [True: 249, False: 68.4k]
  ------------------
  744|  88.2k|        c == 0x9d7 ||
  ------------------
  |  Branch (744:9): [True: 371, False: 87.9k]
  ------------------
  745|  87.9k|        (c >= 0x9e2 && c <= 0x9e3) ||
  ------------------
  |  Branch (745:10): [True: 68.0k, False: 19.8k]
  |  Branch (745:24): [True: 299, False: 67.7k]
  ------------------
  746|  87.6k|        c == 0xa02 ||
  ------------------
  |  Branch (746:9): [True: 750, False: 86.8k]
  ------------------
  747|  86.8k|        c == 0xa3c ||
  ------------------
  |  Branch (747:9): [True: 200, False: 86.6k]
  ------------------
  748|  86.6k|        c == 0xa3e ||
  ------------------
  |  Branch (748:9): [True: 475, False: 86.1k]
  ------------------
  749|  86.1k|        c == 0xa3f ||
  ------------------
  |  Branch (749:9): [True: 290, False: 85.8k]
  ------------------
  750|  85.8k|        (c >= 0xa40 && c <= 0xa42) ||
  ------------------
  |  Branch (750:10): [True: 65.4k, False: 20.4k]
  |  Branch (750:24): [True: 441, False: 65.0k]
  ------------------
  751|  85.4k|        (c >= 0xa47 && c <= 0xa48) ||
  ------------------
  |  Branch (751:10): [True: 65.0k, False: 20.4k]
  |  Branch (751:24): [True: 559, False: 64.4k]
  ------------------
  752|  84.8k|        (c >= 0xa4b && c <= 0xa4d) ||
  ------------------
  |  Branch (752:10): [True: 64.4k, False: 20.4k]
  |  Branch (752:24): [True: 406, False: 64.0k]
  ------------------
  753|  84.4k|        (c >= 0xa70 && c <= 0xa71) ||
  ------------------
  |  Branch (753:10): [True: 63.5k, False: 20.9k]
  |  Branch (753:24): [True: 925, False: 62.6k]
  ------------------
  754|  83.5k|        (c >= 0xa81 && c <= 0xa83) ||
  ------------------
  |  Branch (754:10): [True: 62.6k, False: 20.9k]
  |  Branch (754:24): [True: 290, False: 62.3k]
  ------------------
  755|  83.2k|        c == 0xabc ||
  ------------------
  |  Branch (755:9): [True: 260, False: 83.0k]
  ------------------
  756|  83.0k|        (c >= 0xabe && c <= 0xac5) ||
  ------------------
  |  Branch (756:10): [True: 62.0k, False: 20.9k]
  |  Branch (756:24): [True: 1.01k, False: 61.0k]
  ------------------
  757|  82.0k|        (c >= 0xac7 && c <= 0xac9) ||
  ------------------
  |  Branch (757:10): [True: 61.0k, False: 20.9k]
  |  Branch (757:24): [True: 723, False: 60.3k]
  ------------------
  758|  81.2k|        (c >= 0xacb && c <= 0xacd) ||
  ------------------
  |  Branch (758:10): [True: 60.3k, False: 20.9k]
  |  Branch (758:24): [True: 553, False: 59.7k]
  ------------------
  759|  80.7k|        (c >= 0xb01 && c <= 0xb03) ||
  ------------------
  |  Branch (759:10): [True: 59.5k, False: 21.1k]
  |  Branch (759:24): [True: 624, False: 58.9k]
  ------------------
  760|  80.1k|        c == 0xb3c ||
  ------------------
  |  Branch (760:9): [True: 866, False: 79.2k]
  ------------------
  761|  79.2k|        (c >= 0xb3e && c <= 0xb43) ||
  ------------------
  |  Branch (761:10): [True: 58.0k, False: 21.1k]
  |  Branch (761:24): [True: 1.20k, False: 56.8k]
  ------------------
  762|  78.0k|        (c >= 0xb47 && c <= 0xb48) ||
  ------------------
  |  Branch (762:10): [True: 56.8k, False: 21.1k]
  |  Branch (762:24): [True: 370, False: 56.4k]
  ------------------
  763|  77.6k|        (c >= 0xb4b && c <= 0xb4d) ||
  ------------------
  |  Branch (763:10): [True: 56.4k, False: 21.1k]
  |  Branch (763:24): [True: 256, False: 56.2k]
  ------------------
  764|  77.4k|        (c >= 0xb56 && c <= 0xb57) ||
  ------------------
  |  Branch (764:10): [True: 56.2k, False: 21.1k]
  |  Branch (764:24): [True: 245, False: 55.9k]
  ------------------
  765|  77.1k|        (c >= 0xb82 && c <= 0xb83) ||
  ------------------
  |  Branch (765:10): [True: 55.7k, False: 21.4k]
  |  Branch (765:24): [True: 278, False: 55.4k]
  ------------------
  766|  76.8k|        (c >= 0xbbe && c <= 0xbc2) ||
  ------------------
  |  Branch (766:10): [True: 55.4k, False: 21.4k]
  |  Branch (766:24): [True: 1.44k, False: 53.9k]
  ------------------
  767|  75.4k|        (c >= 0xbc6 && c <= 0xbc8) ||
  ------------------
  |  Branch (767:10): [True: 53.9k, False: 21.4k]
  |  Branch (767:24): [True: 394, False: 53.5k]
  ------------------
  768|  75.0k|        (c >= 0xbca && c <= 0xbcd) ||
  ------------------
  |  Branch (768:10): [True: 53.5k, False: 21.4k]
  |  Branch (768:24): [True: 1.02k, False: 52.5k]
  ------------------
  769|  74.0k|        c == 0xbd7 ||
  ------------------
  |  Branch (769:9): [True: 521, False: 73.5k]
  ------------------
  770|  73.5k|        (c >= 0xc01 && c <= 0xc03) ||
  ------------------
  |  Branch (770:10): [True: 51.5k, False: 21.9k]
  |  Branch (770:24): [True: 334, False: 51.1k]
  ------------------
  771|  73.1k|        (c >= 0xc3e && c <= 0xc44) ||
  ------------------
  |  Branch (771:10): [True: 51.1k, False: 21.9k]
  |  Branch (771:24): [True: 726, False: 50.4k]
  ------------------
  772|  72.4k|        (c >= 0xc46 && c <= 0xc48) ||
  ------------------
  |  Branch (772:10): [True: 50.4k, False: 21.9k]
  |  Branch (772:24): [True: 505, False: 49.9k]
  ------------------
  773|  71.9k|        (c >= 0xc4a && c <= 0xc4d) ||
  ------------------
  |  Branch (773:10): [True: 49.9k, False: 21.9k]
  |  Branch (773:24): [True: 845, False: 49.1k]
  ------------------
  774|  71.0k|        (c >= 0xc55 && c <= 0xc56) ||
  ------------------
  |  Branch (774:10): [True: 49.0k, False: 21.9k]
  |  Branch (774:24): [True: 269, False: 48.8k]
  ------------------
  775|  70.8k|        (c >= 0xc82 && c <= 0xc83) ||
  ------------------
  |  Branch (775:10): [True: 48.3k, False: 22.4k]
  |  Branch (775:24): [True: 516, False: 47.8k]
  ------------------
  776|  70.3k|        (c >= 0xcbe && c <= 0xcc4) ||
  ------------------
  |  Branch (776:10): [True: 47.8k, False: 22.4k]
  |  Branch (776:24): [True: 957, False: 46.8k]
  ------------------
  777|  69.3k|        (c >= 0xcc6 && c <= 0xcc8) ||
  ------------------
  |  Branch (777:10): [True: 46.8k, False: 22.4k]
  |  Branch (777:24): [True: 1.53k, False: 45.3k]
  ------------------
  778|  67.8k|        (c >= 0xcca && c <= 0xccd) ||
  ------------------
  |  Branch (778:10): [True: 45.3k, False: 22.4k]
  |  Branch (778:24): [True: 759, False: 44.5k]
  ------------------
  779|  67.0k|        (c >= 0xcd5 && c <= 0xcd6) ||
  ------------------
  |  Branch (779:10): [True: 44.5k, False: 22.4k]
  |  Branch (779:24): [True: 497, False: 44.0k]
  ------------------
  780|  66.5k|        (c >= 0xd02 && c <= 0xd03) ||
  ------------------
  |  Branch (780:10): [True: 43.6k, False: 22.8k]
  |  Branch (780:24): [True: 948, False: 42.7k]
  ------------------
  781|  65.6k|        (c >= 0xd3e && c <= 0xd43) ||
  ------------------
  |  Branch (781:10): [True: 42.7k, False: 22.8k]
  |  Branch (781:24): [True: 768, False: 41.9k]
  ------------------
  782|  64.8k|        (c >= 0xd46 && c <= 0xd48) ||
  ------------------
  |  Branch (782:10): [True: 41.9k, False: 22.8k]
  |  Branch (782:24): [True: 1.27k, False: 40.6k]
  ------------------
  783|  63.5k|        (c >= 0xd4a && c <= 0xd4d) ||
  ------------------
  |  Branch (783:10): [True: 40.6k, False: 22.8k]
  |  Branch (783:24): [True: 768, False: 39.9k]
  ------------------
  784|  62.8k|        c == 0xd57 ||
  ------------------
  |  Branch (784:9): [True: 195, False: 62.6k]
  ------------------
  785|  62.6k|        c == 0xe31 ||
  ------------------
  |  Branch (785:9): [True: 250, False: 62.3k]
  ------------------
  786|  62.3k|        (c >= 0xe34 && c <= 0xe3a) ||
  ------------------
  |  Branch (786:10): [True: 38.8k, False: 23.4k]
  |  Branch (786:24): [True: 1.24k, False: 37.6k]
  ------------------
  787|  61.1k|        (c >= 0xe47 && c <= 0xe4e) ||
  ------------------
  |  Branch (787:10): [True: 37.4k, False: 23.7k]
  |  Branch (787:24): [True: 827, False: 36.5k]
  ------------------
  788|  60.2k|        c == 0xeb1 ||
  ------------------
  |  Branch (788:9): [True: 414, False: 59.8k]
  ------------------
  789|  59.8k|        (c >= 0xeb4 && c <= 0xeb9) ||
  ------------------
  |  Branch (789:10): [True: 35.4k, False: 24.4k]
  |  Branch (789:24): [True: 823, False: 34.6k]
  ------------------
  790|  59.0k|        (c >= 0xebb && c <= 0xebc) ||
  ------------------
  |  Branch (790:10): [True: 34.6k, False: 24.4k]
  |  Branch (790:24): [True: 253, False: 34.3k]
  ------------------
  791|  58.7k|        (c >= 0xec8 && c <= 0xecd) ||
  ------------------
  |  Branch (791:10): [True: 34.1k, False: 24.6k]
  |  Branch (791:24): [True: 552, False: 33.6k]
  ------------------
  792|  58.2k|        (c >= 0xf18 && c <= 0xf19) ||
  ------------------
  |  Branch (792:10): [True: 33.1k, False: 25.0k]
  |  Branch (792:24): [True: 497, False: 32.6k]
  ------------------
  793|  57.7k|        c == 0xf35 ||
  ------------------
  |  Branch (793:9): [True: 260, False: 57.4k]
  ------------------
  794|  57.4k|        c == 0xf37 ||
  ------------------
  |  Branch (794:9): [True: 355, False: 57.1k]
  ------------------
  795|  57.1k|        c == 0xf39 ||
  ------------------
  |  Branch (795:9): [True: 311, False: 56.8k]
  ------------------
  796|  56.8k|        c == 0xf3e ||
  ------------------
  |  Branch (796:9): [True: 319, False: 56.5k]
  ------------------
  797|  56.5k|        c == 0xf3f ||
  ------------------
  |  Branch (797:9): [True: 336, False: 56.1k]
  ------------------
  798|  56.1k|        (c >= 0xf71 && c <= 0xf84) ||
  ------------------
  |  Branch (798:10): [True: 30.8k, False: 25.3k]
  |  Branch (798:24): [True: 528, False: 30.3k]
  ------------------
  799|  55.6k|        (c >= 0xf86 && c <= 0xf8b) ||
  ------------------
  |  Branch (799:10): [True: 30.2k, False: 25.3k]
  |  Branch (799:24): [True: 323, False: 29.9k]
  ------------------
  800|  55.3k|        (c >= 0xf90 && c <= 0xf95) ||
  ------------------
  |  Branch (800:10): [True: 29.9k, False: 25.3k]
  |  Branch (800:24): [True: 666, False: 29.3k]
  ------------------
  801|  54.6k|        c == 0xf97 ||
  ------------------
  |  Branch (801:9): [True: 474, False: 54.1k]
  ------------------
  802|  54.1k|        (c >= 0xf99 && c <= 0xfad) ||
  ------------------
  |  Branch (802:10): [True: 28.8k, False: 25.3k]
  |  Branch (802:24): [True: 481, False: 28.3k]
  ------------------
  803|  53.6k|        (c >= 0xfb1 && c <= 0xfb7) ||
  ------------------
  |  Branch (803:10): [True: 28.2k, False: 25.4k]
  |  Branch (803:24): [True: 2.15k, False: 26.0k]
  ------------------
  804|  51.5k|        c == 0xfb9 ||
  ------------------
  |  Branch (804:9): [True: 280, False: 51.2k]
  ------------------
  805|  51.2k|        (c >= 0x20d0 && c <= 0x20dc) ||
  ------------------
  |  Branch (805:10): [True: 25.4k, False: 25.8k]
  |  Branch (805:25): [True: 228, False: 25.1k]
  ------------------
  806|  51.0k|        c == 0x20e1 ||
  ------------------
  |  Branch (806:9): [True: 196, False: 50.8k]
  ------------------
  807|  50.8k|        (c >= 0x302a && c <= 0x302f) ||
  ------------------
  |  Branch (807:10): [True: 24.7k, False: 26.1k]
  |  Branch (807:25): [True: 226, False: 24.4k]
  ------------------
  808|  50.6k|        c == 0x3099 ||
  ------------------
  |  Branch (808:9): [True: 202, False: 50.4k]
  ------------------
  809|  50.4k|        c == 0x309a ||
  ------------------
  |  Branch (809:9): [True: 804, False: 49.5k]
  ------------------
  810|  49.5k|        (c >= 0x30 && c <= 0x39) ||
  ------------------
  |  Branch (810:10): [True: 39.3k, False: 10.2k]
  |  Branch (810:23): [True: 2.71k, False: 36.5k]
  ------------------
  811|  46.8k|        (c >= 0x660 && c <= 0x669) ||
  ------------------
  |  Branch (811:10): [True: 31.7k, False: 15.0k]
  |  Branch (811:24): [True: 596, False: 31.1k]
  ------------------
  812|  46.2k|        (c >= 0x6f0 && c <= 0x6f9) ||
  ------------------
  |  Branch (812:10): [True: 31.1k, False: 15.1k]
  |  Branch (812:24): [True: 1.05k, False: 30.0k]
  ------------------
  813|  45.2k|        (c >= 0x966 && c <= 0x96f) ||
  ------------------
  |  Branch (813:10): [True: 29.9k, False: 15.2k]
  |  Branch (813:24): [True: 207, False: 29.7k]
  ------------------
  814|  45.0k|        (c >= 0x9e6 && c <= 0x9ef) ||
  ------------------
  |  Branch (814:10): [True: 29.7k, False: 15.2k]
  |  Branch (814:24): [True: 567, False: 29.1k]
  ------------------
  815|  44.4k|        (c >= 0xa66 && c <= 0xa6f) ||
  ------------------
  |  Branch (815:10): [True: 29.1k, False: 15.3k]
  |  Branch (815:24): [True: 512, False: 28.6k]
  ------------------
  816|  43.9k|        (c >= 0xae6 && c <= 0xaef) ||
  ------------------
  |  Branch (816:10): [True: 28.6k, False: 15.3k]
  |  Branch (816:24): [True: 203, False: 28.4k]
  ------------------
  817|  43.7k|        (c >= 0xb66 && c <= 0xb6f) ||
  ------------------
  |  Branch (817:10): [True: 28.4k, False: 15.3k]
  |  Branch (817:24): [True: 266, False: 28.1k]
  ------------------
  818|  43.4k|        (c >= 0xbe7 && c <= 0xbef) ||
  ------------------
  |  Branch (818:10): [True: 28.1k, False: 15.3k]
  |  Branch (818:24): [True: 500, False: 27.6k]
  ------------------
  819|  42.9k|        (c >= 0xc66 && c <= 0xc6f) ||
  ------------------
  |  Branch (819:10): [True: 27.6k, False: 15.3k]
  |  Branch (819:24): [True: 472, False: 27.1k]
  ------------------
  820|  42.5k|        (c >= 0xce6 && c <= 0xcef) ||
  ------------------
  |  Branch (820:10): [True: 27.1k, False: 15.4k]
  |  Branch (820:24): [True: 391, False: 26.7k]
  ------------------
  821|  42.1k|        (c >= 0xd66 && c <= 0xd6f) ||
  ------------------
  |  Branch (821:10): [True: 26.7k, False: 15.4k]
  |  Branch (821:24): [True: 544, False: 26.1k]
  ------------------
  822|  41.5k|        (c >= 0xe50 && c <= 0xe59) ||
  ------------------
  |  Branch (822:10): [True: 25.8k, False: 15.6k]
  |  Branch (822:24): [True: 523, False: 25.3k]
  ------------------
  823|  41.0k|        (c >= 0xed0 && c <= 0xed9) ||
  ------------------
  |  Branch (823:10): [True: 24.9k, False: 16.0k]
  |  Branch (823:24): [True: 435, False: 24.5k]
  ------------------
  824|  40.6k|        (c >= 0xf20 && c <= 0xf29) ||
  ------------------
  |  Branch (824:10): [True: 24.5k, False: 16.0k]
  |  Branch (824:24): [True: 250, False: 24.2k]
  ------------------
  825|  40.3k|        c == 0xb7 ||
  ------------------
  |  Branch (825:9): [True: 267, False: 40.0k]
  ------------------
  826|  40.0k|        c == 0x2d0 ||
  ------------------
  |  Branch (826:9): [True: 800, False: 39.2k]
  ------------------
  827|  39.2k|        c == 0x2d1 ||
  ------------------
  |  Branch (827:9): [True: 479, False: 38.8k]
  ------------------
  828|  38.8k|        c == 0x387 ||
  ------------------
  |  Branch (828:9): [True: 230, False: 38.5k]
  ------------------
  829|  38.5k|        c == 0x640 ||
  ------------------
  |  Branch (829:9): [True: 206, False: 38.3k]
  ------------------
  830|  38.3k|        c == 0xe46 ||
  ------------------
  |  Branch (830:9): [True: 231, False: 38.1k]
  ------------------
  831|  38.1k|        c == 0xec6 ||
  ------------------
  |  Branch (831:9): [True: 227, False: 37.9k]
  ------------------
  832|  37.9k|        c == 0x3005 ||
  ------------------
  |  Branch (832:9): [True: 195, False: 37.7k]
  ------------------
  833|  37.7k|        (c >= 0x3031 && c <= 0x3035) ||
  ------------------
  |  Branch (833:10): [True: 23.4k, False: 14.2k]
  |  Branch (833:25): [True: 862, False: 22.6k]
  ------------------
  834|  36.8k|        (c >= 0x309d && c <= 0x309e) ||
  ------------------
  |  Branch (834:10): [True: 22.6k, False: 14.2k]
  |  Branch (834:25): [True: 1.37k, False: 21.2k]
  ------------------
  835|  35.4k|        (c >= 0x30fc && c <= 0x30fe));
  ------------------
  |  Branch (835:10): [True: 21.2k, False: 14.2k]
  |  Branch (835:25): [True: 166, False: 21.0k]
  ------------------
  836|   880k|}
prvTidyIsUpper:
  839|  8.86M|{
  840|  8.86M|    uint map = MAP(c);
  ------------------
  |  |  206|  8.86M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 8.68M, False: 175k]
  |  |  ------------------
  ------------------
  841|       |
  842|  8.86M|    return (map & uppercase)!=0;
  ------------------
  |  |   74|  8.86M|#define uppercase   64u
  ------------------
  843|  8.86M|}
prvTidyToLower:
  846|   160M|{
  847|   160M|    uint map = MAP(c);
  ------------------
  |  |  206|   160M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 153M, False: 6.81M]
  |  |  ------------------
  ------------------
  848|       |
  849|   160M|    if (map & uppercase)
  ------------------
  |  |   74|   160M|#define uppercase   64u
  ------------------
  |  Branch (849:9): [True: 9.02M, False: 151M]
  ------------------
  850|  9.02M|        c += 'a' - 'A';
  851|       |
  852|   160M|    return c;
  853|   160M|}
prvTidyToUpper:
  856|   174k|{
  857|   174k|    uint map = MAP(c);
  ------------------
  |  |  206|   174k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 168k, False: 6.40k]
  |  |  ------------------
  ------------------
  858|       |
  859|   174k|    if (map & lowercase)
  ------------------
  |  |   73|   174k|#define lowercase   32u
  ------------------
  |  Branch (859:9): [True: 8.93k, False: 165k]
  ------------------
  860|  8.93k|        c += (uint) ('A' - 'a' );
  861|       |
  862|   174k|    return c;
  863|   174k|}
prvTidyNewLexer:
  881|  21.3k|{
  882|  21.3k|    Lexer* lexer = (Lexer*) TidyDocAlloc( doc, sizeof(Lexer) );
  ------------------
  |  |  157|  21.3k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  21.3k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  883|       |
  884|  21.3k|    if ( lexer != NULL )
  ------------------
  |  Branch (884:10): [True: 21.3k, False: 0]
  ------------------
  885|  21.3k|    {
  886|  21.3k|        TidyClearMemory( lexer, sizeof(Lexer) );
  ------------------
  |  |   70|  21.3k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  887|       |
  888|  21.3k|        lexer->allocator = doc->allocator;
  889|  21.3k|        lexer->lines = 1;
  890|  21.3k|        lexer->columns = 1;
  891|  21.3k|        lexer->state = LEX_CONTENT;
  892|       |
  893|  21.3k|        lexer->versions = (VERS_ALL|VERS_PROPRIETARY);
  ------------------
  |  |  228|  21.3k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|  21.3k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|  21.3k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|  21.3k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  21.3k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|  21.3k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|  21.3k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|  21.3k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|  21.3k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|  21.3k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|  21.3k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|  21.3k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|  21.3k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  21.3k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|  21.3k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|  21.3k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|  21.3k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|  21.3k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|  21.3k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|  21.3k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|  21.3k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|  21.3k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|  21.3k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|  21.3k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|  21.3k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|  21.3k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|  21.3k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|  21.3k|#define HT50              131072u
  |  |  ------------------
  ------------------
                      lexer->versions = (VERS_ALL|VERS_PROPRIETARY);
  ------------------
  |  |  231|  21.3k|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  21.3k|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  21.3k|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  21.3k|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  894|  21.3k|        lexer->doctype = VERS_UNKNOWN;
  ------------------
  |  |  204|  21.3k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  21.3k|#define xxxx                   0u
  |  |  ------------------
  ------------------
  895|  21.3k|        lexer->root = &doc->root;
  896|  21.3k|    }
  897|  21.3k|    return lexer;
  898|  21.3k|}
prvTidyFreeLexer:
  907|  42.6k|{
  908|  42.6k|    Lexer *lexer = doc->lexer;
  909|  42.6k|    if ( lexer )
  ------------------
  |  Branch (909:10): [True: 21.3k, False: 21.3k]
  ------------------
  910|  21.3k|    {
  911|  21.3k|        TY_(FreeStyles)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  912|       |
  913|       |        /* See GetToken() */
  914|  21.3k|        if ( lexer->pushed || lexer->itoken )
  ------------------
  |  Branch (914:14): [True: 0, False: 21.3k]
  |  Branch (914:31): [True: 0, False: 21.3k]
  ------------------
  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|  62.2k|        while ( lexer->istacksize > 0 )
  ------------------
  |  Branch (921:17): [True: 40.9k, False: 21.3k]
  ------------------
  922|  40.9k|            TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|  40.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  923|       |
  924|  21.3k|        TidyDocFree( doc, lexer->istack );
  ------------------
  |  |  159|  21.3k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  925|  21.3k|        TidyDocFree( doc, lexer->lexbuf );
  ------------------
  |  |  159|  21.3k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  926|  21.3k|        TidyDocFree( doc, lexer );
  ------------------
  |  |  159|  21.3k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  927|       |        doc->lexer = NULL;
  928|  21.3k|    }
  929|  42.6k|}
prvTidyAddCharToLexer:
  975|   328M|{
  976|   328M|    int i, err, count = 0;
  977|   328M|    tmbchar buf[10] = {0};
  978|       |    
  979|   328M|    err = TY_(EncodeCharToUTF8Bytes)( c, buf, NULL, &count );
  ------------------
  |  |   23|   328M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   328M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  980|   328M|    if (err)
  ------------------
  |  Branch (980:9): [True: 4.77k, False: 328M]
  ------------------
  981|  4.77k|    {
  982|       |        /* replacement character 0xFFFD encoded as UTF-8 */
  983|  4.77k|        buf[0] = (byte) 0xEF;
  984|  4.77k|        buf[1] = (byte) 0xBF;
  985|  4.77k|        buf[2] = (byte) 0xBD;
  986|  4.77k|        count = 3;
  987|  4.77k|    }
  988|       |    
  989|   660M|    for ( i = 0; i < count; ++i )
  ------------------
  |  Branch (989:18): [True: 332M, False: 328M]
  ------------------
  990|   332M|        AddByte( lexer, buf[i] );
  991|   328M|}
prvTidyNewNode:
 1425|  3.82M|{
 1426|  3.82M|    Node* node = (Node*) TidyAlloc( allocator, sizeof(Node) );
  ------------------
  |  |   66|  3.82M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 1427|  3.82M|    TidyClearMemory( node, sizeof(Node) );
  ------------------
  |  |   70|  3.82M|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1428|  3.82M|    if ( lexer )
  ------------------
  |  Branch (1428:10): [True: 3.80M, False: 18.9k]
  ------------------
 1429|  3.80M|    {
 1430|  3.80M|        node->line = lexer->lines;
 1431|  3.80M|        node->column = lexer->columns;
 1432|  3.80M|    }
 1433|  3.82M|    node->type = TextNode;
 1434|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_ALLOCATION)
 1435|       |    SPRTF("Allocated node %p\n", node );
 1436|       |#endif
 1437|  3.82M|    return node;
 1438|  3.82M|}
prvTidyCloneNode:
 1442|  28.0k|{
 1443|  28.0k|    Lexer* lexer = doc->lexer;
 1444|  28.0k|    Node *node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|  28.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1445|       |
 1446|  28.0k|    node->start = lexer->lexsize;
 1447|  28.0k|    node->end   = lexer->lexsize;
 1448|       |
 1449|  28.0k|    if ( element )
  ------------------
  |  Branch (1449:10): [True: 28.0k, False: 0]
  ------------------
 1450|  28.0k|    {
 1451|  28.0k|        node->parent     = element->parent;
 1452|  28.0k|        node->type       = element->type;
 1453|  28.0k|        node->closed     = element->closed;
 1454|  28.0k|        node->implicit   = element->implicit;
 1455|  28.0k|        node->tag        = element->tag;
 1456|  28.0k|        node->element    = TY_(tmbstrdup)( doc->allocator, element->element );
  ------------------
  |  |   23|  28.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1457|  28.0k|        node->attributes = TY_(DupAttrs)( doc, element->attributes );
  ------------------
  |  |   23|  28.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1458|  28.0k|    }
 1459|  28.0k|    return node;
 1460|  28.0k|}
prvTidyFreeAttrs:
 1464|  3.74M|{
 1465|  4.36M|    while ( node->attributes )
  ------------------
  |  Branch (1465:13): [True: 622k, False: 3.74M]
  ------------------
 1466|   622k|    {
 1467|   622k|        AttVal *av = node->attributes;
 1468|       |
 1469|   622k|        if ( av->attribute )
  ------------------
  |  Branch (1469:14): [True: 586k, False: 36.2k]
  ------------------
 1470|   586k|        {
 1471|   586k|            if ( (attrIsID(av) || attrIsNAME(av)) &&
  ------------------
  |  |  243|   586k|#define attrIsID(av)                AttrIsId( av, TidyAttr_ID  )
  |  |  ------------------
  |  |  |  |  169|  1.17M|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 586k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 418k, False: 167k]
  |  |  |  |  |  Branch (169:51): [True: 72.0k, False: 346k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( (attrIsID(av) || attrIsNAME(av)) &&
  ------------------
  |  |  265|   514k|#define attrIsNAME(av)              AttrIsId( av, TidyAttr_NAME  )
  |  |  ------------------
  |  |  |  |  169|   514k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 514k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 346k, False: 167k]
  |  |  |  |  |  Branch (169:51): [True: 28.2k, False: 318k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1472|   100k|                 TY_(IsAnchorElement)(doc, node) )
  ------------------
  |  |   23|   100k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   100k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1472:18): [True: 11.7k, False: 88.5k]
  ------------------
 1473|  11.7k|            {
 1474|  11.7k|                TY_(RemoveAnchorByNode)( doc, av->value, node );
  ------------------
  |  |   23|  11.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1475|  11.7k|            }
 1476|   586k|        }
 1477|       |
 1478|   622k|        node->attributes = av->next;
 1479|   622k|        TY_(FreeAttribute)( doc, av );
  ------------------
  |  |   23|   622k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   622k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1480|   622k|    }
 1481|  3.74M|}
prvTidyFreeAttribute:
 1485|   688k|{
 1486|   688k|    TY_(FreeNode)( doc, av->asp );
  ------------------
  |  |   23|   688k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   688k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1487|   688k|    TY_(FreeNode)( doc, av->php );
  ------------------
  |  |   23|   688k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   688k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1488|   688k|    TidyDocFree( doc, av->attribute );
  ------------------
  |  |  159|   688k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   688k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1489|   688k|    TidyDocFree( doc, av->value );
  ------------------
  |  |  159|   688k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   688k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1490|   688k|    TidyDocFree( doc, av );
  ------------------
  |  |  159|   688k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   688k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1491|   688k|}
prvTidyDetachAttribute:
 1496|  6.19k|{
 1497|  6.19k|    AttVal *av, *prev = NULL;
 1498|       |
 1499|  13.3k|    for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (1499:34): [True: 13.3k, False: 0]
  ------------------
 1500|  13.3k|    {
 1501|  13.3k|        if ( av == attr )
  ------------------
  |  Branch (1501:14): [True: 6.19k, False: 7.14k]
  ------------------
 1502|  6.19k|        {
 1503|  6.19k|            if ( prev )
  ------------------
  |  Branch (1503:18): [True: 3.81k, False: 2.38k]
  ------------------
 1504|  3.81k|                prev->next = attr->next;
 1505|  2.38k|            else
 1506|  2.38k|                node->attributes = attr->next;
 1507|  6.19k|            break;
 1508|  6.19k|        }
 1509|  7.14k|        prev = av;
 1510|  7.14k|    }
 1511|  6.19k|}
prvTidyRemoveAttribute:
 1516|  6.19k|{
 1517|  6.19k|    TY_(DetachAttribute)( node, attr );
  ------------------
  |  |   23|  6.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1518|  6.19k|    TY_(FreeAttribute)( doc, attr );
  ------------------
  |  |   23|  6.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1519|  6.19k|}
prvTidyFreeNode:
 1527|  6.15M|{
 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.89M|    while ( node )
  ------------------
  |  Branch (1540:13): [True: 3.73M, False: 6.15M]
  ------------------
 1541|  3.73M|    {
 1542|  3.73M|        Node* next = node->next;
 1543|       |
 1544|  3.73M|        TY_(FreeAttrs)( doc, node );
  ------------------
  |  |   23|  3.73M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.73M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1545|  3.73M|        TY_(FreeNode)( doc, node->content );
  ------------------
  |  |   23|  3.73M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.73M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1546|  3.73M|        TidyDocFree( doc, node->element );
  ------------------
  |  |  159|  3.73M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.73M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1547|  3.73M|        if (RootNode != node->type)
  ------------------
  |  Branch (1547:13): [True: 3.69M, False: 42.6k]
  ------------------
 1548|  3.73M|            TidyDocFree( doc, node );
  ------------------
  |  |  159|  3.69M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.69M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1549|  42.6k|        else
 1550|  42.6k|            node->content = NULL;
 1551|       |
 1552|  3.73M|        node = next;
 1553|  3.73M|    }
 1554|  6.15M|}
prvTidyTextToken:
 1557|   219k|{
 1558|   219k|    Node *node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|   219k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   219k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1559|   219k|    node->start = lexer->txtstart;
 1560|   219k|    node->end = lexer->txtend;
 1561|   219k|    return node;
 1562|   219k|}
prvTidyFindDocType:
 1649|  65.2k|{
 1650|  65.2k|    Node* node;
 1651|  65.2k|    for ( node = (doc ? doc->root.content : NULL);
  ------------------
  |  Branch (1651:19): [True: 65.2k, False: 0]
  ------------------
 1652|   118k|          node && node->type != DocTypeTag; 
  ------------------
  |  Branch (1652:11): [True: 60.9k, False: 57.2k]
  |  Branch (1652:19): [True: 52.9k, False: 8.01k]
  ------------------
 1653|  65.2k|          node = node->next )
 1654|  52.9k|        /**/;
 1655|  65.2k|    return node;
 1656|  65.2k|}
prvTidyFindHTML:
 1672|   198k|{
 1673|   198k|    Node *node;
 1674|   198k|    for ( node = (doc ? doc->root.content : NULL);
  ------------------
  |  Branch (1674:19): [True: 198k, False: 0]
  ------------------
 1675|   383k|          node && !nodeIsHTML(node); 
  ------------------
  |  |  370|   379k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   379k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 379k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 195k, False: 184k]
  |  |  |  |  |  Branch (275:54): [True: 195k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1675:11): [True: 379k, False: 3.59k]
  ------------------
 1676|   198k|          node = node->next )
 1677|   184k|        /**/;
 1678|       |
 1679|   198k|    return node;
 1680|   198k|}
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.21k|          node && !(node->type == XmlDecl);
  ------------------
  |  Branch (1687:11): [True: 1.07k, False: 138]
  |  Branch (1687:19): [True: 215, False: 863]
  ------------------
 1688|  1.00k|          node = node->next )
 1689|    215|        /**/;
 1690|       |
 1691|  1.00k|    return node;
 1692|  1.00k|}
prvTidyFindHEAD:
 1696|   136k|{
 1697|   136k|    Node *node = TY_(FindHTML)( doc );
  ------------------
  |  |   23|   136k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   136k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1698|       |
 1699|   136k|    if ( node )
  ------------------
  |  Branch (1699:10): [True: 136k, False: 0]
  ------------------
 1700|   136k|    {
 1701|   136k|        for ( node = node->content;
 1702|   139k|              node && !nodeIsHEAD(node); 
  ------------------
  |  |  371|   139k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|   139k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 139k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 136k, False: 3.54k]
  |  |  |  |  |  Branch (275:54): [True: 136k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1702:15): [True: 139k, False: 0]
  ------------------
 1703|   136k|              node = node->next )
 1704|  3.54k|            /**/;
 1705|   136k|    }
 1706|       |
 1707|   136k|    return node;
 1708|   136k|}
prvTidyFindTITLE:
 1711|  21.3k|{
 1712|  21.3k|    Node *node = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1713|       |
 1714|  21.3k|    if (node)
  ------------------
  |  Branch (1714:9): [True: 21.3k, False: 0]
  ------------------
 1715|  21.3k|        for (node = node->content;
 1716|  28.9k|             node && !nodeIsTITLE(node);
  ------------------
  |  |  372|  7.73k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  7.73k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.73k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.16k, False: 1.56k]
  |  |  |  |  |  Branch (275:54): [True: 124, False: 6.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1716:14): [True: 7.73k, False: 21.1k]
  ------------------
 1717|  21.3k|             node = node->next) {}
 1718|       |
 1719|  21.3k|    return node;
 1720|  21.3k|}
prvTidyFindBody:
 1723|  60.4k|{
 1724|  60.4k|    Node *node = ( doc ? doc->root.content : NULL );
  ------------------
  |  Branch (1724:20): [True: 60.4k, False: 0]
  ------------------
 1725|       |
 1726|  99.4k|    while ( node && !nodeIsHTML(node) )
  ------------------
  |  |  370|  99.4k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  99.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 99.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 60.4k, False: 38.9k]
  |  |  |  |  |  Branch (275:54): [True: 60.4k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1726:13): [True: 99.4k, False: 0]
  ------------------
 1727|  38.9k|        node = node->next;
 1728|       |
 1729|  60.4k|    if (node == NULL)
  ------------------
  |  Branch (1729:9): [True: 0, False: 60.4k]
  ------------------
 1730|      0|        return NULL;
 1731|       |
 1732|  60.4k|    node = node->content;
 1733|   196k|    while ( node && !nodeIsBODY(node) && !nodeIsFRAMESET(node) )
  ------------------
  |  |  375|   192k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   388k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 192k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 139k, False: 52.6k]
  |  |  |  |  |  Branch (275:54): [True: 48.0k, False: 91.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  while ( node && !nodeIsBODY(node) && !nodeIsFRAMESET(node) )
  ------------------
  |  |  376|   144k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|   144k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 144k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 91.4k, False: 52.6k]
  |  |  |  |  |  Branch (275:54): [True: 8.00k, False: 83.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1733:13): [True: 192k, False: 4.40k]
  ------------------
 1734|   136k|        node = node->next;
 1735|       |
 1736|  60.4k|    if ( node && nodeIsFRAMESET(node) )
  ------------------
  |  |  376|  56.0k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  56.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 56.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 56.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 8.00k, False: 48.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1736:10): [True: 56.0k, False: 4.40k]
  ------------------
 1737|  8.00k|    {
 1738|  8.00k|        node = node->content;
 1739|  10.2k|        while ( node && !nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|  9.29k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  9.29k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 9.29k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.47k, False: 813]
  |  |  |  |  |  Branch (275:54): [True: 7.09k, False: 1.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1739:17): [True: 9.29k, False: 908]
  ------------------
 1740|  2.19k|            node = node->next;
 1741|       |
 1742|  8.00k|        if ( node )
  ------------------
  |  Branch (1742:14): [True: 7.09k, False: 908]
  ------------------
 1743|  7.09k|        {
 1744|  7.09k|            node = node->content;
 1745|   145k|            while ( node && !nodeIsBODY(node) )
  ------------------
  |  |  375|   144k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   144k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 144k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 140k, False: 3.94k]
  |  |  |  |  |  Branch (275:54): [True: 5.54k, False: 134k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1745:21): [True: 144k, False: 1.54k]
  ------------------
 1746|   138k|                node = node->next;
 1747|  7.09k|        }
 1748|  8.00k|    }
 1749|       |
 1750|  60.4k|    return node;
 1751|  60.4k|}
prvTidyAddGenerator:
 1755|  21.3k|{
 1756|  21.3k|    AttVal *attval;
 1757|  21.3k|    Node *node;
 1758|  21.3k|    Node *head = TY_(FindHEAD)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1759|  21.3k|    tmbchar buf[256];
 1760|       |    
 1761|  21.3k|    if (head)
  ------------------
  |  Branch (1761:9): [True: 21.3k, False: 0]
  ------------------
 1762|  21.3k|    {
 1763|  21.3k|#ifdef PLATFORM_NAME
 1764|  21.3k|        TY_(tmbsnprintf)(buf, sizeof(buf), "HTML Tidy for HTML5 for "PLATFORM_NAME" version %s",
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1765|  21.3k|                         tidyLibraryVersion());
 1766|       |#else
 1767|       |        TY_(tmbsnprintf)(buf, sizeof(buf), "HTML Tidy for HTML5 version %s", tidyLibraryVersion());
 1768|       |#endif
 1769|       |
 1770|  58.5k|        for ( node = head->content; node; node = node->next )
  ------------------
  |  Branch (1770:37): [True: 37.2k, False: 21.3k]
  ------------------
 1771|  37.2k|        {
 1772|  37.2k|            if ( nodeIsMETA(node) )
  ------------------
  |  |  374|  37.2k|#define nodeIsMETA( node )       TagIsId( node, TidyTag_META )
  |  |  ------------------
  |  |  |  |  275|  37.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 37.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 35.6k, False: 1.56k]
  |  |  |  |  |  Branch (275:54): [True: 626, False: 35.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1773|    626|            {
 1774|    626|                attval = TY_(AttrGetById)(node, TidyAttr_NAME);
  ------------------
  |  |   23|    626|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    626|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1775|       |
 1776|    626|                if (AttrValueIs(attval, "generator"))
  ------------------
  |  |  172|    626|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  1.25k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 279, False: 347]
  |  |  |  |  |  Branch (171:44): [True: 77, False: 202]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|    626|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|     77|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     77|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 77]
  |  |  ------------------
  ------------------
 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|    626|            }
 1792|  37.2k|        }
 1793|       |
 1794|  21.3k|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1794:14): [True: 21.3k, False: 0]
  ------------------
 1795|  21.3k|        {
 1796|  21.3k|            node = TY_(InferredTag)(doc, TidyTag_META);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1797|  21.3k|            TY_(AddAttribute)( doc, node, "name", "generator" );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1798|  21.3k|            TY_(AddAttribute)( doc, node, "content", buf );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1799|  21.3k|            TY_(InsertNodeAtStart)( head, node );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1800|  21.3k|            return yes;
 1801|  21.3k|        }
 1802|  21.3k|    }
 1803|       |
 1804|      0|    return no;
 1805|  21.3k|}
prvTidyApparentVersion:
 1850|  42.6k|{
 1851|  42.6k|    if ((doc->lexer->doctype == XH11 ||
  ------------------
  |  |  188|  85.2k|#define XH11                2048u
  ------------------
  |  Branch (1851:10): [True: 96, False: 42.5k]
  ------------------
 1852|  42.5k|         doc->lexer->doctype == XB10) &&
  ------------------
  |  |  189|  42.5k|#define XB10                4096u
  ------------------
  |  Branch (1852:10): [True: 0, False: 42.5k]
  ------------------
 1853|     96|        (doc->lexer->versions & doc->lexer->doctype))
  ------------------
  |  Branch (1853:9): [True: 78, False: 18]
  ------------------
 1854|     78|        return doc->lexer->doctype;
 1855|  42.5k|    else
 1856|  42.5k|        return TY_(HTMLVersion)(doc);
  ------------------
  |  |   23|  42.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1857|  42.6k|}
prvTidyHTMLVersionNameFromCode:
 1860|  47.9k|{
 1861|  47.9k|    ctmbstr name = GetNameFromVers(vers);
 1862|  47.9k|    return name;
 1863|  47.9k|}
prvTidyWarnMissingSIInEmittedDocType:
 1877|  21.3k|{
 1878|  21.3k|    Bool isXhtml = doc->lexer->isvoyager;
 1879|  21.3k|    Node* doctype;
 1880|       |    
 1881|       |    /* Do not warn in XHTML mode */
 1882|  21.3k|    if ( isXhtml )
  ------------------
  |  Branch (1882:10): [True: 1.37k, False: 19.9k]
  ------------------
 1883|  1.37k|        return no;
 1884|       |
 1885|       |    /* Do not warn if emitted doctype is proprietary */
 1886|  19.9k|    if ( TY_(HTMLVersionNameFromCode)(doc->lexer->versionEmitted, isXhtml ) == NULL )
  ------------------
  |  |   23|  19.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1886:10): [True: 0, False: 19.9k]
  ------------------
 1887|      0|        return no;
 1888|       |
 1889|       |    /* Do not warn if no SI is possible */
 1890|  19.9k|    if ( GetSIFromVers(doc->lexer->versionEmitted) == NULL )
  ------------------
  |  Branch (1890:10): [True: 19.9k, False: 0]
  ------------------
 1891|  19.9k|        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|  21.3k|{
 1923|  21.3k|    Lexer *lexer = doc->lexer;
 1924|  21.3k|    Node *doctype = TY_(FindDocType)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1925|  21.3k|    TidyDoctypeModes dtmode = (TidyDoctypeModes)cfg(doc, TidyDoctypeMode);
  ------------------
  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1926|  21.3k|    ctmbstr pub = "PUBLIC";
 1927|  21.3k|    ctmbstr sys = "SYSTEM";
 1928|       |
 1929|  21.3k|    lexer->versionEmitted = TY_(ApparentVersion)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1930|       |
 1931|  21.3k|    if (dtmode == TidyDoctypeOmit)
  ------------------
  |  Branch (1931:9): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    if (dtmode == TidyDoctypeUser && !cfgStr(doc, TidyDoctype))
  ------------------
  |  |  424|      0|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  ------------------
  |  Branch (1938:9): [True: 0, False: 21.3k]
  |  Branch (1938:38): [True: 0, False: 0]
  ------------------
 1939|      0|        return no;
 1940|       |
 1941|  21.3k|    if (!doctype)
  ------------------
  |  Branch (1941:9): [True: 18.9k, False: 2.35k]
  ------------------
 1942|  18.9k|    {
 1943|  18.9k|        doctype = NewDocTypeNode(doc);
 1944|  18.9k|        doctype->element = TY_(tmbstrdup)(doc->allocator, "html");
  ------------------
  |  |   23|  18.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1945|  18.9k|    }
 1946|  2.35k|    else
 1947|  2.35k|    {
 1948|  2.35k|        doctype->element = TY_(tmbstrtolower)(doctype->element);
  ------------------
  |  |   23|  2.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1949|  2.35k|    }
 1950|       |
 1951|  21.3k|    switch(dtmode)
  ------------------
  |  Branch (1951:12): [True: 21.3k, False: 0]
  ------------------
 1952|  21.3k|    {
 1953|      0|    case TidyDoctypeHtml5:
  ------------------
  |  Branch (1953:5): [True: 0, False: 21.3k]
  ------------------
 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: 21.3k]
  ------------------
 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: 21.3k]
  ------------------
 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: 21.3k]
  ------------------
 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|  21.3k|    case TidyDoctypeAuto:
  ------------------
  |  Branch (1976:5): [True: 21.3k, False: 0]
  ------------------
 1977|  21.3k|        if (lexer->doctype == VERS_UNKNOWN || lexer->doctype == VERS_HTML5) {
  ------------------
  |  |  204|  42.6k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  21.3k|#define xxxx                   0u
  |  |  ------------------
  ------------------
                      if (lexer->doctype == VERS_UNKNOWN || lexer->doctype == VERS_HTML5) {
  ------------------
  |  |  213|    383|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|    383|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|    383|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (1977:13): [True: 20.9k, False: 383]
  |  Branch (1977:47): [True: 212, False: 171]
  ------------------
 1978|  21.1k|          lexer->versionEmitted = XH50;
  ------------------
  |  |  201|  21.1k|#define XH50              262144u
  ------------------
 1979|  21.1k|          return yes;
 1980|  21.1k|        }
 1981|    171|        else if (lexer->versions & XH11 && lexer->doctype == XH11)
  ------------------
  |  |  188|    342|#define XH11                2048u
  ------------------
                      else if (lexer->versions & XH11 && lexer->doctype == XH11)
  ------------------
  |  |  188|    132|#define XH11                2048u
  ------------------
  |  Branch (1981:18): [True: 132, False: 39]
  |  Branch (1981:44): [True: 39, False: 93]
  ------------------
 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: 32, False: 7]
  ------------------
 1984|     32|                TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |   23|     32|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     32|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |  188|     32|#define XH11                2048u
  ------------------
 1985|     39|            lexer->versionEmitted = XH11;
  ------------------
  |  |  188|     39|#define XH11                2048u
  ------------------
 1986|     39|            return yes;
 1987|     39|        }
 1988|    132|        else if (lexer->versions & XH11 && !(lexer->versions & VERS_HTML40))
  ------------------
  |  |  188|    264|#define XH11                2048u
  ------------------
                      else if (lexer->versions & XH11 && !(lexer->versions & VERS_HTML40))
  ------------------
  |  |  216|     93|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  ------------------
  |  |  |  |  207|     93|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|     93|#define H40S                   4u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|     93|#define H41S                  32u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  185|     93|#define X10S                 256u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  ------------------
  |  |  |  |  208|     93|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|     93|#define H40T                   8u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|     93|#define H41T                  64u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  ------------------
  |  |  |  |  |  |  186|     93|#define X10T                 512u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  ------------------
  |  |  |  |  209|     93|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|     93|#define H40F                  16u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|     93|#define H41F                 128u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  ------------------
  |  |  |  |  |  |  187|     93|#define X10F                1024u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1988:18): [True: 93, False: 39]
  |  Branch (1988:44): [True: 7, False: 86]
  ------------------
 1989|      7|        {
 1990|      7|            TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(XH11));
  ------------------
  |  |   23|      7|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      7|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(XH11));
  ------------------
  |  |  188|      7|#define XH11                2048u
  ------------------
 1991|      7|            TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |   23|      7|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      7|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |  188|      7|#define XH11                2048u
  ------------------
 1992|      7|            lexer->versionEmitted = XH11;
  ------------------
  |  |  188|      7|#define XH11                2048u
  ------------------
 1993|      7|        }
 1994|    125|        else if (lexer->versions & XB10 && lexer->doctype == XB10)
  ------------------
  |  |  189|    250|#define XB10                4096u
  ------------------
                      else if (lexer->versions & XB10 && lexer->doctype == XB10)
  ------------------
  |  |  189|     33|#define XB10                4096u
  ------------------
  |  Branch (1994:18): [True: 33, False: 92]
  |  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|    125|        else if (lexer->versions & VERS_HTML40_STRICT)
  ------------------
  |  |  207|    125|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|    125|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|    125|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|    125|#define X10S                 256u
  |  |  ------------------
  ------------------
  |  Branch (2001:18): [True: 4, False: 121]
  ------------------
 2002|      4|        {
 2003|      4|            TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10S));
  ------------------
  |  |   23|      4|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      4|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10S));
  ------------------
  |  |  185|      4|#define X10S                 256u
  ------------------
 2004|      4|            TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10S));
  ------------------
  |  |   23|      4|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      4|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10S));
  ------------------
  |  |  185|      4|#define X10S                 256u
  ------------------
 2005|      4|            lexer->versionEmitted = X10S;
  ------------------
  |  |  185|      4|#define X10S                 256u
  ------------------
 2006|      4|        }
 2007|    121|        else if (lexer->versions & VERS_FRAMESET)
  ------------------
  |  |  209|    121|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|    121|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|    121|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|    121|#define X10F                1024u
  |  |  ------------------
  ------------------
  |  Branch (2007:18): [True: 4, False: 117]
  ------------------
 2008|      4|        {
 2009|      4|            TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10F));
  ------------------
  |  |   23|      4|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      4|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10F));
  ------------------
  |  |  187|      4|#define X10F                1024u
  ------------------
 2010|      4|            TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10F));
  ------------------
  |  |   23|      4|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      4|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10F));
  ------------------
  |  |  187|      4|#define X10F                1024u
  ------------------
 2011|      4|            lexer->versionEmitted = X10F;
  ------------------
  |  |  187|      4|#define X10F                1024u
  ------------------
 2012|      4|        }
 2013|    117|        else if (lexer->versions & VERS_LOOSE)
  ------------------
  |  |  218|    117|#define VERS_LOOSE         (VERS_HTML20|VERS_HTML32|VERS_IFRAME)
  |  |  ------------------
  |  |  |  |  205|    117|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|    117|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_LOOSE         (VERS_HTML20|VERS_HTML32|VERS_IFRAME)
  |  |  ------------------
  |  |  |  |  206|    117|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|    117|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_LOOSE         (VERS_HTML20|VERS_HTML32|VERS_IFRAME)
  |  |  ------------------
  |  |  |  |  217|    117|#define VERS_IFRAME        (VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|    117|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|    117|#define H40T                   8u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    117|#define H41T                  64u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|    117|#define X10T                 512u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_IFRAME        (VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  209|    117|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|    117|#define H40F                  16u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|    117|#define H41F                 128u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|    117|#define X10F                1024u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2013:18): [True: 95, False: 22]
  ------------------
 2014|     95|        {
 2015|     95|            TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10T));
  ------------------
  |  |   23|     95|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     95|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10T));
  ------------------
  |  |  186|     95|#define X10T                 512u
  ------------------
 2016|     95|            TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10T));
  ------------------
  |  |   23|     95|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     95|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10T));
  ------------------
  |  |  186|     95|#define X10T                 512u
  ------------------
 2017|     95|            lexer->versionEmitted = X10T;
  ------------------
  |  |  186|     95|#define X10T                 512u
  ------------------
 2018|     95|        }
 2019|     22|        else if (lexer->versions & VERS_HTML5)
  ------------------
  |  |  213|     22|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|     22|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|     22|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (2019:18): [True: 3, False: 19]
  ------------------
 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|     19|        else
 2030|     19|        {
 2031|     19|            if (doctype)
  ------------------
  |  Branch (2031:17): [True: 19, False: 0]
  ------------------
 2032|     19|                TY_(DiscardElement)(doc, doctype);
  ------------------
  |  |   23|     19|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     19|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2033|     19|            return no;
 2034|     19|        }
 2035|    113|        break;
 2036|    113|    case TidyDoctypeOmit:
  ------------------
  |  Branch (2036:5): [True: 0, False: 21.3k]
  ------------------
 2037|      0|        assert(0);
  ------------------
  |  Branch (2037:9): [Folded, False: 0]
  |  Branch (2037:9): [Folded, False: 0]
  ------------------
 2038|      0|        break;
 2039|  21.3k|    }
 2040|       |
 2041|    113|    return no;
 2042|  21.3k|}
prvTidyInferredTag:
 2174|   328k|{
 2175|   328k|    Lexer *lexer = doc->lexer;
 2176|   328k|    Node *node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|   328k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   328k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2177|   328k|    const Dict* dict = TY_(LookupTagDef)(id);
  ------------------
  |  |   23|   328k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   328k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2178|       |
 2179|   328k|    assert( dict != NULL );
  ------------------
  |  Branch (2179:5): [True: 0, False: 328k]
  |  Branch (2179:5): [True: 328k, False: 0]
  ------------------
 2180|       |
 2181|   328k|    node->type = StartTag;
 2182|   328k|    node->implicit = yes;
 2183|   328k|    node->element = TY_(tmbstrdup)(doc->allocator, dict->name);
  ------------------
  |  |   23|   328k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   328k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2184|   328k|    node->tag = dict;
 2185|   328k|    node->start = lexer->txtstart;
 2186|   328k|    node->end = lexer->txtend;
 2187|       |
 2188|   328k|    return node;
 2189|   328k|}
prvTidyUngetToken:
 2409|  1.17M|{
 2410|  1.17M|    doc->lexer->pushed = yes;
 2411|  1.17M|}
prvTidyGetToken:
 2441|  6.15M|{
 2442|  6.15M|    Node *node;
 2443|  6.15M|    Lexer* lexer = doc->lexer;
 2444|       |
 2445|  6.15M|    if (lexer->pushed || lexer->itoken)
  ------------------
  |  Branch (2445:9): [True: 1.17M, False: 4.97M]
  |  Branch (2445:26): [True: 9.50k, False: 4.96M]
  ------------------
 2446|  1.18M|    {
 2447|       |        /* Deal with previously returned duplicate inline token */
 2448|  1.18M|        if (lexer->itoken)
  ------------------
  |  Branch (2448:13): [True: 10.0k, False: 1.17M]
  ------------------
 2449|  10.0k|        {
 2450|       |            /* itoken rejected */
 2451|  10.0k|            if (lexer->pushed)
  ------------------
  |  Branch (2451:17): [True: 568, False: 9.50k]
  ------------------
 2452|    568|            {
 2453|    568|                lexer->pushed = no;
 2454|    568|                node = lexer->itoken;
 2455|    568|                GTDBG(doc,"lex-itoken", node);
 2456|    568|                return node;
 2457|    568|            }
 2458|       |            /* itoken has been accepted */
 2459|  9.50k|            lexer->itoken = NULL;
 2460|  9.50k|        }
 2461|       |            
 2462|       |        /* duplicate inlines in preference to pushed text nodes when appropriate */
 2463|  1.18M|        lexer->pushed = no;
 2464|  1.18M|        if (lexer->token->type != TextNode
  ------------------
  |  Branch (2464:13): [True: 1.14M, False: 45.8k]
  ------------------
 2465|  1.17M|            || !(lexer->insert || lexer->inode)) {
  ------------------
  |  Branch (2465:18): [True: 9.50k, False: 36.3k]
  |  Branch (2465:35): [True: 0, False: 36.3k]
  ------------------
 2466|  1.17M|            node = lexer->token;
 2467|  1.17M|            GTDBG(doc,"lex-token", node);
 2468|  1.17M|            return node;
 2469|  1.17M|        }
 2470|  9.50k|        lexer->itoken = TY_(InsertedToken)( doc );
  ------------------
  |  |   23|  9.50k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.50k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2471|  9.50k|        node = lexer->itoken;
 2472|  9.50k|        GTDBG(doc,"lex-inserted", node);
 2473|  9.50k|        return node;
 2474|  1.18M|    }
 2475|       |
 2476|  6.15M|    assert( !(lexer->pushed || lexer->itoken) );
  ------------------
  |  Branch (2476:5): [True: 4.96M, False: 0]
  |  Branch (2476:5): [True: 0, False: 0]
  |  Branch (2476:5): [True: 0, False: 4.96M]
  |  Branch (2476:5): [True: 0, False: 4.96M]
  ------------------
 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|  4.96M|    if ((lexer->insert || lexer->inode) && lexer->istacksize)
  ------------------
  |  Branch (2482:10): [True: 1.77M, False: 3.19M]
  |  Branch (2482:27): [True: 3.71k, False: 3.18M]
  |  Branch (2482:44): [True: 1.74M, False: 35.5k]
  ------------------
 2483|  1.74M|    {
 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.74M|        lexer->token = TY_(InsertedToken)( doc );
  ------------------
  |  |   23|  1.74M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.74M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2488|  1.74M|        node = lexer->token;
 2489|  1.74M|        GTDBG(doc,"lex-inserted2", node);
 2490|  1.74M|        return node;
 2491|  1.74M|    }
 2492|       |
 2493|  3.22M|    if (mode == CdataContent)
  ------------------
  |  Branch (2493:9): [True: 6.05k, False: 3.21M]
  ------------------
 2494|  6.05k|    {
 2495|  6.05k|        assert( lexer->parent != NULL );
  ------------------
  |  Branch (2495:9): [True: 0, False: 6.05k]
  |  Branch (2495:9): [True: 6.05k, False: 0]
  ------------------
 2496|  6.05k|        node = GetCDATA(doc, lexer->parent);
 2497|  6.05k|        GTDBG(doc,"lex-cdata", node);
 2498|  6.05k|        return node;
 2499|  6.05k|    }
 2500|       |
 2501|  3.21M|    return GetTokenFromStream( doc, mode );
 2502|  3.22M|}
prvTidyInitMap:
 3480|  21.3k|{
 3481|  21.3k|    MapStr("\r\n\f", newline|white);
  ------------------
  |  |   72|  21.3k|#define newline     16u
  ------------------
                  MapStr("\r\n\f", newline|white);
  ------------------
  |  |   71|  21.3k|#define white       8u
  ------------------
 3482|  21.3k|    MapStr(" \t", white);
  ------------------
  |  |   71|  21.3k|#define white       8u
  ------------------
 3483|  21.3k|    MapStr("-.:_", namechar);
  ------------------
  |  |   70|  21.3k|#define namechar    4u
  ------------------
 3484|  21.3k|    MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   68|  21.3k|#define digit       1u
  ------------------
                  MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   75|  21.3k|#define digithex    128u
  ------------------
                  MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   70|  21.3k|#define namechar    4u
  ------------------
 3485|  21.3k|    MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   73|  21.3k|#define lowercase   32u
  ------------------
                  MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   69|  21.3k|#define letter      2u
  ------------------
                  MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   70|  21.3k|#define namechar    4u
  ------------------
 3486|  21.3k|    MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   74|  21.3k|#define uppercase   64u
  ------------------
                  MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   69|  21.3k|#define letter      2u
  ------------------
                  MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   70|  21.3k|#define namechar    4u
  ------------------
 3487|  21.3k|    MapStr("abcdefABCDEF", digithex);
  ------------------
  |  |   75|  21.3k|#define digithex    128u
  ------------------
 3488|  21.3k|}
prvTidyNewAttribute:
 4155|   695k|{
 4156|   695k|    AttVal *av = (AttVal*) TidyDocAlloc( doc, sizeof(AttVal) );
  ------------------
  |  |  157|   695k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   695k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 4157|   695k|    TidyClearMemory( av, sizeof(AttVal) );
  ------------------
  |  |   70|   695k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 4158|   695k|    return av;
 4159|   695k|}
prvTidyNewAttributeEx:
 4164|  42.7k|{
 4165|  42.7k|    AttVal *av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  42.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4166|  42.7k|    av->attribute = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|  42.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4167|  42.7k|    av->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|  42.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4168|  42.7k|    av->delim = delim;
 4169|  42.7k|    av->dict = TY_(FindAttribute)( doc, av );
  ------------------
  |  |   23|  42.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4170|  42.7k|    return av;
 4171|  42.7k|}
prvTidyInsertAttributeAtEnd:
 4187|   114k|{
 4188|   114k|    AddAttrToList(&node->attributes, av);
 4189|   114k|}
prvTidyInsertAttributeAtStart:
 4192|  42.7k|{
 4193|  42.7k|    av->next = node->attributes;
 4194|  42.7k|    node->attributes = av;
 4195|  42.7k|}
prvTidynewStack:
 4461|   148k|{
 4462|   148k|    Stack *stack = (Stack *)TidyAlloc(doc->allocator, sizeof(Stack));
  ------------------
  |  |   66|   148k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 4463|   148k|    stack->top = -1;
 4464|   148k|    stack->capacity = capacity;
 4465|   148k|    stack->firstNode = (Node **)TidyAlloc(doc->allocator, stack->capacity * sizeof(Node**));
  ------------------
  |  |   66|   148k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 4466|   148k|    stack->allocator = doc->allocator;
 4467|   148k|    return stack;
 4468|   148k|}
prvTidygrowStack:
 4477|    602|{
 4478|    602|    uint new_capacity = stack->capacity * 2;
 4479|       |    
 4480|    602|    Node **firstNode = (Node **)TidyAlloc(stack->allocator, new_capacity * sizeof(Node**));
  ------------------
  |  |   66|    602|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 4481|       |    
 4482|    602|    memcpy( firstNode, stack->firstNode, sizeof(Node**) * (stack->top + 1) );
 4483|    602|    TidyFree(stack->allocator, stack->firstNode);
  ------------------
  |  |   68|    602|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 4484|       |
 4485|    602|    stack->firstNode = firstNode;
 4486|    602|    stack->capacity = new_capacity;
 4487|    602|}
prvTidystackFull:
 4494|  14.3M|{
 4495|  14.3M|    return stack->top == stack->capacity - 1;
 4496|  14.3M|}
prvTidystackEmpty:
 4503|  1.00M|{
 4504|  1.00M|    return stack->top == -1;
 4505|  1.00M|}
prvTidypush:
 4512|  14.3M|{
 4513|  14.3M|    if (TY_(stackFull)(stack))
  ------------------
  |  |   23|  14.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4513:9): [True: 602, False: 14.3M]
  ------------------
 4514|    602|        TY_(growStack)(stack);
  ------------------
  |  |   23|    602|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    602|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4515|       |    
 4516|  14.3M|    if (node)
  ------------------
  |  Branch (4516:9): [True: 853k, False: 13.4M]
  ------------------
 4517|   853k|        stack->firstNode[++stack->top] = node;
 4518|  14.3M|}
prvTidypop:
 4525|  1.00M|{
 4526|  1.00M|    return TY_(stackEmpty)(stack) ? NULL : stack->firstNode[stack->top--];
  ------------------
  |  |   23|  1.00M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4526:12): [True: 148k, False: 853k]
  ------------------
 4527|  1.00M|}
prvTidyfreeStack:
 4542|   148k|{
 4543|   148k|    TidyFree( stack->allocator, stack->firstNode );
  ------------------
  |  |   68|   148k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 4544|   148k|    stack->top = -1;
 4545|   148k|    stack->capacity = 0;
 4546|   148k|    stack->firstNode = NULL;
 4547|       |    stack->allocator = NULL;
 4548|   148k|}
lexer.c:AddByte:
  936|   332M|{
  937|   332M|    if ( lexer->lexsize + 2 >= lexer->lexlength )
  ------------------
  |  Branch (937:10): [True: 23.3k, False: 332M]
  ------------------
  938|  23.3k|    {
  939|  23.3k|        tmbstr buf = NULL;
  940|  23.3k|        uint allocAmt = lexer->lexlength;
  941|  23.3k|        uint prev = allocAmt; /* Is. #761 */
  942|  46.6k|        while ( lexer->lexsize + 2 >= allocAmt )
  ------------------
  |  Branch (942:17): [True: 23.3k, False: 23.3k]
  ------------------
  943|  23.3k|        {
  944|  23.3k|            if ( allocAmt == 0 )
  ------------------
  |  Branch (944:18): [True: 21.2k, False: 2.06k]
  ------------------
  945|  21.2k|                allocAmt = 8192;
  946|  2.06k|            else
  947|  2.06k|                allocAmt *= 2;
  948|  23.3k|            if (allocAmt < prev) /* Is. #761 - watch for wrap - and */
  ------------------
  |  Branch (948:17): [True: 0, False: 23.3k]
  ------------------
  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|  23.3k|        }
  951|  23.3k|        buf = (tmbstr) TidyRealloc( lexer->allocator, lexer->lexbuf, allocAmt );
  ------------------
  |  |   67|  23.3k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  952|  23.3k|        if ( buf )
  ------------------
  |  Branch (952:14): [True: 23.3k, False: 0]
  ------------------
  953|  23.3k|        {
  954|  23.3k|          TidyClearMemory( buf + lexer->lexlength, 
  ------------------
  |  |   70|  23.3k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  955|  23.3k|                           allocAmt - lexer->lexlength );
  956|  23.3k|          lexer->lexbuf = buf;
  957|  23.3k|          lexer->lexlength = allocAmt;
  958|  23.3k|        }
  959|  23.3k|    }
  960|       |
  961|   332M|    lexer->lexbuf[ lexer->lexsize++ ] = ch;
  962|   332M|    lexer->lexbuf[ lexer->lexsize ]   = '\0';  /* debug */
  963|   332M|}
lexer.c:GetNameFromVers:
  322|  47.9k|{
  323|  47.9k|    uint i;
  324|       |
  325|   909k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (325:17): [True: 908k, False: 74]
  ------------------
  326|   908k|        if (W3C_Doctypes[i].vers == vers)
  ------------------
  |  Branch (326:13): [True: 47.8k, False: 861k]
  ------------------
  327|  47.8k|            return W3C_Doctypes[i].name;
  328|       |
  329|     74|    return NULL;
  330|  47.9k|}
lexer.c:GetSIFromVers:
  311|  20.0k|{
  312|  20.0k|    uint i;
  313|       |
  314|   380k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (314:17): [True: 380k, False: 0]
  ------------------
  315|   380k|        if (W3C_Doctypes[i].vers == vers)
  ------------------
  |  Branch (315:13): [True: 20.0k, False: 360k]
  ------------------
  316|  20.0k|            return W3C_Doctypes[i].si;
  317|       |
  318|      0|    return NULL;
  319|  20.0k|}
lexer.c:NewDocTypeNode:
 1908|  18.9k|{
 1909|  18.9k|    Node* doctype = NULL;
 1910|  18.9k|    Node* html = TY_(FindHTML)( doc );
  ------------------
  |  |   23|  18.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1911|       |
 1912|  18.9k|    if ( !html )
  ------------------
  |  Branch (1912:10): [True: 0, False: 18.9k]
  ------------------
 1913|      0|        return NULL;
 1914|       |
 1915|  18.9k|    doctype = TY_(NewNode)( doc->allocator, NULL );
  ------------------
  |  |   23|  18.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1916|  18.9k|    doctype->type = DocTypeTag;
 1917|  18.9k|    TY_(InsertNodeBeforeElement)(html, doctype);
  ------------------
  |  |   23|  18.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1918|  18.9k|    return doctype;
 1919|  18.9k|}
lexer.c:GetFPIFromVers:
  300|  3.84k|{
  301|  3.84k|    uint i;
  302|       |
  303|  75.1k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (303:17): [True: 71.5k, False: 3.55k]
  ------------------
  304|  71.5k|        if (W3C_Doctypes[i].vers == vers)
  ------------------
  |  Branch (304:13): [True: 281, False: 71.2k]
  ------------------
  305|    281|            return W3C_Doctypes[i].fpi;
  306|       |
  307|  3.55k|    return NULL;
  308|  3.84k|}
lexer.c:GetCDATA:
 2220|  6.05k|{
 2221|  6.05k|    Lexer* lexer = doc->lexer;
 2222|  6.05k|    uint start = 0;
 2223|  6.05k|    int nested = 0;
 2224|  6.05k|    CDATAState state = CDATA_INTERMEDIATE;
 2225|  6.05k|    uint i;
 2226|  6.05k|    Bool isEmpty = yes;
 2227|  6.05k|    Bool matches = no;
 2228|  6.05k|    uint c;
 2229|  6.05k|    Bool hasSrc = (TY_(AttrGetById)(container, TidyAttr_SRC) != NULL) ? yes : no;
  ------------------
  |  |   23|  6.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2229:19): [True: 1.55k, False: 4.50k]
  ------------------
 2230|       |    /*\ Issue #65 (1642186) and #280 - is script or style, and the option on
 2231|       |     *  If yes, then avoid incrementing nested...
 2232|       |    \*/
 2233|  6.05k|    Bool nonested = ((nodeIsSCRIPT(container) || (nodeIsSTYLE(container))) && 
  ------------------
  |  |  422|  6.05k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  12.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.05k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.05k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.70k, False: 4.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  Bool nonested = ((nodeIsSCRIPT(container) || (nodeIsSTYLE(container))) && 
  ------------------
  |  |  421|  4.34k|#define nodeIsSTYLE( node )      TagIsId( node, TidyTag_STYLE )
  |  |  ------------------
  |  |  |  |  275|  4.34k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.34k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.34k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.96k, False: 386]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2234|  5.66k|        cfgBool(doc, TidySkipNested)) ? yes : no;
  ------------------
  |  |  418|  5.66k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.66k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 5.66k, False: 0]
  |  |  ------------------
  ------------------
 2235|       |
 2236|  6.05k|    SetLexerLocus( doc, lexer );
 2237|  6.05k|    lexer->waswhite = no;
 2238|  6.05k|    lexer->txtstart = lexer->txtend = lexer->lexsize;
 2239|       |
 2240|       |    /* seen start tag, look for matching end tag */
 2241|  24.1M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|  24.1M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.1M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|  24.1M|#define EndOfStream (~0u)
  ------------------
  |  Branch (2241:12): [True: 24.1M, False: 594]
  ------------------
 2242|  24.1M|    {
 2243|  24.1M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  24.1M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.1M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2244|  24.1M|        lexer->txtend = lexer->lexsize;
 2245|       |
 2246|  24.1M|        if (state == CDATA_INTERMEDIATE)
  ------------------
  |  Branch (2246:13): [True: 23.5M, False: 546k]
  ------------------
 2247|  23.5M|        {
 2248|  23.5M|            if (c != '<')
  ------------------
  |  Branch (2248:17): [True: 23.5M, False: 28.3k]
  ------------------
 2249|  23.5M|            {
 2250|  23.5M|                if (isEmpty && !TY_(IsWhite)(c))
  ------------------
  |  |   23|  5.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2250:21): [True: 5.65k, False: 23.5M]
  |  Branch (2250:32): [True: 2.47k, False: 3.18k]
  ------------------
 2251|  2.47k|                    isEmpty = no;
 2252|  23.5M|                continue;
 2253|  23.5M|            }
 2254|       |
 2255|  28.3k|            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  28.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2256|       |
 2257|  28.3k|            if (TY_(IsLetter)(c))
  ------------------
  |  |   23|  28.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2257:17): [True: 12.2k, False: 16.0k]
  ------------------
 2258|  12.2k|            {
 2259|       |                /* <head><script src=foo><meta name=foo content=bar>*/
 2260|  12.2k|                if (hasSrc && isEmpty && nodeIsSCRIPT(container))
  ------------------
  |  |  422|  1.72k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  1.72k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.72k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.72k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.51k, False: 205]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2260:21): [True: 1.95k, False: 10.2k]
  |  Branch (2260:31): [True: 1.72k, False: 234]
  ------------------
 2261|  1.51k|                {
 2262|       |                    /* ReportError(doc, container, NULL, MISSING_ENDTAG_FOR); */
 2263|  1.51k|                    lexer->lexsize = lexer->txtstart;
 2264|  1.51k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2265|  1.51k|                    TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|  1.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2266|  1.51k|                    return NULL;
 2267|  1.51k|                }
 2268|  10.7k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  10.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2269|  10.7k|                start = lexer->lexsize - 1;
 2270|  10.7k|                state = CDATA_STARTTAG;
 2271|  10.7k|            }
 2272|  16.0k|            else if (c == '/')
  ------------------
  |  Branch (2272:22): [True: 9.23k, False: 6.85k]
  ------------------
 2273|  9.23k|            {
 2274|  9.23k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  9.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2275|       |
 2276|  9.23k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  9.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2277|       |                
 2278|  9.23k|                if (!TY_(IsLetter)(c))
  ------------------
  |  |   23|  9.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2278:21): [True: 510, False: 8.72k]
  ------------------
 2279|    510|                {
 2280|    510|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    510|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    510|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2281|    510|                    continue;
 2282|    510|                }
 2283|  8.72k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  8.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2284|       |
 2285|  8.72k|                start = lexer->lexsize;
 2286|  8.72k|                state = CDATA_ENDTAG;
 2287|  8.72k|            }
 2288|  6.85k|            else if (c == '\\')
  ------------------
  |  Branch (2288:22): [True: 967, False: 5.88k]
  ------------------
 2289|    967|            {
 2290|       |                /* recognize document.write("<script><\/script>") */
 2291|    967|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|    967|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    967|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2292|       |
 2293|    967|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    967|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    967|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2294|       |
 2295|    967|                if (c != '/')
  ------------------
  |  Branch (2295:21): [True: 254, False: 713]
  ------------------
 2296|    254|                {
 2297|    254|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    254|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    254|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2298|    254|                    continue;
 2299|    254|                }
 2300|       |
 2301|    713|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|    713|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    713|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2302|       |
 2303|    713|                if (nonested) {
  ------------------
  |  Branch (2303:21): [True: 197, False: 516]
  ------------------
 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|    197|                    continue;
 2311|    197|                }
 2312|       |
 2313|    516|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    516|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    516|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2314|       |                
 2315|    516|                if (!TY_(IsLetter)(c))
  ------------------
  |  |   23|    516|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    516|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2315:21): [True: 308, False: 208]
  ------------------
 2316|    308|                {
 2317|    308|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    308|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    308|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2318|    308|                    continue;
 2319|    308|                }
 2320|    208|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    208|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    208|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2321|       |
 2322|    208|                start = lexer->lexsize;
 2323|    208|                state = CDATA_ENDTAG;
 2324|    208|            }
 2325|  5.88k|            else
 2326|  5.88k|            {
 2327|  5.88k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  5.88k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.88k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2328|  5.88k|            }
 2329|  28.3k|        }
 2330|       |        /* '<' + Letter found */
 2331|   546k|        else if (state == CDATA_STARTTAG)
  ------------------
  |  Branch (2331:18): [True: 37.8k, False: 508k]
  ------------------
 2332|  37.8k|        {
 2333|  37.8k|            if (TY_(IsLetter)(c))
  ------------------
  |  |   23|  37.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2333:17): [True: 27.1k, False: 10.6k]
  ------------------
 2334|  27.1k|                continue;
 2335|       |
 2336|  10.6k|            matches = TY_(tmbstrncasecmp)(container->element, lexer->lexbuf + start,
  ------------------
  |  |   23|  10.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2337|  10.6k|                                          TY_(tmbstrlen)(container->element)) == 0;
  ------------------
  |  |   23|  10.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2338|  10.6k|            if (matches && !nonested)
  ------------------
  |  Branch (2338:17): [True: 3.41k, False: 7.26k]
  |  Branch (2338:28): [True: 909, False: 2.51k]
  ------------------
 2339|    909|                nested++;
 2340|       |
 2341|  10.6k|            state = CDATA_INTERMEDIATE;
 2342|  10.6k|        }
 2343|       |        /* '<' + '/' + Letter found */
 2344|   508k|        else if (state == CDATA_ENDTAG)
  ------------------
  |  Branch (2344:18): [True: 508k, False: 0]
  ------------------
 2345|   508k|        {
 2346|   508k|            if (TY_(IsLetter)(c))
  ------------------
  |  |   23|   508k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   508k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2346:17): [True: 499k, False: 8.92k]
  ------------------
 2347|   499k|                continue;
 2348|       |
 2349|  8.92k|            matches = TY_(tmbstrncasecmp)(container->element, lexer->lexbuf + start,
  ------------------
  |  |   23|  8.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2350|  8.92k|                                          TY_(tmbstrlen)(container->element)) == 0;
  ------------------
  |  |   23|  8.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2351|       |
 2352|  8.92k|            if (isEmpty && !matches)
  ------------------
  |  Branch (2352:17): [True: 2.00k, False: 6.91k]
  |  Branch (2352:28): [True: 711, False: 1.29k]
  ------------------
 2353|    711|            {
 2354|       |                /* ReportError(doc, container, NULL, MISSING_ENDTAG_FOR); */
 2355|       |
 2356|  61.1k|                for (i = lexer->lexsize - 1; i >= start; --i)
  ------------------
  |  Branch (2356:46): [True: 60.4k, False: 711]
  ------------------
 2357|  60.4k|                    TY_(UngetChar)((uint)lexer->lexbuf[i], doc->docIn);
  ------------------
  |  |   23|  60.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2358|    711|                TY_(UngetChar)('/', doc->docIn);
  ------------------
  |  |   23|    711|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    711|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2359|    711|                TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|    711|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    711|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2360|    711|                break;
 2361|    711|            }
 2362|       |
 2363|  8.21k|            if (matches && nested-- <= 0)
  ------------------
  |  Branch (2363:17): [True: 3.46k, False: 4.74k]
  |  Branch (2363:28): [True: 3.23k, False: 234]
  ------------------
 2364|  3.23k|            {
 2365|   141k|                for (i = lexer->lexsize - 1; i >= start; --i)
  ------------------
  |  Branch (2365:46): [True: 138k, False: 3.23k]
  ------------------
 2366|   138k|                    TY_(UngetChar)((uint)lexer->lexbuf[i], doc->docIn);
  ------------------
  |  |   23|   138k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   138k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2367|  3.23k|                TY_(UngetChar)('/', doc->docIn);
  ------------------
  |  |   23|  3.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2368|  3.23k|                TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|  3.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2369|  3.23k|                lexer->lexsize -= (lexer->lexsize - start) + 2;
 2370|  3.23k|                break;
 2371|  3.23k|            }
 2372|  4.97k|            else if (lexer->lexbuf[start - 2] != '\\')
  ------------------
  |  Branch (2372:22): [True: 4.77k, False: 206]
  ------------------
 2373|  4.77k|            {
 2374|       |                /* if the end tag is not already escaped using backslash */
 2375|  4.77k|                SetLexerLocus( doc, lexer );
 2376|  4.77k|                lexer->columns -= 3;
 2377|       |
 2378|       |                /*\ if javascript insert backslash before / 
 2379|       |                 *  Issue #348 - Add option, escape-scripts, to skip
 2380|       |                \*/
 2381|  4.77k|                if ((TY_(IsJavaScript)(container)) && cfgBool(doc, TidyEscapeScripts) &&
  ------------------
  |  |   23|  4.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ((TY_(IsJavaScript)(container)) && cfgBool(doc, TidyEscapeScripts) &&
  ------------------
  |  |  418|  7.21k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.44k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 2.44k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2381:21): [True: 2.44k, False: 2.32k]
  ------------------
 2382|  2.44k|                    !TY_(IsHTML5Mode)(doc) )    /* Is #700 - This only applies to legacy html4 mode */
  ------------------
  |  |   23|  2.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2382:21): [True: 938, False: 1.50k]
  ------------------
 2383|    938|                {
 2384|       |                    /* Issue #281 - only warn if adding the escape! */
 2385|    938|                    TY_(Report)(doc, NULL, NULL, BAD_CDATA_CONTENT);
  ------------------
  |  |   23|    938|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    938|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2386|       |
 2387|   297k|                    for (i = lexer->lexsize; i > start-1; --i)
  ------------------
  |  Branch (2387:46): [True: 296k, False: 938]
  ------------------
 2388|   296k|                        lexer->lexbuf[i] = lexer->lexbuf[i-1];
 2389|       |
 2390|    938|                    lexer->lexbuf[start-1] = '\\';
 2391|    938|                    lexer->lexsize++;
 2392|    938|                }
 2393|  4.77k|            }
 2394|  4.97k|            state = CDATA_INTERMEDIATE;
 2395|  4.97k|        }
 2396|  24.1M|    }
 2397|  4.53k|    if (isEmpty)
  ------------------
  |  Branch (2397:9): [True: 2.06k, False: 2.47k]
  ------------------
 2398|  2.06k|        lexer->lexsize = lexer->txtstart = lexer->txtend;
 2399|  2.47k|    else
 2400|  2.47k|        lexer->txtend = lexer->lexsize;
 2401|       |
 2402|  4.53k|    if (c == EndOfStream)
  ------------------
  |  | 1064|  4.53k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2402:9): [True: 594, False: 3.94k]
  ------------------
 2403|    594|        TY_(Report)(doc, container, NULL, MISSING_ENDTAG_FOR );
  ------------------
  |  |   23|    594|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    594|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2404|       |
 2405|  4.53k|    return TY_(TextToken)(lexer);
  ------------------
  |  |   23|  4.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2406|  6.05k|}
lexer.c:SetLexerLocus:
 1007|  7.90M|{
 1008|  7.90M|    lexer->lines = doc->docIn->curline;
 1009|  7.90M|    lexer->columns = doc->docIn->curcol;
 1010|  7.90M|}
lexer.c:GetTokenFromStream:
 2512|  3.21M|{
 2513|  3.21M|    Lexer* lexer = doc->lexer;
 2514|  3.21M|    uint c, lexdump, badcomment = 0;
 2515|  3.21M|    Bool isempty = no;
 2516|  3.21M|    AttVal *attributes = NULL;
 2517|  3.21M|    Node *node;
 2518|  3.21M|    Bool fixComments;
 2519|       |    
 2520|  3.21M|    switch ( cfgAutoBool(doc, TidyFixComments) )
  ------------------
  |  |  421|  3.21M|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.21M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2521|  3.21M|    {
 2522|      0|        case TidyYesState:
  ------------------
  |  Branch (2522:9): [True: 0, False: 3.21M]
  ------------------
 2523|      0|            fixComments = yes;
 2524|      0|            break;
 2525|       |
 2526|      0|        case TidyNoState:
  ------------------
  |  Branch (2526:9): [True: 0, False: 3.21M]
  ------------------
 2527|      0|            fixComments = no;
 2528|      0|            break;
 2529|       |
 2530|  3.21M|        default:
  ------------------
  |  Branch (2530:9): [True: 3.21M, False: 0]
  ------------------
 2531|  3.21M|            fixComments = (TY_(HTMLVersion)(doc) & HT50) == 0;
  ------------------
  |  |   23|  3.21M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.21M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          fixComments = (TY_(HTMLVersion)(doc) & HT50) == 0;
  ------------------
  |  |  200|  3.21M|#define HT50              131072u
  ------------------
 2532|  3.21M|            break;
 2533|  3.21M|    }
 2534|       |
 2535|       |    /* Lexer->token must be set on return. Nullify it for safety. */
 2536|  3.21M|    lexer->token = NULL;
 2537|       |
 2538|  3.21M|    SetLexerLocus( doc, lexer );
 2539|  3.21M|    lexer->waswhite = no;
 2540|       |
 2541|  3.21M|    lexer->txtstart = lexer->txtend = lexer->lexsize;
 2542|       |
 2543|   262M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|   262M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   262M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|   262M|#define EndOfStream (~0u)
  ------------------
  |  Branch (2543:12): [True: 260M, False: 1.59M]
  ------------------
 2544|   260M|    {
 2545|   260M|        if (lexer->insertspace)
  ------------------
  |  Branch (2545:13): [True: 1.16k, False: 260M]
  ------------------
 2546|  1.16k|        {
 2547|  1.16k|            TY_(AddCharToLexer)(lexer, ' ');
  ------------------
  |  |   23|  1.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2548|  1.16k|            lexer->waswhite = yes;
 2549|  1.16k|            lexer->insertspace = no;
 2550|  1.16k|        }
 2551|       |
 2552|   260M|        if (c == 160 && (mode == Preformatted))
  ------------------
  |  Branch (2552:13): [True: 841, False: 260M]
  |  Branch (2552:25): [True: 220, False: 621]
  ------------------
 2553|    220|            c = ' ';
 2554|       |
 2555|   260M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   260M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   260M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2556|       |
 2557|   260M|        switch (lexer->state)
  ------------------
  |  Branch (2557:17): [True: 260M, False: 0]
  ------------------
 2558|   260M|        {
 2559|   152M|            case LEX_CONTENT:  /* element content */
  ------------------
  |  Branch (2559:13): [True: 152M, False: 108M]
  ------------------
 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|   152M|                if (TY_(IsWhite)(c) && (mode == IgnoreWhitespace) 
  ------------------
  |  |   23|   152M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   152M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2566:21): [True: 139M, False: 12.7M]
  |  Branch (2566:40): [True: 1.24M, False: 138M]
  ------------------
 2567|  1.24M|                      && lexer->lexsize == lexer->txtstart + 1)
  ------------------
  |  Branch (2567:26): [True: 1.06M, False: 178k]
  ------------------
 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|   151M|                if (c == '<')
  ------------------
  |  Branch (2575:21): [True: 1.58M, False: 149M]
  ------------------
 2576|  1.58M|                {
 2577|  1.58M|                    lexer->state = LEX_GT;
 2578|  1.58M|                    continue;
 2579|  1.58M|                }
 2580|       |
 2581|   149M|                if (TY_(IsWhite)(c))
  ------------------
  |  |   23|   149M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   149M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2581:21): [True: 138M, False: 11.1M]
  ------------------
 2582|   138M|                {
 2583|       |                    /* was previous character white? */
 2584|   138M|                    if (lexer->waswhite)
  ------------------
  |  Branch (2584:25): [True: 138M, False: 330k]
  ------------------
 2585|   138M|                    {
 2586|   138M|                        if (mode != Preformatted && mode != IgnoreMarkup)
  ------------------
  |  Branch (2586:29): [True: 3.40M, False: 135M]
  |  Branch (2586:53): [True: 3.40M, False: 0]
  ------------------
 2587|  3.40M|                        {
 2588|  3.40M|                            --(lexer->lexsize);
 2589|  3.40M|                            SetLexerLocus( doc, lexer );
 2590|  3.40M|                        }
 2591|   138M|                    }
 2592|   330k|                    else /* prev character wasn't white */
 2593|   330k|                    {
 2594|   330k|                        lexer->waswhite = yes;
 2595|       |
 2596|   330k|                        if (mode != Preformatted && mode != IgnoreMarkup && c != ' ')
  ------------------
  |  Branch (2596:29): [True: 156k, False: 173k]
  |  Branch (2596:53): [True: 156k, False: 0]
  |  Branch (2596:77): [True: 40.4k, False: 116k]
  ------------------
 2597|  40.4k|                            ChangeChar(lexer, ' ');
 2598|   330k|                    }
 2599|       |
 2600|   138M|                    continue;
 2601|   138M|                }
 2602|  11.1M|                else if (c == '&' && mode != IgnoreMarkup)
  ------------------
  |  Branch (2602:26): [True: 206k, False: 10.9M]
  |  Branch (2602:38): [True: 206k, False: 0]
  ------------------
 2603|   206k|                    ParseEntity( doc, mode );
 2604|       |
 2605|       |                /* this is needed to avoid trimming trailing whitespace */
 2606|  11.1M|                if (mode == IgnoreWhitespace)
  ------------------
  |  Branch (2606:21): [True: 49.3k, False: 11.1M]
  ------------------
 2607|  49.3k|                    mode = MixedContent;
 2608|       |
 2609|  11.1M|                lexer->waswhite = no;
 2610|  11.1M|                continue;
 2611|       |
 2612|  1.58M|            case LEX_GT:  /* < */
  ------------------
  |  Branch (2612:13): [True: 1.58M, False: 259M]
  ------------------
 2613|       |
 2614|       |                /* check for endtag */
 2615|  1.58M|                if (c == '/')
  ------------------
  |  Branch (2615:21): [True: 124k, False: 1.46M]
  ------------------
 2616|   124k|                {
 2617|   124k|                    if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|   124k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   124k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|   124k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2617:25): [True: 28, False: 124k]
  ------------------
 2618|     28|                    {
 2619|     28|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     28|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     28|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2620|     28|                        continue;
 2621|     28|                    }
 2622|       |
 2623|   124k|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   124k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   124k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2624|       |
 2625|   124k|                    if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|   124k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   124k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |  418|  72.0k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  36.0k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 36.0k]
  |  |  ------------------
  ------------------
                                  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: 88.1k, False: 36.0k]
  |  Branch (2625:75): [True: 0, False: 0]
  ------------------
 2626|  88.1k|                    {
 2627|  88.1k|                        lexer->lexsize -= 3;
 2628|  88.1k|                        lexer->txtend = lexer->lexsize;
 2629|  88.1k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  88.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  88.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2630|  88.1k|                        lexer->state = LEX_ENDTAG;
 2631|  88.1k|                        lexer->lexbuf[lexer->lexsize] = '\0';  /* debug */
 2632|  88.1k|                        doc->docIn->curcol -= 2;
 2633|       |
 2634|       |                        /* if some text before the </ return it now */
 2635|  88.1k|                        if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (2635:29): [True: 13.6k, False: 74.4k]
  ------------------
 2636|  13.6k|                        {
 2637|       |                            /* trim space character before end tag */
 2638|  13.6k|                            if (mode == IgnoreWhitespace && lexer->lexbuf[lexer->lexsize - 1] == ' ')
  ------------------
  |  Branch (2638:33): [True: 1.14k, False: 12.5k]
  |  Branch (2638:61): [True: 395, False: 750]
  ------------------
 2639|    395|                            {
 2640|    395|                                lexer->lexsize -= 1;
 2641|    395|                                lexer->txtend = lexer->lexsize;
 2642|    395|                            }
 2643|  13.6k|                            lexer->token = TY_(TextToken)(lexer);
  ------------------
  |  |   23|  13.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2644|  13.6k|                            node = lexer->token;
 2645|  13.6k|                            GTDBG(doc,"text", node);
 2646|  13.6k|                            return node;
 2647|  13.6k|                        }
 2648|       |
 2649|  74.4k|                        continue;       /* no text so keep going */
 2650|  88.1k|                    }
 2651|       |
 2652|       |                    /* otherwise treat as CDATA */
 2653|  36.0k|                    lexer->waswhite = no;
 2654|  36.0k|                    lexer->state = LEX_CONTENT;
 2655|  36.0k|                    continue;
 2656|   124k|                }
 2657|       |
 2658|  1.46M|                if (mode == IgnoreMarkup)
  ------------------
  |  Branch (2658:21): [True: 0, False: 1.46M]
  ------------------
 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.46M|                if (c == '!')
  ------------------
  |  Branch (2670:21): [True: 170k, False: 1.29M]
  ------------------
 2671|   170k|                {
 2672|   170k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   170k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   170k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2673|       |
 2674|   170k|                    if (c == '-')
  ------------------
  |  Branch (2674:25): [True: 38.7k, False: 131k]
  ------------------
 2675|  38.7k|                    {
 2676|  38.7k|                        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  38.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2677|       |
 2678|  38.7k|                        if (c == '-')
  ------------------
  |  Branch (2678:29): [True: 36.8k, False: 1.87k]
  ------------------
 2679|  36.8k|                        {
 2680|  36.8k|                            lexer->state = LEX_COMMENT;  /* comment */
 2681|  36.8k|                            lexer->lexsize -= 2;
 2682|  36.8k|                            lexer->txtend = lexer->lexsize;
 2683|       |
 2684|  36.8k|                            CondReturnTextNode(doc, 4)
  ------------------
  |  | 2424|  36.8k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 2.41k, False: 34.4k]
  |  |  ------------------
  |  | 2425|  36.8k|            { \
  |  | 2426|  2.41k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  2.41k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  2.41k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  2.41k|                return lexer->token; \
  |  | 2428|  2.41k|            }
  ------------------
 2685|       |
 2686|  34.4k|                            lexer->txtstart = lexer->lexsize;
 2687|  34.4k|                            continue;
 2688|  36.8k|                        }
 2689|       |
 2690|       |                        /*
 2691|       |                           TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_DROPPING );
 2692|       |                           Warning now done later - see issue #487
 2693|       |                         */
 2694|  38.7k|                    }
 2695|   131k|                    else if (c == 'd' || c == 'D')
  ------------------
  |  Branch (2695:30): [True: 19.6k, False: 111k]
  |  Branch (2695:42): [True: 26.8k, False: 85.0k]
  ------------------
 2696|  46.5k|                    {
 2697|       |                        /* todo: check for complete "<!DOCTYPE" not just <!D */
 2698|       |
 2699|  46.5k|                        uint skip = 0;
 2700|       |
 2701|  46.5k|                        lexer->state = LEX_DOCTYPE; /* doctype */
 2702|  46.5k|                        lexer->lexsize -= 2;
 2703|  46.5k|                        lexer->txtend = lexer->lexsize;
 2704|  46.5k|                        mode = IgnoreWhitespace;
 2705|       |
 2706|       |                        /* skip until white space or '>' */
 2707|       |
 2708|  46.5k|                        for (;;)
 2709|  61.6k|                        {
 2710|  61.6k|                            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  61.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  61.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2711|  61.6k|                            ++skip;
 2712|       |
 2713|  61.6k|                            if (c == EndOfStream || c == '>')
  ------------------
  |  | 1064|   123k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2713:33): [True: 72, False: 61.6k]
  |  Branch (2713:53): [True: 20.6k, False: 40.9k]
  ------------------
 2714|  20.6k|                            {
 2715|  20.6k|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2716|  20.6k|                                break;
 2717|  20.6k|                            }
 2718|       |
 2719|       |
 2720|  40.9k|                            if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|  40.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2720:33): [True: 15.1k, False: 25.8k]
  ------------------
 2721|  15.1k|                                continue;
 2722|       |
 2723|       |                            /* and skip to end of whitespace */
 2724|       |
 2725|  25.8k|                            for (;;)
 2726|  73.6k|                            {
 2727|  73.6k|                                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  73.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2728|  73.6k|                                ++skip;
 2729|       |
 2730|  73.6k|                                if (c == EndOfStream || c == '>')
  ------------------
  |  | 1064|   147k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2730:37): [True: 25, False: 73.6k]
  |  Branch (2730:57): [True: 1.25k, False: 72.3k]
  ------------------
 2731|  1.27k|                                {
 2732|  1.27k|                                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2733|  1.27k|                                    break;
 2734|  1.27k|                                }
 2735|       |
 2736|       |
 2737|  72.3k|                                if (TY_(IsWhite)(c))
  ------------------
  |  |   23|  72.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  72.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2737:37): [True: 47.7k, False: 24.5k]
  ------------------
 2738|  47.7k|                                    continue;
 2739|       |
 2740|  24.5k|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  24.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2741|  24.5k|                                break;
 2742|  72.3k|                            }
 2743|       |
 2744|  25.8k|                            break;
 2745|  40.9k|                        }
 2746|       |
 2747|  46.5k|                        CondReturnTextNode(doc, (skip + 3))
  ------------------
  |  | 2424|  46.5k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 11.2k, False: 35.3k]
  |  |  ------------------
  |  | 2425|  46.5k|            { \
  |  | 2426|  11.2k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  11.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  11.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  11.2k|                return lexer->token; \
  |  | 2428|  11.2k|            }
  ------------------
 2748|       |
 2749|  35.3k|                        lexer->txtstart = lexer->lexsize;
 2750|  35.3k|                        continue;
 2751|  46.5k|                    }
 2752|  85.0k|                    else if (c == '[')
  ------------------
  |  Branch (2752:30): [True: 82.0k, False: 3.01k]
  ------------------
 2753|  82.0k|                    {
 2754|       |                        /* Word 2000 embeds <![if ...]> ... <![endif]> sequences */
 2755|  82.0k|                        lexer->lexsize -= 2;
 2756|  82.0k|                        lexer->state = LEX_SECTION;
 2757|  82.0k|                        lexer->txtend = lexer->lexsize;
 2758|       |
 2759|  82.0k|                        CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  82.0k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 12.1k, False: 69.8k]
  |  |  ------------------
  |  | 2425|  82.0k|            { \
  |  | 2426|  12.1k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  12.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  12.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  12.1k|                return lexer->token; \
  |  | 2428|  12.1k|            }
  ------------------
 2760|       |
 2761|  69.8k|                        lexer->txtstart = lexer->lexsize;
 2762|  69.8k|                        continue;
 2763|  82.0k|                    }
 2764|       |
 2765|       |
 2766|       |                    /*
 2767|       |                       We only print this message if there's a missing
 2768|       |                       starting hyphen; this comment will be dropped.
 2769|       |                     */
 2770|  4.89k|                    TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_DROPPING ); /* Is. #487 */
  ------------------
  |  |   23|  4.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2771|       |
 2772|       |                    /* else swallow characters up to and including next '>' */
 2773|  47.0k|                    while ((c = TY_(ReadChar)(doc->docIn)) != '>')
  ------------------
  |  |   23|  47.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  47.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2773:28): [True: 42.3k, False: 4.73k]
  ------------------
 2774|  42.3k|                    {
 2775|  42.3k|                        if (c == EndOfStream)
  ------------------
  |  | 1064|  42.3k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2775:29): [True: 153, False: 42.1k]
  ------------------
 2776|    153|                        {
 2777|    153|                            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    153|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    153|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2778|    153|                            break;
 2779|    153|                        }
 2780|  42.3k|                    }
 2781|       |
 2782|  4.89k|                    lexer->lexsize -= 2;
 2783|  4.89k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 2784|  4.89k|                    lexer->state = LEX_CONTENT;
 2785|  4.89k|                    continue;
 2786|   170k|                }
 2787|       |
 2788|       |                /*
 2789|       |                   processing instructions
 2790|       |                */
 2791|       |
 2792|  1.29M|                if (c == '?')
  ------------------
  |  Branch (2792:21): [True: 55.3k, False: 1.23M]
  ------------------
 2793|  55.3k|                {
 2794|  55.3k|                    lexer->lexsize -= 2;
 2795|  55.3k|                    lexer->state = LEX_PROCINSTR;
 2796|  55.3k|                    lexer->txtend = lexer->lexsize;
 2797|       |
 2798|  55.3k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  55.3k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 36.8k, False: 18.5k]
  |  |  ------------------
  |  | 2425|  55.3k|            { \
  |  | 2426|  36.8k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  36.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  36.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  36.8k|                return lexer->token; \
  |  | 2428|  36.8k|            }
  ------------------
 2799|       |
 2800|  18.5k|                    lexer->txtstart = lexer->lexsize;
 2801|  18.5k|                    continue;
 2802|  55.3k|                }
 2803|       |
 2804|       |                /* Microsoft ASP's e.g. <% ... server-code ... %> */
 2805|  1.23M|                if (c == '%')
  ------------------
  |  Branch (2805:21): [True: 38.5k, False: 1.19M]
  ------------------
 2806|  38.5k|                {
 2807|  38.5k|                    lexer->lexsize -= 2;
 2808|  38.5k|                    lexer->state = LEX_ASP;
 2809|  38.5k|                    lexer->txtend = lexer->lexsize;
 2810|       |
 2811|  38.5k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  38.5k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 611, False: 37.9k]
  |  |  ------------------
  |  | 2425|  38.5k|            { \
  |  | 2426|    611|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|    611|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    611|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|    611|                return lexer->token; \
  |  | 2428|    611|            }
  ------------------
 2812|       |
 2813|  37.9k|                    lexer->txtstart = lexer->lexsize;
 2814|  37.9k|                    continue;
 2815|  38.5k|                }
 2816|       |
 2817|       |                /* Netscapes JSTE e.g. <# ... server-code ... #> */
 2818|  1.19M|                if (c == '#')
  ------------------
  |  Branch (2818:21): [True: 39.5k, False: 1.15M]
  ------------------
 2819|  39.5k|                {
 2820|  39.5k|                    lexer->lexsize -= 2;
 2821|  39.5k|                    lexer->state = LEX_JSTE;
 2822|  39.5k|                    lexer->txtend = lexer->lexsize;
 2823|       |
 2824|  39.5k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  39.5k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 1.03k, False: 38.4k]
  |  |  ------------------
  |  | 2425|  39.5k|            { \
  |  | 2426|  1.03k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  1.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  1.03k|                return lexer->token; \
  |  | 2428|  1.03k|            }
  ------------------
 2825|       |
 2826|  38.4k|                    lexer->txtstart = lexer->lexsize;
 2827|  38.4k|                    continue;
 2828|  39.5k|                }
 2829|       |
 2830|       |                /* check for start tag */
 2831|  1.15M|                if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|  1.15M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.15M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |  418|   257k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   128k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 128k]
  |  |  ------------------
  ------------------
                              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: 1.02M, False: 128k]
  |  Branch (2831:71): [True: 0, False: 0]
  ------------------
 2832|  1.02M|                {
 2833|  1.02M|                    TY_(UngetChar)(c, doc->docIn);     /* push back letter */
  ------------------
  |  |   23|  1.02M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2834|  1.02M|                    TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|  1.02M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2835|  1.02M|                    lexer->lexsize -= 2;      /* discard "<" + letter */
 2836|  1.02M|                    lexer->txtend = lexer->lexsize;
 2837|  1.02M|                    lexer->state = LEX_STARTTAG;         /* ready to read tag name */
 2838|       |
 2839|  1.02M|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  1.02M|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 131k, False: 898k]
  |  |  ------------------
  |  | 2425|  1.02M|            { \
  |  | 2426|   131k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|   131k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   131k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|   131k|                return lexer->token; \
  |  | 2428|   131k|            }
  ------------------
 2840|       |
 2841|       |                    /* lexer->txtstart = lexer->lexsize; missing here? */
 2842|   898k|                    continue;       /* no text so keep going */
 2843|  1.02M|                }
 2844|       |
 2845|       |                /* otherwise treat as CDATA */
 2846|       |                /* fix for bug 762102 (486) */
 2847|       |                /* Issue #384 - Fix skipping parsing character, particularly '<<' */
 2848|   128k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   128k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   128k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2849|   128k|                lexer->lexsize -= 1;
 2850|   128k|                lexer->state = LEX_CONTENT;
 2851|   128k|                lexer->waswhite = no;
 2852|   128k|                continue;
 2853|       |
 2854|  88.8k|            case LEX_ENDTAG:  /* </letter */
  ------------------
  |  Branch (2854:13): [True: 88.8k, False: 260M]
  ------------------
 2855|  88.8k|                lexer->txtstart = lexer->lexsize - 1;
 2856|  88.8k|                doc->docIn->curcol += 2;
 2857|  88.8k|                c = ParseTagName( doc );
 2858|  88.8k|                lexer->token = TagToken( doc, EndTag );  /* create endtag token */
 2859|  88.8k|                lexer->lexsize = lexer->txtend = lexer->txtstart;
 2860|       |
 2861|       |                /* skip to '>' */
 2862|   463k|                while ( c != '>' && c != EndOfStream )
  ------------------
  |  | 1064|   375k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2862:25): [True: 375k, False: 87.8k]
  |  Branch (2862:37): [True: 374k, False: 982]
  ------------------
 2863|   374k|                {
 2864|   374k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   374k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   374k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2865|   374k|                }
 2866|       |
 2867|  88.8k|                if (c == EndOfStream)
  ------------------
  |  | 1064|  88.8k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2867:21): [True: 982, False: 87.8k]
  ------------------
 2868|    982|                {
 2869|    982|                    TY_(FreeNode)( doc, lexer->token );
  ------------------
  |  |   23|    982|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    982|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2870|    982|                    continue;
 2871|    982|                }
 2872|       |
 2873|  87.8k|                lexer->state = LEX_CONTENT;
 2874|  87.8k|                lexer->waswhite = no;
 2875|  87.8k|                node = lexer->token;
 2876|  87.8k|                GTDBG(doc,"endtag", node);
 2877|  87.8k|                return node;  /* the endtag token */
 2878|       |
 2879|  1.02M|            case LEX_STARTTAG: /* first letter of tagname */
  ------------------
  |  Branch (2879:13): [True: 1.02M, False: 259M]
  ------------------
 2880|  1.02M|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.02M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2881|  1.02M|                ChangeChar(lexer, (tmbchar)c);
 2882|  1.02M|                lexer->txtstart = lexer->lexsize - 1; /* set txtstart to first letter */
 2883|  1.02M|                c = ParseTagName( doc );
 2884|  1.02M|                isempty = no;
 2885|  1.02M|                attributes = NULL;
 2886|  1.02M|                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|  1.02M|                if (c != '>')
  ------------------
  |  Branch (2889:21): [True: 345k, False: 683k]
  ------------------
 2890|   345k|                {
 2891|   345k|                    if (c == '/')
  ------------------
  |  Branch (2891:25): [True: 7.93k, False: 338k]
  ------------------
 2892|  7.93k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  7.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2893|       |
 2894|   345k|                    attributes = ParseAttrs( doc, &isempty );
 2895|   345k|                }
 2896|       |
 2897|  1.02M|                if (isempty)
  ------------------
  |  Branch (2897:21): [True: 18.7k, False: 1.01M]
  ------------------
 2898|  18.7k|                    lexer->token->type = StartEndTag;
 2899|       |
 2900|  1.02M|                lexer->token->attributes = attributes;
 2901|  1.02M|                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|  1.02M|                if ( nodeIsPRE(lexer->token) )
  ------------------
  |  |  383|  1.02M|#define nodeIsPRE( node )        TagIsId( node, TidyTag_PRE )
  |  |  ------------------
  |  |  |  |  275|  1.02M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.02M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 901k, False: 128k]
  |  |  |  |  |  Branch (275:54): [True: 79.8k, False: 821k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2914|  79.8k|                {
 2915|  79.8k|                    mode = Preformatted;
 2916|  79.8k|                }
 2917|       |
 2918|  1.02M|                if ((mode != Preformatted && ExpectsContent(lexer->token))
  ------------------
  |  Branch (2918:22): [True: 897k, False: 132k]
  |  Branch (2918:46): [True: 849k, False: 48.4k]
  ------------------
 2919|  1.02M|                    || nodeIsBR(lexer->token) || nodeIsHR(lexer->token))
  ------------------
  |  |  400|   180k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  1.21M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 180k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 174k, False: 6.19k]
  |  |  |  |  |  Branch (275:54): [True: 2.83k, False: 171k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  || nodeIsBR(lexer->token) || nodeIsHR(lexer->token))
  ------------------
  |  |  380|   177k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|   177k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 177k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 171k, False: 6.19k]
  |  |  |  |  |  Branch (275:54): [True: 7.43k, False: 164k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2920|   859k|                {
 2921|   859k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   859k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   859k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2922|       |
 2923|   859k|                    if ((c == '\n') && (mode != IgnoreWhitespace)) /* Issue #329 - Can NOT afford to lose this newline */
  ------------------
  |  Branch (2923:25): [True: 6.30k, False: 853k]
  |  Branch (2923:40): [True: 5.94k, False: 361]
  ------------------
 2924|  5.94k|                        TY_(UngetChar)(c, doc->docIn);  /* Issue #329 - make sure the newline is maintained for now */
  ------------------
  |  |   23|  5.94k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.94k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2925|   853k|                    else if (c != '\n' && c != '\f')
  ------------------
  |  Branch (2925:30): [True: 853k, False: 361]
  |  Branch (2925:43): [True: 853k, False: 0]
  ------------------
 2926|   853k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   853k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   853k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2927|       |
 2928|   859k|                    lexer->waswhite = yes;  /* to swallow leading whitespace */
 2929|   859k|                }
 2930|   170k|                else
 2931|   170k|                    lexer->waswhite = no;
 2932|       |
 2933|  1.02M|                lexer->state = LEX_CONTENT;
 2934|  1.02M|                if (lexer->token->tag == NULL) 
  ------------------
  |  Branch (2934:21): [True: 128k, False: 901k]
  ------------------
 2935|   128k|                {
 2936|   128k|                    if (mode != OtherNamespace) /* [i_a]2 only issue warning if NOT 'OtherNamespace', and tag null */
  ------------------
  |  Branch (2936:25): [True: 122k, False: 5.66k]
  ------------------
 2937|   122k|                    {
 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|   122k|                        if ( (doc->lexer->doctype & VERS_HTML5) > 0 && TY_(elementIsAutonomousCustomFormat)( lexer->token->element ) )
  ------------------
  |  |  213|   122k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|   122k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|   122k|#define XH50              262144u
  |  |  ------------------
  ------------------
                                      if ( (doc->lexer->doctype & VERS_HTML5) > 0 && TY_(elementIsAutonomousCustomFormat)( lexer->token->element ) )
  ------------------
  |  |   23|  34.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2943:30): [True: 34.0k, False: 88.5k]
  |  Branch (2943:72): [True: 32.9k, False: 1.10k]
  ------------------
 2944|  32.9k|                            TY_(Report)( doc, NULL, lexer->token, UNKNOWN_ELEMENT_LOOKS_CUSTOM );
  ------------------
  |  |   23|  32.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2945|  89.6k|                        else
 2946|  89.6k|                            TY_(Report)( doc, NULL, lexer->token, UNKNOWN_ELEMENT );
  ------------------
  |  |   23|  89.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  89.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2947|   122k|                    }
 2948|   128k|                }
 2949|   901k|                else if ( !cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|   901k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   901k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2949:27): [True: 901k, False: 0]
  ------------------
 2950|   901k|                {
 2951|   901k|                    TY_(ConstrainVersion)( doc, lexer->token->tag->versions );
  ------------------
  |  |   23|   901k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   901k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2952|   901k|                    TY_(RepairDuplicateAttributes)( doc, lexer->token, no );
  ------------------
  |  |   23|   901k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   901k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2953|   901k|                } 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|  1.02M|                node = lexer->token;
 2956|  1.02M|                GTDBG(doc,"starttag", node);
 2957|  1.02M|                return node;  /* return start tag */
 2958|       |
 2959|  4.32M|            case LEX_COMMENT:  /* seen <!-- so look for --> */
  ------------------
  |  Branch (2959:13): [True: 4.32M, False: 256M]
  ------------------
 2960|       |
 2961|  4.32M|                if (c != '-')
  ------------------
  |  Branch (2961:21): [True: 4.25M, False: 64.3k]
  ------------------
 2962|  4.25M|                    continue;
 2963|       |
 2964|  64.3k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  64.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  64.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2965|       |
 2966|       |                /* Fix hyphens at beginning of tag */
 2967|  64.3k|                if ( c != '-' && fixComments && lexer->lexsize - lexer->txtstart == 1 )
  ------------------
  |  Branch (2967:22): [True: 7.27k, False: 57.0k]
  |  Branch (2967:34): [True: 7.27k, False: 0]
  |  Branch (2967:49): [True: 6.23k, False: 1.04k]
  ------------------
 2968|  6.23k|                {
 2969|  6.23k|                    lexer->lexbuf[lexer->lexsize - 1] = '=';
 2970|  6.23k|                }
 2971|       |
 2972|  64.3k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  64.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  64.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2973|       |
 2974|  64.3k|                if (c != '-')
  ------------------
  |  Branch (2974:21): [True: 7.27k, False: 57.0k]
  ------------------
 2975|  7.27k|                    continue;
 2976|       |
 2977|  1.22M|            end_comment:
 2978|  1.22M|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.22M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.22M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2979|       |
 2980|  1.22M|                if (c == '>')
  ------------------
  |  Branch (2980:21): [True: 36.6k, False: 1.19M]
  ------------------
 2981|  36.6k|                {
 2982|  36.6k|                    if (badcomment)
  ------------------
  |  Branch (2982:25): [True: 2.83k, False: 33.8k]
  ------------------
 2983|  2.83k|                    {
 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|  2.83k|                        if ( (TY_(HTMLVersion)(doc) & HT50) )
  ------------------
  |  |   23|  2.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                      if ( (TY_(HTMLVersion)(doc) & HT50) )
  ------------------
  |  |  200|  2.83k|#define HT50              131072u
  ------------------
  |  Branch (2989:30): [True: 0, False: 2.83k]
  ------------------
 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|  2.83k|                        else
 2996|  2.83k|                        {
 2997|  2.83k|                            if ( fixComments )
  ------------------
  |  Branch (2997:34): [True: 2.83k, False: 0]
  ------------------
 2998|  2.83k|                                TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT );
  ------------------
  |  |   23|  2.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.83k|#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|  2.83k|                        }
 3002|  2.83k|                    }
 3003|       |
 3004|       |                    /* do not store closing -- in lexbuf */
 3005|  36.6k|                    lexer->lexsize -= 2;
 3006|  36.6k|                    lexer->txtend = lexer->lexsize;
 3007|  36.6k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3008|  36.6k|                    lexer->state = LEX_CONTENT;
 3009|  36.6k|                    lexer->waswhite = no;
 3010|  36.6k|                    lexer->token = CommentToken(doc);
  ------------------
  |  | 1611|  36.6k|#define CommentToken(doc) NewToken(doc, CommentTag)
  ------------------
 3011|       |
 3012|       |                    /* now look for a line break */
 3013|       |
 3014|  36.6k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  36.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3015|       |
 3016|  36.6k|                    if (c == '\n')
  ------------------
  |  Branch (3016:25): [True: 889, False: 35.7k]
  ------------------
 3017|    889|                        lexer->token->linebreak = yes;
 3018|  35.7k|                    else
 3019|  35.7k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  35.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3020|       |
 3021|  36.6k|                    node = lexer->token;
 3022|  36.6k|                    GTDBG(doc,"comment", node);
 3023|  36.6k|                    return node;
 3024|  36.6k|                }
 3025|       |
 3026|       |                /* note position of first such error in the comment */
 3027|  1.19M|                if (!badcomment)
  ------------------
  |  Branch (3027:21): [True: 2.91k, False: 1.18M]
  ------------------
 3028|  2.91k|                {
 3029|  2.91k|                    SetLexerLocus( doc, lexer );
 3030|  2.91k|                    lexer->columns -= 3;
 3031|  2.91k|                }
 3032|       |
 3033|  1.19M|                badcomment++;
 3034|       |
 3035|       |                /* fix hyphens in the middle */
 3036|  1.19M|                if ( fixComments )
  ------------------
  |  Branch (3036:22): [True: 1.19M, False: 0]
  ------------------
 3037|  1.19M|                    lexer->lexbuf[lexer->lexsize - 2] = '=';
 3038|       |
 3039|       |                /* if '-' then look for '>' to end the comment */
 3040|  1.19M|                if (c == '-')
  ------------------
  |  Branch (3040:21): [True: 1.17M, False: 20.3k]
  ------------------
 3041|  1.17M|                {
 3042|  1.17M|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  1.17M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.17M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3043|  1.17M|                    goto end_comment;
 3044|  1.17M|                }
 3045|       |
 3046|       |                /* fix hyphens end, and continue to look for --> */
 3047|  20.3k|                if ( fixComments )
  ------------------
  |  Branch (3047:22): [True: 20.3k, False: 0]
  ------------------
 3048|  20.3k|                    lexer->lexbuf[lexer->lexsize - 1] = '=';
 3049|       |
 3050|       |                /* http://tidy.sf.net/bug/1266647 */
 3051|  20.3k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  20.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3052|       |
 3053|  20.3k|                continue; 
 3054|       |
 3055|  46.4k|            case LEX_DOCTYPE:  /* seen <!d so look for '>' munging whitespace */
  ------------------
  |  Branch (3055:13): [True: 46.4k, False: 260M]
  ------------------
 3056|       |
 3057|       |                /* use ParseDocTypeDecl() to tokenize doctype declaration */
 3058|  46.4k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  46.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3059|  46.4k|                lexer->lexsize -= 1;
 3060|  46.4k|                lexer->token = ParseDocTypeDecl(doc);
 3061|       |
 3062|  46.4k|                lexer->txtend = lexer->lexsize;
 3063|  46.4k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3064|  46.4k|                lexer->state = LEX_CONTENT;
 3065|  46.4k|                lexer->waswhite = no;
 3066|       |
 3067|       |                /* make a note of the version named by the 1st doctype */
 3068|  46.4k|                if (lexer->doctype == VERS_UNKNOWN && lexer->token && !cfgBool(doc, TidyXmlTags))
  ------------------
  |  |  204|  92.9k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  46.4k|#define xxxx                   0u
  |  |  ------------------
  ------------------
                              if (lexer->doctype == VERS_UNKNOWN && lexer->token && !cfgBool(doc, TidyXmlTags))
  ------------------
  |  |  418|  14.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  14.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (3068:21): [True: 39.9k, False: 6.47k]
  |  Branch (3068:55): [True: 14.6k, False: 25.3k]
  |  Branch (3068:71): [True: 14.6k, False: 0]
  ------------------
 3069|  14.6k|                {
 3070|  14.6k|                    lexer->doctype = FindGivenVersion(doc, lexer->token);
 3071|  14.6k|                    if (lexer->doctype != VERS_HTML5)
  ------------------
  |  |  213|  14.6k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  14.6k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  14.6k|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (3071:25): [True: 14.4k, False: 212]
  ------------------
 3072|  14.4k|                    {
 3073|       |                        /*\
 3074|       |                         *  Back to legacy HTML4 mode for -
 3075|       |                         *  Issue #167 & #169 - TidyTag_A
 3076|       |                         *  Issue #196        - TidyTag_CAPTION
 3077|       |                         *  others?
 3078|       |                        \*/ 
 3079|  14.4k|                        TY_(AdjustTags)(doc); /* Dynamically modify the tags table  */
  ------------------
  |  |   23|  14.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3080|  14.4k|                    }
 3081|  14.6k|                }
 3082|  46.4k|                node = lexer->token;
 3083|  46.4k|                GTDBG(doc,"doctype", node);
 3084|  46.4k|                return node;
 3085|       |
 3086|  39.9M|            case LEX_PROCINSTR:  /* seen <? so look for '>' */
  ------------------
  |  Branch (3086:13): [True: 39.9M, False: 220M]
  ------------------
 3087|       |                /* check for PHP preprocessor instructions <?php ... ?> */
 3088|       |
 3089|  39.9M|                if  (lexer->lexsize - lexer->txtstart == 3)
  ------------------
  |  Branch (3089:22): [True: 14.7k, False: 39.9M]
  ------------------
 3090|  14.7k|                {
 3091|  14.7k|                    if (TY_(tmbstrncmp)(lexer->lexbuf + lexer->txtstart, "php", 3) == 0)
  ------------------
  |  |   23|  14.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3091:25): [True: 385, False: 14.3k]
  ------------------
 3092|    385|                    {
 3093|    385|                        lexer->state = LEX_PHP;
 3094|    385|                        continue;
 3095|    385|                    }
 3096|  14.7k|                }
 3097|       |
 3098|  39.9M|                if  (lexer->lexsize - lexer->txtstart == 4)
  ------------------
  |  Branch (3098:22): [True: 12.9k, False: 39.9M]
  ------------------
 3099|  12.9k|                {
 3100|  12.9k|                    if (TY_(tmbstrncmp)(lexer->lexbuf + lexer->txtstart, "xml", 3) == 0 &&
  ------------------
  |  |   23|  12.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3100:25): [True: 10.7k, False: 2.21k]
  ------------------
 3101|  10.7k|                        TY_(IsWhite)(lexer->lexbuf[lexer->txtstart + 3]))
  ------------------
  |  |   23|  10.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3101:25): [True: 9.23k, False: 1.46k]
  ------------------
 3102|  9.23k|                    {
 3103|  9.23k|                        lexer->state = LEX_XMLDECL;
 3104|  9.23k|                        attributes = NULL;
 3105|  9.23k|                        continue;
 3106|  9.23k|                    }
 3107|  12.9k|                }
 3108|       |
 3109|  39.9M|                if (cfgBool(doc, TidyXmlPIs) || lexer->isvoyager) /* insist on ?> as terminator */
  ------------------
  |  |  418|  79.8M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  39.9M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 39.9M]
  |  |  ------------------
  ------------------
  |  Branch (3109:49): [True: 12.9k, False: 39.9M]
  ------------------
 3110|  12.9k|                {
 3111|  12.9k|                    if (c != '?')
  ------------------
  |  Branch (3111:25): [True: 12.5k, False: 407]
  ------------------
 3112|  12.5k|                        continue;
 3113|       |
 3114|       |                    /* now look for '>' */
 3115|    407|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    407|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    407|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3116|       |
 3117|    407|                    if (c == EndOfStream)
  ------------------
  |  | 1064|    407|#define EndOfStream (~0u)
  ------------------
  |  Branch (3117:25): [True: 2, False: 405]
  ------------------
 3118|      2|                    {
 3119|      2|                        TY_(Report)(doc, NULL, NULL, UNEXPECTED_END_OF_FILE );
  ------------------
  |  |   23|      2|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      2|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3120|      2|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      2|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      2|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3121|      2|                        continue;
 3122|      2|                    }
 3123|       |
 3124|    405|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|    405|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    405|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3125|    405|                }
 3126|       |
 3127|       |
 3128|  39.9M|                if (c != '>')
  ------------------
  |  Branch (3128:21): [True: 39.8M, False: 45.5k]
  ------------------
 3129|  39.8M|                    continue;
 3130|       |
 3131|  45.5k|                lexer->lexsize -= 1;
 3132|       |
 3133|  45.5k|                if (lexer->lexsize)
  ------------------
  |  Branch (3133:21): [True: 43.0k, False: 2.52k]
  ------------------
 3134|  43.0k|                {
 3135|  43.0k|                    uint i;
 3136|  43.0k|                    Bool closed;
 3137|       |
 3138|   121k|                    for (i = 0; i < lexer->lexsize - lexer->txtstart &&
  ------------------
  |  Branch (3138:33): [True: 79.4k, False: 41.6k]
  ------------------
 3139|  79.4k|                        !TY_(IsWhite)(lexer->lexbuf[i + lexer->txtstart]); ++i)
  ------------------
  |  |   23|  79.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  79.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3139:25): [True: 78.0k, False: 1.39k]
  ------------------
 3140|  78.0k|                        /**/;
 3141|       |
 3142|  43.0k|                    closed = lexer->lexbuf[lexer->lexsize - 1] == '?';
 3143|       |
 3144|  43.0k|                    if (closed)
  ------------------
  |  Branch (3144:25): [True: 4.18k, False: 38.8k]
  ------------------
 3145|  4.18k|                        lexer->lexsize -= 1;
 3146|       |
 3147|  43.0k|                    lexer->txtstart += i;
 3148|  43.0k|                    lexer->txtend = lexer->lexsize;
 3149|  43.0k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3150|       |
 3151|  43.0k|                    lexer->token = PIToken(doc);
  ------------------
  |  | 1613|  43.0k|#define PIToken(doc)      NewToken(doc, ProcInsTag)
  ------------------
 3152|  43.0k|                    lexer->token->closed = closed;
 3153|  43.0k|                    lexer->token->element = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  43.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  43.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3154|  43.0k|                                                            lexer->lexbuf +
 3155|  43.0k|                                                            lexer->txtstart - i, i);
 3156|  43.0k|                }
 3157|  2.52k|                else
 3158|  2.52k|                {
 3159|  2.52k|                    lexer->txtend = lexer->lexsize;
 3160|  2.52k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3161|  2.52k|                    lexer->token = PIToken(doc);
  ------------------
  |  | 1613|  2.52k|#define PIToken(doc)      NewToken(doc, ProcInsTag)
  ------------------
 3162|  2.52k|                }
 3163|       |
 3164|  45.5k|                lexer->state = LEX_CONTENT;
 3165|  45.5k|                lexer->waswhite = no;
 3166|  45.5k|                node = lexer->token;
 3167|  45.5k|                GTDBG(doc,"procinstr", node);
 3168|  45.5k|                return node;
 3169|       |
 3170|  1.55M|            case LEX_ASP:  /* seen <% so look for "%>" */
  ------------------
  |  Branch (3170:13): [True: 1.55M, False: 259M]
  ------------------
 3171|  1.55M|                if (c != '%')
  ------------------
  |  Branch (3171:21): [True: 1.51M, False: 38.9k]
  ------------------
 3172|  1.51M|                    continue;
 3173|       |
 3174|       |                /* now look for '>' */
 3175|  38.9k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  38.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3176|       |
 3177|       |
 3178|  38.9k|                if (c != '>')
  ------------------
  |  Branch (3178:21): [True: 532, False: 38.4k]
  ------------------
 3179|    532|                {
 3180|    532|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    532|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    532|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3181|    532|                    continue;
 3182|    532|                }
 3183|       |
 3184|  38.4k|                lexer->lexsize -= 1;
 3185|  38.4k|                lexer->txtend = lexer->lexsize;
 3186|  38.4k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3187|  38.4k|                lexer->state = LEX_CONTENT;
 3188|  38.4k|                lexer->waswhite = no;
 3189|  38.4k|                lexer->token = AspToken(doc);
  ------------------
  |  | 1614|  38.4k|#define AspToken(doc)     NewToken(doc, AspTag)
  ------------------
 3190|  38.4k|                node = lexer->token;
 3191|  38.4k|                GTDBG(doc,"ASP", node);
 3192|  38.4k|                return node;  /* the endtag token */
 3193|       |
 3194|       |
 3195|       |
 3196|  1.19M|            case LEX_JSTE:  /* seen <# so look for "#>" */
  ------------------
  |  Branch (3196:13): [True: 1.19M, False: 259M]
  ------------------
 3197|  1.19M|                if (c != '#')
  ------------------
  |  Branch (3197:21): [True: 1.15M, False: 39.7k]
  ------------------
 3198|  1.15M|                    continue;
 3199|       |
 3200|       |                /* now look for '>' */
 3201|  39.7k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  39.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3202|       |
 3203|       |
 3204|  39.7k|                if (c != '>')
  ------------------
  |  Branch (3204:21): [True: 331, False: 39.4k]
  ------------------
 3205|    331|                {
 3206|    331|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    331|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    331|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3207|    331|                    continue;
 3208|    331|                }
 3209|       |
 3210|  39.4k|                lexer->lexsize -= 1;
 3211|  39.4k|                lexer->txtend = lexer->lexsize;
 3212|  39.4k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3213|  39.4k|                lexer->state = LEX_CONTENT;
 3214|  39.4k|                lexer->waswhite = no;
 3215|  39.4k|                lexer->token = JsteToken(doc);
  ------------------
  |  | 1615|  39.4k|#define JsteToken(doc)    NewToken(doc, JsteTag)
  ------------------
 3216|  39.4k|                node = lexer->token;
 3217|  39.4k|                GTDBG(doc,"JSTE", node);
 3218|  39.4k|                return node;  /* the JSTE token */
 3219|       |
 3220|       |
 3221|  1.15k|            case LEX_PHP: /* seen "<?php" so look for "?>" */
  ------------------
  |  Branch (3221:13): [True: 1.15k, False: 260M]
  ------------------
 3222|  1.15k|                if (c != '?')
  ------------------
  |  Branch (3222:21): [True: 493, False: 659]
  ------------------
 3223|    493|                    continue;
 3224|       |
 3225|       |                /* now look for '>' */
 3226|    659|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    659|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    659|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3227|       |
 3228|    659|                if (c != '>')
  ------------------
  |  Branch (3228:21): [True: 308, False: 351]
  ------------------
 3229|    308|                {
 3230|    308|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    308|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    308|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3231|    308|                    continue;
 3232|    308|                }
 3233|       |
 3234|    351|                lexer->lexsize -= 1;
 3235|    351|                lexer->txtend = lexer->lexsize;
 3236|    351|                lexer->lexbuf[lexer->lexsize] = '\0';
 3237|    351|                lexer->state = LEX_CONTENT;
 3238|    351|                lexer->waswhite = no;
 3239|    351|                lexer->token = PhpToken(doc);
  ------------------
  |  | 1616|    351|#define PhpToken(doc)     NewToken(doc, PhpTag)
  ------------------
 3240|    351|                node = lexer->token;
 3241|    351|                GTDBG(doc,"PHP", node);
 3242|    351|                return node;  /* the PHP token */
 3243|       |
 3244|  34.6k|            case LEX_XMLDECL: /* seen "<?xml" so look for "?>" */
  ------------------
  |  Branch (3244:13): [True: 34.6k, False: 260M]
  ------------------
 3245|       |
 3246|  34.6k|                if (TY_(IsWhite)(c) && c != '?')
  ------------------
  |  |   23|  34.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3246:21): [True: 17.4k, False: 17.2k]
  |  Branch (3246:40): [True: 17.4k, False: 0]
  ------------------
 3247|  17.4k|                    continue;
 3248|       |
 3249|       |                /* get pseudo-attribute */
 3250|  17.2k|                if (c != '?')
  ------------------
  |  Branch (3250:21): [True: 16.4k, False: 827]
  ------------------
 3251|  16.4k|                {
 3252|  16.4k|                    tmbstr name;
 3253|  16.4k|                    Node *asp, *php;
 3254|  16.4k|                    AttVal *av = NULL;
 3255|  16.4k|                    int pdelim = 0;
 3256|  16.4k|                    isempty = no;
 3257|       |
 3258|  16.4k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  16.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3259|       |
 3260|  16.4k|                    name = ParseAttribute( doc, &isempty, &asp, &php );
 3261|       |
 3262|  16.4k|                    if (!name)
  ------------------
  |  Branch (3262:25): [True: 7.95k, False: 8.46k]
  ------------------
 3263|  7.95k|                    {
 3264|       |                        /* check if attributes are created by ASP markup */
 3265|  7.95k|                        if (asp)
  ------------------
  |  Branch (3265:29): [True: 3.54k, False: 4.40k]
  ------------------
 3266|  3.54k|                        {
 3267|  3.54k|                            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  3.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3268|  3.54k|                            av->asp = asp;
 3269|  3.54k|                            AddAttrToList( &attributes, av ); 
 3270|  3.54k|                        }
 3271|       |
 3272|       |                        /* check if attributes are created by PHP markup */
 3273|  7.95k|                        if (php)
  ------------------
  |  Branch (3273:29): [True: 2.89k, False: 5.05k]
  ------------------
 3274|  2.89k|                        {
 3275|  2.89k|                            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  2.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3276|  2.89k|                            av->php = php;
 3277|  2.89k|                            AddAttrToList( &attributes, av ); 
 3278|  2.89k|                        }
 3279|       |                      
 3280|       |                        /* fix for http://tidy.sf.net/bug/788031 */
 3281|  7.95k|                        lexer->lexsize -= 1;
 3282|  7.95k|                        lexer->txtend = lexer->txtstart;
 3283|  7.95k|                        lexer->lexbuf[lexer->txtend] = '\0';
 3284|  7.95k|                        lexer->state = LEX_CONTENT;
 3285|  7.95k|                        lexer->waswhite = no;
 3286|  7.95k|                        lexer->token = XmlDeclToken(doc);
  ------------------
  |  | 1617|  7.95k|#define XmlDeclToken(doc) NewToken(doc, XmlDecl)
  ------------------
 3287|  7.95k|                        lexer->token->attributes = attributes;
 3288|  7.95k|                        node = lexer->token;
 3289|  7.95k|                        GTDBG(doc,"xml", node);
 3290|  7.95k|                        return node;  /* the xml token */
 3291|  7.95k|                    }
 3292|       |
 3293|  8.46k|                    av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  8.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3294|  8.46k|                    av->attribute = name;
 3295|  8.46k|                    av->value = ParseValue( doc, name, yes, &isempty, &pdelim );
 3296|  8.46k|                    av->delim = pdelim;
 3297|  8.46k|                    av->dict = TY_(FindAttribute)( doc, av );
  ------------------
  |  |   23|  8.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3298|       |
 3299|  8.46k|                    AddAttrToList( &attributes, av );
 3300|       |                    /* continue; */
 3301|  8.46k|                }
 3302|       |
 3303|       |                /* now look for '>' */
 3304|  9.29k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  9.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3305|       |
 3306|  9.29k|                if (c != '>')
  ------------------
  |  Branch (3306:21): [True: 8.08k, False: 1.20k]
  ------------------
 3307|  8.08k|                {
 3308|  8.08k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  8.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3309|  8.08k|                    continue;
 3310|  8.08k|                }
 3311|  1.20k|                lexer->lexsize -= 1;
 3312|  1.20k|                lexer->txtend = lexer->txtstart;
 3313|  1.20k|                lexer->lexbuf[lexer->txtend] = '\0';
 3314|  1.20k|                lexer->state = LEX_CONTENT;
 3315|  1.20k|                lexer->waswhite = no;
 3316|  1.20k|                lexer->token = XmlDeclToken(doc);
  ------------------
  |  | 1617|  1.20k|#define XmlDeclToken(doc) NewToken(doc, XmlDecl)
  ------------------
 3317|  1.20k|                lexer->token->attributes = attributes;
 3318|  1.20k|                node = lexer->token;
 3319|  1.20k|                GTDBG(doc,"XML", node);
 3320|  1.20k|                return node;  /* the XML token */
 3321|       |
 3322|  58.2M|            case LEX_SECTION: /* seen "<![" so look for "]>" */
  ------------------
  |  Branch (3322:13): [True: 58.2M, False: 202M]
  ------------------
 3323|  58.2M|                if (c == '[')
  ------------------
  |  Branch (3323:21): [True: 6.60k, False: 58.1M]
  ------------------
 3324|  6.60k|                {
 3325|  6.60k|                    if (lexer->lexsize == (lexer->txtstart + 6) &&
  ------------------
  |  Branch (3325:25): [True: 1.19k, False: 5.40k]
  ------------------
 3326|  1.19k|                        TY_(tmbstrncmp)(lexer->lexbuf+lexer->txtstart, "CDATA[", 6) == 0)
  ------------------
  |  |   23|  1.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3326:25): [True: 839, False: 359]
  ------------------
 3327|    839|                    {
 3328|    839|                        lexer->state = LEX_CDATA;
 3329|    839|                        lexer->lexsize -= 6;
 3330|    839|                        continue;
 3331|    839|                    }
 3332|  6.60k|                }
 3333|       |
 3334|  58.2M|                if (c == '>')
  ------------------
  |  Branch (3334:21): [True: 80.5k, False: 58.1M]
  ------------------
 3335|  80.5k|                {
 3336|       |                    /* Is. #462 - reached '>' before ']' */
 3337|  80.5k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  80.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  80.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3338|  58.1M|                } else if (c != ']')
  ------------------
  |  Branch (3338:28): [True: 58.1M, False: 4.29k]
  ------------------
 3339|  58.1M|                    continue;
 3340|       |
 3341|       |                /* now look for '>' */
 3342|  84.8k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  84.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  84.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3343|       |
 3344|  84.8k|                lexdump = 1;
 3345|  84.8k|                if (c != '>')
  ------------------
  |  Branch (3345:21): [True: 4.04k, False: 80.8k]
  ------------------
 3346|  4.04k|                {
 3347|       |                    /* Issue #153 - can also be ]'-->' */
 3348|  4.04k|                    if (c == '-') 
  ------------------
  |  Branch (3348:25): [True: 1.24k, False: 2.79k]
  ------------------
 3349|  1.24k|                    {
 3350|  1.24k|                        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3351|  1.24k|                        if (c == '-')
  ------------------
  |  Branch (3351:29): [True: 470, False: 776]
  ------------------
 3352|    470|                        {
 3353|    470|                            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    470|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    470|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3354|    470|                            if (c != '>')
  ------------------
  |  Branch (3354:33): [True: 246, False: 224]
  ------------------
 3355|    246|                            {
 3356|    246|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    246|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    246|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3357|    246|                                TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|    246|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    246|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3358|    246|                                TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|    246|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    246|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3359|    246|                                continue;
 3360|    246|                            }
 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|    470|                        }
 3366|    776|                        else
 3367|    776|                        {
 3368|    776|                            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    776|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    776|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3369|    776|                            TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|    776|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    776|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3370|    776|                            continue;
 3371|    776|                        }
 3372|  1.24k|                    } 
 3373|  2.79k|                    else 
 3374|  2.79k|                    {
 3375|  2.79k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  2.79k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.79k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3376|  2.79k|                        continue;
 3377|  2.79k|                    }
 3378|  4.04k|                }
 3379|       | 
 3380|  81.0k|                lexer->lexsize -= lexdump;
 3381|  81.0k|                lexer->txtend = lexer->lexsize;
 3382|  81.0k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3383|  81.0k|                lexer->state = LEX_CONTENT;
 3384|  81.0k|                lexer->waswhite = no;
 3385|  81.0k|                lexer->token = SectionToken(doc);
  ------------------
  |  | 1618|  81.0k|#define SectionToken(doc) NewToken(doc, SectionTag)
  ------------------
 3386|  81.0k|                node = lexer->token;
 3387|  81.0k|                GTDBG(doc,"SECTION", node);
 3388|  81.0k|                return node;  /* the SECTION token */
 3389|       |
 3390|   303k|            case LEX_CDATA: /* seen "<![CDATA[" so look for "]]>" */
  ------------------
  |  Branch (3390:13): [True: 303k, False: 260M]
  ------------------
 3391|   303k|                if (c != ']')
  ------------------
  |  Branch (3391:21): [True: 302k, False: 1.46k]
  ------------------
 3392|   302k|                    continue;
 3393|       |
 3394|       |                /* now look for ']' */
 3395|  1.46k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3396|       |
 3397|  1.46k|                if (c != ']')
  ------------------
  |  Branch (3397:21): [True: 423, False: 1.03k]
  ------------------
 3398|    423|                {
 3399|    423|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    423|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    423|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3400|    423|                    continue;
 3401|    423|                }
 3402|       |
 3403|       |                /* now look for '>' */
 3404|  1.03k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3405|       |
 3406|  1.03k|                if (c != '>')
  ------------------
  |  Branch (3406:21): [True: 247, False: 791]
  ------------------
 3407|    247|                {
 3408|    247|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    247|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    247|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3409|    247|                    TY_(UngetChar)(']', doc->docIn);
  ------------------
  |  |   23|    247|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    247|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3410|    247|                    continue;
 3411|    247|                }
 3412|       |
 3413|    791|                lexer->lexsize -= 1;
 3414|    791|                lexer->txtend = lexer->lexsize;
 3415|    791|                lexer->lexbuf[lexer->lexsize] = '\0';
 3416|    791|                lexer->state = LEX_CONTENT;
 3417|    791|                lexer->waswhite = no;
 3418|    791|                lexer->token = CDATAToken(doc);
  ------------------
  |  | 1619|    791|#define CDATAToken(doc)   NewToken(doc, CDATATag)
  ------------------
 3419|    791|                node = lexer->token;
 3420|    791|                GTDBG(doc,"CDATA", node);
 3421|    791|                return node;  /* the CDATA token */
 3422|   260M|        }
 3423|   260M|    }
 3424|       |
 3425|  1.59M|    if (lexer->state == LEX_CONTENT)  /* text string */
  ------------------
  |  Branch (3425:9): [True: 1.42M, False: 168k]
  ------------------
 3426|  1.42M|    {
 3427|  1.42M|        lexer->txtend = lexer->lexsize;
 3428|       |
 3429|  1.42M|        if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3429:13): [True: 4.33k, False: 1.41M]
  ------------------
 3430|  4.33k|        {
 3431|  4.33k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  4.33k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.33k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3432|       |
 3433|  4.33k|            if (lexer->lexbuf[lexer->lexsize - 1] == ' ')
  ------------------
  |  Branch (3433:17): [True: 353, False: 3.98k]
  ------------------
 3434|    353|            {
 3435|    353|                lexer->lexsize -= 1;
 3436|    353|                lexer->txtend = lexer->lexsize;
 3437|    353|            }
 3438|  4.33k|            lexer->token = TY_(TextToken)(lexer);
  ------------------
  |  |   23|  4.33k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.33k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3439|  4.33k|            node = lexer->token;
 3440|  4.33k|            GTDBG(doc,"textstring", node);
 3441|  4.33k|            return node;  /* the textstring token */
 3442|  4.33k|        }
 3443|  1.42M|    }
 3444|   168k|    else if (lexer->state == LEX_COMMENT) /* comment */
  ------------------
  |  Branch (3444:14): [True: 189, False: 168k]
  ------------------
 3445|    189|    {
 3446|    189|        if (c == EndOfStream)
  ------------------
  |  | 1064|    189|#define EndOfStream (~0u)
  ------------------
  |  Branch (3446:13): [True: 189, False: 0]
  ------------------
 3447|    189|        {
 3448|       |            /* We print this if we reached end of the stream mid-comment. */
 3449|    189|            TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_EOS );
  ------------------
  |  |   23|    189|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    189|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3450|    189|        }
 3451|       |
 3452|    189|        lexer->txtend = lexer->lexsize;
 3453|    189|        lexer->lexbuf[lexer->lexsize] = '\0';
 3454|    189|        lexer->state = LEX_CONTENT;
 3455|    189|        lexer->waswhite = no;
 3456|    189|        lexer->token = CommentToken(doc);
  ------------------
  |  | 1611|    189|#define CommentToken(doc) NewToken(doc, CommentTag)
  ------------------
 3457|    189|        node = lexer->token;
 3458|    189|        GTDBG(doc,"COMMENT", node);
 3459|    189|        return node;  /* the COMMENT token */
 3460|    189|    }
 3461|       |
 3462|       |    /* check attributes before return NULL */
 3463|  1.58M|    if (attributes)
  ------------------
  |  Branch (3463:9): [True: 61, False: 1.58M]
  ------------------
 3464|     61|        TY_(FreeAttribute)( doc, attributes );
  ------------------
  |  |   23|     61|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     61|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3465|       |
 3466|  1.58M|    DEBUG_LOG(SPRTF("Returning NULL...\n"));
 3467|       |    return NULL;
 3468|  1.59M|}
lexer.c:ChangeChar:
  966|  1.07M|{
  967|  1.07M|    if ( lexer->lexsize > 0 )
  ------------------
  |  Branch (967:10): [True: 1.07M, False: 0]
  ------------------
  968|  1.07M|    {
  969|  1.07M|        lexer->lexbuf[ lexer->lexsize-1 ] = c;
  970|  1.07M|    }
  971|  1.07M|}
lexer.c:ParseEntity:
 1157|   211k|{
 1158|   211k|    typedef enum
 1159|   211k|    {
 1160|   211k|        ENT_default,
 1161|   211k|        ENT_numdec,
 1162|   211k|        ENT_numhex
 1163|   211k|    } ENTState;
 1164|       |    
 1165|   211k|    typedef Bool (*ENTfn)(uint);
 1166|   211k|    const ENTfn entFn[] = {
 1167|   211k|        TY_(IsNamechar),
  ------------------
  |  |   23|   211k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   211k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1168|   211k|        TY_(IsDigit),
  ------------------
  |  |   23|   211k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   211k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1169|   211k|        IsDigitHex
 1170|   211k|    };
 1171|   211k|    uint start;
 1172|   211k|    ENTState entState = ENT_default;
 1173|   211k|    uint charRead = 0;
 1174|   211k|    Bool semicolon = no, found = no;
 1175|   211k|    Bool isXml = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|   211k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   211k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1176|   211k|    Bool preserveEntities = cfgBool( doc, TidyPreserveEntities );
  ------------------
  |  |  418|   211k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   211k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1177|   211k|    uint c, ch, startcol, entver = 0;
 1178|   211k|    Lexer* lexer = doc->lexer;
 1179|       |
 1180|   211k|    start = lexer->lexsize - 1;  /* to start at "&" */
 1181|   211k|    startcol = doc->docIn->curcol - 1;
 1182|       |
 1183|  2.45M|    while ( (c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  |   23|  2.45M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.45M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ( (c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  | 1064|  2.45M|#define EndOfStream (~0u)
  ------------------
  |  Branch (1183:13): [True: 2.45M, False: 512]
  ------------------
 1184|  2.45M|    {
 1185|  2.45M|        if ( c == ';' )
  ------------------
  |  Branch (1185:14): [True: 5.34k, False: 2.45M]
  ------------------
 1186|  5.34k|        {
 1187|  5.34k|            semicolon = yes;
 1188|  5.34k|            break;
 1189|  5.34k|        }
 1190|  2.45M|        ++charRead;
 1191|       |
 1192|  2.45M|        if (charRead == 1 && c == '#')
  ------------------
  |  Branch (1192:13): [True: 210k, False: 2.24M]
  |  Branch (1192:30): [True: 116k, False: 94.3k]
  ------------------
 1193|   116k|        {
 1194|   116k|            if ( !cfgBool(doc, TidyNCR) ||
  ------------------
  |  |  418|   232k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   116k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1194:18): [True: 0, False: 116k]
  ------------------
 1195|   116k|                 cfg(doc, TidyInCharEncoding) == BIG5 ||
  ------------------
  |  |  415|   116k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                               cfg(doc, TidyInCharEncoding) == BIG5 ||
  ------------------
  |  |  145|   232k|#define BIG5        12
  ------------------
  |  Branch (1195:18): [True: 0, False: 116k]
  ------------------
 1196|   116k|                 cfg(doc, TidyInCharEncoding) == SHIFTJIS )
  ------------------
  |  |  415|   116k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                               cfg(doc, TidyInCharEncoding) == SHIFTJIS )
  ------------------
  |  |  146|   116k|#define SHIFTJIS    13
  ------------------
  |  Branch (1196:18): [True: 0, False: 116k]
  ------------------
 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|   116k|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|   116k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   116k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1203|   116k|            entState = ENT_numdec;
 1204|   116k|            continue;
 1205|   116k|        }
 1206|  2.33M|        else if (charRead == 2 && entState == ENT_numdec
  ------------------
  |  Branch (1206:18): [True: 138k, False: 2.19M]
  |  Branch (1206:35): [True: 116k, False: 21.7k]
  ------------------
 1207|   116k|                 && (c == 'x' || (!isXml && c == 'X')) )
  ------------------
  |  Branch (1207:22): [True: 8.69k, False: 107k]
  |  Branch (1207:35): [True: 107k, False: 0]
  |  Branch (1207:45): [True: 102k, False: 4.76k]
  ------------------
 1208|   111k|        {
 1209|   111k|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|   111k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   111k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1210|   111k|            entState = ENT_numhex;
 1211|   111k|            continue;
 1212|   111k|        }
 1213|       |
 1214|  2.22M|        if ( entFn[entState](c) )
  ------------------
  |  Branch (1214:14): [True: 2.01M, False: 205k]
  ------------------
 1215|  2.01M|        {
 1216|  2.01M|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|  2.01M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.01M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1217|  2.01M|            continue;
 1218|  2.01M|        }
 1219|       |
 1220|       |        /* otherwise put it back */
 1221|   205k|        TY_(UngetChar)( c, doc->docIn );
  ------------------
  |  |   23|   205k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   205k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1222|   205k|        break;
 1223|  2.22M|    }
 1224|       |
 1225|       |    /* make sure entity is NULL terminated */
 1226|   211k|    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|   211k|    if ( TY_(tmbstrcmp)(lexer->lexbuf+start, "&apos") == 0
  ------------------
  |  |   23|   211k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   211k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1232:10): [True: 195, False: 211k]
  ------------------
 1233|    195|         && !cfgBool(doc, TidyXmlOut)
  ------------------
  |  |  418|   211k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    195|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1233:13): [True: 0, False: 195]
  ------------------
 1234|      0|         && !lexer->isvoyager
  ------------------
  |  Branch (1234:13): [True: 0, False: 0]
  ------------------
 1235|      0|         && !cfgBool(doc, TidyXhtmlOut)
  ------------------
  |  |  418|   211k|#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|   211k|    if (( mode == OtherNamespace ) && ( c == ';' ))
  ------------------
  |  Branch (1239:9): [True: 4.48k, False: 207k]
  |  Branch (1239:39): [True: 355, False: 4.13k]
  ------------------
 1240|    355|    {
 1241|       |        /* #130 MathML attr and entity fix! */
 1242|    355|        found = yes;
 1243|    355|        ch = 255;
 1244|    355|        entver = XH50|HT50;
  ------------------
  |  |  201|    355|#define XH50              262144u
  ------------------
                      entver = XH50|HT50;
  ------------------
  |  |  200|    355|#define HT50              131072u
  ------------------
 1245|    355|        preserveEntities = yes;
 1246|    355|    }
 1247|   211k|    else
 1248|   211k|    {
 1249|       |        /* Lookup entity code and version
 1250|       |        */
 1251|   211k|        found = TY_(EntityInfo)( lexer->lexbuf+start, isXml, &ch, &entver );
  ------------------
  |  |   23|   211k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   211k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1252|   211k|    }
 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|   211k|    if (!preserveEntities && found && TY_(IsLowSurrogate)(ch))
  ------------------
  |  |   23|  16.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1258:9): [True: 211k, False: 355]
  |  Branch (1258:30): [True: 16.3k, False: 194k]
  |  Branch (1258:39): [True: 4.77k, False: 11.5k]
  ------------------
 1259|  4.77k|    {
 1260|  4.77k|        uint c1;
 1261|  4.77k|        if ((c1 = TY_(ReadChar)(doc->docIn)) == '&')
  ------------------
  |  |   23|  4.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1261:13): [True: 4.30k, False: 474]
  ------------------
 1262|  4.30k|        {
 1263|  4.30k|            SPStatus status;
 1264|       |            /* Have a following entity, 
 1265|       |               so there is a chance of having a valid surrogate pair */
 1266|  4.30k|            c1 = ch;    /* keep first value, in case of error */
 1267|  4.30k|            status = GetSurrogatePair(doc, isXml, &ch);
 1268|  4.30k|            if (status == SP_error)
  ------------------
  |  Branch (1268:17): [True: 3.90k, False: 403]
  ------------------
 1269|  3.90k|            {
 1270|  3.90k|                TY_(ReportSurrogateError)(doc, BAD_SURROGATE_TAIL, c1, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|  3.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1271|  3.90k|                TY_(UngetChar)('&', doc->docIn);  /* otherwise put it back */
  ------------------
  |  |   23|  3.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1272|  3.90k|            }
 1273|  4.30k|        }
 1274|    474|        else
 1275|    474|        {
 1276|       |            /* put this non-entity lead char back */
 1277|    474|            TY_(UngetChar)(c1, doc->docIn);
  ------------------
  |  |   23|    474|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    474|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1278|       |            /* Have leading surrogate pair, with no tail */
 1279|    474|            TY_(ReportSurrogateError)(doc, BAD_SURROGATE_TAIL, ch, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|    474|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    474|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1280|    474|            ch = 0xFFFD;
 1281|    474|        }
 1282|  4.77k|    } 
 1283|   206k|    else if (!preserveEntities && found && TY_(IsHighSurrogate)(ch))
  ------------------
  |  |   23|  11.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1283:14): [True: 206k, False: 355]
  |  Branch (1283:35): [True: 11.5k, False: 194k]
  |  Branch (1283:44): [True: 459, False: 11.1k]
  ------------------
 1284|    459|    {
 1285|       |        /* Have trailing surrogate pair, with no lead */
 1286|    459|        TY_(ReportSurrogateError)(doc, BAD_SURROGATE_LEAD, ch, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|    459|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    459|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1287|    459|        ch = 0xFFFD;
 1288|    459|    }
 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|   211k|    if ( !found || (ch >= 128 && ch <= 159) || (ch >= 256 && c != ';') )
  ------------------
  |  Branch (1293:10): [True: 194k, False: 16.7k]
  |  Branch (1293:21): [True: 11.0k, False: 5.66k]
  |  Branch (1293:34): [True: 1.06k, False: 10.0k]
  |  Branch (1293:49): [True: 9.02k, False: 6.63k]
  |  Branch (1293:62): [True: 5.79k, False: 3.22k]
  ------------------
 1294|   201k|    {
 1295|       |        /* set error position just before offending character */
 1296|   201k|        SetLexerLocus( doc, lexer );
 1297|   201k|        lexer->columns = startcol;
 1298|       |
 1299|   201k|        if (lexer->lexsize > start + 1)
  ------------------
  |  Branch (1299:13): [True: 128k, False: 72.8k]
  ------------------
 1300|   128k|        {
 1301|   128k|            if (ch >= 128 && ch <= 159)
  ------------------
  |  Branch (1301:17): [True: 6.86k, False: 121k]
  |  Branch (1301:30): [True: 1.06k, False: 5.79k]
  ------------------
 1302|  1.06k|            {
 1303|       |                /* invalid numeric character reference */
 1304|       |                
 1305|  1.06k|                uint c1 = 0;
 1306|  1.06k|                int replaceMode = DISCARDED_CHAR;
  ------------------
  |  |  314|  1.06k|#define DISCARDED_CHAR          1
  ------------------
 1307|       |            
 1308|       |                /* Always assume Win1252 in this circumstance. */
 1309|  1.06k|                c1 = TY_(DecodeWin1252)( ch );
  ------------------
  |  |   23|  1.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1310|       |
 1311|  1.06k|                if ( c1 )
  ------------------
  |  Branch (1311:22): [True: 855, False: 209]
  ------------------
 1312|    855|                    replaceMode = REPLACED_CHAR;
  ------------------
  |  |  313|    855|#define REPLACED_CHAR           0
  ------------------
 1313|       |                
 1314|  1.06k|                if ( c != ';' )  /* issue warning if not terminated by ';' */
  ------------------
  |  Branch (1314:22): [True: 497, False: 567]
  ------------------
 1315|    497|                    TY_(ReportEntityError)( doc, MISSING_SEMICOLON_NCR,
  ------------------
  |  |   23|    497|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    497|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1316|    497|                                            lexer->lexbuf+start, c );
 1317|       | 
 1318|  1.06k|                TY_(ReportEncodingError)(doc, INVALID_NCR, ch, replaceMode == DISCARDED_CHAR);
  ------------------
  |  |   23|  1.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportEncodingError)(doc, INVALID_NCR, ch, replaceMode == DISCARDED_CHAR);
  ------------------
  |  |  314|  1.06k|#define DISCARDED_CHAR          1
  ------------------
 1319|       |                
 1320|  1.06k|                if ( c1 )
  ------------------
  |  Branch (1320:22): [True: 855, False: 209]
  ------------------
 1321|    855|                {
 1322|       |                    /* make the replacement */
 1323|    855|                    lexer->lexsize = start;
 1324|    855|                    TY_(AddCharToLexer)( lexer, c1 );
  ------------------
  |  |   23|    855|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    855|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1325|    855|                    semicolon = no;
 1326|    855|                }
 1327|    209|                else
 1328|    209|                {
 1329|       |                    /* discard */
 1330|    209|                    lexer->lexsize = start;
 1331|    209|                    semicolon = no;
 1332|    209|               }
 1333|       |               
 1334|  1.06k|            }
 1335|   127k|            else
 1336|   127k|                TY_(ReportEntityError)( doc, UNKNOWN_ENTITY,
  ------------------
  |  |   23|   127k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   127k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1337|   127k|                                        lexer->lexbuf+start, ch );
 1338|       |
 1339|   128k|            if (semicolon)
  ------------------
  |  Branch (1339:17): [True: 505, False: 128k]
  ------------------
 1340|    505|                TY_(AddCharToLexer)( lexer, ';' );
  ------------------
  |  |   23|    505|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    505|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1341|   128k|        }
 1342|  72.8k|        else
 1343|  72.8k|        {
 1344|       |            /*\ 
 1345|       |             *  Issue #207 - A naked & is allowed in HTML5, as an unambiguous ampersand!
 1346|       |            \*/
 1347|  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 (1347:17): [True: 72.8k, False: 0]
  ------------------
 1348|  72.8k|            {
 1349|  72.8k|                TY_(ReportEntityError)( doc, UNESCAPED_AMPERSAND,
  ------------------
  |  |   23|  72.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  72.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1350|  72.8k|                                    lexer->lexbuf+start, ch );
 1351|  72.8k|            }
 1352|  72.8k|        }
 1353|   201k|    }
 1354|  9.86k|    else
 1355|  9.86k|    {
 1356|  9.86k|        if ( c != ';' )    /* issue warning if not terminated by ';' */
  ------------------
  |  Branch (1356:14): [True: 6.00k, False: 3.86k]
  ------------------
 1357|  6.00k|        {
 1358|       |            /* set error position just before offending character */
 1359|  6.00k|            SetLexerLocus( doc, lexer );
 1360|  6.00k|            lexer->columns = startcol;
 1361|  6.00k|            TY_(ReportEntityError)( doc, MISSING_SEMICOLON, lexer->lexbuf+start, c );
  ------------------
  |  |   23|  6.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1362|  6.00k|        }
 1363|       |
 1364|  9.86k|        if (preserveEntities)
  ------------------
  |  Branch (1364:13): [True: 355, False: 9.51k]
  ------------------
 1365|    355|            TY_(AddCharToLexer)( lexer, ';' );
  ------------------
  |  |   23|    355|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    355|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1366|  9.51k|        else
 1367|  9.51k|        {
 1368|  9.51k|            lexer->lexsize = start;
 1369|  9.51k|            if ( ch == 160 && (mode == Preformatted) )
  ------------------
  |  Branch (1369:18): [True: 524, False: 8.98k]
  |  Branch (1369:31): [True: 200, False: 324]
  ------------------
 1370|    200|                ch = ' ';
 1371|  9.51k|            TY_(AddCharToLexer)( lexer, ch );
  ------------------
  |  |   23|  9.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1372|       |
 1373|  9.51k|            if ( ch == '&' && !cfgBool(doc, TidyQuoteAmpersand) )
  ------------------
  |  |  418|    207|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    207|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1373:18): [True: 207, False: 9.30k]
  |  Branch (1373:31): [True: 0, False: 207]
  ------------------
 1374|      0|                AddStringToLexer( lexer, "amp;" );
 1375|  9.51k|        }
 1376|       |
 1377|       |        /* Detect extended vs. basic entities */
 1378|  9.86k|        TY_(ConstrainVersion)( doc, entver );
  ------------------
  |  |   23|  9.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1379|  9.86k|    }
 1380|   211k|}
lexer.c:IsDigitHex:
  470|   445k|{
  471|   445k|    uint map;
  472|       |
  473|   445k|    map = MAP(c);
  ------------------
  |  |  206|   445k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 443k, False: 1.69k]
  |  |  ------------------
  ------------------
  474|       |
  475|   445k|    return (map & digithex)!=0;
  ------------------
  |  |   75|   445k|#define digithex    128u
  ------------------
  476|   445k|}
lexer.c:GetSurrogatePair:
 1026|  4.30k|{
 1027|  4.30k|    Lexer* lexer = doc->lexer;
 1028|  4.30k|    uint bufSize = 32;
 1029|  4.30k|    uint c, ch = 0, offset = 0;
 1030|  4.30k|    tmbstr buf = 0;
 1031|  4.30k|    SPStatus status = SP_error;  /* assume failed */
 1032|  4.30k|    int type = 0;   /* assume numeric */
 1033|  4.30k|    uint fch = *pch;
 1034|  4.30k|    int i;  /* has to be signed due to for i >= 0 */
 1035|  4.30k|    if (!lexer)
  ------------------
  |  Branch (1035:9): [True: 0, False: 4.30k]
  ------------------
 1036|      0|        return status;
 1037|  4.30k|    buf = (tmbstr)TidyRealloc(lexer->allocator, buf, bufSize);
  ------------------
  |  |   67|  4.30k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
 1038|  4.30k|    if (!buf)
  ------------------
  |  Branch (1038:9): [True: 0, False: 4.30k]
  ------------------
 1039|      0|        return status;
 1040|   161k|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  |   23|   161k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   161k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  | 1064|   161k|#define EndOfStream (~0u)
  ------------------
  |  Branch (1040:12): [True: 161k, False: 91]
  ------------------
 1041|   161k|    {
 1042|   161k|        if (c == ';')
  ------------------
  |  Branch (1042:13): [True: 888, False: 160k]
  ------------------
 1043|    888|        {
 1044|    888|            break;  /* reached end of entity */
 1045|    888|        }
 1046|   160k|        if ((offset + 2) > bufSize)
  ------------------
  |  Branch (1046:13): [True: 424, False: 160k]
  ------------------
 1047|    424|        {
 1048|    424|            bufSize *= 2;
 1049|    424|            buf = (tmbstr)TidyRealloc(lexer->allocator, buf, bufSize);
  ------------------
  |  |   67|    424|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
 1050|    424|            if (!buf)
  ------------------
  |  Branch (1050:17): [True: 0, False: 424]
  ------------------
 1051|      0|            {
 1052|      0|                break;
 1053|      0|            }
 1054|    424|        }
 1055|   160k|        buf[offset++] = c;  /* add char to buffer */
 1056|   160k|        if (offset == 1)
  ------------------
  |  Branch (1056:13): [True: 4.08k, False: 156k]
  ------------------
 1057|  4.08k|        {
 1058|  4.08k|            if (c != '#')   /* is a numeric entity */
  ------------------
  |  Branch (1058:17): [True: 836, False: 3.24k]
  ------------------
 1059|    836|                break;
 1060|  4.08k|        }
 1061|   156k|        else if (offset == 2 && ((c == 'x') || (!isXml && c == 'X')))
  ------------------
  |  Branch (1061:18): [True: 3.24k, False: 153k]
  |  Branch (1061:34): [True: 2.02k, False: 1.21k]
  |  Branch (1061:49): [True: 1.21k, False: 0]
  |  Branch (1061:59): [True: 519, False: 694]
  ------------------
 1062|  2.54k|        {
 1063|  2.54k|            type = 1;   /* set hex digits */
 1064|  2.54k|        }
 1065|   154k|        else
 1066|   154k|        {
 1067|   154k|            if (type)   /* if hex digits */
  ------------------
  |  Branch (1067:17): [True: 151k, False: 2.40k]
  ------------------
 1068|   151k|            {
 1069|   151k|                if (!IsDigitHex(c))
  ------------------
  |  Branch (1069:21): [True: 1.80k, False: 150k]
  ------------------
 1070|  1.80k|                    break;
 1071|   151k|            }
 1072|  2.40k|            else    /* if numeric */
 1073|  2.40k|            {
 1074|  2.40k|                if (!TY_(IsDigit)(c))
  ------------------
  |  |   23|  2.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1074:21): [True: 680, False: 1.72k]
  ------------------
 1075|    680|                    break;
 1076|  2.40k|            }
 1077|   154k|        }
 1078|   160k|    }
 1079|       |
 1080|  4.30k|    if (c == ';')
  ------------------
  |  Branch (1080:9): [True: 888, False: 3.41k]
  ------------------
 1081|    888|    {
 1082|    888|        int scanned;
 1083|       |
 1084|    888|        buf[offset] = 0;
 1085|    888|        if (type)
  ------------------
  |  Branch (1085:13): [True: 686, False: 202]
  ------------------
 1086|    686|            scanned = sscanf(buf + 2, "%x", &ch);
 1087|    202|        else
 1088|    202|            scanned = sscanf(buf + 1, "%d", &ch);
 1089|       |
 1090|    888|        if (scanned == 1 && TY_(IsHighSurrogate)(ch))
  ------------------
  |  |   23|    679|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    679|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1090:13): [True: 679, False: 209]
  |  Branch (1090:29): [True: 403, False: 276]
  ------------------
 1091|    403|        {
 1092|    403|            ch = TY_(CombineSurrogatePair)(ch, fch);
  ------------------
  |  |   23|    403|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    403|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1093|    403|            if (TY_(IsValidCombinedChar)(ch))
  ------------------
  |  |   23|    403|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    403|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1093:17): [True: 195, False: 208]
  ------------------
 1094|    195|            {
 1095|    195|                *pch = ch;  /* return combined pair value */
 1096|    195|                status = SP_ok; /* full success - pair used */
 1097|    195|            }
 1098|    208|            else
 1099|    208|            {
 1100|    208|                status = SP_failed; /* is one of the 32 out-of-range pairs */
 1101|    208|                *pch = 0xFFFD;  /* return substitute character */
 1102|    208|                TY_(ReportSurrogateError)(doc, BAD_SURROGATE_PAIR, fch, ch); /* SP WARNING: -  */
  ------------------
  |  |   23|    208|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    208|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1103|    208|            }
 1104|    403|        }
 1105|    888|    }
 1106|       |
 1107|  4.30k|    if (status == SP_error)
  ------------------
  |  Branch (1107:9): [True: 3.90k, False: 403]
  ------------------
 1108|  3.90k|    {
 1109|       |        /* Error condition - can only put back all the chars */
 1110|  3.90k|        if (c == ';') /* if last, not added to buffer */
  ------------------
  |  Branch (1110:13): [True: 485, False: 3.41k]
  ------------------
 1111|    485|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    485|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    485|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1112|  3.90k|        if (buf && offset)
  ------------------
  |  Branch (1112:13): [True: 3.90k, False: 0]
  |  Branch (1112:20): [True: 3.68k, False: 218]
  ------------------
 1113|  3.68k|        {
 1114|       |            /* correct the order for unget - last first */
 1115|   162k|            for (i = offset - 1; i >= 0; i--)
  ------------------
  |  Branch (1115:34): [True: 158k, False: 3.68k]
  ------------------
 1116|   158k|            {
 1117|   158k|                c = buf[i];
 1118|   158k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   158k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   158k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1119|   158k|            }
 1120|  3.68k|        }
 1121|  3.90k|    }
 1122|       |
 1123|  4.30k|    if (buf)
  ------------------
  |  Branch (1123:9): [True: 4.30k, False: 0]
  ------------------
 1124|  4.30k|        TidyFree(lexer->allocator, buf);
  ------------------
  |  |   68|  4.30k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 1125|       |
 1126|  4.30k|    return status;
 1127|  4.30k|}
lexer.c:ParseTagName:
 1383|  1.11M|{
 1384|  1.11M|    Lexer *lexer = doc->lexer;
 1385|  1.11M|    uint c = lexer->lexbuf[ lexer->txtstart ];
 1386|  1.11M|    Bool xml = cfgBool(doc, TidyXmlTags);
  ------------------
  |  |  418|  1.11M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.11M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1387|       |
 1388|       |    /* fold case of first character in buffer */
 1389|  1.11M|    if (!xml && TY_(IsUpper)(c))
  ------------------
  |  |   23|  1.11M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.11M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1389:9): [True: 1.11M, False: 0]
  |  Branch (1389:17): [True: 548k, False: 569k]
  ------------------
 1390|   548k|        lexer->lexbuf[lexer->txtstart] = (tmbchar) TY_(ToLower)(c);
  ------------------
  |  |   23|   548k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   548k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1391|       |
 1392|  7.11M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|  7.11M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.11M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|  7.11M|#define EndOfStream (~0u)
  ------------------
  |  Branch (1392:12): [True: 7.11M, False: 4.89k]
  ------------------
 1393|  7.11M|    {
 1394|  7.11M|        if ((!xml && !TY_(IsNamechar)(c)) ||
  ------------------
  |  |   23|  7.11M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.11M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1394:14): [True: 7.11M, False: 0]
  |  Branch (1394:22): [True: 1.11M, False: 5.99M]
  ------------------
 1395|  5.99M|            (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: 5.99M]
  |  Branch (1395:21): [True: 0, False: 0]
  ------------------
 1396|  1.11M|            break;
 1397|       |
 1398|       |        /* fold case of subsequent characters */
 1399|  5.99M|        if (!xml && TY_(IsUpper)(c))
  ------------------
  |  |   23|  5.99M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.99M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1399:13): [True: 5.99M, False: 0]
  |  Branch (1399:21): [True: 1.38M, False: 4.61M]
  ------------------
 1400|  1.38M|             c = TY_(ToLower)(c);
  ------------------
  |  |   23|  1.38M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.38M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1401|       |
 1402|  5.99M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  5.99M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.99M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1403|  5.99M|    }
 1404|       |
 1405|  1.11M|    lexer->txtend = lexer->lexsize;
 1406|  1.11M|    return (tmbchar) c;
 1407|  1.11M|}
lexer.c:TagToken:
 1585|  1.11M|{
 1586|  1.11M|    Lexer* lexer = doc->lexer;
 1587|  1.11M|    Node* node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|  1.11M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.11M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1588|  1.11M|    node->type = type;
 1589|  1.11M|    node->element = TY_(tmbstrndup)( doc->allocator,
  ------------------
  |  |   23|  1.11M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.11M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1590|  1.11M|                                     lexer->lexbuf + lexer->txtstart,
 1591|  1.11M|                                     lexer->txtend - lexer->txtstart );
 1592|  1.11M|    node->start = lexer->txtstart;
 1593|  1.11M|    node->end = lexer->txtstart;
 1594|       |
 1595|  1.11M|    if ( type == StartTag || type == StartEndTag || type == EndTag )
  ------------------
  |  Branch (1595:10): [True: 1.02M, False: 88.8k]
  |  Branch (1595:30): [True: 0, False: 88.8k]
  |  Branch (1595:53): [True: 88.8k, False: 0]
  ------------------
 1596|  1.11M|        TY_(FindTag)(doc, node);
  ------------------
  |  |   23|  1.11M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.11M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1597|       |
 1598|  1.11M|    return node;
 1599|  1.11M|}
lexer.c:ParseAttrs:
 4200|   345k|{
 4201|   345k|    Lexer* lexer = doc->lexer;
 4202|   345k|    AttVal *av, *list;
 4203|   345k|    tmbstr value;
 4204|   345k|    int delim;
 4205|   345k|    Node *asp, *php;
 4206|       |
 4207|   345k|    list = NULL;
 4208|       |
 4209|   529k|    while ( !EndOfInput(doc) )
  ------------------
  |  Branch (4209:13): [True: 520k, False: 8.67k]
  ------------------
 4210|   520k|    {
 4211|   520k|        tmbstr attribute = ParseAttribute( doc, isempty, &asp, &php );
 4212|       |
 4213|   520k|        if (attribute == NULL)
  ------------------
  |  Branch (4213:13): [True: 342k, False: 177k]
  ------------------
 4214|   342k|        {
 4215|       |            /* check if attributes are created by ASP markup */
 4216|   342k|            if (asp)
  ------------------
  |  Branch (4216:17): [True: 1.26k, False: 341k]
  ------------------
 4217|  1.26k|            {
 4218|  1.26k|                av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  1.26k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.26k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4219|  1.26k|                av->asp = asp;
 4220|  1.26k|                AddAttrToList( &list, av ); 
 4221|  1.26k|                continue;
 4222|  1.26k|            }
 4223|       |
 4224|       |            /* check if attributes are created by PHP markup */
 4225|   341k|            if (php)
  ------------------
  |  Branch (4225:17): [True: 4.43k, False: 337k]
  ------------------
 4226|  4.43k|            {
 4227|  4.43k|                av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  4.43k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.43k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4228|  4.43k|                av->php = php;
 4229|  4.43k|                AddAttrToList( &list, av ); 
 4230|  4.43k|                continue;
 4231|  4.43k|            }
 4232|       |
 4233|   337k|            break;
 4234|   341k|        }
 4235|       |
 4236|   177k|        value = ParseValue( doc, attribute, no, isempty, &delim );
 4237|       |
 4238|   177k|        if (attribute && (IsValidAttrName(attribute) ||
  ------------------
  |  Branch (4238:13): [True: 177k, False: 0]
  |  Branch (4238:27): [True: 127k, False: 50.3k]
  ------------------
 4239|  50.3k|            (cfgBool(doc, TidyXmlTags) && IsValidXMLAttrName(attribute))))
  ------------------
  |  |  418|   100k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  50.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 50.3k]
  |  |  ------------------
  ------------------
                          (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|   127k|        {
 4241|   127k|            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|   127k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   127k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4242|   127k|            av->delim = delim ? delim : '"';
  ------------------
  |  Branch (4242:25): [True: 97.1k, False: 30.3k]
  ------------------
 4243|   127k|            av->attribute = attribute;
 4244|   127k|            av->value = value;
 4245|   127k|            av->dict = TY_(FindAttribute)( doc, av );
  ------------------
  |  |   23|   127k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   127k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4246|   127k|            AddAttrToList( &list, av );
 4247|   127k|            if ( !delim && value )
  ------------------
  |  Branch (4247:18): [True: 30.3k, False: 97.1k]
  |  Branch (4247:28): [True: 29.5k, False: 827]
  ------------------
 4248|  29.5k|                TY_(ReportAttrError)( doc, lexer->token, av, MISSING_QUOTEMARK_OPEN);
  ------------------
  |  |   23|  29.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4249|   127k|        }
 4250|  50.3k|        else
 4251|  50.3k|        {
 4252|  50.3k|            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  50.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  50.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4253|  50.3k|            av->attribute = attribute;
 4254|  50.3k|            av->value = value;
 4255|       |
 4256|  50.3k|            if (LastChar(attribute) == '"')
  ------------------
  |  Branch (4256:17): [True: 978, False: 49.3k]
  ------------------
 4257|    978|                TY_(ReportAttrError)( doc, lexer->token, av, MISSING_QUOTEMARK);
  ------------------
  |  |   23|    978|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    978|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4258|  49.3k|            else if (value == NULL)
  ------------------
  |  Branch (4258:22): [True: 44.7k, False: 4.63k]
  ------------------
 4259|  44.7k|                TY_(ReportAttrError)(doc, lexer->token, av, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  44.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4260|  4.63k|            else
 4261|  4.63k|                TY_(ReportAttrError)(doc, lexer->token, av, INVALID_ATTRIBUTE);
  ------------------
  |  |   23|  4.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4262|       |
 4263|  50.3k|            TY_(FreeAttribute)( doc, av );
  ------------------
  |  |   23|  50.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  50.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4264|  50.3k|        }
 4265|   177k|    }
 4266|       |
 4267|   345k|    return list;
 4268|   345k|}
lexer.c:EndOfInput:
  901|   529k|{
  902|   529k|    assert( doc->docIn != NULL );
  ------------------
  |  Branch (902:5): [True: 0, False: 529k]
  |  Branch (902:5): [True: 529k, False: 0]
  ------------------
  903|   529k|    return ( !doc->docIn->pushed && TY_(IsEOF)(doc->docIn) );
  ------------------
  |  |   23|   349k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   349k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (903:14): [True: 349k, False: 179k]
  |  Branch (903:37): [True: 8.67k, False: 341k]
  ------------------
  904|   529k|}
lexer.c:IsValidAttrName:
 4132|   177k|{
 4133|   177k|    uint i, c = attr[0];
 4134|       |
 4135|       |    /* first character should be a letter */
 4136|   177k|    if (!TY_(IsLetter)(c))
  ------------------
  |  |   23|   177k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   177k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4136:9): [True: 42.6k, False: 135k]
  ------------------
 4137|  42.6k|        return no;
 4138|       |
 4139|       |    /* remaining characters should be namechars */
 4140|   575k|    for( i = 1; i < TY_(tmbstrlen)(attr); i++)
  ------------------
  |  |   23|   575k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   575k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4140:17): [True: 447k, False: 127k]
  ------------------
 4141|   447k|    {
 4142|   447k|        c = attr[i];
 4143|       |
 4144|   447k|        if (TY_(IsNamechar)(c))
  ------------------
  |  |   23|   447k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   447k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4144:13): [True: 440k, False: 7.67k]
  ------------------
 4145|   440k|            continue;
 4146|       |
 4147|  7.67k|        return no;
 4148|   447k|    }
 4149|       |
 4150|   127k|    return yes;
 4151|   135k|}
lexer.c:LastChar:
  871|  50.3k|{
  872|  50.3k|    if ( str && *str )
  ------------------
  |  Branch (872:10): [True: 50.3k, False: 0]
  |  Branch (872:17): [True: 50.0k, False: 311]
  ------------------
  873|  50.0k|    {
  874|  50.0k|        int n = TY_(tmbstrlen)(str);
  ------------------
  |  |   23|  50.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  50.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  875|  50.0k|        return str[n-1];
  876|  50.0k|    }
  877|    311|    return 0;
  878|  50.3k|}
lexer.c:ExpectsContent:
 2192|   897k|{
 2193|   897k|    if (node->type != StartTag)
  ------------------
  |  Branch (2193:9): [True: 18.7k, False: 878k]
  ------------------
 2194|  18.7k|        return no;
 2195|       |
 2196|       |    /* unknown element? */
 2197|   878k|    if (node->tag == NULL)
  ------------------
  |  Branch (2197:9): [True: 122k, False: 756k]
  ------------------
 2198|   122k|        return yes;
 2199|       |
 2200|   756k|    if (node->tag->model & CM_EMPTY)
  ------------------
  |  |  139|   756k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (2200:9): [True: 29.7k, False: 727k]
  ------------------
 2201|  29.7k|        return no;
 2202|       |
 2203|   727k|    return yes;
 2204|   756k|}
lexer.c:NewToken:
 1602|   263k|{
 1603|   263k|    Lexer* lexer = doc->lexer;
 1604|   263k|    Node* node = TY_(NewNode)(lexer->allocator, lexer);
  ------------------
  |  |   23|   263k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   263k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1605|   263k|    node->type = type;
 1606|   263k|    node->start = lexer->txtstart;
 1607|   263k|    node->end = lexer->txtend;
 1608|   263k|    return node;
 1609|   263k|}
lexer.c:ParseDocTypeDecl:
 4284|  46.4k|{
 4285|  46.4k|    Lexer *lexer = doc->lexer;
 4286|  46.4k|    int start = lexer->lexsize;
 4287|  46.4k|    ParseDocTypeDeclState state = DT_DOCTYPENAME;
 4288|  46.4k|    uint c;
 4289|  46.4k|    uint delim = 0;
 4290|  46.4k|    Bool hasfpi = yes;
 4291|       |
 4292|  46.4k|    Node* node = TY_(NewNode)(lexer->allocator, lexer);
  ------------------
  |  |   23|  46.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4293|  46.4k|    node->type = DocTypeTag;
 4294|  46.4k|    node->start = lexer->txtstart;
 4295|  46.4k|    node->end = lexer->txtend;
 4296|       |
 4297|  46.4k|    lexer->waswhite = no;
 4298|       |
 4299|       |    /* todo: reset lexer->lexsize when appropriate to avoid wasting memory */
 4300|       |
 4301|  1.53M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|  1.53M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.53M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|  1.53M|#define EndOfStream (~0u)
  ------------------
  |  Branch (4301:12): [True: 1.53M, False: 315]
  ------------------
 4302|  1.53M|    {
 4303|       |        /* convert newlines to spaces */
 4304|  1.53M|        if (state != DT_INTSUBSET)
  ------------------
  |  Branch (4304:13): [True: 1.35M, False: 177k]
  ------------------
 4305|  1.35M|            c = c == '\n' ? ' ' : c;
  ------------------
  |  Branch (4305:17): [True: 1.91k, False: 1.35M]
  ------------------
 4306|       |
 4307|       |        /* convert white-space sequences to single space character */
 4308|  1.53M|        if (TY_(IsWhite)(c) && state != DT_INTSUBSET)
  ------------------
  |  |   23|  1.53M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.53M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4308:13): [True: 409k, False: 1.12M]
  |  Branch (4308:32): [True: 248k, False: 160k]
  ------------------
 4309|   248k|        {
 4310|   248k|            if (!lexer->waswhite)
  ------------------
  |  Branch (4310:17): [True: 29.5k, False: 218k]
  ------------------
 4311|  29.5k|            {
 4312|  29.5k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  29.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4313|  29.5k|                lexer->waswhite = yes;
 4314|  29.5k|            }
 4315|   218k|            else
 4316|   218k|            {
 4317|       |                /* discard space */
 4318|   218k|                continue;
 4319|   218k|            }
 4320|   248k|        }
 4321|  1.28M|        else
 4322|  1.28M|        {
 4323|  1.28M|            TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  1.28M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.28M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4324|  1.28M|            lexer->waswhite = no;
 4325|  1.28M|        }
 4326|       |
 4327|  1.31M|        switch(state)
  ------------------
  |  Branch (4327:16): [True: 1.31M, False: 0]
  ------------------
 4328|  1.31M|        {
 4329|  83.3k|        case DT_INTERMEDIATE:
  ------------------
  |  Branch (4329:9): [True: 83.3k, False: 1.23M]
  ------------------
 4330|       |            /* determine what's next */
 4331|  83.3k|            if (TY_(ToUpper)(c) == 'P' || TY_(ToUpper)(c) == 'S')
  ------------------
  |  |   23|  83.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  83.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(ToUpper)(c) == 'P' || TY_(ToUpper)(c) == 'S')
  ------------------
  |  |   23|  82.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  82.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4331:17): [True: 1.15k, False: 82.2k]
  |  Branch (4331:43): [True: 677, False: 81.5k]
  ------------------
 4332|  1.83k|            {
 4333|  1.83k|                start = lexer->lexsize - 1;
 4334|  1.83k|                state = DT_PUBLICSYSTEM;
 4335|  1.83k|                continue;
 4336|  1.83k|            }
 4337|  81.5k|            else if (c == '[')
  ------------------
  |  Branch (4337:22): [True: 1.45k, False: 80.1k]
  ------------------
 4338|  1.45k|            {
 4339|  1.45k|                start = lexer->lexsize;
 4340|  1.45k|                state = DT_INTSUBSET;
 4341|  1.45k|                continue;
 4342|  1.45k|            }
 4343|  80.1k|            else if (c == '\'' || c == '"')
  ------------------
  |  Branch (4343:22): [True: 17.1k, False: 62.9k]
  |  Branch (4343:35): [True: 806, False: 62.1k]
  ------------------
 4344|  17.9k|            {
 4345|  17.9k|                start = lexer->lexsize;
 4346|  17.9k|                delim = c;
 4347|  17.9k|                state = DT_QUOTEDSTRING;
 4348|  17.9k|                continue;
 4349|  17.9k|            }
 4350|  62.1k|            else if (c == '>')
  ------------------
  |  Branch (4350:22): [True: 46.1k, False: 15.9k]
  ------------------
 4351|  46.1k|            {
 4352|  46.1k|                AttVal* si;
 4353|       |
 4354|  46.1k|                node->end = --(lexer->lexsize);
 4355|       |
 4356|  46.1k|                si = TY_(GetAttrByName)(node, "SYSTEM");
  ------------------
  |  |   23|  46.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4357|  46.1k|                if (si)
  ------------------
  |  Branch (4357:21): [True: 4.98k, False: 41.1k]
  ------------------
 4358|  4.98k|                    TY_(CheckUrl)(doc, node, si);
  ------------------
  |  |   23|  4.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4359|       |
 4360|  46.1k|                if (!node->element || !IsValidXMLElemName(node->element))
  ------------------
  |  |  210|  24.2k|#define IsValidXMLElemName(name) TY_(IsValidXMLID)(name)
  |  |  ------------------
  |  |  |  |   23|  24.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  24.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4360:21): [True: 21.8k, False: 24.2k]
  |  Branch (4360:39): [True: 3.98k, False: 20.2k]
  ------------------
 4361|  25.8k|                {
 4362|  25.8k|                    TY_(Report)(doc, NULL, NULL, MALFORMED_DOCTYPE);
  ------------------
  |  |   23|  25.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  25.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4363|  25.8k|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  25.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  25.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4364|  25.8k|                    return NULL;
 4365|  25.8k|                }
 4366|  20.2k|                return node;
 4367|  46.1k|            }
 4368|  15.9k|            else
 4369|  15.9k|            {
 4370|       |                /* error */
 4371|  15.9k|            }
 4372|  15.9k|            break;
 4373|   726k|        case DT_DOCTYPENAME:
  ------------------
  |  Branch (4373:9): [True: 726k, False: 587k]
  ------------------
 4374|       |            /* read document type name */
 4375|   726k|            if (TY_(IsWhite)(c) || c == '>' || c == '[')
  ------------------
  |  |   23|   726k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   726k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4375:17): [True: 12.0k, False: 714k]
  |  Branch (4375:36): [True: 33.5k, False: 681k]
  |  Branch (4375:48): [True: 822, False: 680k]
  ------------------
 4376|  46.3k|            {
 4377|  46.3k|                node->element = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  46.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4378|  46.3k|                                                lexer->lexbuf + start,
 4379|  46.3k|                                                lexer->lexsize - start - 1);
 4380|  46.3k|                if (c == '>' || c == '[')
  ------------------
  |  Branch (4380:21): [True: 33.5k, False: 12.8k]
  |  Branch (4380:33): [True: 822, False: 12.0k]
  ------------------
 4381|  34.3k|                {
 4382|  34.3k|                    --(lexer->lexsize);
 4383|  34.3k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  34.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4384|  34.3k|                }
 4385|       |
 4386|  46.3k|                state = DT_INTERMEDIATE;
 4387|  46.3k|                continue;
 4388|  46.3k|            }
 4389|   680k|            break;
 4390|   680k|        case DT_PUBLICSYSTEM:
  ------------------
  |  Branch (4390:9): [True: 5.48k, False: 1.30M]
  ------------------
 4391|       |            /* read PUBLIC/SYSTEM */
 4392|  5.48k|            if (TY_(IsWhite)(c) || c == '>')
  ------------------
  |  |   23|  5.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4392:17): [True: 975, False: 4.51k]
  |  Branch (4392:36): [True: 830, False: 3.68k]
  ------------------
 4393|  1.80k|            {
 4394|  1.80k|                char *attname = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  1.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4395|  1.80k|                                                lexer->lexbuf + start,
 4396|  1.80k|                                                lexer->lexsize - start - 1);
 4397|  1.80k|                hasfpi = !(TY_(tmbstrcasecmp)(attname, "SYSTEM") == 0);
  ------------------
  |  |   23|  1.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4398|       |
 4399|  1.80k|                TidyDocFree(doc, attname);
  ------------------
  |  |  159|  1.80k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  1.80k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 4400|       |
 4401|       |                /* todo: report an error if SYSTEM/PUBLIC not uppercase */
 4402|       |
 4403|  1.80k|                if (c == '>')
  ------------------
  |  Branch (4403:21): [True: 830, False: 975]
  ------------------
 4404|    830|                {
 4405|    830|                    --(lexer->lexsize);
 4406|    830|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    830|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    830|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4407|    830|                }
 4408|       |
 4409|  1.80k|                state = DT_INTERMEDIATE;
 4410|  1.80k|                continue;
 4411|  1.80k|            }
 4412|  3.68k|            break;
 4413|   320k|        case DT_QUOTEDSTRING:
  ------------------
  |  Branch (4413:9): [True: 320k, False: 993k]
  ------------------
 4414|       |            /* read quoted string */
 4415|   320k|            if (c == delim)
  ------------------
  |  Branch (4415:17): [True: 17.9k, False: 303k]
  ------------------
 4416|  17.9k|            {
 4417|  17.9k|                char *value = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  17.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4418|  17.9k|                                              lexer->lexbuf + start,
 4419|  17.9k|                                              lexer->lexsize - start - 1);
 4420|  17.9k|                AttVal* att = TY_(AddAttribute)(doc, node, hasfpi ? "PUBLIC" : "SYSTEM", value);
  ------------------
  |  |   23|  17.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4420:60): [True: 10.7k, False: 7.14k]
  ------------------
 4421|  17.9k|                TidyDocFree(doc, value);
  ------------------
  |  |  159|  17.9k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  17.9k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 4422|  17.9k|                att->delim = delim;
 4423|  17.9k|                hasfpi = no;
 4424|  17.9k|                state = DT_INTERMEDIATE;
 4425|  17.9k|                delim = 0;
 4426|  17.9k|                continue;
 4427|  17.9k|            }
 4428|   303k|            break;
 4429|   303k|        case DT_INTSUBSET:
  ------------------
  |  Branch (4429:9): [True: 177k, False: 1.13M]
  ------------------
 4430|       |            /* read internal subset */
 4431|   177k|            if (c == ']')
  ------------------
  |  Branch (4431:17): [True: 1.40k, False: 176k]
  ------------------
 4432|  1.40k|            {
 4433|  1.40k|                Node* subset;
 4434|  1.40k|                lexer->txtstart = start;
 4435|  1.40k|                lexer->txtend = lexer->lexsize - 1;
 4436|  1.40k|                subset = TY_(TextToken)(lexer);
  ------------------
  |  |   23|  1.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4437|  1.40k|                TY_(InsertNodeAtEnd)(node, subset);
  ------------------
  |  |   23|  1.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4438|  1.40k|                state = DT_INTERMEDIATE;
 4439|  1.40k|            }
 4440|   177k|            break;
 4441|  1.31M|        }
 4442|  1.31M|    }
 4443|       |
 4444|       |    /* document type declaration not finished */
 4445|    315|    TY_(Report)(doc, NULL, NULL, MALFORMED_DOCTYPE);
  ------------------
  |  |   23|    315|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    315|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4446|    315|    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    315|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    315|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4447|       |    return NULL;
 4448|  46.4k|}
lexer.c:FindGivenVersion:
 1815|  14.6k|{
 1816|  14.6k|    AttVal * fpi = TY_(GetAttrByName)(doctype, "PUBLIC");
  ------------------
  |  |   23|  14.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1817|  14.6k|    uint vers;
 1818|       |
 1819|  14.6k|    if (!fpi || !fpi->value) 
  ------------------
  |  Branch (1819:9): [True: 9.25k, False: 5.37k]
  |  Branch (1819:17): [True: 1.64k, False: 3.73k]
  ------------------
 1820|  10.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|  10.8k|        if (doctype->element && (TY_(tmbstrcasecmp)(doctype->element,"html") == 0))
  ------------------
  |  |   23|  10.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1825:13): [True: 10.8k, False: 0]
  |  Branch (1825:33): [True: 212, False: 10.6k]
  ------------------
 1826|    212|        {
 1827|    212|            return VERS_HTML5;  /* TODO: do we need to check MORE? */
  ------------------
  |  |  213|    212|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|    212|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|    212|#define XH50              262144u
  |  |  ------------------
  ------------------
 1828|    212|        }
 1829|       |        /* TODO: Consider warning, error message */
 1830|  10.6k|        return VERS_UNKNOWN;
  ------------------
  |  |  204|  10.6k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  10.6k|#define xxxx                   0u
  |  |  ------------------
  ------------------
 1831|  10.8k|    }
 1832|  3.73k|    vers = GetVersFromFPI(fpi->value);
 1833|       |
 1834|  3.73k|    if (VERS_XHTML & vers)
  ------------------
  |  |  222|  3.73k|#define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  185|  3.73k|#define X10S                 256u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  186|  3.73k|#define X10T                 512u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  187|  3.73k|#define X10F                1024u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  188|  3.73k|#define XH11                2048u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  189|  3.73k|#define XB10                4096u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  201|  3.73k|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (1834:9): [True: 171, False: 3.55k]
  ------------------
 1835|    171|    {
 1836|    171|        TY_(SetOptionBool)(doc, TidyXmlOut, yes);
  ------------------
  |  |   23|    171|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    171|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1837|    171|        TY_(SetOptionBool)(doc, TidyXhtmlOut, yes);
  ------------------
  |  |   23|    171|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    171|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1838|    171|        doc->lexer->isvoyager = yes;
 1839|    171|    }
 1840|       |
 1841|       |    /* todo: add a warning if case does not match? */
 1842|  3.73k|    TidyDocFree(doc, fpi->value);
  ------------------
  |  |  159|  3.73k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.73k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1843|  3.73k|    fpi->value = TY_(tmbstrdup)(doc->allocator, GetFPIFromVers(vers));
  ------------------
  |  |   23|  3.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1844|       |
 1845|  3.73k|    return vers;
 1846|  14.6k|}
lexer.c:GetVersFromFPI:
  333|  3.73k|{
  334|  3.73k|    uint i;
  335|       |
  336|  73.5k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (336:17): [True: 69.9k, False: 3.55k]
  ------------------
  337|  69.9k|        if (W3C_Doctypes[i].fpi != NULL && TY_(tmbstrcasecmp)(W3C_Doctypes[i].fpi, fpi) == 0)
  ------------------
  |  |   23|  62.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  62.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (337:13): [True: 62.8k, False: 7.11k]
  |  Branch (337:44): [True: 171, False: 62.6k]
  ------------------
  338|    171|            return W3C_Doctypes[i].vers;
  339|       |
  340|  3.55k|    return 0;
  341|  3.73k|}
lexer.c:ParseAttribute:
 3594|   537k|{
 3595|   537k|    Lexer* lexer = doc->lexer;
 3596|   537k|    int start, len = 0;
 3597|   537k|    tmbstr attr = NULL;
 3598|   537k|    uint c, lastc;
 3599|       |
 3600|   537k|    *asp = NULL;  /* clear asp pointer */
 3601|   537k|    *php = NULL;  /* clear php pointer */
 3602|       |
 3603|       | /* skip white space before the attribute */
 3604|       |
 3605|   537k|    for (;;)
 3606|   649k|    {
 3607|   649k|        c = TY_(ReadChar)( doc->docIn );
  ------------------
  |  |   23|   649k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   649k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3608|       |
 3609|       |
 3610|   649k|        if (c == '/')
  ------------------
  |  Branch (3610:13): [True: 27.8k, False: 621k]
  ------------------
 3611|  27.8k|        {
 3612|  27.8k|            c = TY_(ReadChar)( doc->docIn );
  ------------------
  |  |   23|  27.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3613|       |
 3614|  27.8k|            if (c == '>')
  ------------------
  |  Branch (3614:17): [True: 18.3k, False: 9.55k]
  ------------------
 3615|  18.3k|            {
 3616|  18.3k|                *isempty = yes;
 3617|  18.3k|                return NULL;
 3618|  18.3k|            }
 3619|       |
 3620|  9.55k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  9.55k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.55k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3621|  9.55k|            c = '/';
 3622|  9.55k|            break;
 3623|  27.8k|        }
 3624|       |
 3625|   621k|        if (c == '>')
  ------------------
  |  Branch (3625:13): [True: 59.5k, False: 561k]
  ------------------
 3626|  59.5k|            return NULL;
 3627|       |
 3628|   561k|        if (c =='<')
  ------------------
  |  Branch (3628:13): [True: 272k, False: 289k]
  ------------------
 3629|   272k|        {
 3630|   272k|            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   272k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   272k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3631|       |
 3632|   272k|            if (c == '%')
  ------------------
  |  Branch (3632:17): [True: 5.04k, False: 267k]
  ------------------
 3633|  5.04k|            {
 3634|  5.04k|                *asp = ParseAsp( doc );
 3635|  5.04k|                return NULL;
 3636|  5.04k|            }
 3637|   267k|            else if (c == '?')
  ------------------
  |  Branch (3637:22): [True: 7.52k, False: 259k]
  ------------------
 3638|  7.52k|            {
 3639|  7.52k|                *php = ParsePhp( doc );
 3640|  7.52k|                return NULL;
 3641|  7.52k|            }
 3642|       |
 3643|   259k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   259k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   259k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3644|   259k|            TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|   259k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   259k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3645|   259k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|   259k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   259k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3646|   259k|            return NULL;
 3647|   272k|        }
 3648|       |
 3649|   289k|        if (c == '=')
  ------------------
  |  Branch (3649:13): [True: 3.02k, False: 286k]
  ------------------
 3650|  3.02k|        {
 3651|  3.02k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_EQUALSIGN );
  ------------------
  |  |   23|  3.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3652|  3.02k|            continue;
 3653|  3.02k|        }
 3654|       |
 3655|   286k|        if (c == '"' || c == '\'')
  ------------------
  |  Branch (3655:13): [True: 962, False: 285k]
  |  Branch (3655:25): [True: 608, False: 284k]
  ------------------
 3656|  1.57k|        {
 3657|  1.57k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_QUOTEMARK );
  ------------------
  |  |   23|  1.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3658|  1.57k|            continue;
 3659|  1.57k|        }
 3660|       |
 3661|   284k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   284k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3661:13): [True: 66, False: 284k]
  ------------------
 3662|     66|        {
 3663|     66|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|     66|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     66|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3664|     66|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     66|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     66|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3665|     66|            return NULL;
 3666|     66|        }
 3667|       |
 3668|       |
 3669|   284k|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|   284k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   284k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3669:13): [True: 177k, False: 107k]
  ------------------
 3670|   177k|           break;
 3671|   284k|    }
 3672|       |
 3673|   186k|    start = lexer->lexsize;
 3674|   186k|    lastc = c;
 3675|       |
 3676|   186k|    for (;;)
 3677|  1.89M|    {
 3678|       |     /* but push back '=' for parseValue() */
 3679|  1.89M|        if (c == '=' || c == '>')
  ------------------
  |  Branch (3679:13): [True: 42.0k, False: 1.84M]
  |  Branch (3679:25): [True: 26.9k, False: 1.82M]
  ------------------
 3680|  69.0k|        {
 3681|  69.0k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  69.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  69.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3682|  69.0k|            break;
 3683|  69.0k|        }
 3684|       |
 3685|  1.82M|        if (c == '<' || c == EndOfStream)
  ------------------
  |  | 1064|  1.75M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3685:13): [True: 70.4k, False: 1.75M]
  |  Branch (3685:25): [True: 1.36k, False: 1.74M]
  ------------------
 3686|  71.8k|        {
 3687|  71.8k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  71.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  71.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3688|  71.8k|            break;
 3689|  71.8k|        }
 3690|       |
 3691|  1.74M|        if (lastc == '-' && (c == '"' || c == '\''))
  ------------------
  |  Branch (3691:13): [True: 7.95k, False: 1.74M]
  |  Branch (3691:30): [True: 202, False: 7.75k]
  |  Branch (3691:42): [True: 707, False: 7.04k]
  ------------------
 3692|    909|        {
 3693|    909|            lexer->lexsize--;
 3694|    909|            --len;
 3695|    909|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    909|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    909|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3696|    909|            break;
 3697|    909|        }
 3698|       |
 3699|  1.74M|        if (TY_(IsWhite)(c))
  ------------------
  |  |   23|  1.74M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.74M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3699:13): [True: 44.6k, False: 1.70M]
  ------------------
 3700|  44.6k|            break;
 3701|       |
 3702|  1.70M|        if (c == '/') /* Issue #395 - potential self closing tag */
  ------------------
  |  Branch (3702:13): [True: 11.0k, False: 1.69M]
  ------------------
 3703|  11.0k|        {
 3704|  11.0k|            c = TY_(ReadChar)(doc->docIn);  /* read next */
  ------------------
  |  |   23|  11.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3705|  11.0k|            if (c == '>')
  ------------------
  |  Branch (3705:17): [True: 496, False: 10.5k]
  ------------------
 3706|    496|            {
 3707|       |                /* got a self closing tag - put is back and continue... */
 3708|    496|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    496|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    496|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3709|    496|                break;
 3710|    496|            }
 3711|  10.5k|            else
 3712|  10.5k|            {
 3713|       |                /* Not '/>' - put it back */
 3714|  10.5k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  10.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3715|  10.5k|                c = '/';  /* restore original char */
 3716|  10.5k|            }
 3717|  11.0k|        }
 3718|       |
 3719|       |        /* what should be done about non-namechar characters? */
 3720|       |        /* currently these are incorporated into the attr name */
 3721|       |
 3722|  1.70M|        if ( cfg(doc, TidyUpperCaseAttrs) != TidyUppercasePreserve )
  ------------------
  |  |  415|  1.70M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (3722:14): [True: 1.70M, False: 0]
  ------------------
 3723|  1.70M|        {
 3724|  1.70M|            if ( !cfgBool(doc, TidyXmlTags) && TY_(IsUpper)(c) )
  ------------------
  |  |  418|  3.40M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.70M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                          if ( !cfgBool(doc, TidyXmlTags) && TY_(IsUpper)(c) )
  ------------------
  |  |   23|  1.70M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.70M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3724:18): [True: 1.70M, False: 0]
  |  Branch (3724:48): [True: 95.5k, False: 1.60M]
  ------------------
 3725|  95.5k|                c = TY_(ToLower)(c);
  ------------------
  |  |   23|  95.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  95.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3726|  1.70M|        }
 3727|       |
 3728|  1.70M|        TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|  1.70M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.70M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3729|  1.70M|        lastc = c;
 3730|  1.70M|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.70M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.70M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3731|  1.70M|    }
 3732|       |
 3733|       |    /* handle attribute names with multibyte chars */
 3734|   186k|    len = lexer->lexsize - start;
 3735|   186k|    attr = (len > 0 ? TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|   186k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   186k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3735:13): [True: 186k, False: 610]
  ------------------
 3736|   186k|                                      lexer->lexbuf+start, len) : NULL);
 3737|   186k|    lexer->lexsize = start;
 3738|   186k|    return attr;
 3739|   537k|}
lexer.c:ParseAsp:
 3508|  5.04k|{
 3509|  5.04k|    Lexer* lexer = doc->lexer;
 3510|  5.04k|    uint c;
 3511|  5.04k|    Node *asp = NULL;
 3512|       |
 3513|  5.04k|    lexer->txtstart = lexer->lexsize;
 3514|       |
 3515|  5.04k|    for (;;)
 3516|  7.76M|    {
 3517|  7.76M|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  7.76M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.76M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  7.76M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3517:13): [True: 124, False: 7.76M]
  ------------------
 3518|    124|            break;
 3519|       |
 3520|  7.76M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  7.76M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.76M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3521|       |
 3522|       |
 3523|  7.76M|        if (c != '%')
  ------------------
  |  Branch (3523:13): [True: 7.76M, False: 7.59k]
  ------------------
 3524|  7.76M|            continue;
 3525|       |
 3526|  7.59k|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  7.59k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.59k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  7.59k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3526:13): [True: 4, False: 7.58k]
  ------------------
 3527|      4|            break;
 3528|       |
 3529|  7.58k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  7.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3530|       |
 3531|  7.58k|        if (c == '>')
  ------------------
  |  Branch (3531:13): [True: 4.91k, False: 2.67k]
  ------------------
 3532|  4.91k|        {
 3533|  4.91k|            lexer->lexsize -= 2;
 3534|  4.91k|            break;
 3535|  4.91k|        }
 3536|  7.58k|    }
 3537|       |
 3538|  5.04k|    lexer->txtend = lexer->lexsize;
 3539|  5.04k|    if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3539:9): [True: 4.81k, False: 231]
  ------------------
 3540|  4.81k|        asp = AspToken(doc);
  ------------------
  |  | 1614|  4.81k|#define AspToken(doc)     NewToken(doc, AspTag)
  ------------------
 3541|       |
 3542|  5.04k|    lexer->txtstart = lexer->txtend;
 3543|  5.04k|    return asp;
 3544|  5.04k|}   
lexer.c:ParsePhp:
 3552|  7.52k|{
 3553|  7.52k|    Lexer* lexer = doc->lexer;
 3554|  7.52k|    uint c;
 3555|  7.52k|    Node *php = NULL;
 3556|       |
 3557|  7.52k|    lexer->txtstart = lexer->lexsize;
 3558|       |
 3559|  7.52k|    for (;;)
 3560|  17.4M|    {
 3561|  17.4M|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  17.4M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.4M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  17.4M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3561:13): [True: 181, False: 17.4M]
  ------------------
 3562|    181|            break;
 3563|       |
 3564|  17.4M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  17.4M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.4M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3565|       |
 3566|       |
 3567|  17.4M|        if (c != '?')
  ------------------
  |  Branch (3567:13): [True: 17.4M, False: 10.8k]
  ------------------
 3568|  17.4M|            continue;
 3569|       |
 3570|  10.8k|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  10.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  10.8k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3570:13): [True: 13, False: 10.8k]
  ------------------
 3571|     13|            break;
 3572|       |
 3573|  10.8k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  10.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3574|       |
 3575|  10.8k|        if (c == '>')
  ------------------
  |  Branch (3575:13): [True: 7.33k, False: 3.47k]
  ------------------
 3576|  7.33k|        {
 3577|  7.33k|            lexer->lexsize -= 2;
 3578|  7.33k|            break;
 3579|  7.33k|        }
 3580|  10.8k|    }
 3581|       |
 3582|  7.52k|    lexer->txtend = lexer->lexsize;
 3583|  7.52k|    if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3583:9): [True: 7.32k, False: 203]
  ------------------
 3584|  7.32k|        php = PhpToken(doc);
  ------------------
  |  | 1616|  7.32k|#define PhpToken(doc)     NewToken(doc, PhpTag)
  ------------------
 3585|       |
 3586|  7.52k|    lexer->txtstart = lexer->txtend;
 3587|  7.52k|    return php;
 3588|  7.52k|}   
lexer.c:ParseValue:
 3842|   186k|{
 3843|   186k|    Lexer* lexer = doc->lexer;
 3844|   186k|    int len = 0, start;
 3845|   186k|    Bool seen_gt = no;
 3846|   186k|    Bool munge = yes;
 3847|   186k|    uint c, lastc, delim, quotewarning;
 3848|   186k|    tmbstr value;
 3849|       |
 3850|   186k|    delim = (tmbchar) 0;
 3851|   186k|    *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|   186k|    if ( cfgBool(doc, TidyLiteralAttribs) )
  ------------------
  |  |  418|   186k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   186k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 186k]
  |  |  ------------------
  ------------------
 3859|      0|        munge = no;
 3860|       |
 3861|       | /* skip white space before the '=' */
 3862|       |
 3863|   186k|    for (;;)
 3864|  1.59M|    {
 3865|  1.59M|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.59M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.59M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3866|       |
 3867|  1.59M|        if (c == EndOfStream)
  ------------------
  |  | 1064|  1.59M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3867:13): [True: 1.43k, False: 1.58M]
  ------------------
 3868|  1.43k|        {
 3869|  1.43k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.43k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.43k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3870|  1.43k|            break;
 3871|  1.43k|        }
 3872|       |
 3873|  1.58M|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|  1.58M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.58M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3873:13): [True: 184k, False: 1.40M]
  ------------------
 3874|   184k|           break;
 3875|  1.58M|    }
 3876|       |
 3877|       |/*
 3878|       |  c should be '=' if there is a value
 3879|       |  other legal possibilities are white
 3880|       |  space, '/' and '>'
 3881|       |*/
 3882|       |
 3883|   186k|    if (c != '=' && c != '"' && c != '\'')
  ------------------
  |  Branch (3883:9): [True: 144k, False: 42.1k]
  |  Branch (3883:21): [True: 143k, False: 248]
  |  Branch (3883:33): [True: 143k, False: 801]
  ------------------
 3884|   143k|    {
 3885|   143k|        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   143k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   143k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3886|   143k|        return NULL;
 3887|   143k|    }
 3888|       |
 3889|       | /* skip white space after '=' */
 3890|       |
 3891|  43.1k|    for (;;)
 3892|  65.8k|    {
 3893|  65.8k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  65.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  65.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3894|       |
 3895|  65.8k|        if (c == EndOfStream)
  ------------------
  |  | 1064|  65.8k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3895:13): [True: 68, False: 65.8k]
  ------------------
 3896|     68|        {
 3897|     68|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     68|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     68|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3898|     68|            break;
 3899|     68|        }
 3900|       |
 3901|  65.8k|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|  65.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  65.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3901:13): [True: 43.1k, False: 22.6k]
  ------------------
 3902|  43.1k|           break;
 3903|  65.8k|    }
 3904|       |
 3905|       | /* check for quote marks */
 3906|       |
 3907|  43.1k|    if (c == '"' || c == '\'')
  ------------------
  |  Branch (3907:9): [True: 6.51k, False: 36.6k]
  |  Branch (3907:21): [True: 637, False: 36.0k]
  ------------------
 3908|  7.14k|        delim = c;
 3909|  36.0k|    else if (c == '<')
  ------------------
  |  Branch (3909:14): [True: 2.82k, False: 33.2k]
  ------------------
 3910|  2.82k|    {
 3911|  2.82k|        start = lexer->lexsize;
 3912|  2.82k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  2.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3913|  2.82k|        *pdelim = ParseServerInstruction( doc );
 3914|  2.82k|        len = lexer->lexsize - start;
 3915|  2.82k|        lexer->lexsize = start;
 3916|  2.82k|        return (len > 0 ? TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  2.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3916:17): [True: 2.82k, False: 0]
  ------------------
 3917|  2.82k|                                          lexer->lexbuf+start, len) : NULL);
 3918|  2.82k|    }
 3919|  33.2k|    else
 3920|  33.2k|        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  33.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  33.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3921|       |
 3922|       | /*
 3923|       |   and read the value string
 3924|       |   check for quote mark if needed
 3925|       | */
 3926|       |
 3927|  40.3k|    quotewarning = 0;
 3928|  40.3k|    start = lexer->lexsize;
 3929|  40.3k|    c = '\0';
 3930|       |
 3931|  40.3k|    for (;;)
 3932|   458k|    {
 3933|   458k|        lastc = c;  /* track last character */
 3934|   458k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   458k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   458k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3935|       |
 3936|   458k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   458k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3936:13): [True: 1.39k, False: 457k]
  ------------------
 3937|  1.39k|        {
 3938|  1.39k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|  1.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3939|  1.39k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3940|  1.39k|            break;
 3941|  1.39k|        }
 3942|       |
 3943|   457k|        if (delim == (tmbchar)0)
  ------------------
  |  Branch (3943:13): [True: 329k, False: 128k]
  ------------------
 3944|   329k|        {
 3945|   329k|            if (c == '>')
  ------------------
  |  Branch (3945:17): [True: 3.30k, False: 325k]
  ------------------
 3946|  3.30k|            {
 3947|  3.30k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  3.30k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.30k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3948|  3.30k|                break;
 3949|  3.30k|            }
 3950|       |
 3951|   325k|            if (c == '"' || c == '\'')
  ------------------
  |  Branch (3951:17): [True: 1.48k, False: 324k]
  |  Branch (3951:29): [True: 1.24k, False: 323k]
  ------------------
 3952|  2.73k|            {
 3953|  2.73k|                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.73k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  2.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3960|  2.73k|                if (c == '>')
  ------------------
  |  Branch (3960:21): [True: 217, False: 2.51k]
  ------------------
 3961|    217|                {
 3962|    217|                    TY_(AddCharToLexer)(lexer, q);
  ------------------
  |  |   23|    217|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    217|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3963|    217|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    217|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    217|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3964|    217|                    break;
 3965|    217|                }
 3966|  2.51k|                else
 3967|  2.51k|                {
 3968|  2.51k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  2.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3969|  2.51k|                    c = q;
 3970|  2.51k|                }
 3971|  2.73k|            }
 3972|       |
 3973|   325k|            if (c == '<')
  ------------------
  |  Branch (3973:17): [True: 21.7k, False: 303k]
  ------------------
 3974|  21.7k|            {
 3975|  21.7k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  21.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3976|  21.7k|                c = '>';
 3977|  21.7k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  21.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3978|  21.7k|                TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|  21.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3979|  21.7k|                break;
 3980|  21.7k|            }
 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|   303k|            if (c == '/')
  ------------------
  |  Branch (3988:17): [True: 1.19k, False: 302k]
  ------------------
 3989|  1.19k|            {
 3990|       |                /* peek ahead in case of /> */
 3991|  1.19k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3992|       |
 3993|  1.19k|                if ( c == '>' && !TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|    644|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    644|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3993:22): [True: 644, False: 553]
  |  Branch (3993:34): [True: 449, False: 195]
  ------------------
 3994|    449|                {
 3995|    449|                    *isempty = yes;
 3996|    449|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    449|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    449|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3997|    449|                    break;
 3998|    449|                }
 3999|       |
 4000|       |                /* unget peeked character */
 4001|    748|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    748|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    748|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4002|    748|                c = '/';
 4003|    748|            }
 4004|   303k|        }
 4005|   128k|        else  /* delim is '\'' or '"' */
 4006|   128k|        {
 4007|   128k|            if (c == delim)
  ------------------
  |  Branch (4007:17): [True: 6.87k, False: 121k]
  ------------------
 4008|  6.87k|                break;
 4009|       |
 4010|   121k|            if (c == '\n' || c == '<' || c == '>')
  ------------------
  |  Branch (4010:17): [True: 4.08k, False: 117k]
  |  Branch (4010:30): [True: 7.63k, False: 109k]
  |  Branch (4010:42): [True: 5.95k, False: 103k]
  ------------------
 4011|  17.6k|                ++quotewarning;
 4012|       |
 4013|   121k|            if (c == '>')
  ------------------
  |  Branch (4013:17): [True: 5.95k, False: 115k]
  ------------------
 4014|  5.95k|                seen_gt = yes;
 4015|   121k|        }
 4016|       |
 4017|   424k|        if (c == '&')
  ------------------
  |  Branch (4017:13): [True: 4.55k, False: 420k]
  ------------------
 4018|  4.55k|        {
 4019|  4.55k|            TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  4.55k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.55k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4020|  4.55k|            ParseEntity( doc, IgnoreWhitespace );
 4021|  4.55k|            if (lexer->lexbuf[lexer->lexsize - 1] == '\n' && munge)
  ------------------
  |  Branch (4021:17): [True: 1.07k, False: 3.48k]
  |  Branch (4021:62): [True: 1.07k, False: 0]
  ------------------
 4022|  1.07k|                ChangeChar(lexer, ' ');
 4023|  4.55k|            continue;
 4024|  4.55k|        }
 4025|       |
 4026|       |        /*
 4027|       |         kludge for JavaScript attribute values
 4028|       |         with line continuations in string literals
 4029|       |        */
 4030|   420k|        if (c == '\\')
  ------------------
  |  Branch (4030:13): [True: 859, False: 419k]
  ------------------
 4031|    859|        {
 4032|    859|            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    859|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    859|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4033|       |
 4034|    859|            if (c != '\n')
  ------------------
  |  Branch (4034:17): [True: 486, False: 373]
  ------------------
 4035|    486|            {
 4036|    486|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    486|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    486|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4037|    486|                c = '\\';
 4038|    486|            }
 4039|    859|        }
 4040|       |
 4041|   420k|        if (TY_(IsWhite)(c))
  ------------------
  |  |   23|   420k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   420k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4041:13): [True: 24.5k, False: 395k]
  ------------------
 4042|  24.5k|        {
 4043|  24.5k|            if ( delim == 0 )
  ------------------
  |  Branch (4043:18): [True: 6.34k, False: 18.2k]
  ------------------
 4044|  6.34k|                break;
 4045|       |
 4046|  18.2k|            if (munge)
  ------------------
  |  Branch (4046:17): [True: 18.2k, False: 0]
  ------------------
 4047|  18.2k|            {
 4048|       |                /* discard line breaks in quoted URLs */ 
 4049|       |                /* #438650 - fix by Randy Waki */
 4050|  18.2k|                if ( c == '\n' && TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|  4.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4050:22): [True: 4.08k, False: 14.1k]
  |  Branch (4050:35): [True: 861, False: 3.22k]
  ------------------
 4051|    861|                {
 4052|       |                    /* warn that we discard this newline */
 4053|    861|                    TY_(ReportAttrError)( doc, lexer->token, NULL, NEWLINE_IN_URI);
  ------------------
  |  |   23|    861|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    861|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4054|    861|                    continue;
 4055|    861|                }
 4056|       |                
 4057|  17.3k|                c = ' ';
 4058|       |
 4059|  17.3k|                if (lastc == ' ')
  ------------------
  |  Branch (4059:21): [True: 11.0k, False: 6.37k]
  ------------------
 4060|  11.0k|                {
 4061|  11.0k|                    if (TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|  11.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4061:25): [True: 5.61k, False: 5.39k]
  ------------------
 4062|  5.61k|                        TY_(ReportAttrError)( doc, lexer->token, NULL, WHITE_IN_URI);
  ------------------
  |  |   23|  5.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4063|  11.0k|                    continue;
 4064|  11.0k|                }
 4065|  17.3k|            }
 4066|  18.2k|        }
 4067|   395k|        else if (foldCase && TY_(IsUpper)(c))
  ------------------
  |  |   23|  1.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4067:18): [True: 1.51k, False: 394k]
  |  Branch (4067:30): [True: 390, False: 1.12k]
  ------------------
 4068|    390|            c = TY_(ToLower)(c);
  ------------------
  |  |   23|    390|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    390|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4069|       |
 4070|   401k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   401k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   401k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4071|   401k|    }
 4072|       |
 4073|  40.3k|    if (quotewarning > 10 && seen_gt && munge)
  ------------------
  |  Branch (4073:9): [True: 1.15k, False: 39.2k]
  |  Branch (4073:30): [True: 937, False: 219]
  |  Branch (4073:41): [True: 937, False: 0]
  ------------------
 4074|    937|    {
 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|    937|        if ( !TY_(IsScript)(doc, name) &&
  ------------------
  |  |   23|    937|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    937|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4084:14): [True: 739, False: 198]
  ------------------
 4085|    739|             !(TY_(IsUrl)(doc, name) && TY_(tmbstrncmp)(lexer->lexbuf+start, "javascript:", 11) == 0) &&
  ------------------
  |  |   23|    739|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    739|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           !(TY_(IsUrl)(doc, name) && TY_(tmbstrncmp)(lexer->lexbuf+start, "javascript:", 11) == 0) &&
  ------------------
  |  |   23|    265|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    265|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4085:16): [True: 265, False: 474]
  |  Branch (4085:41): [True: 68, False: 197]
  ------------------
 4086|    671|             !(TY_(tmbstrncmp)(lexer->lexbuf+start, "<xml ", 5) == 0)
  ------------------
  |  |   23|    671|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    671|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4086:14): [True: 451, False: 220]
  ------------------
 4087|    937|           )
 4088|    451|            TY_(Report)( doc, NULL, NULL, SUSPECTED_MISSING_QUOTE ); 
  ------------------
  |  |   23|    451|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    451|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4089|    937|    }
 4090|       |
 4091|  40.3k|    len = lexer->lexsize - start;
 4092|  40.3k|    lexer->lexsize = start;
 4093|       |
 4094|       |
 4095|  40.3k|    if (len > 0 || delim)
  ------------------
  |  Branch (4095:9): [True: 38.1k, False: 2.18k]
  |  Branch (4095:20): [True: 703, False: 1.48k]
  ------------------
 4096|  38.8k|    {
 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|  38.8k|        if ((len > 0) && munge &&
  ------------------
  |  Branch (4102:13): [True: 38.1k, False: 703]
  |  Branch (4102:26): [True: 38.1k, False: 0]
  ------------------
 4103|  38.1k|            TY_(tmbstrcasecmp)(name, "alt") &&
  ------------------
  |  |   23|  38.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4103:13): [True: 37.9k, False: 204]
  ------------------
 4104|  37.9k|            TY_(tmbstrcasecmp)(name, "title") &&
  ------------------
  |  |   23|  37.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4104:13): [True: 37.6k, False: 287]
  ------------------
 4105|  37.6k|            TY_(tmbstrcasecmp)(name, "value") &&
  ------------------
  |  |   23|  37.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4105:13): [True: 37.4k, False: 206]
  ------------------
 4106|  37.4k|            TY_(tmbstrcasecmp)(name, "prompt"))
  ------------------
  |  |   23|  37.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4106:13): [True: 37.2k, False: 194]
  ------------------
 4107|  37.2k|        {
 4108|  38.2k|            while (TY_(IsWhite)(lexer->lexbuf[start+len-1]) && (len > 0))
  ------------------
  |  |   23|  38.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4108:20): [True: 923, False: 37.2k]
  |  Branch (4108:64): [True: 923, False: 0]
  ------------------
 4109|    923|                --len;
 4110|       |
 4111|       |            /* Issue #497 - Fix leading space trimming */
 4112|  37.8k|            while (TY_(IsWhite)(lexer->lexbuf[start]) && (len > 0))
  ------------------
  |  |   23|  37.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4112:20): [True: 619, False: 37.1k]
  |  Branch (4112:58): [True: 509, False: 110]
  ------------------
 4113|    509|            {
 4114|    509|                ++start;
 4115|    509|                --len;
 4116|    509|            }
 4117|  37.2k|        }
 4118|       |
 4119|  38.8k|        value = TY_(tmbstrndup)(doc->allocator, lexer->lexbuf + start, len);
  ------------------
  |  |   23|  38.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4120|  38.8k|    }
 4121|  1.48k|    else
 4122|  1.48k|        value = NULL;
 4123|       |
 4124|       |    /* note delimiter if given */
 4125|  40.3k|    *pdelim = delim;
 4126|       |
 4127|  40.3k|    return value;
 4128|  43.1k|}
lexer.c:ParseServerInstruction:
 3747|  2.82k|{
 3748|  2.82k|    Lexer* lexer = doc->lexer;
 3749|  2.82k|    uint c;
 3750|  2.82k|    int delim = '"';
 3751|  2.82k|    Bool isrule = no;
 3752|       |
 3753|  2.82k|    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  2.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3754|  2.82k|    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  2.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3755|       |
 3756|       |    /* check for ASP, PHP or Tango */
 3757|  2.82k|    if (c == '%' || c == '?' || c == '@')
  ------------------
  |  Branch (3757:9): [True: 264, False: 2.56k]
  |  Branch (3757:21): [True: 596, False: 1.96k]
  |  Branch (3757:33): [True: 226, False: 1.73k]
  ------------------
 3758|  1.08k|        isrule = yes;
 3759|       |
 3760|  2.82k|    for (;;)
 3761|  4.87M|    {
 3762|  4.87M|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  4.87M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.87M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3763|       |
 3764|  4.87M|        if (c == EndOfStream)
  ------------------
  |  | 1064|  4.87M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3764:13): [True: 181, False: 4.87M]
  ------------------
 3765|    181|            break;
 3766|       |
 3767|  4.87M|        if (c == '>')
  ------------------
  |  Branch (3767:13): [True: 1.37k, False: 4.87M]
  ------------------
 3768|  1.37k|        {
 3769|  1.37k|            if (isrule)
  ------------------
  |  Branch (3769:17): [True: 1.02k, False: 348]
  ------------------
 3770|  1.02k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  1.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3771|    348|            else
 3772|    348|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    348|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    348|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3773|       |
 3774|  1.37k|            break;
 3775|  1.37k|        }
 3776|       |
 3777|       |        /* if not recognized as ASP, PHP or Tango */
 3778|       |        /* then also finish value on whitespace */
 3779|  4.87M|        if (!isrule)
  ------------------
  |  Branch (3779:13): [True: 3.29M, False: 1.57M]
  ------------------
 3780|  3.29M|        {
 3781|  3.29M|            if (TY_(IsWhite)(c))
  ------------------
  |  |   23|  3.29M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.29M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3781:17): [True: 641, False: 3.29M]
  ------------------
 3782|    641|                break;
 3783|  3.29M|        }
 3784|       |
 3785|  4.87M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  4.87M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.87M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3786|       |
 3787|  4.87M|        if (c == '"')
  ------------------
  |  Branch (3787:13): [True: 670, False: 4.87M]
  ------------------
 3788|    670|        {
 3789|    670|            do
 3790|  2.98k|            {
 3791|  2.98k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  2.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3792|  2.98k|                if (c == EndOfStream) /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  | 1064|  2.98k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3792:21): [True: 27, False: 2.95k]
  ------------------
 3793|     27|                {
 3794|     27|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|     27|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     27|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3795|     27|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     27|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     27|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3796|     27|                    return 0;
 3797|     27|                }
 3798|  2.95k|                if (c == '>') /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  Branch (3798:21): [True: 225, False: 2.73k]
  ------------------
 3799|    225|                {
 3800|    225|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    225|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    225|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3801|    225|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|    225|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    225|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3802|    225|                    return 0;
 3803|    225|                }
 3804|  2.73k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  2.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3805|  2.73k|            }
 3806|  2.73k|            while (c != '"');
  ------------------
  |  Branch (3806:20): [True: 2.31k, False: 418]
  ------------------
 3807|    418|            delim = '\'';
 3808|    418|            continue;
 3809|    670|        }
 3810|       |
 3811|  4.87M|        if (c == '\'')
  ------------------
  |  Branch (3811:13): [True: 628, False: 4.87M]
  ------------------
 3812|    628|        {
 3813|    628|            do
 3814|  78.9k|            {
 3815|  78.9k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  78.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  78.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3816|  78.9k|                if (c == EndOfStream) /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  | 1064|  78.9k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3816:21): [True: 30, False: 78.9k]
  ------------------
 3817|     30|                {
 3818|     30|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|     30|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     30|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3819|     30|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     30|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     30|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3820|     30|                    return 0;
 3821|     30|                }
 3822|  78.9k|                if (c == '>') /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  Branch (3822:21): [True: 349, False: 78.6k]
  ------------------
 3823|    349|                {
 3824|    349|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    349|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    349|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3825|    349|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|    349|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    349|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3826|    349|                    return 0;
 3827|    349|                }
 3828|  78.6k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  78.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  78.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3829|  78.6k|            }
 3830|  78.6k|            while (c != '\'');
  ------------------
  |  Branch (3830:20): [True: 78.3k, False: 249]
  ------------------
 3831|    628|        }
 3832|  4.87M|    }
 3833|       |
 3834|  2.19k|    return delim;
 3835|  2.82k|}
lexer.c:MapStr:
 3471|   149k|{
 3472|  1.91M|    while ( *str )
  ------------------
  |  Branch (3472:13): [True: 1.76M, False: 149k]
  ------------------
 3473|  1.76M|    {
 3474|  1.76M|        uint i = (byte) *str++;
 3475|  1.76M|        lexmap[i] |= code;
 3476|  1.76M|    }
 3477|   149k|}
lexer.c:AddAttrToList:
 4174|   262k|{
 4175|   262k|  if ( *list == NULL )
  ------------------
  |  Branch (4175:8): [True: 163k, False: 99.2k]
  ------------------
 4176|   163k|    *list = av;
 4177|  99.2k|  else
 4178|  99.2k|  {
 4179|  99.2k|    AttVal* here = *list;
 4180|   528k|    while ( here->next )
  ------------------
  |  Branch (4180:13): [True: 428k, False: 99.2k]
  ------------------
 4181|   428k|      here = here->next;
 4182|  99.2k|    here->next = av;
 4183|  99.2k|  }
 4184|   262k|}

prvTidyinitFileSource:
   52|  21.3k|{
   53|  21.3k|    MappedFileSource* fin;
   54|  21.3k|    struct stat sbuf;
   55|  21.3k|    int fd;
   56|       |
   57|  21.3k|    fin = (MappedFileSource*) TidyAlloc( allocator, sizeof(MappedFileSource) );
  ------------------
  |  |   66|  21.3k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
   58|  21.3k|    if ( !fin )
  ------------------
  |  Branch (58:10): [True: 0, False: 21.3k]
  ------------------
   59|      0|        return -1;
   60|       |
   61|  21.3k|    fd = fileno(fp);
   62|  21.3k|    if ( fstat(fd, &sbuf) == -1
  ------------------
  |  Branch (62:10): [True: 0, False: 21.3k]
  ------------------
   63|  21.3k|         || sbuf.st_size == 0
  ------------------
  |  Branch (63:13): [True: 0, False: 21.3k]
  ------------------
   64|  21.3k|         || (fin->base = mmap(0, fin->size = sbuf.st_size, PROT_READ,
  ------------------
  |  Branch (64:13): [True: 0, False: 21.3k]
  ------------------
   65|  21.3k|                              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|  21.3k|    fin->pos = 0;
   73|  21.3k|    fin->allocator = allocator;
   74|  21.3k|    fclose(fp);
   75|       |
   76|  21.3k|    inp->getByte    = mapped_getByte;
   77|  21.3k|    inp->eof        = mapped_eof;
   78|  21.3k|    inp->ungetByte  = mapped_ungetByte;
   79|  21.3k|    inp->sourceData = fin;
   80|       |
   81|  21.3k|    return 0;
   82|  21.3k|}
prvTidyfreeFileSource:
   85|  21.3k|{
   86|  21.3k|    if ( inp->getByte == mapped_getByte )
  ------------------
  |  Branch (86:10): [True: 21.3k, False: 0]
  ------------------
   87|  21.3k|    {
   88|  21.3k|        MappedFileSource* fin = (MappedFileSource*) inp->sourceData;
   89|  21.3k|        munmap( (void*)fin->base, fin->size );
   90|  21.3k|        TidyFree( fin->allocator, fin );
  ------------------
  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
   91|  21.3k|    }
   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|  21.3k|}
mappedio.c:mapped_getByte:
   34|  76.6M|{
   35|  76.6M|    MappedFileSource* fin = (MappedFileSource*) sourceData;
   36|  76.6M|    return fin->base[fin->pos++];
   37|  76.6M|}
mappedio.c:mapped_eof:
   40|  78.1M|{
   41|  78.1M|    MappedFileSource* fin = (MappedFileSource*) sourceData;
   42|  78.1M|    return (fin->pos >= fin->size);
   43|  78.1M|}
mappedio.c:mapped_ungetByte:
   46|   541k|{
   47|   541k|    MappedFileSource* fin = (MappedFileSource*) sourceData;
   48|   541k|    fin->pos--;
   49|   541k|}

prvTidytidyLibraryVersion:
   31|  21.3k|{
   32|  21.3k|  return TY_(library_version);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   33|  21.3k|}
prvTidyReport:
  943|  9.68M|{
  944|  9.68M|    va_list args;
  945|  9.68M|    va_start(args, code);
  946|  9.68M|    vReport(doc, element, node, code, args);
  947|       |    va_end(args);
  948|  9.68M|}
prvTidyReportAttrError:
  965|  1.13M|{
  966|  1.13M|    TY_(Report)( doc, NULL, node, code, av );
  ------------------
  |  |   23|  1.13M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  967|  1.13M|}
prvTidyReportEntityError:
  978|   207k|{
  979|       |    /* Note that the report formatter currently doesn't use argument c */
  980|   207k|    TY_(Report)( doc, NULL, NULL, code, entity, c );
  ------------------
  |  |   23|   207k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   207k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  981|   207k|}
prvTidyReportEncodingError:
  991|  1.56M|{
  992|  1.56M|    TY_(Report)( doc, NULL, NULL, code, c, discarded );
  ------------------
  |  |   23|  1.56M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  993|  1.56M|}
prvTidyReportEncodingWarning:
  996|    180|{
  997|       |    /* va_list in formatter expects trailing `no` argument */
  998|    180|    TY_(Report)( doc, NULL, NULL, code, encoding, no );
  ------------------
  |  |   23|    180|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    180|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  999|    180|}
prvTidyReportMissingAttr:
 1003|  8.09k|{
 1004|  8.09k|    TY_(Report)( doc, NULL, node, MISSING_ATTRIBUTE, name );
  ------------------
  |  |   23|  8.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1005|  8.09k|}
prvTidyReportSurrogateError:
 1009|  5.04k|{
 1010|  5.04k|    TY_(Report)( doc, NULL, NULL, code, c1,c2 );
  ------------------
  |  |   23|  5.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1011|  5.04k|}
prvTidyDialogue:
 1130|  26.5k|{
 1131|  26.5k|    int i = 0;
 1132|  26.5k|    va_list args;
 1133|       |
 1134|   130k|    while ( dialogueDispatchTable[i].code != 0 )
  ------------------
  |  Branch (1134:13): [True: 130k, False: 0]
  ------------------
 1135|   130k|    {
 1136|   130k|        if ( dialogueDispatchTable[i].code == code )
  ------------------
  |  Branch (1136:14): [True: 26.5k, False: 103k]
  ------------------
 1137|  26.5k|        {
 1138|  26.5k|            TidyMessageImpl *message;
 1139|  26.5k|            TidyReportLevel level = dialogueDispatchTable[i].level;
 1140|  26.5k|            va_start(args, code);
 1141|  26.5k|            message = formatDialogue( doc, code, level, args );
 1142|  26.5k|            va_end(args);
 1143|  26.5k|            messageOut( message );
 1144|  26.5k|            break;
 1145|  26.5k|        }
 1146|   103k|        i++;
 1147|   103k|    }
 1148|  26.5k|}
prvTidyReportMarkupVersion:
 1274|  21.3k|{
 1275|  21.3k|    if ( doc->givenDoctype )
  ------------------
  |  Branch (1275:10): [True: 121, False: 21.1k]
  ------------------
 1276|    121|        TY_(Report)( doc, NULL, NULL, STRING_DOCTYPE_GIVEN, doc->givenDoctype );
  ------------------
  |  |   23|    121|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    121|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1277|       |
 1278|  21.3k|    if ( ! cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1278:10): [True: 21.3k, False: 0]
  ------------------
 1279|  21.3k|    {
 1280|  21.3k|        Bool isXhtml = doc->lexer->isvoyager;
 1281|  21.3k|        uint apparentVers = TY_(ApparentVersion)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1282|  21.3k|        ctmbstr vers = TY_(HTMLVersionNameFromCode)( apparentVers, isXhtml );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1283|       |
 1284|  21.3k|        if ( !vers )
  ------------------
  |  Branch (1284:14): [True: 74, False: 21.2k]
  ------------------
 1285|     74|            vers = tidyLocalizedString(STRING_HTML_PROPRIETARY);
 1286|       |
 1287|  21.3k|        TY_(Report)( doc, NULL, NULL, STRING_CONTENT_LOOKS, vers );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1288|       |
 1289|       |        /* Warn about missing system identifier (SI) in emitted doctype */
 1290|  21.3k|        if ( TY_(WarnMissingSIInEmittedDocType)( doc ) )
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1290:14): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    }
 1293|  21.3k|}
prvTidyReportNumWarnings:
 1300|  21.3k|{
 1301|  21.3k|    if ( doc->warnings > 0 || doc->errors > 0 )
  ------------------
  |  Branch (1301:10): [True: 21.3k, False: 1]
  |  Branch (1301:31): [True: 0, False: 1]
  ------------------
 1302|  21.3k|    {
 1303|  21.3k|        if ( doc->errors > cfg(doc, TidyShowErrors) || !cfgBool(doc, TidyShowWarnings) )
  ------------------
  |  |  415|  42.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                      if ( doc->errors > cfg(doc, TidyShowErrors) || !cfgBool(doc, TidyShowWarnings) )
  ------------------
  |  |  418|  19.9k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  19.9k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1303:14): [True: 1.30k, False: 19.9k]
  |  Branch (1303:56): [True: 0, False: 19.9k]
  ------------------
 1304|  1.30k|        {
 1305|  1.30k|            TY_(Dialogue)( doc, STRING_NOT_ALL_SHOWN );
  ------------------
  |  |   23|  1.30k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.30k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1306|  1.30k|        }
 1307|  19.9k|        else
 1308|  19.9k|        {
 1309|  19.9k|            TY_(Dialogue)( doc, STRING_ERROR_COUNT );
  ------------------
  |  |   23|  19.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1310|  19.9k|        }
 1311|       |
 1312|  21.3k|    }
 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|  21.3k|}
prvTidyFreeMutedMessageList:
 1326|  21.3k|{
 1327|  21.3k|    TidyMutedMessages *list = &(doc->muted);
 1328|       |
 1329|  21.3k|    if ( list->list )
  ------------------
  |  Branch (1329:10): [True: 0, False: 21.3k]
  ------------------
 1330|      0|        TidyFree( doc->allocator, list->list );
  ------------------
  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 1331|  21.3k|}
prvTidytidyErrorCodeAsKey:
 1436|  9.78M|{
 1437|  9.78M|    uint i = 0;
 1438|  1.11G|    while (tidyStringsKeys[i].key) {
  ------------------
  |  Branch (1438:12): [True: 1.11G, False: 0]
  ------------------
 1439|  1.11G|        if ( tidyStringsKeys[i].value == code )
  ------------------
  |  Branch (1439:14): [True: 9.78M, False: 1.10G]
  ------------------
 1440|  9.78M|            return tidyStringsKeys[i].key;
 1441|  1.10G|        i++;
 1442|  1.10G|    }
 1443|      0|    return "UNDEFINED";
 1444|  9.78M|}
message.c:vReport:
  903|  9.76M|{
  904|  9.76M|    int i = 0;
  905|  9.76M|    va_list args_copy;
  906|       |
  907|   564M|    while ( dispatchTable[i].code != 0 )
  ------------------
  |  Branch (907:13): [True: 564M, False: 0]
  ------------------
  908|   564M|    {
  909|   564M|        if ( dispatchTable[i].code == code )
  ------------------
  |  Branch (909:14): [True: 9.76M, False: 555M]
  ------------------
  910|  9.76M|        {
  911|  9.76M|            TidyMessageImpl *message;
  912|  9.76M|            messageFormatter *handler = dispatchTable[i].handler;
  913|  9.76M|            TidyReportLevel level = dispatchTable[i].level;
  914|       |
  915|  9.76M|            va_copy(args_copy, args);
  916|  9.76M|            message = handler( doc, element, node, code, level, args_copy );
  917|  9.76M|            va_end(args_copy);
  918|       |
  919|  9.76M|            messageOut( message );
  920|       |
  921|  9.76M|            if ( dispatchTable[i].next )
  ------------------
  |  Branch (921:18): [True: 76.9k, False: 9.68M]
  ------------------
  922|  76.9k|            {
  923|  76.9k|                va_copy(args_copy, args);
  924|  76.9k|                vReport(doc, element, node, dispatchTable[i].next, args_copy);
  925|  76.9k|                va_end(args_copy);
  926|  76.9k|            }
  927|  9.76M|            break;
  928|  9.76M|        }
  929|   555M|        i++;
  930|   555M|    }
  931|  9.76M|}
message.c:formatStandard:
  673|  6.85M|{
  674|  6.85M|    char nodedesc[ 256 ] = {0};
  675|  6.85M|    char elemdesc[ 256 ] = {0};
  676|  6.85M|    Node* rpt = ( element ? element : node );
  ------------------
  |  Branch (676:19): [True: 6.43M, False: 418k]
  ------------------
  677|       |
  678|  6.85M|    TagToString(node, nodedesc, sizeof(nodedesc));
  679|       |
  680|  6.85M|    if ( element )
  ------------------
  |  Branch (680:10): [True: 6.43M, False: 418k]
  ------------------
  681|  6.43M|        TagToString(element, elemdesc, sizeof(elemdesc));
  682|       |
  683|  6.85M|    switch ( code )
  ------------------
  |  Branch (683:14): [True: 6.85M, False: 0]
  ------------------
  684|  6.85M|    {
  685|      0|        case CUSTOM_TAG_DETECTED:
  ------------------
  |  Branch (685:9): [True: 0, False: 6.85M]
  ------------------
  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: 6.85M]
  ------------------
  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: 6.85M]
  ------------------
  711|      0|        case FILE_CANT_OPEN_CFG:
  ------------------
  |  Branch (711:9): [True: 0, False: 6.85M]
  ------------------
  712|      0|        case FILE_NOT_FILE:
  ------------------
  |  Branch (712:9): [True: 0, False: 6.85M]
  ------------------
  713|  21.3k|        case STRING_CONTENT_LOOKS:
  ------------------
  |  Branch (713:9): [True: 21.3k, False: 6.83M]
  ------------------
  714|  21.4k|        case STRING_DOCTYPE_GIVEN:
  ------------------
  |  Branch (714:9): [True: 121, False: 6.85M]
  ------------------
  715|  21.4k|        case STRING_MISSING_MALFORMED:
  ------------------
  |  Branch (715:9): [True: 0, False: 6.85M]
  ------------------
  716|  21.4k|        case STRING_MUTING_TYPE:
  ------------------
  |  Branch (716:9): [True: 0, False: 6.85M]
  ------------------
  717|  21.4k|        {
  718|  21.4k|            ctmbstr str;
  719|  21.4k|            if ( (str = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (719:18): [True: 21.4k, False: 0]
  ------------------
  720|  21.4k|                return TY_(tidyMessageCreate)( doc, code, level, str );
  ------------------
  |  |   23|  21.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  721|       |
  722|  21.4k|        } break;
  723|       |
  724|      0|        case APOS_UNDEFINED:
  ------------------
  |  Branch (724:9): [True: 0, False: 6.85M]
  ------------------
  725|    497|        case MISSING_SEMICOLON_NCR:
  ------------------
  |  Branch (725:9): [True: 497, False: 6.85M]
  ------------------
  726|  6.49k|        case MISSING_SEMICOLON:
  ------------------
  |  Branch (726:9): [True: 6.00k, False: 6.85M]
  ------------------
  727|  79.3k|        case UNESCAPED_AMPERSAND:
  ------------------
  |  Branch (727:9): [True: 72.8k, False: 6.78M]
  ------------------
  728|   207k|        case UNKNOWN_ENTITY:
  ------------------
  |  Branch (728:9): [True: 127k, False: 6.72M]
  ------------------
  729|   207k|        {
  730|   207k|            ctmbstr entityname;
  731|   207k|            if ( !(entityname = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (731:18): [True: 0, False: 207k]
  ------------------
  732|      0|            {
  733|      0|                entityname = "NULL";
  734|      0|            }
  735|   207k|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, entityname);
  ------------------
  |  |   23|   207k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   207k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  736|  79.3k|        }
  737|       |
  738|  8.09k|        case MISSING_ATTRIBUTE:
  ------------------
  |  Branch (738:9): [True: 8.09k, False: 6.84M]
  ------------------
  739|  8.09k|        {
  740|  8.09k|            ctmbstr name;
  741|  8.09k|            if ( (name = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (741:18): [True: 8.09k, False: 0]
  ------------------
  742|  8.09k|                return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc, name );
  ------------------
  |  |   23|  8.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  743|  8.09k|        } break;
  744|       |
  745|      0|        case STRING_UNKNOWN_OPTION:
  ------------------
  |  Branch (745:9): [True: 0, False: 6.85M]
  ------------------
  746|      0|        case OPTION_REMOVED:
  ------------------
  |  Branch (746:9): [True: 0, False: 6.85M]
  ------------------
  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: 6.85M]
  ------------------
  754|      0|        case STRING_ARGUMENT_BAD:
  ------------------
  |  Branch (754:9): [True: 0, False: 6.85M]
  ------------------
  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: 6.85M]
  ------------------
  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|    459|        case BAD_SURROGATE_LEAD:
  ------------------
  |  Branch (770:9): [True: 459, False: 6.85M]
  ------------------
  771|    667|        case BAD_SURROGATE_PAIR:
  ------------------
  |  Branch (771:9): [True: 208, False: 6.85M]
  ------------------
  772|  5.04k|        case BAD_SURROGATE_TAIL:
  ------------------
  |  Branch (772:9): [True: 4.37k, False: 6.85M]
  ------------------
  773|  5.04k|        {
  774|  5.04k|            uint c1 = va_arg( args, uint );
  775|  5.04k|            uint c2 = va_arg( args, uint );
  776|  5.04k|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, c1, c2);
  ------------------
  |  |   23|  5.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  777|    667|        }
  778|       |
  779|     66|        case SPACE_PRECEDING_XMLDECL:
  ------------------
  |  Branch (779:9): [True: 66, False: 6.85M]
  ------------------
  780|       |            /* @TODO: Should this be a TidyInfo "silent" fix? */
  781|     66|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level );
  ------------------
  |  |   23|     66|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     66|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  782|       |
  783|  5.36k|        case CANT_BE_NESTED:
  ------------------
  |  Branch (783:9): [True: 5.36k, False: 6.85M]
  ------------------
  784|  6.39k|        case NOFRAMES_CONTENT:
  ------------------
  |  Branch (784:9): [True: 1.03k, False: 6.85M]
  ------------------
  785|  11.0k|        case USING_BR_INPLACE_OF:
  ------------------
  |  Branch (785:9): [True: 4.64k, False: 6.85M]
  ------------------
  786|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  787|  11.0k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc );
  ------------------
  |  |   23|  11.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  788|       |
  789|      0|        case ELEMENT_VERS_MISMATCH_ERROR:
  ------------------
  |  Branch (789:9): [True: 0, False: 6.85M]
  ------------------
  790|      0|        case ELEMENT_VERS_MISMATCH_WARN:
  ------------------
  |  Branch (790:9): [True: 0, False: 6.85M]
  ------------------
  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|  74.3k|        case TAG_NOT_ALLOWED_IN:
  ------------------
  |  Branch (793:9): [True: 74.3k, False: 6.78M]
  ------------------
  794|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  795|  74.3k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc, element ? element->element : NULL );
  ------------------
  |  |   23|  74.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  74.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (795:85): [True: 74.3k, False: 0]
  ------------------
  796|       |
  797|  1.87M|        case INSERTING_TAG:
  ------------------
  |  Branch (797:9): [True: 1.87M, False: 4.98M]
  ------------------
  798|  1.92M|        case MISSING_STARTTAG:
  ------------------
  |  Branch (798:9): [True: 59.1k, False: 6.79M]
  ------------------
  799|  1.92M|        case TOO_MANY_ELEMENTS:
  ------------------
  |  Branch (799:9): [True: 0, False: 6.85M]
  ------------------
  800|  1.92M|        case UNEXPECTED_ENDTAG:
  ------------------
  |  Branch (800:9): [True: 0, False: 6.85M]
  ------------------
  801|  1.92M|        case UNEXPECTED_ENDTAG_ERR:  /* generated by XML docs */
  ------------------
  |  Branch (801:9): [True: 0, False: 6.85M]
  ------------------
  802|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  803|  1.92M|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, node->element );
  ------------------
  |  |   23|  1.92M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.92M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  804|       |
  805|      0|        case UNEXPECTED_ENDTAG_IN:
  ------------------
  |  Branch (805:9): [True: 0, False: 6.85M]
  ------------------
  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|    938|        case BAD_CDATA_CONTENT:
  ------------------
  |  Branch (809:9): [True: 938, False: 6.85M]
  ------------------
  810|  7.76k|        case CONTENT_AFTER_BODY:
  ------------------
  |  Branch (810:9): [True: 6.82k, False: 6.84M]
  ------------------
  811|  9.82k|        case DOCTYPE_AFTER_TAGS:
  ------------------
  |  Branch (811:9): [True: 2.06k, False: 6.85M]
  ------------------
  812|  11.4k|        case DUPLICATE_FRAMESET:
  ------------------
  |  Branch (812:9): [True: 1.61k, False: 6.85M]
  ------------------
  813|  14.2k|        case MALFORMED_COMMENT:
  ------------------
  |  Branch (813:9): [True: 2.83k, False: 6.85M]
  ------------------
  814|  19.1k|        case MALFORMED_COMMENT_DROPPING:
  ------------------
  |  Branch (814:9): [True: 4.89k, False: 6.85M]
  ------------------
  815|  19.3k|        case MALFORMED_COMMENT_EOS:
  ------------------
  |  Branch (815:9): [True: 189, False: 6.85M]
  ------------------
  816|  19.3k|        case MALFORMED_COMMENT_WARN:
  ------------------
  |  Branch (816:9): [True: 0, False: 6.85M]
  ------------------
  817|  45.5k|        case MALFORMED_DOCTYPE:
  ------------------
  |  Branch (817:9): [True: 26.1k, False: 6.83M]
  ------------------
  818|  62.7k|        case MISSING_DOCTYPE:
  ------------------
  |  Branch (818:9): [True: 17.2k, False: 6.83M]
  ------------------
  819|  83.9k|        case MISSING_TITLE_ELEMENT:
  ------------------
  |  Branch (819:9): [True: 21.1k, False: 6.83M]
  ------------------
  820|   113k|        case NESTED_QUOTATION:
  ------------------
  |  Branch (820:9): [True: 29.1k, False: 6.82M]
  ------------------
  821|   113k|        case SUSPECTED_MISSING_QUOTE:
  ------------------
  |  Branch (821:9): [True: 451, False: 6.85M]
  ------------------
  822|   113k|        case XML_DECLARATION_DETECTED:
  ------------------
  |  Branch (822:9): [True: 137, False: 6.85M]
  ------------------
  823|   113k|        case BLANK_TITLE_ELEMENT:
  ------------------
  |  Branch (823:9): [True: 74, False: 6.85M]
  ------------------
  824|   113k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level );
  ------------------
  |  |   23|   113k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   113k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  825|       |
  826|      0|        case ELEMENT_NOT_EMPTY:
  ------------------
  |  Branch (826:9): [True: 0, False: 6.85M]
  ------------------
  827|      0|        case FOUND_STYLE_IN_BODY:
  ------------------
  |  Branch (827:9): [True: 0, False: 6.85M]
  ------------------
  828|  7.27k|        case ILLEGAL_NESTING:
  ------------------
  |  Branch (828:9): [True: 7.27k, False: 6.84M]
  ------------------
  829|  9.13k|        case MOVED_STYLE_TO_HEAD:
  ------------------
  |  Branch (829:9): [True: 1.85k, False: 6.85M]
  ------------------
  830|   564k|        case TRIM_EMPTY_ELEMENT:
  ------------------
  |  Branch (830:9): [True: 555k, False: 6.30M]
  ------------------
  831|   564k|        case UNEXPECTED_END_OF_FILE:
  ------------------
  |  Branch (831:9): [True: 2, False: 6.85M]
  ------------------
  832|   564k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, elemdesc );
  ------------------
  |  |   23|   564k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   564k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  833|       |
  834|  1.31k|        case OBSOLETE_ELEMENT:
  ------------------
  |  Branch (834:9): [True: 1.31k, False: 6.85M]
  ------------------
  835|  8.83k|        case REPLACING_ELEMENT:
  ------------------
  |  Branch (835:9): [True: 7.52k, False: 6.84M]
  ------------------
  836|  8.83k|        case REPLACING_UNEX_ELEMENT:
  ------------------
  |  Branch (836:9): [True: 0, False: 6.85M]
  ------------------
  837|  8.83k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, elemdesc, nodedesc );
  ------------------
  |  |   23|  8.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  838|       |
  839|      0|        case ADDED_MISSING_CHARSET:
  ------------------
  |  Branch (839:9): [True: 0, False: 6.85M]
  ------------------
  840|    194|        case BAD_SUMMARY_HTML5:
  ------------------
  |  Branch (840:9): [True: 194, False: 6.85M]
  ------------------
  841|  12.7k|        case NESTED_EMPHASIS:
  ------------------
  |  Branch (841:9): [True: 12.5k, False: 6.84M]
  ------------------
  842|  14.2k|        case PROPRIETARY_ELEMENT:
  ------------------
  |  Branch (842:9): [True: 1.49k, False: 6.85M]
  ------------------
  843|  1.36M|        case REMOVED_HTML5:
  ------------------
  |  Branch (843:9): [True: 1.34M, False: 5.50M]
  ------------------
  844|  1.45M|        case UNKNOWN_ELEMENT:
  ------------------
  |  Branch (844:9): [True: 89.6k, False: 6.76M]
  ------------------
  845|  1.48M|        case UNKNOWN_ELEMENT_LOOKS_CUSTOM:
  ------------------
  |  Branch (845:9): [True: 32.9k, False: 6.82M]
  ------------------
  846|  1.48M|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, nodedesc );
  ------------------
  |  |   23|  1.48M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.48M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  847|       |
  848|  1.47M|        case MISSING_ENDTAG_FOR:
  ------------------
  |  Branch (848:9): [True: 1.47M, False: 5.38M]
  ------------------
  849|  1.48M|        case MISSING_ENDTAG_OPTIONAL:
  ------------------
  |  Branch (849:9): [True: 7.30k, False: 6.84M]
  ------------------
  850|  1.55M|        case PREVIOUS_LOCATION:
  ------------------
  |  Branch (850:9): [True: 76.9k, False: 6.77M]
  ------------------
  851|  1.55M|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, element? element->element : NULL );
  ------------------
  |  |   23|  1.55M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.55M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (851:74): [True: 1.55M, False: 418]
  ------------------
  852|       |
  853|   830k|        case MISSING_ENDTAG_BEFORE:
  ------------------
  |  Branch (853:9): [True: 830k, False: 6.02M]
  ------------------
  854|   830k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, element? element->element : NULL, nodedesc );
  ------------------
  |  |   23|   830k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   830k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (854:74): [True: 830k, False: 0]
  ------------------
  855|       |
  856|  20.2k|        case COERCE_TO_ENDTAG:
  ------------------
  |  Branch (856:9): [True: 20.2k, False: 6.83M]
  ------------------
  857|  37.8k|        case NON_MATCHING_ENDTAG:
  ------------------
  |  Branch (857:9): [True: 17.5k, False: 6.83M]
  ------------------
  858|  37.8k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, node->element, node->element );
  ------------------
  |  |   23|  37.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  859|  2.55k|        case TOO_MANY_ELEMENTS_IN:
  ------------------
  |  Branch (859:9): [True: 2.55k, False: 6.85M]
  ------------------
  860|  2.55k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, node->element, element ? element->element : NULL);
  ------------------
  |  |   23|  2.55k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.55k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (860:89): [True: 2.55k, False: 0]
  ------------------
  861|       |
  862|  6.85M|    }
  863|       |
  864|      0|    return NULL;
  865|  6.85M|}
message.c:TagToString:
   42|  14.6M|{
   43|  14.6M|    *buf = 0;
   44|  14.6M|    if (tag)
  ------------------
  |  Branch (44:9): [True: 12.3M, False: 2.33M]
  ------------------
   45|  12.3M|    {
   46|  12.3M|        if (TY_(nodeIsElement)(tag))
  ------------------
  |  |   23|  12.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (46:13): [True: 12.0M, False: 244k]
  ------------------
   47|  12.0M|            TY_(tmbsnprintf)(buf, count, "<%s>", tag->element);
  ------------------
  |  |   23|  12.0M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.0M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   48|   244k|        else if (tag->type == EndTag)
  ------------------
  |  Branch (48:18): [True: 143k, False: 100k]
  ------------------
   49|   143k|            TY_(tmbsnprintf)(buf, count, "</%s>", tag->element);
  ------------------
  |  |   23|   143k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   143k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   50|   100k|        else if (tag->type == DocTypeTag)
  ------------------
  |  Branch (50:18): [True: 17.8k, False: 82.8k]
  ------------------
   51|  17.8k|            TY_(tmbsnprintf)(buf, count, "<!DOCTYPE>");
  ------------------
  |  |   23|  17.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   52|  82.8k|        else if (tag->type == TextNode)
  ------------------
  |  Branch (52:18): [True: 74.7k, False: 8.15k]
  ------------------
   53|  74.7k|            TY_(tmbsnprintf)(buf, count, "%s", "STRING_PLAIN_TEXT");
  ------------------
  |  |   23|  74.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  74.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   54|  8.15k|        else if (tag->type == XmlDecl)
  ------------------
  |  Branch (54:18): [True: 6.29k, False: 1.85k]
  ------------------
   55|  6.29k|            TY_(tmbsnprintf)(buf, count, "%s", "STRING_XML_DECLARATION");
  ------------------
  |  |   23|  6.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   56|  1.85k|        else if (tag->element)
  ------------------
  |  Branch (56:18): [True: 1.71k, False: 138]
  ------------------
   57|  1.71k|            TY_(tmbsnprintf)(buf, count, "%s", tag->element);
  ------------------
  |  |   23|  1.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   58|  12.3M|    }
   59|  14.6M|    return buf + TY_(tmbstrlen)(buf);
  ------------------
  |  |   23|  14.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   60|  14.6M|}
message.c:HTMLVersion:
   93|  6.68k|{
   94|  6.68k|    uint versionEmitted = doc->lexer->versionEmitted;
   95|  6.68k|    uint declared = doc->lexer->doctype;
   96|  6.68k|    uint version = versionEmitted == 0 ? declared : versionEmitted;
  ------------------
  |  Branch (96:20): [True: 0, False: 6.68k]
  ------------------
   97|  6.68k|    ctmbstr result = TY_(HTMLVersionNameFromCode)(version, 0);
  ------------------
  |  |   23|  6.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   98|  6.68k|    if (!result)
  ------------------
  |  Branch (98:9): [True: 0, False: 6.68k]
  ------------------
   99|      0|        result = tidyLocalizedString(STRING_HTML_PROPRIETARY);
  100|  6.68k|    return result;
  101|  6.68k|}
message.c:formatAttributeReport:
  533|  1.13M|{
  534|  1.13M|    AttVal *av = NULL;
  535|  1.13M|    char const *name = "NULL";
  536|  1.13M|    char const *value = "NULL";
  537|  1.13M|    char tagdesc[64];
  538|       |
  539|  1.13M|    TagToString(node, tagdesc, sizeof(tagdesc));
  540|       |
  541|  1.13M|    if ( ( av = va_arg(args, AttVal*) ) )
  ------------------
  |  Branch (541:10): [True: 842k, False: 294k]
  ------------------
  542|   842k|    {
  543|   842k|        if (av->attribute)
  ------------------
  |  Branch (543:13): [True: 815k, False: 27.3k]
  ------------------
  544|   815k|            name = av->attribute;
  545|   842k|        if (av->value)
  ------------------
  |  Branch (545:13): [True: 664k, False: 178k]
  ------------------
  546|   664k|            value = av->value;
  547|   842k|    }
  548|       |
  549|  1.13M|    switch (code)
  ------------------
  |  Branch (549:13): [True: 1.13M, False: 0]
  ------------------
  550|  1.13M|    {
  551|  29.5k|        case MISSING_QUOTEMARK_OPEN:
  ------------------
  |  Branch (551:9): [True: 29.5k, False: 1.10M]
  ------------------
  552|  29.5k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, name );
  ------------------
  |  |   23|  29.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  553|       |		
  554|    282|        case BACKSLASH_IN_URI:
  ------------------
  |  Branch (554:9): [True: 282, False: 1.13M]
  ------------------
  555|   123k|        case ESCAPED_ILLEGAL_URI:
  ------------------
  |  Branch (555:9): [True: 123k, False: 1.01M]
  ------------------
  556|   236k|        case FIXED_BACKSLASH:
  ------------------
  |  Branch (556:9): [True: 112k, False: 1.02M]
  ------------------
  557|   236k|        case ID_NAME_MISMATCH:
  ------------------
  |  Branch (557:9): [True: 442, False: 1.13M]
  ------------------
  558|   358k|        case ILLEGAL_URI_CODEPOINT:
  ------------------
  |  Branch (558:9): [True: 121k, False: 1.01M]
  ------------------
  559|   358k|        case ILLEGAL_URI_REFERENCE:
  ------------------
  |  Branch (559:9): [True: 0, False: 1.13M]
  ------------------
  560|   358k|        case INVALID_XML_ID:
  ------------------
  |  Branch (560:9): [True: 411, False: 1.13M]
  ------------------
  561|   359k|        case MISSING_IMAGEMAP:
  ------------------
  |  Branch (561:9): [True: 198, False: 1.13M]
  ------------------
  562|   360k|        case MISSING_QUOTEMARK:
  ------------------
  |  Branch (562:9): [True: 978, False: 1.13M]
  ------------------
  563|   360k|        case NEWLINE_IN_URI:
  ------------------
  |  Branch (563:9): [True: 861, False: 1.13M]
  ------------------
  564|   364k|        case UNEXPECTED_EQUALSIGN:
  ------------------
  |  Branch (564:9): [True: 3.02k, False: 1.13M]
  ------------------
  565|   646k|        case UNEXPECTED_GT:
  ------------------
  |  Branch (565:9): [True: 282k, False: 855k]
  ------------------
  566|   647k|        case UNEXPECTED_QUOTEMARK:
  ------------------
  |  Branch (566:9): [True: 1.57k, False: 1.13M]
  ------------------
  567|   653k|        case WHITE_IN_URI:
  ------------------
  |  Branch (567:9): [True: 5.61k, False: 1.13M]
  ------------------
  568|   653k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc );
  ------------------
  |  |   23|   653k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   653k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  569|       |
  570|    198|        case ATTRIBUTE_IS_NOT_ALLOWED:
  ------------------
  |  Branch (570:9): [True: 198, False: 1.13M]
  ------------------
  571|  1.44k|        case JOINING_ATTRIBUTE:
  ------------------
  |  Branch (571:9): [True: 1.24k, False: 1.13M]
  ------------------
  572|  60.1k|        case MISSING_ATTR_VALUE:
  ------------------
  |  Branch (572:9): [True: 58.6k, False: 1.07M]
  ------------------
  573|   305k|        case PROPRIETARY_ATTRIBUTE:
  ------------------
  |  Branch (573:9): [True: 245k, False: 892k]
  ------------------
  574|   305k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name );
  ------------------
  |  |   23|   305k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   305k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  575|       |
  576|      0|        case ATTRIBUTE_VALUE_REPLACED:
  ------------------
  |  Branch (576:9): [True: 0, False: 1.13M]
  ------------------
  577|   100k|        case BAD_ATTRIBUTE_VALUE:
  ------------------
  |  Branch (577:9): [True: 100k, False: 1.03M]
  ------------------
  578|   101k|        case BAD_ATTRIBUTE_VALUE_REPLACED:
  ------------------
  |  Branch (578:9): [True: 1.01k, False: 1.13M]
  ------------------
  579|   101k|        case INSERTING_AUTO_ATTRIBUTE:
  ------------------
  |  Branch (579:9): [True: 0, False: 1.13M]
  ------------------
  580|   106k|        case INVALID_ATTRIBUTE:
  ------------------
  |  Branch (580:9): [True: 4.63k, False: 1.13M]
  ------------------
  581|   106k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name, value );
  ------------------
  |  |   23|   106k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   106k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  582|       |
  583|      0|        case MISMATCHED_ATTRIBUTE_ERROR:
  ------------------
  |  Branch (583:9): [True: 0, False: 1.13M]
  ------------------
  584|  6.68k|        case MISMATCHED_ATTRIBUTE_WARN:
  ------------------
  |  Branch (584:9): [True: 6.68k, False: 1.13M]
  ------------------
  585|  6.68k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name, HTMLVersion(doc));
  ------------------
  |  |   23|  6.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  586|       |
  587|  2.60k|        case ANCHOR_NOT_UNIQUE:
  ------------------
  |  Branch (587:9): [True: 2.60k, False: 1.13M]
  ------------------
  588|  28.0k|        case ANCHOR_DUPLICATED:
  ------------------
  |  Branch (588:9): [True: 25.4k, False: 1.11M]
  ------------------
  589|  29.5k|        case ATTR_VALUE_NOT_LCASE:
  ------------------
  |  Branch (589:9): [True: 1.48k, False: 1.13M]
  ------------------
  590|  29.7k|        case PROPRIETARY_ATTR_VALUE:
  ------------------
  |  Branch (590:9): [True: 199, False: 1.13M]
  ------------------
  591|  29.7k|        case XML_ID_SYNTAX:
  ------------------
  |  Branch (591:9): [True: 0, False: 1.13M]
  ------------------
  592|  29.7k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, value );
  ------------------
  |  |   23|  29.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  593|       |
  594|  4.95k|        case REPEATED_ATTRIBUTE:
  ------------------
  |  Branch (594:9): [True: 4.95k, False: 1.13M]
  ------------------
  595|  4.95k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, value, name );
  ------------------
  |  |   23|  4.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  596|       |
  597|  1.51k|        case UNEXPECTED_END_OF_FILE_ATTR:
  ------------------
  |  Branch (597:9): [True: 1.51k, False: 1.13M]
  ------------------
  598|       |            /* on end of file adjust reported position to end of input */
  599|  1.51k|            doc->lexer->lines   = doc->docIn->curline;
  600|  1.51k|            doc->lexer->columns = doc->docIn->curcol;
  601|  1.51k|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, tagdesc );
  ------------------
  |  |   23|  1.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  602|  1.13M|    }
  603|       |
  604|      0|    return NULL;
  605|  1.13M|}
message.c:formatStandardDynamic:
  872|   205k|{
  873|   205k|    char nodedesc[ 256 ] = {0};
  874|       |
  875|   205k|    TagToString(node, nodedesc, sizeof(nodedesc));
  876|       |
  877|   205k|    switch (code)
  ------------------
  |  Branch (877:13): [True: 205k, False: 0]
  ------------------
  878|   205k|    {
  879|   205k|        case DISCARDING_UNEXPECTED:
  ------------------
  |  Branch (879:9): [True: 205k, 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|   205k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, doc->badForm ? TidyError : TidyWarning, nodedesc );
  ------------------
  |  |   23|   205k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   205k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (882:68): [True: 2.45k, False: 202k]
  ------------------
  883|      0|            break;
  884|   205k|    }
  885|       |
  886|      0|    return NULL;
  887|   205k|}
message.c:formatEncodingReport:
  616|  1.56M|{
  617|  1.56M|    char buf[ 32 ] = {'\0'};
  618|  1.56M|    uint c = va_arg( args, uint );
  619|  1.56M|    Bool discarded = va_arg( args, Bool );
  620|  1.56M|    ctmbstr action = tidyLocalizedString(discarded ? STRING_DISCARDING : STRING_REPLACING);
  ------------------
  |  Branch (620:42): [True: 7.28k, False: 1.55M]
  ------------------
  621|       |
  622|  1.56M|    switch (code)
  ------------------
  |  Branch (622:13): [True: 1.56M, False: 0]
  ------------------
  623|  1.56M|    {
  624|  1.06k|        case INVALID_NCR:
  ------------------
  |  Branch (624:9): [True: 1.06k, False: 1.55M]
  ------------------
  625|  1.06k|            NtoS(c, buf);
  626|  1.06k|            doc->badChars |= BC_INVALID_NCR;
  ------------------
  |  |  305|  1.06k|#define BC_INVALID_NCR             64
  ------------------
  627|  1.06k|            break;
  628|       |
  629|    920|        case INVALID_SGML_CHARS:
  ------------------
  |  Branch (629:9): [True: 920, False: 1.55M]
  ------------------
  630|    920|            NtoS(c, buf);
  631|    920|            doc->badChars |= BC_INVALID_SGML_CHARS;
  ------------------
  |  |  300|    920|#define BC_INVALID_SGML_CHARS      2
  ------------------
  632|    920|            break;
  633|       |
  634|  1.55M|        case INVALID_UTF8:
  ------------------
  |  Branch (634:9): [True: 1.55M, False: 8.80k]
  ------------------
  635|  1.55M|            TY_(tmbsnprintf)(buf, sizeof(buf), "U+%04X", c);
  ------------------
  |  |   23|  1.55M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.55M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  636|  1.55M|            doc->badChars |= BC_INVALID_UTF8;
  ------------------
  |  |  301|  1.55M|#define BC_INVALID_UTF8            4
  ------------------
  637|  1.55M|            break;
  638|       |
  639|  6.64k|        case INVALID_UTF16:
  ------------------
  |  Branch (639:9): [True: 6.64k, False: 1.55M]
  ------------------
  640|  6.64k|            TY_(tmbsnprintf)(buf, sizeof(buf), "U+%04X", c);
  ------------------
  |  |   23|  6.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  641|  6.64k|            doc->badChars |= BC_INVALID_UTF16;
  ------------------
  |  |  302|  6.64k|#define BC_INVALID_UTF16           8
  ------------------
  642|  6.64k|            break;
  643|       |
  644|      0|        case VENDOR_SPECIFIC_CHARS:
  ------------------
  |  Branch (644:9): [True: 0, False: 1.56M]
  ------------------
  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|    180|        case ENCODING_MISMATCH:
  ------------------
  |  Branch (649:9): [True: 180, False: 1.56M]
  ------------------
  650|    180|            doc->badChars |= BC_ENCODING_MISMATCH;
  ------------------
  |  |  303|    180|#define BC_ENCODING_MISMATCH       16 /* fatal error */
  ------------------
  651|    180|            return TY_(tidyMessageCreateWithLexer)(doc,
  ------------------
  |  |   23|    180|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    180|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  652|    180|                                                   code,
  653|    180|                                                   level,
  654|    180|                                                   TY_(CharEncodingName)(doc->docIn->encoding),
  ------------------
  |  |   23|    180|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    180|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  655|    180|                                                   TY_(CharEncodingName)(c));
  ------------------
  |  |   23|    180|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    180|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  656|      0|            break;
  657|  1.56M|    }
  658|       |
  659|  1.56M|    return TY_(tidyMessageCreateWithLexer)(doc, code, level, action, buf );
  ------------------
  |  |   23|  1.56M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  660|       |
  661|  1.56M|}
message.c:NtoS:
   65|  1.98k|{
   66|  1.98k|    tmbchar buf[40];
   67|  1.98k|    int i;
   68|       |    
   69|  3.96k|    for (i = 0;; ++i)
   70|  5.95k|    {
   71|  5.95k|        buf[i] = (tmbchar)( (n % 10) + '0' );
   72|       |        
   73|  5.95k|        n = n / 10;
   74|       |        
   75|  5.95k|        if (n == 0)
  ------------------
  |  Branch (75:13): [True: 1.98k, False: 3.96k]
  ------------------
   76|  1.98k|            break;
   77|  5.95k|    }
   78|       |    
   79|  1.98k|    n = i;
   80|       |    
   81|  7.93k|    while (i >= 0)
  ------------------
  |  Branch (81:12): [True: 5.95k, False: 1.98k]
  ------------------
   82|  5.95k|    {
   83|  5.95k|        str[n-i] = buf[i];
   84|  5.95k|        --i;
   85|  5.95k|    }
   86|       |    
   87|  1.98k|    str[n+1] = '\0';
   88|  1.98k|}
message.c:formatDialogue:
 1077|  26.5k|{
 1078|  26.5k|    switch (code)
 1079|  26.5k|    {
 1080|      0|        case TEXT_SGML_CHARS:
  ------------------
  |  Branch (1080:9): [True: 0, False: 26.5k]
  ------------------
 1081|      0|        case TEXT_VENDOR_CHARS:
  ------------------
  |  Branch (1081:9): [True: 0, False: 26.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|  19.9k|        case STRING_ERROR_COUNT:
  ------------------
  |  Branch (1087:9): [True: 19.9k, False: 6.60k]
  ------------------
 1088|  21.3k|        case STRING_NOT_ALL_SHOWN:
  ------------------
  |  Branch (1088:9): [True: 1.30k, False: 25.2k]
  ------------------
 1089|  21.3k|            return TY_(tidyMessageCreate)( doc, code, level,
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1090|  21.3k|                                           doc->warnings, "STRING_ERROR_COUNT_WARNING",
 1091|  21.3k|                                           doc->errors, "STRING_ERROR_COUNT_ERROR" );
 1092|       |
 1093|      0|        case FOOTNOTE_TRIM_EMPTY_ELEMENT:
  ------------------
  |  Branch (1093:9): [True: 0, False: 26.5k]
  ------------------
 1094|      0|        case STRING_HELLO_ACCESS:
  ------------------
  |  Branch (1094:9): [True: 0, False: 26.5k]
  ------------------
 1095|  5.29k|        case STRING_NEEDS_INTERVENTION:
  ------------------
  |  Branch (1095:9): [True: 5.29k, False: 21.3k]
  ------------------
 1096|  5.29k|        case STRING_NO_ERRORS:
  ------------------
  |  Branch (1096:9): [True: 1, False: 26.5k]
  ------------------
 1097|  5.29k|        case TEXT_ACCESS_ADVICE1:
  ------------------
  |  Branch (1097:9): [True: 0, False: 26.5k]
  ------------------
 1098|  5.29k|        case TEXT_ACCESS_ADVICE2:
  ------------------
  |  Branch (1098:9): [True: 0, False: 26.5k]
  ------------------
 1099|  5.29k|        case TEXT_BAD_FORM:
  ------------------
  |  Branch (1099:9): [True: 0, False: 26.5k]
  ------------------
 1100|  5.29k|        case TEXT_BAD_MAIN:
  ------------------
  |  Branch (1100:9): [True: 0, False: 26.5k]
  ------------------
 1101|  5.29k|        case TEXT_GENERAL_INFO:
  ------------------
  |  Branch (1101:9): [True: 0, False: 26.5k]
  ------------------
 1102|  5.29k|        case TEXT_GENERAL_INFO_PLEA:
  ------------------
  |  Branch (1102:9): [True: 0, False: 26.5k]
  ------------------
 1103|  5.29k|        case TEXT_HTML_T_ALGORITHM:
  ------------------
  |  Branch (1103:9): [True: 0, False: 26.5k]
  ------------------
 1104|  5.29k|        case TEXT_INVALID_URI:
  ------------------
  |  Branch (1104:9): [True: 0, False: 26.5k]
  ------------------
 1105|  5.29k|        case TEXT_INVALID_UTF8:
  ------------------
  |  Branch (1105:9): [True: 0, False: 26.5k]
  ------------------
 1106|  5.29k|        case TEXT_INVALID_UTF16:
  ------------------
  |  Branch (1106:9): [True: 0, False: 26.5k]
  ------------------
 1107|  5.29k|        case TEXT_M_IMAGE_ALT:
  ------------------
  |  Branch (1107:9): [True: 0, False: 26.5k]
  ------------------
 1108|  5.29k|        case TEXT_M_IMAGE_MAP:
  ------------------
  |  Branch (1108:9): [True: 0, False: 26.5k]
  ------------------
 1109|  5.29k|        case TEXT_M_LINK_ALT:
  ------------------
  |  Branch (1109:9): [True: 0, False: 26.5k]
  ------------------
 1110|  5.29k|        case TEXT_M_SUMMARY:
  ------------------
  |  Branch (1110:9): [True: 0, False: 26.5k]
  ------------------
 1111|  5.29k|        case TEXT_USING_BODY:
  ------------------
  |  Branch (1111:9): [True: 0, False: 26.5k]
  ------------------
 1112|  5.29k|        case TEXT_USING_FONT:
  ------------------
  |  Branch (1112:9): [True: 0, False: 26.5k]
  ------------------
 1113|  5.29k|        case TEXT_USING_FRAMES:
  ------------------
  |  Branch (1113:9): [True: 0, False: 26.5k]
  ------------------
 1114|  5.29k|        case TEXT_USING_LAYER:
  ------------------
  |  Branch (1114:9): [True: 0, False: 26.5k]
  ------------------
 1115|  5.29k|        case TEXT_USING_NOBR:
  ------------------
  |  Branch (1115:9): [True: 0, False: 26.5k]
  ------------------
 1116|  5.29k|        case TEXT_USING_SPACER:
  ------------------
  |  Branch (1116:9): [True: 0, False: 26.5k]
  ------------------
 1117|  5.29k|        default:
  ------------------
  |  Branch (1117:9): [True: 0, False: 26.5k]
  ------------------
 1118|  5.29k|            return TY_(tidyMessageCreate)( doc, code, level );
  ------------------
  |  |   23|  5.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1119|  26.5k|    }
 1120|       |    
 1121|      0|    return NULL;
 1122|  26.5k|}
message.c:messageOut:
  116|  9.78M|{
  117|  9.78M|    TidyDocImpl *doc;
  118|  9.78M|    Bool go = yes;
  119|       |
  120|  9.78M|    if ( !message )
  ------------------
  |  Branch (120:10): [True: 0, False: 9.78M]
  ------------------
  121|      0|        return;
  122|       |
  123|  9.78M|    doc = message->tidyDoc;
  124|       |
  125|       |    /* The filter has had a chance to suppress *any* message from output. */
  126|  9.78M|    go = message->allowMessage;
  127|       |
  128|       |    /* Update the count of each report type. */
  129|  9.78M|    switch ( message->level )
  130|  9.78M|    {
  131|   138k|        case TidyInfo:
  ------------------
  |  Branch (131:9): [True: 138k, False: 9.64M]
  ------------------
  132|   138k|            doc->infoMessages++;
  133|   138k|            break;
  134|  9.49M|        case TidyWarning:
  ------------------
  |  Branch (134:9): [True: 9.49M, False: 291k]
  ------------------
  135|  9.49M|            doc->warnings++;
  136|  9.49M|            break;
  137|      0|        case TidyConfig:
  ------------------
  |  Branch (137:9): [True: 0, False: 9.78M]
  ------------------
  138|      0|            doc->optionErrors++;
  139|      0|            break;
  140|      0|        case TidyAccess:
  ------------------
  |  Branch (140:9): [True: 0, False: 9.78M]
  ------------------
  141|      0|            doc->accessErrors++;
  142|      0|            break;
  143|   126k|        case TidyError:
  ------------------
  |  Branch (143:9): [True: 126k, False: 9.66M]
  ------------------
  144|   126k|            doc->errors++;
  145|   126k|            break;
  146|      0|        case TidyBadDocument:
  ------------------
  |  Branch (146:9): [True: 0, False: 9.78M]
  ------------------
  147|      0|            doc->docErrors++;
  148|      0|            break;
  149|      0|        case TidyFatal:
  ------------------
  |  Branch (149:9): [True: 0, False: 9.78M]
  ------------------
  150|       |            /* Ack! */
  151|      0|            break;
  152|  26.5k|        default:
  ------------------
  |  Branch (152:9): [True: 26.5k, False: 9.76M]
  ------------------
  153|  26.5k|            break;
  154|  9.78M|    }
  155|       |
  156|       |    /* Suppress report messages if they've been muted. */
  157|  9.78M|    go = go & !message->muted;
  158|       |
  159|       |    /* Suppress report messages if we've already reached the reporting limit. */
  160|  9.78M|    if ( message->level <= TidyFatal )
  ------------------
  |  Branch (160:10): [True: 9.76M, False: 26.5k]
  ------------------
  161|  9.76M|    {
  162|  9.76M|        go = go & ( doc->errors < cfg(doc, TidyShowErrors) );
  ------------------
  |  |  415|  9.76M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  163|  9.76M|    }
  164|       |
  165|       |    /* Let TidyQuiet silence a lot of things. */
  166|  9.78M|    if ( cfgBool( doc, TidyQuiet ) == yes )
  ------------------
  |  |  418|  9.78M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  9.78M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (166:10): [True: 0, False: 9.78M]
  ------------------
  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|  9.78M|    if ( cfgBool( doc, TidyShowInfo ) == no )
  ------------------
  |  |  418|  9.78M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  9.78M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (179:10): [True: 0, False: 9.78M]
  ------------------
  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|  9.78M|    if ( cfgBool( doc, TidyShowWarnings ) == no )
  ------------------
  |  |  418|  9.78M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  9.78M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (190:10): [True: 0, False: 9.78M]
  ------------------
  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|  9.78M|    if ( go )
  ------------------
  |  Branch (196:10): [True: 4.84M, False: 4.94M]
  ------------------
  197|  4.84M|    {
  198|  4.84M|        TidyOutputSink *outp = &doc->errout->sink;
  199|  4.84M|        ctmbstr cp;
  200|  4.84M|        byte b = '\0';
  201|   359M|        for ( cp = message->messageOutput; *cp; ++cp )
  ------------------
  |  Branch (201:44): [True: 354M, False: 4.84M]
  ------------------
  202|   354M|        {
  203|   354M|            b = (*cp & 0xff);
  204|   354M|            if (b == (byte)'\n')
  ------------------
  |  Branch (204:17): [True: 47.0k, False: 354M]
  ------------------
  205|  47.0k|                TY_(WriteChar)( b, doc->errout );   /* for EOL translation */
  ------------------
  |  |   23|  47.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  47.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  206|   354M|            else
  207|   354M|                outp->putByte( outp->sinkData, b ); /* #383 - no encoding */
  208|   354M|        }
  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.84M|        TY_(WriteChar)( '\n', doc->errout );
  ------------------
  |  |   23|  4.84M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.84M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  214|  4.84M|    }
  215|       |
  216|  9.78M|    TY_(tidyMessageRelease)(message);
  ------------------
  |  |   23|  9.78M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.78M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  217|  9.78M|}

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

prvTidyInitParserStack:
  843|  21.3k|{
  844|  21.3k|    enum { default_size = 32 };
  845|  21.3k|    TidyParserMemory *content = (TidyParserMemory *) TidyAlloc( doc->allocator, sizeof(TidyParserMemory) * default_size );
  ------------------
  |  |   66|  21.3k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  846|       |
  847|  21.3k|    doc->stack.content = content;
  848|  21.3k|    doc->stack.size = default_size;
  849|  21.3k|    doc->stack.top = -1;
  850|  21.3k|}
prvTidyFreeParserStack:
  857|  21.3k|{
  858|  21.3k|    TidyFree( doc->allocator, doc->stack.content );
  ------------------
  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  859|       |
  860|       |    doc->stack.content = NULL;
  861|  21.3k|    doc->stack.size = 0;
  862|  21.3k|    doc->stack.top = -1;
  863|  21.3k|}
prvTidyisEmptyParserStack:
  886|  5.20M|{
  887|  5.20M|    return doc->stack.top < 0;
  888|  5.20M|}
prvTidypeekMemoryIdentity:
  905|  2.59M|{
  906|  2.59M|    return doc->stack.content[doc->stack.top].identity;
  907|  2.59M|}
prvTidypeekMemoryMode:
  915|  21.7k|{
  916|  21.7k|    return doc->stack.content[doc->stack.top].mode;
  917|  21.7k|}
prvTidypopMemory:
  924|  2.59M|{
  925|  2.59M|    if ( !TY_(isEmptyParserStack)( doc ) )
  ------------------
  |  |   23|  2.59M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.59M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (925:10): [True: 2.59M, False: 0]
  ------------------
  926|  2.59M|    {
  927|  2.59M|        TidyParserMemory data = doc->stack.content[doc->stack.top];
  928|  2.59M|        DEBUG_LOG(SPRTF("\n"
  929|  2.59M|                        "<--POP  original: %s @ %p\n"
  930|  2.59M|                        "         reentry: %s @ %p\n"
  931|  2.59M|                        "     stack depth: %lu @ %p\n"
  932|  2.59M|                        "            mode: %u\n"
  933|  2.59M|                        "      register 1: %i\n"
  934|  2.59M|                        "      register 2: %i\n\n",
  935|  2.59M|                        data.original_node ? data.original_node->element : "none", data.original_node,
  936|  2.59M|                        data.reentry_node ? data.reentry_node->element : "none", data.reentry_node,
  937|  2.59M|                        doc->stack.top, &doc->stack.content[doc->stack.top],
  938|  2.59M|                        data.mode,
  939|  2.59M|                        data.register_1,
  940|  2.59M|                        data.register_2
  941|  2.59M|                        ));
  942|  2.59M|        doc->stack.top = doc->stack.top - 1;
  943|  2.59M|        return data;
  944|  2.59M|    }
  945|      0|    TidyParserMemory blank = { NULL };
  946|      0|    return blank;
  947|  2.59M|}
prvTidypushMemory:
  954|  2.77M|{
  955|  2.77M|    if ( doc->stack.top == doc->stack.size - 1 )
  ------------------
  |  Branch (955:10): [True: 4.46k, False: 2.76M]
  ------------------
  956|  4.46k|        growParserStack( doc );
  957|       |
  958|  2.77M|    doc->stack.top++;
  959|       |    
  960|  2.77M|    doc->stack.content[doc->stack.top] = data;
  961|  2.77M|    DEBUG_LOG(SPRTF("\n"
  962|  2.77M|                    "-->PUSH original: %s @ %p\n"
  963|  2.77M|                    "         reentry: %s @ %p\n"
  964|  2.77M|                    "     stack depth: %lu @ %p\n"
  965|  2.77M|                    "            mode: %u\n"
  966|  2.77M|                    "      register 1: %i\n"
  967|  2.77M|                    "      register 2: %i\n\n",
  968|  2.77M|                    data.original_node ? data.original_node->element : "none", data.original_node,
  969|  2.77M|                    data.reentry_node ? data.reentry_node->element : "none", data.reentry_node,
  970|  2.77M|                    doc->stack.top, &doc->stack.content[doc->stack.top],
  971|  2.77M|                    data.mode,
  972|  2.77M|                    data.register_1,
  973|  2.77M|                    data.register_2
  974|  2.77M|                    ));
  975|  2.77M|}
ParseHTMLWithNode:
 1064|  21.3k|{
 1065|  21.3k|    GetTokenMode mode = IgnoreWhitespace;
 1066|  21.3k|    Parser* parser = GetParserForNode( doc, node );
 1067|  21.3k|    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.39M|    while (something_to_do)
  ------------------
  |  Branch (1075:12): [True: 5.37M, False: 21.3k]
  ------------------
 1076|  5.37M|    {
 1077|  5.37M|        node = parser ? parser( doc, node, mode ) : NULL;
  ------------------
  |  Branch (1077:16): [True: 5.36M, False: 13.6k]
  ------------------
 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.37M|        if ( node )
  ------------------
  |  Branch (1083:14): [True: 2.77M, False: 2.60M]
  ------------------
 1084|  2.77M|        {
 1085|  2.77M|            parser = GetParserForNode( doc, node );
 1086|  2.77M|            continue;
 1087|  2.77M|        }
 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.60M|        if ( !TY_(isEmptyParserStack)(doc))
  ------------------
  |  |   23|  2.60M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.60M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1093:14): [True: 2.59M, False: 8.04k]
  ------------------
 1094|  2.59M|        {
 1095|  2.59M|            parser = TY_(peekMemoryIdentity)(doc);
  ------------------
  |  |   23|  2.59M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.59M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1096|  2.59M|            if (parser)
  ------------------
  |  Branch (1096:17): [True: 2.57M, False: 21.7k]
  ------------------
 1097|  2.57M|            {
 1098|  2.57M|                continue;
 1099|  2.57M|            }
 1100|  21.7k|            else
 1101|  21.7k|            {
 1102|       |                /* No parser means we're only passing back a parsing mode. */
 1103|  21.7k|                mode = TY_(peekMemoryMode)( doc );
  ------------------
  |  |   23|  21.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1104|  21.7k|                TY_(popMemory)( doc );
  ------------------
  |  |   23|  21.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1105|  21.7k|            }
 1106|  2.59M|        }
 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.8k|        node = TY_(GetToken)( doc, mode );
  ------------------
  |  |   23|  29.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1113|  29.8k|        DEBUG_LOG_GOT_TOKEN(node);
 1114|       |
 1115|  29.8k|        if (node)
  ------------------
  |  Branch (1115:13): [True: 8.53k, False: 21.3k]
  ------------------
 1116|  8.53k|            parser = GetParserForNode( doc, node );
 1117|  21.3k|        else
 1118|  21.3k|            something_to_do = no;
 1119|  29.8k|    }
 1120|  21.3k|}
prvTidyParseBlock:
 1138|   541k|{
 1139|   541k|    Lexer* lexer = doc->lexer;
 1140|   541k|    Node *node = NULL;
 1141|   541k|    Bool checkstack = yes;
 1142|   541k|    uint istackbase = 0;
 1143|   541k|    DEBUG_LOG_COUNTERS;
 1144|       |    
 1145|   541k|    if ( element == NULL )
  ------------------
  |  Branch (1145:10): [True: 265k, False: 276k]
  ------------------
 1146|   265k|    {
 1147|   265k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|   265k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   265k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1148|   265k|        node = memory.reentry_node; /* Throwaway, because the loop overwrites this immediately. */
 1149|   265k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 1150|   265k|        element = memory.original_node;
 1151|   265k|        DEBUG_LOG_GET_OLD_MODE;
 1152|   265k|        mode = memory.reentry_mode;
 1153|   265k|        DEBUG_LOG_CHANGE_MODE;
 1154|   265k|    }
 1155|   276k|    else
 1156|   276k|    {
 1157|   276k|        DEBUG_LOG_ENTER_WITH_NODE(element);
 1158|       |
 1159|   276k|        if ( element->tag->model & CM_EMPTY )
  ------------------
  |  |  139|   276k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (1159:14): [True: 1.51k, False: 274k]
  ------------------
 1160|  1.51k|        {
 1161|  1.51k|            DEBUG_LOG_EXIT;
 1162|  1.51k|            return NULL;
 1163|  1.51k|        }
 1164|       |
 1165|   274k|        if ( nodeIsDIV(element) && nodeIsDL(element->parent) && TY_(IsHTML5Mode)(doc) )
  ------------------
  |  |  429|   274k|#define nodeIsDIV( node )        TagIsId( node, TidyTag_DIV )
  |  |  ------------------
  |  |  |  |  275|   549k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 274k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 274k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 914, False: 273k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsDIV(element) && nodeIsDL(element->parent) && TY_(IsHTML5Mode)(doc) )
  ------------------
  |  |  388|    914|#define nodeIsDL( node )         TagIsId( node, TidyTag_DL )
  |  |  ------------------
  |  |  |  |  275|   275k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 713, False: 201]
  |  |  |  |  |  Branch (275:39): [True: 713, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 241, False: 472]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsDIV(element) && nodeIsDL(element->parent) && TY_(IsHTML5Mode)(doc) )
  ------------------
  |  |   23|    241|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    241|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1165:65): [True: 241, False: 0]
  ------------------
 1166|    241|        {
 1167|    241|            DEBUG_LOG_EXIT;
 1168|    241|            return TY_(ParseDefList)(doc, element, mode); /* @warning: possible recursion! */
  ------------------
  |  |   23|    241|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    241|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1169|    241|        }
 1170|       |        
 1171|   274k|        if ( nodeIsFORM(element) && DescendantOf(element, TidyTag_FORM) )
  ------------------
  |  |  424|   274k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|   549k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 274k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 274k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 8.12k, False: 266k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1171:37): [True: 7.27k, False: 844]
  ------------------
 1172|  7.27k|        {
 1173|  7.27k|            TY_(Report)(doc, element, NULL, ILLEGAL_NESTING );
  ------------------
  |  |   23|  7.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1174|  7.27k|        }
 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|   274k|        if (element->tag->model & CM_OBJECT)
  ------------------
  |  |  150|   274k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1184:13): [True: 3.83k, False: 270k]
  ------------------
 1185|  3.83k|        {
 1186|  3.83k|            istackbase = lexer->istackbase;
 1187|  3.83k|            lexer->istackbase = lexer->istacksize;
 1188|  3.83k|        }
 1189|       |
 1190|   274k|        if (!(element->tag->model & CM_MIXED))
  ------------------
  |  |  156|   274k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (1190:13): [True: 243k, False: 30.9k]
  ------------------
 1191|   243k|        {
 1192|   243k|            TY_(InlineDup)( doc, NULL );
  ------------------
  |  |   23|   243k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   243k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1193|   243k|        }
 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|   274k|        if ( !(element->tag->model & CM_INLINE) ||
  ------------------
  |  |  143|   274k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1201:14): [True: 77.3k, False: 197k]
  ------------------
 1202|   197k|              (element->tag->model & CM_FIELD ) )
  ------------------
  |  |  149|   197k|#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: 197k]
  ------------------
 1203|  77.3k|        {
 1204|  77.3k|            DEBUG_LOG_GET_OLD_MODE;
 1205|  77.3k|            mode = IgnoreWhitespace;
 1206|  77.3k|            DEBUG_LOG_CHANGE_MODE;
 1207|  77.3k|        }
 1208|   197k|        else if (mode == IgnoreWhitespace)
  ------------------
  |  Branch (1208:18): [True: 197k, False: 0]
  ------------------
 1209|   197k|        {
 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|   197k|            DEBUG_LOG_GET_OLD_MODE;
 1214|   197k|            mode = MixedContent;
 1215|   197k|            DEBUG_LOG_CHANGE_MODE;
 1216|   197k|        }
 1217|   274k|    } /* Re-Entering */
 1218|       |    
 1219|       |    /*
 1220|       |     Main Loop
 1221|       |     */
 1222|       |    
 1223|   621k|    while ((node = TY_(GetToken)(doc, mode /*MixedContent*/)) != NULL)
  ------------------
  |  |   23|   621k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   621k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1223:12): [True: 397k, False: 223k]
  ------------------
 1224|   397k|    {
 1225|   397k|        DEBUG_LOG_GOT_TOKEN(node);
 1226|       |        /* end tag for this element */
 1227|   397k|        if (node->type == EndTag && node->tag &&
  ------------------
  |  Branch (1227:13): [True: 39.2k, False: 358k]
  |  Branch (1227:37): [True: 38.7k, False: 486]
  ------------------
 1228|  38.7k|            (node->tag == element->tag || element->was == node->tag))
  ------------------
  |  Branch (1228:14): [True: 20.8k, False: 17.8k]
  |  Branch (1228:43): [True: 0, False: 17.8k]
  ------------------
 1229|  20.8k|        {
 1230|  20.8k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  20.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1231|       |
 1232|  20.8k|            if (element->tag->model & CM_OBJECT)
  ------------------
  |  |  150|  20.8k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1232:17): [True: 1.22k, False: 19.6k]
  ------------------
 1233|  1.22k|            {
 1234|       |                /* pop inline stack */
 1235|  20.2k|                while (lexer->istacksize > lexer->istackbase)
  ------------------
  |  Branch (1235:24): [True: 19.0k, False: 1.22k]
  ------------------
 1236|  19.0k|                    TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|  19.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1237|  1.22k|                lexer->istackbase = istackbase;
 1238|  1.22k|            }
 1239|       |
 1240|  20.8k|            element->closed = yes;
 1241|  20.8k|            TrimSpaces( doc, element );
 1242|  20.8k|            DEBUG_LOG_EXIT;
 1243|  20.8k|            return NULL;
 1244|  20.8k|        }
 1245|       |
 1246|   377k|        if ( nodeIsHTML(node) || nodeIsHEAD(node) || nodeIsBODY(node) )
  ------------------
  |  |  370|   377k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   754k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 377k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 329k, False: 47.5k]
  |  |  |  |  |  Branch (275:54): [True: 341, False: 329k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsHTML(node) || nodeIsHEAD(node) || nodeIsBODY(node) )
  ------------------
  |  |  371|   376k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|   753k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 376k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 329k, False: 47.5k]
  |  |  |  |  |  Branch (275:54): [True: 365, False: 328k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsHTML(node) || nodeIsHEAD(node) || nodeIsBODY(node) )
  ------------------
  |  |  375|   376k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   376k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 376k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 328k, False: 47.5k]
  |  |  |  |  |  Branch (275:54): [True: 473, False: 328k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1247|  1.17k|        {
 1248|  1.17k|            if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1248:18): [True: 862, False: 317]
  ------------------
 1249|    862|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    862|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    862|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1250|  1.17k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  1.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1251|  1.17k|            continue;
 1252|  1.17k|        }
 1253|       |
 1254|       |
 1255|   375k|        if (node->type == EndTag)
  ------------------
  |  Branch (1255:13): [True: 18.0k, False: 357k]
  ------------------
 1256|  18.0k|        {
 1257|  18.0k|            if (node->tag == NULL)
  ------------------
  |  Branch (1257:17): [True: 486, False: 17.5k]
  ------------------
 1258|    486|            {
 1259|    486|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    486|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    486|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1260|    486|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    486|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    486|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1261|    486|                continue;
 1262|    486|            }
 1263|  17.5k|            else if ( nodeIsBR(node) )
  ------------------
  |  |  400|  17.5k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  17.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 17.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 195, False: 17.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1264|    195|            {
 1265|    195|                node->type = StartTag;
 1266|    195|            }
 1267|  17.3k|            else if ( nodeIsP(node) )
  ------------------
  |  |  385|  17.3k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  17.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 17.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 222, False: 17.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1268|    222|            {
 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|    222|                node->type = StartEndTag;
 1276|    222|                node->implicit = yes;
 1277|    222|            }
 1278|  17.1k|            else if (DescendantOf( element, node->tag->id ))
  ------------------
  |  Branch (1278:22): [True: 4.22k, False: 12.9k]
  ------------------
 1279|  4.22k|            {
 1280|       |                /*
 1281|       |                  if this is the end tag for an ancestor element
 1282|       |                  then infer end tag for this element
 1283|       |                */
 1284|  4.22k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  4.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1285|  4.22k|                break;
 1286|  4.22k|            }
 1287|  12.9k|            else
 1288|  12.9k|            {
 1289|       |                /* special case </tr> etc. for stuff moved in front of table */
 1290|  12.9k|                if ( lexer->exiled
  ------------------
  |  Branch (1290:22): [True: 10.6k, False: 2.25k]
  ------------------
 1291|  10.6k|                     && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |   23|  10.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  146|  10.6k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  393|  10.4k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  10.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 10.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.4k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 451, False: 9.96k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1291:26): [True: 277, False: 10.4k]
  ------------------
 1292|    728|                {
 1293|    728|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    728|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    728|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1294|    728|                    TrimSpaces( doc, element );
 1295|    728|                    DEBUG_LOG_EXIT;
 1296|    728|                    return NULL;
 1297|    728|                }
 1298|  12.9k|            }
 1299|  18.0k|        }
 1300|       |
 1301|       |        /* mixed content model permits text */
 1302|   370k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|   370k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   370k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1302:13): [True: 26.2k, False: 344k]
  ------------------
 1303|  26.2k|        {
 1304|  26.2k|            if ( checkstack )
  ------------------
  |  Branch (1304:18): [True: 21.6k, False: 4.66k]
  ------------------
 1305|  21.6k|            {
 1306|  21.6k|                checkstack = no;
 1307|  21.6k|                if (!(element->tag->model & CM_MIXED))
  ------------------
  |  |  156|  21.6k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (1307:21): [True: 8.63k, False: 12.9k]
  ------------------
 1308|  8.63k|                {
 1309|  8.63k|                    if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  8.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1309:26): [True: 914, False: 7.71k]
  ------------------
 1310|    914|                        continue;
 1311|  8.63k|                }
 1312|  21.6k|            }
 1313|       |
 1314|  25.3k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  25.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  25.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1315|  25.3k|            DEBUG_LOG_GET_OLD_MODE
 1316|  25.3k|            mode = MixedContent;
 1317|  25.3k|            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|  25.3k|            if ( nodeIsBODY(element)       ||
  ------------------
  |  |  375|  25.3k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  50.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 25.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 25.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 25.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1327|  25.3k|                 nodeIsMAP(element)        ||
  ------------------
  |  |  413|  25.3k|#define nodeIsMAP( node )        TagIsId( node, TidyTag_MAP )
  |  |  ------------------
  |  |  |  |  275|  50.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 25.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 25.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 779, False: 24.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1328|  25.3k|                 nodeIsBLOCKQUOTE(element) ||
  ------------------
  |  |  426|  24.5k|#define nodeIsBLOCKQUOTE( node ) TagIsId( node, TidyTag_BLOCKQUOTE )
  |  |  ------------------
  |  |  |  |  275|  49.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 24.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 24.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 627, False: 23.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1329|  25.3k|                 nodeIsFORM(element)       ||
  ------------------
  |  |  424|  23.9k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  49.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 23.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 23.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 338, False: 23.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1330|  23.6k|                 nodeIsNOSCRIPT(element) )
  ------------------
  |  |  423|  23.6k|#define nodeIsNOSCRIPT( node )   TagIsId( node, TidyTag_NOSCRIPT )
  |  |  ------------------
  |  |  |  |  275|  23.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 23.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 23.6k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 210, False: 23.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1331|  1.95k|                TY_(ConstrainVersion)( doc, ~VERS_HTML40_STRICT );
  ------------------
  |  |   23|  1.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ConstrainVersion)( doc, ~VERS_HTML40_STRICT );
  ------------------
  |  |  207|  1.95k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  1.95k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  1.95k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  1.95k|#define X10S                 256u
  |  |  ------------------
  ------------------
 1332|  25.3k|            continue;
 1333|  26.2k|        }
 1334|       |
 1335|   344k|        if ( InsertMisc(element, node) )
  ------------------
  |  Branch (1335:14): [True: 13.8k, False: 330k]
  ------------------
 1336|  13.8k|            continue;
 1337|       |
 1338|       |        /* allow PARAM elements? */
 1339|   330k|        if ( nodeIsPARAM(node) )
  ------------------
  |  |  409|   330k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|   330k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 330k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 323k, False: 6.93k]
  |  |  |  |  |  Branch (275:54): [True: 1.39k, False: 322k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1340|  1.39k|        {
 1341|  1.39k|            if ( TY_(nodeHasCM)(element, CM_PARAM) && TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if ( TY_(nodeHasCM)(element, CM_PARAM) && TY_(nodeIsElement)(node) )
  ------------------
  |  |  151|  1.39k|#define CM_PARAM        (1 << 12)  /**< Elements that allows "PARAM". */
  ------------------
                          if ( TY_(nodeHasCM)(element, CM_PARAM) && TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.20k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1341:18): [True: 1.20k, False: 194]
  |  Branch (1341:55): [True: 1.00k, False: 196]
  ------------------
 1342|  1.00k|            {
 1343|  1.00k|                TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1344|  1.00k|                continue;
 1345|  1.00k|            }
 1346|       |
 1347|       |            /* otherwise discard it */
 1348|    390|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    390|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    390|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1349|    390|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    390|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    390|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1350|    390|            continue;
 1351|  1.39k|        }
 1352|       |
 1353|       |        /* allow AREA elements? */
 1354|   328k|        if ( nodeIsAREA(node) )
  ------------------
  |  |  414|   328k|#define nodeIsAREA( node )       TagIsId( node, TidyTag_AREA )
  |  |  ------------------
  |  |  |  |  275|   328k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 328k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 322k, False: 6.93k]
  |  |  |  |  |  Branch (275:54): [True: 1.05k, False: 320k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1355|  1.05k|        {
 1356|  1.05k|            if ( nodeIsMAP(element) && TY_(nodeIsElement)(node) )
  ------------------
  |  |  413|  1.05k|#define nodeIsMAP( node )        TagIsId( node, TidyTag_MAP )
  |  |  ------------------
  |  |  |  |  275|  2.10k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.05k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.05k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 853, False: 197]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsMAP(element) && TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|    853|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    853|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1356:40): [True: 478, False: 375]
  ------------------
 1357|    478|            {
 1358|    478|                TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|    478|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    478|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1359|    478|                continue;
 1360|    478|            }
 1361|       |
 1362|       |            /* otherwise discard it */
 1363|    572|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    572|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    572|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1364|    572|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    572|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    572|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1365|    572|            continue;
 1366|  1.05k|        }
 1367|       |
 1368|       |        /* ignore unknown start/end tags */
 1369|   327k|        if ( node->tag == NULL )
  ------------------
  |  Branch (1369:14): [True: 6.93k, False: 320k]
  ------------------
 1370|  6.93k|        {
 1371|  6.93k|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  6.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1372|  6.93k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  6.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1373|  6.93k|            continue;
 1374|  6.93k|        }
 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|   320k|        if ( !TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|   320k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   320k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( !TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|   320k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1387:14): [True: 93.3k, False: 227k]
  ------------------
 1388|  93.3k|        {
 1389|  93.3k|            if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  93.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  93.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1389:18): [True: 793, False: 92.5k]
  ------------------
 1390|    793|            {
 1391|    793|                if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    793|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    793|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 793, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 793, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 199, False: 594]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1392|    199|                    BadForm( doc );
 1393|       |
 1394|    793|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    793|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    793|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1395|    793|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    793|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    793|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1396|    793|                continue;
 1397|    793|            }
 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|  92.5k|            if ( nodeIsLI(element) )
  ------------------
  |  |  390|  92.5k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|  92.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 92.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 92.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 45.1k, False: 47.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1416|  45.1k|            {
 1417|  45.1k|                if ( nodeIsFRAME(node)    ||
  ------------------
  |  |  377|  45.1k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|  90.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 45.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 45.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 197, False: 44.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1418|  45.1k|                     nodeIsFRAMESET(node) ||
  ------------------
  |  |  376|  44.9k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  90.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 44.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 44.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 195, False: 44.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1419|  45.1k|                     nodeIsOPTGROUP(node) ||
  ------------------
  |  |  411|  44.7k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  89.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 44.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 44.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 216, False: 44.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1420|  44.5k|                     nodeIsOPTION(node) )
  ------------------
  |  |  410|  44.5k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  44.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 44.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 44.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 209, False: 44.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1421|    817|                {
 1422|    817|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    817|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    817|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1423|    817|                    TY_(FreeNode)( doc, node );  /* DSR - 27Apr02 avoid memory leak */
  ------------------
  |  |   23|    817|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    817|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1424|    817|                    continue;
 1425|    817|                }
 1426|  45.1k|            }
 1427|       |
 1428|  91.7k|            if ( nodeIsTD(element) || nodeIsTH(element) )
  ------------------
  |  |  395|  91.7k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|   183k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 91.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 91.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 10.2k, False: 81.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsTD(element) || nodeIsTH(element) )
  ------------------
  |  |  396|  81.5k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  81.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 81.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 81.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.52k, False: 79.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1429|  12.7k|            {
 1430|       |                /* if parent is a table cell, avoid inferring the end of the cell */
 1431|       |
 1432|  12.7k|                if ( TY_(nodeHasCM)(node, CM_HEAD) )
  ------------------
  |  |   23|  12.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_HEAD) )
  ------------------
  |  |  141|  12.7k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1432:22): [True: 257, False: 12.4k]
  ------------------
 1433|    257|                {
 1434|    257|                    MoveToHead( doc, element, node );
 1435|    257|                    continue;
 1436|    257|                }
 1437|       |
 1438|  12.4k|                if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |   23|  12.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |  144|  12.4k|#define CM_LIST         (1 << 5)   /**< Elements that mark list item ("LI"). */
  ------------------
  |  Branch (1438:22): [True: 210, False: 12.2k]
  ------------------
 1439|    210|                {
 1440|    210|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    210|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    210|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1441|    210|                    node = TY_(InferredTag)(doc, TidyTag_UL);
  ------------------
  |  |   23|    210|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    210|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1442|    210|                    AddClassNoIndent(doc, node);
 1443|    210|                    lexer->excludeBlocks = yes;
 1444|    210|                }
 1445|  12.2k|                else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |   23|  12.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |  145|  12.2k|#define CM_DEFLIST      (1 << 6)   /**< Elements that mark definition list item ("DL", "DT"). */
  ------------------
  |  Branch (1445:27): [True: 1.54k, False: 10.7k]
  ------------------
 1446|  1.54k|                {
 1447|  1.54k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1448|  1.54k|                    node = TY_(InferredTag)(doc, TidyTag_DL);
  ------------------
  |  |   23|  1.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1449|  1.54k|                    lexer->excludeBlocks = yes;
 1450|  1.54k|                }
 1451|       |
 1452|       |                /* infer end of current table cell */
 1453|  12.4k|                if ( !TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |   23|  12.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( !TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |  142|  12.4k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (1453:22): [True: 2.38k, False: 10.0k]
  ------------------
 1454|  2.38k|                {
 1455|  2.38k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1456|  2.38k|                    TrimSpaces( doc, element );
 1457|  2.38k|                    DEBUG_LOG_EXIT;
 1458|  2.38k|                    return NULL;
 1459|  2.38k|                }
 1460|  12.4k|            }
 1461|  79.0k|            else if ( TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |   23|  79.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  79.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |  142|  79.0k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (1461:23): [True: 53.1k, False: 25.8k]
  ------------------
 1462|  53.1k|            {
 1463|  53.1k|                if ( lexer->excludeBlocks )
  ------------------
  |  Branch (1463:22): [True: 2.54k, False: 50.6k]
  ------------------
 1464|  2.54k|                {
 1465|  2.54k|                    if ( !TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |   23|  2.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( !TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |  154|  2.54k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1465:26): [True: 1.03k, False: 1.51k]
  ------------------
 1466|  1.03k|                        TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|  1.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1467|       |
 1468|  2.54k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1469|       |
 1470|  2.54k|                    if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |   23|  2.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |  150|  2.54k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1470:26): [True: 196, False: 2.35k]
  ------------------
 1471|    196|                        lexer->istackbase = istackbase;
 1472|       |
 1473|  2.54k|                    TrimSpaces( doc, element );
 1474|  2.54k|                    DEBUG_LOG_EXIT;
 1475|  2.54k|                    return NULL;
 1476|  2.54k|                }
 1477|  53.1k|            }
 1478|  25.8k|            else if ( ! nodeIsTEMPLATE( element ) )/* things like list items */
  ------------------
  |  |  466|  25.8k|#define nodeIsTEMPLATE( node )   TagIsId( node, TidyTag_TEMPLATE )
  |  |  ------------------
  |  |  |  |  275|  25.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 25.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 25.8k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 221, False: 25.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1479|  25.6k|            {
 1480|  25.6k|                if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  25.6k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1480:21): [True: 294, False: 25.3k]
  ------------------
 1481|    294|                {
 1482|    294|                    MoveToHead( doc, element, node );
 1483|    294|                    continue;
 1484|    294|                }
 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|  25.3k|                if ( nodeIsFORM(element) &&
  ------------------
  |  |  424|  25.3k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  50.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 25.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 25.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 7.69k, False: 17.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1492|  25.3k|                     nodeIsTD(element->parent) &&
  ------------------
  |  |  395|  7.69k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  33.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.14k, False: 548]
  |  |  |  |  |  Branch (275:39): [True: 7.14k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 6.29k, False: 846]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1493|  6.29k|                     element->parent->implicit )
  ------------------
  |  Branch (1493:22): [True: 6.06k, False: 235]
  ------------------
 1494|  6.06k|                {
 1495|  6.06k|                    if ( nodeIsTD(node) )
  ------------------
  |  |  395|  6.06k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  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: 195, False: 5.86k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1496|    195|                    {
 1497|    195|                        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    195|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    195|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1498|    195|                        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    195|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    195|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1499|    195|                        continue;
 1500|    195|                    }
 1501|       |
 1502|  5.86k|                    if ( nodeIsTH(node) )
  ------------------
  |  |  396|  5.86k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  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: 226, False: 5.64k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1503|    226|                    {
 1504|    226|                        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    226|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    226|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1505|    226|                        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    226|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    226|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1506|    226|                        node = element->parent;
 1507|    226|                        TidyDocFree(doc, node->element);
  ------------------
  |  |  159|    226|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|    226|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1508|    226|                        node->element = TY_(tmbstrdup)(doc->allocator, "th");
  ------------------
  |  |   23|    226|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    226|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1509|    226|                        node->tag = TY_(LookupTagDef)( TidyTag_TH );
  ------------------
  |  |   23|    226|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    226|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1510|    226|                        continue;
 1511|    226|                    }
 1512|  5.86k|                }
 1513|       |
 1514|  24.9k|                if ( !TY_(nodeHasCM)(element, CM_OPT) && !element->implicit )
  ------------------
  |  |   23|  24.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( !TY_(nodeHasCM)(element, CM_OPT) && !element->implicit )
  ------------------
  |  |  154|  24.9k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1514:22): [True: 17.6k, False: 7.30k]
  |  Branch (1514:58): [True: 17.4k, False: 200]
  ------------------
 1515|  17.4k|                    TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|  17.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1516|       |
 1517|       |                /* #521, warn on missing optional end-tags if not omitting them. */
 1518|  24.9k|                if ( cfgBool( doc, TidyOmitOptionalTags ) == no && TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |  418|  24.9k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  24.9k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                              if ( cfgBool( doc, TidyOmitOptionalTags ) == no && TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |   23|  24.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( cfgBool( doc, TidyOmitOptionalTags ) == no && TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |  154|  24.9k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1518:22): [True: 24.9k, False: 0]
  |  Branch (1518:68): [True: 7.30k, False: 17.6k]
  ------------------
 1519|  7.30k|                    TY_(Report)(doc, element, node, MISSING_ENDTAG_OPTIONAL );
  ------------------
  |  |   23|  7.30k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.30k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1520|       |
 1521|       |
 1522|  24.9k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  24.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1523|       |
 1524|  24.9k|                if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |   23|  24.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |  144|  24.9k|#define CM_LIST         (1 << 5)   /**< Elements that mark list item ("LI"). */
  ------------------
  |  Branch (1524:22): [True: 3.05k, False: 21.8k]
  ------------------
 1525|  3.05k|                {
 1526|  3.05k|                    if ( element->parent && element->parent->tag &&
  ------------------
  |  Branch (1526:26): [True: 2.86k, False: 196]
  |  Branch (1526:45): [True: 2.86k, False: 0]
  ------------------
 1527|  2.86k|                         element->parent->tag->parser == TY_(ParseList) )
  ------------------
  |  |   23|  2.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1527:26): [True: 1.92k, False: 939]
  ------------------
 1528|  1.92k|                    {
 1529|  1.92k|                        TrimSpaces( doc, element );
 1530|  1.92k|                        DEBUG_LOG_EXIT;
 1531|  1.92k|                        return NULL;
 1532|  1.92k|                    }
 1533|       |
 1534|  1.13k|                    node = TY_(InferredTag)(doc, TidyTag_UL);
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1535|  1.13k|                    AddClassNoIndent(doc, node);
 1536|  1.13k|                }
 1537|  21.8k|                else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |   23|  21.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |  145|  21.8k|#define CM_DEFLIST      (1 << 6)   /**< Elements that mark definition list item ("DL", "DT"). */
  ------------------
  |  Branch (1537:27): [True: 1.67k, False: 20.1k]
  ------------------
 1538|  1.67k|                {
 1539|  1.67k|                    if ( nodeIsDL(element->parent) )
  ------------------
  |  |  388|  1.67k|#define nodeIsDL( node )         TagIsId( node, TidyTag_DL )
  |  |  ------------------
  |  |  |  |  275|  1.67k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.38k, False: 291]
  |  |  |  |  |  Branch (275:39): [True: 1.38k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 300, False: 1.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1540|    300|                    {
 1541|    300|                        TrimSpaces( doc, element );
 1542|    300|                        DEBUG_LOG_EXIT;
 1543|    300|                        return NULL;
 1544|    300|                    }
 1545|       |
 1546|  1.37k|                    node = TY_(InferredTag)(doc, TidyTag_DL);
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1547|  1.37k|                }
 1548|  20.1k|                else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |   23|  20.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |  146|  20.1k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |   23|  7.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |  148|  7.28k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (1548:27): [True: 12.8k, False: 7.28k]
  |  Branch (1548:61): [True: 2.12k, False: 5.16k]
  ------------------
 1549|  15.0k|                {
 1550|       |                    /* http://tidy.sf.net/issue/1316307 */
 1551|       |                    /* In exiled mode, return so table processing can
 1552|       |                       continue. */
 1553|  15.0k|                    if (lexer->exiled)
  ------------------
  |  Branch (1553:25): [True: 2.17k, False: 12.8k]
  ------------------
 1554|  2.17k|                    {
 1555|  2.17k|                        DEBUG_LOG_EXIT;
 1556|  2.17k|                        return NULL;
 1557|  2.17k|                    }
 1558|  12.8k|                    node = TY_(InferredTag)(doc, TidyTag_TABLE);
  ------------------
  |  |   23|  12.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1559|  12.8k|                }
 1560|  5.16k|                else if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |   23|  5.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |  150|  5.16k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1560:27): [True: 936, False: 4.22k]
  ------------------
 1561|    936|                {
 1562|       |                    /* pop inline stack */
 1563|  1.61k|                    while ( lexer->istacksize > lexer->istackbase )
  ------------------
  |  Branch (1563:29): [True: 674, False: 936]
  ------------------
 1564|    674|                        TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|    674|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    674|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1565|    936|                    lexer->istackbase = istackbase;
 1566|    936|                    TrimSpaces( doc, element );
 1567|    936|                    DEBUG_LOG_EXIT;
 1568|    936|                    return NULL;
 1569|       |
 1570|    936|                }
 1571|  4.22k|                else
 1572|  4.22k|                {
 1573|  4.22k|                    TrimSpaces( doc, element );
 1574|  4.22k|                    DEBUG_LOG_EXIT;
 1575|  4.22k|                    return NULL;
 1576|  4.22k|                }
 1577|  24.9k|            }
 1578|  91.7k|        }
 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|   303k|        if ( nodeIsA(node) && !node->implicit &&
  ------------------
  |  |  401|   303k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|   607k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 303k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 303k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 71.3k, False: 232k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1587:31): [True: 46.3k, False: 25.0k]
  ------------------
 1588|  46.3k|             (nodeIsA(element) || DescendantOf(element, TidyTag_A)) )
  ------------------
  |  |  401|  46.3k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  92.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 46.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 46.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 24.7k, False: 21.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1588:35): [True: 1.80k, False: 19.7k]
  ------------------
 1589|  26.5k|        {
 1590|  26.5k|            if (node->type != EndTag && node->attributes == NULL
  ------------------
  |  Branch (1590:17): [True: 26.5k, False: 0]
  |  Branch (1590:41): [True: 16.3k, False: 10.1k]
  ------------------
 1591|  16.3k|                && cfgBool(doc, TidyCoerceEndTags) )
  ------------------
  |  |  418|  16.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  16.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 16.3k, False: 0]
  |  |  ------------------
  ------------------
 1592|  16.3k|            {
 1593|  16.3k|                node->type = EndTag;
 1594|  16.3k|                TY_(Report)(doc, element, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|  16.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1595|  16.3k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  16.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1596|  16.3k|                continue;
 1597|  16.3k|            }
 1598|       |
 1599|  10.1k|            if (nodeIsA(element))
  ------------------
  |  |  401|  10.1k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  10.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 10.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 9.77k, False: 415]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1600|  9.77k|            {
 1601|  9.77k|                TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  9.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1602|  9.77k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  9.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1603|  9.77k|            }
 1604|    415|            else
 1605|    415|            {
 1606|       |                /* Issue #597 - if we not 'UngetToken' then it is being discarded.
 1607|       |                   Add message, and 'FreeNode' - thanks @ralfjunker */
 1608|    415|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    415|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    415|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1609|    415|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    415|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    415|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1610|    415|            }
 1611|       |
 1612|  10.1k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (1612:17): [True: 10.1k, False: 0]
  ------------------
 1613|  10.1k|                TrimSpaces(doc, element);
 1614|       |
 1615|  10.1k|            DEBUG_LOG_EXIT;
 1616|  10.1k|            return NULL;
 1617|  26.5k|        }
 1618|       |
 1619|       |        /* parse known element */
 1620|   277k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|   277k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   277k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1620:13): [True: 266k, False: 10.7k]
  ------------------
 1621|   266k|        {
 1622|   266k|            if (node->tag->model & CM_INLINE)
  ------------------
  |  |  143|   266k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1622:17): [True: 190k, False: 76.3k]
  ------------------
 1623|   190k|            {
 1624|   190k|                if (checkstack && !node->implicit)
  ------------------
  |  Branch (1624:21): [True: 184k, False: 5.35k]
  |  Branch (1624:35): [True: 20.7k, False: 164k]
  ------------------
 1625|  20.7k|                {
 1626|  20.7k|                    checkstack = no;
 1627|       |
 1628|  20.7k|                    if (!(element->tag->model & CM_MIXED)) /* #431731 - fix by Randy Waki 25 Dec 00 */
  ------------------
  |  |  156|  20.7k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (1628:25): [True: 13.5k, False: 7.14k]
  ------------------
 1629|  13.5k|                    {
 1630|  13.5k|                        if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  13.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1630:30): [True: 511, False: 13.0k]
  ------------------
 1631|    511|                            continue;
 1632|  13.5k|                    }
 1633|  20.7k|                }
 1634|       |
 1635|   189k|                DEBUG_LOG_GET_OLD_MODE;
 1636|   189k|                mode = MixedContent;
 1637|   189k|                DEBUG_LOG_CHANGE_MODE;
 1638|   189k|            }
 1639|  76.3k|            else
 1640|  76.3k|            {
 1641|  76.3k|                checkstack = yes;
 1642|  76.3k|                DEBUG_LOG_GET_OLD_MODE;
 1643|  76.3k|                mode = IgnoreWhitespace;
 1644|  76.3k|                DEBUG_LOG_CHANGE_MODE;
 1645|  76.3k|            }
 1646|       |
 1647|       |            /* trim white space before <br> */
 1648|   266k|            if ( nodeIsBR(node) )
  ------------------
  |  |  400|   266k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   266k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 266k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 266k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 611, False: 265k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1649|    611|                TrimSpaces( doc, element );
 1650|       |
 1651|   266k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|   266k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   266k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1652|       |
 1653|   266k|            if (node->implicit)
  ------------------
  |  Branch (1653:17): [True: 182k, False: 83.0k]
  ------------------
 1654|   182k|                TY_(Report)(doc, element, node, INSERTING_TAG );
  ------------------
  |  |   23|   182k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   182k|#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|   266k|            {
 1661|   266k|                TidyParserMemory memory = {0};
 1662|   266k|                memory.identity = TY_(ParseBlock);
  ------------------
  |  |   23|   266k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   266k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1663|   266k|                memory.reentry_node = node;
 1664|   266k|                memory.reentry_mode = mode;
 1665|   266k|                memory.original_node = element;
 1666|   266k|                TY_(pushMemory)(doc, memory);
  ------------------
  |  |   23|   266k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   266k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1667|   266k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 1668|   266k|            }
 1669|   266k|            return node;
 1670|   266k|        }
 1671|       |
 1672|       |        /* discard unexpected tags */
 1673|  10.7k|        if (node->type == EndTag)
  ------------------
  |  Branch (1673:13): [True: 10.7k, False: 0]
  ------------------
 1674|  10.7k|            TY_(PopInline)( doc, node );  /* if inline end tag */
  ------------------
  |  |   23|  10.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1675|       |
 1676|  10.7k|        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  10.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1677|  10.7k|        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  10.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1678|  10.7k|        continue;
 1679|   277k|    }
 1680|       |
 1681|   227k|    if (!(element->tag->model & CM_OPT))
  ------------------
  |  |  154|   227k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1681:9): [True: 173k, False: 53.8k]
  ------------------
 1682|   173k|        TY_(Report)(doc, element, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|   173k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   173k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1683|       |
 1684|   227k|    if (element->tag->model & CM_OBJECT)
  ------------------
  |  |  150|   227k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1684:9): [True: 1.45k, False: 225k]
  ------------------
 1685|  1.45k|    {
 1686|       |        /* pop inline stack */
 1687|  3.80k|        while ( lexer->istacksize > lexer->istackbase )
  ------------------
  |  Branch (1687:17): [True: 2.34k, False: 1.45k]
  ------------------
 1688|  2.34k|            TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|  2.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1689|  1.45k|        lexer->istackbase = istackbase;
 1690|  1.45k|    }
 1691|       |
 1692|   227k|    TrimSpaces( doc, element );
 1693|       |
 1694|   227k|    DEBUG_LOG_EXIT;
 1695|       |    return NULL;
 1696|   539k|}
prvTidyParseBody:
 1708|   211k|{
 1709|   211k|    Lexer* lexer = doc->lexer;
 1710|   211k|    Node *node = NULL;
 1711|   211k|    Bool checkstack = no;
 1712|   211k|    Bool iswhitenode = no;
 1713|   211k|    DEBUG_LOG_COUNTERS;
 1714|       |
 1715|   211k|    mode = IgnoreWhitespace;
 1716|   211k|    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|   211k|    if ( body == NULL )
  ------------------
  |  Branch (1723:10): [True: 142k, False: 69.3k]
  ------------------
 1724|   142k|    {
 1725|   142k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|   142k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   142k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1726|   142k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 1727|   142k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 1728|   142k|        body = memory.original_node;
 1729|   142k|        checkstack = memory.register_1;
 1730|   142k|        iswhitenode = memory.register_2;
 1731|   142k|        DEBUG_LOG_GET_OLD_MODE;
 1732|   142k|        mode = memory.mode;
 1733|   142k|        DEBUG_LOG_CHANGE_MODE;
 1734|   142k|    }
 1735|  69.3k|    else
 1736|  69.3k|    {
 1737|  69.3k|        DEBUG_LOG_ENTER_WITH_NODE(body);
 1738|  69.3k|        TY_(BumpObject)( doc, body->parent );
  ------------------
  |  |   23|  69.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  69.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1739|  69.3k|    }
 1740|       |    
 1741|   464k|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|   464k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   464k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1741:12): [True: 437k, False: 27.2k]
  ------------------
 1742|   437k|    {
 1743|   437k|        DEBUG_LOG_GOT_TOKEN(node);
 1744|       |        /* find and discard multiple <body> elements */
 1745|   437k|        if (node->tag == body->tag && node->type == StartTag)
  ------------------
  |  Branch (1745:13): [True: 4.29k, False: 432k]
  |  Branch (1745:39): [True: 811, False: 3.48k]
  ------------------
 1746|    811|        {
 1747|    811|            TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    811|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    811|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1748|    811|            TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    811|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    811|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1749|    811|            continue;
 1750|    811|        }
 1751|       |
 1752|       |        /* #538536 Extra endtags not detected */
 1753|   436k|        if ( nodeIsHTML(node) )
  ------------------
  |  |  370|   436k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   436k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 436k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 195k, False: 240k]
  |  |  |  |  |  Branch (275:54): [True: 730, False: 194k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1754|    730|        {
 1755|    730|            if (TY_(nodeIsElement)(node) || lexer->seenEndHtml)
  ------------------
  |  |   23|    730|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    730|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1755:17): [True: 474, False: 256]
  |  Branch (1755:45): [True: 228, False: 28]
  ------------------
 1756|    702|                TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    702|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    702|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1757|     28|            else
 1758|     28|                lexer->seenEndHtml = 1;
 1759|       |
 1760|    730|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    730|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    730|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1761|    730|            continue;
 1762|    730|        }
 1763|       |
 1764|   435k|        if ( lexer->seenEndBody &&
  ------------------
  |  Branch (1764:14): [True: 5.09k, False: 430k]
  ------------------
 1765|  5.09k|             ( node->type == StartTag ||
  ------------------
  |  Branch (1765:16): [True: 1.51k, False: 3.58k]
  ------------------
 1766|  3.58k|               node->type == EndTag   ||
  ------------------
  |  Branch (1766:16): [True: 2.55k, False: 1.03k]
  ------------------
 1767|  1.03k|               node->type == StartEndTag ) )
  ------------------
  |  Branch (1767:16): [True: 288, False: 747]
  ------------------
 1768|  4.35k|        {
 1769|  4.35k|            TY_(Report)(doc, body, node, CONTENT_AFTER_BODY );
  ------------------
  |  |   23|  4.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1770|  4.35k|        }
 1771|       |
 1772|   435k|        if ( node->tag == body->tag && node->type == EndTag )
  ------------------
  |  Branch (1772:14): [True: 3.48k, False: 432k]
  |  Branch (1772:40): [True: 2.48k, False: 1.00k]
  ------------------
 1773|  2.48k|        {
 1774|  2.48k|            body->closed = yes;
 1775|  2.48k|            TrimSpaces(doc, body);
 1776|  2.48k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1777|  2.48k|            lexer->seenEndBody = 1;
 1778|  2.48k|            DEBUG_LOG_GET_OLD_MODE;
 1779|  2.48k|            mode = IgnoreWhitespace;
 1780|  2.48k|            DEBUG_LOG_CHANGE_MODE;
 1781|       |
 1782|  2.48k|            if ( nodeIsNOFRAMES(body->parent) )
  ------------------
  |  |  379|  2.48k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  2.48k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.25k, False: 229]
  |  |  |  |  |  Branch (275:39): [True: 2.25k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.73k, False: 518]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1783|  1.73k|                break;
 1784|       |
 1785|    747|            continue;
 1786|  2.48k|        }
 1787|       |
 1788|   433k|        if ( nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|   433k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|   433k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 433k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 192k, False: 240k]
  |  |  |  |  |  Branch (275:54): [True: 5.50k, False: 187k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1789|  5.50k|        {
 1790|  5.50k|            if (node->type == StartTag)
  ------------------
  |  Branch (1790:17): [True: 4.47k, False: 1.03k]
  ------------------
 1791|  4.47k|            {
 1792|  4.47k|                TidyParserMemory memory = {0};
 1793|       |
 1794|  4.47k|                TY_(InsertNodeAtEnd)(body, node);
  ------------------
  |  |   23|  4.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1795|       |                
 1796|  4.47k|                memory.identity = TY_(ParseBody);
  ------------------
  |  |   23|  4.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1797|  4.47k|                memory.original_node = body;
 1798|  4.47k|                memory.reentry_node = node;
 1799|  4.47k|                memory.register_1 = checkstack;
 1800|  4.47k|                memory.register_2 = iswhitenode;
 1801|  4.47k|                memory.mode = mode;
 1802|  4.47k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  4.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1803|  4.47k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 1804|  4.47k|                return node;
 1805|  4.47k|            }
 1806|       |
 1807|  1.03k|            if (node->type == EndTag && nodeIsNOFRAMES(body->parent) )
  ------------------
  |  |  379|    605|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|    605|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 404, False: 201]
  |  |  |  |  |  Branch (275:39): [True: 404, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 203, False: 201]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1807:17): [True: 605, False: 426]
  ------------------
 1808|    203|            {
 1809|    203|                TrimSpaces(doc, body);
 1810|    203|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    203|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    203|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1811|    203|                break;
 1812|    203|            }
 1813|  1.03k|        }
 1814|       |
 1815|   428k|        if ( (nodeIsFRAME(node) || nodeIsFRAMESET(node))
  ------------------
  |  |  377|   428k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|   856k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 428k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 187k, False: 240k]
  |  |  |  |  |  Branch (275:54): [True: 2.63k, False: 185k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( (nodeIsFRAME(node) || nodeIsFRAMESET(node))
  ------------------
  |  |  376|   425k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|   425k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 425k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 185k, False: 240k]
  |  |  |  |  |  Branch (275:54): [True: 1.15k, False: 184k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1816|  3.78k|             && nodeIsNOFRAMES(body->parent) )
  ------------------
  |  |  379|  3.78k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  3.78k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.57k, False: 210]
  |  |  |  |  |  Branch (275:39): [True: 3.57k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 953, False: 2.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1817|    953|        {
 1818|    953|            TrimSpaces(doc, body);
 1819|    953|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    953|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    953|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1820|    953|            break;
 1821|    953|        }
 1822|       |
 1823|   427k|        iswhitenode = no;
 1824|       |
 1825|   427k|        if ( TY_(nodeIsText)(node) &&
  ------------------
  |  |   23|   427k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   427k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1825:14): [True: 39.0k, False: 388k]
  ------------------
 1826|  39.0k|             node->end <= node->start + 1 &&
  ------------------
  |  Branch (1826:14): [True: 13.3k, False: 25.6k]
  ------------------
 1827|  13.3k|             lexer->lexbuf[node->start] == ' ' )
  ------------------
  |  Branch (1827:14): [True: 1.32k, False: 12.0k]
  ------------------
 1828|  1.32k|            iswhitenode = yes;
 1829|       |
 1830|       |        /* deal with comments etc. */
 1831|   427k|        if (InsertMisc(body, node))
  ------------------
  |  Branch (1831:13): [True: 146k, False: 280k]
  ------------------
 1832|   146k|            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: 39.0k, False: 241k]
  ------------------
 1836|  39.0k|        {
 1837|  39.0k|            if (iswhitenode && mode == IgnoreWhitespace)
  ------------------
  |  Branch (1837:17): [True: 1.32k, False: 37.7k]
  |  Branch (1837:32): [True: 231, False: 1.09k]
  ------------------
 1838|    231|            {
 1839|    231|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    231|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    231|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1840|    231|                continue;
 1841|    231|            }
 1842|       |
 1843|       |            /* HTML 2 and HTML4 strict don't allow text here */
 1844|  38.8k|            TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT | VERS_HTML20));
  ------------------
  |  |   23|  38.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT | VERS_HTML20));
  ------------------
  |  |  207|  38.8k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  38.8k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  38.8k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  38.8k|#define X10S                 256u
  |  |  ------------------
  ------------------
                          TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT | VERS_HTML20));
  ------------------
  |  |  205|  38.8k|#define VERS_HTML20        (HT20)
  |  |  ------------------
  |  |  |  |  177|  38.8k|#define HT20                   1u
  |  |  ------------------
  ------------------
 1845|       |
 1846|  38.8k|            if (checkstack)
  ------------------
  |  Branch (1846:17): [True: 13.0k, False: 25.7k]
  ------------------
 1847|  13.0k|            {
 1848|  13.0k|                checkstack = no;
 1849|       |
 1850|  13.0k|                if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  13.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1850:22): [True: 1.41k, False: 11.6k]
  ------------------
 1851|  1.41k|                    continue;
 1852|  13.0k|            }
 1853|       |
 1854|  37.4k|            TY_(InsertNodeAtEnd)(body, node);
  ------------------
  |  |   23|  37.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1855|  37.4k|            DEBUG_LOG_GET_OLD_MODE;
 1856|  37.4k|            mode = MixedContent;
 1857|  37.4k|            DEBUG_LOG_CHANGE_MODE;
 1858|  37.4k|            continue;
 1859|  38.8k|        }
 1860|       |
 1861|   241k|        if (node->type == DocTypeTag)
  ------------------
  |  Branch (1861:13): [True: 3.83k, False: 237k]
  ------------------
 1862|  3.83k|        {
 1863|  3.83k|            InsertDocType(doc, body, node);
 1864|  3.83k|            continue;
 1865|  3.83k|        }
 1866|       |        /* discard unknown  and PARAM tags */
 1867|   237k|        if ( node->tag == NULL || nodeIsPARAM(node) )
  ------------------
  |  |  409|   186k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|   186k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 186k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 186k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 236, False: 186k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1867:14): [True: 50.7k, False: 186k]
  ------------------
 1868|  51.0k|        {
 1869|  51.0k|            TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  51.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1870|  51.0k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  51.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1871|  51.0k|            continue;
 1872|  51.0k|        }
 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|   186k|        lexer->excludeBlocks = no;
 1881|       |
 1882|   186k|        if ((( nodeIsINPUT(node) ||
  ------------------
  |  |  431|   186k|#define nodeIsINPUT( node )      TagIsId( node, TidyTag_INPUT )
  |  |  ------------------
  |  |  |  |  275|   373k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 186k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 186k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 610, False: 186k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1883|   186k|             (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |   23|   186k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   186k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |  142|   186k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                           (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |   23|  42.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |  143|  42.1k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1883:15): [True: 42.1k, False: 143k]
  |  Branch (1883:50): [True: 22.7k, False: 19.4k]
  ------------------
 1884|   186k|           ) && !TY_(IsHTML5Mode)(doc)) || nodeIsLI(node) )
  ------------------
  |  |   23|  23.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                         ) && !TY_(IsHTML5Mode)(doc)) || nodeIsLI(node) )
  ------------------
  |  |  390|   183k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|   183k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 183k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 183k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 585, False: 182k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1884:17): [True: 3.27k, False: 20.0k]
  ------------------
 1885|  3.86k|        {
 1886|       |            /* avoid this error message being issued twice */
 1887|  3.86k|            if (!(node->tag->model & CM_HEAD))
  ------------------
  |  |  141|  3.86k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1887:17): [True: 3.46k, False: 392]
  ------------------
 1888|  3.46k|                TY_(Report)(doc, body, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  3.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1889|       |
 1890|  3.86k|            if (node->tag->model & CM_HTML)
  ------------------
  |  |  140|  3.86k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
  |  Branch (1890:17): [True: 1.02k, False: 2.83k]
  ------------------
 1891|  1.02k|            {
 1892|       |                /* copy body attributes if current body was inferred */
 1893|  1.02k|                if ( nodeIsBODY(node) && body->implicit
  ------------------
  |  |  375|  1.02k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  2.04k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.02k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.02k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 602, False: 422]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1893:42): [True: 408, False: 194]
  ------------------
 1894|    408|                     && body->attributes == NULL )
  ------------------
  |  Branch (1894:25): [True: 214, False: 194]
  ------------------
 1895|    214|                {
 1896|    214|                    body->attributes = node->attributes;
 1897|    214|                    node->attributes = NULL;
 1898|    214|                }
 1899|       |
 1900|  1.02k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1901|  1.02k|                continue;
 1902|  1.02k|            }
 1903|       |
 1904|  2.83k|            if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  2.83k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1904:17): [True: 392, False: 2.44k]
  ------------------
 1905|    392|            {
 1906|    392|                MoveToHead(doc, body, node);
 1907|    392|                continue;
 1908|    392|            }
 1909|       |
 1910|  2.44k|            if (node->tag->model & CM_LIST)
  ------------------
  |  |  144|  2.44k|#define CM_LIST         (1 << 5)   /**< Elements that mark list item ("LI"). */
  ------------------
  |  Branch (1910:17): [True: 690, False: 1.75k]
  ------------------
 1911|    690|            {
 1912|    690|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    690|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    690|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1913|    690|                node = TY_(InferredTag)(doc, TidyTag_UL);
  ------------------
  |  |   23|    690|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    690|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1914|    690|                AddClassNoIndent(doc, node);
 1915|    690|                lexer->excludeBlocks = yes;
 1916|    690|            }
 1917|  1.75k|            else if (node->tag->model & CM_DEFLIST)
  ------------------
  |  |  145|  1.75k|#define CM_DEFLIST      (1 << 6)   /**< Elements that mark definition list item ("DL", "DT"). */
  ------------------
  |  Branch (1917:22): [True: 311, False: 1.44k]
  ------------------
 1918|    311|            {
 1919|    311|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    311|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    311|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1920|    311|                node = TY_(InferredTag)(doc, TidyTag_DL);
  ------------------
  |  |   23|    311|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    311|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1921|    311|                lexer->excludeBlocks = yes;
 1922|    311|            }
 1923|  1.44k|            else if (node->tag->model & (CM_TABLE | CM_ROWGRP | CM_ROW))
  ------------------
  |  |  146|  1.44k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                          else if (node->tag->model & (CM_TABLE | CM_ROWGRP | CM_ROW))
  ------------------
  |  |  147|  1.44k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
                          else if (node->tag->model & (CM_TABLE | CM_ROWGRP | CM_ROW))
  ------------------
  |  |  148|  1.44k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (1923:22): [True: 551, False: 893]
  ------------------
 1924|    551|            {
 1925|       |                /* http://tidy.sf.net/issue/2855621 */
 1926|    551|                if (node->type != EndTag) {
  ------------------
  |  Branch (1926:21): [True: 345, False: 206]
  ------------------
 1927|    345|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    345|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    345|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1928|    345|                    node = TY_(InferredTag)(doc, TidyTag_TABLE);
  ------------------
  |  |   23|    345|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    345|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1929|    345|                }
 1930|    551|                lexer->excludeBlocks = yes;
 1931|    551|            }
 1932|    893|            else if ( nodeIsINPUT(node) )
  ------------------
  |  |  431|    893|#define nodeIsINPUT( node )      TagIsId( node, TidyTag_INPUT )
  |  |  ------------------
  |  |  |  |  275|    893|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 893, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 893, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 205, False: 688]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1933|    205|            {
 1934|    205|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    205|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    205|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1935|    205|                node = TY_(InferredTag)(doc, TidyTag_FORM);
  ------------------
  |  |   23|    205|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    205|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1936|    205|                lexer->excludeBlocks = yes;
 1937|    205|            }
 1938|    688|            else
 1939|    688|            {
 1940|    688|                if ( !TY_(nodeHasCM)(node, CM_ROW | CM_FIELD) )
  ------------------
  |  |   23|    688|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    688|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( !TY_(nodeHasCM)(node, CM_ROW | CM_FIELD) )
  ------------------
  |  |  148|    688|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
                              if ( !TY_(nodeHasCM)(node, CM_ROW | CM_FIELD) )
  ------------------
  |  |  149|    688|#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: 487, False: 201]
  ------------------
 1941|    487|                {
 1942|    487|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    487|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    487|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1943|    487|                    DEBUG_LOG_EXIT;
 1944|    487|                    return NULL;
 1945|    487|                }
 1946|       |
 1947|       |                /* ignore </td> </th> <option> etc. */
 1948|    201|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    201|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    201|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1949|    201|                continue;
 1950|    688|            }
 1951|  2.44k|        }
 1952|       |
 1953|   184k|        if (node->type == EndTag)
  ------------------
  |  Branch (1953:13): [True: 7.97k, False: 176k]
  ------------------
 1954|  7.97k|        {
 1955|  7.97k|            if ( nodeIsBR(node) )
  ------------------
  |  |  400|  7.97k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  7.97k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.97k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 7.97k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 324, False: 7.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1956|    324|            {
 1957|    324|                node->type = StartTag;
 1958|    324|            }
 1959|  7.65k|            else if ( nodeIsP(node) )
  ------------------
  |  |  385|  7.65k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  7.65k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.65k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 7.65k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 794, False: 6.85k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1960|    794|            {
 1961|    794|                node->type = StartEndTag;
 1962|    794|                node->implicit = yes;
 1963|    794|            }
 1964|  6.85k|            else if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|  6.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|  6.85k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1964:23): [True: 2.59k, False: 4.26k]
  ------------------
 1965|  2.59k|                TY_(PopInline)( doc, node );
  ------------------
  |  |   23|  2.59k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.59k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1966|  7.97k|        }
 1967|       |
 1968|   184k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|   184k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   184k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1968:13): [True: 177k, False: 6.85k]
  ------------------
 1969|   177k|        {
 1970|   177k|            if (nodeIsMAIN(node))
  ------------------
  |  |  452|   177k|#define nodeIsMAIN( node )       TagIsId( node, TidyTag_MAIN )
  |  |  ------------------
  |  |  |  |  275|   177k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 177k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 177k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 785, False: 176k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1971|    785|            {
 1972|       |                /*\ Issue #166 - repeated <main> element
 1973|       |                 *  How to efficiently search for a previous main element?
 1974|       |                \*/
 1975|    785|                if ( findNodeById(doc, TidyTag_MAIN) )
  ------------------
  |  Branch (1975:22): [True: 547, False: 238]
  ------------------
 1976|    547|                {
 1977|    547|                    doc->badForm |= flg_BadMain; /* this is an ERROR in format */
  ------------------
  |  |   35|    547|#define flg_BadMain     0x00000002
  ------------------
 1978|    547|                    TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    547|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    547|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1979|    547|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    547|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    547|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1980|    547|                    continue;
 1981|    547|                }
 1982|    785|            }
 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|   177k|            if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|   177k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   177k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|   177k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1986:18): [True: 27.1k, False: 149k]
  ------------------
 1987|  27.1k|            {
 1988|       |                /* HTML4 strict doesn't allow inline content here */
 1989|       |                /* but HTML2 does allow img elements as children of body */
 1990|  27.1k|                if ( nodeIsIMG(node) )
  ------------------
  |  |  412|  27.1k|#define nodeIsIMG( node )        TagIsId( node, TidyTag_IMG )
  |  |  ------------------
  |  |  |  |  275|  27.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 27.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 27.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.03k, False: 25.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1991|  2.03k|                    TY_(ConstrainVersion)(doc, ~VERS_HTML40_STRICT);
  ------------------
  |  |   23|  2.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~VERS_HTML40_STRICT);
  ------------------
  |  |  207|  2.03k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  2.03k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  2.03k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  2.03k|#define X10S                 256u
  |  |  ------------------
  ------------------
 1992|  25.1k|                else
 1993|  25.1k|                    TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT|VERS_HTML20));
  ------------------
  |  |   23|  25.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  25.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT|VERS_HTML20));
  ------------------
  |  |  207|  25.1k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  25.1k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  25.1k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  25.1k|#define X10S                 256u
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT|VERS_HTML20));
  ------------------
  |  |  205|  25.1k|#define VERS_HTML20        (HT20)
  |  |  ------------------
  |  |  |  |  177|  25.1k|#define HT20                   1u
  |  |  ------------------
  ------------------
 1994|       |
 1995|  27.1k|                if (checkstack && !node->implicit)
  ------------------
  |  Branch (1995:21): [True: 7.97k, False: 19.2k]
  |  Branch (1995:35): [True: 7.45k, False: 516]
  ------------------
 1996|  7.45k|                {
 1997|  7.45k|                    checkstack = no;
 1998|       |
 1999|  7.45k|                    if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  7.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1999:26): [True: 870, False: 6.58k]
  ------------------
 2000|    870|                        continue;
 2001|  7.45k|                }
 2002|       |                
 2003|  26.3k|                DEBUG_LOG_GET_OLD_MODE;
 2004|  26.3k|                mode = MixedContent;
 2005|  26.3k|                DEBUG_LOG_CHANGE_MODE;
 2006|  26.3k|            }
 2007|   149k|            else
 2008|   149k|            {
 2009|   149k|                checkstack = yes;
 2010|   149k|                DEBUG_LOG_GET_OLD_MODE;
 2011|   149k|                mode = IgnoreWhitespace;
 2012|   149k|                DEBUG_LOG_CHANGE_MODE;
 2013|   149k|            }
 2014|       |
 2015|   176k|            if (node->implicit)
  ------------------
  |  Branch (2015:17): [True: 5.22k, False: 171k]
  ------------------
 2016|  5.22k|            {
 2017|  5.22k|                TY_(Report)(doc, body, node, INSERTING_TAG);
  ------------------
  |  |   23|  5.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2018|  5.22k|            }
 2019|       |
 2020|   176k|            TY_(InsertNodeAtEnd)(body, node);
  ------------------
  |  |   23|   176k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   176k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2021|       |            
 2022|   176k|            {
 2023|   176k|                TidyParserMemory memory = {0};
 2024|   176k|                memory.identity = TY_(ParseBody);
  ------------------
  |  |   23|   176k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   176k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2025|   176k|                memory.original_node = body;
 2026|   176k|                memory.reentry_node = node;
 2027|   176k|                memory.register_1 = checkstack;
 2028|   176k|                memory.register_2 = iswhitenode;
 2029|   176k|                memory.mode = mode;
 2030|   176k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|   176k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   176k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2031|   176k|            }
 2032|   176k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2033|   176k|            return node;
 2034|   177k|        }
 2035|       |
 2036|       |        /* discard unexpected tags */
 2037|  6.85k|        TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  6.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2038|  6.85k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  6.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2039|  6.85k|    }
 2040|  30.1k|    DEBUG_LOG_EXIT;
 2041|       |    return NULL;
 2042|   211k|}
prvTidyParseColGroup:
 2054|  4.64k|{
 2055|  4.64k|    Node *node, *parent;
 2056|  4.64k|    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|  4.64k|    if ( colgroup == NULL )
  ------------------
  |  Branch (2063:10): [True: 1.71k, False: 2.93k]
  ------------------
 2064|  1.71k|    {
 2065|  1.71k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  1.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2066|  1.71k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2067|  1.71k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2068|  1.71k|        colgroup = memory.original_node;
 2069|  1.71k|        DEBUG_LOG_GET_OLD_MODE;
 2070|  1.71k|        mode = memory.mode;
 2071|  1.71k|        DEBUG_LOG_CHANGE_MODE;
 2072|  1.71k|    }
 2073|  2.93k|    else
 2074|  2.93k|    {
 2075|  2.93k|        DEBUG_LOG_ENTER_WITH_NODE(colgroup);
 2076|  2.93k|        if (colgroup->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  2.93k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (2076:13): [True: 0, False: 2.93k]
  ------------------
 2077|      0|            return NULL;
 2078|  2.93k|    }
 2079|       |
 2080|  6.68k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  6.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2080:12): [True: 6.21k, False: 461]
  ------------------
 2081|  6.21k|    {
 2082|  6.21k|        DEBUG_LOG_GOT_TOKEN(node);
 2083|       |
 2084|  6.21k|        if (node->tag == colgroup->tag && node->type == EndTag)
  ------------------
  |  Branch (2084:13): [True: 1.58k, False: 4.63k]
  |  Branch (2084:43): [True: 196, False: 1.38k]
  ------------------
 2085|    196|        {
 2086|    196|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    196|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    196|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2087|    196|            colgroup->closed = yes;
 2088|    196|            return NULL;
 2089|    196|        }
 2090|       |
 2091|       |        /*
 2092|       |          if this is the end tag for an ancestor element
 2093|       |          then infer end tag for this element
 2094|       |        */
 2095|  6.02k|        if (node->type == EndTag)
  ------------------
  |  Branch (2095:13): [True: 701, False: 5.32k]
  ------------------
 2096|    701|        {
 2097|    701|            if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    701|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    701|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 701, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 427, False: 274]
  |  |  |  |  |  Branch (275:54): [True: 205, False: 222]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2098|    205|            {
 2099|    205|                BadForm( doc );
 2100|    205|                TY_(Report)(doc, colgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    205|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    205|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2101|    205|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    205|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    205|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2102|    205|                continue;
 2103|    205|            }
 2104|       |
 2105|    496|            for ( parent = colgroup->parent;
 2106|  2.12k|                  parent != NULL;
  ------------------
  |  Branch (2106:19): [True: 1.90k, False: 223]
  ------------------
 2107|  1.62k|                  parent = parent->parent )
 2108|  1.90k|            {
 2109|  1.90k|                if (node->tag == parent->tag)
  ------------------
  |  Branch (2109:21): [True: 273, False: 1.62k]
  ------------------
 2110|    273|                {
 2111|    273|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    273|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    273|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2112|    273|                    DEBUG_LOG_EXIT;
 2113|    273|                    return NULL;
 2114|    273|                }
 2115|  1.90k|            }
 2116|    496|        }
 2117|       |
 2118|  5.54k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  5.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2118:13): [True: 426, False: 5.11k]
  ------------------
 2119|    426|        {
 2120|    426|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    426|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    426|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2121|    426|            DEBUG_LOG_EXIT;
 2122|    426|            return NULL;
 2123|    426|        }
 2124|       |
 2125|       |        /* deal with comments etc. */
 2126|  5.11k|        if (InsertMisc(colgroup, node))
  ------------------
  |  Branch (2126:13): [True: 238, False: 4.88k]
  ------------------
 2127|    238|            continue;
 2128|       |
 2129|       |        /* discard unknown tags */
 2130|  4.88k|        if (node->tag == NULL)
  ------------------
  |  Branch (2130:13): [True: 1.36k, False: 3.51k]
  ------------------
 2131|  1.36k|        {
 2132|  1.36k|            TY_(Report)(doc, colgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2133|  1.36k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2134|  1.36k|            continue;
 2135|  1.36k|        }
 2136|       |
 2137|  3.51k|        if ( !nodeIsCOL(node) )
  ------------------
  |  |  398|  3.51k|#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: 3.51k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.51k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.93k, False: 1.57k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2138|  1.57k|        {
 2139|  1.57k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2140|  1.57k|            DEBUG_LOG_EXIT;
 2141|  1.57k|            return NULL;
 2142|  1.57k|        }
 2143|       |
 2144|  1.93k|        if (node->type == EndTag)
  ------------------
  |  Branch (2144:13): [True: 221, False: 1.71k]
  ------------------
 2145|    221|        {
 2146|    221|            TY_(Report)(doc, colgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    221|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    221|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2147|    221|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    221|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    221|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2148|    221|            continue;
 2149|    221|        }
 2150|       |
 2151|       |        /* node should be <COL> */
 2152|  1.71k|        TY_(InsertNodeAtEnd)(colgroup, node);
  ------------------
  |  |   23|  1.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2153|       |        
 2154|  1.71k|        {
 2155|  1.71k|            TidyParserMemory memory = {0};
 2156|  1.71k|            memory.identity = TY_(ParseColGroup);
  ------------------
  |  |   23|  1.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2157|  1.71k|            memory.original_node = colgroup;
 2158|  1.71k|            memory.reentry_node = node;
 2159|  1.71k|            memory.mode = mode;
 2160|  1.71k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2161|  1.71k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2162|  1.71k|        }
 2163|  1.71k|        DEBUG_LOG_EXIT;
 2164|  1.71k|        return node;
 2165|  1.93k|    }
 2166|    461|    DEBUG_LOG_EXIT;
 2167|       |    return NULL;
 2168|  4.64k|}
prvTidyParseDatalist:
 2180|  33.5k|{
 2181|  33.5k|    Lexer* lexer = doc->lexer;
 2182|  33.5k|    Node *node;
 2183|  33.5k|    DEBUG_LOG_COUNTERS;
 2184|       |
 2185|  33.5k|    if ( field == NULL )
  ------------------
  |  Branch (2185:10): [True: 16.8k, False: 16.6k]
  ------------------
 2186|  16.8k|    {
 2187|  16.8k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2188|  16.8k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2189|  16.8k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2190|  16.8k|        field = memory.original_node;
 2191|  16.8k|        DEBUG_LOG_GET_OLD_MODE;
 2192|  16.8k|        mode = memory.mode;
 2193|  16.8k|        DEBUG_LOG_CHANGE_MODE;
 2194|  16.8k|    }
 2195|  16.6k|    else
 2196|  16.6k|    {
 2197|  16.6k|        DEBUG_LOG_ENTER_WITH_NODE(field);
 2198|  16.6k|    }
 2199|       |    
 2200|  33.5k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 2201|       |
 2202|  35.8k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  35.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2202:12): [True: 19.4k, False: 16.4k]
  ------------------
 2203|  19.4k|    {
 2204|  19.4k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (2204:13): [True: 16.2k, False: 3.16k]
  |  Branch (2204:40): [True: 195, False: 16.1k]
  ------------------
 2205|    195|        {
 2206|    195|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    195|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    195|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2207|    195|            field->closed = yes;
 2208|    195|            TrimSpaces(doc, field);
 2209|       |
 2210|    195|            DEBUG_LOG_EXIT;
 2211|    195|            return NULL;
 2212|    195|        }
 2213|       |
 2214|       |        /* deal with comments etc. */
 2215|  19.2k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (2215:13): [True: 363, False: 18.9k]
  ------------------
 2216|    363|            continue;
 2217|       |
 2218|  18.9k|        if ( node->type == StartTag &&
  ------------------
  |  Branch (2218:14): [True: 18.2k, False: 652]
  ------------------
 2219|  18.2k|             ( nodeIsOPTION(node)   ||
  ------------------
  |  |  410|  18.2k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  36.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 18.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.1k, False: 1.08k]
  |  |  |  |  |  Branch (275:54): [True: 391, False: 16.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2220|  18.2k|               nodeIsOPTGROUP(node) ||
  ------------------
  |  |  411|  17.8k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  36.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 17.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 16.7k, False: 1.08k]
  |  |  |  |  |  Branch (275:54): [True: 194, False: 16.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2221|  18.2k|               nodeIsDATALIST(node) ||
  ------------------
  |  |  463|  17.6k|#define nodeIsDATALIST( node )   TagIsId( node, TidyTag_DATALIST )
  |  |  ------------------
  |  |  |  |  275|  35.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 17.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 16.5k, False: 1.08k]
  |  |  |  |  |  Branch (275:54): [True: 16.1k, False: 474]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2222|  18.2k|               nodeIsSCRIPT(node))
  ------------------
  |  |  422|  1.56k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  1.56k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.56k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 474, False: 1.08k]
  |  |  |  |  |  Branch (275:54): [True: 208, False: 266]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2223|  18.9k|           )
 2224|  16.8k|        {
 2225|  16.8k|            TidyParserMemory memory = {0};
 2226|  16.8k|            memory.identity = TY_(ParseDatalist);
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2227|  16.8k|            memory.original_node = field;
 2228|  16.8k|            memory.reentry_node = node;
 2229|  16.8k|            memory.reentry_mode = IgnoreWhitespace;
 2230|       |
 2231|  16.8k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2232|  16.8k|            TY_(pushMemory)(doc, memory);
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2233|  16.8k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2234|  16.8k|            return node;
 2235|  16.8k|        }
 2236|       |
 2237|       |        /* discard unexpected tags */
 2238|  2.00k|        TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2239|  2.00k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2240|  2.00k|    }
 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.5k|}
prvTidyParseDefList:
 2258|  20.9k|{
 2259|  20.9k|    Lexer* lexer = doc->lexer;
 2260|  20.9k|    Node *node = NULL;
 2261|  20.9k|    Node *parent = NULL;
 2262|  20.9k|    DEBUG_LOG_COUNTERS;
 2263|       |
 2264|  20.9k|    enum parserState {
 2265|  20.9k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 2266|  20.9k|        STATE_POST_NODEISCENTER,      /* To-do after re-entering after checks. */
 2267|  20.9k|        STATE_COMPLETE,               /* Done with the switch. */
 2268|  20.9k|    } state = STATE_INITIAL;
 2269|       |
 2270|  20.9k|    if ( list == NULL )
  ------------------
  |  Branch (2270:10): [True: 11.8k, False: 9.08k]
  ------------------
 2271|  11.8k|    {
 2272|  11.8k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  11.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2273|  11.8k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2274|  11.8k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2275|  11.8k|        list = memory.original_node;
 2276|  11.8k|        state = memory.reentry_state;
 2277|  11.8k|        DEBUG_LOG_GET_OLD_MODE;
 2278|  11.8k|        mode = memory.mode;
 2279|  11.8k|        DEBUG_LOG_CHANGE_MODE;
 2280|  11.8k|    }
 2281|  9.08k|    else
 2282|  9.08k|    {
 2283|  9.08k|        DEBUG_LOG_ENTER_WITH_NODE(list);
 2284|  9.08k|    }
 2285|       |
 2286|  20.9k|    if (list->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  20.9k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (2286:9): [True: 0, False: 20.9k]
  ------------------
 2287|      0|        return NULL;
 2288|       |
 2289|  20.9k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 2290|       |
 2291|  29.1k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (2291:13): [True: 24.2k, False: 4.89k]
  ------------------
 2292|  24.2k|    {
 2293|  24.2k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (2293:14): [True: 22.9k, False: 1.22k]
  ------------------
 2294|  22.9k|            node = TY_(GetToken)( doc, IgnoreWhitespace);
  ------------------
  |  |   23|  22.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2295|       |        
 2296|  24.2k|        switch ( state)
 2297|  24.2k|        {
 2298|  22.9k|            case STATE_INITIAL:
  ------------------
  |  Branch (2298:13): [True: 22.9k, False: 1.22k]
  ------------------
 2299|  22.9k|            {
 2300|  22.9k|                if ( node == NULL)
  ------------------
  |  Branch (2300:22): [True: 4.89k, False: 18.0k]
  ------------------
 2301|  4.89k|                {
 2302|  4.89k|                    state = STATE_COMPLETE;
 2303|  4.89k|                    continue;
 2304|  4.89k|                }
 2305|       |
 2306|  18.0k|                if (node->tag == list->tag && node->type == EndTag)
  ------------------
  |  Branch (2306:21): [True: 4.51k, False: 13.5k]
  |  Branch (2306:47): [True: 603, False: 3.91k]
  ------------------
 2307|    603|                {
 2308|    603|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    603|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    603|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2309|    603|                    list->closed = yes;
 2310|    603|                    DEBUG_LOG_EXIT;
 2311|    603|                    return NULL;
 2312|    603|                }
 2313|       |
 2314|       |                /* deal with comments etc. */
 2315|  17.4k|                if (InsertMisc(list, node))
  ------------------
  |  Branch (2315:21): [True: 218, False: 17.2k]
  ------------------
 2316|    218|                    continue;
 2317|       |
 2318|  17.2k|                if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  17.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2318:21): [True: 2.15k, False: 15.1k]
  ------------------
 2319|  2.15k|                {
 2320|  2.15k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2321|  2.15k|                    node = TY_(InferredTag)(doc, TidyTag_DT);
  ------------------
  |  |   23|  2.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2322|  2.15k|                    TY_(Report)(doc, list, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  2.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2323|  2.15k|                }
 2324|       |
 2325|  17.2k|                if (node->tag == NULL)
  ------------------
  |  Branch (2325:21): [True: 521, False: 16.7k]
  ------------------
 2326|    521|                {
 2327|    521|                    TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    521|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    521|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2328|    521|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    521|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    521|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2329|    521|                    continue;
 2330|    521|                }
 2331|       |
 2332|       |                /*
 2333|       |                  if this is the end tag for an ancestor element
 2334|       |                  then infer end tag for this element
 2335|       |                */
 2336|  16.7k|                if (node->type == EndTag)
  ------------------
  |  Branch (2336:21): [True: 2.49k, False: 14.2k]
  ------------------
 2337|  2.49k|                {
 2338|  2.49k|                    Bool discardIt = no;
 2339|  2.49k|                    if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  2.49k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  2.49k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.49k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.49k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 229, False: 2.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2340|    229|                    {
 2341|    229|                        BadForm( doc );
 2342|    229|                        TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    229|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    229|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2343|    229|                        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    229|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    229|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2344|    229|                        continue;
 2345|    229|                    }
 2346|       |
 2347|  2.26k|                    for (parent = list->parent;
 2348|   125k|                            parent != NULL; parent = parent->parent)
  ------------------
  |  Branch (2348:29): [True: 124k, False: 985]
  ------------------
 2349|   124k|                    {
 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|   124k|                        if (nodeIsBODY(parent))
  ------------------
  |  |  375|   124k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   124k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 124k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 124k, False: 983]
  |  |  |  |  |  Branch (275:54): [True: 878, False: 123k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2354|    878|                        {
 2355|    878|                            discardIt = yes;
 2356|    878|                            break;
 2357|    878|                        }
 2358|   124k|                        if (node->tag == parent->tag)
  ------------------
  |  Branch (2358:29): [True: 398, False: 123k]
  ------------------
 2359|    398|                        {
 2360|    398|                            TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|    398|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    398|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2361|    398|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    398|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    398|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2362|       |
 2363|    398|                            DEBUG_LOG_EXIT;
 2364|    398|                            return NULL;
 2365|    398|                        }
 2366|   124k|                    }
 2367|  1.86k|                    if (discardIt)
  ------------------
  |  Branch (2367:25): [True: 878, False: 985]
  ------------------
 2368|    878|                    {
 2369|    878|                        TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    878|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    878|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2370|    878|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    878|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    878|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2371|    878|                        continue;
 2372|    878|                    }
 2373|  1.86k|                }
 2374|       |
 2375|       |                /* center in a dt or a dl breaks the dl list in two */
 2376|  15.2k|                if ( nodeIsCENTER(node) )
  ------------------
  |  |  420|  15.2k|#define nodeIsCENTER( node )     TagIsId( node, TidyTag_CENTER )
  |  |  ------------------
  |  |  |  |  275|  15.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 15.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 15.2k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.22k, False: 14.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2377|  1.22k|                {
 2378|  1.22k|                    if (list->content)
  ------------------
  |  Branch (2378:25): [True: 984, False: 244]
  ------------------
 2379|    984|                        TY_(InsertNodeAfterElement)(list, node);
  ------------------
  |  |   23|    984|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    984|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2380|    244|                    else /* trim empty dl list */
 2381|    244|                    {
 2382|    244|                        TY_(InsertNodeBeforeElement)(list, node);
  ------------------
  |  |   23|    244|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    244|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2383|    244|                    }
 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.22k|                    parent = node->parent;
 2393|       |
 2394|       |                    /* and parse contents of center */
 2395|  1.22k|                    lexer->excludeBlocks = no;
 2396|       |
 2397|  1.22k|                    {
 2398|  1.22k|                        TidyParserMemory memory = {0};
 2399|  1.22k|                        memory.identity = TY_(ParseDefList);
  ------------------
  |  |   23|  1.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2400|  1.22k|                        memory.original_node = list;
 2401|  1.22k|                        memory.reentry_node = node;
 2402|  1.22k|                        memory.reentry_state = STATE_POST_NODEISCENTER;
 2403|  1.22k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2404|  1.22k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 2405|  1.22k|                        return node;
 2406|  1.22k|                    }
 2407|  1.22k|                }
 2408|       |
 2409|  14.0k|                if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |  391|  14.0k|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  275|  28.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 14.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 14.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.35k, False: 10.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |  392|  10.6k|#define nodeIsDD( node )         TagIsId( node, TidyTag_DD )
  |  |  ------------------
  |  |  |  |  275|  24.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 10.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.6k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.87k, False: 7.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |  429|  7.79k|#define nodeIsDIV( node )        TagIsId( node, TidyTag_DIV )
  |  |  ------------------
  |  |  |  |  275|  15.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.79k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 7.79k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 531, False: 7.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |   23|    531|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    531|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2409:82): [True: 270, False: 261]
  ------------------
 2410|  7.52k|                {
 2411|  7.52k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  7.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2412|       |
 2413|  7.52k|                    if (!(node->tag->model & (CM_BLOCK | CM_INLINE)))
  ------------------
  |  |  142|  7.52k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                  if (!(node->tag->model & (CM_BLOCK | CM_INLINE)))
  ------------------
  |  |  143|  7.52k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2413:25): [True: 1.62k, False: 5.90k]
  ------------------
 2414|  1.62k|                    {
 2415|  1.62k|                        TY_(Report)(doc, list, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.62k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.62k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2416|  1.62k|                        DEBUG_LOG_EXIT;
 2417|  1.62k|                        return NULL;
 2418|  1.62k|                    }
 2419|       |
 2420|       |                    /* if DD appeared directly in BODY then exclude blocks */
 2421|  5.90k|                    if (!(node->tag->model & CM_INLINE) && lexer->excludeBlocks)
  ------------------
  |  |  143|  5.90k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2421:25): [True: 4.37k, False: 1.52k]
  |  Branch (2421:60): [True: 1.25k, False: 3.12k]
  ------------------
 2422|  1.25k|                    {
 2423|  1.25k|                        DEBUG_LOG_EXIT;
 2424|  1.25k|                        return NULL;
 2425|  1.25k|                    }
 2426|       |
 2427|  4.64k|                    node = TY_(InferredTag)(doc, TidyTag_DD);
  ------------------
  |  |   23|  4.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2428|  4.64k|                    TY_(Report)(doc, list, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  4.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2429|  4.64k|                }
 2430|       |
 2431|  11.1k|                if (node->type == EndTag)
  ------------------
  |  Branch (2431:21): [True: 226, False: 10.9k]
  ------------------
 2432|    226|                {
 2433|    226|                    TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    226|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    226|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2434|    226|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    226|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    226|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2435|    226|                    continue;
 2436|    226|                }
 2437|       |
 2438|       |                /* node should be <DT> or <DD> or <DIV>*/
 2439|  10.9k|                TY_(InsertNodeAtEnd)(list, node);
  ------------------
  |  |   23|  10.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2440|  10.9k|                {
 2441|  10.9k|                    TidyParserMemory memory = {0};
 2442|  10.9k|                    memory.identity = TY_(ParseDefList);
  ------------------
  |  |   23|  10.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2443|  10.9k|                    memory.original_node = list;
 2444|  10.9k|                    memory.reentry_node = node;
 2445|  10.9k|                    memory.reentry_state = STATE_INITIAL;
 2446|  10.9k|                    TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  10.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2447|  10.9k|                    DEBUG_LOG_EXIT;
 2448|  10.9k|                    return node;
 2449|  11.1k|                }
 2450|  11.1k|            } break;
 2451|       |
 2452|       |
 2453|  1.22k|            case STATE_POST_NODEISCENTER:
  ------------------
  |  Branch (2453:13): [True: 1.22k, False: 22.9k]
  ------------------
 2454|  1.22k|            {
 2455|  1.22k|                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.22k|                if (parent && parent->last == node)
  ------------------
  |  Branch (2461:21): [True: 0, False: 1.22k]
  |  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.22k|                state = STATE_INITIAL;
 2467|  1.22k|                continue;
 2468|  11.1k|            } break;
 2469|       |
 2470|       |
 2471|      0|            default:
  ------------------
  |  Branch (2471:13): [True: 0, False: 24.2k]
  ------------------
 2472|      0|                break;
 2473|  24.2k|        } /* switch */
 2474|  24.2k|    } /* while */
 2475|       |
 2476|  4.89k|    TY_(Report)(doc, list, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  4.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2477|  4.89k|    DEBUG_LOG_EXIT;
 2478|       |    return NULL;
 2479|  20.9k|}
prvTidyParseEmpty:
 2491|  24.4k|{
 2492|  24.4k|    Lexer* lexer = doc->lexer;
 2493|  24.4k|    if ( lexer->isvoyager )
  ------------------
  |  Branch (2493:10): [True: 1.26k, False: 23.2k]
  ------------------
 2494|  1.26k|    {
 2495|  1.26k|        Node *node = TY_(GetToken)( doc, mode);
  ------------------
  |  |   23|  1.26k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.26k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2496|  1.26k|        if ( node )
  ------------------
  |  Branch (2496:14): [True: 1.04k, False: 223]
  ------------------
 2497|  1.04k|        {
 2498|  1.04k|            if ( !(node->type == EndTag && node->tag == element->tag) )
  ------------------
  |  Branch (2498:20): [True: 460, False: 581]
  |  Branch (2498:44): [True: 203, False: 257]
  ------------------
 2499|    838|            {
 2500|       |                /* TY_(Report)(doc, element, node, ELEMENT_NOT_EMPTY); */
 2501|    838|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    838|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    838|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2502|    838|            }
 2503|    203|            else
 2504|    203|            {
 2505|    203|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    203|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    203|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2506|    203|            }
 2507|  1.04k|        }
 2508|  1.26k|    }
 2509|       |    return NULL;
 2510|  24.4k|}
prvTidyParseFrameSet:
 2522|  23.0k|{
 2523|  23.0k|    Lexer* lexer = doc->lexer;
 2524|  23.0k|    Node *node;
 2525|  23.0k|    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|  23.0k|    if ( frameset == NULL )
  ------------------
  |  Branch (2532:10): [True: 9.80k, False: 13.2k]
  ------------------
 2533|  9.80k|    {
 2534|  9.80k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  9.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2535|  9.80k|        node = memory.reentry_node; /* Throwaway, because we replace it entering the loop. */
 2536|  9.80k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2537|  9.80k|        frameset = memory.original_node;
 2538|  9.80k|        DEBUG_LOG_GET_OLD_MODE;
 2539|  9.80k|        mode = memory.mode;
 2540|  9.80k|        DEBUG_LOG_CHANGE_MODE;
 2541|  9.80k|    }
 2542|  13.2k|    else
 2543|  13.2k|    {
 2544|  13.2k|        DEBUG_LOG_ENTER_WITH_NODE(frameset);
 2545|  13.2k|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  13.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (2545:14): [True: 13.2k, False: 0]
  ------------------
 2546|  13.2k|        {
 2547|  13.2k|            doc->badAccess |= BA_USING_FRAMES;
  ------------------
  |  |  284|  13.2k|#define BA_USING_FRAMES            16
  ------------------
 2548|  13.2k|        }
 2549|  13.2k|    }
 2550|       |
 2551|  29.7k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  29.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2551:12): [True: 16.6k, False: 13.0k]
  ------------------
 2552|  16.6k|    {
 2553|  16.6k|        if (node->tag == frameset->tag && node->type == EndTag)
  ------------------
  |  Branch (2553:13): [True: 8.54k, False: 8.11k]
  |  Branch (2553:43): [True: 197, False: 8.34k]
  ------------------
 2554|    197|        {
 2555|    197|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    197|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    197|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2556|    197|            frameset->closed = yes;
 2557|    197|            TrimSpaces(doc, frameset);
 2558|    197|            DEBUG_LOG_EXIT;
 2559|    197|            return NULL;
 2560|    197|        }
 2561|       |
 2562|       |        /* deal with comments etc. */
 2563|  16.4k|        if (InsertMisc(frameset, node))
  ------------------
  |  Branch (2563:13): [True: 496, False: 15.9k]
  ------------------
 2564|    496|            continue;
 2565|       |
 2566|  15.9k|        if (node->tag == NULL)
  ------------------
  |  Branch (2566:13): [True: 2.87k, False: 13.0k]
  ------------------
 2567|  2.87k|        {
 2568|  2.87k|            TY_(Report)(doc, frameset, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2569|  2.87k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2570|  2.87k|            continue;
 2571|  2.87k|        }
 2572|       |
 2573|  13.0k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  13.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2573:13): [True: 12.8k, False: 222]
  ------------------
 2574|  12.8k|        {
 2575|  12.8k|            if (node->tag && node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  12.8k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (2575:17): [True: 12.8k, False: 0]
  |  Branch (2575:30): [True: 334, False: 12.5k]
  ------------------
 2576|    334|            {
 2577|    334|                MoveToHead(doc, frameset, node);
 2578|    334|                continue;
 2579|    334|            }
 2580|  12.8k|        }
 2581|       |
 2582|  12.7k|        if ( nodeIsBODY(node) )
  ------------------
  |  |  375|  12.7k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  12.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 12.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 12.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 887, False: 11.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2583|    887|        {
 2584|    887|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    887|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    887|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2585|    887|            node = TY_(InferredTag)(doc, TidyTag_NOFRAMES);
  ------------------
  |  |   23|    887|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    887|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2586|    887|            TY_(Report)(doc, frameset, node, INSERTING_TAG);
  ------------------
  |  |   23|    887|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    887|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2587|    887|        }
 2588|       |
 2589|  12.7k|        if (node->type == StartTag && (node->tag && node->tag->model & CM_FRAMES))
  ------------------
  |  |  152|  11.0k|#define CM_FRAMES       (1 << 13)  /**< "FRAME", "FRAMESET", "NOFRAMES". Used in ParseFrameSet. */
  ------------------
  |  Branch (2589:13): [True: 11.0k, False: 1.68k]
  |  Branch (2589:40): [True: 11.0k, False: 0]
  |  Branch (2589:53): [True: 9.82k, False: 1.25k]
  ------------------
 2590|  9.82k|        {
 2591|  9.82k|            TY_(InsertNodeAtEnd)(frameset, node);
  ------------------
  |  |   23|  9.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2592|  9.82k|            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|  9.82k|            TidyParserMemory memory = {0};
 2600|  9.82k|            memory.identity = TY_(ParseFrameSet);
  ------------------
  |  |   23|  9.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2601|  9.82k|            memory.original_node = frameset;
 2602|  9.82k|            memory.reentry_node = node;
 2603|  9.82k|            memory.mode = MixedContent;
 2604|  9.82k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  9.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2605|  9.82k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2606|  9.82k|            return node;
 2607|  9.82k|        }
 2608|  2.93k|        else if (node->type == StartEndTag && (node->tag && node->tag->model & CM_FRAMES))
  ------------------
  |  |  152|  1.47k|#define CM_FRAMES       (1 << 13)  /**< "FRAME", "FRAMESET", "NOFRAMES". Used in ParseFrameSet. */
  ------------------
  |  Branch (2608:18): [True: 1.47k, False: 1.46k]
  |  Branch (2608:48): [True: 1.47k, False: 0]
  |  Branch (2608:61): [True: 1.25k, False: 218]
  ------------------
 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.67k|        if ( nodeIsA(node) )
  ------------------
  |  |  401|  1.67k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  1.67k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.67k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.67k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 214, False: 1.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2617|    214|           doc->badAccess |= BA_INVALID_LINK_NOFRAMES;
  ------------------
  |  |  286|    214|#define BA_INVALID_LINK_NOFRAMES   64  /* WAI [6.5.1.4] */  
  ------------------
 2618|       |
 2619|  1.67k|        TY_(Report)(doc, frameset, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.67k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.67k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2620|  1.67k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.67k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.67k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2621|  1.67k|    }
 2622|       |
 2623|  13.0k|    TY_(Report)(doc, frameset, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  13.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2624|  13.0k|    DEBUG_LOG_EXIT;
 2625|       |    return NULL;
 2626|  23.0k|}
prvTidyParseHead:
 2638|  70.1k|{
 2639|  70.1k|    Lexer* lexer = doc->lexer;
 2640|  70.1k|    Node *node;
 2641|  70.1k|    int HasTitle = 0;
 2642|  70.1k|    int HasBase = 0;
 2643|  70.1k|    DEBUG_LOG_COUNTERS;
 2644|       |
 2645|  70.1k|    if ( head == NULL )
  ------------------
  |  Branch (2645:10): [True: 6.98k, False: 63.2k]
  ------------------
 2646|  6.98k|    {
 2647|  6.98k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  6.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2648|  6.98k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2649|  6.98k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2650|  6.98k|        head = memory.original_node;
 2651|  6.98k|        HasTitle = memory.register_1;
 2652|  6.98k|        HasBase = memory.register_2;
 2653|  6.98k|        DEBUG_LOG_GET_OLD_MODE;
 2654|  6.98k|        mode = memory.mode;
 2655|  6.98k|        DEBUG_LOG_CHANGE_MODE;
 2656|  6.98k|    }
 2657|  63.2k|    else
 2658|  63.2k|    {
 2659|  63.2k|        DEBUG_LOG_ENTER_WITH_NODE(head);
 2660|  63.2k|    }
 2661|       |    
 2662|  86.3k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  86.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  86.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2662:12): [True: 80.6k, False: 5.70k]
  ------------------
 2663|  80.6k|    {
 2664|  80.6k|        if (node->tag == head->tag && node->type == EndTag)
  ------------------
  |  Branch (2664:13): [True: 942, False: 79.6k]
  |  Branch (2664:39): [True: 217, False: 725]
  ------------------
 2665|    217|        {
 2666|    217|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    217|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    217|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2667|    217|            head->closed = yes;
 2668|    217|            break;
 2669|    217|        }
 2670|       |
 2671|       |        /* find and discard multiple <head> elements */
 2672|       |        /* find and discard <html> in <head> elements */
 2673|  80.4k|        if ((node->tag == head->tag || nodeIsHTML(node)) && node->type == StartTag)
  ------------------
  |  |  370|  79.6k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  79.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 79.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 58.3k, False: 21.3k]
  |  |  |  |  |  Branch (275:54): [True: 766, False: 57.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2673:14): [True: 725, False: 79.6k]
  |  Branch (2673:61): [True: 1.23k, False: 255]
  ------------------
 2674|  1.23k|        {
 2675|  1.23k|            TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2676|  1.23k|            TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  1.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2677|  1.23k|            continue;
 2678|  1.23k|        }
 2679|       |
 2680|  79.1k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  79.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  79.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2680:13): [True: 6.96k, False: 72.2k]
  ------------------
 2681|  6.96k|        {
 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|  6.96k|            if (!cfgBool( doc, TidyOmitOptionalTags ) &&
  ------------------
  |  |  418|  13.9k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  6.96k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2686:17): [True: 6.96k, False: 0]
  |  Branch (2686:17): [True: 6.96k, False: 0]
  ------------------
 2687|  6.96k|                !showingBodyOnly(doc) )
  ------------------
  |  |   28|  6.96k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  6.96k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  6.96k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2687:17): [True: 6.96k, False: 0]
  ------------------
 2688|  6.96k|            {
 2689|  6.96k|                TY_(Report)(doc, head, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  6.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2690|  6.96k|            }
 2691|  6.96k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  6.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2692|  6.96k|            break;
 2693|  6.96k|        }
 2694|       |
 2695|  72.2k|        if (node->type == ProcInsTag && node->element &&
  ------------------
  |  Branch (2695:13): [True: 2.28k, False: 69.9k]
  |  Branch (2695:41): [True: 1.52k, False: 758]
  ------------------
 2696|  1.52k|            TY_(tmbstrcmp)(node->element, "xml-stylesheet") == 0)
  ------------------
  |  |   23|  1.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2696:13): [True: 855, False: 671]
  ------------------
 2697|    855|        {
 2698|    855|            TY_(Report)(doc, head, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|    855|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    855|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2699|    855|            TY_(InsertNodeBeforeElement)(TY_(FindHTML)(doc), node);
  ------------------
  |  |   23|    855|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    855|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(InsertNodeBeforeElement)(TY_(FindHTML)(doc), node);
  ------------------
  |  |   23|    855|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    855|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2700|    855|            continue;
 2701|    855|        }
 2702|       |
 2703|       |        /* deal with comments etc. */
 2704|  71.3k|        if (InsertMisc(head, node))
  ------------------
  |  Branch (2704:13): [True: 1.57k, False: 69.7k]
  ------------------
 2705|  1.57k|            continue;
 2706|       |
 2707|  69.7k|        if (node->type == DocTypeTag)
  ------------------
  |  Branch (2707:13): [True: 1.06k, False: 68.7k]
  ------------------
 2708|  1.06k|        {
 2709|  1.06k|            InsertDocType(doc, head, node);
 2710|  1.06k|            continue;
 2711|  1.06k|        }
 2712|       |
 2713|       |        /* discard unknown tags */
 2714|  68.7k|        if (node->tag == NULL)
  ------------------
  |  Branch (2714:13): [True: 10.8k, False: 57.8k]
  ------------------
 2715|  10.8k|        {
 2716|  10.8k|            TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  10.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2717|  10.8k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  10.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2718|  10.8k|            continue;
 2719|  10.8k|        }
 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|  57.8k|        if (!(node->tag->model & CM_HEAD))
  ------------------
  |  |  141|  57.8k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (2726:13): [True: 50.3k, False: 7.53k]
  ------------------
 2727|  50.3k|        {
 2728|       |            /* #545067 Implicit closing of head broken - warn only for XHTML input */
 2729|  50.3k|            if ( lexer->isvoyager )
  ------------------
  |  Branch (2729:18): [True: 380, False: 49.9k]
  ------------------
 2730|    380|                TY_(Report)(doc, head, node, TAG_NOT_ALLOWED_IN );
  ------------------
  |  |   23|    380|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    380|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2731|  50.3k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  50.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  50.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2732|  50.3k|            break;
 2733|  50.3k|        }
 2734|       |
 2735|  7.53k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  7.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2735:13): [True: 6.98k, False: 545]
  ------------------
 2736|  6.98k|        {
 2737|  6.98k|            if ( nodeIsTITLE(node) )
  ------------------
  |  |  372|  6.98k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  6.98k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.98k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.98k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.43k, False: 4.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2738|  2.43k|            {
 2739|  2.43k|                ++HasTitle;
 2740|       |
 2741|  2.43k|                if (HasTitle > 1)
  ------------------
  |  Branch (2741:21): [True: 2.14k, False: 297]
  ------------------
 2742|  2.14k|                    TY_(Report)(doc, head, node,
  ------------------
  |  |   23|  2.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2743|  2.14k|                                     head ?
  ------------------
  |  Branch (2743:38): [True: 2.14k, False: 0]
  ------------------
 2744|  2.14k|                                     TOO_MANY_ELEMENTS_IN : TOO_MANY_ELEMENTS);
 2745|  2.43k|            }
 2746|  4.54k|            else if ( nodeIsBASE(node) )
  ------------------
  |  |  373|  4.54k|#define nodeIsBASE( node )       TagIsId( node, TidyTag_BASE )
  |  |  ------------------
  |  |  |  |  275|  4.54k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.54k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.54k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 795, False: 3.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2747|    795|            {
 2748|    795|                ++HasBase;
 2749|       |
 2750|    795|                if (HasBase > 1)
  ------------------
  |  Branch (2750:21): [True: 411, False: 384]
  ------------------
 2751|    411|                    TY_(Report)(doc, head, node,
  ------------------
  |  |   23|    411|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    411|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2752|    411|                                     head ?
  ------------------
  |  Branch (2752:38): [True: 411, False: 0]
  ------------------
 2753|    411|                                     TOO_MANY_ELEMENTS_IN : TOO_MANY_ELEMENTS);
 2754|    795|            }
 2755|       |
 2756|  6.98k|            TY_(InsertNodeAtEnd)(head, node);
  ------------------
  |  |   23|  6.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2757|       |
 2758|  6.98k|            {
 2759|  6.98k|                TidyParserMemory memory = {0};
 2760|  6.98k|                memory.identity = TY_(ParseHead);
  ------------------
  |  |   23|  6.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2761|  6.98k|                memory.original_node = head;
 2762|  6.98k|                memory.reentry_node = node;
 2763|  6.98k|                memory.register_1 = HasTitle;
 2764|  6.98k|                memory.register_2 = HasBase;
 2765|  6.98k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  6.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2766|  6.98k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 2767|  6.98k|                return node;
 2768|  6.98k|            }
 2769|  6.98k|        }
 2770|       |
 2771|       |        /* discard unexpected text nodes and end tags */
 2772|    545|        TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    545|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    545|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2773|    545|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    545|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    545|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2774|    545|    }
 2775|  63.2k|    DEBUG_LOG_EXIT;
 2776|       |    return NULL;
 2777|  70.1k|}
prvTidyParseHTML:
 2791|   132k|{
 2792|   132k|    Node *node = NULL;
 2793|   132k|    Node *head = NULL;
 2794|   132k|    Node *frameset = NULL;
 2795|   132k|    Node *noframes = NULL;
 2796|   132k|    DEBUG_LOG_COUNTERS;
 2797|       |
 2798|   132k|    enum parserState {
 2799|   132k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 2800|   132k|        STATE_COMPLETE,               /* Complete! */
 2801|   132k|        STATE_PRE_BODY,               /* In this state, we'll consider frames vs. body. */
 2802|   132k|        STATE_PARSE_BODY,             /* In this state, we can parse the body. */
 2803|   132k|        STATE_PARSE_HEAD,             /* In this state, we will setup head for parsing. */
 2804|   132k|        STATE_PARSE_HEAD_REENTER,     /* Resume here after parsing head. */
 2805|   132k|        STATE_PARSE_NOFRAMES,         /* In this state, we can parse noframes content. */
 2806|   132k|        STATE_PARSE_NOFRAMES_REENTER, /* In this state, we can restore more state. */
 2807|   132k|        STATE_PARSE_FRAMESET,         /* In this state, we will parse frameset content. */
 2808|   132k|        STATE_PARSE_FRAMESET_REENTER, /* We need to cleanup some things after parsing frameset. */
 2809|   132k|    } state = STATE_INITIAL;
 2810|       |
 2811|   132k|    TY_(SetOptionBool)( doc, TidyXmlTags, no );
  ------------------
  |  |   23|   132k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   132k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2812|       |
 2813|   132k|    if ( html == NULL )
  ------------------
  |  Branch (2813:10): [True: 70.3k, False: 62.0k]
  ------------------
 2814|  70.3k|    {
 2815|  70.3k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  70.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  70.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2816|  70.3k|        node = memory.reentry_node;
 2817|  70.3k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2818|  70.3k|        html = memory.original_node;
 2819|  70.3k|        state = memory.reentry_state;
 2820|  70.3k|        DEBUG_LOG_GET_OLD_MODE;
 2821|  70.3k|        mode = memory.reentry_mode;
 2822|  70.3k|        DEBUG_LOG_CHANGE_MODE;
 2823|  70.3k|    }
 2824|  62.0k|    else
 2825|  62.0k|    {
 2826|  62.0k|        DEBUG_LOG_ENTER_WITH_NODE(html);
 2827|  62.0k|    }
 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|   344k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (2833:13): [True: 343k, False: 1.15k]
  ------------------
 2834|   343k|    {
 2835|   343k|        if ( state == STATE_INITIAL || state == STATE_PRE_BODY )
  ------------------
  |  Branch (2835:14): [True: 63.4k, False: 279k]
  |  Branch (2835:40): [True: 78.1k, False: 201k]
  ------------------
 2836|   141k|        {
 2837|   141k|            node = TY_(GetToken)( doc, IgnoreWhitespace );
  ------------------
  |  |   23|   141k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   141k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2838|   141k|            DEBUG_LOG_GOT_TOKEN(node);
 2839|   141k|        }
 2840|       |
 2841|   343k|        switch ( state )
 2842|   343k|        {
 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|  63.4k|            case STATE_INITIAL:
  ------------------
  |  Branch (2848:13): [True: 63.4k, False: 279k]
  ------------------
 2849|  63.4k|            {
 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|  63.4k|                if (node == NULL)
  ------------------
  |  Branch (2855:21): [True: 3.96k, False: 59.4k]
  ------------------
 2856|  3.96k|                {
 2857|  3.96k|                    node = TY_(InferredTag)(doc, TidyTag_HEAD);
  ------------------
  |  |   23|  3.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2858|  3.96k|                    state = STATE_PARSE_HEAD;
 2859|  3.96k|                    continue;
 2860|  3.96k|                }
 2861|       |
 2862|       |                /* We found exactly what we expected: head. */
 2863|  59.4k|                if ( nodeIsHEAD(node) )
  ------------------
  |  |  371|  59.4k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|  59.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 59.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 49.2k, False: 10.2k]
  |  |  |  |  |  Branch (275:54): [True: 293, False: 48.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2864|    293|                {
 2865|    293|                    state = STATE_PARSE_HEAD;
 2866|    293|                    continue;
 2867|    293|                }
 2868|       |
 2869|       |                /* We did not expect to find an html closing tag here! */
 2870|  59.1k|                if (html && (node->tag == html->tag) && (node->type == EndTag))
  ------------------
  |  Branch (2870:21): [True: 59.1k, False: 0]
  |  Branch (2870:29): [True: 990, False: 58.2k]
  |  Branch (2870:57): [True: 207, False: 783]
  ------------------
 2871|    207|                {
 2872|    207|                    TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    207|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    207|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2873|    207|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    207|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    207|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2874|    207|                    continue;
 2875|    207|                }
 2876|       |
 2877|       |                /* Find and discard multiple <html> elements. */
 2878|  58.9k|                if (html && (node->tag == html->tag) && (node->type == StartTag))
  ------------------
  |  Branch (2878:21): [True: 58.9k, False: 0]
  |  Branch (2878:29): [True: 783, False: 58.2k]
  |  Branch (2878:57): [True: 536, False: 247]
  ------------------
 2879|    536|                {
 2880|    536|                    TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    536|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    536|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2881|    536|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    536|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    536|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2882|    536|                    continue;
 2883|    536|                }
 2884|       |
 2885|       |                /* Deal with comments, etc. */
 2886|  58.4k|                if (InsertMisc(html, node))
  ------------------
  |  Branch (2886:21): [True: 664, False: 57.7k]
  ------------------
 2887|    664|                    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|  57.7k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  57.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2895|  57.7k|                node = TY_(InferredTag)(doc, TidyTag_HEAD);
  ------------------
  |  |   23|  57.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2896|  57.7k|                state = STATE_PARSE_HEAD;
 2897|  57.7k|                continue;
 2898|  58.4k|            } 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|  78.1k|            case STATE_PRE_BODY:
  ------------------
  |  Branch (2905:13): [True: 78.1k, False: 265k]
  ------------------
 2906|  78.1k|            {
 2907|  78.1k|                if (node == NULL )
  ------------------
  |  Branch (2907:21): [True: 6.35k, False: 71.8k]
  ------------------
 2908|  6.35k|                {
 2909|  6.35k|                    if (frameset == NULL) /* Implied body. */
  ------------------
  |  Branch (2909:25): [True: 5.19k, False: 1.15k]
  ------------------
 2910|  5.19k|                    {
 2911|  5.19k|                        node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|  5.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2912|  5.19k|                        state = STATE_PARSE_BODY;
 2913|  5.19k|                    } else {
 2914|  1.15k|                        state = STATE_COMPLETE;
 2915|  1.15k|                    }
 2916|       |
 2917|  6.35k|                    continue;
 2918|  6.35k|                }
 2919|       |
 2920|       |                /* Robustly handle html tags. */
 2921|  71.8k|                if (node->tag == html->tag)
  ------------------
  |  Branch (2921:21): [True: 1.19k, False: 70.6k]
  ------------------
 2922|  1.19k|                {
 2923|  1.19k|                    if (node->type != StartTag && frameset == NULL)
  ------------------
  |  Branch (2923:25): [True: 735, False: 464]
  |  Branch (2923:51): [True: 507, False: 228]
  ------------------
 2924|    507|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    507|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    507|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2925|       |
 2926|  1.19k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2927|  1.19k|                    continue;
 2928|  1.19k|                }
 2929|       |
 2930|       |                /* Deal with comments, etc. */
 2931|  70.6k|                if (InsertMisc(html, node))
  ------------------
  |  Branch (2931:21): [True: 356, False: 70.2k]
  ------------------
 2932|    356|                    continue;
 2933|       |
 2934|       |                /* If frameset document, coerce <body> to <noframes> */
 2935|  70.2k|                if ( nodeIsBODY(node) )
  ------------------
  |  |  375|  70.2k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  70.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 70.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 60.5k, False: 9.73k]
  |  |  |  |  |  Branch (275:54): [True: 1.28k, False: 59.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2936|  1.28k|                {
 2937|  1.28k|                    if (node->type != StartTag)
  ------------------
  |  Branch (2937:25): [True: 209, False: 1.07k]
  ------------------
 2938|    209|                    {
 2939|    209|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    209|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    209|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2940|    209|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    209|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    209|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2941|    209|                        continue;
 2942|    209|                    }
 2943|       |
 2944|  1.07k|                    if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  1.07k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (2944:26): [True: 1.07k, False: 0]
  ------------------
 2945|  1.07k|                    {
 2946|  1.07k|                        if (frameset != NULL)
  ------------------
  |  Branch (2946:29): [True: 818, False: 256]
  ------------------
 2947|    818|                        {
 2948|    818|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    818|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    818|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2949|       |
 2950|    818|                            if (noframes == NULL)
  ------------------
  |  Branch (2950:33): [True: 403, False: 415]
  ------------------
 2951|    403|                            {
 2952|    403|                                noframes = TY_(InferredTag)(doc, TidyTag_NOFRAMES);
  ------------------
  |  |   23|    403|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    403|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2953|    403|                                TY_(InsertNodeAtEnd)(frameset, noframes);
  ------------------
  |  |   23|    403|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    403|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2954|    403|                                TY_(Report)(doc, html, noframes, INSERTING_TAG);
  ------------------
  |  |   23|    403|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    403|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2955|    403|                            }
 2956|    415|                            else
 2957|    415|                            {
 2958|    415|                                if (noframes->type == StartEndTag)
  ------------------
  |  Branch (2958:37): [True: 194, False: 221]
  ------------------
 2959|    194|                                    noframes->type = StartTag;
 2960|    415|                            }
 2961|       |
 2962|    818|                            state = STATE_PARSE_NOFRAMES;
 2963|    818|                            continue;
 2964|    818|                        }
 2965|  1.07k|                    }
 2966|       |
 2967|    256|                    TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |   23|    256|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    256|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |  209|    256|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|    256|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|    256|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|    256|#define X10F                1024u
  |  |  ------------------
  ------------------
 2968|    256|                    state = STATE_PARSE_BODY;
 2969|    256|                    continue;
 2970|  1.07k|                }
 2971|       |
 2972|       |                /* Flag an error if we see more than one frameset. */
 2973|  68.9k|                if ( nodeIsFRAMESET(node) )
  ------------------
  |  |  376|  68.9k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  68.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 68.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 59.2k, False: 9.73k]
  |  |  |  |  |  Branch (275:54): [True: 4.61k, False: 54.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2974|  4.61k|                {
 2975|  4.61k|                    if (node->type != StartTag)
  ------------------
  |  Branch (2975:25): [True: 235, False: 4.38k]
  ------------------
 2976|    235|                    {
 2977|    235|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    235|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    235|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2978|    235|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    235|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    235|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2979|    235|                        continue;
 2980|    235|                    }
 2981|       |
 2982|  4.38k|                    if (frameset != NULL)
  ------------------
  |  Branch (2982:25): [True: 1.61k, False: 2.76k]
  ------------------
 2983|  1.61k|                        TY_(Report)(doc, html, node, DUPLICATE_FRAMESET);
  ------------------
  |  |   23|  1.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2984|  2.76k|                    else
 2985|  2.76k|                        frameset = node;
 2986|       |
 2987|  4.38k|                    state = STATE_PARSE_FRAMESET;
 2988|  4.38k|                    continue;
 2989|  4.61k|                }
 2990|       |
 2991|       |                /* If not a frameset document coerce <noframes> to <body>. */
 2992|  64.3k|                if ( nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|  64.3k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  64.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 64.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 54.6k, False: 9.73k]
  |  |  |  |  |  Branch (275:54): [True: 1.47k, False: 53.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2993|  1.47k|                {
 2994|  1.47k|                    if (node->type != StartTag)
  ------------------
  |  Branch (2994:25): [True: 223, False: 1.25k]
  ------------------
 2995|    223|                    {
 2996|    223|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    223|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    223|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2997|    223|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    223|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    223|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2998|    223|                        continue;
 2999|    223|                    }
 3000|       |
 3001|  1.25k|                    if (frameset == NULL)
  ------------------
  |  Branch (3001:25): [True: 258, False: 997]
  ------------------
 3002|    258|                    {
 3003|    258|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    258|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    258|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3004|    258|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    258|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    258|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3005|    258|                        node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|    258|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    258|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3006|    258|                        state = STATE_PARSE_BODY;
 3007|    258|                        continue;
 3008|    258|                    }
 3009|       |
 3010|    997|                    if (noframes == NULL)
  ------------------
  |  Branch (3010:25): [True: 792, False: 205]
  ------------------
 3011|    792|                    {
 3012|    792|                        noframes = node;
 3013|    792|                        TY_(InsertNodeAtEnd)(frameset, noframes);
  ------------------
  |  |   23|    792|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    792|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3014|    792|                        state = STATE_PARSE_NOFRAMES;
 3015|    792|                    }
 3016|    205|                    else
 3017|    205|                    {
 3018|    205|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    205|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    205|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3019|    205|                    }
 3020|       |
 3021|    997|                    continue;
 3022|  1.25k|                }
 3023|       |
 3024|       |                /* Deal with some other element that we're not expecting. */
 3025|  62.8k|                if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  62.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  62.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3025:21): [True: 54.4k, False: 8.38k]
  ------------------
 3026|  54.4k|                {
 3027|  54.4k|                    if (node->tag && node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  52.5k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (3027:25): [True: 52.5k, False: 1.91k]
  |  Branch (3027:38): [True: 4.95k, False: 47.6k]
  ------------------
 3028|  4.95k|                    {
 3029|  4.95k|                        MoveToHead(doc, html, node);
 3030|  4.95k|                        continue;
 3031|  4.95k|                    }
 3032|       |
 3033|       |                    /* Discard illegal frame element following a frameset. */
 3034|  49.5k|                    if ( frameset != NULL && nodeIsFRAME(node) )
  ------------------
  |  |  377|  2.53k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|  2.53k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.53k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 681, False: 1.85k]
  |  |  |  |  |  Branch (275:54): [True: 439, False: 242]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3034:26): [True: 2.53k, False: 47.0k]
  ------------------
 3035|    439|                    {
 3036|    439|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    439|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    439|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3037|    439|                        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    439|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    439|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3038|    439|                        continue;
 3039|    439|                    }
 3040|  49.5k|                }
 3041|       |
 3042|  57.4k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  57.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3043|       |
 3044|       |                /* Insert other content into noframes element. */
 3045|  57.4k|                if (frameset)
  ------------------
  |  Branch (3045:21): [True: 3.90k, False: 53.5k]
  ------------------
 3046|  3.90k|                {
 3047|  3.90k|                    if (noframes == NULL)
  ------------------
  |  Branch (3047:25): [True: 2.86k, False: 1.03k]
  ------------------
 3048|  2.86k|                    {
 3049|  2.86k|                        noframes = TY_(InferredTag)(doc, TidyTag_NOFRAMES);
  ------------------
  |  |   23|  2.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3050|  2.86k|                        TY_(InsertNodeAtEnd)(frameset, noframes);
  ------------------
  |  |   23|  2.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3051|  2.86k|                    }
 3052|  1.03k|                    else
 3053|  1.03k|                    {
 3054|  1.03k|                        TY_(Report)(doc, html, node, NOFRAMES_CONTENT);
  ------------------
  |  |   23|  1.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3055|  1.03k|                        if (noframes->type == StartEndTag)
  ------------------
  |  Branch (3055:29): [True: 203, False: 832]
  ------------------
 3056|    203|                            noframes->type = StartTag;
 3057|  1.03k|                    }
 3058|       |
 3059|  3.90k|                    TY_(ConstrainVersion)(doc, VERS_FRAMESET);
  ------------------
  |  |   23|  3.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, VERS_FRAMESET);
  ------------------
  |  |  209|  3.90k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|  3.90k|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|  3.90k|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|  3.90k|#define X10F                1024u
  |  |  ------------------
  ------------------
 3060|  3.90k|                    state = STATE_PARSE_NOFRAMES;
 3061|  3.90k|                    continue;
 3062|  3.90k|                }
 3063|       |
 3064|  53.5k|                node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|  53.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  53.5k|#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|   107k|                if (!showingBodyOnly(doc))
  ------------------
  |  |   28|  53.5k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  53.5k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  53.5k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3068:21): [True: 53.5k, False: 0]
  |  Branch (3068:21): [True: 53.5k, False: 0]
  ------------------
 3069|  53.5k|                    TY_(Report)(doc, html, node, INSERTING_TAG );
  ------------------
  |  |   23|  53.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  53.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3070|       |
 3071|  53.5k|                TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |   23|  53.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  53.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |  209|  53.5k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|  53.5k|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|  53.5k|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|  53.5k|#define X10F                1024u
  |  |  ------------------
  ------------------
 3072|  53.5k|                state = STATE_PARSE_BODY;
 3073|  53.5k|                continue;
 3074|  57.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|  62.0k|            case STATE_PARSE_HEAD:
  ------------------
  |  Branch (3081:13): [True: 62.0k, False: 281k]
  ------------------
 3082|  62.0k|            {
 3083|  62.0k|                TidyParserMemory memory = {0};
 3084|  62.0k|                memory.identity = TY_(ParseHTML);
  ------------------
  |  |   23|  62.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  62.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3085|  62.0k|                memory.mode = mode;
 3086|  62.0k|                memory.original_node = html;
 3087|  62.0k|                memory.reentry_node = node;
 3088|  62.0k|                memory.reentry_mode = mode;
 3089|  62.0k|                memory.reentry_state = STATE_PARSE_HEAD_REENTER;
 3090|  62.0k|                TY_(InsertNodeAtEnd)(html, node);
  ------------------
  |  |   23|  62.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  62.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3091|  62.0k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  62.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  62.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3092|  62.0k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3093|  62.0k|                return node;
 3094|  57.4k|            } break;
 3095|       |
 3096|  62.0k|            case STATE_PARSE_HEAD_REENTER:
  ------------------
  |  Branch (3096:13): [True: 62.0k, False: 281k]
  ------------------
 3097|  62.0k|            {
 3098|  62.0k|                head = node;
 3099|  62.0k|                state = STATE_PRE_BODY;
 3100|  62.0k|            } break;
 3101|       |
 3102|       |
 3103|       |            /**************************************************************
 3104|       |             In this case, we can finally parse a body.
 3105|       |             **************************************************************/
 3106|  59.2k|            case STATE_PARSE_BODY:
  ------------------
  |  Branch (3106:13): [True: 59.2k, False: 283k]
  ------------------
 3107|  59.2k|            {
 3108|  59.2k|                TidyParserMemory memory = {0};
 3109|  59.2k|                memory.identity = NULL; /* we don't need to reenter */
 3110|  59.2k|                memory.mode = mode;
 3111|  59.2k|                memory.original_node = html;
 3112|  59.2k|                memory.reentry_node = NULL;
 3113|  59.2k|                memory.reentry_mode = mode;
 3114|  59.2k|                memory.reentry_state = STATE_COMPLETE;
 3115|  59.2k|                TY_(InsertNodeAtEnd)(html, node);
  ------------------
  |  |   23|  59.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  59.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3116|  59.2k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  59.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  59.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3117|  59.2k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3118|  59.2k|                return node;
 3119|  57.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|  5.51k|            case STATE_PARSE_NOFRAMES:
  ------------------
  |  Branch (3126:13): [True: 5.51k, False: 337k]
  ------------------
 3127|  5.51k|            {
 3128|  5.51k|                TidyParserMemory memory = {0};
 3129|  5.51k|                memory.identity = TY_(ParseHTML);
  ------------------
  |  |   23|  5.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3130|  5.51k|                memory.mode = mode;
 3131|  5.51k|                memory.original_node = html;
 3132|  5.51k|                memory.reentry_node = frameset;
 3133|  5.51k|                memory.reentry_mode = mode;
 3134|  5.51k|                memory.reentry_state = STATE_PARSE_NOFRAMES_REENTER;
 3135|  5.51k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  5.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3136|  5.51k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3137|  5.51k|                return noframes;
 3138|  57.4k|            } break;
 3139|       |
 3140|  3.92k|            case STATE_PARSE_NOFRAMES_REENTER:
  ------------------
  |  Branch (3140:13): [True: 3.92k, False: 339k]
  ------------------
 3141|  3.92k|            {
 3142|  3.92k|                frameset = node;
 3143|  3.92k|                state = STATE_PRE_BODY;
 3144|  3.92k|            } 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|  4.38k|            case STATE_PARSE_FRAMESET:
  ------------------
  |  Branch (3151:13): [True: 4.38k, False: 338k]
  ------------------
 3152|  4.38k|            {
 3153|  4.38k|                TidyParserMemory memory = {0};
 3154|  4.38k|                memory.identity = TY_(ParseHTML);
  ------------------
  |  |   23|  4.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3155|  4.38k|                memory.mode = mode;
 3156|  4.38k|                memory.original_node = html;
 3157|  4.38k|                memory.reentry_node = frameset;
 3158|  4.38k|                memory.reentry_mode = mode;
 3159|  4.38k|                memory.reentry_state = STATE_PARSE_FRAMESET_REENTER;
 3160|  4.38k|                TY_(InsertNodeAtEnd)(html, node);
  ------------------
  |  |   23|  4.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3161|  4.38k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  4.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3162|  4.38k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3163|  4.38k|                return node;
 3164|  57.4k|            } break;
 3165|       |
 3166|  4.36k|            case (STATE_PARSE_FRAMESET_REENTER):
  ------------------
  |  Branch (3166:13): [True: 4.36k, False: 338k]
  ------------------
 3167|  4.36k|            {
 3168|  4.36k|                frameset = node;
 3169|       |                /*
 3170|       |                 See if it includes a noframes element so that
 3171|       |                 we can merge subsequent noframes elements.
 3172|       |                 */
 3173|  8.54k|                for (node = frameset->content; node; node = node->next)
  ------------------
  |  Branch (3173:48): [True: 4.17k, False: 4.36k]
  ------------------
 3174|  4.17k|                {
 3175|  4.17k|                    if ( nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|  4.17k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  4.17k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.17k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.75k, False: 425]
  |  |  |  |  |  Branch (275:54): [True: 2.81k, False: 933]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3176|  2.81k|                        noframes = node;
 3177|  4.17k|                }
 3178|  4.36k|                state = STATE_PRE_BODY;
 3179|  4.36k|            } 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: 343k]
  ------------------
 3186|      0|            {
 3187|      0|                state = STATE_COMPLETE;
 3188|      0|            }
 3189|   343k|        } /* switch */
 3190|   343k|    } /* while */
 3191|       |
 3192|  1.15k|    DEBUG_LOG_EXIT;
 3193|       |    return NULL;
 3194|   132k|}
prvTidyParseInline:
 3206|  3.92M|{
 3207|  3.92M|    Lexer* lexer = doc->lexer;
 3208|  3.92M|    Node *node = NULL;
 3209|  3.92M|    Node *parent = NULL;
 3210|  3.92M|    DEBUG_LOG_COUNTERS;
 3211|       |    
 3212|  3.92M|    if ( element == NULL )
  ------------------
  |  Branch (3212:10): [True: 1.88M, False: 2.03M]
  ------------------
 3213|  1.88M|    {
 3214|  1.88M|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  1.88M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.88M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3215|  1.88M|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 3216|  1.88M|        DEBUG_LOG_REENTER_WITH_NODE(node);
 3217|  1.88M|        element = memory.original_node;
 3218|  1.88M|        DEBUG_LOG_GET_OLD_MODE;
 3219|  1.88M|        mode = memory.reentry_mode;
 3220|  1.88M|        DEBUG_LOG_CHANGE_MODE;
 3221|  1.88M|    }
 3222|  2.03M|    else
 3223|  2.03M|    {
 3224|  2.03M|        DEBUG_LOG_ENTER_WITH_NODE(element);
 3225|       |
 3226|  2.03M|        if (element->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  2.03M|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (3226:13): [True: 0, False: 2.03M]
  ------------------
 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.03M|        if ((TY_(nodeHasCM)(element, CM_BLOCK) || nodeIsDT(element)) &&
  ------------------
  |  |   23|  2.03M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.03M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((TY_(nodeHasCM)(element, CM_BLOCK) || nodeIsDT(element)) &&
  ------------------
  |  |  142|  2.03M|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                      if ((TY_(nodeHasCM)(element, CM_BLOCK) || nodeIsDT(element)) &&
  ------------------
  |  |  391|  1.94M|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  275|  1.94M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.94M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.94M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.00k, False: 1.94M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3248:14): [True: 93.7k, False: 1.94M]
  ------------------
 3249|  97.7k|            !TY_(nodeHasCM)(element, CM_MIXED))
  ------------------
  |  |   23|  97.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  97.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          !TY_(nodeHasCM)(element, CM_MIXED))
  ------------------
  |  |  156|  97.7k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (3249:13): [True: 96.5k, False: 1.14k]
  ------------------
 3250|  96.5k|            TY_(InlineDup)(doc, NULL);
  ------------------
  |  |   23|  96.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  96.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3251|  1.94M|        else if (TY_(nodeHasCM)(element, CM_INLINE))
  ------------------
  |  |   23|  1.94M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.94M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      else if (TY_(nodeHasCM)(element, CM_INLINE))
  ------------------
  |  |  143|  1.94M|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3251:18): [True: 1.94M, False: 244]
  ------------------
 3252|  1.94M|            TY_(PushInline)(doc, element);
  ------------------
  |  |   23|  1.94M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.94M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3253|       |
 3254|  2.03M|        if ( nodeIsNOBR(element) )
  ------------------
  |  |  415|  2.03M|#define nodeIsNOBR( node )       TagIsId( node, TidyTag_NOBR )
  |  |  ------------------
  |  |  |  |  275|  2.03M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.03M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.03M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 966, False: 2.03M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3255|    966|            doc->badLayout |= USING_NOBR;
  ------------------
  |  |  293|    966|#define USING_NOBR              4
  ------------------
 3256|  2.03M|        else if ( nodeIsFONT(element) )
  ------------------
  |  |  417|  2.03M|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  2.03M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.03M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.03M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.58M, False: 452k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3257|  1.58M|            doc->badLayout |= USING_FONT;
  ------------------
  |  |  294|  1.58M|#define USING_FONT              8
  ------------------
 3258|       |
 3259|       |        /* Inline elements may or may not be within a preformatted element */
 3260|  2.03M|        if (mode != Preformatted)
  ------------------
  |  Branch (3260:13): [True: 2.03M, False: 0]
  ------------------
 3261|  2.03M|        {
 3262|  2.03M|            DEBUG_LOG_GET_OLD_MODE;
 3263|  2.03M|            mode = MixedContent;
 3264|  2.03M|            DEBUG_LOG_CHANGE_MODE;
 3265|  2.03M|        }
 3266|  2.03M|    }
 3267|       |    
 3268|  4.10M|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|  4.10M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.10M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3268:12): [True: 2.92M, False: 1.18M]
  ------------------
 3269|  2.92M|    {
 3270|       |        /* end tag for current element */
 3271|  2.92M|        if (node->tag == element->tag && node->type == EndTag)
  ------------------
  |  Branch (3271:13): [True: 1.69M, False: 1.23M]
  |  Branch (3271:42): [True: 21.1k, False: 1.67M]
  ------------------
 3272|  21.1k|        {
 3273|  21.1k|            if (element->tag->model & CM_INLINE)
  ------------------
  |  |  143|  21.1k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3273:17): [True: 20.2k, False: 847]
  ------------------
 3274|  20.2k|                TY_(PopInline)( doc, node );
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3275|       |
 3276|  21.1k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  21.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3277|       |
 3278|  21.1k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3278:17): [True: 21.1k, False: 0]
  ------------------
 3279|  21.1k|                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.1k|            if ( nodeIsFONT(element) &&
  ------------------
  |  |  417|  21.1k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  42.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 21.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 21.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 16.2k, False: 4.83k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3287|  16.2k|                 element->content && element->content == element->last )
  ------------------
  |  Branch (3287:18): [True: 16.0k, False: 221]
  |  Branch (3287:38): [True: 1.73k, False: 14.3k]
  ------------------
 3288|  1.73k|            {
 3289|  1.73k|                Node *child = element->content;
 3290|       |
 3291|  1.73k|                if ( nodeIsA(child) )
  ------------------
  |  |  401|  1.73k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  1.73k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.73k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.52k, False: 210]
  |  |  |  |  |  Branch (275:54): [True: 1.03k, False: 495]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3292|  1.03k|                {
 3293|  1.03k|                    child->parent = element->parent;
 3294|  1.03k|                    child->next = element->next;
 3295|  1.03k|                    child->prev = element->prev;
 3296|       |
 3297|  1.03k|                    element->next = NULL;
 3298|  1.03k|                    element->prev = NULL;
 3299|  1.03k|                    element->parent = child;
 3300|       |
 3301|  1.03k|                    element->content = child->content;
 3302|  1.03k|                    element->last = child->last;
 3303|  1.03k|                    child->content = element;
 3304|       |
 3305|  1.03k|                    TY_(FixNodeLinks)(child);
  ------------------
  |  |   23|  1.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3306|  1.03k|                    TY_(FixNodeLinks)(element);
  ------------------
  |  |   23|  1.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3307|  1.03k|                }
 3308|  1.73k|            }
 3309|       |
 3310|  21.1k|            element->closed = yes;
 3311|  21.1k|            TrimSpaces( doc, element );
 3312|       |
 3313|  21.1k|            DEBUG_LOG_EXIT;
 3314|  21.1k|            return NULL;
 3315|  21.1k|        }
 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|  2.90M|        if ( node->type == StartTag
  ------------------
  |  Branch (3321:14): [True: 2.62M, False: 277k]
  ------------------
 3322|  2.62M|             && node->tag == element->tag
  ------------------
  |  Branch (3322:17): [True: 1.67M, False: 955k]
  ------------------
 3323|  1.67M|             && TY_(IsPushed)( doc, node )
  ------------------
  |  |   23|  1.67M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.67M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3323:17): [True: 1.58M, False: 85.1k]
  ------------------
 3324|  1.58M|             && !node->implicit
  ------------------
  |  Branch (3324:17): [True: 169k, False: 1.41M]
  ------------------
 3325|   169k|             && !element->implicit
  ------------------
  |  Branch (3325:17): [True: 165k, False: 3.98k]
  ------------------
 3326|   165k|             && node->tag && (node->tag->model & CM_INLINE)
  ------------------
  |  |  143|   165k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3326:17): [True: 165k, False: 0]
  |  Branch (3326:30): [True: 165k, False: 0]
  ------------------
 3327|  2.90M|             && !nodeIsA(node)
  ------------------
  |  |  401|   165k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  3.06M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 165k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 165k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.04k, False: 164k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3328|  2.90M|             && !nodeIsFONT(node)
  ------------------
  |  |  417|   164k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  3.06M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 164k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 164k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 137k, False: 26.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3329|  2.90M|             && !nodeIsBIG(node)
  ------------------
  |  |  407|  26.5k|#define nodeIsBIG( node )        TagIsId( node, TidyTag_BIG )
  |  |  ------------------
  |  |  |  |  275|  2.92M|#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: 271, False: 26.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3330|  2.90M|             && !nodeIsSMALL(node)
  ------------------
  |  |  408|  26.3k|#define nodeIsSMALL( node )      TagIsId( node, TidyTag_SMALL )
  |  |  ------------------
  |  |  |  |  275|  2.92M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 26.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 26.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 6.39k, False: 19.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3331|  2.90M|             && !nodeIsSUB(node)
  ------------------
  |  |  448|  19.9k|#define nodeIsSUB( node )        TagIsId( node, TidyTag_SUB )
  |  |  ------------------
  |  |  |  |  275|  2.92M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 19.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 19.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 204, False: 19.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3332|  2.90M|             && !nodeIsSUP(node)
  ------------------
  |  |  449|  19.7k|#define nodeIsSUP( node )        TagIsId( node, TidyTag_SUP )
  |  |  ------------------
  |  |  |  |  275|  2.92M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 19.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 19.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 197, False: 19.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3333|  2.90M|             && !nodeIsQ(node)
  ------------------
  |  |  432|  19.5k|#define nodeIsQ( node )          TagIsId( node, TidyTag_Q )
  |  |  ------------------
  |  |  |  |  275|  2.92M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 19.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 19.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.76k, False: 16.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3334|  2.90M|             && !nodeIsSPAN(node)
  ------------------
  |  |  430|  16.7k|#define nodeIsSPAN( node )       TagIsId( node, TidyTag_SPAN )
  |  |  ------------------
  |  |  |  |  275|  2.91M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 16.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 16.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 432, False: 16.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3335|  16.3k|             && cfgBool(doc, TidyCoerceEndTags)
  ------------------
  |  |  418|  16.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  16.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 16.3k, False: 0]
  |  |  ------------------
  ------------------
 3336|  2.90M|           )
 3337|  16.3k|        {
 3338|       |            /* proceeds only if "node" does not have any attribute and
 3339|       |               follows a text node not finishing with a space */
 3340|  16.3k|            if (element->content != NULL && node->attributes == NULL
  ------------------
  |  Branch (3340:17): [True: 4.48k, False: 11.8k]
  |  Branch (3340:45): [True: 3.94k, False: 532]
  ------------------
 3341|  3.94k|                && TY_(nodeIsText)(element->last)
  ------------------
  |  |   23|  3.94k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.94k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3341:20): [True: 2.89k, False: 1.05k]
  ------------------
 3342|  2.89k|                && !TY_(TextNodeEndWithSpace)(doc->lexer, element->last) )
  ------------------
  |  |   23|  2.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3342:20): [True: 2.42k, False: 464]
  ------------------
 3343|  2.42k|            {
 3344|  2.42k|                TY_(Report)(doc, element, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|  2.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3345|  2.42k|                node->type = EndTag;
 3346|  2.42k|                TY_(UngetToken)(doc);
  ------------------
  |  |   23|  2.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3347|  2.42k|                continue;
 3348|  2.42k|            }
 3349|       |
 3350|  13.9k|            if (node->attributes == NULL || element->attributes == NULL)
  ------------------
  |  Branch (3350:17): [True: 5.58k, False: 8.32k]
  |  Branch (3350:45): [True: 6.97k, False: 1.34k]
  ------------------
 3351|  12.5k|                TY_(Report)(doc, element, node, NESTED_EMPHASIS);
  ------------------
  |  |   23|  12.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3352|  13.9k|        }
 3353|  2.88M|        else if ( TY_(IsPushed)(doc, node) && node->type == StartTag &&
  ------------------
  |  |   23|  2.88M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.88M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3353:19): [True: 1.75M, False: 1.13M]
  |  Branch (3353:47): [True: 1.73M, False: 16.8k]
  ------------------
 3354|  1.73M|                  nodeIsQ(node) )
  ------------------
  |  |  432|  1.73M|#define nodeIsQ( node )          TagIsId( node, TidyTag_Q )
  |  |  ------------------
  |  |  |  |  275|  1.73M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.73M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.73M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 29.1k, False: 1.70M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3355|  29.1k|        {
 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|  29.1k|            if (TY_(HTMLVersion)(doc) != HT50)
  ------------------
  |  |   23|  29.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(HTMLVersion)(doc) != HT50)
  ------------------
  |  |  200|  29.1k|#define HT50              131072u
  ------------------
  |  Branch (3360:17): [True: 29.1k, False: 0]
  ------------------
 3361|  29.1k|            {
 3362|  29.1k|                TY_(Report)(doc, element, node, NESTED_QUOTATION);
  ------------------
  |  |   23|  29.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3363|  29.1k|            }
 3364|  29.1k|        }
 3365|       |
 3366|  2.90M|        if ( TY_(nodeIsText)(node) )
  ------------------
  |  |   23|  2.90M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.90M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3366:14): [True: 81.4k, False: 2.81M]
  ------------------
 3367|  81.4k|        {
 3368|       |            /* only called for 1st child */
 3369|  81.4k|            if ( element->content == NULL && !(mode & Preformatted) )
  ------------------
  |  Branch (3369:18): [True: 66.1k, False: 15.2k]
  |  Branch (3369:46): [True: 66.1k, False: 0]
  ------------------
 3370|  66.1k|                TrimSpaces( doc, element );
 3371|       |
 3372|  81.4k|            if ( node->start >= node->end )
  ------------------
  |  Branch (3372:18): [True: 223, False: 81.1k]
  ------------------
 3373|    223|            {
 3374|    223|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    223|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    223|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3375|    223|                continue;
 3376|    223|            }
 3377|       |
 3378|  81.1k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  81.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  81.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3379|  81.1k|            continue;
 3380|  81.4k|        }
 3381|       |
 3382|       |        /* mixed content model so allow text */
 3383|  2.81M|        if (InsertMisc(element, node))
  ------------------
  |  Branch (3383:13): [True: 42.5k, False: 2.77M]
  ------------------
 3384|  42.5k|            continue;
 3385|       |
 3386|       |        /* deal with HTML tags */
 3387|  2.77M|        if ( nodeIsHTML(node) )
  ------------------
  |  |  370|  2.77M|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  2.77M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.77M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.73M, False: 36.8k]
  |  |  |  |  |  Branch (275:54): [True: 494, False: 2.73M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3388|    494|        {
 3389|    494|            if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|    494|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    494|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3389:18): [True: 287, False: 207]
  ------------------
 3390|    287|            {
 3391|    287|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    287|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    287|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3392|    287|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    287|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    287|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3393|    287|                continue;
 3394|    287|            }
 3395|       |
 3396|       |            /* otherwise infer end of inline element */
 3397|    207|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    207|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    207|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3398|       |
 3399|    207|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3399:17): [True: 207, False: 0]
  ------------------
 3400|    207|                TrimSpaces(doc, element);
 3401|       |
 3402|    207|            DEBUG_LOG_EXIT;
 3403|    207|            return NULL;
 3404|    494|        }
 3405|       |
 3406|       |        /* within <dt> or <pre> map <p> to <br> */
 3407|  2.77M|        if ( nodeIsP(node) &&
  ------------------
  |  |  385|  2.77M|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  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.73M, False: 36.8k]
  |  |  |  |  |  Branch (275:54): [True: 295k, False: 2.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3408|   295k|             node->type == StartTag &&
  ------------------
  |  Branch (3408:14): [True: 290k, False: 4.82k]
  ------------------
 3409|   290k|             ( (mode & Preformatted) ||
  ------------------
  |  Branch (3409:16): [True: 0, False: 290k]
  ------------------
 3410|   290k|               nodeIsDT(element) ||
  ------------------
  |  |  391|   290k|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  275|   580k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 290k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 290k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.67k, False: 288k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3411|   288k|               DescendantOf(element, TidyTag_DT )
  ------------------
  |  Branch (3411:16): [True: 898, False: 287k]
  ------------------
 3412|   290k|             )
 3413|  2.77M|           )
 3414|  2.57k|        {
 3415|  2.57k|            node->tag = TY_(LookupTagDef)( TidyTag_BR );
  ------------------
  |  |   23|  2.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3416|  2.57k|            TidyDocFree(doc, node->element);
  ------------------
  |  |  159|  2.57k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  2.57k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 3417|  2.57k|            node->element = TY_(tmbstrdup)(doc->allocator, "br");
  ------------------
  |  |   23|  2.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3418|  2.57k|            TrimSpaces(doc, element);
 3419|  2.57k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  2.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3420|  2.57k|            continue;
 3421|  2.57k|        }
 3422|       |
 3423|       |        /* <p> allowed within <address> in HTML 4.01 Transitional */
 3424|  2.77M|        if ( nodeIsP(node) &&
  ------------------
  |  |  385|  2.77M|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  5.54M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.77M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.73M, False: 36.8k]
  |  |  |  |  |  Branch (275:54): [True: 292k, False: 2.44M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3425|   292k|             node->type == StartTag &&
  ------------------
  |  Branch (3425:14): [True: 287k, False: 4.82k]
  ------------------
 3426|   287k|             nodeIsADDRESS(element) )
  ------------------
  |  |  438|   287k|#define nodeIsADDRESS( node )    TagIsId( node, TidyTag_ADDRESS )
  |  |  ------------------
  |  |  |  |  275|   287k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 287k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 287k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 287k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.77M|        if ( node->tag == NULL || nodeIsPARAM(node) )
  ------------------
  |  |  409|  2.73M|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|  2.73M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.73M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.73M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 224, False: 2.73M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3435:14): [True: 36.8k, False: 2.73M]
  ------------------
 3436|  37.1k|        {
 3437|  37.1k|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  37.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3438|  37.1k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  37.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3439|  37.1k|            continue;
 3440|  37.1k|        }
 3441|       |
 3442|  2.73M|        if ( nodeIsBR(node) && node->type == EndTag )
  ------------------
  |  |  400|  2.73M|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  5.47M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.73M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.73M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.38k, False: 2.73M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3442:32): [True: 207, False: 1.17k]
  ------------------
 3443|    207|            node->type = StartTag;
 3444|       |
 3445|  2.73M|        if ( node->type == EndTag )
  ------------------
  |  Branch (3445:14): [True: 84.0k, False: 2.65M]
  ------------------
 3446|  84.0k|        {
 3447|       |           /* coerce </br> to <br> */
 3448|  84.0k|           if ( nodeIsBR(node) )
  ------------------
  |  |  400|  84.0k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  84.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 84.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 84.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 84.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3449|      0|                node->type = StartTag;
 3450|  84.0k|           else if ( nodeIsP(node) )
  ------------------
  |  |  385|  84.0k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  84.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 84.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 84.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.76k, False: 79.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3451|  4.76k|           {
 3452|       |               /* coerce unmatched </p> to <br><br> */
 3453|  4.76k|                if ( !DescendantOf(element, TidyTag_P) )
  ------------------
  |  Branch (3453:22): [True: 1.63k, False: 3.12k]
  ------------------
 3454|  1.63k|                {
 3455|  1.63k|                    TY_(CoerceNode)(doc, node, TidyTag_BR, no, no);
  ------------------
  |  |   23|  1.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3456|  1.63k|                    TrimSpaces( doc, element );
 3457|  1.63k|                    TY_(InsertNodeAtEnd)( element, node );
  ------------------
  |  |   23|  1.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3458|  1.63k|                    node = TY_(InferredTag)(doc, TidyTag_BR);
  ------------------
  |  |   23|  1.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3459|  1.63k|                    TY_(InsertNodeAtEnd)( element, node ); /* todo: check this */
  ------------------
  |  |   23|  1.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3460|  1.63k|                    continue;
 3461|  1.63k|                }
 3462|  4.76k|           }
 3463|  79.2k|           else if ( TY_(nodeHasCM)(node, CM_INLINE)
  ------------------
  |  |   23|  79.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  79.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                         else if ( TY_(nodeHasCM)(node, CM_INLINE)
  ------------------
  |  |  143|  79.2k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3463:22): [True: 74.7k, False: 4.50k]
  ------------------
 3464|  79.2k|                     && !nodeIsA(node)
  ------------------
  |  |  401|  74.7k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|   154k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 74.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 74.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 39.3k, False: 35.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3465|  35.3k|                     && !TY_(nodeHasCM)(node, CM_OBJECT)
  ------------------
  |  |   23|  35.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && !TY_(nodeHasCM)(node, CM_OBJECT)
  ------------------
  |  |  150|  35.3k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (3465:25): [True: 17.9k, False: 17.4k]
  ------------------
 3466|  17.9k|                     && TY_(nodeHasCM)(element, CM_INLINE) )
  ------------------
  |  |   23|  17.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && TY_(nodeHasCM)(element, CM_INLINE) )
  ------------------
  |  |  143|  17.9k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3466:25): [True: 17.2k, False: 705]
  ------------------
 3467|  17.2k|            {
 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|  17.2k|                if ( !nodeIsA(element)
  ------------------
  |  |  401|  17.2k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  34.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 17.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.2k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 200, False: 17.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3476|  17.0k|                     && (node->tag != element->tag)
  ------------------
  |  Branch (3476:25): [True: 17.0k, False: 0]
  ------------------
 3477|  17.0k|                     && TY_(IsPushed)( doc, node )
  ------------------
  |  |   23|  17.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3477:25): [True: 16.7k, False: 323]
  ------------------
 3478|  16.7k|                     && TY_(IsPushed)( doc, element ) )
  ------------------
  |  |   23|  16.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3478:25): [True: 16.5k, False: 194]
  ------------------
 3479|  16.5k|                {
 3480|       |                    /* we have something like
 3481|       |                       <b>bold <i>bold and italic</b> italics</i> */
 3482|  16.5k|                    if ( TY_(SwitchInline)( doc, element, node ) )
  ------------------
  |  |   23|  16.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3482:26): [True: 15.2k, False: 1.32k]
  ------------------
 3483|  15.2k|                    {
 3484|  15.2k|                        TY_(Report)(doc, element, node, NON_MATCHING_ENDTAG);
  ------------------
  |  |   23|  15.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3485|  15.2k|                        TY_(UngetToken)( doc ); /* put this back */
  ------------------
  |  |   23|  15.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3486|  15.2k|                        TY_(InlineDup1)( doc, NULL, element ); /* dupe the <i>, after </b> */
  ------------------
  |  |   23|  15.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3487|  15.2k|                        if (!(mode & Preformatted))
  ------------------
  |  Branch (3487:29): [True: 15.2k, False: 0]
  ------------------
 3488|  15.2k|                            TrimSpaces( doc, element );
 3489|       |
 3490|  15.2k|                        DEBUG_LOG_EXIT;
 3491|  15.2k|                        return NULL; /* close <i>, but will re-open it, after </b> */
 3492|  15.2k|                    }
 3493|  16.5k|                }
 3494|  2.04k|                TY_(PopInline)( doc, element );
  ------------------
  |  |   23|  2.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3495|       |
 3496|  2.04k|                if ( !nodeIsA(element) )
  ------------------
  |  |  401|  2.04k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  2.04k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.04k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.04k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 200, False: 1.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3497|  1.84k|                {
 3498|  1.84k|                    if ( nodeIsA(node) && node->tag != element->tag )
  ------------------
  |  |  401|  1.84k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  3.68k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.84k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.84k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 1.84k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  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|  1.84k|                    else
 3504|  1.84k|                    {
 3505|  1.84k|                        TY_(Report)(doc, element, node, NON_MATCHING_ENDTAG);
  ------------------
  |  |   23|  1.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3506|  1.84k|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3507|  1.84k|                    }
 3508|       |
 3509|  1.84k|                    if (!(mode & Preformatted))
  ------------------
  |  Branch (3509:25): [True: 1.84k, False: 0]
  ------------------
 3510|  1.84k|                        TrimSpaces(doc, element);
 3511|       |
 3512|  1.84k|                    DEBUG_LOG_EXIT;
 3513|  1.84k|                    return NULL;
 3514|  1.84k|                }
 3515|       |
 3516|       |                /* if parent is <a> then discard unexpected inline end tag */
 3517|    200|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    200|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    200|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3518|    200|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    200|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    200|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3519|    200|                continue;
 3520|  2.04k|            }  /* special case </tr> etc. for stuff moved in front of table */
 3521|  62.0k|            else if ( lexer->exiled
  ------------------
  |  Branch (3521:23): [True: 7.06k, False: 54.9k]
  ------------------
 3522|  7.06k|                     && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |   23|  7.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  146|  7.06k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  393|  6.81k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  6.81k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.81k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.81k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 464, False: 6.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3522:26): [True: 251, False: 6.81k]
  ------------------
 3523|    715|            {
 3524|    715|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    715|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    715|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3525|    715|                TrimSpaces(doc, element);
 3526|       |
 3527|    715|                DEBUG_LOG_EXIT;
 3528|    715|                return NULL;
 3529|    715|            }
 3530|  84.0k|        }
 3531|       |
 3532|       |        /* allow any header tag to end current header */
 3533|  2.71M|        if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |   23|  2.71M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.71M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |  153|  2.71M|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
                      if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |   23|  13.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |  153|  13.5k|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
  |  Branch (3533:14): [True: 13.5k, False: 2.70M]
  |  Branch (3533:50): [True: 1.64k, False: 11.9k]
  ------------------
 3534|  1.64k|        {
 3535|       |
 3536|  1.64k|            if ( node->tag == element->tag )
  ------------------
  |  Branch (3536:18): [True: 521, False: 1.12k]
  ------------------
 3537|    521|            {
 3538|    521|                TY_(Report)(doc, element, node, NON_MATCHING_ENDTAG );
  ------------------
  |  |   23|    521|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    521|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3539|    521|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    521|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    521|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3540|    521|            }
 3541|  1.12k|            else
 3542|  1.12k|            {
 3543|  1.12k|                TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|  1.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3544|  1.12k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3545|  1.12k|            }
 3546|       |
 3547|  1.64k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3547:17): [True: 1.64k, False: 0]
  ------------------
 3548|  1.64k|                TrimSpaces(doc, element);
 3549|       |
 3550|  1.64k|            DEBUG_LOG_EXIT;
 3551|  1.64k|            return NULL;
 3552|  1.64k|        }
 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.71M|        if ( nodeIsA(node) && !node->implicit &&
  ------------------
  |  |  401|  2.71M|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  5.43M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.71M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.71M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 73.7k, False: 2.64M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3560:31): [True: 72.0k, False: 1.77k]
  ------------------
 3561|  72.0k|             (nodeIsA(element) || DescendantOf(element, TidyTag_A)) )
  ------------------
  |  |  401|  72.0k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|   144k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 72.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 72.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.07k, False: 70.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3561:35): [True: 46.8k, False: 24.1k]
  ------------------
 3562|  47.8k|        {
 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|  47.8k|            if (node->type != EndTag && node->attributes == NULL
  ------------------
  |  Branch (3567:17): [True: 14.6k, False: 33.2k]
  |  Branch (3567:41): [True: 961, False: 13.6k]
  ------------------
 3568|    961|                && cfgBool(doc, TidyCoerceEndTags) )
  ------------------
  |  |  418|    961|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    961|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 961, False: 0]
  |  |  ------------------
  ------------------
 3569|    961|            {
 3570|    961|                node->type = EndTag;
 3571|    961|                TY_(Report)(doc, element, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|    961|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    961|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3572|       |                /* TY_(PopInline)( doc, node ); */
 3573|    961|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    961|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    961|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3574|    961|                continue;
 3575|    961|            }
 3576|       |
 3577|  46.9k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  46.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3578|  46.9k|            TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  46.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3579|       |            /* TY_(PopInline)( doc, element ); */
 3580|       |
 3581|  46.9k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3581:17): [True: 46.9k, False: 0]
  ------------------
 3582|  46.9k|                TrimSpaces(doc, element);
 3583|       |
 3584|  46.9k|            DEBUG_LOG_EXIT;
 3585|  46.9k|            return NULL;
 3586|  47.8k|        }
 3587|       |
 3588|  2.66M|        if (element->tag->model & CM_HEADING)
  ------------------
  |  |  153|  2.66M|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
  |  Branch (3588:13): [True: 5.13k, False: 2.66M]
  ------------------
 3589|  5.13k|        {
 3590|  5.13k|            if ( nodeIsCENTER(node) || nodeIsDIV(node) )
  ------------------
  |  |  420|  5.13k|#define nodeIsCENTER( node )     TagIsId( node, TidyTag_CENTER )
  |  |  ------------------
  |  |  |  |  275|  10.2k|#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: 258, False: 4.87k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsCENTER(node) || nodeIsDIV(node) )
  ------------------
  |  |  429|  4.87k|#define nodeIsDIV( node )        TagIsId( node, TidyTag_DIV )
  |  |  ------------------
  |  |  |  |  275|  4.87k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.87k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.87k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.68k, False: 3.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3591|  1.94k|            {
 3592|  1.94k|                if (!TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  1.94k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.94k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3592:21): [True: 199, False: 1.74k]
  ------------------
 3593|    199|                {
 3594|    199|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    199|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    199|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3595|    199|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    199|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    199|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3596|    199|                    continue;
 3597|    199|                }
 3598|       |
 3599|  1.74k|                TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3600|       |
 3601|       |                /* insert center as parent if heading is empty */
 3602|  1.74k|                if (element->content == NULL)
  ------------------
  |  Branch (3602:21): [True: 1.18k, False: 565]
  ------------------
 3603|  1.18k|                {
 3604|  1.18k|                    InsertNodeAsParent(element, node);
 3605|  1.18k|                    continue;
 3606|  1.18k|                }
 3607|       |
 3608|       |                /* split heading and make center parent of 2nd part */
 3609|    565|                TY_(InsertNodeAfterElement)(element, node);
  ------------------
  |  |   23|    565|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    565|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3610|       |
 3611|    565|                if (!(mode & Preformatted))
  ------------------
  |  Branch (3611:21): [True: 565, False: 0]
  ------------------
 3612|    565|                    TrimSpaces(doc, element);
 3613|       |
 3614|    565|                element = TY_(CloneNode)( doc, element );
  ------------------
  |  |   23|    565|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    565|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3615|    565|                TY_(InsertNodeAtEnd)(node, element);
  ------------------
  |  |   23|    565|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    565|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3616|    565|                continue;
 3617|  1.74k|            }
 3618|       |
 3619|  3.19k|            if ( nodeIsHR(node) )
  ------------------
  |  |  380|  3.19k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  3.19k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.19k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.19k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.52k, False: 1.67k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3620|  1.52k|            {
 3621|  1.52k|                if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3621:22): [True: 270, False: 1.25k]
  ------------------
 3622|    270|                {
 3623|    270|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    270|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    270|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3624|    270|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    270|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    270|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3625|    270|                    continue;
 3626|    270|                }
 3627|       |
 3628|  1.25k|                TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3629|       |
 3630|       |                /* insert hr before heading if heading is empty */
 3631|  1.25k|                if (element->content == NULL)
  ------------------
  |  Branch (3631:21): [True: 345, False: 905]
  ------------------
 3632|    345|                {
 3633|    345|                    TY_(InsertNodeBeforeElement)(element, node);
  ------------------
  |  |   23|    345|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    345|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3634|    345|                    continue;
 3635|    345|                }
 3636|       |
 3637|       |                /* split heading and insert hr before 2nd part */
 3638|    905|                TY_(InsertNodeAfterElement)(element, node);
  ------------------
  |  |   23|    905|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    905|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3639|       |
 3640|    905|                if (!(mode & Preformatted))
  ------------------
  |  Branch (3640:21): [True: 905, False: 0]
  ------------------
 3641|    905|                    TrimSpaces(doc, element);
 3642|       |
 3643|    905|                element = TY_(CloneNode)( doc, element );
  ------------------
  |  |   23|    905|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    905|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3644|    905|                TY_(InsertNodeAfterElement)(node, element);
  ------------------
  |  |   23|    905|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    905|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3645|    905|                continue;
 3646|  1.25k|            }
 3647|  3.19k|        }
 3648|       |
 3649|  2.66M|        if ( nodeIsDT(element) )
  ------------------
  |  |  391|  2.66M|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  275|  2.66M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.66M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.66M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.89k, False: 2.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3650|  5.89k|        {
 3651|  5.89k|            if ( nodeIsHR(node) )
  ------------------
  |  |  380|  5.89k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  5.89k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.89k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.89k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.58k, False: 4.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3652|  1.58k|            {
 3653|  1.58k|                Node *dd;
 3654|  1.58k|                if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3654:22): [True: 195, False: 1.38k]
  ------------------
 3655|    195|                {
 3656|    195|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    195|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    195|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3657|    195|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    195|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    195|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3658|    195|                    continue;
 3659|    195|                }
 3660|       |
 3661|  1.38k|                TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3662|  1.38k|                dd = TY_(InferredTag)(doc, TidyTag_DD);
  ------------------
  |  |   23|  1.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3663|       |
 3664|       |                /* insert hr within dd before dt if dt is empty */
 3665|  1.38k|                if (element->content == NULL)
  ------------------
  |  Branch (3665:21): [True: 765, False: 622]
  ------------------
 3666|    765|                {
 3667|    765|                    TY_(InsertNodeBeforeElement)(element, dd);
  ------------------
  |  |   23|    765|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    765|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3668|    765|                    TY_(InsertNodeAtEnd)(dd, node);
  ------------------
  |  |   23|    765|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    765|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3669|    765|                    continue;
 3670|    765|                }
 3671|       |
 3672|       |                /* split dt and insert hr within dd before 2nd part */
 3673|    622|                TY_(InsertNodeAfterElement)(element, dd);
  ------------------
  |  |   23|    622|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    622|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3674|    622|                TY_(InsertNodeAtEnd)(dd, node);
  ------------------
  |  |   23|    622|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    622|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3675|       |
 3676|    622|                if (!(mode & Preformatted))
  ------------------
  |  Branch (3676:21): [True: 622, False: 0]
  ------------------
 3677|    622|                    TrimSpaces(doc, element);
 3678|       |
 3679|    622|                element = TY_(CloneNode)( doc, element );
  ------------------
  |  |   23|    622|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    622|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3680|    622|                TY_(InsertNodeAfterElement)(dd, element);
  ------------------
  |  |   23|    622|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    622|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3681|    622|                continue;
 3682|  1.38k|            }
 3683|  5.89k|        }
 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.66M|        if (node->type == EndTag)
  ------------------
  |  Branch (3690:13): [True: 30.4k, False: 2.63M]
  ------------------
 3691|  30.4k|        {
 3692|  30.4k|            for (parent = element->parent;
 3693|  27.4M|                    parent != NULL; parent = parent->parent)
  ------------------
  |  Branch (3693:21): [True: 27.4M, False: 7.33k]
  ------------------
 3694|  27.4M|            {
 3695|  27.4M|                if (node->tag == parent->tag)
  ------------------
  |  Branch (3695:21): [True: 23.1k, False: 27.3M]
  ------------------
 3696|  23.1k|                {
 3697|  23.1k|                    if (!(element->tag->model & CM_OPT) && !element->implicit)
  ------------------
  |  |  154|  23.1k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (3697:25): [True: 22.8k, False: 308]
  |  Branch (3697:60): [True: 18.5k, False: 4.28k]
  ------------------
 3698|  18.5k|                        TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  18.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3699|       |
 3700|  23.1k|                    if( TY_(IsPushedLast)( doc, element, node ) )
  ------------------
  |  |   23|  23.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3700:25): [True: 0, False: 23.1k]
  ------------------
 3701|      0|                        TY_(PopInline)( doc, element );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3702|  23.1k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  23.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3703|       |
 3704|  23.1k|                    if (!(mode & Preformatted))
  ------------------
  |  Branch (3704:25): [True: 23.1k, False: 0]
  ------------------
 3705|  23.1k|                        TrimSpaces(doc, element);
 3706|       |
 3707|  23.1k|                    DEBUG_LOG_EXIT;
 3708|  23.1k|                    return NULL;
 3709|  23.1k|                }
 3710|  27.4M|            }
 3711|  30.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.63M|        if (!(node->tag->model & CM_INLINE) &&
  ------------------
  |  |  143|  2.63M|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3721:13): [True: 694k, False: 1.94M]
  ------------------
 3722|   694k|            !(element->tag->model & CM_MIXED) &&
  ------------------
  |  |  156|   694k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (3722:13): [True: 694k, False: 306]
  ------------------
 3723|   694k|            !(nodeIsSPAN(element) && nodeIsMETA(node)) )
  ------------------
  |  |  430|   694k|#define nodeIsSPAN( node )       TagIsId( node, TidyTag_SPAN )
  |  |  ------------------
  |  |  |  |  275|  1.38M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 694k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 694k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 650, False: 693k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          !(nodeIsSPAN(element) && nodeIsMETA(node)) )
  ------------------
  |  |  374|    650|#define nodeIsMETA( node )       TagIsId( node, TidyTag_META )
  |  |  ------------------
  |  |  |  |  275|    650|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 650, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 650, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 196, False: 454]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3724|   693k|        {
 3725|   693k|            if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|   693k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   693k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3725:18): [True: 503, False: 693k]
  ------------------
 3726|    503|            {
 3727|    503|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    503|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    503|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3728|    503|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    503|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    503|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3729|    503|                continue;
 3730|    503|            }
 3731|       |            /* HTML5 */
 3732|   693k|            if (nodeIsDATALIST(element)) {
  ------------------
  |  |  463|   693k|#define nodeIsDATALIST( node )   TagIsId( node, TidyTag_DATALIST )
  |  |  ------------------
  |  |  |  |  275|   693k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 693k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 693k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 693k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|   693k|            if (!(element->tag->model & CM_OPT))
  ------------------
  |  |  154|   693k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (3735:17): [True: 605k, False: 87.7k]
  ------------------
 3736|   605k|                TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|   605k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   605k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3737|       |
 3738|   693k|            if (node->tag->model & CM_HEAD && !(node->tag->model & CM_BLOCK))
  ------------------
  |  |  141|  1.38M|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
                          if (node->tag->model & CM_HEAD && !(node->tag->model & CM_BLOCK))
  ------------------
  |  |  142|  3.44k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (3738:17): [True: 3.44k, False: 689k]
  |  Branch (3738:47): [True: 1.77k, False: 1.67k]
  ------------------
 3739|  1.77k|            {
 3740|  1.77k|                MoveToHead(doc, element, node);
 3741|  1.77k|                continue;
 3742|  1.77k|            }
 3743|       |
 3744|       |            /*
 3745|       |               prevent anchors from propagating into block tags
 3746|       |               except for headings h1 to h6
 3747|       |            */
 3748|   691k|            if ( nodeIsA(element) )
  ------------------
  |  |  401|   691k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|   691k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 691k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 691k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.55k, False: 689k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3749|  1.55k|            {
 3750|  1.55k|                if (node->tag && !(node->tag->model & CM_HEADING))
  ------------------
  |  |  153|  1.55k|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
  |  Branch (3750:21): [True: 1.55k, False: 0]
  |  Branch (3750:34): [True: 565, False: 991]
  ------------------
 3751|    565|                    TY_(PopInline)( doc, element );
  ------------------
  |  |   23|    565|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    565|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3752|    991|                else if (!(element->content))
  ------------------
  |  Branch (3752:26): [True: 673, False: 318]
  ------------------
 3753|    673|                {
 3754|    673|                    TY_(DiscardElement)( doc, element );
  ------------------
  |  |   23|    673|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    673|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3755|    673|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    673|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    673|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3756|       |
 3757|    673|                    DEBUG_LOG_EXIT;
 3758|    673|                    return NULL;
 3759|    673|                }
 3760|  1.55k|            }
 3761|       |
 3762|   690k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|   690k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   690k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3763|       |
 3764|   690k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3764:17): [True: 690k, False: 0]
  ------------------
 3765|   690k|                TrimSpaces(doc, element);
 3766|       |
 3767|   690k|            DEBUG_LOG_EXIT;
 3768|   690k|            return NULL;
 3769|   691k|        }
 3770|       |
 3771|       |        /* parse inline element */
 3772|  1.94M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  1.94M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.94M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3772:13): [True: 1.93M, False: 6.83k]
  ------------------
 3773|  1.93M|        {
 3774|  1.93M|            if (node->implicit)
  ------------------
  |  Branch (3774:17): [True: 1.57M, False: 359k]
  ------------------
 3775|  1.57M|                TY_(Report)(doc, element, node, INSERTING_TAG);
  ------------------
  |  |   23|  1.57M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.57M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3776|       |
 3777|       |            /* trim white space before <br> */
 3778|  1.93M|            if ( nodeIsBR(node) )
  ------------------
  |  |  400|  1.93M|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  1.93M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.93M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.93M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.38k, False: 1.93M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3779|  1.38k|                TrimSpaces(doc, element);
 3780|       |
 3781|  1.93M|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  1.93M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.93M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3782|       |            
 3783|  1.93M|            {
 3784|  1.93M|                TidyParserMemory memory = {0};
 3785|  1.93M|                memory.identity = TY_(ParseInline);
  ------------------
  |  |   23|  1.93M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.93M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3786|  1.93M|                memory.original_node = element;
 3787|  1.93M|                memory.reentry_node = node;
 3788|  1.93M|                memory.mode = mode;
 3789|  1.93M|                memory.reentry_mode = mode;
 3790|  1.93M|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.93M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.93M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3791|  1.93M|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3792|  1.93M|                return node;
 3793|  1.93M|            }
 3794|  1.93M|        }
 3795|       |
 3796|       |        /* discard unexpected tags */
 3797|  6.83k|        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  6.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3798|  6.83k|        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  6.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3799|  6.83k|        continue;
 3800|  1.94M|    }
 3801|       |
 3802|  1.18M|    if (!(element->tag->model & CM_OPT))
  ------------------
  |  |  154|  1.18M|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (3802:9): [True: 1.17M, False: 5.78k]
  ------------------
 3803|  1.17M|        TY_(Report)(doc, element, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  1.17M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.17M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3804|       |
 3805|  1.18M|    DEBUG_LOG_EXIT;
 3806|       |    return NULL;
 3807|  3.92M|}
prvTidyParseList:
 3819|   111k|{
 3820|   111k|    Lexer* lexer = doc->lexer;
 3821|   111k|    Node *node = NULL;
 3822|   111k|    Node *parent = NULL;
 3823|   111k|    Node *lastli = NULL;;
 3824|   111k|    Bool wasblock = no;
 3825|   111k|    Bool nodeisOL = nodeIsOL(list);
  ------------------
  |  |  387|   111k|#define nodeIsOL( node )         TagIsId( node, TidyTag_OL )
  |  |  ------------------
  |  |  |  |  275|   111k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 52.5k, False: 59.2k]
  |  |  |  |  |  Branch (275:39): [True: 52.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 45.2k, False: 7.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3826|   111k|    DEBUG_LOG_COUNTERS;
 3827|       |
 3828|   111k|    if ( list == NULL )
  ------------------
  |  Branch (3828:10): [True: 59.2k, False: 52.5k]
  ------------------
 3829|  59.2k|    {
 3830|  59.2k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  59.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  59.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3831|  59.2k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 3832|  59.2k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 3833|  59.2k|        list = memory.original_node;
 3834|  59.2k|        DEBUG_LOG_GET_OLD_MODE;
 3835|  59.2k|        mode = memory.mode;
 3836|  59.2k|        DEBUG_LOG_CHANGE_MODE;
 3837|  59.2k|    }
 3838|  52.5k|    else
 3839|  52.5k|    {
 3840|  52.5k|        DEBUG_LOG_ENTER_WITH_NODE(list);
 3841|       |
 3842|  52.5k|        if (list->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  52.5k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (3842:13): [True: 0, False: 52.5k]
  ------------------
 3843|      0|        {
 3844|      0|            DEBUG_LOG_EXIT;
 3845|      0|            return NULL;
 3846|      0|        }
 3847|  52.5k|    }
 3848|       |    
 3849|   111k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 3850|       |
 3851|   121k|    while ((node = TY_(GetToken)( doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|   121k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   121k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3851:12): [True: 72.4k, False: 48.7k]
  ------------------
 3852|  72.4k|    {
 3853|  72.4k|        Bool foundLI = no;
 3854|  72.4k|        if (node->tag == list->tag && node->type == EndTag)
  ------------------
  |  Branch (3854:13): [True: 42.6k, False: 29.7k]
  |  Branch (3854:39): [True: 209, False: 42.4k]
  ------------------
 3855|    209|        {
 3856|    209|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    209|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    209|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3857|    209|            list->closed = yes;
 3858|    209|            DEBUG_LOG_EXIT;
 3859|    209|            return NULL;
 3860|    209|        }
 3861|       |
 3862|       |        /* deal with comments etc. */
 3863|  72.2k|        if (InsertMisc(list, node))
  ------------------
  |  Branch (3863:13): [True: 1.85k, False: 70.3k]
  ------------------
 3864|  1.85k|            continue;
 3865|       |
 3866|  70.3k|        if (node->type != TextNode && node->tag == NULL)
  ------------------
  |  Branch (3866:13): [True: 62.3k, False: 8.04k]
  |  Branch (3866:39): [True: 5.68k, False: 56.6k]
  ------------------
 3867|  5.68k|        {
 3868|  5.68k|            TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  5.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3869|  5.68k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  5.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3870|  5.68k|            continue;
 3871|  5.68k|        }
 3872|  64.6k|        if (lexer && (node->type == TextNode))
  ------------------
  |  Branch (3872:13): [True: 64.6k, False: 0]
  |  Branch (3872:22): [True: 8.04k, False: 56.6k]
  ------------------
 3873|  8.04k|        {
 3874|  8.04k|            uint ch, ix = node->start;
 3875|       |            /* Issue #572 - Skip whitespace. */
 3876|  9.37k|            while (ix < node->end && (ch = (lexer->lexbuf[ix] & 0xff))
  ------------------
  |  Branch (3876:20): [True: 9.12k, False: 257]
  |  Branch (3876:38): [True: 9.04k, False: 74]
  ------------------
 3877|  9.04k|                && (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n'))
  ------------------
  |  Branch (3877:21): [True: 434, False: 8.61k]
  |  Branch (3877:34): [True: 519, False: 8.09k]
  |  Branch (3877:48): [True: 201, False: 7.89k]
  |  Branch (3877:62): [True: 182, False: 7.71k]
  ------------------
 3878|  1.33k|                ++ix;
 3879|  8.04k|            if (ix >= node->end)
  ------------------
  |  Branch (3879:17): [True: 257, False: 7.78k]
  ------------------
 3880|    257|            {
 3881|       |                /* Issue #572 - Discard if ALL whitespace. */
 3882|    257|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    257|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    257|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3883|    257|                continue;
 3884|    257|            }
 3885|  8.04k|        }
 3886|       |
 3887|       |
 3888|       |        /*
 3889|       |          if this is the end tag for an ancestor element
 3890|       |          then infer end tag for this element
 3891|       |        */
 3892|  64.4k|        if (node->type == EndTag)
  ------------------
  |  Branch (3892:13): [True: 1.90k, False: 62.5k]
  ------------------
 3893|  1.90k|        {
 3894|  1.90k|            if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  1.90k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  1.90k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.90k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.90k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 219, False: 1.68k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3895|    219|            {
 3896|    219|                BadForm( doc );
 3897|    219|                TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    219|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    219|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3898|    219|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    219|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    219|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3899|    219|                continue;
 3900|    219|            }
 3901|       |
 3902|  1.68k|            if (TY_(nodeHasCM)(node,CM_INLINE))
  ------------------
  |  |   23|  1.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(nodeHasCM)(node,CM_INLINE))
  ------------------
  |  |  143|  1.68k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3902:17): [True: 953, False: 730]
  ------------------
 3903|    953|            {
 3904|    953|                TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    953|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    953|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3905|    953|                TY_(PopInline)( doc, node );
  ------------------
  |  |   23|    953|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    953|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3906|    953|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    953|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    953|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3907|    953|                continue;
 3908|    953|            }
 3909|       |
 3910|    730|            for ( parent = list->parent;
 3911|  3.49k|                  parent != NULL; parent = parent->parent )
  ------------------
  |  Branch (3911:19): [True: 3.26k, False: 223]
  ------------------
 3912|  3.26k|            {
 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|  3.26k|                if (nodeIsBODY(parent))
  ------------------
  |  |  375|  3.26k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  3.26k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.26k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.04k, False: 223]
  |  |  |  |  |  Branch (275:54): [True: 247, False: 2.79k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3917|    247|                    break;
 3918|  3.02k|                if (node->tag == parent->tag)
  ------------------
  |  Branch (3918:21): [True: 260, False: 2.76k]
  ------------------
 3919|    260|                {
 3920|    260|                    TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|    260|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    260|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3921|    260|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    260|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    260|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3922|    260|                    DEBUG_LOG_EXIT;
 3923|    260|                    return NULL;
 3924|    260|                }
 3925|  3.02k|            }
 3926|       |
 3927|    470|            TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    470|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    470|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3928|    470|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    470|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    470|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3929|    470|            continue;
 3930|    730|        }
 3931|       |
 3932|  62.5k|        if ( !nodeIsLI(node) && nodeisOL )
  ------------------
  |  |  390|  62.5k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|   125k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 62.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 54.7k, False: 7.78k]
  |  |  |  |  |  Branch (275:54): [True: 4.55k, False: 50.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3932:33): [True: 44.6k, False: 13.3k]
  ------------------
 3933|  44.6k|        {
 3934|       |            /* Issue #572 - A <ol><li> can have nested <ol> elements */
 3935|  44.6k|            foundLI = FindLastLI(list, &lastli); /* find last <li> */
 3936|  44.6k|        }
 3937|       |
 3938|  62.5k|        if ( nodeIsLI(node) || (TY_(IsHTML5Mode)(doc) && !foundLI) )
  ------------------
  |  |  390|  62.5k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|   125k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 62.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 54.7k, False: 7.78k]
  |  |  |  |  |  Branch (275:54): [True: 4.55k, False: 50.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsLI(node) || (TY_(IsHTML5Mode)(doc) && !foundLI) )
  ------------------
  |  |   23|  57.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3938:33): [True: 15.2k, False: 42.7k]
  |  Branch (3938:58): [True: 15.2k, False: 0]
  ------------------
 3939|  19.7k|        {
 3940|       |            /* node is <LI> OR
 3941|       |               Issue #396 - A <ul> can have Zero or more <li> elements
 3942|       |             */
 3943|  19.7k|            TY_(InsertNodeAtEnd)(list,node);
  ------------------
  |  |   23|  19.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3944|  19.7k|        }
 3945|  42.7k|        else
 3946|  42.7k|        {
 3947|  42.7k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  42.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3948|       |
 3949|  42.7k|            if (TY_(nodeHasCM)(node,CM_BLOCK) && lexer->excludeBlocks)
  ------------------
  |  |   23|  42.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(nodeHasCM)(node,CM_BLOCK) && lexer->excludeBlocks)
  ------------------
  |  |  142|  42.7k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (3949:17): [True: 36.2k, False: 6.50k]
  |  Branch (3949:50): [True: 1.34k, False: 34.9k]
  ------------------
 3950|  1.34k|            {
 3951|  1.34k|                TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3952|  1.34k|                DEBUG_LOG_EXIT;
 3953|  1.34k|                return NULL;
 3954|  1.34k|            }
 3955|       |            /* http://tidy.sf.net/issue/1316307 */
 3956|       |            /* In exiled mode, return so table processing can continue. */
 3957|  41.4k|            else if ( lexer->exiled
  ------------------
  |  Branch (3957:23): [True: 20.3k, False: 21.1k]
  ------------------
 3958|  20.3k|                      && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |   23|  20.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                    && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |  146|  20.3k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                    && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |  147|  20.3k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
                                    && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |  148|  20.3k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (3958:27): [True: 588, False: 19.7k]
  ------------------
 3959|  20.3k|                          || nodeIsTABLE(node)) )
  ------------------
  |  |  393|  19.7k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  19.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 19.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 18.2k, False: 1.43k]
  |  |  |  |  |  Branch (275:54): [True: 279, False: 18.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3960|    867|            {
 3961|    867|                DEBUG_LOG_EXIT;
 3962|    867|                return NULL;
 3963|    867|            }
 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|  40.5k|            if ( nodeIsOL(list) && FindLastLI(list, &lastli) )
  ------------------
  |  |  387|  40.5k|#define nodeIsOL( node )         TagIsId( node, TidyTag_OL )
  |  |  ------------------
  |  |  |  |  275|  81.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 40.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 40.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 37.4k, False: 3.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3968:36): [True: 946, False: 36.5k]
  ------------------
 3969|    946|            {
 3970|       |                /* Create a node for error reporting */
 3971|    946|                node = TY_(InferredTag)(doc, TidyTag_LI);
  ------------------
  |  |   23|    946|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    946|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3972|    946|                TY_(Report)(doc, list, node, MISSING_STARTTAG );
  ------------------
  |  |   23|    946|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    946|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3973|    946|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    946|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    946|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3974|    946|                node = lastli;
 3975|    946|            }
 3976|  39.6k|            else
 3977|  39.6k|            {
 3978|       |                /* Add an inferred <li> */
 3979|  39.6k|                wasblock = TY_(nodeHasCM)(node,CM_BLOCK);
  ------------------
  |  |   23|  39.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              wasblock = TY_(nodeHasCM)(node,CM_BLOCK);
  ------------------
  |  |  142|  39.6k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
 3980|  39.6k|                node = TY_(InferredTag)(doc, TidyTag_LI);
  ------------------
  |  |   23|  39.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.6k|#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|  39.6k|                TY_(AddStyleProperty)( doc, node,
  ------------------
  |  |   23|  39.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3984|  39.6k|                                       wasblock
  ------------------
  |  Branch (3984:40): [True: 34.5k, False: 5.02k]
  ------------------
 3985|  39.6k|                                       ? "list-style: none; display: inline"
 3986|  39.6k|                                       : "list-style: none"
 3987|  39.6k|                                       );
 3988|  39.6k|                TY_(Report)(doc, list, node, MISSING_STARTTAG );
  ------------------
  |  |   23|  39.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3989|  39.6k|                TY_(InsertNodeAtEnd)(list,node);
  ------------------
  |  |   23|  39.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3990|  39.6k|            }
 3991|  40.5k|        }
 3992|       |
 3993|  60.3k|        {
 3994|  60.3k|            TidyParserMemory memory = {0};
 3995|  60.3k|            memory.identity = TY_(ParseList);
  ------------------
  |  |   23|  60.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3996|  60.3k|            memory.original_node = list;
 3997|  60.3k|            memory.reentry_node = node;
 3998|  60.3k|            memory.mode = IgnoreWhitespace;
 3999|  60.3k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  60.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4000|  60.3k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 4001|  60.3k|            return node;
 4002|  62.5k|        }
 4003|  62.5k|    }
 4004|       |
 4005|  48.7k|    TY_(Report)(doc, list, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  48.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  48.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4006|  48.7k|    DEBUG_LOG_EXIT;
 4007|       |    return NULL;
 4008|   111k|}
prvTidyParseNamespace:
 4028|  7.03k|{
 4029|  7.03k|    Lexer* lexer = doc->lexer;
 4030|  7.03k|    Node *node;
 4031|  7.03k|    Node *parent = basenode;
 4032|  7.03k|    uint istackbase;
 4033|  7.03k|    AttVal* av; /* #130 MathML attr and entity fix! */
 4034|       |
 4035|       |    /* a la <table>: defer popping elements off the inline stack */
 4036|  7.03k|    TY_(DeferDup)( doc );
  ------------------
  |  |   23|  7.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4037|  7.03k|    istackbase = lexer->istackbase;
 4038|  7.03k|    lexer->istackbase = lexer->istacksize;
 4039|       |
 4040|  7.03k|    mode = OtherNamespace; /* Preformatted; IgnoreWhitespace; */
 4041|       |
 4042|  78.8k|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|  78.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  78.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4042:12): [True: 72.0k, False: 6.77k]
  ------------------
 4043|  72.0k|    {
 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|  72.0k|        if (node->type == EndTag)
  ------------------
  |  Branch (4053:13): [True: 4.22k, False: 67.8k]
  ------------------
 4054|  4.22k|        {
 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|  4.22k|            Bool outside;
 4062|  4.22k|            Node *mp = FindMatchingDescendant(parent, node, basenode, &outside);
 4063|       |
 4064|  4.22k|            if (mp != NULL)
  ------------------
  |  Branch (4064:17): [True: 2.82k, False: 1.40k]
  ------------------
 4065|  2.82k|            {
 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|  2.82k|                Node *n;
 4072|       |
 4073|  2.82k|                for (n = parent;
 4074|  4.19k|                     n != NULL && n != basenode->parent && n != mp;
  ------------------
  |  Branch (4074:22): [True: 4.19k, False: 0]
  |  Branch (4074:35): [True: 3.82k, False: 378]
  |  Branch (4074:60): [True: 1.37k, False: 2.44k]
  ------------------
 4075|  2.82k|                     n = n->parent)
 4076|  1.37k|                {
 4077|       |                    /* n->implicit = yes; */
 4078|  1.37k|                    n->closed = yes;
 4079|  1.37k|                    TY_(Report)(doc, n->parent, n, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4080|  1.37k|                }
 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|  2.82k|                if (outside == no)
  ------------------
  |  Branch (4089:21): [True: 2.82k, False: 0]
  ------------------
 4090|  2.82k|                {
 4091|       |                    /* EndTag for a node within the basenode subtree. Roll on... */
 4092|  2.82k|                    if (n)
  ------------------
  |  Branch (4092:25): [True: 2.82k, False: 0]
  ------------------
 4093|  2.82k|                        n->closed = yes;
 4094|  2.82k|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  2.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4095|       |
 4096|  2.82k|                    node = n;
 4097|  2.82k|                    parent = node ? node->parent : NULL;
  ------------------
  |  Branch (4097:30): [True: 2.82k, False: 0]
  ------------------
 4098|  2.82k|                }
 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|  2.82k|                if (node == basenode)
  ------------------
  |  Branch (4108:21): [True: 260, False: 2.56k]
  ------------------
 4109|    260|                {
 4110|    260|                    lexer->istackbase = istackbase;
 4111|    260|                    assert(basenode && basenode->closed == yes);
  ------------------
  |  Branch (4111:21): [True: 0, False: 260]
  |  Branch (4111:21): [True: 0, False: 0]
  |  Branch (4111:21): [True: 260, False: 0]
  |  Branch (4111:21): [True: 260, False: 0]
  ------------------
 4112|    260|                    return NULL;
 4113|    260|                }
 4114|  2.82k|            }
 4115|  1.40k|            else
 4116|  1.40k|            {
 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.40k|                TY_(Report)(doc, parent, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4120|  1.40k|                assert(parent);
  ------------------
  |  Branch (4120:17): [True: 0, False: 1.40k]
  |  Branch (4120:17): [True: 1.40k, False: 0]
  ------------------
 4121|       |                /* assert(parent->tag != node->tag); Issue #308 - Seems would always be true! */
 4122|  1.40k|                TY_(FreeNode)( doc, node); /* Issue #308 - Discard unexpected end tag memory */
  ------------------
  |  |   23|  1.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4123|  1.40k|            }
 4124|  4.22k|        }
 4125|  67.8k|        else if (node->type == StartTag)
  ------------------
  |  Branch (4125:18): [True: 29.5k, False: 38.2k]
  ------------------
 4126|  29.5k|        {
 4127|       |            /* #130 MathML attr and entity fix!
 4128|       |               care if it has attributes, and 'accidently' any of those attributes match known */
 4129|  57.1k|            for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (4129:42): [True: 27.6k, False: 29.5k]
  ------------------
 4130|  27.6k|            {
 4131|  27.6k|                av->dict = 0; /* does something need to be freed? */
 4132|  27.6k|            }
 4133|       |            /* add another child to the current parent */
 4134|  29.5k|            TY_(InsertNodeAtEnd)(parent, node);
  ------------------
  |  |   23|  29.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4135|  29.5k|            parent = node;
 4136|  29.5k|        }
 4137|  38.2k|        else
 4138|  38.2k|        {
 4139|       |            /* #130 MathML attr and entity fix!
 4140|       |               care if it has attributes, and 'accidently' any of those attributes match known */
 4141|  55.4k|            for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (4141:42): [True: 17.1k, False: 38.2k]
  ------------------
 4142|  17.1k|            {
 4143|  17.1k|                av->dict = 0; /* does something need to be freed? */
 4144|  17.1k|            }
 4145|  38.2k|            TY_(InsertNodeAtEnd)(parent, node);
  ------------------
  |  |   23|  38.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4146|  38.2k|        }
 4147|  72.0k|    }
 4148|       |
 4149|  6.77k|    TY_(Report)(doc, basenode->parent, basenode, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  6.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4150|       |    return NULL;
 4151|  7.03k|}
prvTidyParseNoFrames:
 4163|  32.3k|{
 4164|  32.3k|    Lexer* lexer = doc->lexer;
 4165|  32.3k|    Node *node = NULL;
 4166|  32.3k|    Bool body_seen = no;
 4167|  32.3k|    DEBUG_LOG_COUNTERS;
 4168|       |
 4169|  32.3k|    enum parserState {
 4170|  32.3k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4171|  32.3k|        STATE_POST_NODEISBODY,        /* To-do after re-entering after checks. */
 4172|  32.3k|        STATE_COMPLETE,               /* Done with the switch. */
 4173|  32.3k|    } 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|  32.3k|    if ( noframes == NULL )
  ------------------
  |  Branch (4180:10): [True: 16.8k, False: 15.5k]
  ------------------
 4181|  16.8k|    {
 4182|  16.8k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4183|  16.8k|        node = memory.reentry_node; /* Throwaway, because we replace it entering the loop anyway.*/
 4184|  16.8k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4185|  16.8k|        noframes = memory.original_node;
 4186|  16.8k|        state = memory.reentry_state;
 4187|  16.8k|        body_seen = memory.register_1;
 4188|  16.8k|        DEBUG_LOG_GET_OLD_MODE;
 4189|  16.8k|        mode = memory.mode;
 4190|  16.8k|        DEBUG_LOG_CHANGE_MODE;
 4191|  16.8k|    }
 4192|  15.5k|    else
 4193|  15.5k|    {
 4194|  15.5k|        DEBUG_LOG_ENTER_WITH_NODE(noframes);
 4195|  15.5k|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  15.5k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (4195:14): [True: 15.5k, False: 0]
  ------------------
 4196|  15.5k|        {
 4197|  15.5k|            doc->badAccess |=  BA_USING_NOFRAMES;
  ------------------
  |  |  285|  15.5k|#define BA_USING_NOFRAMES          32
  ------------------
 4198|  15.5k|        }
 4199|  15.5k|    }
 4200|       |
 4201|  32.3k|    mode = IgnoreWhitespace;
 4202|       |
 4203|  51.3k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4203:13): [True: 40.2k, False: 11.1k]
  ------------------
 4204|  40.2k|    {
 4205|  40.2k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4205:14): [True: 37.2k, False: 2.95k]
  ------------------
 4206|  37.2k|        {
 4207|  37.2k|            node = TY_(GetToken)(doc, mode);
  ------------------
  |  |   23|  37.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4208|  37.2k|            DEBUG_LOG_GOT_TOKEN(node);
 4209|  37.2k|        }
 4210|       |        
 4211|  40.2k|        switch ( state )
 4212|  40.2k|        {
 4213|  37.2k|            case STATE_INITIAL:
  ------------------
  |  Branch (4213:13): [True: 37.2k, False: 2.95k]
  ------------------
 4214|  37.2k|            {
 4215|  37.2k|                if ( node == NULL )
  ------------------
  |  Branch (4215:22): [True: 11.1k, False: 26.1k]
  ------------------
 4216|  11.1k|                {
 4217|  11.1k|                    state = STATE_COMPLETE;
 4218|  11.1k|                    continue;
 4219|  11.1k|                }
 4220|       |                
 4221|  26.1k|                if ( node->tag == noframes->tag && node->type == EndTag )
  ------------------
  |  Branch (4221:22): [True: 8.63k, False: 17.4k]
  |  Branch (4221:52): [True: 264, False: 8.36k]
  ------------------
 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|  25.8k|                if ( nodeIsFRAME(node) || nodeIsFRAMESET(node) )
  ------------------
  |  |  377|  25.8k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|  51.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 25.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 18.7k, False: 7.09k]
  |  |  |  |  |  Branch (275:54): [True: 1.02k, False: 17.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( nodeIsFRAME(node) || nodeIsFRAMESET(node) )
  ------------------
  |  |  376|  24.8k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  24.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 24.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.7k, False: 7.09k]
  |  |  |  |  |  Branch (275:54): [True: 1.33k, False: 16.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4231|  2.36k|                {
 4232|  2.36k|                    TrimSpaces(doc, noframes);
 4233|  2.36k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4233:25): [True: 562, False: 1.80k]
  ------------------
 4234|    562|                    {
 4235|    562|                        TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    562|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    562|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4236|    562|                        TY_(FreeNode)( doc, node);       /* Throw it away */
  ------------------
  |  |   23|    562|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    562|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4237|    562|                    }
 4238|  1.80k|                    else
 4239|  1.80k|                    {
 4240|  1.80k|                        TY_(Report)(doc, noframes, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4241|  1.80k|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4242|  1.80k|                    }
 4243|  2.36k|                    DEBUG_LOG_EXIT;
 4244|  2.36k|                    return NULL;
 4245|  2.36k|                }
 4246|       |
 4247|  23.5k|                if ( nodeIsHTML(node) )
  ------------------
  |  |  370|  23.5k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  23.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 23.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 16.4k, False: 7.09k]
  |  |  |  |  |  Branch (275:54): [True: 468, False: 15.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4248|    468|                {
 4249|    468|                    if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|    468|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    468|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4249:25): [True: 257, False: 211]
  ------------------
 4250|    257|                        TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    257|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    257|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4251|       |
 4252|    468|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    468|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    468|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4253|    468|                    continue;
 4254|    468|                }
 4255|       |
 4256|       |                /* deal with comments etc. */
 4257|  23.0k|                if (InsertMisc(noframes, node))
  ------------------
  |  Branch (4257:21): [True: 421, False: 22.6k]
  ------------------
 4258|    421|                    continue;
 4259|       |
 4260|  22.6k|                if ( nodeIsBODY(node) && node->type == StartTag )
  ------------------
  |  |  375|  22.6k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  45.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 22.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 15.9k, False: 6.67k]
  |  |  |  |  |  Branch (275:54): [True: 3.52k, False: 12.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4260:42): [True: 3.31k, False: 215]
  ------------------
 4261|  3.31k|                {
 4262|  3.31k|                    TidyParserMemory memory = {0};
 4263|  3.31k|                    memory.identity = TY_(ParseNoFrames);
  ------------------
  |  |   23|  3.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4264|  3.31k|                    memory.original_node = noframes;
 4265|  3.31k|                    memory.reentry_node = node;
 4266|  3.31k|                    memory.reentry_state = STATE_POST_NODEISBODY;
 4267|  3.31k|                    memory.register_1 = lexer->seenEndBody;
 4268|  3.31k|                    memory.mode = IgnoreWhitespace;
 4269|       |
 4270|  3.31k|                    TY_(InsertNodeAtEnd)(noframes, node);
  ------------------
  |  |   23|  3.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4271|  3.31k|                    TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  3.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4272|  3.31k|                    DEBUG_LOG_EXIT_WITH_NODE(node);
 4273|  3.31k|                    return node;
 4274|  3.31k|                }
 4275|       |
 4276|       |                /* implicit body element inferred */
 4277|  19.3k|                if (TY_(nodeIsText)(node) || (node->tag && node->type != EndTag))
  ------------------
  |  |   23|  19.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4277:21): [True: 3.17k, False: 16.1k]
  |  Branch (4277:47): [True: 12.6k, False: 3.50k]
  |  Branch (4277:60): [True: 12.3k, False: 257]
  ------------------
 4278|  15.5k|                {
 4279|  15.5k|                    Node *body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  15.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4280|  15.5k|                    if ( body || lexer->seenEndBody )
  ------------------
  |  Branch (4280:26): [True: 9.57k, False: 5.96k]
  |  Branch (4280:34): [True: 241, False: 5.72k]
  ------------------
 4281|  9.81k|                    {
 4282|  9.81k|                        if ( body == NULL )
  ------------------
  |  Branch (4282:30): [True: 241, False: 9.57k]
  ------------------
 4283|    241|                        {
 4284|    241|                            TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    241|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    241|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4285|    241|                            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    241|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    241|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4286|    241|                            continue;
 4287|    241|                        }
 4288|  9.57k|                        if ( TY_(nodeIsText)(node) )
  ------------------
  |  |   23|  9.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4288:30): [True: 2.47k, False: 7.10k]
  ------------------
 4289|  2.47k|                        {
 4290|  2.47k|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4291|  2.47k|                            node = TY_(InferredTag)(doc, TidyTag_P);
  ------------------
  |  |   23|  2.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4292|  2.47k|                            TY_(Report)(doc, noframes, node, CONTENT_AFTER_BODY );
  ------------------
  |  |   23|  2.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4293|  2.47k|                        }
 4294|  9.57k|                        TY_(InsertNodeAtEnd)( body, node );
  ------------------
  |  |   23|  9.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4295|  9.57k|                    }
 4296|  5.72k|                    else
 4297|  5.72k|                    {
 4298|  5.72k|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  5.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4299|  5.72k|                        node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|  5.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4300|  5.72k|                        if ( cfgBool(doc, TidyXmlOut) )
  ------------------
  |  |  418|  5.72k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.72k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 5.72k, False: 0]
  |  |  ------------------
  ------------------
 4301|  5.72k|                            TY_(Report)(doc, noframes, node, INSERTING_TAG);
  ------------------
  |  |   23|  5.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4302|  5.72k|                        TY_(InsertNodeAtEnd)( noframes, node );
  ------------------
  |  |   23|  5.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4303|  5.72k|                    }
 4304|       |
 4305|  15.3k|                    {
 4306|  15.3k|                        TidyParserMemory memory = {0};
 4307|  15.3k|                        memory.identity = TY_(ParseNoFrames);
  ------------------
  |  |   23|  15.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4308|  15.3k|                        memory.original_node = noframes;
 4309|  15.3k|                        memory.reentry_node = node;
 4310|  15.3k|                        memory.mode = IgnoreWhitespace; /*MixedContent*/
 4311|  15.3k|                        memory.reentry_state = STATE_INITIAL;
 4312|  15.3k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  15.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4313|  15.3k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 4314|  15.3k|                        return node;
 4315|  15.5k|                    }
 4316|  15.5k|                }
 4317|       |
 4318|       |                /* discard unexpected end tags */
 4319|  3.75k|                TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  3.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4320|  3.75k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  3.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4321|  3.75k|            } break;
 4322|       |                
 4323|       |                
 4324|  2.95k|            case STATE_POST_NODEISBODY:
  ------------------
  |  Branch (4324:13): [True: 2.95k, False: 37.2k]
  ------------------
 4325|  2.95k|            {
 4326|       |                /* fix for bug http://tidy.sf.net/bug/887259 */
 4327|  2.95k|                if (body_seen && TY_(FindBody)(doc) != node)
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4327:21): [True: 1.24k, False: 1.71k]
  |  Branch (4327:34): [True: 1.23k, False: 2]
  ------------------
 4328|  1.23k|                {
 4329|  1.23k|                    TY_(CoerceNode)(doc, node, TidyTag_DIV, no, no);
  ------------------
  |  |   23|  1.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4330|  1.23k|                    MoveNodeToBody(doc, node);
 4331|  1.23k|                }
 4332|  2.95k|                state = STATE_INITIAL;
 4333|  2.95k|                continue;
 4334|       |
 4335|  19.3k|            } break;
 4336|       |                
 4337|       |                
 4338|      0|            default:
  ------------------
  |  Branch (4338:13): [True: 0, False: 40.2k]
  ------------------
 4339|      0|                break;
 4340|  40.2k|        } /* switch */
 4341|  40.2k|    } /* while */
 4342|       |
 4343|  11.1k|    TY_(Report)(doc, noframes, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  11.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4344|  11.1k|    DEBUG_LOG_EXIT;
 4345|       |    return NULL;
 4346|  32.3k|}
prvTidyParseOptGroup:
 4358|  11.9k|{
 4359|  11.9k|    Lexer* lexer = doc->lexer;
 4360|  11.9k|    Node *node;
 4361|  11.9k|    DEBUG_LOG_COUNTERS;
 4362|       |    
 4363|  11.9k|    if ( field == NULL )
  ------------------
  |  Branch (4363:10): [True: 5.74k, False: 6.17k]
  ------------------
 4364|  5.74k|    {
 4365|  5.74k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  5.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4366|  5.74k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4367|  5.74k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4368|  5.74k|        field = memory.original_node;
 4369|  5.74k|        DEBUG_LOG_GET_OLD_MODE;
 4370|  5.74k|        mode = memory.mode;
 4371|  5.74k|        DEBUG_LOG_CHANGE_MODE;
 4372|  5.74k|    }
 4373|  6.17k|    else
 4374|  6.17k|    {
 4375|  6.17k|        DEBUG_LOG_ENTER_WITH_NODE(field);
 4376|  6.17k|    }
 4377|       |    
 4378|  11.9k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 4379|       |
 4380|  14.4k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  14.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4380:12): [True: 8.68k, False: 5.76k]
  ------------------
 4381|  8.68k|    {
 4382|  8.68k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (4382:13): [True: 5.76k, False: 2.92k]
  |  Branch (4382:40): [True: 405, False: 5.36k]
  ------------------
 4383|    405|        {
 4384|    405|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    405|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    405|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4385|    405|            field->closed = yes;
 4386|    405|            TrimSpaces(doc, field);
 4387|    405|            DEBUG_LOG_EXIT;
 4388|    405|            return NULL;
 4389|    405|        }
 4390|       |
 4391|       |        /* deal with comments etc. */
 4392|  8.28k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (4392:13): [True: 632, False: 7.64k]
  ------------------
 4393|    632|            continue;
 4394|       |
 4395|  7.64k|        if ( node->type == StartTag &&
  ------------------
  |  Branch (4395:14): [True: 6.74k, False: 908]
  ------------------
 4396|  6.74k|             (nodeIsOPTION(node) || nodeIsOPTGROUP(node)) )
  ------------------
  |  |  410|  6.74k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  13.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.74k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.27k, False: 466]
  |  |  |  |  |  Branch (275:54): [True: 387, False: 5.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                           (nodeIsOPTION(node) || nodeIsOPTGROUP(node)) )
  ------------------
  |  |  411|  6.35k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  6.35k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.35k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.88k, False: 466]
  |  |  |  |  |  Branch (275:54): [True: 5.36k, False: 527]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4397|  5.74k|        {
 4398|  5.74k|            TidyParserMemory memory = {0};
 4399|       |
 4400|  5.74k|            if ( nodeIsOPTGROUP(node) )
  ------------------
  |  |  411|  5.74k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  5.74k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.74k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.74k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.36k, False: 387]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4401|  5.36k|                TY_(Report)(doc, field, node, CANT_BE_NESTED);
  ------------------
  |  |   23|  5.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4402|       |
 4403|  5.74k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  5.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4404|       |
 4405|  5.74k|            memory.identity = TY_(ParseOptGroup);
  ------------------
  |  |   23|  5.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4406|  5.74k|            memory.original_node = field;
 4407|  5.74k|            memory.reentry_node = node;
 4408|  5.74k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  5.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4409|  5.74k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 4410|  5.74k|            return node;
 4411|  5.74k|        }
 4412|       |
 4413|       |        /* discard unexpected tags */
 4414|  1.90k|        TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  1.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4415|  1.90k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.90k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.90k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4416|  1.90k|    }
 4417|  5.76k|    DEBUG_LOG_EXIT;
 4418|       |    return NULL;
 4419|  11.9k|}
prvTidyParsePre:
 4431|   124k|{
 4432|   124k|    Node *node = NULL;
 4433|   124k|    DEBUG_LOG_COUNTERS;
 4434|       |
 4435|   124k|    enum parserState {
 4436|   124k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4437|   124k|        STATE_RENTRY_ACTION,          /* To-do after re-entering after checks. */
 4438|   124k|        STATE_COMPLETE,               /* Done with the switch. */
 4439|   124k|    } state = STATE_INITIAL;
 4440|       |
 4441|       |
 4442|   124k|    if ( pre == NULL )
  ------------------
  |  Branch (4442:10): [True: 44.6k, False: 80.0k]
  ------------------
 4443|  44.6k|    {
 4444|  44.6k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  44.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4445|  44.6k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4446|  44.6k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4447|  44.6k|        pre = memory.original_node;
 4448|  44.6k|        state = memory.reentry_state;
 4449|  44.6k|        DEBUG_LOG_GET_OLD_MODE;
 4450|  44.6k|        mode = memory.mode;
 4451|  44.6k|        DEBUG_LOG_CHANGE_MODE;
 4452|  44.6k|    }
 4453|  80.0k|    else
 4454|  80.0k|    {
 4455|  80.0k|        DEBUG_LOG_ENTER_WITH_NODE(pre);
 4456|  80.0k|        if (pre->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  80.0k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (4456:13): [True: 0, False: 80.0k]
  ------------------
 4457|      0|        {
 4458|      0|            DEBUG_LOG_EXIT;
 4459|      0|            return NULL;
 4460|      0|        }
 4461|  80.0k|    }
 4462|       |
 4463|   124k|    TY_(InlineDup)( doc, NULL ); /* tell lexer to insert inlines if needed */
  ------------------
  |  |   23|   124k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   124k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4464|       |
 4465|   183k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4465:13): [True: 179k, False: 3.65k]
  ------------------
 4466|   179k|    {
 4467|   179k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4467:14): [True: 137k, False: 42.3k]
  ------------------
 4468|   137k|            node = TY_(GetToken)(doc, Preformatted);
  ------------------
  |  |   23|   137k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   137k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4469|       |        
 4470|   179k|        switch ( state )
 4471|   179k|        {
 4472|   137k|            case STATE_INITIAL:
  ------------------
  |  Branch (4472:13): [True: 137k, False: 42.3k]
  ------------------
 4473|   137k|            {
 4474|   137k|                if ( node == NULL )
  ------------------
  |  Branch (4474:22): [True: 3.65k, False: 133k]
  ------------------
 4475|  3.65k|                {
 4476|  3.65k|                    state = STATE_COMPLETE;
 4477|  3.65k|                    continue;
 4478|  3.65k|                }
 4479|       |                
 4480|   133k|                if ( node->type == EndTag &&
  ------------------
  |  Branch (4480:22): [True: 3.28k, False: 130k]
  ------------------
 4481|  3.28k|                     (node->tag == pre->tag || DescendantOf(pre, TagId(node))) )
  ------------------
  |  |  270|  2.86k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 2.86k, False: 0]
  |  |  |  Branch (270:39): [True: 2.55k, False: 310]
  |  |  ------------------
  ------------------
  |  Branch (4481:23): [True: 420, False: 2.86k]
  |  Branch (4481:48): [True: 997, False: 1.86k]
  ------------------
 4482|  1.41k|                {
 4483|  1.41k|                    if (nodeIsBODY(node) || nodeIsHTML(node))
  ------------------
  |  |  375|  1.41k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  2.83k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.41k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.41k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 200, False: 1.21k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if (nodeIsBODY(node) || nodeIsHTML(node))
  ------------------
  |  |  370|  1.21k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  1.21k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.21k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.21k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 275, False: 942]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4484|    475|                    {
 4485|    475|                        TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    475|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    475|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4486|    475|                        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    475|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    475|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4487|    475|                        continue;
 4488|    475|                    }
 4489|    942|                    if (node->tag == pre->tag)
  ------------------
  |  Branch (4489:25): [True: 420, False: 522]
  ------------------
 4490|    420|                    {
 4491|    420|                        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    420|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    420|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4492|    420|                    }
 4493|    522|                    else
 4494|    522|                    {
 4495|    522|                        TY_(Report)(doc, pre, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|    522|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    522|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4496|    522|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    522|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    522|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4497|    522|                    }
 4498|    942|                    pre->closed = yes;
 4499|    942|                    TrimSpaces(doc, pre);
 4500|    942|                    DEBUG_LOG_EXIT;
 4501|    942|                    return NULL;
 4502|  1.41k|                }
 4503|       |
 4504|   132k|                if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|   132k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   132k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4504:21): [True: 3.16k, False: 129k]
  ------------------
 4505|  3.16k|                {
 4506|  3.16k|                    TY_(InsertNodeAtEnd)(pre, node);
  ------------------
  |  |   23|  3.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4507|  3.16k|                    continue;
 4508|  3.16k|                }
 4509|       |
 4510|       |                /* deal with comments etc. */
 4511|   129k|                if (InsertMisc(pre, node))
  ------------------
  |  Branch (4511:21): [True: 256, False: 128k]
  ------------------
 4512|    256|                    continue;
 4513|       |
 4514|   128k|                if (node->tag == NULL)
  ------------------
  |  Branch (4514:21): [True: 3.10k, False: 125k]
  ------------------
 4515|  3.10k|                {
 4516|  3.10k|                    TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  3.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4517|  3.10k|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  3.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4518|  3.10k|                    continue;
 4519|  3.10k|                }
 4520|       |
 4521|       |                /* strip unexpected tags */
 4522|   125k|                if ( !PreContent(doc, node) )
  ------------------
  |  Branch (4522:22): [True: 118k, False: 7.36k]
  ------------------
 4523|   118k|                {
 4524|       |                    /* fix for http://tidy.sf.net/bug/772205 */
 4525|   118k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4525:25): [True: 1.13k, False: 117k]
  ------------------
 4526|  1.13k|                    {
 4527|       |                        /* http://tidy.sf.net/issue/1590220 */
 4528|  1.13k|                       if ( doc->lexer->exiled
  ------------------
  |  Branch (4528:29): [True: 772, False: 363]
  ------------------
 4529|    772|                           && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |   23|    772|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    772|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                         && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  146|    772|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                         && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  393|    533|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|    533|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 533, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 533, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 250, False: 283]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4529:32): [True: 239, False: 533]
  ------------------
 4530|    489|                       {
 4531|    489|                          TY_(UngetToken)(doc);
  ------------------
  |  |   23|    489|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    489|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4532|    489|                          TrimSpaces(doc, pre);
 4533|    489|                           DEBUG_LOG_EXIT;
 4534|    489|                          return NULL;
 4535|    489|                       }
 4536|       |
 4537|    646|                       TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    646|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    646|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4538|    646|                       TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    646|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    646|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4539|    646|                       continue;
 4540|  1.13k|                    }
 4541|       |                    /* http://tidy.sf.net/issue/1590220 */
 4542|   117k|                    else if (TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)
  ------------------
  |  |   23|   117k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   117k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  else if (TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)
  ------------------
  |  |  146|   117k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                  else if (TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)
  ------------------
  |  |  148|   117k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (4542:30): [True: 967, False: 116k]
  ------------------
 4543|   116k|                             || nodeIsTABLE(node) )
  ------------------
  |  |  393|   116k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|   116k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 116k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 116k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 35.1k, False: 81.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4544|  36.1k|                    {
 4545|  36.1k|                        if (!doc->lexer->exiled)
  ------------------
  |  Branch (4545:29): [True: 35.3k, False: 742]
  ------------------
 4546|       |                            /* No missing close warning if exiled. */
 4547|  35.3k|                            TY_(Report)(doc, pre, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  35.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4548|       |
 4549|  36.1k|                        TY_(UngetToken)(doc);
  ------------------
  |  |   23|  36.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4550|  36.1k|                        DEBUG_LOG_EXIT;
 4551|  36.1k|                        return NULL;
 4552|  36.1k|                    }
 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|  81.2k|                    TY_(InsertNodeAfterElement)(pre, node);
  ------------------
  |  |   23|  81.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  81.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4592|  81.2k|                    TY_(Report)(doc, pre, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  81.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  81.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4593|       |                    
 4594|  81.2k|                    {
 4595|  81.2k|                        TidyParserMemory memory = {0};
 4596|  81.2k|                        memory.identity = TY_(ParsePre);
  ------------------
  |  |   23|  81.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  81.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4597|  81.2k|                        memory.original_node = pre;
 4598|  81.2k|                        memory.reentry_node = node;
 4599|  81.2k|                        memory.reentry_state = STATE_RENTRY_ACTION;
 4600|  81.2k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  81.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  81.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4601|  81.2k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 4602|  81.2k|                        return node;
 4603|   118k|                    }
 4604|   118k|                }
 4605|       |
 4606|  7.36k|                if ( nodeIsP(node) )
  ------------------
  |  |  385|  7.36k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  7.36k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.36k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 7.36k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.85k, False: 2.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4607|  4.85k|                {
 4608|  4.85k|                    if (node->type == StartTag)
  ------------------
  |  Branch (4608:25): [True: 4.64k, False: 208]
  ------------------
 4609|  4.64k|                    {
 4610|  4.64k|                        TY_(Report)(doc, pre, node, USING_BR_INPLACE_OF);
  ------------------
  |  |   23|  4.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4611|       |
 4612|       |                        /* trim white space before <p> in <pre>*/
 4613|  4.64k|                        TrimSpaces(doc, pre);
 4614|       |
 4615|       |                        /* coerce both <p> and </p> to <br> */
 4616|  4.64k|                        TY_(CoerceNode)(doc, node, TidyTag_BR, no, no);
  ------------------
  |  |   23|  4.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4617|  4.64k|                        TY_(FreeAttrs)( doc, node ); /* discard align attribute etc. */
  ------------------
  |  |   23|  4.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4618|  4.64k|                        TY_(InsertNodeAtEnd)( pre, node );
  ------------------
  |  |   23|  4.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4619|  4.64k|                    }
 4620|    208|                    else
 4621|    208|                    {
 4622|    208|                        TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    208|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    208|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4623|    208|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    208|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    208|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4624|    208|                    }
 4625|  4.85k|                    continue;
 4626|  4.85k|                }
 4627|       |
 4628|  2.50k|                if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  2.50k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.50k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4628:22): [True: 2.29k, False: 213]
  ------------------
 4629|  2.29k|                {
 4630|       |                    /* trim white space before <br> */
 4631|  2.29k|                    if ( nodeIsBR(node) )
  ------------------
  |  |  400|  2.29k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  2.29k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.29k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.29k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 221, False: 2.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4632|    221|                        TrimSpaces(doc, pre);
 4633|       |
 4634|  2.29k|                    TY_(InsertNodeAtEnd)(pre, node);
  ------------------
  |  |   23|  2.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4635|       |                    
 4636|  2.29k|                    {
 4637|  2.29k|                        TidyParserMemory memory = {0};
 4638|  2.29k|                        memory.identity = TY_(ParsePre);
  ------------------
  |  |   23|  2.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4639|  2.29k|                        memory.original_node = pre;
 4640|  2.29k|                        memory.reentry_node = node;
 4641|  2.29k|                        memory.reentry_state = STATE_INITIAL;
 4642|  2.29k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  2.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4643|  2.29k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 4644|  2.29k|                        return node;
 4645|  2.29k|                    }
 4646|  2.29k|                }
 4647|       |
 4648|       |                /* discard unexpected tags */
 4649|    213|                TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    213|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    213|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4650|    213|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    213|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    213|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4651|    213|            } break;
 4652|       |                
 4653|  42.3k|            case STATE_RENTRY_ACTION:
  ------------------
  |  Branch (4653:13): [True: 42.3k, False: 137k]
  ------------------
 4654|  42.3k|            {
 4655|  42.3k|                Node* newnode = TY_(InferredTag)(doc, TidyTag_PRE);
  ------------------
  |  |   23|  42.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4656|  42.3k|                TY_(Report)(doc, pre, newnode, INSERTING_TAG);
  ------------------
  |  |   23|  42.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4657|  42.3k|                pre = newnode;
 4658|  42.3k|                TY_(InsertNodeAfterElement)(node, pre);
  ------------------
  |  |   23|  42.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4659|  42.3k|                state = STATE_INITIAL;
 4660|  42.3k|                continue;
 4661|  2.50k|            } break;
 4662|       |            
 4663|      0|            default:
  ------------------
  |  Branch (4663:13): [True: 0, False: 179k]
  ------------------
 4664|      0|                break;
 4665|       |
 4666|   179k|        } /* switch */
 4667|   179k|    } /* while */
 4668|       |
 4669|  3.65k|    TY_(Report)(doc, pre, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  3.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4670|  3.65k|    DEBUG_LOG_EXIT;
 4671|       |    return NULL;
 4672|   124k|}
prvTidyParseRow:
 4684|  29.6k|{
 4685|  29.6k|    Lexer* lexer = doc->lexer;
 4686|  29.6k|    Node *node = NULL;
 4687|  29.6k|    Bool exclude_state = no;
 4688|  29.6k|    DEBUG_LOG_COUNTERS;
 4689|       |
 4690|  29.6k|    enum parserState {
 4691|  29.6k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4692|  29.6k|        STATE_POST_NOT_ENDTAG,        /* To-do after re-entering after !EndTag checks. */
 4693|  29.6k|        STATE_POST_TD_TH,             /* To-do after re-entering after TD/TH checks. */
 4694|  29.6k|        STATE_COMPLETE,               /* Done with the switch. */
 4695|  29.6k|    } state = STATE_INITIAL;
 4696|       |
 4697|  29.6k|    if ( row == NULL )
  ------------------
  |  Branch (4697:10): [True: 15.1k, False: 14.4k]
  ------------------
 4698|  15.1k|    {
 4699|  15.1k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  15.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4700|  15.1k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4701|  15.1k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4702|  15.1k|        row = memory.original_node;
 4703|  15.1k|        state = memory.reentry_state;
 4704|  15.1k|        exclude_state = memory.register_1;
 4705|  15.1k|        DEBUG_LOG_GET_OLD_MODE;
 4706|  15.1k|        mode = memory.mode;
 4707|  15.1k|        DEBUG_LOG_CHANGE_MODE;
 4708|  15.1k|    }
 4709|  14.4k|    else
 4710|  14.4k|    {
 4711|  14.4k|        DEBUG_LOG_ENTER_WITH_NODE(row);
 4712|       |
 4713|  14.4k|        if (row->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  14.4k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (4713:13): [True: 0, False: 14.4k]
  ------------------
 4714|      0|            return NULL;
 4715|  14.4k|    }
 4716|       |
 4717|  65.7k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4717:13): [True: 55.7k, False: 10.0k]
  ------------------
 4718|  55.7k|    {
 4719|  55.7k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4719:14): [True: 40.5k, False: 15.1k]
  ------------------
 4720|  40.5k|        {
 4721|  40.5k|            node = TY_(GetToken)( doc, IgnoreWhitespace );
  ------------------
  |  |   23|  40.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4722|  40.5k|            DEBUG_LOG_GOT_TOKEN(node);
 4723|  40.5k|        }
 4724|       |    
 4725|  55.7k|        switch (state)
 4726|  55.7k|        {
 4727|  40.5k|            case STATE_INITIAL:
  ------------------
  |  Branch (4727:13): [True: 40.5k, False: 15.1k]
  ------------------
 4728|  40.5k|            {
 4729|  40.5k|                if ( node == NULL)
  ------------------
  |  Branch (4729:22): [True: 10.0k, False: 30.4k]
  ------------------
 4730|  10.0k|                {
 4731|  10.0k|                    state = STATE_COMPLETE;
 4732|  10.0k|                    continue;
 4733|  10.0k|                }
 4734|       |                
 4735|  30.4k|                if (node->tag == row->tag)
  ------------------
  |  Branch (4735:21): [True: 2.88k, False: 27.5k]
  ------------------
 4736|  2.88k|                {
 4737|  2.88k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4737:25): [True: 425, False: 2.46k]
  ------------------
 4738|    425|                    {
 4739|    425|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    425|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    425|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4740|    425|                        row->closed = yes;
 4741|    425|                        FixEmptyRow( doc, row);
 4742|    425|                        DEBUG_LOG_EXIT;
 4743|    425|                        return NULL;
 4744|    425|                    }
 4745|       |
 4746|       |                    /* New row start implies end of current row */
 4747|  2.46k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4748|  2.46k|                    FixEmptyRow( doc, row);
 4749|  2.46k|                    DEBUG_LOG_EXIT;
 4750|  2.46k|                    return NULL;
 4751|  2.88k|                }
 4752|       |
 4753|       |                /*
 4754|       |                  if this is the end tag for an ancestor element
 4755|       |                  then infer end tag for this element
 4756|       |                */
 4757|  27.5k|                if ( node->type == EndTag )
  ------------------
  |  Branch (4757:22): [True: 2.65k, False: 24.9k]
  ------------------
 4758|  2.65k|                {
 4759|  2.65k|                    if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |   23|  2.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |  140|  2.65k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
                                  if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |  146|  2.65k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                  if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |  393|  2.13k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  2.13k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.13k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.78k, False: 350]
  |  |  |  |  |  Branch (275:54): [True: 321, False: 1.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4759:27): [True: 522, False: 2.13k]
  ------------------
 4760|    843|                         && DescendantOf(row, TagId(node)) )
  ------------------
  |  |  270|    843|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 843, False: 0]
  |  |  |  Branch (270:39): [True: 843, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (4760:29): [True: 320, False: 523]
  ------------------
 4761|    320|                    {
 4762|    320|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    320|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    320|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4763|    320|                        DEBUG_LOG_EXIT;
 4764|    320|                        return NULL;
 4765|    320|                    }
 4766|       |
 4767|  2.33k|                    if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  424|  2.33k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  4.67k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.33k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.98k, False: 350]
  |  |  |  |  |  Branch (275:54): [True: 207, False: 1.78k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  2.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  2.13k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  2.13k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (4767:46): [True: 623, False: 1.50k]
  ------------------
 4768|    830|                    {
 4769|    830|                        if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    830|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    830|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 830, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 830, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 207, False: 623]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4770|    207|                            BadForm( doc );
 4771|       |
 4772|    830|                        TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    830|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    830|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4773|    830|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    830|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    830|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4774|    830|                        continue;
 4775|    830|                    }
 4776|       |
 4777|  1.50k|                    if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  395|  1.50k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  3.01k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.50k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.15k, False: 350]
  |  |  |  |  |  Branch (275:54): [True: 203, False: 956]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  396|  1.30k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  1.30k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.30k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 956, False: 350]
  |  |  |  |  |  Branch (275:54): [True: 230, False: 726]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4778|    433|                    {
 4779|    433|                        TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    433|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    433|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4780|    433|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    433|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    433|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4781|    433|                        continue;
 4782|    433|                    }
 4783|  1.50k|                }
 4784|       |
 4785|       |                /* deal with comments etc. */
 4786|  26.0k|                if (InsertMisc(row, node))
  ------------------
  |  Branch (4786:21): [True: 835, False: 25.1k]
  ------------------
 4787|    835|                    continue;
 4788|       |
 4789|       |                /* discard unknown tags */
 4790|  25.1k|                if (node->tag == NULL && node->type != TextNode)
  ------------------
  |  Branch (4790:21): [True: 4.09k, False: 21.0k]
  |  Branch (4790:42): [True: 2.01k, False: 2.07k]
  ------------------
 4791|  2.01k|                {
 4792|  2.01k|                    TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.01k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.01k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4793|  2.01k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.01k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.01k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4794|  2.01k|                    continue;
 4795|  2.01k|                }
 4796|       |
 4797|       |                /* discard unexpected <table> element */
 4798|  23.1k|                if ( nodeIsTABLE(node) )
  ------------------
  |  |  393|  23.1k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  23.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 23.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 21.0k, False: 2.07k]
  |  |  |  |  |  Branch (275:54): [True: 232, False: 20.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4799|    232|                {
 4800|    232|                    TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    232|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    232|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4801|    232|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    232|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    232|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4802|    232|                    continue;
 4803|    232|                }
 4804|       |
 4805|       |                /* THEAD, TFOOT or TBODY */
 4806|  22.9k|                if ( TY_(nodeHasCM)(node, CM_ROWGRP) )
  ------------------
  |  |   23|  22.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_ROWGRP) )
  ------------------
  |  |  147|  22.9k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
  |  Branch (4806:22): [True: 878, False: 22.0k]
  ------------------
 4807|    878|                {
 4808|    878|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    878|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    878|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4809|    878|                    DEBUG_LOG_EXIT;
 4810|    878|                    return NULL;
 4811|    878|                }
 4812|       |
 4813|  22.0k|                if (node->type == EndTag)
  ------------------
  |  Branch (4813:21): [True: 726, False: 21.3k]
  ------------------
 4814|    726|                {
 4815|    726|                    TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    726|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    726|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4816|    726|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    726|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    726|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4817|    726|                    continue;
 4818|    726|                }
 4819|       |
 4820|       |                /*
 4821|       |                  if text or inline or block move before table
 4822|       |                  if head content move to head
 4823|       |                */
 4824|       |
 4825|  21.3k|                if (node->type != EndTag)
  ------------------
  |  Branch (4825:21): [True: 21.3k, False: 0]
  ------------------
 4826|  21.3k|                {
 4827|  21.3k|                    if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  21.3k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  21.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 21.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 19.2k, False: 2.07k]
  |  |  |  |  |  Branch (275:54): [True: 5.98k, False: 13.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4828|  5.98k|                    {
 4829|  5.98k|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  5.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4830|  5.98k|                        node = TY_(InferredTag)(doc, TidyTag_TD);
  ------------------
  |  |   23|  5.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4831|  5.98k|                        TY_(Report)(doc, row, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  5.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4832|  5.98k|                    }
 4833|  15.3k|                    else if ( TY_(nodeIsText)(node)
  ------------------
  |  |   23|  15.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4833:31): [True: 2.07k, False: 13.2k]
  ------------------
 4834|  13.2k|                              || TY_(nodeHasCM)(node, CM_BLOCK | CM_INLINE) )
  ------------------
  |  |   23|  13.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK | CM_INLINE) )
  ------------------
  |  |  142|  13.2k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK | CM_INLINE) )
  ------------------
  |  |  143|  13.2k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (4834:34): [True: 6.04k, False: 7.20k]
  ------------------
 4835|  8.11k|                    {
 4836|  8.11k|                        MoveBeforeTable( doc, row, node );
 4837|  8.11k|                        TY_(Report)(doc, row, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  8.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4838|  8.11k|                        lexer->exiled = yes;
 4839|  8.11k|                        exclude_state = lexer->excludeBlocks;
 4840|  8.11k|                        lexer->excludeBlocks = no;
 4841|       |
 4842|  8.11k|                        if (node->type != TextNode)
  ------------------
  |  Branch (4842:29): [True: 6.04k, False: 2.07k]
  ------------------
 4843|  6.04k|                        {
 4844|  6.04k|                            TidyParserMemory memory = {0};
 4845|  6.04k|                            memory.identity = TY_(ParseRow);
  ------------------
  |  |   23|  6.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4846|  6.04k|                            memory.original_node = row;
 4847|  6.04k|                            memory.reentry_node = node;
 4848|  6.04k|                            memory.reentry_state = STATE_POST_NOT_ENDTAG;
 4849|  6.04k|                            memory.register_1 = exclude_state;
 4850|  6.04k|                            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  6.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4851|  6.04k|                            DEBUG_LOG_EXIT_WITH_NODE(node);
 4852|  6.04k|                            return node;
 4853|  6.04k|                        }
 4854|       |                        
 4855|  2.07k|                        lexer->exiled = no;
 4856|  2.07k|                        lexer->excludeBlocks = exclude_state;
 4857|  2.07k|                        continue;
 4858|  8.11k|                    }
 4859|  7.20k|                    else if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  7.20k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (4859:30): [True: 208, False: 7.00k]
  ------------------
 4860|    208|                    {
 4861|    208|                        TY_(Report)(doc, row, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|    208|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    208|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4862|    208|                        MoveToHead( doc, row, node);
 4863|    208|                        continue;
 4864|    208|                    }
 4865|  21.3k|                }
 4866|       |
 4867|  12.9k|                if ( !(nodeIsTD(node) || nodeIsTH(node)) )
  ------------------
  |  |  395|  12.9k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  25.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 12.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 12.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 7.36k, False: 5.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !(nodeIsTD(node) || nodeIsTH(node)) )
  ------------------
  |  |  396|  5.62k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  5.62k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.62k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.62k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.09k, False: 3.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4868|  3.53k|                {
 4869|  3.53k|                    TY_(Report)(doc, row, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  3.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4870|  3.53k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  3.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4871|  3.53k|                    continue;
 4872|  3.53k|                }
 4873|       |
 4874|       |                /* node should be <TD> or <TH> */
 4875|  9.45k|                TY_(InsertNodeAtEnd)(row, node);
  ------------------
  |  |   23|  9.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4876|  9.45k|                exclude_state = lexer->excludeBlocks;
 4877|  9.45k|                lexer->excludeBlocks = no;
 4878|  9.45k|                {
 4879|  9.45k|                    TidyParserMemory memory = {0};
 4880|  9.45k|                    memory.identity = TY_(ParseRow);
  ------------------
  |  |   23|  9.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4881|  9.45k|                    memory.original_node = row;
 4882|  9.45k|                    memory.reentry_node = node;
 4883|  9.45k|                    memory.reentry_state = STATE_POST_TD_TH;
 4884|  9.45k|                    memory.register_1 = exclude_state;
 4885|  9.45k|                    TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  9.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4886|  9.45k|                    DEBUG_LOG_EXIT_WITH_NODE(node);
 4887|  9.45k|                    return node;
 4888|  12.9k|                }
 4889|  12.9k|            } break;
 4890|       |                
 4891|       |                
 4892|  5.74k|            case STATE_POST_NOT_ENDTAG:
  ------------------
  |  Branch (4892:13): [True: 5.74k, False: 49.9k]
  ------------------
 4893|  5.74k|            {
 4894|  5.74k|                lexer->exiled = no;
 4895|  5.74k|                lexer->excludeBlocks = exclude_state; /* capture this in stack. */
 4896|  5.74k|                state = STATE_INITIAL;
 4897|  5.74k|                continue;
 4898|  12.9k|            } break;
 4899|       |                
 4900|       |                
 4901|  9.45k|            case STATE_POST_TD_TH:
  ------------------
  |  Branch (4901:13): [True: 9.45k, False: 46.2k]
  ------------------
 4902|  9.45k|            {
 4903|  9.45k|                lexer->excludeBlocks = exclude_state; /* capture this in stack. */
 4904|       |
 4905|       |                /* pop inline stack */
 4906|  15.7k|                while ( lexer->istacksize > lexer->istackbase )
  ------------------
  |  Branch (4906:25): [True: 6.29k, False: 9.45k]
  ------------------
 4907|  6.29k|                    TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|  6.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4908|       |                
 4909|  9.45k|                state = STATE_INITIAL;
 4910|  9.45k|                continue;
 4911|  12.9k|            } break;
 4912|       |                
 4913|       |                
 4914|      0|            default:
  ------------------
  |  Branch (4914:13): [True: 0, False: 55.7k]
  ------------------
 4915|      0|                break;
 4916|       |                
 4917|  55.7k|        } /* switch */
 4918|  55.7k|    } /* while */
 4919|  10.0k|    DEBUG_LOG_EXIT;
 4920|       |    return NULL;
 4921|  29.6k|}
prvTidyParseRowGroup:
 4933|  13.8k|{
 4934|  13.8k|    Lexer* lexer = doc->lexer;
 4935|  13.8k|    Node *node = NULL;
 4936|  13.8k|    Node *parent = NULL;
 4937|  13.8k|    DEBUG_LOG_COUNTERS;
 4938|       |
 4939|  13.8k|    enum parserState {
 4940|  13.8k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4941|  13.8k|        STATE_POST_NOT_TEXTNODE,      /* To-do after re-entering after checks. */
 4942|  13.8k|        STATE_COMPLETE,               /* Done with the switch. */
 4943|  13.8k|    } state = STATE_INITIAL;
 4944|       |
 4945|  13.8k|    if ( rowgroup == NULL )
  ------------------
  |  Branch (4945:10): [True: 5.77k, False: 8.04k]
  ------------------
 4946|  5.77k|    {
 4947|  5.77k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  5.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4948|  5.77k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4949|  5.77k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4950|  5.77k|        rowgroup = memory.original_node;
 4951|  5.77k|        state = memory.reentry_state;
 4952|  5.77k|        DEBUG_LOG_GET_OLD_MODE;
 4953|  5.77k|        mode = memory.mode;
 4954|  5.77k|        DEBUG_LOG_CHANGE_MODE;
 4955|  5.77k|    }
 4956|  8.04k|    else
 4957|  8.04k|    {
 4958|  8.04k|        DEBUG_LOG_ENTER_WITH_NODE(rowgroup);
 4959|  8.04k|        if (rowgroup->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  8.04k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (4959:13): [True: 0, False: 8.04k]
  ------------------
 4960|      0|        {
 4961|      0|            DEBUG_LOG_EXIT;
 4962|      0|            return NULL;
 4963|      0|        }
 4964|  8.04k|    }
 4965|       |
 4966|  94.5k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4966:13): [True: 92.2k, False: 2.32k]
  ------------------
 4967|  92.2k|    {
 4968|  92.2k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4968:14): [True: 63.9k, False: 28.2k]
  ------------------
 4969|  63.9k|            node = TY_(GetToken)(doc, IgnoreWhitespace);
  ------------------
  |  |   23|  63.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  63.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4970|       |        
 4971|  92.2k|        switch (state)
 4972|  92.2k|        {
 4973|  63.9k|            case STATE_INITIAL:
  ------------------
  |  Branch (4973:13): [True: 63.9k, False: 28.2k]
  ------------------
 4974|  63.9k|            {
 4975|  63.9k|                TidyParserMemory memory = {0};
 4976|       |
 4977|  63.9k|                if (node == NULL)
  ------------------
  |  Branch (4977:21): [True: 2.32k, False: 61.6k]
  ------------------
 4978|  2.32k|                {
 4979|  2.32k|                    state = STATE_COMPLETE;
 4980|  2.32k|                    continue;
 4981|  2.32k|                }
 4982|       |                
 4983|  61.6k|                if (node->tag == rowgroup->tag)
  ------------------
  |  Branch (4983:21): [True: 4.19k, False: 57.4k]
  ------------------
 4984|  4.19k|                {
 4985|  4.19k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4985:25): [True: 415, False: 3.77k]
  ------------------
 4986|    415|                    {
 4987|    415|                        rowgroup->closed = yes;
 4988|    415|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    415|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    415|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4989|    415|                        DEBUG_LOG_EXIT;
 4990|    415|                        return NULL;
 4991|    415|                    }
 4992|       |
 4993|  3.77k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  3.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4994|  3.77k|                    DEBUG_LOG_EXIT;
 4995|  3.77k|                    return NULL;
 4996|  4.19k|                }
 4997|       |
 4998|       |                /* if </table> infer end tag */
 4999|  57.4k|                if ( nodeIsTABLE(node) && node->type == EndTag )
  ------------------
  |  |  393|  57.4k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|   114k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 57.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 9.89k, False: 47.5k]
  |  |  |  |  |  Branch (275:54): [True: 844, False: 9.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4999:43): [True: 533, False: 311]
  ------------------
 5000|    533|                {
 5001|    533|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    533|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    533|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5002|    533|                    DEBUG_LOG_EXIT;
 5003|    533|                    return NULL;
 5004|    533|                }
 5005|       |
 5006|       |                /* deal with comments etc. */
 5007|  56.9k|                if (InsertMisc(rowgroup, node))
  ------------------
  |  Branch (5007:21): [True: 21.1k, False: 35.8k]
  ------------------
 5008|  21.1k|                    continue;
 5009|       |
 5010|       |                /* discard unknown tags */
 5011|  35.8k|                if (node->tag == NULL && node->type != TextNode)
  ------------------
  |  Branch (5011:21): [True: 26.4k, False: 9.35k]
  |  Branch (5011:42): [True: 2.15k, False: 24.3k]
  ------------------
 5012|  2.15k|                {
 5013|  2.15k|                    TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5014|  2.15k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5015|  2.15k|                    continue;
 5016|  2.15k|                }
 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|  33.6k|                if (node->type != EndTag)
  ------------------
  |  Branch (5024:21): [True: 31.0k, False: 2.57k]
  ------------------
 5025|  31.0k|                {
 5026|  31.0k|                    if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  395|  31.0k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  62.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 31.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.77k, False: 24.3k]
  |  |  |  |  |  Branch (275:54): [True: 220, False: 6.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  396|  30.8k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  30.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 30.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.55k, False: 24.3k]
  |  |  |  |  |  Branch (275:54): [True: 215, False: 6.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5027|    435|                    {
 5028|    435|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    435|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    435|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5029|    435|                        node = TY_(InferredTag)(doc, TidyTag_TR);
  ------------------
  |  |   23|    435|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    435|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5030|    435|                        TY_(Report)(doc, rowgroup, node, MISSING_STARTTAG);
  ------------------
  |  |   23|    435|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    435|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5031|    435|                    }
 5032|  30.6k|                    else if ( TY_(nodeIsText)(node)
  ------------------
  |  |   23|  30.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  30.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5032:31): [True: 24.3k, False: 6.34k]
  ------------------
 5033|  6.34k|                              || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  6.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  6.34k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  6.34k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5033:34): [True: 3.93k, False: 2.40k]
  ------------------
 5034|  28.2k|                    {
 5035|  28.2k|                        MoveBeforeTable( doc, rowgroup, node );
 5036|  28.2k|                        TY_(Report)(doc, rowgroup, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  28.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5037|  28.2k|                        lexer->exiled = yes;
 5038|       |
 5039|  28.2k|                        if (node->type != TextNode)
  ------------------
  |  Branch (5039:29): [True: 3.93k, False: 24.3k]
  ------------------
 5040|  3.93k|                        {
 5041|  3.93k|                            memory.identity = TY_(ParseRowGroup);
  ------------------
  |  |   23|  3.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5042|  3.93k|                            memory.original_node = rowgroup;
 5043|  3.93k|                            memory.reentry_node = node;
 5044|  3.93k|                            memory.reentry_state = STATE_POST_NOT_TEXTNODE;
 5045|  3.93k|                            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  3.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5046|  3.93k|                            DEBUG_LOG_EXIT_WITH_NODE(node);
 5047|  3.93k|                            return node;
 5048|  3.93k|                        }
 5049|       |                        
 5050|  24.3k|                        state = STATE_POST_NOT_TEXTNODE;
 5051|  24.3k|                        continue;
 5052|  28.2k|                    }
 5053|  2.40k|                    else if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  2.40k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (5053:30): [True: 220, False: 2.18k]
  ------------------
 5054|    220|                    {
 5055|    220|                        TY_(Report)(doc, rowgroup, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|    220|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    220|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5056|    220|                        MoveToHead(doc, rowgroup, node);
 5057|    220|                        continue;
 5058|    220|                    }
 5059|  31.0k|                }
 5060|       |
 5061|       |                /*
 5062|       |                  if this is the end tag for ancestor element
 5063|       |                  then infer end tag for this element
 5064|       |                */
 5065|  5.19k|                if (node->type == EndTag)
  ------------------
  |  Branch (5065:21): [True: 2.57k, False: 2.61k]
  ------------------
 5066|  2.57k|                {
 5067|  2.57k|                    if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  424|  2.57k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  5.15k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.57k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.57k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 194, False: 2.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  2.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  2.38k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  2.38k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5067:46): [True: 269, False: 2.11k]
  ------------------
 5068|    463|                    {
 5069|    463|                        if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    463|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    463|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 463, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 463, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 194, False: 269]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5070|    194|                            BadForm( doc );
 5071|       |
 5072|    463|                        TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    463|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    463|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5073|    463|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    463|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    463|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5074|    463|                        continue;
 5075|    463|                    }
 5076|       |
 5077|  2.11k|                    if ( nodeIsTR(node) || nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  397|  2.11k|#define nodeIsTR( node )         TagIsId( node, TidyTag_TR )
  |  |  ------------------
  |  |  |  |  275|  4.23k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.11k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.11k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 315, False: 1.80k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTR(node) || nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  395|  1.80k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  3.91k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.80k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.80k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 205, False: 1.59k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTR(node) || nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  396|  1.59k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  1.59k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.59k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.59k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 311, False: 1.28k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5078|    831|                    {
 5079|    831|                        TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    831|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    831|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5080|    831|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    831|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    831|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5081|    831|                        continue;
 5082|    831|                    }
 5083|       |
 5084|  1.28k|                    for ( parent = rowgroup->parent;
 5085|  4.69k|                          parent != NULL;
  ------------------
  |  Branch (5085:27): [True: 3.62k, False: 1.07k]
  ------------------
 5086|  3.41k|                          parent = parent->parent )
 5087|  3.62k|                    {
 5088|  3.62k|                        if (node->tag == parent->tag)
  ------------------
  |  Branch (5088:29): [True: 213, False: 3.41k]
  ------------------
 5089|    213|                        {
 5090|    213|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    213|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    213|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5091|    213|                            DEBUG_LOG_EXIT;
 5092|    213|                            return NULL;
 5093|    213|                        }
 5094|  3.62k|                    }
 5095|  1.28k|                }
 5096|       |
 5097|       |                /*
 5098|       |                  if THEAD, TFOOT or TBODY then implied end tag
 5099|       |
 5100|       |                */
 5101|  3.69k|                if (node->tag->model & CM_ROWGRP)
  ------------------
  |  |  147|  3.69k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
  |  Branch (5101:21): [True: 1.63k, False: 2.06k]
  ------------------
 5102|  1.63k|                {
 5103|  1.63k|                    if (node->type != EndTag)
  ------------------
  |  Branch (5103:25): [True: 781, False: 849]
  ------------------
 5104|    781|                    {
 5105|    781|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    781|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    781|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5106|    781|                        DEBUG_LOG_EXIT;
 5107|    781|                        return NULL;
 5108|    781|                    }
 5109|  1.63k|                }
 5110|       |
 5111|  2.91k|                if (node->type == EndTag)
  ------------------
  |  Branch (5111:21): [True: 1.07k, False: 1.83k]
  ------------------
 5112|  1.07k|                {
 5113|  1.07k|                    TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.07k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.07k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5114|  1.07k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.07k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.07k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5115|  1.07k|                    continue;
 5116|  1.07k|                }
 5117|       |
 5118|  1.83k|                if ( !nodeIsTR(node) )
  ------------------
  |  |  397|  1.83k|#define nodeIsTR( node )         TagIsId( node, TidyTag_TR )
  |  |  ------------------
  |  |  |  |  275|  1.83k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.83k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.83k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 869, False: 969]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5119|    969|                {
 5120|    969|                    node = TY_(InferredTag)(doc, TidyTag_TR);
  ------------------
  |  |   23|    969|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    969|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5121|    969|                    TY_(Report)(doc, rowgroup, node, MISSING_STARTTAG);
  ------------------
  |  |   23|    969|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    969|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5122|    969|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    969|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    969|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5123|    969|                }
 5124|       |
 5125|       |               /* node should be <TR> */
 5126|  1.83k|                TY_(InsertNodeAtEnd)(rowgroup, node);
  ------------------
  |  |   23|  1.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5127|  1.83k|                memory.identity = TY_(ParseRowGroup);
  ------------------
  |  |   23|  1.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5128|  1.83k|                memory.original_node = rowgroup;
 5129|  1.83k|                memory.reentry_node = node;
 5130|  1.83k|                memory.reentry_state = STATE_INITIAL;
 5131|  1.83k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5132|  1.83k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 5133|  1.83k|                return node;
 5134|  2.91k|            } break;
 5135|       |                
 5136|       |                
 5137|  28.2k|            case STATE_POST_NOT_TEXTNODE:
  ------------------
  |  Branch (5137:13): [True: 28.2k, False: 63.9k]
  ------------------
 5138|  28.2k|            {
 5139|  28.2k|                lexer->exiled = no;
 5140|  28.2k|                state = STATE_INITIAL;
 5141|  28.2k|                continue;
 5142|  2.91k|            } break;
 5143|       |
 5144|       |                
 5145|      0|            default:
  ------------------
  |  Branch (5145:13): [True: 0, False: 92.2k]
  ------------------
 5146|      0|                break;
 5147|  92.2k|        } /* switch */
 5148|  92.2k|    } /* while */
 5149|  2.32k|    DEBUG_LOG_EXIT;
 5150|       |    return NULL;
 5151|  13.8k|}
prvTidyParseScript:
 5171|  6.38k|{
 5172|  6.38k|    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|  6.38k|    DEBUG_LOG_ENTER_WITH_NODE(script);
 5179|       |    
 5180|  6.38k|    doc->lexer->parent = script;
 5181|  6.38k|    node = TY_(GetToken)(doc, CdataContent);
  ------------------
  |  |   23|  6.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5182|  6.38k|    doc->lexer->parent = NULL;
 5183|       |
 5184|  6.38k|    if (node)
  ------------------
  |  Branch (5184:9): [True: 4.86k, False: 1.51k]
  ------------------
 5185|  4.86k|    {
 5186|  4.86k|        TY_(InsertNodeAtEnd)(script, node);
  ------------------
  |  |   23|  4.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5187|  4.86k|    }
 5188|  1.51k|    else
 5189|  1.51k|    {
 5190|       |        /* handle e.g. a document like "<script>" */
 5191|  1.51k|        TY_(Report)(doc, script, NULL, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  1.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5192|  1.51k|        DEBUG_LOG_EXIT;
 5193|  1.51k|        return NULL;
 5194|  1.51k|    }
 5195|       |
 5196|  4.86k|    node = TY_(GetToken)(doc, IgnoreWhitespace);
  ------------------
  |  |   23|  4.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5197|  4.86k|    DEBUG_LOG_GOT_TOKEN(node);
 5198|       |
 5199|  4.86k|    if (!(node && node->type == EndTag && node->tag &&
  ------------------
  |  Branch (5199:11): [True: 4.16k, False: 701]
  |  Branch (5199:19): [True: 3.90k, False: 266]
  |  Branch (5199:43): [True: 3.35k, False: 550]
  ------------------
 5200|  3.35k|        node->tag->id == script->tag->id))
  ------------------
  |  Branch (5200:9): [True: 3.14k, False: 202]
  ------------------
 5201|  1.71k|    {
 5202|  1.71k|        TY_(Report)(doc, script, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  1.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5203|       |
 5204|  1.71k|        if (node)
  ------------------
  |  Branch (5204:13): [True: 1.01k, False: 701]
  ------------------
 5205|  1.01k|            TY_(UngetToken)(doc);
  ------------------
  |  |   23|  1.01k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.01k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5206|  1.71k|    }
 5207|  3.14k|    else
 5208|  3.14k|    {
 5209|  3.14k|        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  3.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5210|  3.14k|    }
 5211|  4.86k|    DEBUG_LOG_EXIT;
 5212|       |    return NULL;
 5213|  6.38k|}
prvTidyParseSelect:
 5225|  2.35k|{
 5226|  2.35k|    Lexer* lexer = doc->lexer;
 5227|  2.35k|    Node *node;
 5228|  2.35k|    DEBUG_LOG_COUNTERS;
 5229|       |
 5230|  2.35k|    if ( field == NULL )
  ------------------
  |  Branch (5230:10): [True: 1.37k, False: 985]
  ------------------
 5231|  1.37k|    {
 5232|  1.37k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5233|  1.37k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 5234|  1.37k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 5235|  1.37k|        field = memory.original_node;
 5236|  1.37k|        DEBUG_LOG_GET_OLD_MODE;
 5237|  1.37k|        mode = memory.mode;
 5238|  1.37k|        DEBUG_LOG_CHANGE_MODE;
 5239|  1.37k|    }
 5240|    985|    else
 5241|    985|    {
 5242|    985|        DEBUG_LOG_ENTER_WITH_NODE(field);
 5243|    985|    }
 5244|       |    
 5245|  2.35k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 5246|       |
 5247|  5.52k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  5.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5247:12): [True: 4.73k, False: 789]
  ------------------
 5248|  4.73k|    {
 5249|  4.73k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (5249:13): [True: 653, False: 4.08k]
  |  Branch (5249:40): [True: 196, False: 457]
  ------------------
 5250|    196|        {
 5251|    196|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    196|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    196|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5252|    196|            field->closed = yes;
 5253|    196|            TrimSpaces(doc, field);
 5254|       |
 5255|    196|            DEBUG_LOG_EXIT;
 5256|    196|            return NULL;
 5257|    196|        }
 5258|       |
 5259|       |        /* deal with comments etc. */
 5260|  4.54k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (5260:13): [True: 212, False: 4.32k]
  ------------------
 5261|    212|            continue;
 5262|       |
 5263|  4.32k|        if ( node->type == StartTag &&
  ------------------
  |  Branch (5263:14): [True: 3.41k, False: 917]
  ------------------
 5264|  3.41k|             ( nodeIsOPTION(node)   ||
  ------------------
  |  |  410|  3.41k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  6.82k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.41k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.41k, False: 998]
  |  |  |  |  |  Branch (275:54): [True: 331, False: 2.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5265|  3.41k|               nodeIsOPTGROUP(node) ||
  ------------------
  |  |  411|  3.08k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  6.49k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.08k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.08k, False: 998]
  |  |  |  |  |  Branch (275:54): [True: 469, False: 1.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5266|  3.41k|               nodeIsDATALIST(node) ||
  ------------------
  |  |  463|  2.61k|#define nodeIsDATALIST( node )   TagIsId( node, TidyTag_DATALIST )
  |  |  ------------------
  |  |  |  |  275|  6.02k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.61k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.61k, False: 998]
  |  |  |  |  |  Branch (275:54): [True: 248, False: 1.36k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5267|  3.41k|               nodeIsSCRIPT(node))
  ------------------
  |  |  422|  2.36k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  2.36k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.36k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.36k, False: 998]
  |  |  |  |  |  Branch (275:54): [True: 324, False: 1.04k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5268|  4.32k|           )
 5269|  1.37k|        {
 5270|  1.37k|            TidyParserMemory memory = {0};
 5271|  1.37k|            memory.identity = TY_(ParseSelect);
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5272|  1.37k|            memory.original_node = field;
 5273|  1.37k|            memory.reentry_node = node;
 5274|       |
 5275|  1.37k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5276|  1.37k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5277|  1.37k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 5278|  1.37k|            return node;
 5279|  1.37k|        }
 5280|       |
 5281|       |        /* discard unexpected tags */
 5282|  2.95k|        TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5283|  2.95k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5284|  2.95k|    }
 5285|       |
 5286|    789|    TY_(Report)(doc, field, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|    789|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    789|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5287|       |
 5288|    789|    DEBUG_LOG_EXIT;
 5289|       |    return NULL;
 5290|  2.35k|}
prvTidyParseTableTag:
 5302|  35.6k|{
 5303|  35.6k|    Lexer* lexer = doc->lexer;
 5304|  35.6k|    Node *node, *parent;
 5305|  35.6k|    uint istackbase;
 5306|  35.6k|    DEBUG_LOG_COUNTERS;
 5307|       |
 5308|  35.6k|    if ( table == NULL )
  ------------------
  |  Branch (5308:10): [True: 17.7k, False: 17.9k]
  ------------------
 5309|  17.7k|    {
 5310|  17.7k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  17.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5311|  17.7k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 5312|  17.7k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 5313|  17.7k|        table = memory.original_node;
 5314|  17.7k|        lexer->exiled = memory.register_1;
 5315|  17.7k|        DEBUG_LOG_GET_OLD_MODE;
 5316|  17.7k|        mode = memory.mode;
 5317|  17.7k|        DEBUG_LOG_CHANGE_MODE;
 5318|  17.7k|    }
 5319|  17.9k|    else
 5320|  17.9k|    {
 5321|  17.9k|        DEBUG_LOG_ENTER_WITH_NODE(table);
 5322|  17.9k|        TY_(DeferDup)( doc );
  ------------------
  |  |   23|  17.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5323|  17.9k|    }
 5324|       |
 5325|  35.6k|    istackbase = lexer->istackbase;
 5326|  35.6k|    lexer->istackbase = lexer->istacksize;
 5327|       |
 5328|  40.0k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  40.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5328:12): [True: 27.1k, False: 12.9k]
  ------------------
 5329|  27.1k|    {
 5330|  27.1k|        DEBUG_LOG_GOT_TOKEN(node);
 5331|  27.1k|        if (node->tag == table->tag )
  ------------------
  |  Branch (5331:13): [True: 4.04k, False: 23.0k]
  ------------------
 5332|  4.04k|        {
 5333|  4.04k|            if (node->type == EndTag)
  ------------------
  |  Branch (5333:17): [True: 358, False: 3.68k]
  ------------------
 5334|    358|            {
 5335|    358|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    358|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    358|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5336|    358|            }
 5337|  3.68k|            else
 5338|  3.68k|            {
 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|  3.68k|                TY_(UngetToken)(doc);
  ------------------
  |  |   23|  3.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5345|  3.68k|                TY_(Report)(doc, table, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  3.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5346|  3.68k|            }
 5347|  4.04k|            lexer->istackbase = istackbase;
 5348|  4.04k|            table->closed = yes;
 5349|       |
 5350|  4.04k|            DEBUG_LOG_EXIT;
 5351|  4.04k|            return NULL;
 5352|  4.04k|        }
 5353|       |
 5354|       |        /* deal with comments etc. */
 5355|  23.0k|        if (InsertMisc(table, node))
  ------------------
  |  Branch (5355:13): [True: 521, False: 22.5k]
  ------------------
 5356|    521|            continue;
 5357|       |
 5358|       |        /* discard unknown tags */
 5359|  22.5k|        if (node->tag == NULL && node->type != TextNode)
  ------------------
  |  Branch (5359:13): [True: 2.94k, False: 19.6k]
  |  Branch (5359:34): [True: 1.14k, False: 1.80k]
  ------------------
 5360|  1.14k|        {
 5361|  1.14k|            TY_(Report)(doc, table, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5362|  1.14k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5363|  1.14k|            continue;
 5364|  1.14k|        }
 5365|       |
 5366|       |        /* if TD or TH or text or inline or block then infer <TR> */
 5367|       |
 5368|  21.4k|        if (node->type != EndTag)
  ------------------
  |  Branch (5368:13): [True: 19.9k, False: 1.44k]
  ------------------
 5369|  19.9k|        {
 5370|  19.9k|            if ( nodeIsTD(node) || nodeIsTH(node) || nodeIsTABLE(node) )
  ------------------
  |  |  395|  19.9k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  39.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 19.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 18.1k, False: 1.80k]
  |  |  |  |  |  Branch (275:54): [True: 497, False: 17.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsTD(node) || nodeIsTH(node) || nodeIsTABLE(node) )
  ------------------
  |  |  396|  19.4k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  39.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 19.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.6k, False: 1.80k]
  |  |  |  |  |  Branch (275:54): [True: 1.45k, False: 16.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsTD(node) || nodeIsTH(node) || nodeIsTABLE(node) )
  ------------------
  |  |  393|  18.0k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  18.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 18.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 16.2k, False: 1.80k]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 16.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5371|  1.95k|            {
 5372|  1.95k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5373|  1.95k|                node = TY_(InferredTag)(doc, TidyTag_TR);
  ------------------
  |  |   23|  1.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5374|  1.95k|                TY_(Report)(doc, table, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  1.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5375|  1.95k|            }
 5376|  18.0k|            else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  18.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  16.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  16.2k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                          else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  16.2k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5376:23): [True: 1.80k, False: 16.2k]
  |  Branch (5376:47): [True: 1.60k, False: 14.6k]
  ------------------
 5377|  3.40k|            {
 5378|  3.40k|                TY_(InsertNodeBeforeElement)(table, node);
  ------------------
  |  |   23|  3.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5379|  3.40k|                TY_(Report)(doc, table, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  3.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5380|  3.40k|                lexer->exiled = yes;
 5381|       |
 5382|  3.40k|                if (node->type != TextNode)
  ------------------
  |  Branch (5382:21): [True: 1.60k, False: 1.80k]
  ------------------
 5383|  1.60k|                {
 5384|  1.60k|                    TidyParserMemory memory = {0};
 5385|  1.60k|                    memory.identity = TY_(ParseTableTag);
  ------------------
  |  |   23|  1.60k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.60k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5386|  1.60k|                    memory.original_node = table;
 5387|  1.60k|                    memory.reentry_node = node;
 5388|  1.60k|                    memory.register_1 = no; /* later, lexer->exiled = no */
 5389|  1.60k|                    memory.mode = IgnoreWhitespace;
 5390|  1.60k|                    TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.60k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.60k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5391|  1.60k|                    DEBUG_LOG_EXIT_WITH_NODE(node);
 5392|  1.60k|                    return node;
 5393|  1.60k|                }
 5394|       |
 5395|  1.80k|                lexer->exiled = no;
 5396|  1.80k|                continue;
 5397|  3.40k|            }
 5398|  14.6k|            else if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  14.6k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (5398:22): [True: 290, False: 14.3k]
  ------------------
 5399|    290|            {
 5400|    290|                MoveToHead(doc, table, node);
 5401|    290|                continue;
 5402|    290|            }
 5403|  19.9k|        }
 5404|       |
 5405|       |        /*
 5406|       |          if this is the end tag for an ancestor element
 5407|       |          then infer end tag for this element
 5408|       |        */
 5409|  17.7k|        if (node->type == EndTag)
  ------------------
  |  Branch (5409:13): [True: 1.44k, False: 16.2k]
  ------------------
 5410|  1.44k|        {
 5411|  1.44k|            if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  1.44k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  1.44k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.44k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.44k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 202, False: 1.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5412|    202|            {
 5413|    202|                BadForm( doc );
 5414|    202|                TY_(Report)(doc, table, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    202|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    202|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5415|    202|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    202|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    202|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5416|    202|                continue;
 5417|    202|            }
 5418|       |
 5419|       |            /* best to discard unexpected block/inline end tags */
 5420|  1.24k|            if ( TY_(nodeHasCM)(node, CM_TABLE|CM_ROW) ||
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if ( TY_(nodeHasCM)(node, CM_TABLE|CM_ROW) ||
  ------------------
  |  |  146|  1.24k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                          if ( TY_(nodeHasCM)(node, CM_TABLE|CM_ROW) ||
  ------------------
  |  |  148|  1.24k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (5420:18): [True: 248, False: 994]
  ------------------
 5421|    994|                 TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|    994|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    994|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                               TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|    994|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                               TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|    994|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5421:18): [True: 206, False: 788]
  ------------------
 5422|    454|            {
 5423|    454|                TY_(Report)(doc, table, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    454|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    454|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5424|    454|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    454|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    454|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5425|    454|                continue;
 5426|    454|            }
 5427|       |
 5428|    788|            for ( parent = table->parent;
 5429|  20.0k|                  parent != NULL;
  ------------------
  |  Branch (5429:19): [True: 19.4k, False: 562]
  ------------------
 5430|  19.2k|                  parent = parent->parent )
 5431|  19.4k|            {
 5432|  19.4k|                if (node->tag == parent->tag)
  ------------------
  |  Branch (5432:21): [True: 226, False: 19.2k]
  ------------------
 5433|    226|                {
 5434|    226|                    TY_(Report)(doc, table, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|    226|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    226|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5435|    226|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    226|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    226|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5436|    226|                    lexer->istackbase = istackbase;
 5437|       |
 5438|    226|                    DEBUG_LOG_EXIT;
 5439|    226|                    return NULL;
 5440|    226|                }
 5441|  19.4k|            }
 5442|    788|        }
 5443|       |
 5444|  16.8k|        if (!(node->tag->model & CM_TABLE))
  ------------------
  |  |  146|  16.8k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
  |  Branch (5444:13): [True: 734, False: 16.1k]
  ------------------
 5445|    734|        {
 5446|    734|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    734|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    734|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5447|    734|            TY_(Report)(doc, table, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|    734|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    734|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5448|    734|            lexer->istackbase = istackbase;
 5449|       |
 5450|    734|            DEBUG_LOG_EXIT;
 5451|    734|            return NULL;
 5452|    734|        }
 5453|       |
 5454|  16.1k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  16.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5454:13): [True: 16.1k, False: 0]
  ------------------
 5455|  16.1k|        {
 5456|  16.1k|            TidyParserMemory memory = {0};
 5457|  16.1k|            TY_(InsertNodeAtEnd)(table, node);
  ------------------
  |  |   23|  16.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5458|  16.1k|            memory.identity = TY_(ParseTableTag);
  ------------------
  |  |   23|  16.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5459|  16.1k|            memory.original_node = table;
 5460|  16.1k|            memory.reentry_node = node;
 5461|  16.1k|            memory.register_1 = lexer->exiled;
 5462|  16.1k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  16.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5463|  16.1k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 5464|  16.1k|            return node;
 5465|  16.1k|        }
 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|  12.9k|    TY_(Report)(doc, table, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  12.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5473|  12.9k|    lexer->istackbase = istackbase;
 5474|       |
 5475|  12.9k|    DEBUG_LOG_EXIT;
 5476|       |    return NULL;
 5477|  35.6k|}
prvTidyParseText:
 5489|  4.65k|{
 5490|  4.65k|    Lexer* lexer = doc->lexer;
 5491|  4.65k|    Node *node;
 5492|  4.65k|    DEBUG_LOG_COUNTERS;
 5493|       |    
 5494|  4.65k|    DEBUG_LOG_ENTER_WITH_NODE(field);
 5495|       |
 5496|  4.65k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 5497|       |
 5498|  4.65k|    DEBUG_LOG_GET_OLD_MODE;
 5499|  4.65k|    if ( nodeIsTEXTAREA(field) )
  ------------------
  |  |  425|  4.65k|#define nodeIsTEXTAREA( node )   TagIsId( node, TidyTag_TEXTAREA )
  |  |  ------------------
  |  |  |  |  275|  4.65k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.65k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.65k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.74k, False: 2.90k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5500|  1.74k|        mode = Preformatted;
 5501|  2.90k|    else
 5502|  2.90k|        mode = MixedContent;  /* kludge for font tags */
 5503|  4.65k|    DEBUG_LOG_CHANGE_MODE;
 5504|       |
 5505|  9.10k|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|  9.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5505:12): [True: 8.32k, False: 776]
  ------------------
 5506|  8.32k|    {
 5507|  8.32k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (5507:13): [True: 3.26k, False: 5.06k]
  |  Branch (5507:40): [True: 194, False: 3.07k]
  ------------------
 5508|    194|        {
 5509|    194|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5510|    194|            field->closed = yes;
 5511|    194|            TrimSpaces(doc, field);
 5512|    194|            DEBUG_LOG_EXIT;
 5513|    194|            return NULL;
 5514|    194|        }
 5515|       |
 5516|       |        /* deal with comments etc. */
 5517|  8.13k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (5517:13): [True: 1.68k, False: 6.44k]
  ------------------
 5518|  1.68k|            continue;
 5519|       |
 5520|  6.44k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  6.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5520:13): [True: 1.95k, False: 4.49k]
  ------------------
 5521|  1.95k|        {
 5522|       |            /* only called for 1st child */
 5523|  1.95k|            if (field->content == NULL && !(mode & Preformatted))
  ------------------
  |  Branch (5523:17): [True: 1.15k, False: 796]
  |  Branch (5523:43): [True: 522, False: 634]
  ------------------
 5524|    522|                TrimSpaces(doc, field);
 5525|       |
 5526|  1.95k|            if (node->start >= node->end)
  ------------------
  |  Branch (5526:17): [True: 1, False: 1.95k]
  ------------------
 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.95k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  1.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5533|  1.95k|            continue;
 5534|  1.95k|        }
 5535|       |
 5536|       |        /* for textarea should all cases of < and & be escaped? */
 5537|       |
 5538|       |        /* discard inline tags e.g. font */
 5539|  4.49k|        if (   node->tag
  ------------------
  |  Branch (5539:16): [True: 3.93k, False: 555]
  ------------------
 5540|  3.93k|            && node->tag->model & CM_INLINE
  ------------------
  |  |  143|  8.42k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5540:16): [True: 1.93k, False: 2.00k]
  ------------------
 5541|  1.93k|            && !(node->tag->model & CM_FIELD)) /* #487283 - fix by Lee Passey 25 Jan 02 */
  ------------------
  |  |  149|  1.93k|#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: 812, False: 1.12k]
  ------------------
 5542|    812|        {
 5543|    812|            TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    812|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    812|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5544|    812|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    812|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    812|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5545|    812|            continue;
 5546|    812|        }
 5547|       |
 5548|       |        /* terminate element on other tags */
 5549|  3.68k|        if (!(field->tag->model & CM_OPT))
  ------------------
  |  |  154|  3.68k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (5549:13): [True: 1.47k, False: 2.20k]
  ------------------
 5550|  1.47k|            TY_(Report)(doc, field, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5551|       |
 5552|  3.68k|        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  3.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5553|  3.68k|        TrimSpaces(doc, field);
 5554|  3.68k|        DEBUG_LOG_EXIT;
 5555|  3.68k|        return NULL;
 5556|  4.49k|    }
 5557|       |
 5558|    776|    if (!(field->tag->model & CM_OPT))
  ------------------
  |  |  154|    776|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (5558:9): [True: 272, False: 504]
  ------------------
 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|    776|    DEBUG_LOG_EXIT;
 5561|       |    return NULL;
 5562|  4.65k|}
prvTidyParseTitle:
 5574|  6.97k|{
 5575|  6.97k|    Node *node;
 5576|  15.7k|    while ((node = TY_(GetToken)(doc, MixedContent)) != NULL)
  ------------------
  |  |   23|  15.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5576:12): [True: 15.2k, False: 569]
  ------------------
 5577|  15.2k|    {
 5578|  15.2k|        if (node->tag == title->tag && node->type == StartTag
  ------------------
  |  Branch (5578:13): [True: 6.45k, False: 8.77k]
  |  Branch (5578:40): [True: 471, False: 5.98k]
  ------------------
 5579|    471|            && cfgBool(doc, TidyCoerceEndTags) )
  ------------------
  |  |  418|    471|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    471|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 471, False: 0]
  |  |  ------------------
  ------------------
 5580|    471|        {
 5581|    471|            TY_(Report)(doc, title, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|    471|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    471|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5582|    471|            node->type = EndTag;
 5583|    471|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    471|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    471|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5584|    471|            continue;
 5585|    471|        }
 5586|  14.7k|        else if (node->tag == title->tag && node->type == EndTag)
  ------------------
  |  Branch (5586:18): [True: 5.98k, False: 8.77k]
  |  Branch (5586:45): [True: 477, False: 5.50k]
  ------------------
 5587|    477|        {
 5588|    477|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    477|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    477|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5589|    477|            title->closed = yes;
 5590|    477|            TrimSpaces(doc, title);
 5591|    477|            return NULL;
 5592|    477|        }
 5593|       |
 5594|  14.2k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  14.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5594:13): [True: 4.00k, False: 10.2k]
  ------------------
 5595|  4.00k|        {
 5596|       |            /* only called for 1st child */
 5597|  4.00k|            if (title->content == NULL)
  ------------------
  |  Branch (5597:17): [True: 1.97k, False: 2.03k]
  ------------------
 5598|  1.97k|                TrimInitialSpace(doc, title, node);
 5599|       |
 5600|  4.00k|            if (node->start >= node->end)
  ------------------
  |  Branch (5600:17): [True: 1.19k, False: 2.81k]
  ------------------
 5601|  1.19k|            {
 5602|  1.19k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5603|  1.19k|                continue;
 5604|  1.19k|            }
 5605|       |
 5606|  2.81k|            TY_(InsertNodeAtEnd)(title, node);
  ------------------
  |  |   23|  2.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5607|  2.81k|            continue;
 5608|  4.00k|        }
 5609|       |
 5610|       |        /* deal with comments etc. */
 5611|  10.2k|        if (InsertMisc(title, node))
  ------------------
  |  Branch (5611:13): [True: 281, False: 9.99k]
  ------------------
 5612|    281|            continue;
 5613|       |
 5614|       |        /* discard unknown tags */
 5615|  9.99k|        if (node->tag == NULL)
  ------------------
  |  Branch (5615:13): [True: 4.07k, False: 5.92k]
  ------------------
 5616|  4.07k|        {
 5617|  4.07k|            TY_(Report)(doc, title, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  4.07k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.07k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5618|  4.07k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  4.07k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.07k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5619|  4.07k|            continue;
 5620|  4.07k|        }
 5621|       |
 5622|       |        /* pushback unexpected tokens */
 5623|  5.92k|        TY_(Report)(doc, title, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  5.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5624|  5.92k|        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  5.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5625|  5.92k|        TrimSpaces(doc, title);
 5626|  5.92k|        return NULL;
 5627|  9.99k|    }
 5628|       |
 5629|    569|    TY_(Report)(doc, title, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|    569|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    569|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5630|       |    return NULL;
 5631|  6.97k|}
prvTidyCheckNodeIntegrity:
 5902|  5.36M|{
 5903|  5.36M|#ifndef NO_NODE_INTEGRITY_CHECK
 5904|  5.36M|    Node *child;
 5905|       |
 5906|  5.36M|    if (node->prev)
  ------------------
  |  Branch (5906:9): [True: 1.16M, False: 4.19M]
  ------------------
 5907|  1.16M|    {
 5908|  1.16M|        if (node->prev->next != node)
  ------------------
  |  Branch (5908:13): [True: 0, False: 1.16M]
  ------------------
 5909|      0|            return no;
 5910|  1.16M|    }
 5911|       |
 5912|  5.36M|    if (node->next)
  ------------------
  |  Branch (5912:9): [True: 1.16M, False: 4.19M]
  ------------------
 5913|  1.16M|    {
 5914|  1.16M|        if (node->next == node || node->next->prev != node)
  ------------------
  |  Branch (5914:13): [True: 0, False: 1.16M]
  |  Branch (5914:35): [True: 0, False: 1.16M]
  ------------------
 5915|      0|            return no;
 5916|  1.16M|    }
 5917|       |
 5918|  5.36M|    if (node->parent)
  ------------------
  |  Branch (5918:9): [True: 5.32M, False: 42.6k]
  ------------------
 5919|  5.32M|    {
 5920|  5.32M|        if (node->prev == NULL && node->parent->content != node)
  ------------------
  |  Branch (5920:13): [True: 4.15M, False: 1.16M]
  |  Branch (5920:35): [True: 0, False: 4.15M]
  ------------------
 5921|      0|            return no;
 5922|       |
 5923|  5.32M|        if (node->next == NULL && node->parent->last != node)
  ------------------
  |  Branch (5923:13): [True: 4.15M, False: 1.16M]
  |  Branch (5923:35): [True: 0, False: 4.15M]
  ------------------
 5924|      0|            return no;
 5925|  5.32M|    }
 5926|       |
 5927|  10.6M|    for (child = node->content; child; child = child->next)
  ------------------
  |  Branch (5927:33): [True: 5.32M, False: 5.36M]
  ------------------
 5928|  5.32M|        if ( child->parent != node || !TY_(CheckNodeIntegrity)(child) )
  ------------------
  |  |   23|  5.32M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.32M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5928:14): [True: 0, False: 5.32M]
  |  Branch (5928:39): [True: 0, False: 5.32M]
  ------------------
 5929|      0|            return no;
 5930|       |
 5931|  5.36M|#endif
 5932|  5.36M|    return yes;
 5933|  5.36M|}
prvTidyCoerceNode:
 5941|  8.83k|{
 5942|  8.83k|    const Dict* tag = TY_(LookupTagDef)(tid);
  ------------------
  |  |   23|  8.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5943|  8.83k|    Node* tmp = TY_(InferredTag)(doc, tag->id);
  ------------------
  |  |   23|  8.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5944|       |
 5945|  8.83k|    if (obsolete)
  ------------------
  |  Branch (5945:9): [True: 1.31k, False: 7.52k]
  ------------------
 5946|  1.31k|        TY_(Report)(doc, node, tmp, OBSOLETE_ELEMENT);
  ------------------
  |  |   23|  1.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5947|  7.52k|    else if (unexpected)
  ------------------
  |  Branch (5947:14): [True: 0, False: 7.52k]
  ------------------
 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|  7.52k|    else
 5950|  7.52k|        TY_(Report)(doc, node, tmp, REPLACING_ELEMENT);
  ------------------
  |  |   23|  7.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5951|       |
 5952|  8.83k|    TidyDocFree(doc, tmp->element);
  ------------------
  |  |  159|  8.83k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  8.83k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 5953|  8.83k|    TidyDocFree(doc, tmp);
  ------------------
  |  |  159|  8.83k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  8.83k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 5954|       |
 5955|  8.83k|    node->was = node->tag;
 5956|  8.83k|    node->tag = tag;
 5957|  8.83k|    node->type = StartTag;
 5958|  8.83k|    node->implicit = yes;
 5959|  8.83k|    TidyDocFree(doc, node->element);
  ------------------
  |  |  159|  8.83k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  8.83k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 5960|  8.83k|    node->element = TY_(tmbstrdup)(doc->allocator, tag->name);
  ------------------
  |  |   23|  8.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5961|  8.83k|}
prvTidyDiscardElement:
 5968|   627k|{
 5969|   627k|    Node *next = NULL;
 5970|       |
 5971|   627k|    if (element)
  ------------------
  |  Branch (5971:9): [True: 627k, False: 0]
  ------------------
 5972|   627k|    {
 5973|   627k|        next = element->next;
 5974|   627k|        TY_(RemoveNode)(element);
  ------------------
  |  |   23|   627k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   627k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5975|   627k|        TY_(FreeNode)( doc, element);
  ------------------
  |  |   23|   627k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   627k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5976|   627k|    }
 5977|       |
 5978|   627k|    return next;
 5979|   627k|}
prvTidyDropEmptyElements:
 5986|  2.44M|{
 5987|  2.44M|    Node* next;
 5988|       |
 5989|  5.79M|    while (node)
  ------------------
  |  Branch (5989:12): [True: 3.34M, False: 2.44M]
  ------------------
 5990|  3.34M|    {
 5991|  3.34M|        next = node->next;
 5992|       |
 5993|  3.34M|        if (node->content)
  ------------------
  |  Branch (5993:13): [True: 2.42M, False: 916k]
  ------------------
 5994|  2.42M|            TY_(DropEmptyElements)(doc, node->content);
  ------------------
  |  |   23|  2.42M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.42M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5995|       |
 5996|  3.34M|        if (!TY_(nodeIsElement)(node) &&
  ------------------
  |  |   23|  3.34M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.34M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5996:13): [True: 536k, False: 2.80M]
  ------------------
 5997|   536k|            !(TY_(nodeIsText)(node) && !(node->start < node->end)))
  ------------------
  |  |   23|   536k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   536k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5997:15): [True: 257k, False: 278k]
  |  Branch (5997:40): [True: 63.6k, False: 193k]
  ------------------
 5998|   472k|        {
 5999|   472k|            node = next;
 6000|   472k|            continue;
 6001|   472k|        }
 6002|       |
 6003|  2.87M|        next = TY_(TrimEmptyElement)(doc, node);
  ------------------
  |  |   23|  2.87M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.87M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6004|  2.87M|        node = next;
 6005|  2.87M|    }
 6006|       |
 6007|  2.44M|    return node;
 6008|  2.44M|}
prvTidyInsertNodeAtStart:
 6015|  22.8k|{
 6016|  22.8k|    node->parent = element;
 6017|       |
 6018|  22.8k|    if (element->content == NULL)
  ------------------
  |  Branch (6018:9): [True: 640, False: 22.2k]
  ------------------
 6019|    640|        element->last = node;
 6020|  22.2k|    else
 6021|  22.2k|        element->content->prev = node;
 6022|       |
 6023|  22.8k|    node->next = element->content;
 6024|       |    node->prev = NULL;
 6025|  22.8k|    element->content = node;
 6026|  22.8k|}
prvTidyInsertNodeAtEnd:
 6033|  3.21M|{
 6034|  3.21M|    node->parent = element;
 6035|  3.21M|    node->prev = element ? element->last : NULL;
  ------------------
  |  Branch (6035:18): [True: 3.21M, False: 301]
  ------------------
 6036|       |
 6037|  3.21M|    if (element && element->last != NULL)
  ------------------
  |  Branch (6037:9): [True: 3.21M, False: 301]
  |  Branch (6037:20): [True: 686k, False: 2.52M]
  ------------------
 6038|   686k|        element->last->next = node;
 6039|  2.52M|    else
 6040|  2.52M|        if (element)
  ------------------
  |  Branch (6040:13): [True: 2.52M, False: 301]
  ------------------
 6041|  2.52M|            element->content = node;
 6042|       |
 6043|  3.21M|    if (element)
  ------------------
  |  Branch (6043:9): [True: 3.21M, False: 301]
  ------------------
 6044|  3.21M|        element->last = node;
 6045|  3.21M|}
prvTidyInsertNodeBeforeElement:
 6052|   114k|{
 6053|   114k|    Node *parent;
 6054|       |
 6055|   114k|    parent = element ? element->parent : NULL;
  ------------------
  |  Branch (6055:14): [True: 113k, False: 1.27k]
  ------------------
 6056|   114k|    node->parent = parent;
 6057|   114k|    node->next = element;
 6058|   114k|    node->prev = element ? element->prev : NULL;
  ------------------
  |  Branch (6058:18): [True: 113k, False: 1.27k]
  ------------------
 6059|   114k|    if (element)
  ------------------
  |  Branch (6059:9): [True: 113k, False: 1.27k]
  ------------------
 6060|   113k|        element->prev = node;
 6061|       |
 6062|   114k|    if (node->prev)
  ------------------
  |  Branch (6062:9): [True: 39.7k, False: 74.5k]
  ------------------
 6063|  39.7k|        node->prev->next = node;
 6064|       |
 6065|   114k|    if (parent && parent->content == element)
  ------------------
  |  Branch (6065:9): [True: 111k, False: 2.95k]
  |  Branch (6065:19): [True: 72.8k, False: 38.5k]
  ------------------
 6066|  72.8k|        parent->content = node;
 6067|   114k|}
prvTidyInsertNodeAfterElement:
 6074|   128k|{
 6075|   128k|    Node *parent;
 6076|       |
 6077|   128k|    parent = element->parent;
 6078|   128k|    node->parent = parent;
 6079|       |
 6080|       |    /* AQ - 13 Jan 2000 fix for parent == NULL */
 6081|   128k|    if (parent != NULL && parent->last == element)
  ------------------
  |  Branch (6081:9): [True: 126k, False: 1.90k]
  |  Branch (6081:27): [True: 81.5k, False: 44.7k]
  ------------------
 6082|  81.5k|        parent->last = node;
 6083|  46.6k|    else
 6084|  46.6k|    {
 6085|  46.6k|        node->next = element->next;
 6086|       |        /* AQ - 13 Jan 2000 fix for node->next == NULL */
 6087|  46.6k|        if (node->next != NULL)
  ------------------
  |  Branch (6087:13): [True: 44.9k, False: 1.72k]
  ------------------
 6088|  44.9k|            node->next->prev = node;
 6089|  46.6k|    }
 6090|       |
 6091|   128k|    element->next = node;
 6092|   128k|    node->prev = element;
 6093|   128k|}
prvTidyIsBlank:
 6101|    416|{
 6102|    416|    Bool isBlank = TY_(nodeIsText)(node);
  ------------------
  |  |   23|    416|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    416|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6103|    416|    if ( isBlank )
  ------------------
  |  Branch (6103:10): [True: 0, False: 416]
  ------------------
 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|    416|    return isBlank;
 6109|    416|}
prvTidyIsJavaScript:
 6117|  4.77k|{
 6118|  4.77k|    Bool result = no;
 6119|  4.77k|    AttVal *attr;
 6120|       |
 6121|  4.77k|    if (node->attributes == NULL)
  ------------------
  |  Branch (6121:9): [True: 2.03k, False: 2.73k]
  ------------------
 6122|  2.03k|        return yes;
 6123|       |
 6124|  6.81k|    for (attr = node->attributes; attr; attr = attr->next)
  ------------------
  |  Branch (6124:35): [True: 4.49k, False: 2.32k]
  ------------------
 6125|  4.49k|    {
 6126|  4.49k|        if ( (attrIsLANGUAGE(attr) || attrIsTYPE(attr))
  ------------------
  |  |  252|  4.49k|#define attrIsLANGUAGE(av)          AttrIsId( av, TidyAttr_LANGUAGE  )
  |  |  ------------------
  |  |  |  |  169|  8.98k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.49k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.12k, False: 1.36k]
  |  |  |  |  |  Branch (169:51): [True: 812, False: 2.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( (attrIsLANGUAGE(attr) || attrIsTYPE(attr))
  ------------------
  |  |  330|  3.67k|#define attrIsTYPE(av)              AttrIsId( av, TidyAttr_TYPE  )
  |  |  ------------------
  |  |  |  |  169|  3.67k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.67k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.31k, False: 1.36k]
  |  |  |  |  |  Branch (169:51): [True: 1.62k, False: 686]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6127|  2.44k|             && AttrContains(attr, "javascript") )
  ------------------
  |  |  174|  2.44k|#define AttrContains(attr, val) (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  4.88k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 2.44k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 2.04k, False: 395]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  2.44k|                                 TY_(tmbsubstr)((attr)->value, val) != NULL)
  |  |  ------------------
  |  |  |  |   23|  2.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  2.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (175:34): [True: 408, False: 1.63k]
  |  |  ------------------
  ------------------
 6128|    408|        {
 6129|    408|            result = yes;
 6130|    408|            break;
 6131|    408|        }
 6132|  4.49k|    }
 6133|       |
 6134|  2.73k|    return result;
 6135|  4.77k|}
prvTidyRemoveNode:
 6157|   644k|{
 6158|   644k|    if (node->prev)
  ------------------
  |  Branch (6158:9): [True: 164k, False: 480k]
  ------------------
 6159|   164k|        node->prev->next = node->next;
 6160|       |
 6161|   644k|    if (node->next)
  ------------------
  |  Branch (6161:9): [True: 315k, False: 328k]
  ------------------
 6162|   315k|        node->next->prev = node->prev;
 6163|       |
 6164|   644k|    if (node->parent)
  ------------------
  |  Branch (6164:9): [True: 635k, False: 8.92k]
  ------------------
 6165|   635k|    {
 6166|   635k|        if (node->parent->content == node)
  ------------------
  |  Branch (6166:13): [True: 471k, False: 164k]
  ------------------
 6167|   471k|            node->parent->content = node->next;
 6168|       |
 6169|   635k|        if (node->parent->last == node)
  ------------------
  |  Branch (6169:13): [True: 319k, False: 315k]
  ------------------
 6170|   319k|            node->parent->last = node->prev;
 6171|   635k|    }
 6172|       |
 6173|       |    node->parent = node->prev = node->next = NULL;
 6174|   644k|    return node;
 6175|   644k|}
prvTidyTrimEmptyElement:
 6182|  2.87M|{
 6183|  2.87M|    if ( CanPrune(doc, element) )
  ------------------
  |  Branch (6183:10): [True: 619k, False: 2.25M]
  ------------------
 6184|   619k|    {
 6185|   619k|        if (element->type != TextNode)
  ------------------
  |  Branch (6185:13): [True: 555k, False: 63.6k]
  ------------------
 6186|   555k|        {
 6187|   555k|            doc->footnotes |= FN_TRIM_EMPTY_ELEMENT;
  ------------------
  |  |  309|   555k|#define FN_TRIM_EMPTY_ELEMENT     1
  ------------------
 6188|   555k|            TY_(Report)(doc, element, NULL, TRIM_EMPTY_ELEMENT);
  ------------------
  |  |   23|   555k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   555k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6189|   555k|        }
 6190|       |
 6191|   619k|        return TY_(DiscardElement)(doc, element);
  ------------------
  |  |   23|   619k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   619k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6192|   619k|    }
 6193|  2.25M|    return element->next;
 6194|  2.87M|}
prvTidyParseDocument:
 6246|  21.3k|{
 6247|  21.3k|    Node *node, *html, *doctype = NULL;
 6248|       |
 6249|  30.7k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  30.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  30.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6249:12): [True: 27.1k, False: 3.59k]
  ------------------
 6250|  27.1k|    {
 6251|  27.1k|        if (node->type == XmlDecl)
  ------------------
  |  Branch (6251:13): [True: 864, False: 26.2k]
  ------------------
 6252|    864|        {
 6253|    864|            doc->xmlDetected = yes;
 6254|       |
 6255|    864|            if (TY_(FindXmlDecl)(doc) && doc->root.content)
  ------------------
  |  |   23|    864|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    864|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6255:17): [True: 726, False: 138]
  |  Branch (6255:42): [True: 726, False: 0]
  ------------------
 6256|    726|            {
 6257|    726|                TY_(Report)(doc, &doc->root, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    726|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    726|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6258|    726|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    726|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    726|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6259|    726|                continue;
 6260|    726|            }
 6261|    138|            if (node->line > 1 || node->column != 1)
  ------------------
  |  Branch (6261:17): [True: 8, False: 130]
  |  Branch (6261:35): [True: 58, False: 72]
  ------------------
 6262|     66|            {
 6263|     66|                TY_(Report)(doc, &doc->root, node, SPACE_PRECEDING_XMLDECL);
  ------------------
  |  |   23|     66|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     66|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6264|     66|            }
 6265|    138|        }
 6266|       |
 6267|       |        /* deal with comments etc. */
 6268|  26.3k|        if (InsertMisc( &doc->root, node ))
  ------------------
  |  Branch (6268:13): [True: 4.44k, False: 21.9k]
  ------------------
 6269|  4.44k|            continue;
 6270|       |
 6271|  21.9k|        if (node->type == DocTypeTag)
  ------------------
  |  Branch (6271:13): [True: 4.00k, False: 17.9k]
  ------------------
 6272|  4.00k|        {
 6273|  4.00k|            if (doctype == NULL)
  ------------------
  |  Branch (6273:17): [True: 1.83k, False: 2.16k]
  ------------------
 6274|  1.83k|            {
 6275|  1.83k|                TY_(InsertNodeAtEnd)( &doc->root, node);
  ------------------
  |  |   23|  1.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6276|  1.83k|                doctype = node;
 6277|  1.83k|            }
 6278|  2.16k|            else
 6279|  2.16k|            {
 6280|  2.16k|                TY_(Report)(doc, &doc->root, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6281|  2.16k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6282|  2.16k|            }
 6283|  4.00k|            continue;
 6284|  4.00k|        }
 6285|       |
 6286|  17.9k|        if (node->type == EndTag)
  ------------------
  |  Branch (6286:13): [True: 228, False: 17.7k]
  ------------------
 6287|    228|        {
 6288|    228|            TY_(Report)(doc, &doc->root, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    228|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    228|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6289|    228|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    228|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    228|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6290|    228|            continue;
 6291|    228|        }
 6292|       |
 6293|  17.7k|        if (node->type == StartTag && nodeIsHTML(node))
  ------------------
  |  |  370|  12.2k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  12.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 12.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.6k, False: 1.65k]
  |  |  |  |  |  Branch (275:54): [True: 44, False: 10.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6293:13): [True: 12.2k, False: 5.41k]
  ------------------
 6294|     44|        {
 6295|     44|            AttVal *xmlns = TY_(AttrGetById)(node, TidyAttr_XMLNS);
  ------------------
  |  |   23|     44|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     44|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6296|       |
 6297|     44|            if (AttrValueIs(xmlns, XHTML_NAMESPACE))
  ------------------
  |  |  172|     44|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|     88|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 0, False: 44]
  |  |  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|     44|                                 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|     44|        }
 6312|       |
 6313|  17.7k|        if ( node->type != StartTag || !nodeIsHTML(node) )
  ------------------
  |  |  370|  12.2k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  12.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 12.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.6k, False: 1.65k]
  |  |  |  |  |  Branch (275:54): [True: 44, False: 10.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6313:14): [True: 5.41k, False: 12.2k]
  ------------------
 6314|  17.6k|        {
 6315|  17.6k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  17.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6316|  17.6k|            html = TY_(InferredTag)(doc, TidyTag_HTML);
  ------------------
  |  |   23|  17.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6317|  17.6k|        }
 6318|     44|        else
 6319|     44|            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|  17.7k|        if (!TY_(FindDocType)(doc))
  ------------------
  |  |   23|  17.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6326:13): [True: 17.2k, False: 466]
  ------------------
 6327|  17.2k|        {
 6328|  17.2k|            ulong dtmode = cfg( doc, TidyDoctypeMode );
  ------------------
  |  |  415|  17.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 6329|  17.2k|            if ((dtmode != TidyDoctypeOmit) && !showingBodyOnly(doc))
  ------------------
  |  |   28|  17.2k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  17.2k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  17.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6329:17): [True: 17.2k, False: 0]
  |  Branch (6329:17): [True: 17.2k, False: 0]
  |  Branch (6329:48): [True: 17.2k, False: 0]
  ------------------
 6330|  17.2k|                TY_(Report)(doc, NULL, NULL, MISSING_DOCTYPE);
  ------------------
  |  |   23|  17.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6331|  17.2k|            if ((dtmode != TidyDoctypeAuto) && (dtmode != TidyDoctypeHtml5))
  ------------------
  |  Branch (6331:17): [True: 0, False: 17.2k]
  |  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|  17.2k|        }
 6340|  17.7k|        TY_(InsertNodeAtEnd)( &doc->root, html);
  ------------------
  |  |   23|  17.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6341|  17.7k|        ParseHTMLWithNode( doc, html );
 6342|  17.7k|        break;
 6343|  17.9k|    }
 6344|       |
 6345|       |    /* do this before any more document fixes */
 6346|  21.3k|    if ( cfg( doc, TidyAccessibilityCheckLevel ) > 0 )
  ------------------
  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (6346:10): [True: 0, False: 21.3k]
  ------------------
 6347|      0|        TY_(AccessibilityChecks)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6348|       |
 6349|  21.3k|    if (!TY_(FindHTML)(doc))
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6349:9): [True: 3.59k, False: 17.7k]
  ------------------
 6350|  3.59k|    {
 6351|       |        /* a later check should complain if <body> is empty */
 6352|  3.59k|        html = TY_(InferredTag)(doc, TidyTag_HTML);
  ------------------
  |  |   23|  3.59k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.59k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6353|  3.59k|        TY_(InsertNodeAtEnd)( &doc->root, html);
  ------------------
  |  |   23|  3.59k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.59k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6354|  3.59k|        ParseHTMLWithNode( doc, html );
 6355|  3.59k|    }
 6356|       |
 6357|  21.3k|    node = TY_(FindTITLE)(doc);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6358|  21.3k|    if (!node)
  ------------------
  |  Branch (6358:9): [True: 21.1k, False: 124]
  ------------------
 6359|  21.1k|    {
 6360|  21.1k|        Node* head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  21.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6361|       |        /* #72, avoid MISSING_TITLE_ELEMENT if show-body-only (but allow InsertNodeAtEnd to avoid new warning) */
 6362|  42.3k|        if (!showingBodyOnly(doc))
  ------------------
  |  |   28|  21.1k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  21.1k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  21.1k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6362:13): [True: 21.1k, False: 0]
  |  Branch (6362:13): [True: 21.1k, False: 0]
  ------------------
 6363|  21.1k|        {
 6364|  21.1k|            TY_(Report)(doc, head, NULL, MISSING_TITLE_ELEMENT);
  ------------------
  |  |   23|  21.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6365|  21.1k|        }
 6366|  21.1k|        TY_(InsertNodeAtEnd)(head, TY_(InferredTag)(doc, TidyTag_TITLE));
  ------------------
  |  |   23|  21.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(InsertNodeAtEnd)(head, TY_(InferredTag)(doc, TidyTag_TITLE));
  ------------------
  |  |   23|  21.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6367|  21.1k|    }
 6368|    124|    else if (!node->content && !showingBodyOnly(doc))
  ------------------
  |  |   28|     79|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|     79|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|     79|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6368:14): [True: 79, False: 45]
  |  Branch (6368:14): [True: 79, False: 45]
  |  Branch (6368:32): [True: 79, False: 0]
  ------------------
 6369|     79|    {
 6370|       |        /* Is #839 - warn node is blank in HTML5 */
 6371|     79|        if (TY_(IsHTML5Mode)(doc))
  ------------------
  |  |   23|     79|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     79|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6371:13): [True: 74, False: 5]
  ------------------
 6372|     74|        {
 6373|     74|            TY_(Report)(doc, node, NULL, BLANK_TITLE_ELEMENT);
  ------------------
  |  |   23|     74|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     74|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6374|     74|        }
 6375|     79|    }
 6376|       |
 6377|  21.3k|    AttributeChecks(doc, &doc->root);
 6378|  21.3k|    ReplaceObsoleteElements(doc, &doc->root);
 6379|  21.3k|    TY_(DropEmptyElements)(doc, &doc->root);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6380|  21.3k|    CleanSpaces(doc, &doc->root);
 6381|       |
 6382|  21.3k|    if (cfgBool(doc, TidyEncloseBodyText))
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
 6383|      0|        EncloseBodyText(doc);
 6384|  21.3k|    if (cfgBool(doc, TidyEncloseBlockText))
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
 6385|      0|        EncloseBlockText(doc, &doc->root);
 6386|  21.3k|}
parser.c:growParserStack:
  870|  4.46k|{
  871|  4.46k|    TidyParserMemory *content;
  872|  4.46k|    content = (TidyParserMemory *) TidyAlloc( doc->allocator, sizeof(TidyParserMemory) * doc->stack.size * 2 );
  ------------------
  |  |   66|  4.46k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  873|       |
  874|  4.46k|    memcpy( content, doc->stack.content, sizeof(TidyParserMemory) * (doc->stack.top + 1) );
  875|  4.46k|    TidyFree(doc->allocator, doc->stack.content);
  ------------------
  |  |   68|  4.46k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  876|       |
  877|  4.46k|    doc->stack.content = content;
  878|  4.46k|    doc->stack.size = doc->stack.size * 2;
  879|  4.46k|}
parser.c:GetParserForNode:
 1017|  2.80M|{
 1018|  2.80M|    Lexer* lexer = doc->lexer;
 1019|       |
 1020|  2.80M|    if ( cfgBool( doc, TidyXmlTags ) )
  ------------------
  |  |  418|  2.80M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.80M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 2.80M]
  |  |  ------------------
  ------------------
 1021|      0|        return ParseXMLElement;
 1022|       |    
 1023|       |    /* [i_a]2 prevent crash for active content (php, asp) docs */
 1024|  2.80M|    if (!node || node->tag == NULL)
  ------------------
  |  Branch (1024:9): [True: 0, False: 2.80M]
  |  Branch (1024:18): [True: 5.37k, False: 2.79M]
  ------------------
 1025|  5.37k|        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.79M|    if (node->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  2.79M|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (1031:9): [True: 23.3k, False: 2.77M]
  ------------------
 1032|  23.3k|    {
 1033|  23.3k|        lexer->waswhite = no;
 1034|  23.3k|        if (node->tag->parser == NULL)
  ------------------
  |  Branch (1034:13): [True: 0, False: 23.3k]
  ------------------
 1035|      0|            return NULL;
 1036|  23.3k|    }
 1037|  2.77M|    else if (!(node->tag->model & CM_INLINE))
  ------------------
  |  |  143|  2.77M|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1037:14): [True: 603k, False: 2.16M]
  ------------------
 1038|   603k|        lexer->insertspace = no;
 1039|       |
 1040|  2.79M|    if (node->tag->parser == NULL)
  ------------------
  |  Branch (1040:9): [True: 0, False: 2.79M]
  ------------------
 1041|      0|        return NULL;
 1042|       |
 1043|  2.79M|    if (node->type == StartEndTag)
  ------------------
  |  Branch (1043:9): [True: 8.29k, False: 2.78M]
  ------------------
 1044|  8.29k|        return NULL;
 1045|       |
 1046|       |    /* [i_a]2 added this - not sure why - CHECKME: */
 1047|  2.78M|    lexer->parent = node;
 1048|       |
 1049|  2.78M|    return (node->tag->parser);
 1050|  2.79M|}
parser.c:DescendantOf:
  339|   414k|{
  340|   414k|    Node *parent;
  341|   414k|    for ( parent = element->parent;
  342|   256M|         parent != NULL;
  ------------------
  |  Branch (342:10): [True: 256M, False: 349k]
  ------------------
  343|   255M|         parent = parent->parent )
  344|   256M|    {
  345|   256M|        if ( TagIsId(parent, tid) )
  ------------------
  |  |  275|   256M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  ------------------
  |  |  |  Branch (275:29): [True: 256M, False: 0]
  |  |  |  Branch (275:39): [True: 255M, False: 344k]
  |  |  |  Branch (275:54): [True: 65.4k, False: 255M]
  |  |  ------------------
  ------------------
  346|  65.4k|            return yes;
  347|   256M|    }
  348|   349k|    return no;
  349|   414k|}
parser.c:TrimSpaces:
  725|  1.19M|{
  726|  1.19M|    Node* text = element->content;
  727|       |
  728|  1.19M|    if (nodeIsPRE(element) || IsPreDescendant(element))
  ------------------
  |  |  383|  1.19M|#define nodeIsPRE( node )        TagIsId( node, TidyTag_PRE )
  |  |  ------------------
  |  |  |  |  275|  2.38M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.19M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.19M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.98k, False: 1.18M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (728:31): [True: 13.0k, False: 1.17M]
  ------------------
  729|  19.0k|        return;
  730|       |
  731|  1.17M|    if (TY_(nodeIsText)(text))
  ------------------
  |  |   23|  1.17M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.17M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (731:9): [True: 112k, False: 1.06M]
  ------------------
  732|   112k|        TrimInitialSpace(doc, element, text);
  733|       |
  734|  1.17M|    text = element->last;
  735|       |
  736|  1.17M|    if (TY_(nodeIsText)(text))
  ------------------
  |  |   23|  1.17M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.17M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (736:9): [True: 52.3k, False: 1.12M]
  ------------------
  737|  52.3k|        TrimTrailingSpace(doc, element, text);
  738|  1.17M|}
parser.c:IsPreDescendant:
  356|  1.57M|{
  357|  1.57M|    Node *parent = node->parent;
  358|       |
  359|  4.15G|    while (parent)
  ------------------
  |  Branch (359:12): [True: 4.15G, False: 1.55M]
  ------------------
  360|  4.15G|    {
  361|  4.15G|        if (parent->tag && parent->tag->parser == TY_(ParsePre))
  ------------------
  |  |   23|  4.15G|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.15G|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (361:13): [True: 4.15G, False: 3.90M]
  |  Branch (361:28): [True: 20.7k, False: 4.15G]
  ------------------
  362|  20.7k|            return yes;
  363|       |
  364|  4.15G|        parent = parent->parent;
  365|  4.15G|    }
  366|       |
  367|  1.55M|    return no;
  368|  1.57M|}
parser.c:TrimTrailingSpace:
  691|  52.3k|{
  692|  52.3k|    Lexer* lexer = doc->lexer;
  693|  52.3k|    byte c;
  694|       |
  695|  52.3k|    if (TY_(nodeIsText)(last))
  ------------------
  |  |   23|  52.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  52.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (695:9): [True: 52.3k, False: 0]
  ------------------
  696|  52.3k|    {
  697|  52.3k|        if (last->end > last->start)
  ------------------
  |  Branch (697:13): [True: 42.9k, False: 9.39k]
  ------------------
  698|  42.9k|        {
  699|  42.9k|            c = (byte) lexer->lexbuf[ last->end - 1 ];
  700|       |
  701|  42.9k|            if ( c == ' ' )
  ------------------
  |  Branch (701:18): [True: 2.21k, False: 40.7k]
  ------------------
  702|  2.21k|            {
  703|  2.21k|                last->end -= 1;
  704|  2.21k|                if ( (element->tag->model & CM_INLINE) &&
  ------------------
  |  |  143|  2.21k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (704:22): [True: 1.63k, False: 583]
  ------------------
  705|  1.63k|                     !(element->tag->model & CM_FIELD) )
  ------------------
  |  |  149|  1.63k|#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: 1.33k, False: 296]
  ------------------
  706|  1.33k|                    lexer->insertspace = yes;
  707|  2.21k|            }
  708|  42.9k|        }
  709|  52.3k|    }
  710|  52.3k|}
parser.c:InsertMisc:
   90|  4.23M|{
   91|  4.23M|    if (node->type == CommentTag ||
  ------------------
  |  Branch (91:9): [True: 36.7k, False: 4.20M]
  ------------------
   92|  4.20M|        node->type == ProcInsTag ||
  ------------------
  |  Branch (92:9): [True: 42.1k, False: 4.15M]
  ------------------
   93|  4.15M|        node->type == CDATATag ||
  ------------------
  |  Branch (93:9): [True: 791, False: 4.15M]
  ------------------
   94|  4.15M|        node->type == SectionTag ||
  ------------------
  |  Branch (94:9): [True: 81.0k, False: 4.07M]
  ------------------
   95|  4.07M|        node->type == AspTag ||
  ------------------
  |  Branch (95:9): [True: 38.4k, False: 4.03M]
  ------------------
   96|  4.03M|        node->type == JsteTag ||
  ------------------
  |  Branch (96:9): [True: 39.4k, False: 3.99M]
  ------------------
   97|  3.99M|        node->type == PhpTag )
  ------------------
  |  Branch (97:9): [True: 351, False: 3.99M]
  ------------------
   98|   238k|    {
   99|   238k|        TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|   238k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   238k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  100|   238k|        return yes;
  101|   238k|    }
  102|       |
  103|  3.99M|    if ( node->type == XmlDecl )
  ------------------
  |  Branch (103:10): [True: 5.95k, False: 3.99M]
  ------------------
  104|  5.95k|    {
  105|  5.95k|        Node* root = element;
  106|  22.4k|        while ( root && root->parent )
  ------------------
  |  Branch (106:17): [True: 22.4k, False: 0]
  |  Branch (106:25): [True: 16.4k, False: 5.95k]
  ------------------
  107|  16.4k|            root = root->parent;
  108|  5.95k|        if ( root && !(root->content && root->content->type == XmlDecl))
  ------------------
  |  Branch (108:14): [True: 5.95k, False: 0]
  |  Branch (108:24): [True: 5.63k, False: 322]
  |  Branch (108:41): [True: 5.37k, False: 263]
  ------------------
  109|    585|        {
  110|    585|          TY_(InsertNodeAtStart)( root, node );
  ------------------
  |  |   23|    585|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    585|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  111|    585|          return yes;
  112|    585|        }
  113|  5.95k|    }
  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|  3.99M|    if ( node->tag &&
  ------------------
  |  Branch (119:10): [True: 3.74M, False: 255k]
  ------------------
  120|  3.74M|         TY_(nodeIsElement)(node) &&
  ------------------
  |  |   23|  3.74M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.74M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (120:10): [True: 3.62M, False: 118k]
  ------------------
  121|  3.62M|         TY_(nodeCMIsEmpty)(node) && TagId(node) == TidyTag_UNKNOWN &&
  ------------------
  |  |   23|  3.62M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.62M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                       TY_(nodeCMIsEmpty)(node) && TagId(node) == TidyTag_UNKNOWN &&
  ------------------
  |  |  270|   126k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 126k, False: 0]
  |  |  |  Branch (270:39): [True: 126k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (121:10): [True: 126k, False: 3.49M]
  |  Branch (121:38): [True: 0, False: 126k]
  ------------------
  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|  3.99M|    return no;
  129|  3.99M|}
parser.c:BadForm:
  521|  1.45k|{
  522|  1.45k|    doc->badForm |= flg_BadForm;
  ------------------
  |  |   34|  1.45k|#define flg_BadForm     0x00000001
  ------------------
  523|  1.45k|}
parser.c:MoveToHead:
  206|  8.72k|{
  207|  8.72k|    Node *head = NULL;
  208|       |
  209|  8.72k|    TY_(RemoveNode)( node );  /* make sure that node is isolated */
  ------------------
  |  |   23|  8.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  210|       |
  211|  8.72k|    if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  8.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (211:10): [True: 8.52k, False: 194]
  ------------------
  212|  8.52k|    {
  213|  8.52k|        TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN );
  ------------------
  |  |   23|  8.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  214|       |
  215|  8.52k|        head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  8.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  216|  8.52k|        assert(head != NULL);
  ------------------
  |  Branch (216:9): [True: 0, False: 8.52k]
  |  Branch (216:9): [True: 8.52k, False: 0]
  ------------------
  217|       |
  218|  8.52k|        TY_(InsertNodeAtEnd)(head, node);
  ------------------
  |  |   23|  8.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  219|       |
  220|  8.52k|        if ( node->tag->parser )
  ------------------
  |  Branch (220:14): [True: 8.52k, False: 0]
  ------------------
  221|  8.52k|        {
  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|  8.52k|            Parser* parser = node->tag->parser;
  229|  8.52k|            parser( doc, node, IgnoreWhitespace );
  230|  8.52k|        }
  231|  8.52k|    }
  232|    194|    else
  233|    194|    {
  234|    194|        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  235|    194|        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  236|    194|    }
  237|  8.72k|}
parser.c:AddClassNoIndent:
  536|  2.03k|{
  537|  2.03k|    ctmbstr sprop =
  538|  2.03k|    "padding-left: 2ex; margin-left: 0ex"
  539|  2.03k|    "; margin-top: 0ex; margin-bottom: 0ex";
  540|  2.03k|    if ( !cfgBool(doc, TidyDecorateInferredUL) )
  ------------------
  |  |  418|  2.03k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.03k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (540:10): [True: 2.03k, False: 0]
  ------------------
  541|  2.03k|        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.89k|{
  615|  4.89k|    Node* existing = TY_(FindDocType)( doc );
  ------------------
  |  |   23|  4.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  616|  4.89k|    if ( existing )
  ------------------
  |  Branch (616:10): [True: 2.83k, False: 2.06k]
  ------------------
  617|  2.83k|    {
  618|  2.83k|        TY_(Report)(doc, element, doctype, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  2.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  619|  2.83k|        TY_(FreeNode)( doc, doctype );
  ------------------
  |  |   23|  2.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  620|  2.83k|    }
  621|  2.06k|    else
  622|  2.06k|    {
  623|  2.06k|        TY_(Report)(doc, element, doctype, DOCTYPE_AFTER_TAGS );
  ------------------
  |  |   23|  2.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  624|  4.29k|        while ( !nodeIsHTML(element) )
  ------------------
  |  |  370|  4.29k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  4.29k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.29k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.29k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.06k, False: 2.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  625|  2.23k|            element = element->parent;
  626|  2.06k|        TY_(InsertNodeBeforeElement)( element, doctype );
  ------------------
  |  |   23|  2.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  627|  2.06k|    }
  628|  4.89k|}
parser.c:findNodeById:
   79|    785|{
   80|    785|    Node *node = (doc ? doc->root.content : NULL);
  ------------------
  |  Branch (80:19): [True: 785, False: 0]
  ------------------
   81|    785|    return findNodeWithId( node,tid );
   82|    785|}
parser.c:findNodeWithId:
   49|  3.24k|{
   50|  3.24k|    Node *content;
   51|  6.29k|    while (node)
  ------------------
  |  Branch (51:12): [True: 4.77k, False: 1.52k]
  ------------------
   52|  4.77k|    {
   53|  4.77k|        if (TagIsId(node,tid))
  ------------------
  |  |  275|  4.77k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  ------------------
  |  |  |  Branch (275:29): [True: 4.77k, False: 0]
  |  |  |  Branch (275:39): [True: 4.12k, False: 652]
  |  |  |  Branch (275:54): [True: 547, False: 3.57k]
  |  |  ------------------
  ------------------
   54|    547|            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|  4.23k|        content = node->content;
   63|  4.23k|        if (content)
  ------------------
  |  Branch (63:13): [True: 2.46k, False: 1.76k]
  ------------------
   64|  2.46k|        {
   65|  2.46k|            if ( findNodeWithId(content,tid) )
  ------------------
  |  Branch (65:18): [True: 1.17k, False: 1.28k]
  ------------------
   66|  1.17k|                return yes;
   67|  2.46k|        }
   68|  3.05k|        node = node->next;
   69|  3.05k|    }
   70|  1.52k|    return no;
   71|  3.24k|}
parser.c:InsertNodeAsParent:
  137|  1.18k|{
  138|  1.18k|    node->content = element;
  139|  1.18k|    node->last = element;
  140|  1.18k|    node->parent = element->parent;
  141|  1.18k|    element->parent = node;
  142|       |
  143|  1.18k|    if (node->parent->content == element)
  ------------------
  |  Branch (143:9): [True: 935, False: 248]
  ------------------
  144|    935|        node->parent->content = node;
  145|       |
  146|  1.18k|    if (node->parent->last == element)
  ------------------
  |  Branch (146:9): [True: 1.11k, False: 66]
  ------------------
  147|  1.11k|        node->parent->last = node;
  148|       |
  149|  1.18k|    node->prev = element->prev;
  150|  1.18k|    element->prev = NULL;
  151|       |
  152|  1.18k|    if (node->prev)
  ------------------
  |  Branch (152:9): [True: 248, False: 935]
  ------------------
  153|    248|        node->prev->next = node;
  154|       |
  155|  1.18k|    node->next = element->next;
  156|  1.18k|    element->next = NULL;
  157|       |
  158|  1.18k|    if (node->next)
  ------------------
  |  Branch (158:9): [True: 66, False: 1.11k]
  ------------------
  159|     66|        node->next->prev = node;
  160|  1.18k|}
parser.c:FindLastLI:
  823|  82.1k|{
  824|  82.1k|    Node *node;
  825|       |
  826|  82.1k|    *lastli = NULL;
  827|  85.5k|    for ( node = list->content; node ; node = node->next )
  ------------------
  |  Branch (827:33): [True: 3.37k, False: 82.1k]
  ------------------
  828|  3.37k|        if ( nodeIsLI(node) && node->type == StartTag )
  ------------------
  |  |  390|  3.37k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|  6.74k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.37k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.55k, False: 1.81k]
  |  |  |  |  |  Branch (275:54): [True: 1.15k, False: 396]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (828:32): [True: 946, False: 211]
  ------------------
  829|    946|            *lastli=node;
  830|  82.1k|    return *lastli ? yes:no;
  ------------------
  |  Branch (830:12): [True: 946, False: 81.1k]
  ------------------
  831|  82.1k|}
parser.c:FindMatchingDescendant:
  801|  4.22k|{
  802|  4.22k|    struct MatchingDescendantData cb_data = { 0 };
  803|  4.22k|    cb_data.matching_tagId = TagId(node);
  ------------------
  |  |  270|  4.22k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 4.22k, False: 0]
  |  |  |  Branch (270:39): [True: 2.77k, False: 1.45k]
  |  |  ------------------
  ------------------
  804|  4.22k|    cb_data.node_to_find = node;
  805|  4.22k|    cb_data.marker_node = marker_node;
  806|       |
  807|  4.22k|    assert(node);
  ------------------
  |  Branch (807:5): [True: 0, False: 4.22k]
  |  Branch (807:5): [True: 4.22k, False: 0]
  ------------------
  808|       |
  809|  4.22k|    if (is_parent_of_marker)
  ------------------
  |  Branch (809:9): [True: 4.22k, False: 0]
  ------------------
  810|  4.22k|        *is_parent_of_marker = no;
  811|       |
  812|  4.22k|    TY_(TraverseNodeTree)(NULL, parent, FindDescendant_cb, &cb_data);
  ------------------
  |  |   23|  4.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  813|  4.22k|    return cb_data.found_node;
  814|  4.22k|}
parser.c:FindDescendant_cb:
  765|   329k|{
  766|   329k|    struct MatchingDescendantData *cb_data = (struct MatchingDescendantData *)propagate;
  767|       |
  768|   329k|    if (TagId(node) == cb_data->matching_tagId)
  ------------------
  |  |  270|   329k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 329k, False: 0]
  |  |  |  Branch (270:39): [True: 321k, False: 7.30k]
  |  |  ------------------
  ------------------
  |  Branch (768:9): [True: 5.57k, False: 323k]
  ------------------
  769|  5.57k|    {
  770|       |        /* make sure we match up 'unknown' tags exactly! */
  771|  5.57k|        if (cb_data->matching_tagId != TidyTag_UNKNOWN ||
  ------------------
  |  Branch (771:13): [True: 2.07k, False: 3.49k]
  ------------------
  772|  3.49k|            (node->element != NULL &&
  ------------------
  |  Branch (772:14): [True: 2.80k, False: 698]
  ------------------
  773|  2.80k|            cb_data->node_to_find != NULL &&
  ------------------
  |  Branch (773:13): [True: 2.80k, False: 0]
  ------------------
  774|  2.80k|            cb_data->node_to_find->element != NULL &&
  ------------------
  |  Branch (774:13): [True: 2.80k, False: 0]
  ------------------
  775|  2.80k|            0 == TY_(tmbstrcmp)(cb_data->node_to_find->element, node->element)))
  ------------------
  |  |   23|  2.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (775:13): [True: 751, False: 2.05k]
  ------------------
  776|  2.82k|        {
  777|  2.82k|            cb_data->found_node = node;
  778|  2.82k|            return ExitTraversal;
  779|  2.82k|        }
  780|  5.57k|    }
  781|       |
  782|   326k|    if (cb_data->passed_marker_node && node == cb_data->marker_node)
  ------------------
  |  Branch (782:9): [True: 0, False: 326k]
  |  Branch (782:40): [True: 0, False: 0]
  ------------------
  783|      0|        *cb_data->passed_marker_node = yes;
  784|       |
  785|   326k|    return VisitParent;
  786|   329k|}
parser.c:MoveNodeToBody:
  191|  1.23k|{
  192|  1.23k|    Node* body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  1.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  193|  1.23k|    if ( body )
  ------------------
  |  Branch (193:10): [True: 1.04k, False: 195]
  ------------------
  194|  1.04k|    {
  195|  1.04k|        TY_(RemoveNode)( node );
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  196|  1.04k|        TY_(InsertNodeAtEnd)( body, node );
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  197|  1.04k|    }
  198|  1.23k|}
parser.c:PreContent:
  386|   125k|{
  387|       |    /* p is coerced to br's, Text OK too */
  388|   125k|    if ( nodeIsP(node) || TY_(nodeIsText)(node) )
  ------------------
  |  |  385|   125k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|   251k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 125k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 125k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.85k, False: 120k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( nodeIsP(node) || TY_(nodeIsText)(node) )
  ------------------
  |  |   23|   120k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   120k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (388:27): [True: 0, False: 120k]
  ------------------
  389|  4.85k|        return yes;
  390|       |
  391|   120k|    if ( node->tag == NULL ||
  ------------------
  |  Branch (391:10): [True: 0, False: 120k]
  ------------------
  392|   120k|         nodeIsPARAM(node) ||
  ------------------
  |  |  409|   120k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  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: 214, False: 120k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  393|   120k|         !TY_(nodeHasCM)(node, CM_INLINE|CM_NEW) )
  ------------------
  |  |   23|   120k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   120k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                       !TY_(nodeHasCM)(node, CM_INLINE|CM_NEW) )
  ------------------
  |  |  143|   120k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                       !TY_(nodeHasCM)(node, CM_INLINE|CM_NEW) )
  ------------------
  |  |  159|   120k|#define CM_NEW          (1 << 20)  /**< User defined elements. Used to determine how attributes without value should be printed. */
  ------------------
  |  Branch (393:10): [True: 118k, False: 2.50k]
  ------------------
  394|   118k|        return no;
  395|       |
  396|  2.50k|    return yes;
  397|   120k|}
parser.c:FixEmptyRow:
  597|  2.88k|{
  598|  2.88k|    Node *cell;
  599|       |
  600|  2.88k|    if (row->content == NULL)
  ------------------
  |  Branch (600:9): [True: 2.45k, False: 437]
  ------------------
  601|  2.45k|    {
  602|  2.45k|        cell = TY_(InferredTag)(doc, TidyTag_TD);
  ------------------
  |  |   23|  2.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  603|  2.45k|        TY_(InsertNodeAtEnd)(row, cell);
  ------------------
  |  |   23|  2.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  604|  2.45k|        TY_(Report)(doc, row, cell, MISSING_STARTTAG);
  ------------------
  |  |   23|  2.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  605|  2.45k|    }
  606|  2.88k|}
parser.c:MoveBeforeTable:
  170|  36.3k|{
  171|  36.3k|    Node *table;
  172|       |
  173|       |    /* first find the table element */
  174|   931k|    for (table = row->parent; table; table = table->parent)
  ------------------
  |  Branch (174:31): [True: 897k, False: 34.4k]
  ------------------
  175|   897k|    {
  176|   897k|        if ( nodeIsTABLE(table) )
  ------------------
  |  |  393|   897k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|   897k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 897k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 864k, False: 33.1k]
  |  |  |  |  |  Branch (275:54): [True: 1.89k, False: 862k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  1.89k|        {
  178|  1.89k|            TY_(InsertNodeBeforeElement)( table, node );
  ------------------
  |  |   23|  1.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  179|  1.89k|            return;
  180|  1.89k|        }
  181|   897k|    }
  182|       |    /* No table element */
  183|  34.4k|    TY_(InsertNodeBeforeElement)( row->parent, node );
  ------------------
  |  |   23|  34.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  184|  34.4k|}
parser.c:TrimInitialSpace:
  642|   114k|{
  643|   114k|    Lexer* lexer = doc->lexer;
  644|   114k|    Node *prev, *node;
  645|       |
  646|   114k|    if ( TY_(nodeIsText)(text) &&
  ------------------
  |  |   23|   114k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   114k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (646:10): [True: 114k, False: 0]
  ------------------
  647|   114k|         lexer->lexbuf[text->start] == ' ' &&
  ------------------
  |  Branch (647:10): [True: 63.7k, False: 50.9k]
  ------------------
  648|  63.7k|         text->start < text->end )
  ------------------
  |  Branch (648:10): [True: 62.9k, False: 758]
  ------------------
  649|  62.9k|    {
  650|  62.9k|        if ( (element->tag->model & CM_INLINE) &&
  ------------------
  |  |  143|  62.9k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (650:14): [True: 52.3k, False: 10.5k]
  ------------------
  651|  52.3k|             !(element->tag->model & CM_FIELD) )
  ------------------
  |  |  149|  52.3k|#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: 51.8k, False: 470]
  ------------------
  652|  51.8k|        {
  653|  51.8k|            prev = element->prev;
  654|       |
  655|  51.8k|            if (TY_(nodeIsText)(prev))
  ------------------
  |  |   23|  51.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (655:17): [True: 539, False: 51.3k]
  ------------------
  656|    539|            {
  657|    539|                if (prev->end == 0 || lexer->lexbuf[prev->end - 1] != ' ')
  ------------------
  |  Branch (657:21): [True: 0, False: 539]
  |  Branch (657:39): [True: 273, False: 266]
  ------------------
  658|    273|                    lexer->lexbuf[(prev->end)++] = ' ';
  659|       |
  660|    539|                ++(element->start);
  661|    539|            }
  662|  51.3k|            else /* create new node */
  663|  51.3k|            {
  664|  51.3k|                node = TY_(NewNode)(lexer->allocator, lexer);
  ------------------
  |  |   23|  51.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  665|  51.3k|                node->start = (element->start)++;
  666|  51.3k|                node->end = element->start;
  667|  51.3k|                lexer->lexbuf[node->start] = ' ';
  668|  51.3k|                TY_(InsertNodeBeforeElement)(element ,node);
  ------------------
  |  |   23|  51.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  669|  51.3k|                DEBUG_LOG(SPRTF("TrimInitialSpace: Created text node, inserted before <%s>\n",
  670|  51.3k|                    (element->element ? element->element : "unknown")));
  671|  51.3k|            }
  672|  51.8k|        }
  673|       |
  674|       |        /* discard the space in current node */
  675|  62.9k|        ++(text->start);
  676|  62.9k|    }
  677|   114k|}
parser.c:CanPrune:
  250|  2.87M|{
  251|  2.87M|    if ( !cfgBool(doc, TidyDropEmptyElems) )
  ------------------
  |  |  418|  2.87M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.87M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (251:10): [True: 0, False: 2.87M]
  ------------------
  252|      0|        return no;
  253|       |
  254|  2.87M|    if ( TY_(nodeIsText)(element) )
  ------------------
  |  |   23|  2.87M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.87M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (254:10): [True: 63.6k, False: 2.80M]
  ------------------
  255|  63.6k|        return yes;
  256|       |
  257|  2.80M|    if ( element->content )
  ------------------
  |  Branch (257:10): [True: 2.09M, False: 712k]
  ------------------
  258|  2.09M|        return no;
  259|       |
  260|   712k|    if ( element->tag == NULL )
  ------------------
  |  Branch (260:10): [True: 1.14k, False: 711k]
  ------------------
  261|  1.14k|        return no;
  262|       |
  263|   711k|    if ( element->tag->model & CM_BLOCK && element->attributes != NULL )
  ------------------
  |  |  142|  1.42M|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (263:10): [True: 222k, False: 488k]
  |  Branch (263:44): [True: 16.3k, False: 206k]
  ------------------
  264|  16.3k|        return no;
  265|       |
  266|   695k|    if ( nodeIsA(element) && element->attributes != NULL )
  ------------------
  |  |  401|   695k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  1.39M|#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: 16.9k, False: 678k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:30): [True: 837, False: 16.0k]
  ------------------
  267|    837|        return no;
  268|       |
  269|   694k|    if ( nodeIsP(element) && !cfgBool(doc, TidyDropEmptyParas) )
  ------------------
  |  |  385|   694k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  1.38M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 694k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 694k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 39.3k, False: 655k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( nodeIsP(element) && !cfgBool(doc, TidyDropEmptyParas) )
  ------------------
  |  |  418|  39.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  39.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (269:30): [True: 0, False: 39.3k]
  ------------------
  270|      0|        return no;
  271|       |
  272|   694k|    if ( element->tag->model & CM_ROW )
  ------------------
  |  |  148|   694k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (272:10): [True: 4.50k, False: 689k]
  ------------------
  273|  4.50k|        return no;
  274|       |
  275|   689k|    if ( element->tag->model & CM_EMPTY )
  ------------------
  |  |  139|   689k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (275:10): [True: 36.1k, False: 653k]
  ------------------
  276|  36.1k|        return no;
  277|       |
  278|   653k|    if ( nodeIsAPPLET(element) )
  ------------------
  |  |  427|   653k|#define nodeIsAPPLET( node )     TagIsId( node, TidyTag_APPLET )
  |  |  ------------------
  |  |  |  |  275|   653k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 653k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 653k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 357, False: 653k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|    357|        return no;
  280|       |
  281|   653k|    if ( nodeIsOBJECT(element) )
  ------------------
  |  |  428|   653k|#define nodeIsOBJECT( node )     TagIsId( node, TidyTag_OBJECT )
  |  |  ------------------
  |  |  |  |  275|   653k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 653k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 653k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 839, False: 652k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  282|    839|        return no;
  283|       |
  284|   652k|    if ( nodeIsSCRIPT(element) && attrGetSRC(element) )
  ------------------
  |  |  422|   652k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  1.30M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 652k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 652k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 236, False: 652k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( nodeIsSCRIPT(element) && attrGetSRC(element) )
  ------------------
  |  |  396|    236|#define attrGetSRC( nod )         TY_(AttrGetById)( nod, TidyAttr_SRC  )
  |  |  ------------------
  |  |  |  |   23|    236|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    236|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (396:35): [True: 0, False: 236]
  |  |  ------------------
  ------------------
  285|      0|        return no;
  286|       |
  287|   652k|    if ( nodeIsTITLE(element) )
  ------------------
  |  |  372|   652k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|   652k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 652k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 652k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 29.3k, False: 623k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|  29.3k|        return no;
  289|       |
  290|       |    /* #433359 - fix by Randy Waki 12 Mar 01 */
  291|   623k|    if ( nodeIsIFRAME(element) )
  ------------------
  |  |  378|   623k|#define nodeIsIFRAME( node )     TagIsId( node, TidyTag_IFRAME )
  |  |  ------------------
  |  |  |  |  275|   623k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 623k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 623k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 206, False: 622k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  292|    206|        return no;
  293|       |
  294|       |    /* fix for bug 770297 */
  295|   622k|    if (nodeIsTEXTAREA(element))
  ------------------
  |  |  425|   622k|#define nodeIsTEXTAREA( node )   TagIsId( node, TidyTag_TEXTAREA )
  |  |  ------------------
  |  |  |  |  275|   622k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 622k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 622k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.10k, False: 621k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  296|  1.10k|        return no;
  297|       |
  298|       |    /* fix for ISSUE #7 https://github.com/w3c/tidy-html5/issues/7 */
  299|   621k|    if (nodeIsCANVAS(element))
  ------------------
  |  |  454|   621k|#define nodeIsCANVAS( node )     TagIsId( node, TidyTag_CANVAS )
  |  |  ------------------
  |  |  |  |  275|   621k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 621k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 621k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 197, False: 621k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  300|    197|        return no;
  301|       |    
  302|   621k|    if (nodeIsPROGRESS(element))
  ------------------
  |  |  455|   621k|#define nodeIsPROGRESS( node )   TagIsId( node, TidyTag_PROGRESS )
  |  |  ------------------
  |  |  |  |  275|   621k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 621k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 621k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 240, False: 621k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  303|    240|        return no;
  304|       |
  305|   621k|    if ( attrGetID(element) || attrGetNAME(element) )
  ------------------
  |  |  397|  1.24M|#define attrGetID( nod )          TY_(AttrGetById)( nod, TidyAttr_ID  )
  |  |  ------------------
  |  |  |  |   23|   621k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   621k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (397:35): [True: 51.6k, False: 569k]
  |  |  ------------------
  ------------------
                  if ( attrGetID(element) || attrGetNAME(element) )
  ------------------
  |  |  398|   569k|#define attrGetNAME( nod )        TY_(AttrGetById)( nod, TidyAttr_NAME  )
  |  |  ------------------
  |  |  |  |   23|   569k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   569k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (398:35): [True: 428, False: 569k]
  |  |  ------------------
  ------------------
  306|  52.0k|        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|   569k|    if (attrGetDATAFLD(element))
  ------------------
  |  |  410|   569k|#define attrGetDATAFLD( nod )     TY_(AttrGetById)( nod, TidyAttr_DATAFLD  )
  |  |  ------------------
  |  |  |  |   23|   569k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   569k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (410:35): [True: 0, False: 569k]
  |  |  ------------------
  ------------------
  311|      0|        return no;
  312|       |
  313|       |    /* fix for bug 723772, don't trim new-...-tags */
  314|   569k|    if (element->tag->id == TidyTag_UNKNOWN)
  ------------------
  |  Branch (314:9): [True: 0, False: 569k]
  ------------------
  315|      0|        return no;
  316|       |
  317|   569k|    if (nodeIsBODY(element))
  ------------------
  |  |  375|   569k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   569k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 569k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 569k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 10.6k, False: 558k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  10.6k|        return no;
  319|       |
  320|   558k|    if (nodeIsCOLGROUP(element))
  ------------------
  |  |  399|   558k|#define nodeIsCOLGROUP( node )   TagIsId( node, TidyTag_COLGROUP )
  |  |  ------------------
  |  |  |  |  275|   558k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 558k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 558k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.62k, False: 557k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|  1.62k|        return no;
  322|       |
  323|       |    /* HTML5 - do NOT drop empty option if it has attributes */
  324|   557k|    if ( nodeIsOPTION(element) && element->attributes != NULL )
  ------------------
  |  |  410|   557k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  1.11M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 557k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 557k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.35k, False: 554k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (324:35): [True: 402, False: 1.95k]
  ------------------
  325|    402|        return no;
  326|       |
  327|       |    /* fix for #103 - don't drop empty dd tags lest document not validate */
  328|   556k|    if (nodeIsDD(element))
  ------------------
  |  |  392|   556k|#define nodeIsDD( node )         TagIsId( node, TidyTag_DD )
  |  |  ------------------
  |  |  |  |  275|   556k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 556k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 556k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.31k, False: 555k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  329|  1.31k|        return no;
  330|       |
  331|   555k|    return yes;
  332|   556k|}
parser.c:AttributeChecks:
 5753|  2.44M|{
 5754|  2.44M|    Node *next;
 5755|       |
 5756|  5.79M|    while (node)
  ------------------
  |  Branch (5756:12): [True: 3.34M, False: 2.44M]
  ------------------
 5757|  3.34M|    {
 5758|  3.34M|        next = node->next;
 5759|       |
 5760|  3.34M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  3.34M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.34M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5760:13): [True: 2.80M, False: 536k]
  ------------------
 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: 5.65k]
  |  Branch (5762:30): [True: 92.9k, False: 2.70M]
  ------------------
 5763|  92.9k|                node->tag->chkattrs(doc, node);
 5764|  2.71M|            else
 5765|  2.71M|                TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  2.71M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.71M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5766|  2.80M|        }
 5767|       |
 5768|  3.34M|        if (node->content)
  ------------------
  |  Branch (5768:13): [True: 2.42M, False: 916k]
  ------------------
 5769|  2.42M|            AttributeChecks(doc, node->content);
 5770|       |
 5771|  3.34M|        assert( next != node ); /* http://tidy.sf.net/issue/1603538 */
  ------------------
  |  Branch (5771:9): [True: 0, False: 3.34M]
  |  Branch (5771:9): [True: 3.34M, False: 0]
  ------------------
 5772|  3.34M|        node = next;
 5773|  3.34M|    }
 5774|  2.44M|}
parser.c:ReplaceObsoleteElements:
 5866|  2.44M|{
 5867|  2.44M|    Node *next;
 5868|       |
 5869|  5.79M|    while (node)
  ------------------
  |  Branch (5869:12): [True: 3.34M, False: 2.44M]
  ------------------
 5870|  3.34M|    {
 5871|  3.34M|        next = node->next;
 5872|       |
 5873|       |        /* if (nodeIsDIR(node) || nodeIsMENU(node)) */
 5874|       |        /* HTML5 - <menu ... > is no longer obsolete */
 5875|  3.34M|        if (nodeIsDIR(node))
  ------------------
  |  |  389|  3.34M|#define nodeIsDIR( node )        TagIsId( node, TidyTag_DIR )
  |  |  ------------------
  |  |  |  |  275|  3.34M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.34M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.80M, False: 541k]
  |  |  |  |  |  Branch (275:54): [True: 621, False: 2.80M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5876|    621|            TY_(CoerceNode)(doc, node, TidyTag_UL, yes, yes);
  ------------------
  |  |   23|    621|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    621|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5877|       |
 5878|  3.34M|        if (nodeIsXMP(node) || nodeIsLISTING(node) ||
  ------------------
  |  |  439|  3.34M|#define nodeIsXMP( node )        TagIsId( node, TidyTag_XMP )
  |  |  ------------------
  |  |  |  |  275|  6.68M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.34M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.80M, False: 541k]
  |  |  |  |  |  Branch (275:54): [True: 237, False: 2.80M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (nodeIsXMP(node) || nodeIsLISTING(node) ||
  ------------------
  |  |  384|  3.34M|#define nodeIsLISTING( node )    TagIsId( node, TidyTag_LISTING )
  |  |  ------------------
  |  |  |  |  275|  6.68M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.34M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.80M, False: 541k]
  |  |  |  |  |  Branch (275:54): [True: 195, False: 2.80M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5879|  3.34M|            (node->tag && node->tag->id == TidyTag_PLAINTEXT))
  ------------------
  |  Branch (5879:14): [True: 2.80M, False: 541k]
  |  Branch (5879:27): [True: 259, False: 2.80M]
  ------------------
 5880|    691|            TY_(CoerceNode)(doc, node, TidyTag_PRE, yes, yes);
  ------------------
  |  |   23|    691|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    691|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5881|       |
 5882|  3.34M|        if (node->content)
  ------------------
  |  Branch (5882:13): [True: 2.42M, False: 916k]
  ------------------
 5883|  2.42M|            ReplaceObsoleteElements(doc, node->content);
 5884|       |
 5885|  3.34M|        node = next;
 5886|  3.34M|    }
 5887|  2.44M|}
parser.c:CleanSpaces:
  554|  21.3k|{
  555|  21.3k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  556|  21.3k|    Node *next;
  557|       |    
  558|  2.74M|    while (node)
  ------------------
  |  Branch (558:12): [True: 2.72M, False: 21.3k]
  ------------------
  559|  2.72M|    {
  560|  2.72M|        next = node->next;
  561|       |
  562|  2.72M|        if (TY_(nodeIsText)(node) && CleanLeadingWhitespace(doc, node))
  ------------------
  |  |   23|  2.72M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.72M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (562:13): [True: 193k, False: 2.53M]
  |  Branch (562:38): [True: 41.6k, False: 152k]
  ------------------
  563|  44.0k|            while (node->start < node->end && TY_(IsWhite)(doc->lexer->lexbuf[node->start]))
  ------------------
  |  |   23|  42.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (563:20): [True: 42.8k, False: 1.19k]
  |  Branch (563:47): [True: 2.40k, False: 40.4k]
  ------------------
  564|  2.40k|                ++(node->start);
  565|       |
  566|  2.72M|        if (TY_(nodeIsText)(node) && CleanTrailingWhitespace(doc, node))
  ------------------
  |  |   23|  2.72M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.72M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (566:13): [True: 193k, False: 2.53M]
  |  Branch (566:38): [True: 47.8k, False: 145k]
  ------------------
  567|  80.0k|            while (node->end > node->start && TY_(IsWhite)(doc->lexer->lexbuf[node->end - 1]))
  ------------------
  |  |   23|  75.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  75.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (567:20): [True: 75.8k, False: 4.14k]
  |  Branch (567:47): [True: 32.1k, False: 43.7k]
  ------------------
  568|  32.1k|                --(node->end);
  569|       |
  570|  2.72M|        if (TY_(nodeIsText)(node) && !(node->start < node->end))
  ------------------
  |  |   23|  2.72M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.72M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (570:13): [True: 193k, False: 2.53M]
  |  Branch (570:38): [True: 4.51k, False: 189k]
  ------------------
  571|  4.51k|        {
  572|  4.51k|            TY_(RemoveNode)(node);
  ------------------
  |  |   23|  4.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  573|  4.51k|            TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  4.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  574|  4.51k|            node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|    480|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    480|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (574:20): [True: 4.03k, False: 480]
  ------------------
  575|  4.51k|            continue;
  576|  4.51k|        }
  577|       |
  578|  2.71M|        if (node->content)
  ------------------
  |  Branch (578:13): [True: 2.11M, False: 603k]
  ------------------
  579|  2.11M|        {
  580|  2.11M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.11M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.11M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  581|  2.11M|            node = node->content;
  582|  2.11M|            continue;
  583|  2.11M|        }
  584|       |
  585|   603k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   147k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   147k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (585:16): [True: 455k, False: 147k]
  ------------------
  586|   603k|    }
  587|  21.3k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  588|  21.3k|}
parser.c:CleanLeadingWhitespace:
  404|   193k|{
  405|   193k|    if (!TY_(nodeIsText)(node))
  ------------------
  |  |   23|   193k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   193k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (405:9): [True: 0, False: 193k]
  ------------------
  406|      0|        return no;
  407|       |
  408|   193k|    if (node->parent->type == DocTypeTag)
  ------------------
  |  Branch (408:9): [True: 713, False: 192k]
  ------------------
  409|    713|        return no;
  410|       |
  411|   192k|    if (IsPreDescendant(node))
  ------------------
  |  Branch (411:9): [True: 3.85k, False: 189k]
  ------------------
  412|  3.85k|        return no;
  413|       |
  414|   189k|    if (node->parent->tag && node->parent->tag->parser == TY_(ParseScript))
  ------------------
  |  |   23|   185k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   185k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (414:9): [True: 185k, False: 3.94k]
  |  Branch (414:30): [True: 3.93k, False: 181k]
  ------------------
  415|  3.93k|        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|   185k|    if ( node->prev && nodeIsSCRIPT(node->prev) && nodeIsBODY(node->prev->parent) )
  ------------------
  |  |  422|  87.5k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|   272k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 87.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.8k, False: 69.7k]
  |  |  |  |  |  Branch (275:54): [True: 885, False: 16.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( node->prev && nodeIsSCRIPT(node->prev) && nodeIsBODY(node->prev->parent) )
  ------------------
  |  |  375|    885|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|    885|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 885, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 691, False: 194]
  |  |  |  |  |  Branch (275:54): [True: 447, False: 244]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (422:10): [True: 87.5k, False: 97.6k]
  ------------------
  423|    447|        return yes;
  424|       |
  425|       |    /* <p>...<br> <em>...</em>...</p> */
  426|   184k|    if (nodeIsBR(node->prev))
  ------------------
  |  |  400|   184k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   184k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 87.1k, False: 97.6k]
  |  |  |  |  |  Branch (275:39): [True: 17.3k, False: 69.7k]
  |  |  |  |  |  Branch (275:54): [True: 1.26k, False: 16.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|  1.26k|        return yes;
  428|       |
  429|       |    /* <p> ...</p> */
  430|   183k|    if (node->prev == NULL && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |   23|  97.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  97.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (node->prev == NULL && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |  143|  97.6k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (430:9): [True: 97.6k, False: 85.8k]
  |  Branch (430:31): [True: 27.3k, False: 70.2k]
  ------------------
  431|  27.3k|        return yes;
  432|       |
  433|       |    /* <h4>...</h4> <em>...</em> */
  434|   156k|    if (node->prev && !TY_(nodeHasCM)(node->prev, CM_INLINE) &&
  ------------------
  |  |   23|  85.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  85.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (node->prev && !TY_(nodeHasCM)(node->prev, CM_INLINE) &&
  ------------------
  |  |  143|  85.8k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (434:9): [True: 85.8k, False: 70.2k]
  |  Branch (434:23): [True: 73.8k, False: 12.0k]
  ------------------
  435|  73.8k|        TY_(nodeIsElement)(node->prev))
  ------------------
  |  |   23|  73.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (435:9): [True: 4.13k, False: 69.7k]
  ------------------
  436|  4.13k|        return yes;
  437|       |
  438|       |    /* <p><span> ...</span></p> */
  439|   152k|    if (!node->prev && !node->parent->prev && !TY_(nodeHasCM)(node->parent->parent, CM_INLINE))
  ------------------
  |  |   23|  42.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (!node->prev && !node->parent->prev && !TY_(nodeHasCM)(node->parent->parent, CM_INLINE))
  ------------------
  |  |  143|  42.3k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (439:9): [True: 70.2k, False: 81.7k]
  |  Branch (439:24): [True: 42.3k, False: 27.9k]
  |  Branch (439:47): [True: 8.41k, False: 33.9k]
  ------------------
  440|  8.41k|        return yes;
  441|       |
  442|   143k|    return no;
  443|   152k|}
parser.c:CleanTrailingWhitespace:
  450|   193k|{
  451|   193k|    Node* next;
  452|       |
  453|   193k|    if (!TY_(nodeIsText)(node))
  ------------------
  |  |   23|   193k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   193k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (453:9): [True: 0, False: 193k]
  ------------------
  454|      0|        return no;
  455|       |
  456|   193k|    if (node->parent->type == DocTypeTag)
  ------------------
  |  Branch (456:9): [True: 713, False: 192k]
  ------------------
  457|    713|        return no;
  458|       |
  459|   192k|    if (IsPreDescendant(node))
  ------------------
  |  Branch (459:9): [True: 3.85k, False: 189k]
  ------------------
  460|  3.85k|        return no;
  461|       |
  462|   189k|    if (node->parent->tag && node->parent->tag->parser == TY_(ParseScript))
  ------------------
  |  |   23|   185k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   185k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (462:9): [True: 185k, False: 3.94k]
  |  Branch (462:30): [True: 3.93k, False: 181k]
  ------------------
  463|  3.93k|        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|   185k|    if ( node->next && nodeIsSCRIPT(node->next) && nodeIsBODY(node->next->parent) )
  ------------------
  |  |  422|   138k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|   323k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 138k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 66.9k, False: 71.7k]
  |  |  |  |  |  Branch (275:54): [True: 1.37k, False: 65.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( node->next && nodeIsSCRIPT(node->next) && nodeIsBODY(node->next->parent) )
  ------------------
  |  |  375|  1.37k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  1.37k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.37k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 744, False: 632]
  |  |  |  |  |  Branch (275:54): [True: 458, False: 286]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (470:10): [True: 138k, False: 46.4k]
  ------------------
  471|    458|        return yes;
  472|       |
  473|   184k|    next = node->next;
  474|       |
  475|       |    /* <p>... </p> */
  476|   184k|    if (!next && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |   23|  46.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (!next && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |  143|  46.4k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (476:9): [True: 46.4k, False: 138k]
  |  Branch (476:18): [True: 16.5k, False: 29.9k]
  ------------------
  477|  16.5k|        return yes;
  478|       |
  479|       |    /* <div><small>... </small><h3>...</h3></div> */
  480|   168k|    if (!next && node->parent->next && !TY_(nodeHasCM)(node->parent->next, CM_INLINE))
  ------------------
  |  |   23|  18.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (!next && node->parent->next && !TY_(nodeHasCM)(node->parent->next, CM_INLINE))
  ------------------
  |  |  143|  18.0k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (480:9): [True: 29.9k, False: 138k]
  |  Branch (480:18): [True: 18.0k, False: 11.8k]
  |  Branch (480:40): [True: 12.9k, False: 5.14k]
  ------------------
  481|  12.9k|        return yes;
  482|       |
  483|   155k|    if (!next)
  ------------------
  |  Branch (483:9): [True: 16.9k, False: 138k]
  ------------------
  484|  16.9k|        return no;
  485|       |
  486|   138k|    if (nodeIsBR(next))
  ------------------
  |  |  400|   138k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   138k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 138k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 66.4k, False: 71.7k]
  |  |  |  |  |  Branch (275:54): [True: 1.26k, False: 65.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  1.26k|        return yes;
  488|       |
  489|   137k|    if (TY_(nodeHasCM)(next, CM_INLINE))
  ------------------
  |  |   23|   137k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   137k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (TY_(nodeHasCM)(next, CM_INLINE))
  ------------------
  |  |  143|   137k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (489:9): [True: 53.4k, False: 83.5k]
  ------------------
  490|  53.4k|        return no;
  491|       |
  492|       |    /* <a href='/'>...</a> <p>...</p> */
  493|  83.5k|    if (next->type == StartTag)
  ------------------
  |  Branch (493:9): [True: 12.4k, False: 71.1k]
  ------------------
  494|  12.4k|        return yes;
  495|       |
  496|       |    /* <strong>...</strong> <hr /> */
  497|  71.1k|    if (next->type == StartEndTag)
  ------------------
  |  Branch (497:9): [True: 287, False: 70.8k]
  ------------------
  498|    287|        return yes;
  499|       |
  500|       |    /* evil adjacent text nodes, Tidy should not generate these :-( */
  501|  70.8k|    if (TY_(nodeIsText)(next) && next->start < next->end
  ------------------
  |  |   23|  70.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  70.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (501:9): [True: 39.5k, False: 31.3k]
  |  Branch (501:34): [True: 39.5k, False: 0]
  ------------------
  502|  39.5k|        && TY_(IsWhite)(doc->lexer->lexbuf[next->start]))
  ------------------
  |  |   23|  39.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (502:12): [True: 3.94k, False: 35.6k]
  ------------------
  503|  3.94k|        return yes;
  504|       |
  505|  66.9k|    return no;
  506|  70.8k|}

prvTidyInitPrintBuf:
  286|  42.6k|{
  287|  42.6k|    TidyClearMemory( &doc->pprint, sizeof(TidyPrintImpl) );
  ------------------
  |  |   70|  42.6k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  288|  42.6k|    InitIndent( &doc->pprint.indent[0] );
  289|  42.6k|    InitIndent( &doc->pprint.indent[1] );
  290|  42.6k|    doc->pprint.allocator = doc->allocator;
  291|  42.6k|    doc->pprint.line = 0;
  292|  42.6k|}
prvTidyFreePrintBuf:
  299|  21.3k|{
  300|  21.3k|    TidyDocFree( doc, doc->pprint.linebuf );
  ------------------
  |  |  159|  21.3k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  301|  21.3k|    TY_(InitPrintBuf)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  302|  21.3k|}
prvTidyPFlushLine:
  847|  36.6k|{
  848|  36.6k|    TidyPrintImpl* pprint = &doc->pprint;
  849|       |
  850|  36.6k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (850:10): [True: 33.0k, False: 3.65k]
  ------------------
  851|  33.0k|        PFlushLineImpl( doc );
  852|       |
  853|  36.6k|    TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|  36.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  854|  36.6k|    pprint->line++;
  855|       |
  856|  36.6k|    if (pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (856:9): [True: 12, False: 36.6k]
  ------------------
  857|     12|    {
  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|     12|        pprint->indent[ 0 ].spaces = indent;
  862|     12|    }
  863|  36.6k|}
prvTidyTextNodeEndWithSpace:
 1667|  1.04M|{
 1668|  1.04M|    if (TY_(nodeIsText)(node) && node->end > node->start)
  ------------------
  |  |   23|  1.04M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1668:9): [True: 1.04M, False: 0]
  |  Branch (1668:34): [True: 1.04M, False: 0]
  ------------------
 1669|  1.04M|    {
 1670|  1.04M|        uint i, c = '\0'; /* initialised to avoid warnings */
 1671|  11.2M|        for (i = node->start; i < node->end; ++i)
  ------------------
  |  Branch (1671:31): [True: 10.1M, False: 1.04M]
  ------------------
 1672|  10.1M|        {
 1673|  10.1M|            c = (byte) lexer->lexbuf[i];
 1674|  10.1M|            if ( c > 0x7F )
  ------------------
  |  Branch (1674:18): [True: 1.33M, False: 8.84M]
  ------------------
 1675|  1.33M|                i += TY_(GetUTF8)( lexer->lexbuf + i, &c );
  ------------------
  |  |   23|  1.33M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.33M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1676|  10.1M|        }
 1677|       |
 1678|  1.04M|        if ( c == ' ' || c == '\n' )
  ------------------
  |  Branch (1678:14): [True: 11.0k, False: 1.03M]
  |  Branch (1678:26): [True: 426, False: 1.03M]
  ------------------
 1679|  11.4k|            return yes;
 1680|  1.04M|    }
 1681|  1.03M|    return no;
 1682|  1.04M|}
prvTidyPPrintTree:
 2275|  2.67M|{
 2276|  2.67M|    Node *content, *last;
 2277|  2.67M|    uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|  2.67M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 2278|  2.67M|    Bool xhtml = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  2.67M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.67M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2279|       |
 2280|  2.67M|    if ( node == NULL )
  ------------------
  |  Branch (2280:10): [True: 0, False: 2.67M]
  ------------------
 2281|      0|        return;
 2282|       |
 2283|  2.67M|    if (doc->progressCallback)
  ------------------
  |  Branch (2283:9): [True: 0, False: 2.67M]
  ------------------
 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.67M|    if (node->type == TextNode)
  ------------------
  |  Branch (2292:9): [True: 187k, False: 2.48M]
  ------------------
 2293|   187k|    {
 2294|   187k|        PPrintText( doc, mode, indent, node );
 2295|   187k|    }
 2296|  2.48M|    else if ( node->type == CommentTag )
  ------------------
  |  Branch (2296:15): [True: 36.8k, False: 2.45M]
  ------------------
 2297|  36.8k|    {
 2298|  36.8k|        PPrintComment( doc, indent, node );
 2299|  36.8k|    }
 2300|  2.45M|    else if ( node->type == RootNode )
  ------------------
  |  Branch (2300:15): [True: 21.3k, False: 2.42M]
  ------------------
 2301|  21.3k|    {
 2302|  69.2k|        for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2302:40): [True: 47.9k, False: 21.3k]
  ------------------
 2303|  47.9k|           TY_(PPrintTree)( doc, mode, indent, content );
  ------------------
  |  |   23|  47.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  47.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2304|  21.3k|    }
 2305|  2.42M|    else if ( node->type == DocTypeTag )
  ------------------
  |  Branch (2305:15): [True: 31.6k, False: 2.39M]
  ------------------
 2306|  31.6k|        PPrintDocType( doc, indent, node );
 2307|  2.39M|    else if ( node->type == ProcInsTag)
  ------------------
  |  Branch (2307:15): [True: 44.8k, False: 2.35M]
  ------------------
 2308|  44.8k|        PPrintPI( doc, indent, node );
 2309|  2.35M|    else if ( node->type == XmlDecl)
  ------------------
  |  Branch (2309:15): [True: 2.66k, False: 2.34M]
  ------------------
 2310|  2.66k|        PPrintXmlDecl( doc, indent, node );
 2311|  2.34M|    else if ( node->type == CDATATag)
  ------------------
  |  Branch (2311:15): [True: 791, False: 2.34M]
  ------------------
 2312|    791|        PPrintCDATA( doc, indent, node );
 2313|  2.34M|    else if ( node->type == SectionTag)
  ------------------
  |  Branch (2313:15): [True: 80.9k, False: 2.26M]
  ------------------
 2314|  80.9k|        PPrintSection( doc, indent, node );
 2315|  2.26M|    else if ( node->type == AspTag)
  ------------------
  |  Branch (2315:15): [True: 38.4k, False: 2.22M]
  ------------------
 2316|  38.4k|        PPrintAsp( doc, indent, node );
 2317|  2.22M|    else if ( node->type == JsteTag)
  ------------------
  |  Branch (2317:15): [True: 39.2k, False: 2.19M]
  ------------------
 2318|  39.2k|        PPrintJste( doc, indent, node );
 2319|  2.19M|    else if ( node->type == PhpTag)
  ------------------
  |  Branch (2319:15): [True: 351, False: 2.19M]
  ------------------
 2320|    351|        PPrintPhp( doc, indent, node );
 2321|  2.19M|    else if ( nodeIsMATHML(node) )
  ------------------
  |  |  465|  2.19M|#define nodeIsMATHML( node )     TagIsId( node, TidyTag_MATHML ) /* #130 MathML attr and entity fix! */
  |  |  ------------------
  |  |  |  |  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.18M, False: 5.63k]
  |  |  |  |  |  Branch (275:54): [True: 325, False: 2.18M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2322|    325|        PPrintMathML( doc, indent, node ); /* #130 MathML attr and entity fix! */
 2323|  2.18M|    else if ( TY_(nodeCMIsEmpty)(node) ||
  ------------------
  |  |   23|  2.18M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.18M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2323:15): [True: 59.4k, False: 2.13M]
  ------------------
 2324|  2.13M|              (node->type == StartEndTag && !xhtml) )
  ------------------
  |  Branch (2324:16): [True: 3.31k, False: 2.12M]
  |  Branch (2324:45): [True: 0, False: 3.31k]
  ------------------
 2325|  59.4k|    {
 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|  59.4k|        if ( ! TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|  59.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  59.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( ! TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|  59.4k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2330:14): [True: 40.5k, False: 18.8k]
  ------------------
 2331|  40.5k|            PCondFlushLineSmart( doc, indent );
 2332|       |
 2333|  59.4k|        if ( nodeIsBR(node) && node->prev &&
  ------------------
  |  |  400|  59.4k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   118k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 59.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 59.4k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 12.8k, False: 46.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2333:32): [True: 11.4k, False: 1.40k]
  ------------------
 2334|  11.4k|             !(nodeIsBR(node->prev) || (mode & PREFORMATTED)) &&
  ------------------
  |  |  400|  11.4k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  22.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 9.27k, False: 2.17k]
  |  |  |  |  |  Branch (275:54): [True: 8.92k, False: 345]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2334:40): [True: 1.21k, False: 1.30k]
  ------------------
 2335|  1.30k|             cfgBool(doc, TidyBreakBeforeBR) )
  ------------------
  |  |  418|  1.30k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.30k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 1.30k]
  |  |  ------------------
  ------------------
 2336|      0|            PFlushLineSmart( doc, indent );
 2337|       |
 2338|  59.4k|        if ( nodeIsHR(node) )
  ------------------
  |  |  380|  59.4k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  59.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 59.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 59.4k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 6.09k, False: 53.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2339|  6.09k|        {
 2340|       |            /* insert extra newline for classic formatting */
 2341|  6.09k|            Bool classic = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
  ------------------
  |  |   51|  6.09k|#define TidyClassicVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyYesState) ? yes : no)
  |  |  ------------------
  |  |  |  |  421|  6.09k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  6.09k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (51:24): [True: 0, False: 6.09k]
  |  |  ------------------
  ------------------
 2342|  6.09k|            if (classic && node->parent && node->parent->content != node)
  ------------------
  |  Branch (2342:17): [True: 0, False: 6.09k]
  |  Branch (2342:28): [True: 0, False: 0]
  |  Branch (2342:44): [True: 0, False: 0]
  ------------------
 2343|      0|            {
 2344|      0|                PFlushLineSmart( doc, indent );
 2345|      0|            }
 2346|  6.09k|        }
 2347|       |
 2348|  59.4k|        PPrintTag( doc, mode, indent, node );
 2349|       |
 2350|  59.4k|        if (node->next)
  ------------------
  |  Branch (2350:13): [True: 54.4k, False: 4.97k]
  ------------------
 2351|  54.4k|        {
 2352|  54.4k|          if (nodeIsPARAM(node) || nodeIsAREA(node))
  ------------------
  |  |  409|  54.4k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|   108k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 54.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 54.4k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 902, False: 53.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                        if (nodeIsPARAM(node) || nodeIsAREA(node))
  ------------------
  |  |  414|  53.5k|#define nodeIsAREA( node )       TagIsId( node, TidyTag_AREA )
  |  |  ------------------
  |  |  |  |  275|  53.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 53.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 53.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.40k, False: 52.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2353|  2.30k|              PCondFlushLineSmart(doc, indent);
 2354|  52.1k|          else if ((nodeIsBR(node) && !(mode & PREFORMATTED))
  ------------------
  |  |  400|  52.1k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   104k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 52.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 52.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 11.6k, False: 40.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2354:39): [True: 7.20k, False: 4.40k]
  ------------------
 2355|  44.9k|                   || nodeIsHR(node))
  ------------------
  |  |  380|  44.9k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  44.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 44.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 44.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.21k, False: 39.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2356|  12.4k|              PFlushLineSmart(doc, indent);
 2357|  54.4k|        }
 2358|  59.4k|    }
 2359|  2.13M|    else /* some kind of container element */
 2360|  2.13M|    {
 2361|  2.13M|        if ( node->type == StartEndTag )
  ------------------
  |  Branch (2361:14): [True: 3.31k, False: 2.12M]
  ------------------
 2362|  3.31k|            node->type = StartTag;
 2363|       |
 2364|  2.13M|        if ( node->tag && 
  ------------------
  |  Branch (2364:14): [True: 2.12M, False: 5.63k]
  ------------------
 2365|  2.12M|             (node->tag->parser == TY_(ParsePre) || nodeIsTEXTAREA(node)) )
  ------------------
  |  |   23|  2.12M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.12M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           (node->tag->parser == TY_(ParsePre) || nodeIsTEXTAREA(node)) )
  ------------------
  |  |  425|  2.12M|#define nodeIsTEXTAREA( node )   TagIsId( node, TidyTag_TEXTAREA )
  |  |  ------------------
  |  |  |  |  275|  2.12M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.12M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.12M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.74k, False: 2.12M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2365:15): [True: 2.74k, False: 2.12M]
  ------------------
 2366|  4.48k|        {
 2367|  4.48k|            Bool classic  = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
  ------------------
  |  |   51|  4.48k|#define TidyClassicVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyYesState) ? yes : no)
  |  |  ------------------
  |  |  |  |  421|  4.48k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  4.48k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (51:24): [True: 0, False: 4.48k]
  |  |  ------------------
  ------------------
 2368|  4.48k|            uint indprev = indent;
 2369|       |
 2370|  4.48k|            PCondFlushLineSmart( doc, indent ); /* about to add <pre> tag - clear any previous */
 2371|       |
 2372|       |            /* insert extra newline for classic formatting */
 2373|  4.48k|            if (classic && node->parent && node->parent->content != node)
  ------------------
  |  Branch (2373:17): [True: 0, False: 4.48k]
  |  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|  4.48k|            PPrintTag( doc, (mode | NOWRAP), indent, node );   /* add <pre> or <textarea> tag */
 2380|       |
 2381|  4.48k|            indent = 0;
 2382|       |            /* @camoy Fix #158 - remove inserted newlines in pre - PFlushLineSmart( doc, indent ); */
 2383|       |
 2384|  16.5k|            for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2384:44): [True: 12.0k, False: 4.48k]
  ------------------
 2385|  12.0k|            {
 2386|  12.0k|                TY_(PPrintTree)( doc, (mode | PREFORMATTED | NOWRAP),
  ------------------
  |  |   23|  12.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2387|  12.0k|                                 indent, content );
 2388|  12.0k|            }
 2389|       |
 2390|       |            /* @camoy Fix #158 - remove inserted newlines in pre - PCondFlushLineSmart( doc, indent ); */
 2391|  4.48k|            indent = indprev;
 2392|  4.48k|            PPrintEndTag( doc, mode, indent, node );
 2393|       |
 2394|  4.48k|            if ( cfgAutoBool(doc, TidyIndentContent) == TidyNoState
  ------------------
  |  |  421|  4.48k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  4.48k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2394:18): [True: 4.48k, False: 0]
  ------------------
 2395|  4.48k|                 && node->next != NULL )
  ------------------
  |  Branch (2395:21): [True: 3.76k, False: 717]
  ------------------
 2396|  3.76k|                PFlushLineSmart( doc, indent );
 2397|  4.48k|        }
 2398|  2.12M|        else if ( nodeIsSTYLE(node) || nodeIsSCRIPT(node) )
  ------------------
  |  |  421|  2.12M|#define nodeIsSTYLE( node )      TagIsId( node, TidyTag_STYLE )
  |  |  ------------------
  |  |  |  |  275|  4.25M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.12M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.12M, False: 5.63k]
  |  |  |  |  |  Branch (275:54): [True: 2.70k, False: 2.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      else if ( nodeIsSTYLE(node) || nodeIsSCRIPT(node) )
  ------------------
  |  |  422|  2.12M|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  2.12M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.12M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.11M, False: 5.63k]
  |  |  |  |  |  Branch (275:54): [True: 2.97k, False: 2.11M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2399|  5.67k|        {
 2400|  5.67k|            PPrintScriptStyle( doc, (mode | PREFORMATTED | NOWRAP | CDATA),
 2401|  5.67k|                               indent, node );
 2402|  5.67k|        }
 2403|  2.12M|        else if ( TY_(nodeCMIsInline)(node) )
  ------------------
  |  |   23|  2.12M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.12M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2403:19): [True: 1.77M, False: 347k]
  ------------------
 2404|  1.77M|        {
 2405|  1.77M|            if ( cfgBool(doc, TidyMakeClean) )
  ------------------
  |  |  418|  1.77M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.77M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 1.77M]
  |  |  ------------------
  ------------------
 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.77M|            PPrintTag( doc, mode, indent, node );
 2420|       |
 2421|       |            /* indent content for SELECT, TEXTAREA, MAP, OBJECT and APPLET */
 2422|  1.77M|            if ( ShouldIndent(doc, node) )
  ------------------
  |  Branch (2422:18): [True: 0, False: 1.77M]
  ------------------
 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.77M|            else
 2437|  1.77M|            {
 2438|  1.77M|                for ( content = node->content;
 2439|  3.62M|                      content != NULL;
  ------------------
  |  Branch (2439:23): [True: 1.85M, False: 1.77M]
  ------------------
 2440|  1.85M|                      content = content->next )
 2441|  1.85M|                    TY_(PPrintTree)( doc, mode, indent, content );
  ------------------
  |  |   23|  1.85M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.85M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2442|  1.77M|            }
 2443|  1.77M|            PPrintEndTag( doc, mode, indent, node );
 2444|  1.77M|        }
 2445|   347k|        else /* other tags */
 2446|   347k|        {
 2447|   347k|            Bool indcont  = ( cfgAutoBool(doc, TidyIndentContent) != TidyNoState );
  ------------------
  |  |  421|   347k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   347k|#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|   347k|            Bool hideend  = cfgBool( doc, TidyOmitOptionalTags );
  ------------------
  |  |  418|   347k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   347k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2451|   347k|            Bool classic  = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
  ------------------
  |  |   51|   347k|#define TidyClassicVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyYesState) ? yes : no)
  |  |  ------------------
  |  |  |  |  421|   347k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|   347k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (51:24): [True: 0, False: 347k]
  |  |  ------------------
  ------------------
 2452|   347k|            uint contentIndent = indent;
 2453|       |
 2454|       |            /* insert extra newline for classic formatting */
 2455|   347k|            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: 347k]
  |  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|   347k|            if ( ShouldIndent(doc, node) )
  ------------------
  |  Branch (2460:18): [True: 0, False: 347k]
  ------------------
 2461|      0|                contentIndent += spaces;
 2462|       |
 2463|   347k|            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|   347k|            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: 347k, False: 0]
  |  Branch (2476:30): [True: 0, False: 0]
  ------------------
 2477|      0|                 node->attributes != NULL )
  ------------------
  |  Branch (2477:18): [True: 0, False: 0]
  ------------------
 2478|   347k|            {
 2479|   347k|                PPrintTag( doc, mode, indent, node );
 2480|       |
 2481|   347k|                if ( ShouldIndent(doc, node) )
  ------------------
  |  Branch (2481:22): [True: 0, False: 347k]
  ------------------
 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|   347k|                else if ( TY_(nodeHasCM)(node, CM_HTML) || nodeIsNOFRAMES(node) ||
  ------------------
  |  |   23|   347k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   347k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_HTML) || nodeIsNOFRAMES(node) ||
  ------------------
  |  |  140|   347k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_HTML) || nodeIsNOFRAMES(node) ||
  ------------------
  |  |  379|   191k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|   539k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 191k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 185k, False: 5.63k]
  |  |  |  |  |  Branch (275:54): [True: 6.58k, False: 179k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2488:27): [True: 156k, False: 191k]
  ------------------
 2489|   185k|                          (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node)) )
  ------------------
  |  |   23|   185k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   185k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                        (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node)) )
  ------------------
  |  |  141|   185k|#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.9k, False: 215]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2489:28): [True: 24.1k, False: 160k]
  ------------------
 2490|   162k|                    PFlushLineSmart( doc, contentIndent );
 2491|   347k|            }
 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|   347k|            last = NULL;
 2503|  1.08M|            for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2503:44): [True: 736k, False: 347k]
  ------------------
 2504|   736k|            {
 2505|       |                /* kludge for naked text before block level tag */
 2506|   736k|                if ( last && !indcont && TY_(nodeIsText)(last) &&
  ------------------
  |  |   23|   436k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   436k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2506:22): [True: 436k, False: 299k]
  |  Branch (2506:30): [True: 436k, False: 0]
  |  Branch (2506:42): [True: 75.0k, False: 361k]
  ------------------
 2507|  75.0k|                     content->tag && !TY_(nodeHasCM)(content, CM_INLINE) )
  ------------------
  |  |   23|  17.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   content->tag && !TY_(nodeHasCM)(content, CM_INLINE) )
  ------------------
  |  |  143|  17.8k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2507:22): [True: 17.8k, False: 57.2k]
  |  Branch (2507:38): [True: 11.1k, False: 6.72k]
  ------------------
 2508|  11.1k|                {
 2509|       |                    /* TY_(PFlushLine)(fout, indent); */
 2510|  11.1k|                    PFlushLineSmart( doc, contentIndent );
 2511|  11.1k|                }
 2512|       |
 2513|   736k|                TY_(PPrintTree)( doc, mode, contentIndent, content );
  ------------------
  |  |   23|   736k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   736k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2514|   736k|                last = content;
 2515|   736k|            }
 2516|       |
 2517|       |            /* don't flush line for td and th */
 2518|   347k|            if ( ShouldIndent(doc, node) ||
  ------------------
  |  Branch (2518:18): [True: 0, False: 347k]
  ------------------
 2519|   347k|                 ( !hideend &&
  ------------------
  |  Branch (2519:20): [True: 347k, False: 0]
  ------------------
 2520|   347k|                   ( TY_(nodeHasCM)(node, CM_HTML) || 
  ------------------
  |  |   23|   347k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   347k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                 ( TY_(nodeHasCM)(node, CM_HTML) || 
  ------------------
  |  |  140|   347k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
  |  Branch (2520:22): [True: 156k, False: 191k]
  ------------------
 2521|   347k|                     nodeIsNOFRAMES(node) ||
  ------------------
  |  |  379|   191k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|   539k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 191k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 185k, False: 5.63k]
  |  |  |  |  |  Branch (275:54): [True: 6.58k, False: 179k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2522|   185k|                     (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node))
  ------------------
  |  |   23|   185k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   185k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node))
  ------------------
  |  |  141|   185k|#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.9k, False: 215]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2522:23): [True: 24.1k, False: 160k]
  ------------------
 2523|   347k|                   )
 2524|   347k|                 )
 2525|   347k|               )
 2526|   162k|            {
 2527|   162k|                PCondFlushLineSmart( doc, indent );
 2528|   162k|                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: 162k, False: 0]
  |  Branch (2528:34): [True: 0, False: 0]
  ------------------
 2529|   162k|                {
 2530|   162k|                    PPrintEndTag( doc, mode, indent, node );
 2531|       |                    /* TY_(PFlushLine)( doc, indent ); */
 2532|   162k|                }
 2533|   162k|            }
 2534|   184k|            else
 2535|   184k|            {
 2536|   184k|                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: 184k, False: 0]
  |  Branch (2536:34): [True: 0, False: 0]
  ------------------
 2537|   184k|                {
 2538|       |                    /* newline before endtag for classic formatting */
 2539|   184k|                    if ( classic && !HasMixedContent(node) )
  ------------------
  |  Branch (2539:26): [True: 0, False: 184k]
  |  Branch (2539:37): [True: 0, False: 0]
  ------------------
 2540|      0|                        PFlushLineSmart( doc, indent );
 2541|   184k|                    PPrintEndTag( doc, mode, indent, node );
 2542|   184k|                }
 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|   184k|            }
 2556|       |
 2557|   347k|            if (!indcont && !hideend && !nodeIsHTML(node) && !classic)
  ------------------
  |  |  370|   347k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   695k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 347k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 342k, False: 5.63k]
  |  |  |  |  |  Branch (275:54): [True: 60.5k, False: 281k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2557:17): [True: 347k, False: 0]
  |  Branch (2557:29): [True: 347k, False: 0]
  |  Branch (2557:62): [True: 287k, False: 0]
  ------------------
 2558|   287k|                PFlushLineSmart( doc, indent );
 2559|  60.5k|            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: 60.5k]
  |  Branch (2559:33): [True: 0, False: 0]
  |  Branch (2559:55): [True: 0, False: 0]
  ------------------
 2560|      0|                PFlushLineSmart( doc, indent );
 2561|   347k|        }
 2562|  2.13M|    }
 2563|  2.67M|}
pprint.c:InitIndent:
  275|  91.6k|{
  276|  91.6k|    ind->spaces = -1;
  277|  91.6k|    ind->attrValStart = -1;
  278|  91.6k|    ind->attrStringStart = -1;
  279|  91.6k|}
pprint.c:PFlushLineImpl:
  821|   829k|{
  822|   829k|    TidyPrintImpl* pprint = &doc->pprint;
  823|       |
  824|   829k|    uint i;
  825|       |
  826|   829k|    CheckWrapLine( doc );
  827|       |
  828|   829k|    if ( WantIndent(doc) )
  ------------------
  |  Branch (828:10): [True: 547, False: 829k]
  ------------------
  829|    547|        WriteIndentChar(doc);
  830|       |
  831|   361M|    for ( i = 0; i < pprint->linelen; ++i )
  ------------------
  |  Branch (831:18): [True: 360M, False: 829k]
  ------------------
  832|   360M|        TY_(WriteChar)( pprint->linebuf[i], doc->docOut );
  ------------------
  |  |   23|   360M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   360M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  833|       |
  834|   829k|    if ( IsInString(pprint) )
  ------------------
  |  Branch (834:10): [True: 0, False: 829k]
  ------------------
  835|      0|        TY_(WriteChar)( '\\', doc->docOut );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  836|   829k|    ResetLine( pprint );
  837|   829k|    pprint->linelen = 0;
  838|   829k|}
pprint.c:CheckWrapLine:
  680|   829k|{
  681|   829k|    TidyPrintImpl* pprint = &doc->pprint;
  682|   829k|    if ( GetSpaces(pprint) + pprint->linelen >= cfg(doc, TidyWrapLen) )
  ------------------
  |  |  415|   829k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (682:10): [True: 62.7k, False: 766k]
  ------------------
  683|  62.7k|    {
  684|  62.7k|        WrapLine( doc );
  685|  62.7k|        return yes;
  686|  62.7k|    }
  687|   766k|    return no;
  688|   829k|}
pprint.c:GetSpaces:
  343|   284M|{
  344|   284M|    int spaces = pprint->indent[ 0 ].spaces;
  345|   284M|    return ( spaces < 0 ? 0U : (uint) spaces );
  ------------------
  |  Branch (345:14): [True: 2.22k, False: 284M]
  ------------------
  346|   284M|}
pprint.c:WrapLine:
  652|   277M|{
  653|   277M|    TidyPrintImpl* pprint = &doc->pprint;
  654|   277M|    uint i;
  655|       |
  656|   277M|    if ( pprint->wraphere == 0 )
  ------------------
  |  Branch (656:10): [True: 277M, False: 101k]
  ------------------
  657|   277M|        return;
  658|       |
  659|   101k|    if ( WantIndent(doc) )
  ------------------
  |  Branch (659:10): [True: 0, False: 101k]
  ------------------
  660|      0|        WriteIndentChar(doc);
  661|       |
  662|  28.2M|    for ( i = 0; i < pprint->wraphere; ++i )
  ------------------
  |  Branch (662:18): [True: 28.1M, False: 101k]
  ------------------
  663|  28.1M|        TY_(WriteChar)( pprint->linebuf[i], doc->docOut );
  ------------------
  |  |   23|  28.1M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.1M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  664|       |
  665|   101k|    if ( IsWrapInString(pprint) )
  ------------------
  |  Branch (665:10): [True: 0, False: 101k]
  ------------------
  666|      0|        TY_(WriteChar)( '\\', doc->docOut );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  667|       |
  668|   101k|    TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|   101k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   101k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  669|   101k|    pprint->line++;
  670|   101k|    ResetLineAfterWrap( pprint );
  671|   101k|}
pprint.c:IsWrapInString:
  392|   102k|{
  393|   102k|    TidyIndent *ind = pprint->indent + 0; /* Always 1st */
  394|   102k|    int wrap = (int) pprint->wraphere;
  395|   102k|    return ( ind->attrStringStart == 0 ||
  ------------------
  |  Branch (395:14): [True: 0, False: 102k]
  ------------------
  396|   102k|             (ind->attrStringStart > 0 && ind->attrStringStart < wrap) );
  ------------------
  |  Branch (396:15): [True: 0, False: 102k]
  |  Branch (396:43): [True: 0, False: 0]
  ------------------
  397|   102k|}
pprint.c:ResetLineAfterWrap:
  595|   101k|{
  596|   101k|    if ( pprint->linelen > pprint->wraphere )
  ------------------
  |  Branch (596:10): [True: 101k, False: 0]
  ------------------
  597|   101k|    {
  598|   101k|        uint *p = pprint->linebuf;
  599|   101k|        uint *q = p + pprint->wraphere;
  600|   101k|        uint *end = p + pprint->linelen;
  601|       |
  602|   101k|        if ( ! IsWrapInAttrVal(pprint) )
  ------------------
  |  Branch (602:14): [True: 101k, False: 0]
  ------------------
  603|   101k|        {
  604|   154k|            while ( q < end && *q == ' ' )
  ------------------
  |  Branch (604:21): [True: 127k, False: 27.1k]
  |  Branch (604:32): [True: 53.3k, False: 74.4k]
  ------------------
  605|  53.3k|                ++q, ++pprint->wraphere;
  606|   101k|        }
  607|       |
  608|  11.0M|        while ( q < end )
  ------------------
  |  Branch (608:17): [True: 10.9M, False: 101k]
  ------------------
  609|  10.9M|            *p++ = *q++;
  610|       |
  611|   101k|        pprint->linelen -= pprint->wraphere;
  612|   101k|    }
  613|      0|    else
  614|      0|    {
  615|      0|        pprint->linelen = 0;
  616|      0|    }
  617|       |
  618|   101k|    ResetLine( pprint );
  619|   101k|}
pprint.c:IsWrapInAttrVal:
  430|   102k|{
  431|   102k|    TidyIndent *ind = pprint->indent + 0; /* Always 1st */
  432|   102k|    int wrap = (int) pprint->wraphere;
  433|   102k|    return ( ind->attrValStart == 0 ||
  ------------------
  |  Branch (433:14): [True: 0, False: 102k]
  ------------------
  434|   102k|             (ind->attrValStart > 0 && ind->attrValStart < wrap) );
  ------------------
  |  Branch (434:15): [True: 231, False: 101k]
  |  Branch (434:40): [True: 0, False: 231]
  ------------------
  435|   102k|}
pprint.c:WantIndent:
  489|   931k|{
  490|   931k|    TidyPrintImpl* pprint = &doc->pprint;
  491|   931k|    Bool wantIt = GetSpaces(pprint) > 0;
  492|   931k|    if ( wantIt )
  ------------------
  |  Branch (492:10): [True: 547, False: 930k]
  ------------------
  493|    547|    {
  494|    547|        Bool indentAttrs = cfgBool( doc, TidyIndentAttributes );
  ------------------
  |  |  418|    547|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    547|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  495|    547|        wantIt = ( ( !IsWrapInAttrVal(pprint) || indentAttrs ) &&
  ------------------
  |  Branch (495:22): [True: 547, False: 0]
  |  Branch (495:50): [True: 0, False: 0]
  ------------------
  496|    547|                   !IsWrapInString(pprint) );
  ------------------
  |  Branch (496:20): [True: 547, False: 0]
  ------------------
  497|    547|    }
  498|   931k|    return wantIt;
  499|   931k|}
pprint.c:WriteIndentChar:
  630|    547|{
  631|    547|    TidyPrintImpl* pprint = &doc->pprint;
  632|    547|    uint i;
  633|    547|    uint spaces = GetSpaces(pprint);
  634|    547|    uint tabsize = cfg(doc, TidyTabSize);
  ------------------
  |  |  415|    547|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  635|    547|    if (spaces && (doc->indent_char == '\t') && tabsize)
  ------------------
  |  Branch (635:9): [True: 547, False: 0]
  |  Branch (635:19): [True: 0, False: 547]
  |  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|  2.51k|    for (i = 0; i < spaces; i++)
  ------------------
  |  Branch (641:17): [True: 1.96k, False: 547]
  ------------------
  642|  1.96k|        TY_(WriteChar)(doc->indent_char, doc->docOut); /* 20150515 - Issue #108 */
  ------------------
  |  |   23|  1.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  643|       |
  644|    547|}
pprint.c:IsInString:
  380|   829k|{
  381|   829k|    TidyIndent *ind = pprint->indent + 0; /* Always 1st */
  382|   829k|    return ( ind->attrStringStart >= 0 && 
  ------------------
  |  Branch (382:14): [True: 0, False: 829k]
  ------------------
  383|      0|             ind->attrStringStart < (int) pprint->linelen );
  ------------------
  |  Branch (383:14): [True: 0, False: 0]
  ------------------
  384|   829k|}
pprint.c:ResetLine:
  564|   931k|{
  565|   931k|    TidyIndent* ind = pprint->indent + 0;
  566|   931k|    if ( pprint->ixInd > 0 )
  ------------------
  |  Branch (566:10): [True: 6.45k, False: 924k]
  ------------------
  567|  6.45k|    {
  568|  6.45k|        ind[0] = ind[1];
  569|  6.45k|        InitIndent( &ind[1] );
  570|  6.45k|    }
  571|       |
  572|   931k|    if ( pprint->wraphere > 0 )
  ------------------
  |  Branch (572:10): [True: 541k, False: 389k]
  ------------------
  573|   541k|    {
  574|   541k|        int wrap = (int) pprint->wraphere;
  575|   541k|        if ( ind[0].attrStringStart > wrap )
  ------------------
  |  Branch (575:14): [True: 0, False: 541k]
  ------------------
  576|      0|            ind[0].attrStringStart -= wrap;
  577|   541k|        if ( ind[0].attrValStart > wrap )
  ------------------
  |  Branch (577:14): [True: 1.09k, False: 540k]
  ------------------
  578|  1.09k|            ind[0].attrValStart -= wrap;
  579|   541k|    }
  580|   389k|    else
  581|   389k|    {
  582|   389k|        if ( ind[0].attrStringStart > 0 )
  ------------------
  |  Branch (582:14): [True: 0, False: 389k]
  ------------------
  583|      0|            ind[0].attrStringStart = 0;
  584|   389k|        if ( ind[0].attrValStart > 0 )
  ------------------
  |  Branch (584:14): [True: 496, False: 389k]
  ------------------
  585|    496|            ind[0].attrValStart = 0;
  586|   389k|    }
  587|   931k|    pprint->wraphere = pprint->ixInd = 0;
  588|   931k|}
pprint.c:PPrintText:
 1359|   457k|{
 1360|   457k|    uint start = node->start;
 1361|   457k|    uint end = node->end;
 1362|   457k|    uint ix, c = 0;
 1363|   457k|    int  ixNL = TextEndsWithNewline( doc->lexer, node, mode );
 1364|   457k|    int  ixWS = TextStartsWithWhitespace( doc->lexer, node, start, mode );
 1365|   457k|    if ( ixNL > 0 )
  ------------------
  |  Branch (1365:10): [True: 430, False: 456k]
  ------------------
 1366|    430|      end -= ixNL;
 1367|   457k|    start = IncrWS( start, end, indent, ixWS );
 1368|       |
 1369|   280M|    for ( ix = start; ix < end; ++ix )
  ------------------
  |  Branch (1369:23): [True: 279M, False: 457k]
  ------------------
 1370|   279M|    {
 1371|   279M|        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|   279M|        c = (byte) doc->lexer->lexbuf[ix];
 1380|       |
 1381|       |        /* look for UTF-8 multibyte character */
 1382|   279M|        if ( c > 0x7F )
  ------------------
  |  Branch (1382:14): [True: 1.80M, False: 277M]
  ------------------
 1383|  1.80M|             ix += TY_(GetUTF8)( doc->lexer->lexbuf + ix, &c );
  ------------------
  |  |   23|  1.80M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.80M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1384|       |
 1385|   279M|        if ( c == '\n' )
  ------------------
  |  Branch (1385:14): [True: 10.8k, False: 279M]
  ------------------
 1386|  10.8k|        {
 1387|  10.8k|            TY_(PFlushLine)( doc, indent );
  ------------------
  |  |   23|  10.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1388|  10.8k|            ixWS = TextStartsWithWhitespace( doc->lexer, node, ix+1, mode );
 1389|  10.8k|            ix = IncrWS( ix, end, indent, ixWS );
 1390|  10.8k|        }
 1391|   279M|        else if (( c == '&' ) && (TY_(HTMLVersion)(doc) == HT50) &&
  ------------------
  |  |   23|   198k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   198k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      else if (( c == '&' ) && (TY_(HTMLVersion)(doc) == HT50) &&
  ------------------
  |  |  200|   198k|#define HT50              131072u
  ------------------
  |  Branch (1391:18): [True: 198k, False: 279M]
  |  Branch (1391:34): [True: 0, False: 198k]
  ------------------
 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|   279M|        else
 1401|   279M|        {
 1402|   279M|            PPrintChar( doc, c, mode );
 1403|   279M|        }
 1404|   279M|    }
 1405|   457k|}
pprint.c:TextEndsWithNewline:
  999|   461k|{
 1000|   461k|    if ( (mode & (CDATA|COMMENT)) && TY_(nodeIsText)(node) && node->end > node->start )
  ------------------
  |  |   23|   287k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   287k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1000:10): [True: 287k, False: 173k]
  |  Branch (1000:38): [True: 17.4k, False: 270k]
  |  Branch (1000:63): [True: 17.4k, False: 0]
  ------------------
 1001|  17.4k|    {
 1002|  17.4k|        uint ch, ix = node->end - 1;
 1003|       |        /*\
 1004|       |         *  Skip non-newline whitespace.
 1005|       |         *  Issue #379 - Only if ix is GT start can it be decremented!
 1006|       |        \*/
 1007|  97.6k|        while ( ix > node->start && (ch = (lexer->lexbuf[ix] & 0xff))
  ------------------
  |  Branch (1007:17): [True: 87.2k, False: 10.3k]
  |  Branch (1007:37): [True: 86.8k, False: 426]
  ------------------
 1008|  86.8k|                 && ( ch == ' ' || ch == '\t' || ch == '\r' ) )
  ------------------
  |  Branch (1008:23): [True: 79.7k, False: 7.06k]
  |  Branch (1008:36): [True: 429, False: 6.63k]
  |  Branch (1008:50): [True: 24, False: 6.61k]
  ------------------
 1009|  80.2k|            --ix;
 1010|       |
 1011|  17.4k|        if ( lexer->lexbuf[ ix ] == '\n' )
  ------------------
  |  Branch (1011:14): [True: 851, False: 16.5k]
  ------------------
 1012|    851|          return node->end - ix - 1; /* #543262 tidy eats all memory */
 1013|  17.4k|    }
 1014|   460k|    return -1;
 1015|   461k|}
pprint.c:TextStartsWithWhitespace:
 1044|   468k|{
 1045|   468k|    assert( node != NULL );
  ------------------
  |  Branch (1045:5): [True: 0, False: 468k]
  |  Branch (1045:5): [True: 468k, False: 0]
  ------------------
 1046|   468k|    if ( (mode & (CDATA|COMMENT)) && TY_(nodeIsTextLike)(node) && node->end > node->start && start >= node->start )
  ------------------
  |  |   23|   291k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   291k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1046:10): [True: 291k, False: 176k]
  |  Branch (1046:38): [True: 87.5k, False: 204k]
  |  Branch (1046:67): [True: 26.6k, False: 60.9k]
  |  Branch (1046:94): [True: 26.6k, False: 0]
  ------------------
 1047|  26.6k|    {
 1048|  26.6k|        uint ch, ix = start;
 1049|       |        /* Skip whitespace. */
 1050|  2.78M|        while ( ix < node->end && (ch = (lexer->lexbuf[ix] & 0xff))
  ------------------
  |  Branch (1050:17): [True: 2.78M, False: 1.98k]
  |  Branch (1050:35): [True: 2.78M, False: 590]
  ------------------
 1051|  2.78M|                && ( ch==' ' || ch=='\t' || ch=='\r' ) )
  ------------------
  |  Branch (1051:22): [True: 2.75M, False: 25.2k]
  |  Branch (1051:33): [True: 948, False: 24.2k]
  |  Branch (1051:45): [True: 235, False: 24.0k]
  ------------------
 1052|  2.76M|            ++ix;
 1053|       |
 1054|  26.6k|        if ( ix > start )
  ------------------
  |  Branch (1054:14): [True: 3.36k, False: 23.2k]
  ------------------
 1055|  3.36k|          return ix - start;
 1056|  26.6k|    }
 1057|   464k|    return -1;
 1058|   468k|}
pprint.c:prvTidynodeIsTextLike:
 1028|   291k|{
 1029|   291k|    if ( TY_(nodeIsText)(node) )
  ------------------
  |  |   23|   291k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   291k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1029:10): [True: 19.2k, False: 272k]
  ------------------
 1030|  19.2k|        return yes;
 1031|   272k|    if ( node->type == AspTag )
  ------------------
  |  Branch (1031:10): [True: 42.9k, False: 229k]
  ------------------
 1032|  42.9k|        return yes;
 1033|   229k|    if (node->type == PhpTag)
  ------------------
  |  Branch (1033:9): [True: 25.3k, False: 204k]
  ------------------
 1034|  25.3k|        return yes; /* Issue #392 */
 1035|       |    /* add other text like nodes... */
 1036|   204k|    return no;
 1037|   229k|}
pprint.c:IncrWS:
 1341|   468k|{
 1342|   468k|  if ( ixWS > 0 )
  ------------------
  |  Branch (1342:8): [True: 3.36k, False: 464k]
  ------------------
 1343|  3.36k|  {
 1344|  3.36k|    uint st = start + MIN( (uint)ixWS, indent );
  ------------------
  |  |   25|  3.36k|#define MIN(a,b) (((a) < (b))?(a):(b))
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 3.36k]
  |  |  ------------------
  ------------------
 1345|  3.36k|    start = MIN( st, end );
  ------------------
  |  |   25|  3.36k|#define MIN(a,b) (((a) < (b))?(a):(b))
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 3.36k, False: 0]
  |  |  ------------------
  ------------------
 1346|  3.36k|  }
 1347|   468k|  return start;
 1348|   468k|}
pprint.c:CheckWrapIndent:
  696|   283M|{
  697|   283M|    TidyPrintImpl* pprint = &doc->pprint;
  698|   283M|    if ( GetSpaces(pprint) + pprint->linelen >= cfg(doc, TidyWrapLen) )
  ------------------
  |  |  415|   283M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (698:10): [True: 277M, False: 5.60M]
  ------------------
  699|   277M|    {
  700|   277M|        WrapLine( doc );
  701|   277M|        if ( pprint->indent[ 0 ].spaces < 0 )
  ------------------
  |  Branch (701:14): [True: 31, False: 277M]
  ------------------
  702|     31|        {
  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|     31|            pprint->indent[ 0 ].spaces = indent;
  707|     31|        }
  708|   277M|        return yes;
  709|   277M|    }
  710|  5.60M|    return no;
  711|   283M|}
pprint.c:PPrintChar:
 1138|   338M|{
 1139|   338M|    tmbchar entity[128];
 1140|   338M|    ctmbstr p;
 1141|   338M|    TidyPrintImpl* pprint  = &doc->pprint;
 1142|   338M|    uint outenc = cfg( doc, TidyOutCharEncoding );
  ------------------
  |  |  415|   338M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1143|   338M|    Bool qmark = cfgBool( doc, TidyQuoteMarks );
  ------------------
  |  |  418|   338M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   338M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1144|       |
 1145|   338M|    if ( c == ' ' && !(mode & (PREFORMATTED | COMMENT | ATTRIBVALUE | CDATA)))
  ------------------
  |  Branch (1145:10): [True: 263M, False: 74.9M]
  |  Branch (1145:22): [True: 185k, False: 263M]
  ------------------
 1146|   185k|    {
 1147|       |        /* coerce a space character to a non-breaking space */
 1148|   185k|        if (mode & NOWRAP)
  ------------------
  |  Branch (1148:13): [True: 0, False: 185k]
  ------------------
 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|   185k|        else
 1158|   185k|            pprint->wraphere = pprint->linelen;
 1159|   185k|    }
 1160|       |
 1161|       |    /* comment characters are passed raw */
 1162|   338M|    if ( mode & (COMMENT | CDATA) )
  ------------------
  |  Branch (1162:10): [True: 130M, False: 207M]
  ------------------
 1163|   130M|    {
 1164|   130M|        AddChar( pprint, c );
 1165|   130M|        return;
 1166|   130M|    }
 1167|       |
 1168|       |    /* except in CDATA map < to &lt; etc. */
 1169|   207M|    if ( !(mode & CDATA) )
  ------------------
  |  Branch (1169:10): [True: 207M, False: 0]
  ------------------
 1170|   207M|    {
 1171|   207M|        if ( c == '<')
  ------------------
  |  Branch (1171:14): [True: 404k, False: 207M]
  ------------------
 1172|   404k|        {
 1173|   404k|            AddString( pprint, "&lt;" );
 1174|   404k|            return;
 1175|   404k|        }
 1176|       |            
 1177|   207M|        if ( c == '>')
  ------------------
  |  Branch (1177:14): [True: 122k, False: 207M]
  ------------------
 1178|   122k|        {
 1179|   122k|            AddString( pprint, "&gt;" );
 1180|   122k|            return;
 1181|   122k|        }
 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|   207M|        if ( c == '&' && cfgBool(doc, TidyQuoteAmpersand)
  ------------------
  |  |  418|   207M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   236k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 236k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1188:14): [True: 236k, False: 207M]
  ------------------
 1189|   236k|             && !cfgBool(doc, TidyPreserveEntities)
  ------------------
  |  |  418|   207M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   236k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1189:17): [True: 236k, False: 0]
  ------------------
 1190|   236k|             && ( mode != OtherNamespace) ) /* #130 MathML attr and entity fix! */
  ------------------
  |  Branch (1190:17): [True: 236k, False: 211]
  ------------------
 1191|   236k|        {
 1192|   236k|            AddString( pprint, "&amp;" );
 1193|   236k|            return;
 1194|   236k|        }
 1195|       |
 1196|   207M|        if ( c == '"' && qmark )
  ------------------
  |  Branch (1196:14): [True: 11.0k, False: 207M]
  |  Branch (1196:26): [True: 0, False: 11.0k]
  ------------------
 1197|      0|        {
 1198|      0|            AddString( pprint, "&quot;" );
 1199|      0|            return;
 1200|      0|        }
 1201|       |
 1202|   207M|        if ( c == '\'' && qmark )
  ------------------
  |  Branch (1202:14): [True: 9.92k, False: 207M]
  |  Branch (1202:27): [True: 0, False: 9.92k]
  ------------------
 1203|      0|        {
 1204|      0|            AddString( pprint, "&#39;" );
 1205|      0|            return;
 1206|      0|        }
 1207|       |
 1208|   207M|        if ( c == 160 && outenc != RAW )
  ------------------
  |  |  133|    722|#define RAW         0
  ------------------
  |  Branch (1208:14): [True: 722, False: 207M]
  |  Branch (1208:26): [True: 722, False: 0]
  ------------------
 1209|    722|        {
 1210|    722|            if ( cfgBool(doc, TidyQuoteNbsp) )
  ------------------
  |  |  418|    722|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    722|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 722, False: 0]
  |  |  ------------------
  ------------------
 1211|    722|            {
 1212|    722|                if ( cfgBool(doc, TidyNumEntities) ||
  ------------------
  |  |  418|  1.44k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    722|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 722]
  |  |  ------------------
  ------------------
 1213|    722|                     cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|    722|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    722|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 722]
  |  |  ------------------
  ------------------
 1214|      0|                    AddString( pprint, "&#160;" );
 1215|    722|                else
 1216|    722|                    AddString( pprint, "&nbsp;" );
 1217|    722|            }
 1218|      0|            else
 1219|      0|                AddChar( pprint, c );
 1220|    722|            return;
 1221|    722|        }
 1222|   207M|    }
 1223|       |
 1224|       |    /* Handle encoding-specific issues */
 1225|   207M|    switch ( outenc )
  ------------------
  |  Branch (1225:14): [True: 207M, False: 0]
  ------------------
 1226|   207M|    {
 1227|   207M|    case UTF8:
  ------------------
  |  |  137|   207M|#define UTF8        4
  ------------------
  |  Branch (1227:5): [True: 207M, False: 0]
  ------------------
 1228|   207M|    case UTF16:
  ------------------
  |  |  144|   207M|#define UTF16       11
  ------------------
  |  Branch (1228:5): [True: 0, False: 207M]
  ------------------
 1229|   207M|    case UTF16LE:
  ------------------
  |  |  142|   207M|#define UTF16LE     9
  ------------------
  |  Branch (1229:5): [True: 0, False: 207M]
  ------------------
 1230|   207M|    case UTF16BE:
  ------------------
  |  |  143|   207M|#define UTF16BE     10
  ------------------
  |  Branch (1230:5): [True: 0, False: 207M]
  ------------------
 1231|   207M|        if (!(mode & PREFORMATTED) && cfg(doc, TidyPunctWrap))
  ------------------
  |  |  415|  13.0M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (415:33): [True: 0, False: 13.0M]
  |  |  ------------------
  ------------------
  |  Branch (1231:13): [True: 13.0M, False: 194M]
  ------------------
 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|   207M|        break;
 1240|       |
 1241|      0|    case BIG5:
  ------------------
  |  |  145|      0|#define BIG5        12
  ------------------
  |  Branch (1241:5): [True: 0, False: 207M]
  ------------------
 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: 207M]
  ------------------
 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: 207M]
  ------------------
 1258|      0|#endif
 1259|      0|    case RAW:
  ------------------
  |  |  133|      0|#define RAW         0
  ------------------
  |  Branch (1259:5): [True: 0, False: 207M]
  ------------------
 1260|      0|        AddChar( pprint, c );
 1261|      0|        return;
 1262|   207M|    }
 1263|       |
 1264|       |    /* don't map latin-1 chars to entities */
 1265|   207M|    if ( outenc == LATIN1 )
  ------------------
  |  |  136|   207M|#define LATIN1      3
  ------------------
  |  Branch (1265:10): [True: 0, False: 207M]
  ------------------
 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|   207M|    if ( outenc == UTF8 )
  ------------------
  |  |  137|   207M|#define UTF8        4
  ------------------
  |  Branch (1291:10): [True: 207M, False: 0]
  ------------------
 1292|   207M|    {
 1293|   207M|        AddChar( pprint, c );
 1294|   207M|        return;
 1295|   207M|    }
 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.49M|{
  808|  3.49M|   return pprint->linelen = AddAsciiString( pprint, str, pprint->linelen );
  809|  3.49M|}
pprint.c:AddAsciiString:
  792|  3.49M|{
  793|  3.49M|    uint ix, len = TY_(tmbstrlen)( str );
  ------------------
  |  |   23|  3.49M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.49M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  794|  3.49M|    if ( string_index + len >= pprint->lbufsize )
  ------------------
  |  Branch (794:10): [True: 22.3k, False: 3.47M]
  ------------------
  795|  22.3k|        expand( pprint, string_index + len );
  796|       |
  797|  13.8M|    for ( ix=0; ix<len; ++ix )
  ------------------
  |  Branch (797:17): [True: 10.3M, False: 3.49M]
  ------------------
  798|  10.3M|        pprint->linebuf[string_index + ix] = str[ ix ];
  799|  3.49M|    return string_index + len;
  800|  3.49M|}
pprint.c:expand:
  314|  28.3k|{
  315|  28.3k|    uint* ip;
  316|  28.3k|    uint buflen = pprint->lbufsize;
  317|       |
  318|  28.3k|    if ( buflen == 0 )
  ------------------
  |  Branch (318:10): [True: 21.3k, False: 7.07k]
  ------------------
  319|  21.3k|        buflen = 256;
  320|  35.6k|    while ( len >= buflen )
  ------------------
  |  Branch (320:13): [True: 7.25k, False: 28.3k]
  ------------------
  321|  7.25k|        buflen *= 2;
  322|       |
  323|  28.3k|    ip = (uint*) TidyRealloc( pprint->allocator, pprint->linebuf, buflen*sizeof(uint) );
  ------------------
  |  |   67|  28.3k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  324|  28.3k|    if ( ip )
  ------------------
  |  Branch (324:10): [True: 28.3k, False: 0]
  ------------------
  325|  28.3k|    {
  326|  28.3k|      TidyClearMemory( ip+pprint->lbufsize, 
  ------------------
  |  |   70|  28.3k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  327|  28.3k|                       (buflen-pprint->lbufsize)*sizeof(uint) );
  328|  28.3k|      pprint->lbufsize = buflen;
  329|  28.3k|      pprint->linebuf = ip;
  330|  28.3k|    }
  331|  28.3k|}
pprint.c:AddChar:
  782|   378M|{
  783|   378M|    AddC( pprint, c, pprint->linelen );
  784|   378M|    return ++pprint->linelen;
  785|   378M|}
pprint.c:AddC:
  771|   378M|{
  772|   378M|    if ( string_index + 1 >= pprint->lbufsize )
  ------------------
  |  Branch (772:10): [True: 6.07k, False: 378M]
  ------------------
  773|  6.07k|        expand( pprint, string_index + 1 );
  774|   378M|    pprint->linebuf[string_index] = c;
  775|   378M|}
pprint.c:PPrintComment:
 1859|  36.8k|{
 1860|  36.8k|    TidyPrintImpl* pprint = &doc->pprint;
 1861|       |
 1862|  36.8k|    SetWrap( doc, indent );
 1863|  36.8k|    AddString( pprint, "<!--" );
 1864|       |
 1865|  36.8k|    PPrintText(doc, COMMENT, 0, node);
 1866|       |
 1867|  36.8k|    AddString(pprint, "--");
 1868|  36.8k|    AddChar( pprint, '>' );
 1869|  36.8k|    if ( node->linebreak && node->next )
  ------------------
  |  Branch (1869:10): [True: 889, False: 35.9k]
  |  Branch (1869:29): [True: 687, False: 202]
  ------------------
 1870|    687|        PFlushLineSmart( doc, indent );
 1871|  36.8k|}
pprint.c:SetWrap:
  541|   734k|{
  542|   734k|    TidyPrintImpl* pprint = &doc->pprint;
  543|   734k|    Bool wrap = ( indent + pprint->linelen < cfg(doc, TidyWrapLen) );
  ------------------
  |  |  415|   734k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  544|   734k|    if ( wrap )
  ------------------
  |  Branch (544:10): [True: 529k, False: 205k]
  ------------------
  545|   529k|    {
  546|   529k|        if ( pprint->indent[0].spaces < 0 )
  ------------------
  |  Branch (546:14): [True: 21.1k, False: 508k]
  ------------------
  547|  21.1k|            pprint->indent[0].spaces = indent;
  548|   529k|        pprint->wraphere = pprint->linelen;
  549|   529k|    }
  550|   205k|    else if ( pprint->ixInd == 0 )
  ------------------
  |  Branch (550:15): [True: 6.45k, False: 199k]
  ------------------
  551|  6.45k|    {
  552|       |        /* Save indent 1st time we pass the the wrap line */
  553|  6.45k|        pprint->indent[ 1 ].spaces = indent;
  554|  6.45k|        pprint->ixInd = 1;
  555|  6.45k|    }
  556|   734k|    return wrap;
  557|   734k|}
pprint.c:PPrintDocType:
 1878|  31.6k|{
 1879|  31.6k|    TidyPrintImpl* pprint = &doc->pprint;
 1880|  31.6k|    uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  31.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1881|  31.6k|    uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|  31.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1882|  31.6k|    AttVal* fpi = TY_(GetAttrByName)(node, "PUBLIC");
  ------------------
  |  |   23|  31.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1883|  31.6k|    AttVal* sys = TY_(GetAttrByName)(node, "SYSTEM");
  ------------------
  |  |   23|  31.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1884|       |
 1885|       |    /* todo: handle non-ASCII characters in FPI / SI / node->element */
 1886|       |
 1887|  31.6k|    SetWrap( doc, indent );
 1888|  31.6k|    PCondFlushLineSmart( doc, indent );
 1889|       |
 1890|  31.6k|    AddString( pprint, "<!DOCTYPE " );
 1891|  31.6k|    SetWrap( doc, indent );
 1892|  31.6k|    if (node->element)
  ------------------
  |  Branch (1892:9): [True: 31.6k, False: 0]
  ------------------
 1893|  31.6k|    {
 1894|  31.6k|        AddString(pprint, node->element);
 1895|  31.6k|    }
 1896|       |
 1897|  31.6k|    if (fpi && fpi->value)
  ------------------
  |  Branch (1897:9): [True: 8.46k, False: 23.1k]
  |  Branch (1897:16): [True: 4.90k, False: 3.56k]
  ------------------
 1898|  4.90k|    {
 1899|  4.90k|        AddString(pprint, " PUBLIC ");
 1900|  4.90k|        AddChar(pprint, fpi->delim);
 1901|  4.90k|        AddString(pprint, fpi->value);
 1902|  4.90k|        AddChar(pprint, fpi->delim);
 1903|  4.90k|    }
 1904|       |
 1905|  31.6k|    if (fpi && fpi->value && sys && sys->value)
  ------------------
  |  Branch (1905:9): [True: 8.46k, False: 23.1k]
  |  Branch (1905:16): [True: 4.90k, False: 3.56k]
  |  Branch (1905:30): [True: 1.87k, False: 3.02k]
  |  Branch (1905:37): [True: 1.79k, False: 83]
  ------------------
 1906|  1.79k|    {
 1907|  1.79k|        uint i = pprint->linelen - (TY_(tmbstrlen)(sys->value) + 2) - 1;
  ------------------
  |  |   23|  1.79k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.79k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1908|  1.79k|        if (!(i>0&&TY_(tmbstrlen)(sys->value)+2+i<wraplen&&i<=(spaces?spaces:2)*2))
  ------------------
  |  |   23|  1.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1908:15): [True: 1.65k, False: 137]
  |  Branch (1908:20): [True: 1.33k, False: 325]
  |  Branch (1908:60): [True: 547, False: 784]
  |  Branch (1908:64): [True: 0, False: 1.33k]
  ------------------
 1909|  1.24k|            i = 0;
 1910|       |
 1911|  1.79k|        PCondFlushLineSmart(doc, i);
 1912|  1.79k|        if (pprint->linelen)
  ------------------
  |  Branch (1912:13): [True: 0, False: 1.79k]
  ------------------
 1913|      0|            AddChar(pprint, ' ');
 1914|  1.79k|    }
 1915|  29.8k|    else if (sys && sys->value)
  ------------------
  |  Branch (1915:14): [True: 2.73k, False: 27.1k]
  |  Branch (1915:21): [True: 2.36k, False: 367]
  ------------------
 1916|  2.36k|    {
 1917|  2.36k|        AddString(pprint, " SYSTEM ");
 1918|  2.36k|    }
 1919|       |
 1920|  31.6k|    if (sys && sys->value)
  ------------------
  |  Branch (1920:9): [True: 4.52k, False: 27.1k]
  |  Branch (1920:16): [True: 4.15k, False: 367]
  ------------------
 1921|  4.15k|    {
 1922|  4.15k|        AddChar(pprint, sys->delim);
 1923|  4.15k|        AddString(pprint, sys->value);
 1924|  4.15k|        AddChar(pprint, sys->delim);
 1925|  4.15k|    }
 1926|       |
 1927|  31.6k|    if (node->content)
  ------------------
  |  Branch (1927:9): [True: 524, False: 31.1k]
  ------------------
 1928|    524|    {
 1929|    524|        PCondFlushLineSmart(doc, indent);
 1930|    524|        AddChar(pprint, '[');
 1931|    524|        PPrintText(doc, CDATA, 0, node->content);
 1932|    524|        AddChar(pprint, ']');
 1933|    524|    }
 1934|       |
 1935|  31.6k|    SetWrap( doc, 0 );
 1936|  31.6k|    AddChar( pprint, '>' );
 1937|  31.6k|    PCondFlushLineSmart( doc, indent );
 1938|  31.6k|}
pprint.c:PPrintPI:
 1945|  44.8k|{
 1946|  44.8k|    TidyPrintImpl* pprint = &doc->pprint;
 1947|  44.8k|    tchar c;
 1948|  44.8k|    tmbstr s;
 1949|       |
 1950|  44.8k|    SetWrap( doc, indent );
 1951|  44.8k|    AddString( pprint, "<?" );
 1952|       |
 1953|  44.8k|    s = node->element;
 1954|       |
 1955|   108k|    while (s && *s)
  ------------------
  |  Branch (1955:12): [True: 68.5k, False: 39.9k]
  |  Branch (1955:17): [True: 63.6k, False: 4.87k]
  ------------------
 1956|  63.6k|    {
 1957|  63.6k|        c = (unsigned char)*s;
 1958|  63.6k|        if (c > 0x7F)
  ------------------
  |  Branch (1958:13): [True: 6.62k, False: 57.0k]
  ------------------
 1959|  6.62k|            s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|  6.62k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.62k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1960|  63.6k|        AddChar(pprint, c);
 1961|  63.6k|        ++s;
 1962|  63.6k|    }
 1963|       |
 1964|       |    /* set CDATA to pass < and > unescaped */
 1965|  44.8k|    PPrintText( doc, CDATA, indent, node );
 1966|       |
 1967|  44.8k|    if (cfgBool(doc, TidyXmlOut) ||
  ------------------
  |  |  418|  89.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  44.8k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 44.8k, False: 0]
  |  |  ------------------
  ------------------
 1968|      0|        cfgBool(doc, TidyXhtmlOut) || node->closed)
  ------------------
  |  |  418|  44.8k|#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|  44.8k|        AddChar( pprint, '?' );
 1970|       |
 1971|  44.8k|    AddChar( pprint, '>' );
 1972|  44.8k|    PCondFlushLine( doc, indent );
 1973|  44.8k|}
pprint.c:PCondFlushLine:
  873|  44.8k|{
  874|  44.8k|    TidyPrintImpl* pprint = &doc->pprint;
  875|       |
  876|  44.8k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (876:10): [True: 44.8k, False: 0]
  ------------------
  877|  44.8k|    {
  878|  44.8k|         PFlushLineImpl( doc );
  879|       |
  880|  44.8k|         TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|  44.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  881|  44.8k|         pprint->line++;
  882|  44.8k|    }
  883|       |
  884|       |    /* Issue #390 - Whether chars to flush or not, set new indent */
  885|  44.8k|    if ( pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (885:10): [True: 0, False: 44.8k]
  ------------------
  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|  44.8k|}
pprint.c:PPrintXmlDecl:
 1980|  2.66k|{
 1981|  2.66k|    AttVal* att;
 1982|  2.66k|    uint saveWrap;
 1983|  2.66k|    TidyPrintImpl* pprint = &doc->pprint;
 1984|  2.66k|    Bool ucAttrs;
 1985|  2.66k|    SetWrap( doc, indent );
 1986|  2.66k|    saveWrap = WrapOff( doc );
 1987|       |
 1988|       |    /* no case translation for XML declaration pseudo attributes */
 1989|  2.66k|    ucAttrs = cfg(doc, TidyUpperCaseAttrs);
  ------------------
  |  |  415|  2.66k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1990|  2.66k|    TY_(SetOptionInt)(doc, TidyUpperCaseAttrs, no);
  ------------------
  |  |   23|  2.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1991|       |
 1992|  2.66k|    AddString( pprint, "<?xml" );
 1993|       |
 1994|       |    /* Force order of XML declaration attributes */
 1995|       |    /* PPrintAttrs( doc, indent, node ); */
 1996|  2.66k|    if ( NULL != (att = TY_(AttrGetById)(node, TidyAttr_VERSION)) )
  ------------------
  |  |   23|  2.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1996:10): [True: 16, False: 2.64k]
  ------------------
 1997|     16|      PPrintAttribute( doc, indent, node, att );
 1998|  2.66k|    if ( NULL != (att = TY_(AttrGetById)(node, TidyAttr_ENCODING)) )
  ------------------
  |  |   23|  2.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1998:10): [True: 14, False: 2.64k]
  ------------------
 1999|     14|      PPrintAttribute( doc, indent, node, att );
 2000|  2.66k|    if ( NULL != (att = TY_(GetAttrByName)(node, "standalone")) )
  ------------------
  |  |   23|  2.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2000:10): [True: 0, False: 2.66k]
  ------------------
 2001|      0|      PPrintAttribute( doc, indent, node, att );
 2002|       |
 2003|       |    /* restore old config value */
 2004|  2.66k|    TY_(SetOptionInt)(doc, TidyUpperCaseAttrs, ucAttrs);
  ------------------
  |  |   23|  2.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2005|       |
 2006|  2.66k|    if ( node->end <= 0 || doc->lexer->lexbuf[node->end - 1] != '?' )
  ------------------
  |  Branch (2006:10): [True: 90, False: 2.57k]
  |  Branch (2006:28): [True: 1.78k, False: 784]
  ------------------
 2007|  1.87k|        AddChar( pprint, '?' );
 2008|  2.66k|    AddChar( pprint, '>' );
 2009|  2.66k|    WrapOn( doc, saveWrap );
 2010|  2.66k|    PFlushLineSmart( doc, indent );
 2011|  2.66k|}
pprint.c:WrapOff:
  508|  10.0k|{
  509|  10.0k|    uint saveWrap = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  10.0k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  510|  10.0k|    TY_(SetOptionInt)( doc, TidyWrapLen, 0xFFFFFFFF );  /* very large number */
  ------------------
  |  |   23|  10.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  511|  10.0k|    return saveWrap;
  512|  10.0k|}
pprint.c:PPrintAttribute:
 1546|   445k|{
 1547|   445k|    TidyPrintImpl* pprint = &doc->pprint;
 1548|   445k|    Bool xmlOut    = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|   445k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   445k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1549|   445k|    Bool xhtmlOut  = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|   445k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   445k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1550|   445k|    Bool wrapAttrs = cfgBool( doc, TidyWrapAttVals );
  ------------------
  |  |  418|   445k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   445k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1551|   445k|    uint ucAttrs   = cfg( doc, TidyUpperCaseAttrs );
  ------------------
  |  |  415|   445k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1552|   445k|    Bool indAttrs  = cfgBool( doc, TidyIndentAttributes );
  ------------------
  |  |  418|   445k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   445k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1553|   445k|    uint xtra      = AttrIndent( doc, node, attr );
 1554|   445k|    Bool first     = (attr == node->attributes);
 1555|   445k|    tmbstr name    = attr->attribute;
 1556|   445k|    Bool wrappable = no;
 1557|   445k|    tchar c;
 1558|       |
 1559|       |    /* fix for odd attribute indentation bug triggered by long values */
 1560|   445k|    if (!indAttrs)
  ------------------
  |  Branch (1560:9): [True: 445k, False: 0]
  ------------------
 1561|   445k|      xtra = 0;
 1562|       |
 1563|   445k|    if ( indAttrs )
  ------------------
  |  Branch (1563:10): [True: 0, False: 445k]
  ------------------
 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|   445k|    CheckWrapIndent( doc, indent );
 1573|       |
 1574|   445k|    if ( !xmlOut && !xhtmlOut && attr->dict )
  ------------------
  |  Branch (1574:10): [True: 0, False: 445k]
  |  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|   445k|    if ( !first && !SetWrap(doc, indent) )
  ------------------
  |  Branch (1582:10): [True: 110k, False: 334k]
  |  Branch (1582:20): [True: 1.62k, False: 108k]
  ------------------
 1583|  1.62k|    {
 1584|  1.62k|        TY_(PFlushLine)( doc, indent+xtra );  /* Put it on next line */
  ------------------
  |  |   23|  1.62k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.62k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1585|  1.62k|    }
 1586|   443k|    else if ( pprint->linelen > 0 )
  ------------------
  |  Branch (1586:15): [True: 443k, False: 0]
  ------------------
 1587|   443k|    {
 1588|   443k|        AddChar( pprint, ' ' );
 1589|   443k|    }
 1590|       |
 1591|       |    /* Attribute name */
 1592|  17.1M|    while (*name)
  ------------------
  |  Branch (1592:12): [True: 16.7M, False: 445k]
  ------------------
 1593|  16.7M|    {
 1594|  16.7M|        c = (unsigned char)*name;
 1595|       |
 1596|  16.7M|        if (c > 0x7F)
  ------------------
  |  Branch (1596:13): [True: 0, False: 16.7M]
  ------------------
 1597|      0|            name += TY_(GetUTF8)(name, &c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1598|  16.7M|        else if (ucAttrs == TidyUppercaseYes)
  ------------------
  |  Branch (1598:18): [True: 0, False: 16.7M]
  ------------------
 1599|      0|            c = TY_(ToUpper)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1600|       |
 1601|  16.7M|        AddChar(pprint, c);
 1602|  16.7M|        ++name;
 1603|  16.7M|    }
 1604|       |
 1605|   445k|    CheckWrapIndent( doc, indent );
 1606|       | 
 1607|   445k|    if ( attr->value == NULL )
  ------------------
  |  Branch (1607:10): [True: 157k, False: 287k]
  ------------------
 1608|   157k|    {
 1609|   157k|        Bool isB = TY_(IsBoolAttribute)(attr);
  ------------------
  |  |   23|   157k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   157k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1610|   157k|        Bool scriptAttr = TY_(attrIsEvent)(attr);
  ------------------
  |  |   23|   157k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   157k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1611|       |
 1612|   157k|        if ( xmlOut )
  ------------------
  |  Branch (1612:14): [True: 157k, False: 0]
  ------------------
 1613|   157k|            PPrintAttrValue( doc, indent, isB ? attr->attribute : NULLSTR,
  ------------------
  |  |  625|   314k|#  define NULLSTR (tmbstr)""
  ------------------
  |  Branch (1613:43): [True: 888, False: 156k]
  ------------------
 1614|   157k|                             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|   157k|    }
 1622|   287k|    else
 1623|   287k|        PPrintAttrValue( doc, indent, attr->value, attr->delim, wrappable, no );
 1624|   445k|}
pprint.c:AttrIndent:
 1525|   445k|{
 1526|   445k|  uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|   445k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1527|   445k|  uint xtra = 2;  /* 1 for the '<', another for the ' ' */
 1528|   445k|  if ( node->element == NULL )
  ------------------
  |  Branch (1528:8): [True: 30, False: 445k]
  ------------------
 1529|     30|    return spaces;
 1530|       |
 1531|   445k|  if ( !TY_(nodeHasCM)(node, CM_INLINE) ||
  ------------------
  |  |   23|   445k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   445k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                if ( !TY_(nodeHasCM)(node, CM_INLINE) ||
  ------------------
  |  |  143|   445k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1531:8): [True: 99.4k, False: 345k]
  ------------------
 1532|   345k|       !ShouldIndent(doc, node->parent ? node->parent: node) )
  ------------------
  |  Branch (1532:8): [True: 345k, False: 0]
  |  Branch (1532:27): [True: 345k, False: 0]
  ------------------
 1533|   445k|    return xtra + TY_(tmbstrlen)( node->element );
  ------------------
  |  |   23|   445k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   445k|#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|   445k|{
 1414|   445k|    TidyPrintImpl* pprint = &doc->pprint;
 1415|   445k|    Bool scriptlets = cfgBool(doc, TidyWrapScriptlets);
  ------------------
  |  |  418|   445k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   445k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1416|       |
 1417|   445k|    uint mode = PREFORMATTED | ATTRIBVALUE;
 1418|   445k|    if ( wrappable )
  ------------------
  |  Branch (1418:10): [True: 0, False: 445k]
  ------------------
 1419|      0|        mode = NORMAL | ATTRIBVALUE;
 1420|       |
 1421|       |    /* look for ASP, Tango or PHP instructions for computed attribute value */
 1422|   445k|    if ( value && value[0] == '<' )
  ------------------
  |  Branch (1422:10): [True: 445k, False: 0]
  |  Branch (1422:19): [True: 4.80k, False: 440k]
  ------------------
 1423|  4.80k|    {
 1424|  4.80k|        if ( value[1] == '%' || value[1] == '@'||
  ------------------
  |  Branch (1424:14): [True: 2.08k, False: 2.71k]
  |  Branch (1424:33): [True: 258, False: 2.46k]
  ------------------
 1425|  2.46k|             TY_(tmbstrncmp)(value, "<?php", 5) == 0 )
  ------------------
  |  |   23|  2.46k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.46k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1425:14): [True: 220, False: 2.24k]
  ------------------
 1426|  2.55k|            mode |= CDATA;
 1427|  4.80k|    }
 1428|       |
 1429|   445k|    if ( delim == 0 )
  ------------------
  |  Branch (1429:10): [True: 17, False: 445k]
  ------------------
 1430|     17|        delim = '"';
 1431|       |
 1432|   445k|    AddChar( pprint, '=' );
 1433|       |
 1434|       |    /* don't wrap after "=" for xml documents */
 1435|   445k|    if ( !cfgBool(doc, TidyXmlOut) || cfgBool(doc, TidyXhtmlOut) )
  ------------------
  |  |  418|   890k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   445k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                  if ( !cfgBool(doc, TidyXmlOut) || cfgBool(doc, TidyXhtmlOut) )
  ------------------
  |  |  418|   445k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   445k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 445k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1435:10): [True: 0, False: 445k]
  ------------------
 1436|   445k|    {
 1437|   445k|        SetWrap( doc, indent );
 1438|   445k|        CheckWrapIndent( doc, indent );
 1439|       |        /*
 1440|       |        if ( !SetWrap(doc, indent) )
 1441|       |            PCondFlushLine( doc, indent );
 1442|       |        */
 1443|   445k|    }
 1444|       |
 1445|   445k|    AddChar( pprint, delim );
 1446|       |
 1447|   445k|    if ( value )
  ------------------
  |  Branch (1447:10): [True: 445k, False: 0]
  ------------------
 1448|   445k|    {
 1449|   445k|        uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|   445k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1450|   445k|        int attrStart = SetInAttrVal( pprint );
 1451|   445k|        int strStart = ClearInString( pprint );
 1452|       |
 1453|  59.5M|        while (*value != '\0')
  ------------------
  |  Branch (1453:16): [True: 59.0M, False: 445k]
  ------------------
 1454|  59.0M|        {
 1455|  59.0M|            uint c = *value;
 1456|       |
 1457|  59.0M|            if ( wrappable && c == ' ' )
  ------------------
  |  Branch (1457:18): [True: 0, False: 59.0M]
  |  Branch (1457:31): [True: 0, False: 0]
  ------------------
 1458|      0|                SetWrapAttr( doc, indent, attrStart, strStart );
 1459|       |
 1460|  59.0M|            if ( wrappable && pprint->wraphere > 0 &&
  ------------------
  |  Branch (1460:18): [True: 0, False: 59.0M]
  |  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|  59.0M|            if ( c == delim )
  ------------------
  |  Branch (1464:18): [True: 9.17k, False: 59.0M]
  ------------------
 1465|  9.17k|            {
 1466|  9.17k|                ctmbstr entity = (c == '"' ? "&quot;" : "&#39;");
  ------------------
  |  Branch (1466:35): [True: 8.99k, False: 181]
  ------------------
 1467|  9.17k|                AddString( pprint, entity );
 1468|  9.17k|                ++value;
 1469|  9.17k|                continue;
 1470|  9.17k|            }
 1471|  59.0M|            else if (c == '"')
  ------------------
  |  Branch (1471:22): [True: 920, False: 59.0M]
  ------------------
 1472|    920|            {
 1473|    920|                if ( cfgBool(doc, TidyQuoteMarks) )
  ------------------
  |  |  418|    920|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    920|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 920]
  |  |  ------------------
  ------------------
 1474|      0|                    AddString( pprint, "&quot;" );
 1475|    920|                else
 1476|    920|                    AddChar( pprint, c );
 1477|       |
 1478|    920|                if ( delim == '\'' && scriptAttr && scriptlets )
  ------------------
  |  Branch (1478:22): [True: 920, False: 0]
  |  Branch (1478:39): [True: 0, False: 920]
  |  Branch (1478:53): [True: 0, False: 0]
  ------------------
 1479|      0|                    strStart = ToggleInString( pprint );
 1480|       |
 1481|    920|                ++value;
 1482|    920|                continue;
 1483|    920|            }
 1484|  59.0M|            else if ( c == '\'' )
  ------------------
  |  Branch (1484:23): [True: 8.28k, False: 59.0M]
  ------------------
 1485|  8.28k|            {
 1486|  8.28k|                if ( cfgBool(doc, TidyQuoteMarks) )
  ------------------
  |  |  418|  8.28k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  8.28k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 8.28k]
  |  |  ------------------
  ------------------
 1487|      0|                    AddString( pprint, "&#39;" );
 1488|  8.28k|                else
 1489|  8.28k|                    AddChar( pprint, c );
 1490|       |
 1491|  8.28k|                if ( delim == '"' && scriptAttr && scriptlets )
  ------------------
  |  Branch (1491:22): [True: 8.28k, False: 0]
  |  Branch (1491:38): [True: 0, False: 8.28k]
  |  Branch (1491:52): [True: 0, False: 0]
  ------------------
 1492|      0|                    strStart = ToggleInString( pprint );
 1493|       |
 1494|  8.28k|                ++value;
 1495|  8.28k|                continue;
 1496|  8.28k|            }
 1497|       |
 1498|       |            /* look for UTF-8 multibyte character */
 1499|  59.0M|            if ( c > 0x7F )
  ------------------
  |  Branch (1499:18): [True: 558k, False: 58.5M]
  ------------------
 1500|   558k|                 value += TY_(GetUTF8)( value, &c );
  ------------------
  |  |   23|   558k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   558k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1501|  59.0M|            ++value;
 1502|       |
 1503|  59.0M|            if ( c == '\n' )
  ------------------
  |  Branch (1503:18): [True: 2.87k, False: 59.0M]
  ------------------
 1504|  2.87k|            {
 1505|       |                /* No indent inside Javascript literals */
 1506|  2.87k|                TY_(PFlushLine)( doc, (strStart < 0
  ------------------
  |  |   23|  2.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1506:40): [True: 2.87k, False: 0]
  ------------------
 1507|  2.87k|                                       && !cfgBool(doc, TidyLiteralAttribs) ?
  ------------------
  |  |  418|  2.87k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.87k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1507:43): [True: 2.87k, False: 0]
  ------------------
 1508|  2.87k|                                       indent : 0) );
 1509|  2.87k|                continue;
 1510|  2.87k|            }
 1511|  59.0M|            PPrintChar( doc, c, mode );
 1512|  59.0M|        }
 1513|   445k|        ClearInAttrVal( pprint );
 1514|   445k|        ClearInString( pprint );
 1515|   445k|    }
 1516|   445k|    AddChar( pprint, delim );
 1517|   445k|}
pprint.c:SetInAttrVal:
  419|   445k|{
  420|   445k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  421|   445k|    return ind->attrValStart = (int) pprint->linelen;
  422|   445k|}
pprint.c:ClearInString:
  355|   890k|{
  356|   890k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  357|   890k|    return ind->attrStringStart = -1;
  358|   890k|}
pprint.c:ClearInAttrVal:
  406|   445k|{
  407|   445k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  408|   445k|    ind->attrValStart = -1;
  409|   445k|}
pprint.c:WrapOn:
  520|   172k|{
  521|   172k|    TY_(SetOptionInt)( doc, TidyWrapLen, saveWrap );
  ------------------
  |  |   23|   172k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   172k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  522|   172k|}
pprint.c:PPrintCDATA:
 2080|    791|{
 2081|    791|    uint saveWrap;
 2082|    791|    TidyPrintImpl* pprint = &doc->pprint;
 2083|    791|    Bool indentCData = cfgBool( doc, TidyIndentCdata );
  ------------------
  |  |  418|    791|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    791|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2084|    791|    if ( !indentCData )
  ------------------
  |  Branch (2084:10): [True: 791, False: 0]
  ------------------
 2085|    791|        indent = 0;
 2086|       |
 2087|    791|    PCondFlushLineSmart( doc, indent );
 2088|    791|    saveWrap = WrapOff( doc );        /* disable wrapping */
 2089|       |
 2090|    791|    AddString( pprint, "<![CDATA[" );
 2091|    791|    PPrintText( doc, COMMENT, indent, node );
 2092|    791|    AddString( pprint, "]]>" );
 2093|       |
 2094|    791|    PCondFlushLineSmart( doc, indent );
 2095|    791|    WrapOn( doc, saveWrap );          /* restore wrapping */
 2096|    791|}
pprint.c:PPrintSection:
 2103|  80.9k|{
 2104|  80.9k|    TidyPrintImpl* pprint = &doc->pprint;
 2105|  80.9k|    Bool wrapSect = cfgBool( doc, TidyWrapSection );
  ------------------
  |  |  418|  80.9k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  80.9k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2106|  80.9k|    uint saveWrap = WrapOffCond( doc, !wrapSect  );
 2107|       |
 2108|  80.9k|    AddString( pprint, "<![" );
 2109|  80.9k|    PPrintText( doc, (wrapSect ? CDATA : COMMENT),
  ------------------
  |  Branch (2109:23): [True: 80.9k, False: 0]
  ------------------
 2110|  80.9k|                indent, node );
 2111|  80.9k|    AddString( pprint, "]>" );
 2112|       |
 2113|       |    /* PCondFlushLine( doc, indent ); */
 2114|  80.9k|    WrapOn( doc, saveWrap );
 2115|  80.9k|}
pprint.c:WrapOffCond:
  529|   162k|{
  530|   162k|    if ( onoff )
  ------------------
  |  Branch (530:10): [True: 0, False: 162k]
  ------------------
  531|      0|        return WrapOff( doc );
  532|   162k|    return cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|   162k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  533|   162k|}
pprint.c:PPrintAsp:
 2019|  41.8k|{
 2020|  41.8k|    TidyPrintImpl* pprint = &doc->pprint;
 2021|  41.8k|    Bool wrapAsp  = cfgBool( doc, TidyWrapAsp );
  ------------------
  |  |  418|  41.8k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  41.8k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2022|  41.8k|    Bool wrapJste = cfgBool( doc, TidyWrapJste );
  ------------------
  |  |  418|  41.8k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  41.8k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2023|  41.8k|    uint saveWrap = WrapOffCond( doc, !wrapAsp || !wrapJste );
  ------------------
  |  Branch (2023:39): [True: 0, False: 41.8k]
  |  Branch (2023:51): [True: 0, False: 41.8k]
  ------------------
 2024|       |
 2025|  41.8k|    AddString( pprint, "<%" );
 2026|  41.8k|    PPrintText( doc, (wrapAsp ? CDATA : COMMENT), indent, node );
  ------------------
  |  Branch (2026:23): [True: 41.8k, False: 0]
  ------------------
 2027|  41.8k|    AddString( pprint, "%>" );
 2028|       |
 2029|       |    /* PCondFlushLine( doc, indent ); */
 2030|  41.8k|    WrapOn( doc, saveWrap );
 2031|  41.8k|}
pprint.c:PPrintJste:
 2039|  39.2k|{
 2040|  39.2k|    TidyPrintImpl* pprint = &doc->pprint;
 2041|  39.2k|    Bool wrapAsp = cfgBool( doc, TidyWrapAsp );
  ------------------
  |  |  418|  39.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  39.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2042|  39.2k|    uint saveWrap = WrapOffCond( doc, !wrapAsp  );
 2043|       |
 2044|  39.2k|    AddString( pprint, "<#" );
 2045|  39.2k|    PPrintText( doc, (cfgBool(doc, TidyWrapJste) ? CDATA : COMMENT),
  ------------------
  |  |  418|  39.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  39.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 39.2k, False: 0]
  |  |  ------------------
  ------------------
 2046|  39.2k|                indent, node );
 2047|  39.2k|    AddString( pprint, "#>" );
 2048|       |
 2049|       |    /* PCondFlushLine( doc, indent ); */
 2050|  39.2k|    WrapOn( doc, saveWrap );
 2051|  39.2k|}
pprint.c:PPrintPhp:
 2059|  24.3k|{
 2060|  24.3k|    TidyPrintImpl* pprint = &doc->pprint;
 2061|  24.3k|    Bool wrapPhp = cfgBool( doc, TidyWrapPhp );
  ------------------
  |  |  418|  24.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  24.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2062|       |    /* uint saveWrap = WrapOffCond( doc, !wrapPhp  ); */
 2063|       |
 2064|  24.3k|    AddString( pprint, "<?" );
 2065|  24.3k|    PPrintText( doc, CDATA, indent, node );
 2066|  24.3k|    AddString( pprint, "?>" );
 2067|       |
 2068|       |    /* Issue #437 - add a new line if 'wrap-php' is on */
 2069|  24.3k|    if (wrapPhp)
  ------------------
  |  Branch (2069:9): [True: 0, False: 24.3k]
  ------------------
 2070|      0|        PCondFlushLine( doc, indent ); 
 2071|       |       
 2072|       |    /* WrapOn( doc, saveWrap ); */
 2073|  24.3k|}
pprint.c:PPrintMathML:
 2239|    325|{
 2240|    325|    Node *content;
 2241|    325|    uint mode = OtherNamespace;
 2242|       |
 2243|    325|    PPrintTag( doc, mode, indent, node );
 2244|       |
 2245|    839|    for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2245:36): [True: 514, False: 325]
  ------------------
 2246|    514|           TY_(PPrintTree)( doc, mode, indent, content );
  ------------------
  |  |   23|    514|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    514|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2247|       |
 2248|    325|    PPrintEndTag( doc, mode, indent, node );
 2249|    325|}
pprint.c:PCondFlushLineSmart:
  930|   686k|{
  931|   686k|    TidyPrintImpl* pprint = &doc->pprint;
  932|       |
  933|   686k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (933:10): [True: 264k, False: 422k]
  ------------------
  934|   264k|    {
  935|   264k|         PFlushLineImpl( doc );
  936|       |
  937|       |         /* Issue #228 - cfgBool( doc, TidyVertSpace ); */
  938|   264k|         if(TidyAddVS) {
  ------------------
  |  |   52|   264k|#define TidyAddVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyAutoState) ? no : yes )
  |  |  ------------------
  |  |  |  |  421|   264k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|   264k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (52:19): [True: 264k, False: 0]
  |  |  |  Branch (52:20): [True: 0, False: 264k]
  |  |  ------------------
  ------------------
  939|   264k|            TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|   264k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   264k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  940|   264k|            pprint->line++;
  941|   264k|         }
  942|   264k|    }
  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|   686k|    if (pprint->indent[ 0 ].spaces != (int)indent)
  ------------------
  |  Branch (949:9): [True: 1.14k, False: 685k]
  ------------------
  950|  1.14k|    {
  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|  1.14k|        pprint->indent[ 0 ].spaces = indent;
  955|  1.14k|    }
  956|   686k|}
pprint.c:PFlushLineSmart:
  901|   489k|{
  902|   489k|    TidyPrintImpl* pprint = &doc->pprint;
  903|       |
  904|   489k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (904:10): [True: 487k, False: 2.56k]
  ------------------
  905|   487k|        PFlushLineImpl( doc );
  906|       |
  907|       |    /* Issue #228 - cfgBool( doc, TidyVertSpace ); */
  908|   489k|    if(TidyAddVS) {
  ------------------
  |  |   52|   489k|#define TidyAddVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyAutoState) ? no : yes )
  |  |  ------------------
  |  |  |  |  421|   489k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|   489k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (52:19): [True: 489k, False: 0]
  |  |  |  Branch (52:20): [True: 0, False: 489k]
  |  |  ------------------
  ------------------
  909|   489k|        TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|   489k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   489k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  910|   489k|        pprint->line++;
  911|   489k|    }
  912|       |
  913|   489k|    if ( pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (913:10): [True: 0, False: 489k]
  ------------------
  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|   489k|}
pprint.c:PPrintTag:
 1772|  2.19M|{
 1773|  2.19M|    TidyPrintImpl* pprint = &doc->pprint;
 1774|  2.19M|    Bool uc = cfgBool( doc, TidyUpperCaseTags );
  ------------------
  |  |  418|  2.19M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.19M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1775|  2.19M|    Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  2.19M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.19M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1776|  2.19M|    Bool xmlOut = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|  2.19M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.19M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1777|  2.19M|    tchar c;
 1778|  2.19M|    tmbstr s = node->element;
 1779|       |
 1780|  2.19M|    AddChar( pprint, '<' );
 1781|       |
 1782|  2.19M|    if ( node->type == EndTag )
  ------------------
  |  Branch (1782:10): [True: 268, False: 2.18M]
  ------------------
 1783|    268|        AddChar( pprint, '/' );
 1784|       |
 1785|  2.19M|    if (s)
  ------------------
  |  Branch (1785:9): [True: 2.18M, False: 294]
  ------------------
 1786|  2.18M|    {
 1787|  9.84M|        while (*s)
  ------------------
  |  Branch (1787:16): [True: 7.66M, False: 2.18M]
  ------------------
 1788|  7.66M|        {
 1789|  7.66M|            c = (unsigned char)*s;
 1790|       |
 1791|  7.66M|            if (c > 0x7F)
  ------------------
  |  Branch (1791:17): [True: 0, False: 7.66M]
  ------------------
 1792|      0|                s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1793|  7.66M|            else if (uc)
  ------------------
  |  Branch (1793:22): [True: 0, False: 7.66M]
  ------------------
 1794|      0|                c = TY_(ToUpper)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1795|       |
 1796|  7.66M|            AddChar(pprint, c);
 1797|  7.66M|            ++s;
 1798|  7.66M|        }
 1799|  2.18M|    }
 1800|       |
 1801|  2.19M|    PPrintAttrs( doc, indent, node );
 1802|       |
 1803|  2.19M|    if ( (xmlOut || xhtmlOut) &&
  ------------------
  |  Branch (1803:11): [True: 2.19M, False: 0]
  |  Branch (1803:21): [True: 0, False: 0]
  ------------------
 1804|  2.19M|         (node->type == StartEndTag || TY_(nodeCMIsEmpty)(node)) )
  ------------------
  |  |   23|  2.18M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.18M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1804:11): [True: 941, False: 2.18M]
  |  Branch (1804:40): [True: 58.4k, False: 2.13M]
  ------------------
 1805|  59.4k|    {
 1806|  59.4k|        AddChar( pprint, ' ' );   /* Space is NS compatibility hack <br /> */
 1807|  59.4k|        AddChar( pprint, '/' );   /* Required end tag marker */
 1808|  59.4k|    }
 1809|       |
 1810|  2.19M|    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.19M|    if ((node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50) && !TY_(nodeHasCM)(node, CM_VOID ) )
  ------------------
  |  |   23|    941|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    941|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if ((node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50) && !TY_(nodeHasCM)(node, CM_VOID ) )
  ------------------
  |  |  200|    941|#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: 941, False: 2.18M]
  |  Branch (1820:39): [True: 0, False: 941]
  |  Branch (1820:73): [True: 0, False: 0]
  ------------------
 1821|      0|    {
 1822|      0|        PPrintEndTag( doc, mode, indent, node );
 1823|      0|    }
 1824|       |
 1825|  2.19M|    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.18M, False: 941]
  |  Branch (1825:40): [True: 941, False: 0]
  |  Branch (1825:53): [True: 0, False: 0]
  |  Branch (1825:82): [True: 0, False: 0]
  |  Branch (1825:117): [True: 2.15M, False: 33.3k]
  ------------------
 1826|  2.15M|    {
 1827|  2.15M|        uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  2.15M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1828|  2.15M|        CheckWrapIndent( doc, indent );
 1829|       |
 1830|  2.15M|        if ( indent + pprint->linelen < wraplen )
  ------------------
  |  Branch (1830:14): [True: 1.00M, False: 1.15M]
  ------------------
 1831|  1.00M|        {
 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.00M|            if (!(mode & NOWRAP)
  ------------------
  |  Branch (1838:17): [True: 1.00M, False: 4.19k]
  ------------------
 1839|  1.00M|                && (!TY_(nodeCMIsInline)(node) || nodeIsBR(node))
  ------------------
  |  |   23|  1.00M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              && (!TY_(nodeCMIsInline)(node) || nodeIsBR(node))
  ------------------
  |  |  400|   619k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   619k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 619k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 619k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 7.64k, False: 612k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1839:21): [True: 382k, False: 619k]
  ------------------
 1840|   390k|                && AfterSpace(doc->lexer, node))
  ------------------
  |  Branch (1840:20): [True: 388k, False: 1.76k]
  ------------------
 1841|   388k|            {
 1842|   388k|                pprint->wraphere = pprint->linelen;
 1843|   388k|            }
 1844|  1.00M|        }
 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.15M|        else if ( mode & NOWRAP ||
  ------------------
  |  Branch (1848:19): [True: 67, False: 1.15M]
  ------------------
 1849|  1.15M|                  nodeIsBR(node) || AfterSpace(doc->lexer, node))
  ------------------
  |  |  400|  1.15M|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  2.30M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.15M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.15M, False: 215]
  |  |  |  |  |  Branch (275:54): [True: 330, False: 1.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1849:37): [True: 45.2k, False: 1.10M]
  ------------------
 1850|  45.6k|            PCondFlushLineSmart( doc, indent );
 1851|  2.15M|    }
 1852|  2.19M|}
pprint.c:PPrintAttrs:
 1631|  2.19M|{
 1632|  2.19M|    TidyPrintImpl* pprint = &doc->pprint;
 1633|  2.19M|    AttVal* av;
 1634|       |
 1635|       |    /* add xml:space attribute to pre and other elements */
 1636|  2.19M|    if ( cfgBool(doc, TidyXmlOut) && cfgBool(doc, TidyXmlSpace) &&
  ------------------
  |  |  418|  4.38M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.19M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 2.19M, False: 0]
  |  |  ------------------
  ------------------
                  if ( cfgBool(doc, TidyXmlOut) && cfgBool(doc, TidyXmlSpace) &&
  ------------------
  |  |  418|  4.38M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.19M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 2.19M]
  |  |  ------------------
  ------------------
 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.66M|    for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (1643:34): [True: 472k, False: 2.19M]
  ------------------
 1644|   472k|    {
 1645|   472k|        if ( av->attribute != NULL )
  ------------------
  |  Branch (1645:14): [True: 445k, False: 27.4k]
  ------------------
 1646|   445k|        {
 1647|   445k|            PPrintAttribute( doc, indent, node, av );
 1648|   445k|        }
 1649|  27.4k|        else if ( av->asp != NULL )
  ------------------
  |  Branch (1649:19): [True: 3.39k, False: 24.0k]
  ------------------
 1650|  3.39k|        {
 1651|  3.39k|            AddChar( pprint, ' ' );
 1652|  3.39k|            PPrintAsp( doc, indent, av->asp );
 1653|  3.39k|        }
 1654|  24.0k|        else if ( av->php != NULL )
  ------------------
  |  Branch (1654:19): [True: 24.0k, False: 0]
  ------------------
 1655|  24.0k|        {
 1656|  24.0k|            AddChar( pprint, ' ' );
 1657|  24.0k|            PPrintPhp( doc, indent, av->php );
 1658|  24.0k|        }
 1659|   472k|    }
 1660|  2.19M|}
pprint.c:AfterSpace:
 1729|  1.54M|{
 1730|  1.54M|    return AfterSpaceImp(lexer, node, TY_(nodeCMIsEmpty)(node));
  ------------------
  |  |   23|  1.54M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.54M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1731|  1.54M|}
pprint.c:AfterSpaceImp:
 1689|  1.75G|{
 1690|  1.75G|    Node *prev;
 1691|       |
 1692|  1.75G|    if ( !TY_(nodeCMIsInline)(node) )
  ------------------
  |  |   23|  1.75G|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.75G|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1692:10): [True: 416k, False: 1.75G]
  ------------------
 1693|   416k|        return yes;
 1694|       |
 1695|  1.75G|    prev = node->prev;
 1696|  1.75G|    if (prev)
  ------------------
  |  Branch (1696:9): [True: 1.12M, False: 1.75G]
  ------------------
 1697|  1.12M|    {
 1698|  1.12M|        if (TY_(nodeIsText)(prev))
  ------------------
  |  |   23|  1.12M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.12M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1698:13): [True: 1.04M, False: 76.6k]
  ------------------
 1699|  1.04M|            return TY_(TextNodeEndWithSpace)( lexer, prev );
  ------------------
  |  |   23|  1.04M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1700|  76.6k|        else if (nodeIsBR(prev))
  ------------------
  |  |  400|  76.6k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  76.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 76.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 75.9k, False: 713]
  |  |  |  |  |  Branch (275:54): [True: 5.88k, False: 70.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1701|  5.88k|            return yes;
 1702|       |
 1703|  70.7k|        return no;
 1704|  1.12M|    }
 1705|       |
 1706|  1.75G|    if ( isEmpty && !TY_(nodeCMIsInline)(node->parent) )
  ------------------
  |  |   23|  1.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1706:10): [True: 1.64k, False: 1.75G]
  |  Branch (1706:21): [True: 444, False: 1.20k]
  ------------------
 1707|    444|        return no;
 1708|       |
 1709|  1.75G|    return AfterSpaceImp(lexer, node->parent, isEmpty);
 1710|  1.75G|}
pprint.c:PPrintEndTag:
 1739|  2.13M|{
 1740|  2.13M|    TidyPrintImpl* pprint = &doc->pprint;
 1741|  2.13M|    Bool uc = cfgBool( doc, TidyUpperCaseTags );
  ------------------
  |  |  418|  2.13M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.13M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1742|  2.13M|    tmbstr s = node->element;
 1743|  2.13M|    tchar c;
 1744|       |
 1745|  2.13M|    AddString( pprint, "</" );
 1746|       |
 1747|  2.13M|    if (s)
  ------------------
  |  Branch (1747:9): [True: 2.13M, False: 294]
  ------------------
 1748|  2.13M|    {
 1749|  9.58M|        while (*s)
  ------------------
  |  Branch (1749:16): [True: 7.45M, False: 2.13M]
  ------------------
 1750|  7.45M|        {
 1751|  7.45M|             c = (unsigned char)*s;
 1752|       |
 1753|  7.45M|             if (c > 0x7F)
  ------------------
  |  Branch (1753:18): [True: 0, False: 7.45M]
  ------------------
 1754|      0|                 s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1755|  7.45M|             else if (uc)
  ------------------
  |  Branch (1755:23): [True: 0, False: 7.45M]
  ------------------
 1756|      0|                 c = TY_(ToUpper)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1757|       |
 1758|  7.45M|             AddChar(pprint, c);
 1759|  7.45M|             ++s;
 1760|  7.45M|        }
 1761|  2.13M|    }
 1762|       |
 1763|  2.13M|    AddChar( pprint, '>' );
 1764|  2.13M|}
pprint.c:PPrintScriptStyle:
 2122|  5.67k|{
 2123|  5.67k|    TidyPrintImpl* pprint = &doc->pprint;
 2124|  5.67k|    Node*   content;
 2125|  5.67k|    ctmbstr commentStart = DEFAULT_COMMENT_START;
 2126|  5.67k|    ctmbstr commentEnd = DEFAULT_COMMENT_END;
 2127|  5.67k|    Bool    hasCData = no;
 2128|  5.67k|    int     contentIndent = -1;
 2129|  5.67k|    Bool    xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  5.67k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.67k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2130|       |
 2131|  5.67k|    if ( InsideHead(doc, node) )
  ------------------
  |  Branch (2131:10): [True: 2.87k, False: 2.80k]
  ------------------
 2132|  2.87k|      PFlushLineSmart( doc, indent );
 2133|       |
 2134|  5.67k|    PCondFlushLineSmart( doc, indent );  /* Issue #56 - long outstanding bug - flush any existing closing tag */
 2135|       |
 2136|  5.67k|    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|  5.67k|    if ( node->content != NULL )
  ------------------
  |  Branch (2141:10): [True: 3.91k, False: 1.76k]
  ------------------
 2142|  3.91k|        PFlushLineSmart(doc, indent);
 2143|       |
 2144|  5.67k|    if ( xhtmlOut && node->content != NULL )
  ------------------
  |  Branch (2144:10): [True: 5.67k, False: 0]
  |  Branch (2144:22): [True: 3.91k, False: 1.76k]
  ------------------
 2145|  3.91k|    {
 2146|  3.91k|        AttVal* type = attrGetTYPE(node);
  ------------------
  |  |  405|  3.91k|#define attrGetTYPE( nod )        TY_(AttrGetById)( nod, TidyAttr_TYPE  )
  |  |  ------------------
  |  |  |  |   23|  3.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  3.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2147|       |
 2148|  3.91k|        if (AttrValueIs(type, "text/javascript"))
  ------------------
  |  |  172|  3.91k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  7.82k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 580, False: 3.33k]
  |  |  |  |  |  Branch (171:44): [True: 502, False: 78]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  3.91k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|    502|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    502|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 502]
  |  |  ------------------
  ------------------
 2149|      0|        {
 2150|      0|            commentStart = JS_COMMENT_START;
 2151|      0|            commentEnd = JS_COMMENT_END;
 2152|      0|        }
 2153|  3.91k|        else if (AttrValueIs(type, "text/css"))
  ------------------
  |  |  172|  3.91k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  7.82k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 580, False: 3.33k]
  |  |  |  |  |  Branch (171:44): [True: 502, False: 78]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  3.91k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|    502|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    502|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 68, False: 434]
  |  |  ------------------
  ------------------
 2154|     68|        {
 2155|     68|            commentStart = CSS_COMMENT_START;
 2156|     68|            commentEnd = CSS_COMMENT_END;
 2157|     68|        }
 2158|  3.84k|        else if (AttrValueIs(type, "text/vbscript"))
  ------------------
  |  |  172|  3.84k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  7.68k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 512, False: 3.33k]
  |  |  |  |  |  Branch (171:44): [True: 434, False: 78]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  3.84k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|    434|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    434|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 434]
  |  |  ------------------
  ------------------
 2159|      0|        {
 2160|      0|            commentStart = VB_COMMENT_START;
 2161|      0|            commentEnd = VB_COMMENT_END;
 2162|      0|        }
 2163|       |
 2164|  3.91k|        hasCData = HasCDATA(doc->lexer, node->content);
 2165|       |
 2166|  3.91k|        if (!hasCData)
  ------------------
  |  Branch (2166:13): [True: 3.31k, False: 596]
  ------------------
 2167|  3.31k|        {
 2168|  3.31k|            uint saveWrap = WrapOff( doc );
 2169|       |
 2170|  3.31k|            AddString( pprint, commentStart );
 2171|  3.31k|            AddString( pprint, CDATA_START );
 2172|  3.31k|            AddString( pprint, commentEnd );
 2173|  3.31k|            PCondFlushLineSmart( doc, indent );
 2174|       |
 2175|  3.31k|            WrapOn( doc, saveWrap );
 2176|  3.31k|        }
 2177|  3.91k|    }
 2178|       |
 2179|  5.67k|    for ( content = node->content;
 2180|  12.0k|          content != NULL;
  ------------------
  |  Branch (2180:11): [True: 6.39k, False: 5.67k]
  ------------------
 2181|  6.39k|          content = content->next )
 2182|  6.39k|    {
 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|  6.39k|        TY_(PPrintTree)( doc, (mode | PREFORMATTED | NOWRAP | CDATA),
  ------------------
  |  |   23|  6.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2189|  6.39k|                         indent, content );
 2190|       |
 2191|  6.39k|        if ( content == node->last )
  ------------------
  |  Branch (2191:14): [True: 3.91k, False: 2.48k]
  ------------------
 2192|  3.91k|            contentIndent = TextEndsWithNewline( doc->lexer, content, CDATA );
 2193|  6.39k|    }
 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|  5.67k|    if ( contentIndent < 0 && node->content != NULL )
  ------------------
  |  Branch (2197:10): [True: 5.25k, False: 417]
  |  Branch (2197:31): [True: 3.49k, False: 1.76k]
  ------------------
 2198|  3.49k|    {
 2199|  3.49k|        PCondFlushLineSmart( doc, indent );
 2200|  3.49k|        contentIndent = 0;
 2201|  3.49k|    }
 2202|       |
 2203|  5.67k|    if ( xhtmlOut && node->content != NULL )
  ------------------
  |  Branch (2203:10): [True: 5.67k, False: 0]
  |  Branch (2203:22): [True: 3.91k, False: 1.76k]
  ------------------
 2204|  3.91k|    {
 2205|  3.91k|        if ( ! hasCData )
  ------------------
  |  Branch (2205:14): [True: 3.31k, False: 596]
  ------------------
 2206|  3.31k|        {
 2207|  3.31k|            uint saveWrap = WrapOff( doc );
 2208|       |
 2209|  3.31k|            AddString( pprint, commentStart );
 2210|  3.31k|            AddString( pprint, CDATA_END );
 2211|  3.31k|            AddString( pprint, commentEnd );
 2212|       |
 2213|  3.31k|            WrapOn( doc, saveWrap );
 2214|  3.31k|            PCondFlushLineSmart( doc, indent );
 2215|  3.31k|        }
 2216|  3.91k|    }
 2217|       |
 2218|  5.67k|    if ( node->content && pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (2218:10): [True: 3.91k, False: 1.76k]
  |  Branch (2218:27): [True: 0, False: 3.91k]
  ------------------
 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|  5.67k|    PPrintEndTag( doc, mode, indent, node );
 2226|  5.67k|    if ( cfgAutoBool(doc, TidyIndentContent) == TidyNoState
  ------------------
  |  |  421|  5.67k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.67k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2226:10): [True: 5.67k, False: 0]
  ------------------
 2227|  5.67k|         && node->next != NULL &&
  ------------------
  |  Branch (2227:13): [True: 4.00k, False: 1.66k]
  ------------------
 2228|  4.00k|         !( TY_(nodeHasCM)(node, CM_INLINE) || TY_(nodeIsText)(node) ) )
  ------------------
  |  |   23|  4.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                       !( TY_(nodeHasCM)(node, CM_INLINE) || TY_(nodeIsText)(node) ) )
  ------------------
  |  |  143|  4.00k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                       !( TY_(nodeHasCM)(node, CM_INLINE) || TY_(nodeIsText)(node) ) )
  ------------------
  |  |   23|  2.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2228:13): [True: 1.78k, False: 2.22k]
  |  Branch (2228:48): [True: 0, False: 2.22k]
  ------------------
 2229|  2.22k|        PFlushLineSmart( doc, indent );
 2230|  5.67k|}
pprint.c:InsideHead:
  981|   127k|{
  982|   127k|  if ( nodeIsHEAD(node) )
  ------------------
  |  |  371|   127k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|   127k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 127k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 92.2k, False: 35.2k]
  |  |  |  |  |  Branch (275:54): [True: 2.87k, False: 89.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  983|  2.87k|    return yes;
  984|       |
  985|   124k|  if ( node->parent != NULL )
  ------------------
  |  Branch (985:8): [True: 121k, False: 2.80k]
  ------------------
  986|   121k|    return InsideHead( doc, node->parent );
  987|       |
  988|  2.80k|  return no;
  989|   124k|}
pprint.c:HasCDATA:
 1065|  3.91k|{
 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|  3.91k|    ctmbstr start = lexer->lexbuf + node->start;
 1070|  3.91k|    int len = node->end - node->start + 1;
 1071|       |
 1072|  3.91k|    if ( node->type != TextNode )
  ------------------
  |  Branch (1072:10): [True: 1.12k, False: 2.79k]
  ------------------
 1073|  1.12k|        return no;
 1074|       |
 1075|  2.79k|    return ( NULL != TY_(tmbsubstrn)( start, len, CDATA_START ));
  ------------------
  |  |   23|  2.79k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.79k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1076|  3.91k|}
pprint.c:ShouldIndent:
 1083|  3.16M|{
 1084|  3.16M|    TidyTriState indentContent = cfgAutoBool( doc, TidyIndentContent );
  ------------------
  |  |  421|  3.16M|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.16M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1085|  3.16M|    if ( indentContent == TidyNoState )
  ------------------
  |  Branch (1085:10): [True: 3.16M, False: 0]
  ------------------
 1086|  3.16M|        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|  21.3k|{
   69|  21.3k|  if ( stderrStreamOut.sink.sinkData == 0 )
  ------------------
  |  Branch (69:8): [True: 1, False: 21.3k]
  ------------------
   70|      1|      stderrStreamOut.sink.sinkData = stderr;
   71|  21.3k|  return &stderrStreamOut;
   72|  21.3k|}
prvTidyReleaseStreamOut:
   75|  42.6k|{
   76|  42.6k|    if ( out && out != &stderrStreamOut && out != &stdoutStreamOut )
  ------------------
  |  Branch (76:10): [True: 42.6k, False: 0]
  |  Branch (76:17): [True: 21.3k, False: 21.3k]
  |  Branch (76:44): [True: 21.3k, False: 0]
  ------------------
   77|  21.3k|    {
   78|  21.3k|        if ( out->iotype == FileIO )
  ------------------
  |  Branch (78:14): [True: 0, False: 21.3k]
  ------------------
   79|      0|            fclose( (FILE*) out->sink.sinkData );
   80|  21.3k|        TidyDocFree( doc, out );
  ------------------
  |  |  159|  21.3k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   81|  21.3k|    }
   82|  42.6k|}
prvTidyinitStreamIn:
   91|  21.3k|{
   92|  21.3k|    StreamIn *in = (StreamIn*) TidyDocAlloc( doc, sizeof(StreamIn) );
  ------------------
  |  |  157|  21.3k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  21.3k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
   93|       |
   94|  21.3k|    TidyClearMemory( in, sizeof(StreamIn) );
  ------------------
  |  |   70|  21.3k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
   95|  21.3k|    in->curline = 1;
   96|  21.3k|    in->curcol = 1;
   97|  21.3k|    in->encoding = encoding;
   98|  21.3k|    in->state = FSM_ASCII;
   99|  21.3k|    in->doc = doc;
  100|  21.3k|    in->bufsize = CHARBUF_SIZE;
  101|  21.3k|    in->allocator = doc->allocator;
  102|  21.3k|    in->charbuf = (tchar*)TidyDocAlloc(doc, sizeof(tchar) * in->bufsize);
  ------------------
  |  |  157|  21.3k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  21.3k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  103|  21.3k|    InitLastPos( in );
  104|  21.3k|    return in;
  105|  21.3k|}
prvTidyfreeStreamIn:
  108|  21.3k|{
  109|  21.3k|    TidyFree(in->allocator, in->charbuf);
  ------------------
  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  110|  21.3k|    TidyFree(in->allocator, in);
  ------------------
  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  111|  21.3k|}
prvTidyFileInput:
  114|  21.3k|{
  115|  21.3k|    StreamIn *in = TY_(initStreamIn)( doc, encoding );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  116|  21.3k|    if ( TY_(initFileSource)( doc->allocator, &in->source, fp ) != 0 )
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (116:10): [True: 0, False: 21.3k]
  ------------------
  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|  21.3k|    in->iotype = FileIO;
  122|  21.3k|    return in;
  123|  21.3k|}
prvTidyReadBOMEncoding:
  142|  21.3k|{
  143|  21.3k|    uint c, c1;
  144|  21.3k|    uint bom;
  145|       |
  146|  21.3k|    c = ReadByte(in);
  147|  21.3k|    if (c == EndOfStream)
  ------------------
  |  | 1064|  21.3k|#define EndOfStream (~0u)
  ------------------
  |  Branch (147:9): [True: 0, False: 21.3k]
  ------------------
  148|      0|        return -1;
  149|       |
  150|  21.3k|    c1 = ReadByte( in );
  151|  21.3k|    if (c1 == EndOfStream)
  ------------------
  |  | 1064|  21.3k|#define EndOfStream (~0u)
  ------------------
  |  Branch (151:9): [True: 0, False: 21.3k]
  ------------------
  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|  21.3k|    bom = (c << 8) + c1;
  161|       |
  162|  21.3k|    if ( bom == UNICODE_BOM_BE )
  ------------------
  |  |   28|  21.3k|#define UNICODE_BOM_BE   0xFEFF   /* big-endian (default) UNICODE BOM */
  ------------------
  |  Branch (162:10): [True: 120, False: 21.1k]
  ------------------
  163|    120|    {
  164|       |        /* big-endian UTF-16 */
  165|    120|        if ( in->encoding != UTF16 && in->encoding != UTF16BE )
  ------------------
  |  |  144|    240|#define UTF16       11
  ------------------
                      if ( in->encoding != UTF16 && in->encoding != UTF16BE )
  ------------------
  |  |  143|    120|#define UTF16BE     10
  ------------------
  |  Branch (165:14): [True: 120, False: 0]
  |  Branch (165:39): [True: 120, False: 0]
  ------------------
  166|    120|            TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16BE);
  ------------------
  |  |   23|    120|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    120|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16BE);
  ------------------
  |  |  143|    120|#define UTF16BE     10
  ------------------
  167|       |
  168|    120|        return UTF16BE; /* return decoded BOM */
  ------------------
  |  |  143|    120|#define UTF16BE     10
  ------------------
  169|    120|    }
  170|  21.1k|    else if (bom == UNICODE_BOM_LE)
  ------------------
  |  |   30|  21.1k|#define UNICODE_BOM_LE   0xFFFE   /* little-endian UNICODE BOM */
  ------------------
  |  Branch (170:14): [True: 60, False: 21.1k]
  ------------------
  171|     60|    {
  172|       |        /* little-endian UTF-16 */
  173|     60|        if (in->encoding != UTF16 && in->encoding != UTF16LE)
  ------------------
  |  |  144|    120|#define UTF16       11
  ------------------
                      if (in->encoding != UTF16 && in->encoding != UTF16LE)
  ------------------
  |  |  142|     60|#define UTF16LE     9
  ------------------
  |  Branch (173:13): [True: 60, False: 0]
  |  Branch (173:38): [True: 60, False: 0]
  ------------------
  174|     60|            TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16LE);
  ------------------
  |  |   23|     60|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     60|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(ReportEncodingWarning)(in->doc, ENCODING_MISMATCH, UTF16LE);
  ------------------
  |  |  142|     60|#define UTF16LE     9
  ------------------
  175|       |
  176|     60|        return UTF16LE; /* return decoded BOM */
  ------------------
  |  |  142|     60|#define UTF16LE     9
  ------------------
  177|     60|    }
  178|  21.1k|    else
  179|  21.1k|    {
  180|  21.1k|        uint c2 = ReadByte(in);
  181|       |
  182|  21.1k|        if (c2 == EndOfStream)
  ------------------
  |  | 1064|  21.1k|#define EndOfStream (~0u)
  ------------------
  |  Branch (182:13): [True: 0, False: 21.1k]
  ------------------
  183|      0|        {
  184|      0|            UngetByte(in, c1);
  185|      0|            UngetByte(in, c);
  186|      0|            return -1;
  187|      0|        }
  188|       |
  189|  21.1k|        if (((c << 16) + (c1 << 8) + c2) == UNICODE_BOM_UTF8)
  ------------------
  |  |   31|  21.1k|#define UNICODE_BOM_UTF8 0xEFBBBF /* UTF-8 UNICODE BOM */
  ------------------
  |  Branch (189:13): [True: 3, False: 21.1k]
  ------------------
  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|  21.1k|        else
  198|  21.1k|            UngetByte( in, c2 );
  199|  21.1k|    }
  200|       |
  201|  21.1k|    UngetByte(in, c1);
  202|  21.1k|    UngetByte(in, c);
  203|       |
  204|  21.1k|    return -1;
  205|  21.3k|}
prvTidyReadChar:
  240|   337M|{
  241|   337M|    uint c = EndOfStream;
  ------------------
  |  | 1064|   337M|#define EndOfStream (~0u)
  ------------------
  242|       |
  243|   337M|    if ( in->pushed )
  ------------------
  |  Branch (243:10): [True: 4.95M, False: 332M]
  ------------------
  244|  4.95M|        return PopChar( in );
  245|       |
  246|   332M|    SaveLastPos( in );
  247|       |
  248|   332M|    if ( in->tabs > 0 )
  ------------------
  |  Branch (248:10): [True: 258M, False: 73.8M]
  ------------------
  249|   258M|    {
  250|   258M|        in->curcol++;
  251|   258M|        in->tabs--;
  252|   258M|        return ' ';
  253|   258M|    }
  254|       |    
  255|  73.8M|    for (;;)
  256|  76.5M|    {
  257|  76.5M|        c = ReadCharFromStream(in);
  258|       |
  259|  76.5M|        if ( EndOfStream == c )
  ------------------
  |  | 1064|  76.5M|#define EndOfStream (~0u)
  ------------------
  |  Branch (259:14): [True: 1.61M, False: 74.9M]
  ------------------
  260|  1.61M|            return EndOfStream;
  ------------------
  |  | 1064|  1.61M|#define EndOfStream (~0u)
  ------------------
  261|       |
  262|  74.9M|        if (c == '\n')
  ------------------
  |  Branch (262:13): [True: 1.11M, False: 73.8M]
  ------------------
  263|  1.11M|        {
  264|  1.11M|            in->curcol = 1;
  265|  1.11M|            in->curline++;
  266|  1.11M|            break;
  267|  1.11M|        }
  268|       |
  269|  73.8M|        if (c == '\t')
  ------------------
  |  Branch (269:13): [True: 37.0M, False: 36.8M]
  ------------------
  270|  37.0M|        {
  271|  37.0M|            Bool keeptabs = cfg( in->doc, TidyKeepTabs );
  ------------------
  |  |  415|  37.0M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  272|  37.0M|            if (!keeptabs) {
  ------------------
  |  Branch (272:17): [True: 37.0M, False: 0]
  ------------------
  273|  37.0M|                uint tabsize = cfg(in->doc, TidyTabSize);
  ------------------
  |  |  415|  37.0M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  274|  37.0M|                in->tabs = tabsize > 0 ?
  ------------------
  |  Branch (274:28): [True: 37.0M, False: 0]
  ------------------
  275|  37.0M|                    tabsize - ((in->curcol - 1) % tabsize) - 1
  276|  37.0M|                    : 0;
  277|  37.0M|                c = ' ';
  278|  37.0M|            }
  279|  37.0M|            in->curcol++;
  280|  37.0M|            break;
  281|  37.0M|        }
  282|       |
  283|       |        /* #427663 - map '\r' to '\n' - Andy Quick 11 Aug 00 */
  284|  36.8M|        if (c == '\r')
  ------------------
  |  Branch (284:13): [True: 42.6k, False: 36.8M]
  ------------------
  285|  42.6k|        {
  286|  42.6k|            c = ReadCharFromStream(in);
  287|  42.6k|            if (c != '\n')
  ------------------
  |  Branch (287:17): [True: 40.9k, False: 1.71k]
  ------------------
  288|  40.9k|            {
  289|  40.9k|                TY_(UngetChar)( c, in );
  ------------------
  |  |   23|  40.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  290|  40.9k|                c = '\n';
  291|  40.9k|            }
  292|  1.71k|            else
  293|  1.71k|            {
  294|  1.71k|            }
  295|  42.6k|            in->curcol = 1;
  296|  42.6k|            in->curline++;
  297|  42.6k|            break;
  298|  42.6k|        }
  299|       |
  300|  36.8M|#ifndef NO_NATIVE_ISO2022_SUPPORT
  301|       |        /* strip control characters, except for Esc */
  302|  36.8M|        if (c == '\033')
  ------------------
  |  Branch (302:13): [True: 7.24k, False: 36.7M]
  ------------------
  303|  7.24k|            break;
  304|  36.7M|#endif
  305|       |
  306|       |        /* Form Feed is allowed in HTML */
  307|  36.7M|        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: 36.7M]
  |  Branch (307:29): [True: 0, False: 0]
  ------------------
  308|      0|            break;
  309|       |            
  310|  36.7M|        if ( c < 32 )
  ------------------
  |  Branch (310:14): [True: 2.77M, False: 34.0M]
  ------------------
  311|  2.77M|            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.0M|        if (
  317|  34.0M|            in->encoding == RAW
  ------------------
  |  |  133|  68.0M|#define RAW         0
  ------------------
  |  Branch (317:13): [True: 0, False: 34.0M]
  ------------------
  318|  34.0M|#ifndef NO_NATIVE_ISO2022_SUPPORT
  319|  34.0M|         || in->encoding == ISO2022
  ------------------
  |  |  138|  68.0M|#define ISO2022     5
  ------------------
  |  Branch (319:13): [True: 0, False: 34.0M]
  ------------------
  320|  34.0M|#endif
  321|  34.0M|         || in->encoding == UTF8
  ------------------
  |  |  137|  68.0M|#define UTF8        4
  ------------------
  |  Branch (321:13): [True: 33.6M, False: 399k]
  ------------------
  322|   399k|         || in->encoding == SHIFTJIS /* #431953 - RJ */
  ------------------
  |  |  146|  34.4M|#define SHIFTJIS    13
  ------------------
  |  Branch (322:13): [True: 0, False: 399k]
  ------------------
  323|   399k|         || in->encoding == BIG5     /* #431953 - RJ */
  ------------------
  |  |  145|   399k|#define BIG5        12
  ------------------
  |  Branch (323:13): [True: 0, False: 399k]
  ------------------
  324|  34.0M|           )
  325|  33.6M|        {
  326|  33.6M|            in->curcol++;
  327|  33.6M|            break;
  328|  33.6M|        }
  329|       |
  330|       |        /* handle surrogate pairs */
  331|   399k|        if ( in->encoding == UTF16LE ||
  ------------------
  |  |  142|   799k|#define UTF16LE     9
  ------------------
  |  Branch (331:14): [True: 396k, False: 3.73k]
  ------------------
  332|  3.73k|             in->encoding == UTF16   ||
  ------------------
  |  |  144|   403k|#define UTF16       11
  ------------------
  |  Branch (332:14): [True: 0, False: 3.73k]
  ------------------
  333|  3.73k|             in->encoding == UTF16BE )
  ------------------
  |  |  143|  3.73k|#define UTF16BE     10
  ------------------
  |  Branch (333:14): [True: 3.73k, False: 0]
  ------------------
  334|   399k|        {
  335|   399k|            if ( !TY_(IsValidUTF16FromUCS4)(c) )
  ------------------
  |  |   23|   399k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   399k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (335:18): [True: 0, False: 399k]
  ------------------
  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|   399k|            else if ( TY_(IsLowSurrogate)(c) )
  ------------------
  |  |   23|   399k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   399k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (341:23): [True: 7.12k, False: 392k]
  ------------------
  342|  7.12k|            {
  343|  7.12k|                uint n = c;
  344|  7.12k|                uint m = ReadCharFromStream( in );
  345|  7.12k|                if ( m == EndOfStream )
  ------------------
  |  | 1064|  7.12k|#define EndOfStream (~0u)
  ------------------
  |  Branch (345:22): [True: 8, False: 7.11k]
  ------------------
  346|      8|                   return EndOfStream;
  ------------------
  |  | 1064|      8|#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: 792, False: 6.32k]
  ------------------
  350|    792|                {
  351|    792|                    n = TY_(CombineSurrogatePair)( m, n );
  ------------------
  |  |   23|    792|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    792|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  352|    792|                    if ( TY_(IsValidCombinedChar)(n) )
  ------------------
  |  |   23|    792|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    792|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (352:26): [True: 472, False: 320]
  ------------------
  353|    472|                        c = n;
  354|    792|                }
  355|       |                /* not a valid pair */
  356|  7.11k|                if ( 0 == c )
  ------------------
  |  Branch (356:22): [True: 6.64k, False: 472]
  ------------------
  357|  6.64k|                    TY_(ReportEncodingError)( in->doc, INVALID_UTF16, c, yes );
  ------------------
  |  |   23|  6.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  358|  7.11k|            }
  359|   399k|        }
  360|       |
  361|       |        /* Do first: acts on range 128 - 255 */
  362|   399k|        switch ( in->encoding )
  ------------------
  |  Branch (362:18): [True: 0, False: 399k]
  ------------------
  363|   399k|        {
  364|      0|        case MACROMAN:
  ------------------
  |  |  139|      0|#define MACROMAN    6
  ------------------
  |  Branch (364:9): [True: 0, False: 399k]
  ------------------
  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: 399k]
  ------------------
  368|      0|            c = DecodeIbm850( c );
  369|      0|            break;
  370|      0|        case LATIN0:
  ------------------
  |  |  135|      0|#define LATIN0      2
  ------------------
  |  Branch (370:9): [True: 0, False: 399k]
  ------------------
  371|      0|            c = DecodeLatin0( c );
  372|      0|            break;
  373|   399k|        }
  374|       |
  375|       |        /* produced e.g. as a side-effect of smart quotes in Word */
  376|       |        /* but can't happen if using MACROMAN encoding */
  377|   399k|        if ( 127 < c && c < 160 )
  ------------------
  |  Branch (377:14): [True: 391k, False: 7.83k]
  |  Branch (377:25): [True: 920, False: 391k]
  ------------------
  378|    920|        {
  379|    920|            uint c1 = 0, replMode = DISCARDED_CHAR;
  ------------------
  |  |  314|    920|#define DISCARDED_CHAR          1
  ------------------
  380|    920|            Bool isVendorChar = ( in->encoding == WIN1252 ||
  ------------------
  |  |  140|  1.84k|#define WIN1252     7
  ------------------
  |  Branch (380:35): [True: 0, False: 920]
  ------------------
  381|    920|                                  in->encoding == MACROMAN );
  ------------------
  |  |  139|    920|#define MACROMAN    6
  ------------------
  |  Branch (381:35): [True: 0, False: 920]
  ------------------
  382|    920|            Bool isMacChar    = ( in->encoding == MACROMAN );
  ------------------
  |  |  139|    920|#define MACROMAN    6
  ------------------
  383|       |            
  384|       |            /* set error position just before offending character */
  385|    920|            if (in->doc->lexer)
  ------------------
  |  Branch (385:17): [True: 920, False: 0]
  ------------------
  386|    920|            {
  387|    920|                in->doc->lexer->lines = in->curline;
  388|    920|                in->doc->lexer->columns = in->curcol;
  389|    920|            }
  390|       |                
  391|    920|            if ( isMacChar )
  ------------------
  |  Branch (391:18): [True: 0, False: 920]
  ------------------
  392|      0|                c1 = TY_(DecodeMacRoman)( c );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  393|    920|            else
  394|    920|                c1 = TY_(DecodeWin1252)( c );
  ------------------
  |  |   23|    920|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    920|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  395|    920|            if ( c1 )
  ------------------
  |  Branch (395:18): [True: 482, False: 438]
  ------------------
  396|    482|                replMode = REPLACED_CHAR;
  ------------------
  |  |  313|    482|#define REPLACED_CHAR           0
  ------------------
  397|       |                
  398|    920|            if ( c1 == 0 && isVendorChar )
  ------------------
  |  Branch (398:18): [True: 438, False: 482]
  |  Branch (398:29): [True: 0, False: 438]
  ------------------
  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|    920|            else if ( ! isVendorChar )
  ------------------
  |  Branch (400:23): [True: 920, False: 0]
  ------------------
  401|    920|                TY_(ReportEncodingError)(in->doc, INVALID_SGML_CHARS, c, replMode == DISCARDED_CHAR);
  ------------------
  |  |   23|    920|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    920|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportEncodingError)(in->doc, INVALID_SGML_CHARS, c, replMode == DISCARDED_CHAR);
  ------------------
  |  |  314|    920|#define DISCARDED_CHAR          1
  ------------------
  402|       |                
  403|    920|            c = c1;
  404|    920|        }
  405|       |
  406|   399k|        if ( c == 0 )
  ------------------
  |  Branch (406:14): [True: 7.08k, False: 392k]
  ------------------
  407|  7.08k|            continue; /* illegal char is discarded */
  408|       |        
  409|   392k|        in->curcol++;
  410|   392k|        break;
  411|   399k|    }
  412|       |
  413|  72.1M|    return c;
  414|  73.8M|}
prvTidyUngetChar:
  440|  4.97M|{
  441|  4.97M|    if (c == EndOfStream)
  ------------------
  |  | 1064|  4.97M|#define EndOfStream (~0u)
  ------------------
  |  Branch (441:9): [True: 20.0k, False: 4.95M]
  ------------------
  442|  20.0k|    {
  443|       |        /* fprintf(stderr, "Attempt to UngetChar EOF\n"); */
  444|  20.0k|        return;
  445|  20.0k|    }
  446|       |    
  447|  4.95M|    in->pushed = yes;
  448|       |
  449|  4.95M|    if (in->bufpos + 1 >= in->bufsize)
  ------------------
  |  Branch (449:9): [True: 273k, False: 4.67M]
  ------------------
  450|   273k|        in->charbuf = (tchar*)TidyRealloc(in->allocator, in->charbuf, sizeof(tchar) * ++(in->bufsize));
  ------------------
  |  |   67|   273k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  451|       |
  452|  4.95M|    in->charbuf[(in->bufpos)++] = c;
  453|       |
  454|  4.95M|    if (c == '\n')
  ------------------
  |  Branch (454:9): [True: 8.49k, False: 4.94M]
  ------------------
  455|  8.49k|        --(in->curline);
  456|       |
  457|  4.95M|    RestoreLastPos( in );
  458|  4.95M|}
prvTidyBufferOutput:
  484|  42.6k|{
  485|  42.6k|    StreamOut* out = initStreamOut( doc, encoding, nl );
  486|  42.6k|    tidyInitOutputBuffer( &out->sink, buf );
  487|  42.6k|    out->iotype = BufferIO;
  488|  42.6k|    return out;
  489|  42.6k|}
prvTidyWriteChar:
  499|   394M|{
  500|       |    /* Translate outgoing newlines */
  501|   394M|    if ( LF == c )
  ------------------
  |  |  163|   394M|#define LF    0xA
  ------------------
  |  Branch (501:10): [True: 5.83M, False: 388M]
  ------------------
  502|  5.83M|    {
  503|  5.83M|      if ( out->nl == TidyCRLF )
  ------------------
  |  Branch (503:12): [True: 0, False: 5.83M]
  ------------------
  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.83M|      else if ( out->nl == TidyCR )
  ------------------
  |  Branch (505:17): [True: 0, False: 5.83M]
  ------------------
  506|      0|          c = CR;
  ------------------
  |  |  162|      0|#define CR    0xD
  ------------------
  507|  5.83M|    }
  508|       |
  509|   394M|    if (out->encoding == MACROMAN)
  ------------------
  |  |  139|   394M|#define MACROMAN    6
  ------------------
  |  Branch (509:9): [True: 0, False: 394M]
  ------------------
  510|      0|    {
  511|      0|        EncodeMacRoman( c, out );
  512|      0|    }
  513|   394M|    else if (out->encoding == WIN1252)
  ------------------
  |  |  140|   394M|#define WIN1252     7
  ------------------
  |  Branch (513:14): [True: 0, False: 394M]
  ------------------
  514|      0|    {
  515|      0|        EncodeWin1252( c, out );
  516|      0|    }
  517|   394M|    else if (out->encoding == IBM858)
  ------------------
  |  |  141|   394M|#define IBM858      8
  ------------------
  |  Branch (517:14): [True: 0, False: 394M]
  ------------------
  518|      0|    {
  519|      0|        EncodeIbm858( c, out );
  520|      0|    }
  521|   394M|    else if (out->encoding == LATIN0)
  ------------------
  |  |  135|   394M|#define LATIN0      2
  ------------------
  |  Branch (521:14): [True: 0, False: 394M]
  ------------------
  522|      0|    {
  523|      0|        EncodeLatin0( c, out );
  524|      0|    }
  525|       |
  526|   394M|    else if (out->encoding == UTF8)
  ------------------
  |  |  137|   394M|#define UTF8        4
  ------------------
  |  Branch (526:14): [True: 394M, False: 0]
  ------------------
  527|   394M|    {
  528|   394M|        int count = 0;
  529|       |        
  530|   394M|        TY_(EncodeCharToUTF8Bytes)( c, NULL, &out->sink, &count );
  ------------------
  |  |   23|   394M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   394M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  531|   394M|        if (count <= 0)
  ------------------
  |  Branch (531:13): [True: 49.8k, False: 394M]
  ------------------
  532|  49.8k|        {
  533|       |            /* replacement char 0xFFFD encoded as UTF-8 */
  534|  49.8k|            PutByte(0xEF, out); PutByte(0xBF, out); PutByte(0xBF, out);
  535|  49.8k|        }
  536|   394M|    }
  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|   394M|}
prvTidyDecodeWin1252:
  660|  1.98k|{
  661|  1.98k|    if (127 < c && c < 160)
  ------------------
  |  Branch (661:9): [True: 1.98k, False: 0]
  |  Branch (661:20): [True: 1.98k, False: 0]
  ------------------
  662|  1.98k|        c = Win2Unicode[c - 128];
  663|       |        
  664|  1.98k|    return c;
  665|  1.98k|}
tidyGetByte:
  879|  75.4M|{
  880|  75.4M|  int bv = source->getByte( source->sourceData );
  881|  75.4M|  return (uint) bv;
  882|  75.4M|}
tidyIsEOF:
  884|  76.9M|{
  885|  76.9M|  return source->eof( source->sourceData );
  886|  76.9M|}
tidyUngetByte:
  888|  63.3k|{
  889|  63.3k|    source->ungetByte( source->sourceData, (byte) ch );
  890|  63.3k|}
tidyPutByte:
  892|   149k|{
  893|   149k|    sink->putByte( sink->sinkData, (byte) ch );
  894|   149k|}
prvTidyIsEOF:
  901|  76.9M|{
  902|  76.9M|    return tidyIsEOF( &in->source );
  903|  76.9M|}
prvTidyGetEncodingNameFromTidyId:
 1110|  21.6k|{
 1111|  21.6k|    uint i;
 1112|       |
 1113|  87.5k|    for (i = 0; enc2iana[i].name; ++i)
  ------------------
  |  Branch (1113:17): [True: 87.5k, False: 0]
  ------------------
 1114|  87.5k|        if (enc2iana[i].id == id)
  ------------------
  |  Branch (1114:13): [True: 21.6k, False: 65.8k]
  ------------------
 1115|  21.6k|            return enc2iana[i].name;
 1116|       |
 1117|      0|    return NULL;
 1118|  21.6k|}
streamio.c:InitLastPos:
  208|  21.3k|{
  209|  21.3k|    in->curlastpos = 0;
  210|  21.3k|    in->firstlastpos = 0;
  211|  21.3k|}
streamio.c:SaveLastPos:
  221|   332M|{
  222|   332M|    PopLastPos( in );
  223|   332M|    in->lastcols[in->curlastpos] = in->curcol;
  224|   332M|}
streamio.c:PopLastPos:
  214|   337M|{
  215|   337M|    in->curlastpos = (in->curlastpos+1)%LASTPOS_SIZE;
  216|   337M|    if ( in->curlastpos == in->firstlastpos )
  ------------------
  |  Branch (216:10): [True: 331M, False: 5.50M]
  ------------------
  217|   331M|        in->firstlastpos = (in->firstlastpos+1)%LASTPOS_SIZE;
  218|   337M|}
streamio.c:PopChar:
  417|  4.95M|{
  418|  4.95M|    uint c = EndOfStream;
  ------------------
  |  | 1064|  4.95M|#define EndOfStream (~0u)
  ------------------
  419|  4.95M|    if ( in->pushed )
  ------------------
  |  Branch (419:10): [True: 4.95M, False: 0]
  ------------------
  420|  4.95M|    {
  421|  4.95M|        assert( in->bufpos > 0 );
  ------------------
  |  Branch (421:9): [True: 0, False: 4.95M]
  |  Branch (421:9): [True: 4.95M, False: 0]
  ------------------
  422|  4.95M|        c = in->charbuf[ --in->bufpos ];
  423|  4.95M|        if ( in->bufpos == 0 )
  ------------------
  |  Branch (423:14): [True: 3.10M, False: 1.85M]
  ------------------
  424|  3.10M|            in->pushed = no;
  425|       |
  426|  4.95M|        if ( c == '\n' )
  ------------------
  |  Branch (426:14): [True: 8.49k, False: 4.94M]
  ------------------
  427|  8.49k|        {
  428|  8.49k|            in->curcol = 1;
  429|  8.49k|            in->curline++;
  430|  8.49k|            PopLastPos( in );
  431|  8.49k|            return c;
  432|  8.49k|        }
  433|  4.94M|        in->curcol++;
  434|  4.94M|        PopLastPos( in );
  435|  4.94M|    }
  436|  4.94M|    return c;
  437|  4.95M|}
streamio.c:RestoreLastPos:
  227|  4.95M|{
  228|  4.95M|    if ( in->firstlastpos == in->curlastpos )
  ------------------
  |  Branch (228:10): [True: 305k, False: 4.64M]
  ------------------
  229|   305k|        in->curcol = 0;
  230|  4.64M|    else
  231|  4.64M|    {
  232|  4.64M|        in->curcol = in->lastcols[in->curlastpos];
  233|  4.64M|        if ( in->curlastpos == 0 )
  ------------------
  |  Branch (233:14): [True: 67.9k, False: 4.57M]
  ------------------
  234|  67.9k|            in->curlastpos = LASTPOS_SIZE;
  235|  4.64M|        in->curlastpos--;
  236|  4.64M|    }
  237|  4.95M|}
streamio.c:initStreamOut:
  467|  42.6k|{
  468|  42.6k|    StreamOut* out = (StreamOut*) TidyDocAlloc( doc, sizeof(StreamOut) );
  ------------------
  |  |  157|  42.6k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  42.6k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  469|  42.6k|    TidyClearMemory( out, sizeof(StreamOut) );
  ------------------
  |  |   70|  42.6k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  470|  42.6k|    out->encoding = encoding;
  471|  42.6k|    out->state = FSM_ASCII;
  472|  42.6k|    out->nl = nl;
  473|  42.6k|    return out;
  474|  42.6k|}
streamio.c:ReadByte:
  897|  75.4M|{
  898|  75.4M|    return tidyGetByte( &in->source );
  899|  75.4M|}
streamio.c:UngetByte:
  905|  63.3k|{
  906|  63.3k|    tidyUngetByte( &in->source, byteValue );
  907|  63.3k|}
streamio.c:PutByte:
  909|   149k|{
  910|   149k|    tidyPutByte( &out->sink, byteValue );
  911|   149k|}
streamio.c:ReadCharFromStream:
  915|  76.6M|{
  916|  76.6M|    uint c, n;
  917|       |
  918|  76.6M|    if ( TY_(IsEOF)(in) )
  ------------------
  |  |   23|  76.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  76.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (918:10): [True: 1.61M, False: 75.0M]
  ------------------
  919|  1.61M|        return EndOfStream;
  ------------------
  |  | 1064|  1.61M|#define EndOfStream (~0u)
  ------------------
  920|       |    
  921|  75.0M|    c = ReadByte( in );
  922|       |
  923|  75.0M|    if (c == EndOfStream)
  ------------------
  |  | 1064|  75.0M|#define EndOfStream (~0u)
  ------------------
  |  Branch (923:9): [True: 0, False: 75.0M]
  ------------------
  924|      0|        return c;
  925|       |
  926|  75.0M|#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|  75.0M|    if (in->encoding == ISO2022)
  ------------------
  |  |  138|  75.0M|#define ISO2022     5
  ------------------
  |  Branch (946:9): [True: 0, False: 75.0M]
  ------------------
  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|  75.0M|#endif /* NO_NATIVE_ISO2022_SUPPORT */
  991|       |
  992|  75.0M|    if ( in->encoding == UTF16LE )
  ------------------
  |  |  142|  75.0M|#define UTF16LE     9
  ------------------
  |  Branch (992:10): [True: 403k, False: 74.6M]
  ------------------
  993|   403k|    {
  994|   403k|        uint c1 = ReadByte( in );
  995|   403k|        if ( EndOfStream == c1 )
  ------------------
  |  | 1064|   403k|#define EndOfStream (~0u)
  ------------------
  |  Branch (995:14): [True: 0, False: 403k]
  ------------------
  996|      0|            return EndOfStream;
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
  997|   403k|        n = (c1 << 8) + c;
  998|   403k|        return n;
  999|   403k|    }
 1000|       |
 1001|  74.6M|    if ((in->encoding == UTF16) || (in->encoding == UTF16BE)) /* UTF-16 is big-endian by default */
  ------------------
  |  |  144|  74.6M|#define UTF16       11
  ------------------
                  if ((in->encoding == UTF16) || (in->encoding == UTF16BE)) /* UTF-16 is big-endian by default */
  ------------------
  |  |  143|  74.6M|#define UTF16BE     10
  ------------------
  |  Branch (1001:9): [True: 0, False: 74.6M]
  |  Branch (1001:36): [True: 4.55k, False: 74.6M]
  ------------------
 1002|  4.55k|    {
 1003|  4.55k|        uint c1 = ReadByte( in );
 1004|  4.55k|        if ( EndOfStream == c1 )
  ------------------
  |  | 1064|  4.55k|#define EndOfStream (~0u)
  ------------------
  |  Branch (1004:14): [True: 0, False: 4.55k]
  ------------------
 1005|      0|            return EndOfStream;
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
 1006|  4.55k|        n = (c << 8) + c1;
 1007|  4.55k|        return n;
 1008|  4.55k|    }
 1009|       |
 1010|  74.6M|    if ( in->encoding == UTF8 )
  ------------------
  |  |  137|  74.6M|#define UTF8        4
  ------------------
  |  Branch (1010:10): [True: 74.6M, False: 0]
  ------------------
 1011|  74.6M|    {
 1012|       |        /* deal with UTF-8 encoded char */
 1013|       |
 1014|  74.6M|        int err, count = 0;
 1015|       |        
 1016|       |        /* first byte "c" is passed in separately */
 1017|  74.6M|        err = TY_(DecodeUTF8BytesToChar)( &n, c, NULL, &in->source, &count );
  ------------------
  |  |   23|  74.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  74.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1018|  74.6M|        if (!err && (n == (uint)EndOfStream) && (count == 1)) /* EOF */
  ------------------
  |  | 1064|  73.0M|#define EndOfStream (~0u)
  ------------------
  |  Branch (1018:13): [True: 73.0M, False: 1.55M]
  |  Branch (1018:21): [True: 0, False: 73.0M]
  |  Branch (1018:49): [True: 0, False: 0]
  ------------------
 1019|      0|            return EndOfStream;
  ------------------
  |  | 1064|      0|#define EndOfStream (~0u)
  ------------------
 1020|  74.6M|        else if (err)
  ------------------
  |  Branch (1020:18): [True: 1.55M, False: 73.0M]
  ------------------
 1021|  1.55M|        {
 1022|       |            /* set error position just before offending character */
 1023|  1.55M|            in->doc->lexer->lines = in->curline;
 1024|  1.55M|            in->doc->lexer->columns = in->curcol;
 1025|       |
 1026|  1.55M|            TY_(ReportEncodingError)(in->doc, INVALID_UTF8, n, no);
  ------------------
  |  |   23|  1.55M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.55M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1027|  1.55M|            n = 0xFFFD; /* replacement char */
 1028|  1.55M|        }
 1029|       |        
 1030|  74.6M|        return n;
 1031|  74.6M|    }
 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.11M|{
  565|  1.11M|    const Dict *np = NULL;
  566|       |
  567|  1.11M|    if ( cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  1.11M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.11M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 1.11M]
  |  |  ------------------
  ------------------
  568|      0|    {
  569|      0|        node->tag = doc->tags.xml_tags;
  570|      0|        return yes;
  571|      0|    }
  572|       |
  573|  1.11M|    if ( node->element && (np = tagsLookup(doc, &doc->tags, node->element)) )
  ------------------
  |  Branch (573:10): [True: 1.11M, False: 0]
  |  Branch (573:27): [True: 983k, False: 135k]
  ------------------
  574|   983k|    {
  575|   983k|        node->tag = np;
  576|   983k|        return yes;
  577|   983k|    }
  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|   135k|    if ( TY_(nodeIsAutonomousCustomTag)( doc, node) )
  ------------------
  |  |   23|   135k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   135k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (581:10): [True: 0, False: 135k]
  ------------------
  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|   135k|    return no;
  596|   135k|}
prvTidyLookupTagDef:
  599|   527k|{
  600|   527k|    const Dict *np;
  601|       |
  602|  20.2M|    for (np = tag_defs + 1; np < tag_defs + N_TIDY_TAGS; ++np )
  ------------------
  |  Branch (602:29): [True: 20.2M, False: 0]
  ------------------
  603|  20.2M|        if (np->id == tid)
  ------------------
  |  Branch (603:13): [True: 527k, False: 19.7M]
  ------------------
  604|   527k|            return np;
  605|       |
  606|      0|    return NULL;
  607|   527k|}
prvTidyInitTags:
  697|  21.3k|{
  698|  21.3k|    Dict* xml;
  699|  21.3k|    TidyTagImpl* tags = &doc->tags;
  700|       |
  701|  21.3k|    TidyClearMemory( tags, sizeof(TidyTagImpl) );
  ------------------
  |  |   70|  21.3k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  702|       |
  703|       |    /* create dummy entry for all xml tags */
  704|  21.3k|    xml =  NewDict( doc, NULL );
  705|  21.3k|    xml->versions = VERS_XML;
  ------------------
  |  |  197|  21.3k|#define VERS_XML           65536u
  ------------------
  706|  21.3k|    xml->model = CM_BLOCK;
  ------------------
  |  |  142|  21.3k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  707|  21.3k|    xml->parser = 0;
  708|  21.3k|    xml->chkattrs = 0;
  709|       |    xml->attrvers = NULL;
  710|  21.3k|    tags->xml_tags = xml;
  711|  21.3k|}
prvTidyFreeDeclaredTags:
  717|  63.9k|{
  718|  63.9k|    TidyTagImpl* tags = &doc->tags;
  719|  63.9k|    Dict *curr, *next = NULL, *prev = NULL;
  720|       |
  721|  63.9k|    for ( curr=tags->declared_tag_list; curr; curr = next )
  ------------------
  |  Branch (721:41): [True: 0, False: 63.9k]
  ------------------
  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|  63.9k|}
prvTidyAdjustTags:
  773|  14.4k|{
  774|  14.4k|    Dict *np = (Dict *)TY_(LookupTagDef)( TidyTag_A );
  ------------------
  |  |   23|  14.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  775|  14.4k|    TidyTagImpl* tags = &doc->tags;
  776|  14.4k|    if (np) 
  ------------------
  |  Branch (776:9): [True: 14.4k, False: 0]
  ------------------
  777|  14.4k|    {
  778|  14.4k|        np->parser = TY_(ParseInline);
  ------------------
  |  |   23|  14.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  779|  14.4k|        np->model  = CM_INLINE;
  ------------------
  |  |  143|  14.4k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  780|  14.4k|    }
  781|       |
  782|       |/*\
  783|       | * Issue #196
  784|       | * TidyTag_CAPTION allows %flow; in HTML5,
  785|       | * but only %inline; in HTML4
  786|       |\*/
  787|  14.4k|    np = (Dict *)TY_(LookupTagDef)( TidyTag_CAPTION );
  ------------------
  |  |   23|  14.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  788|  14.4k|    if (np)
  ------------------
  |  Branch (788:9): [True: 14.4k, False: 0]
  ------------------
  789|  14.4k|    {
  790|  14.4k|        np->parser = TY_(ParseInline);
  ------------------
  |  |   23|  14.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  791|  14.4k|    }
  792|       |
  793|       |/*\
  794|       | * Issue #232
  795|       | * TidyTag_OBJECT not in head in HTML5,
  796|       | * but still allowed in HTML4
  797|       |\*/
  798|  14.4k|    np = (Dict *)TY_(LookupTagDef)( TidyTag_OBJECT );
  ------------------
  |  |   23|  14.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  799|  14.4k|    if (np)
  ------------------
  |  Branch (799:9): [True: 14.4k, False: 0]
  ------------------
  800|  14.4k|    {
  801|  14.4k|        np->model |= CM_HEAD; /* add back allowed in head */
  ------------------
  |  |  141|  14.4k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  802|  14.4k|    }
  803|       |
  804|       |/*\
  805|       | * Issue #461
  806|       | * TidyTag_BUTTON is a block in HTML4,
  807|       | * whereas it is inline in HTML5
  808|       |\*/
  809|  14.4k|    np = (Dict *)TY_(LookupTagDef)(TidyTag_BUTTON);
  ------------------
  |  |   23|  14.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  810|  14.4k|    if (np)
  ------------------
  |  Branch (810:9): [True: 14.4k, False: 0]
  ------------------
  811|  14.4k|    {
  812|  14.4k|        np->parser = TY_(ParseBlock);
  ------------------
  |  |   23|  14.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  813|  14.4k|    }
  814|       |
  815|  14.4k|    tagsEmptyHash(doc, tags); /* not sure this is really required, but to be sure */
  816|  14.4k|    doc->HTML5Mode = no;   /* set *NOT* HTML5 mode */
  817|       |
  818|  14.4k|}
prvTidyIsHTML5Mode:
  821|   130k|{
  822|   130k|    return doc->HTML5Mode;
  823|   130k|}
prvTidyResetTags:
  833|  21.3k|{
  834|  21.3k|    Dict *np = (Dict *)TY_(LookupTagDef)( TidyTag_A );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  835|  21.3k|    TidyTagImpl* tags = &doc->tags;
  836|  21.3k|    if (np) 
  ------------------
  |  Branch (836:9): [True: 21.3k, False: 0]
  ------------------
  837|  21.3k|    {
  838|  21.3k|        np->parser = TY_(ParseBlock);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  839|  21.3k|        np->model  = (CM_INLINE|CM_BLOCK|CM_MIXED);
  ------------------
  |  |  143|  21.3k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                      np->model  = (CM_INLINE|CM_BLOCK|CM_MIXED);
  ------------------
  |  |  142|  21.3k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                      np->model  = (CM_INLINE|CM_BLOCK|CM_MIXED);
  ------------------
  |  |  156|  21.3k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  840|  21.3k|    }
  841|  21.3k|    np = (Dict *)TY_(LookupTagDef)( TidyTag_CAPTION );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  842|  21.3k|    if (np)
  ------------------
  |  Branch (842:9): [True: 21.3k, False: 0]
  ------------------
  843|  21.3k|    {
  844|  21.3k|        np->parser = TY_(ParseBlock);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  845|  21.3k|    }
  846|       |
  847|  21.3k|    np = (Dict *)TY_(LookupTagDef)( TidyTag_OBJECT );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  848|  21.3k|    if (np)
  ------------------
  |  Branch (848:9): [True: 21.3k, False: 0]
  ------------------
  849|  21.3k|    {
  850|  21.3k|        np->model = (CM_OBJECT|CM_IMG|CM_INLINE|CM_PARAM); /* reset */
  ------------------
  |  |  150|  21.3k|#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|  21.3k|#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|  21.3k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                      np->model = (CM_OBJECT|CM_IMG|CM_INLINE|CM_PARAM); /* reset */
  ------------------
  |  |  151|  21.3k|#define CM_PARAM        (1 << 12)  /**< Elements that allows "PARAM". */
  ------------------
  851|  21.3k|    }
  852|       |    /*\
  853|       |     * Issue #461
  854|       |     * TidyTag_BUTTON reset to inline in HTML5
  855|       |    \*/
  856|  21.3k|    np = (Dict *)TY_(LookupTagDef)(TidyTag_BUTTON);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  857|  21.3k|    if (np)
  ------------------
  |  Branch (857:9): [True: 21.3k, False: 0]
  ------------------
  858|  21.3k|    {
  859|  21.3k|        np->parser = TY_(ParseInline);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  860|  21.3k|    }
  861|       |
  862|  21.3k|    tagsEmptyHash( doc, tags ); /* not sure this is really required, but to be sure */
  863|  21.3k|    doc->HTML5Mode = yes;   /* set HTML5 mode */
  864|  21.3k|}
prvTidyFreeTags:
  867|  21.3k|{
  868|  21.3k|    TidyTagImpl* tags = &doc->tags;
  869|       |
  870|  21.3k|    tagsEmptyHash( doc, tags );
  871|  21.3k|    TY_(FreeDeclaredTags)( doc, tagtype_null );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  872|  21.3k|    FreeDict( doc, tags->xml_tags );
  873|       |
  874|       |    /* get rid of dangling tag references */
  875|  21.3k|    TidyClearMemory( tags, sizeof(TidyTagImpl) );
  ------------------
  |  |   70|  21.3k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  876|       |
  877|  21.3k|}
prvTidyCheckAttributes:
  882|  2.80M|{
  883|  2.80M|    AttVal *next, *attval = node->attributes;
  884|  3.27M|    while (attval)
  ------------------
  |  Branch (884:12): [True: 468k, False: 2.80M]
  ------------------
  885|   468k|    {
  886|   468k|        next = attval->next;
  887|   468k|        TY_(CheckAttribute)( doc, node, attval );
  ------------------
  |  |   23|   468k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   468k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  888|   468k|        attval = next;
  889|   468k|    }
  890|  2.80M|}
prvTidynodeIsText:
 1031|  22.2M|{
 1032|  22.2M|  return ( node && node->type == TextNode );
  ------------------
  |  Branch (1032:12): [True: 21.8M, False: 449k]
  |  Branch (1032:20): [True: 4.11M, False: 17.7M]
  ------------------
 1033|  22.2M|}
prvTidynodeIsElement:
 1052|  35.4M|{
 1053|  35.4M|  return ( node &&
  ------------------
  |  Branch (1053:12): [True: 35.4M, False: 0]
  ------------------
 1054|  35.4M|           (node->type == StartTag || node->type == StartEndTag) );
  ------------------
  |  Branch (1054:13): [True: 31.6M, False: 3.80M]
  |  Branch (1054:39): [True: 349k, False: 3.45M]
  ------------------
 1055|  35.4M|}
prvTidyelementIsAutonomousCustomFormat:
 1058|   170k|{
 1059|   170k|    if ( element )
  ------------------
  |  Branch (1059:10): [True: 170k, False: 0]
  ------------------
 1060|   170k|    {
 1061|   170k|        const char *ptr = strchr(element, '-');
 1062|       |
 1063|       |        /* Tag must contain hyphen not in first character. */
 1064|   170k|        if ( ptr && (ptr - element > 0) )
  ------------------
  |  Branch (1064:14): [True: 66.6k, False: 103k]
  |  Branch (1064:21): [True: 66.3k, False: 372]
  ------------------
 1065|  66.3k|        {
 1066|  66.3k|            return yes;
 1067|  66.3k|        }
 1068|   170k|    }
 1069|       |
 1070|   104k|    return no;
 1071|   170k|}
prvTidynodeIsAutonomousCustomFormat:
 1074|   136k|{
 1075|   136k|    if ( node->element )
  ------------------
  |  Branch (1075:10): [True: 136k, False: 10]
  ------------------
 1076|   136k|        return TY_(elementIsAutonomousCustomFormat)( node->element );
  ------------------
  |  |   23|   136k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   136k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1077|       |
 1078|     10|    return no;
 1079|   136k|}
prvTidynodeIsAutonomousCustomTag:
 1082|   135k|{
 1083|   135k|    return TY_(nodeIsAutonomousCustomFormat)( node )
  ------------------
  |  |   23|   135k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   135k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1083:12): [True: 33.3k, False: 101k]
  ------------------
 1084|  33.3k|            && ( cfg( doc, TidyUseCustomTags ) != TidyCustomNo );
  ------------------
  |  |  415|  33.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1084:16): [True: 0, False: 33.3k]
  ------------------
 1085|   135k|}
prvTidynodeHasCM:
 1092|  1.77G|{
 1093|  1.77G|  return ( node && node->tag &&
  ------------------
  |  Branch (1093:12): [True: 1.77G, False: 0]
  |  Branch (1093:20): [True: 1.77G, False: 221k]
  ------------------
 1094|  1.77G|           (node->tag->model & contentModel) != 0 );
  ------------------
  |  Branch (1094:12): [True: 1.75G, False: 16.8M]
  ------------------
 1095|  1.77G|}
prvTidynodeCMIsInline:
 1102|  1.75G|{
 1103|  1.75G|  return TY_(nodeHasCM)( node, CM_INLINE );
  ------------------
  |  |   23|  1.75G|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.75G|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                return TY_(nodeHasCM)( node, CM_INLINE );
  ------------------
  |  |  143|  1.75G|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
 1104|  1.75G|}
prvTidynodeCMIsEmpty:
 1106|  9.54M|{
 1107|  9.54M|  return TY_(nodeHasCM)( node, CM_EMPTY );
  ------------------
  |  |   23|  9.54M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.54M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                return TY_(nodeHasCM)( node, CM_EMPTY );
  ------------------
  |  |  139|  9.54M|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
 1108|  9.54M|}
prvTidyTraverseNodeTree:
 1149|  4.22k|{
 1150|   330k|    while (node)
  ------------------
  |  Branch (1150:12): [True: 329k, False: 1.40k]
  ------------------
 1151|   329k|    {
 1152|   329k|        NodeTraversalSignal s = (*cb)(doc, node, propagate);
 1153|       |
 1154|   329k|        if (node->content && (s == ContinueTraversal || s == SkipSiblings))
  ------------------
  |  Branch (1154:13): [True: 326k, False: 2.16k]
  |  Branch (1154:31): [True: 0, False: 326k]
  |  Branch (1154:57): [True: 0, False: 326k]
  ------------------
 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|   329k|        switch (s)
 1160|   329k|        {
 1161|  2.82k|        case ExitTraversal:
  ------------------
  |  Branch (1161:9): [True: 2.82k, False: 326k]
  ------------------
 1162|  2.82k|            return ExitTraversal;
 1163|       |
 1164|   326k|        case VisitParent:
  ------------------
  |  Branch (1164:9): [True: 326k, False: 2.82k]
  ------------------
 1165|   326k|            node = node->parent;
 1166|   326k|            continue;
 1167|       |
 1168|      0|        case SkipSiblings:
  ------------------
  |  Branch (1168:9): [True: 0, False: 329k]
  ------------------
 1169|      0|        case SkipChildrenAndSiblings:
  ------------------
  |  Branch (1169:9): [True: 0, False: 329k]
  ------------------
 1170|      0|            return ContinueTraversal;
 1171|       |
 1172|      0|        default:
  ------------------
  |  Branch (1172:9): [True: 0, False: 329k]
  ------------------
 1173|      0|            node = node->next;
 1174|      0|            break;
 1175|   329k|        }
 1176|   329k|    }
 1177|  1.40k|    return ContinueTraversal;
 1178|  4.22k|}
tags.c:tagsLookup:
  408|  1.11M|{
  409|  1.11M|    const Dict *np;
  410|  1.11M|    const DictHash* p;
  411|       |
  412|  1.11M|    if (!s)
  ------------------
  |  Branch (412:9): [True: 0, False: 1.11M]
  ------------------
  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.11M|    for (p = tags->hashtab[tagsHash(s)]; p && p->tag; p = p->next)
  ------------------
  |  Branch (420:42): [True: 951k, False: 168k]
  |  Branch (420:47): [True: 951k, False: 0]
  ------------------
  421|   951k|        if (TY_(tmbstrcmp)(s, p->tag->name) == 0)
  ------------------
  |  |   23|   951k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   951k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (421:13): [True: 950k, False: 1.37k]
  ------------------
  422|   950k|            return p->tag;
  423|       |
  424|  22.4M|    for (np = tag_defs + 1; np < tag_defs + N_TIDY_TAGS; ++np)
  ------------------
  |  Branch (424:29): [True: 22.3M, False: 135k]
  ------------------
  425|  22.3M|        if (TY_(tmbstrcmp)(s, np->name) == 0)
  ------------------
  |  |   23|  22.3M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.3M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (425:13): [True: 32.9k, False: 22.3M]
  ------------------
  426|  32.9k|            return tagsInstall(doc, tags, np);
  427|       |
  428|   135k|    for (np = tags->declared_tag_list; np; np = np->next)
  ------------------
  |  Branch (428:40): [True: 0, False: 135k]
  ------------------
  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|   135k|    return NULL;
  433|   135k|}
tags.c:tagsHash:
  339|  1.15M|{
  340|  1.15M|    uint hashval;
  341|       |
  342|  8.35M|    for (hashval = 0; *s != '\0'; s++)
  ------------------
  |  Branch (342:23): [True: 7.20M, False: 1.15M]
  ------------------
  343|  7.20M|        hashval = *s + 31*hashval;
  344|       |
  345|  1.15M|    return hashval % ELEMENT_HASH_SIZE;
  346|  1.15M|}
tags.c:tagsInstall:
  349|  32.9k|{
  350|  32.9k|    DictHash *np;
  351|  32.9k|    uint hashval;
  352|       |
  353|  32.9k|    if (old)
  ------------------
  |  Branch (353:9): [True: 32.9k, False: 0]
  ------------------
  354|  32.9k|    {
  355|  32.9k|        np = (DictHash *)TidyDocAlloc(doc, sizeof(*np));
  ------------------
  |  |  157|  32.9k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  32.9k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  356|  32.9k|        np->tag = old;
  357|       |
  358|  32.9k|        hashval = tagsHash(old->name);
  359|  32.9k|        np->next = tags->hashtab[hashval];
  360|  32.9k|        tags->hashtab[hashval] = np;
  361|  32.9k|    }
  362|       |
  363|  32.9k|    return old;
  364|  32.9k|}
tags.c:CheckAREA:
  957|  1.47k|{
  958|  1.47k|    Bool HasAlt = TY_(AttrGetById)(node, TidyAttr_ALT) != NULL;
  ------------------
  |  |   23|  1.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  959|  1.47k|    Bool HasHref = TY_(AttrGetById)(node, TidyAttr_HREF) != NULL;
  ------------------
  |  |   23|  1.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  960|  1.47k|    Bool HasNohref = TY_(AttrGetById)(node, TidyAttr_NOHREF) != NULL;
  ------------------
  |  |   23|  1.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  961|       |
  962|  1.47k|    TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  1.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  963|       |
  964|  1.47k|    if ( !HasAlt )
  ------------------
  |  Branch (964:10): [True: 1.27k, False: 194]
  ------------------
  965|  1.27k|    {
  966|  1.27k|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  1.27k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (966:14): [True: 1.27k, False: 0]
  ------------------
  967|  1.27k|        {
  968|  1.27k|            doc->badAccess |= BA_MISSING_LINK_ALT;
  ------------------
  |  |  281|  1.27k|#define BA_MISSING_LINK_ALT        2
  ------------------
  969|  1.27k|            TY_(ReportMissingAttr)( doc, node, "alt" );
  ------------------
  |  |   23|  1.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  970|  1.27k|        }
  971|  1.27k|    }
  972|       |
  973|  1.47k|    if ( !HasHref && !HasNohref )
  ------------------
  |  Branch (973:10): [True: 1.27k, False: 199]
  |  Branch (973:22): [True: 1.07k, False: 196]
  ------------------
  974|  1.07k|        TY_(ReportMissingAttr)( doc, node, "href" );
  ------------------
  |  |   23|  1.07k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.07k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  975|  1.47k|}
tags.c:CheckCaption:
  933|  9.16k|{
  934|  9.16k|    AttVal *attval;
  935|       |
  936|  9.16k|    TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  9.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  937|       |
  938|  9.16k|    attval = TY_(AttrGetById)(node, TidyAttr_ALIGN);
  ------------------
  |  |   23|  9.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  939|       |
  940|  9.16k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  9.16k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 3.47k, False: 5.69k]
  |  |  |  Branch (171:44): [True: 3.27k, False: 196]
  |  |  ------------------
  ------------------
  941|  5.88k|        return;
  942|       |
  943|  3.27k|    if (AttrValueIs(attval, "left") || AttrValueIs(attval, "right"))
  ------------------
  |  |  172|  6.55k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  6.55k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 3.27k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 3.27k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  6.55k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  3.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  3.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 194, False: 3.08k]
  |  |  ------------------
  ------------------
                  if (AttrValueIs(attval, "left") || AttrValueIs(attval, "right"))
  ------------------
  |  |  172|  3.08k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  6.16k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 3.08k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 3.08k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  3.08k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  3.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  3.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 1.64k, False: 1.44k]
  |  |  ------------------
  ------------------
  944|  1.83k|        TY_(ConstrainVersion)(doc, VERS_HTML40_LOOSE);
  ------------------
  |  |   23|  1.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(ConstrainVersion)(doc, VERS_HTML40_LOOSE);
  ------------------
  |  |  208|  1.83k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  ------------------
  |  |  |  |  180|  1.83k|#define H40T                   8u
  |  |  ------------------
  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  ------------------
  |  |  |  |  183|  1.83k|#define H41T                  64u
  |  |  ------------------
  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  ------------------
  |  |  |  |  186|  1.83k|#define X10T                 512u
  |  |  ------------------
  ------------------
  945|  1.44k|    else if (AttrValueIs(attval, "top") || AttrValueIs(attval, "bottom"))
  ------------------
  |  |  172|  2.88k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  2.88k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 1.44k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 1.44k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  2.88k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  1.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 239, False: 1.20k]
  |  |  ------------------
  ------------------
                  else if (AttrValueIs(attval, "top") || AttrValueIs(attval, "bottom"))
  ------------------
  |  |  172|  1.20k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  2.40k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 1.20k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 1.20k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  1.20k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  1.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.20k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 194, False: 1.00k]
  |  |  ------------------
  ------------------
  946|    433|        TY_(ConstrainVersion)(doc, ~(VERS_HTML20|VERS_HTML32));
  ------------------
  |  |   23|    433|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    433|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(ConstrainVersion)(doc, ~(VERS_HTML20|VERS_HTML32));
  ------------------
  |  |  205|    433|#define VERS_HTML20        (HT20)
  |  |  ------------------
  |  |  |  |  177|    433|#define HT20                   1u
  |  |  ------------------
  ------------------
                      TY_(ConstrainVersion)(doc, ~(VERS_HTML20|VERS_HTML32));
  ------------------
  |  |  206|    433|#define VERS_HTML32        (HT32)
  |  |  ------------------
  |  |  |  |  178|    433|#define HT32                   2u
  |  |  ------------------
  ------------------
  947|  1.00k|    else
  948|  1.00k|        TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  949|  3.27k|}
tags.c:CheckHTML:
  952|  61.4k|{
  953|  61.4k|    TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  61.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  61.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  954|  61.4k|}
tags.c:CheckIMG:
  895|  2.37k|{
  896|  2.37k|    Bool HasAlt = TY_(AttrGetById)(node, TidyAttr_ALT) != NULL;
  ------------------
  |  |   23|  2.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  897|  2.37k|    Bool HasSrc = TY_(AttrGetById)(node, TidyAttr_SRC) != NULL;
  ------------------
  |  |   23|  2.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  898|  2.37k|    Bool HasUseMap = TY_(AttrGetById)(node, TidyAttr_USEMAP) != NULL;
  ------------------
  |  |   23|  2.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  899|  2.37k|    Bool HasIsMap = TY_(AttrGetById)(node, TidyAttr_ISMAP) != NULL;
  ------------------
  |  |   23|  2.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  900|  2.37k|    Bool HasDataFld = TY_(AttrGetById)(node, TidyAttr_DATAFLD) != NULL;
  ------------------
  |  |   23|  2.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  901|       |
  902|  2.37k|    TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  2.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  903|       |
  904|  2.37k|    if ( !HasAlt )
  ------------------
  |  Branch (904:10): [True: 2.16k, False: 209]
  ------------------
  905|  2.16k|    {
  906|  2.16k|        ctmbstr alttext = cfgStr(doc, TidyAltText);
  ------------------
  |  |  424|  2.16k|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  ------------------
  907|  2.16k|        if ( ( cfg(doc, TidyAccessibilityCheckLevel) == 0 ) && ( !alttext ) )
  ------------------
  |  |  415|  2.16k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (907:14): [True: 2.16k, False: 0]
  |  Branch (907:64): [True: 2.16k, False: 0]
  ------------------
  908|  2.16k|        {
  909|  2.16k|            doc->badAccess |= BA_MISSING_IMAGE_ALT;
  ------------------
  |  |  280|  2.16k|#define BA_MISSING_IMAGE_ALT       1
  ------------------
  910|  2.16k|            TY_(ReportMissingAttr)( doc, node, "alt" );
  ------------------
  |  |   23|  2.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  911|  2.16k|        }
  912|       |
  913|  2.16k|        if ( alttext ) {
  ------------------
  |  Branch (913:14): [True: 0, False: 2.16k]
  ------------------
  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.16k|    }
  918|       |
  919|  2.37k|    if ( !HasSrc && !HasDataFld )
  ------------------
  |  Branch (919:10): [True: 2.12k, False: 249]
  |  Branch (919:21): [True: 2.12k, False: 0]
  ------------------
  920|  2.12k|        TY_(ReportMissingAttr)( doc, node, "src" );
  ------------------
  |  |   23|  2.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  921|       |
  922|  2.37k|    if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  2.37k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (922:10): [True: 2.37k, False: 0]
  ------------------
  923|  2.37k|    {
  924|  2.37k|        if ( HasIsMap && !HasUseMap )
  ------------------
  |  Branch (924:14): [True: 392, False: 1.98k]
  |  Branch (924:26): [True: 198, False: 194]
  ------------------
  925|    198|        {
  926|    198|            TY_(ReportAttrError)( doc, node, NULL, MISSING_IMAGEMAP);
  ------------------
  |  |   23|    198|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    198|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  927|    198|            doc->badAccess |= BA_MISSING_IMAGE_MAP;
  ------------------
  |  |  283|    198|#define BA_MISSING_IMAGE_MAP       8
  ------------------
  928|    198|        }
  929|  2.37k|    }
  930|  2.37k|}
tags.c:CheckLINK:
 1014|    947|{
 1015|    947|    Bool HasHref = TY_(AttrGetById)(node, TidyAttr_HREF) != NULL;
  ------------------
  |  |   23|    947|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    947|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1016|    947|    Bool HasRel = TY_(AttrGetById)(node, TidyAttr_REL) != NULL;
  ------------------
  |  |   23|    947|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    947|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1017|    947|    Bool HasItemprop = TY_(AttrGetById)(node, TidyAttr_ITEMPROP) != NULL;
  ------------------
  |  |   23|    947|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    947|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1018|       |
 1019|    947|    if (!HasHref)
  ------------------
  |  Branch (1019:9): [True: 752, False: 195]
  ------------------
 1020|    752|    {
 1021|    752|      TY_(ReportMissingAttr)( doc, node, "href" );
  ------------------
  |  |   23|    752|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    752|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1022|    752|    }
 1023|       |
 1024|    947|    if (!HasItemprop && !HasRel)
  ------------------
  |  Branch (1024:9): [True: 643, False: 304]
  |  Branch (1024:25): [True: 436, False: 207]
  ------------------
 1025|    436|    {
 1026|    436|      TY_(ReportMissingAttr)( doc, node, "rel" );
  ------------------
  |  |   23|    436|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    436|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1027|    436|    }
 1028|    947|}
tags.c:CheckTABLE:
  978|  17.5k|{
  979|  17.5k|    AttVal* attval;
  980|  17.5k|    Bool HasSummary = (TY_(AttrGetById)(node, TidyAttr_SUMMARY) != NULL) ? yes : no;
  ------------------
  |  |   23|  17.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (980:23): [True: 508, False: 17.0k]
  ------------------
  981|  17.5k|    uint vers = TY_(HTMLVersion)(doc);  /* Issue #377 - Also applies to XHTML5 */
  ------------------
  |  |   23|  17.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  982|  17.5k|    Bool isHTML5 = ((vers == HT50)||(vers == XH50)) ? yes : no;
  ------------------
  |  |  200|  17.5k|#define HT50              131072u
  ------------------
                  Bool isHTML5 = ((vers == HT50)||(vers == XH50)) ? yes : no;
  ------------------
  |  |  201|  17.5k|#define XH50              262144u
  ------------------
  |  Branch (982:21): [True: 0, False: 17.5k]
  |  Branch (982:37): [True: 16.9k, False: 578]
  ------------------
  983|       |
  984|  17.5k|    TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  17.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.5k|#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|  17.5k|    if (cfg(doc, TidyAccessibilityCheckLevel) == 0)
  ------------------
  |  |  415|  17.5k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (989:9): [True: 17.5k, False: 0]
  ------------------
  990|  17.5k|    {
  991|  17.5k|        if (HasSummary && isHTML5)
  ------------------
  |  Branch (991:13): [True: 508, False: 17.0k]
  |  Branch (991:27): [True: 194, False: 314]
  ------------------
  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|  17.3k|        else if (!HasSummary && !isHTML5) 
  ------------------
  |  Branch (996:18): [True: 17.0k, False: 314]
  |  Branch (996:33): [True: 264, False: 16.7k]
  ------------------
  997|    264|        {
  998|       |            /* #210 - No summary, and NOT HTML5, then report as before */
  999|    264|            doc->badAccess |= BA_MISSING_SUMMARY;
  ------------------
  |  |  282|    264|#define BA_MISSING_SUMMARY         4
  ------------------
 1000|    264|            TY_(ReportMissingAttr)( doc, node, "summary");
  ------------------
  |  |   23|    264|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    264|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1001|    264|        }
 1002|  17.5k|    }
 1003|       |
 1004|       |    /* convert <table border> to <table border="1"> */
 1005|  17.5k|    if ( cfgBool(doc, TidyXmlOut) && (attval = TY_(AttrGetById)(node, TidyAttr_BORDER)) )
  ------------------
  |  |  418|  35.0k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  17.5k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 17.5k, False: 0]
  |  |  ------------------
  ------------------
                  if ( cfgBool(doc, TidyXmlOut) && (attval = TY_(AttrGetById)(node, TidyAttr_BORDER)) )
  ------------------
  |  |   23|  17.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1005:38): [True: 463, False: 17.0k]
  ------------------
 1006|    463|    {
 1007|    463|        if (attval->value == NULL)
  ------------------
  |  Branch (1007:13): [True: 195, False: 268]
  ------------------
 1008|    195|            attval->value = TY_(tmbstrdup)(doc->allocator, "1");
  ------------------
  |  |   23|    195|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    195|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1009|    463|    }
 1010|  17.5k|}
tags.c:NewDict:
  436|  21.3k|{
  437|  21.3k|    Dict *np = (Dict*) TidyDocAlloc( doc, sizeof(Dict) );
  ------------------
  |  |  157|  21.3k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  21.3k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  438|  21.3k|    np->id = TidyTag_UNKNOWN;
  439|  21.3k|    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: 21.3k]
  ------------------
  440|  21.3k|    np->versions = VERS_UNKNOWN;
  ------------------
  |  |  204|  21.3k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  21.3k|#define xxxx                   0u
  |  |  ------------------
  ------------------
  441|  21.3k|    np->attrvers = NULL;
  442|  21.3k|    np->model = CM_UNKNOWN;
  ------------------
  |  |  138|  21.3k|#define CM_UNKNOWN      0
  ------------------
  443|  21.3k|    np->parser = 0;
  444|  21.3k|    np->chkattrs = 0;
  445|       |    np->next = NULL;
  446|  21.3k|    return np;
  447|  21.3k|}
tags.c:FreeDict:
  450|  21.3k|{
  451|  21.3k|    if ( d )
  ------------------
  |  Branch (451:10): [True: 21.3k, False: 0]
  ------------------
  452|  21.3k|        TidyDocFree( doc, d->name );
  ------------------
  |  |  159|  21.3k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  453|  21.3k|    TidyDocFree( doc, d );
  ------------------
  |  |  159|  21.3k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  454|  21.3k|}
tags.c:tagsEmptyHash:
  387|  57.0k|{
  388|  57.0k|    uint i;
  389|  57.0k|    DictHash *prev, *next;
  390|       |
  391|  10.2M|    for (i = 0; i < ELEMENT_HASH_SIZE; ++i)
  ------------------
  |  Branch (391:17): [True: 10.1M, False: 57.0k]
  ------------------
  392|  10.1M|    {
  393|  10.1M|        prev = NULL;
  394|  10.1M|        next = tags->hashtab[i];
  395|       |
  396|  10.1M|        while(next)
  ------------------
  |  Branch (396:15): [True: 32.9k, False: 10.1M]
  ------------------
  397|  32.9k|        {
  398|  32.9k|            prev = next->next;
  399|  32.9k|            TidyDocFree(doc, next);
  ------------------
  |  |  159|  32.9k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  32.9k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  400|  32.9k|            next = prev;
  401|  32.9k|        }
  402|       |
  403|       |        tags->hashtab[i] = NULL;
  404|  10.1M|    }
  405|  57.0k|}

tidyCreate:
   87|  21.3k|{
   88|  21.3k|  TidyDocImpl* impl = tidyDocCreate( &TY_(g_default_allocator) );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   89|  21.3k|  return tidyImplToDoc( impl );
  ------------------
  |  |  141|  21.3k|#define tidyImplToDoc( doc )            ((TidyDoc)(doc))
  ------------------
   90|  21.3k|}
tidyRelease:
   99|  21.3k|{
  100|  21.3k|  TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  21.3k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  101|  21.3k|  tidyDocRelease( impl );
  102|  21.3k|}
tidyLibraryVersion:
  204|  21.3k|{
  205|  21.3k|    return TY_(tidyLibraryVersion)();
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  206|  21.3k|}
tidyOptSetBool:
  530|  42.6k|{
  531|  42.6k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  42.6k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  532|  42.6k|    if ( impl )
  ------------------
  |  Branch (532:10): [True: 42.6k, False: 0]
  ------------------
  533|  42.6k|        return TY_(SetOptionBool)( impl, optId, val );
  ------------------
  |  |   23|  42.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  534|      0|    return no;
  535|  42.6k|}
tidySetErrorBuffer:
  974|  21.3k|{
  975|  21.3k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  21.3k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  976|  21.3k|    if ( impl )
  ------------------
  |  Branch (976:10): [True: 21.3k, False: 0]
  ------------------
  977|  21.3k|    {
  978|  21.3k|        uint outenc = cfg( impl, TidyOutCharEncoding );
  ------------------
  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  979|  21.3k|        uint nl = cfg( impl, TidyNewline );
  ------------------
  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  980|  21.3k|        TY_(ReleaseStreamOut)( impl, impl->errout );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  981|  21.3k|        impl->errout = TY_(BufferOutput)( impl, errbuf, outenc, nl );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  982|  21.3k|        return ( impl->errout ? 0 : -ENOMEM );
  ------------------
  |  Branch (982:18): [True: 21.3k, False: 0]
  ------------------
  983|  21.3k|    }
  984|      0|    return -EINVAL;
  985|  21.3k|}
tidyParseFile:
 1105|  21.3k|{
 1106|  21.3k|    TidyDocImpl* doc = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  21.3k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1107|  21.3k|    return tidyDocParseFile( doc, filnam );
 1108|  21.3k|}
tidySaveBuffer:
 1255|  21.3k|{
 1256|  21.3k|    TidyDocImpl* doc = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  21.3k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1257|  21.3k|    return tidyDocSaveBuffer( doc, outbuf );
 1258|  21.3k|}
tidyCleanAndRepair:
 1419|  21.3k|{
 1420|  21.3k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  21.3k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1421|  21.3k|    if ( impl )
  ------------------
  |  Branch (1421:10): [True: 21.3k, False: 0]
  ------------------
 1422|  21.3k|      return tidyDocCleanAndRepair( impl );
 1423|      0|    return -EINVAL;
 1424|  21.3k|}
tidyRunDiagnostics:
 1427|  21.3k|{
 1428|  21.3k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  21.3k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1429|  21.3k|    if ( impl )
  ------------------
  |  Branch (1429:10): [True: 21.3k, False: 0]
  ------------------
 1430|  21.3k|      return tidyDocRunDiagnostics( impl );
 1431|      0|    return -EINVAL;
 1432|  21.3k|}
prvTidyDocParseStream:
 1456|  21.3k|{
 1457|  21.3k|    Bool xmlIn = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1458|  21.3k|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 1459|       |    
 1460|  21.3k|    int bomEnc;
 1461|  21.3k|    doc->pConfigChangeCallback = NULL;
 1462|       |
 1463|  21.3k|    assert( doc != NULL && in != NULL );
  ------------------
  |  Branch (1463:5): [True: 0, False: 21.3k]
  |  Branch (1463:5): [True: 0, False: 0]
  |  Branch (1463:5): [True: 21.3k, False: 0]
  |  Branch (1463:5): [True: 21.3k, False: 0]
  ------------------
 1464|  21.3k|    assert( doc->docIn == NULL );
  ------------------
  |  Branch (1464:5): [True: 0, False: 21.3k]
  |  Branch (1464:5): [True: 21.3k, False: 0]
  ------------------
 1465|  21.3k|    doc->docIn = in;
 1466|       |
 1467|  21.3k|    TY_(ResetTags)(doc);             /* Reset table to html5 mode */
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1468|  21.3k|    TY_(TakeConfigSnapshot)( doc );  /* Save config state */
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1469|  21.3k|    TY_(AdjustConfig)( doc );        /* Ensure config internal consistency */
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1470|  21.3k|    TY_(FreeAnchors)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1471|       |
 1472|  21.3k|    TY_(FreeNode)(doc, &doc->root);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1473|  21.3k|    TidyClearMemory(&doc->root, sizeof(Node));
  ------------------
  |  |   70|  21.3k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1474|       |
 1475|  21.3k|    if (doc->givenDoctype)
  ------------------
  |  Branch (1475:9): [True: 0, False: 21.3k]
  ------------------
 1476|  21.3k|        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|  21.3k|    TY_(FreeLexer)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1482|  21.3k|    doc->givenDoctype = NULL;
 1483|       |
 1484|  21.3k|    doc->lexer = TY_(NewLexer)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1485|       |    /* doc->lexer->root = &doc->root; */
 1486|  21.3k|    doc->root.line = doc->lexer->lines;
 1487|  21.3k|    doc->root.column = doc->lexer->columns;
 1488|  21.3k|    doc->inputHadBOM = no;
 1489|  21.3k|    doc->xmlDetected = no;
 1490|       |
 1491|  21.3k|    bomEnc = TY_(ReadBOMEncoding)(in);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1492|       |
 1493|  21.3k|    if (bomEnc != -1)
  ------------------
  |  Branch (1493:9): [True: 183, False: 21.1k]
  ------------------
 1494|    183|    {
 1495|    183|        in->encoding = bomEnc;
 1496|    183|        TY_(SetOptionInt)(doc, TidyInCharEncoding, bomEnc);
  ------------------
  |  |   23|    183|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    183|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1497|    183|    }
 1498|       |
 1499|       |    /* Tidy doesn't alter the doctype for generic XML docs */
 1500|  21.3k|    if ( xmlIn )
  ------------------
  |  Branch (1500:10): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    else
 1507|  21.3k|    {
 1508|  21.3k|        doc->warnings = 0;
 1509|  21.3k|        TY_(ParseDocument)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1510|  21.3k|        if ( !TY_(CheckNodeIntegrity)( &doc->root ) )
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1510:14): [True: 0, False: 21.3k]
  ------------------
 1511|      0|            TidyPanic( doc->allocator, integrity );
  ------------------
  |  |   69|      0|#define TidyPanic(allocator, msg) ((allocator)->vtbl->panic((allocator), (msg)))
  ------------------
 1512|  21.3k|    }
 1513|       |
 1514|  21.3k|    doc->docIn = NULL;
 1515|  21.3k|    doc->pConfigChangeCallback = callback;
 1516|       |
 1517|  21.3k|    return tidyDocStatus( doc );
 1518|  21.3k|}
tidyLocalizedStringN:
 2686|  19.5M|{
 2687|  19.5M|    return TY_(tidyLocalizedStringN)( messageType, quantity);
  ------------------
  |  |   23|  19.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2688|  19.5M|}
tidyLocalizedString:
 2691|  50.4M|{
 2692|  50.4M|    return TY_(tidyLocalizedString)( messageType );
  ------------------
  |  |   23|  50.4M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  50.4M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2693|  50.4M|}
tidyDefaultStringN:
 2696|  19.5M|{
 2697|  19.5M|    return TY_(tidyDefaultStringN)( messageType, quantity);
  ------------------
  |  |   23|  19.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2698|  19.5M|}
tidyDefaultString:
 2701|  58.7M|{
 2702|  58.7M|    return TY_(tidyDefaultString)( messageType );
  ------------------
  |  |   23|  58.7M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  58.7M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2703|  58.7M|}
tidylib.c:tidyDocCreate:
  105|  21.3k|{
  106|  21.3k|    TidyDocImpl* doc = (TidyDocImpl*)TidyAlloc( allocator, sizeof(TidyDocImpl) );
  ------------------
  |  |   66|  21.3k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  107|  21.3k|    TidyClearMemory( doc, sizeof(*doc) );
  ------------------
  |  |   70|  21.3k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  108|  21.3k|    doc->allocator = allocator;
  109|       |
  110|  21.3k|    TY_(InitMap)();
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  111|  21.3k|    TY_(InitTags)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  112|  21.3k|    TY_(InitAttrs)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  113|  21.3k|    TY_(InitConfig)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  114|  21.3k|    TY_(InitPrintBuf)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  115|  21.3k|    TY_(InitParserStack)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#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|  21.3k|#if SUPPORT_LOCALIZATIONS
  122|  21.3k|    if ( TY_(tidyGetLanguageSetByUser)() == no )
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (122:10): [True: 21.3k, False: 0]
  ------------------
  123|  21.3k|    {
  124|  21.3k|        if( ! TY_(tidySetLanguage)( getenv( "LC_MESSAGES" ) ) )
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (124:13): [True: 21.3k, False: 0]
  ------------------
  125|  21.3k|        {
  126|  21.3k|            if( ! TY_(tidySetLanguage)( getenv( "LANG" ) ) )
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (126:17): [True: 21.3k, False: 0]
  ------------------
  127|  21.3k|            {
  128|       |                /*\
  129|       |                *  Is. #770 #783 #780 #790 and maybe others -
  130|       |                *  TY_(tidySetLanguage)( setlocale( LC_ALL, "" ) );
  131|       |                *  this seems a 'bad' choice!
  132|       |               \*/
  133|  21.3k|            }
  134|  21.3k|        }
  135|  21.3k|    }
  136|  21.3k|#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|  21.3k|    doc->errout = TY_(StdErrOutput)();
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  145|  21.3k|    return doc;
  146|  21.3k|}
tidylib.c:tidyDocRelease:
  149|  21.3k|{
  150|       |    /* doc in/out opened and closed by parse/print routines */
  151|  21.3k|    if ( doc )
  ------------------
  |  Branch (151:10): [True: 21.3k, False: 0]
  ------------------
  152|  21.3k|    {
  153|  21.3k|        assert( doc->docIn == NULL );
  ------------------
  |  Branch (153:9): [True: 0, False: 21.3k]
  |  Branch (153:9): [True: 21.3k, False: 0]
  ------------------
  154|  21.3k|        assert( doc->docOut == NULL );
  ------------------
  |  Branch (154:9): [True: 0, False: 21.3k]
  |  Branch (154:9): [True: 21.3k, False: 0]
  ------------------
  155|       |
  156|  21.3k|        TY_(ReleaseStreamOut)( doc, doc->errout );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  157|  21.3k|        doc->errout = NULL;
  158|       |
  159|  21.3k|        TY_(FreePrintBuf)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  160|  21.3k|        TY_(FreeNode)(doc, &doc->root);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  161|  21.3k|        TidyClearMemory(&doc->root, sizeof(Node));
  ------------------
  |  |   70|  21.3k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  162|       |
  163|  21.3k|        if (doc->givenDoctype)
  ------------------
  |  Branch (163:13): [True: 121, False: 21.1k]
  ------------------
  164|  21.3k|            TidyDocFree(doc, doc->givenDoctype);
  ------------------
  |  |  159|    121|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|    121|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  165|       |
  166|  21.3k|        TY_(FreeConfig)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  167|  21.3k|        TY_(FreeAttrTable)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  168|  21.3k|        TY_(FreeAttrPriorityList)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  169|  21.3k|        TY_(FreeMutedMessageList( doc ));
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  170|  21.3k|        TY_(FreeTags)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#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|  21.3k|        TY_(FreeLexer)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  176|  21.3k|        TY_(FreeParserStack)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  177|  21.3k|        TidyDocFree( doc, doc );
  ------------------
  |  |  159|  21.3k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  178|  21.3k|    }
  179|  21.3k|}
tidylib.c:tidyDocParseFile:
 1136|  21.3k|{
 1137|  21.3k|    int status = -ENOENT;
 1138|  21.3k|    FILE* fin = 0;
 1139|  21.3k|    struct stat sbuf = { 0 }; /* Is. #681 - read-only files */
 1140|  21.3k|    if ( stat(filnam,&sbuf) != 0 )
  ------------------
  |  Branch (1140:10): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    if (sbuf.st_mode & M_IS_DIR) /* and /NOT/ if a DIRECTORY */
  ------------------
  |  | 1133|  21.3k|#define M_IS_DIR S_IFDIR
  ------------------
  |  Branch (1145:9): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    fin = fopen( filnam, "rb" );
 1156|       |
 1157|  21.3k|#if PRESERVE_FILE_TIMES
 1158|  21.3k|    {
 1159|       |        /* get last modified time */
 1160|  21.3k|        TidyClearMemory(&doc->filetimes, sizeof(doc->filetimes));
  ------------------
  |  |   70|  21.3k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1161|  21.3k|        if (fin && cfgBool(doc, TidyKeepFileTimes) &&
  ------------------
  |  |  418|  42.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 21.3k]
  |  |  ------------------
  ------------------
  |  Branch (1161:13): [True: 21.3k, 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|  21.3k|    }
 1168|  21.3k|#endif
 1169|       |
 1170|  21.3k|    if ( fin )
  ------------------
  |  Branch (1170:10): [True: 21.3k, False: 0]
  ------------------
 1171|  21.3k|    {
 1172|  21.3k|        StreamIn* in = TY_(FileInput)( doc, fin, cfg( doc, TidyInCharEncoding ));
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      StreamIn* in = TY_(FileInput)( doc, fin, cfg( doc, TidyInCharEncoding ));
  ------------------
  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1173|  21.3k|        if ( !in )
  ------------------
  |  Branch (1173:14): [True: 0, False: 21.3k]
  ------------------
 1174|      0|        {
 1175|      0|            fclose( fin );
 1176|      0|            return status;
 1177|      0|        }
 1178|  21.3k|        status = TY_(DocParseStream)( doc, in );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1179|  21.3k|        TY_(freeFileSource)(&in->source, yes);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1180|  21.3k|        TY_(freeStreamIn)(in);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1181|  21.3k|    }
 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|  21.3k|    return status;
 1185|  21.3k|#endif
 1186|  21.3k|}
tidylib.c:tidyDocSaveStream:
 2270|  21.3k|{
 2271|  21.3k|    Bool showMarkup  = cfgBool( doc, TidyShowMarkup );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2272|  21.3k|    Bool forceOutput = cfgBool( doc, TidyForceOutput );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2273|  21.3k|    Bool outputBOM   = ( cfgAutoBool(doc, TidyOutputBOM) == TidyYesState );
  ------------------
  |  |  421|  21.3k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2274|  21.3k|    Bool smartBOM    = ( cfgAutoBool(doc, TidyOutputBOM) == TidyAutoState );
  ------------------
  |  |  421|  21.3k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2275|  21.3k|    Bool xmlOut      = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2276|  21.3k|    Bool xhtmlOut    = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2277|  21.3k|    TidyTriState bodyOnly    = cfgAutoBool( doc, TidyBodyOnly );
  ------------------
  |  |  421|  21.3k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2278|       |
 2279|  21.3k|    Bool dropComments = cfgBool(doc, TidyHideComments);
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2280|  21.3k|    Bool makeClean    = cfgBool(doc, TidyMakeClean);
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2281|  21.3k|    Bool asciiChars   = cfgBool(doc, TidyAsciiChars);
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2282|  21.3k|    Bool makeBare     = cfgBool(doc, TidyMakeBare);
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2283|  21.3k|    Bool escapeCDATA  = cfgBool(doc, TidyEscapeCdata);
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2284|  21.3k|    TidyAttrSortStrategy sortAttrStrat = cfg(doc, TidySortAttributes);
  ------------------
  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 2285|  21.3k|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 2286|  21.3k|    doc->pConfigChangeCallback = NULL;
 2287|       |
 2288|       |    
 2289|  21.3k|    if (escapeCDATA)
  ------------------
  |  Branch (2289:9): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    if (dropComments)
  ------------------
  |  Branch (2292:9): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    if (makeClean)
  ------------------
  |  Branch (2295:9): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    if ((makeClean && asciiChars) || makeBare)
  ------------------
  |  Branch (2301:10): [True: 0, False: 21.3k]
  |  Branch (2301:23): [True: 0, False: 0]
  |  Branch (2301:38): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    if (makeBare)
  ------------------
  |  Branch (2304:9): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    else
 2309|  21.3k|        TY_(ReplacePreformattedSpaces)(doc, &doc->root);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2310|       |
 2311|  21.3k|    TY_(SortAttributes)(doc, &doc->root, sortAttrStrat);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2312|       |
 2313|  21.3k|    if ( showMarkup && (doc->errors == 0 || forceOutput) )
  ------------------
  |  Branch (2313:10): [True: 21.3k, False: 0]
  |  Branch (2313:25): [True: 16.0k, False: 5.29k]
  |  Branch (2313:45): [True: 5.29k, False: 0]
  ------------------
 2314|  21.3k|    {
 2315|       |        /* Output a Byte Order Mark if required */
 2316|  21.3k|        if ( outputBOM || (doc->inputHadBOM && smartBOM) )
  ------------------
  |  Branch (2316:14): [True: 0, False: 21.3k]
  |  Branch (2316:28): [True: 0, False: 21.3k]
  |  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|  21.3k|        doc->docOut = out;
 2327|  21.3k|        if ( xmlOut && !xhtmlOut )
  ------------------
  |  Branch (2327:14): [True: 21.3k, False: 0]
  |  Branch (2327:24): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|        else if ( showBodyOnly( doc, bodyOnly ) )
  ------------------
  |  Branch (2329:19): [True: 0, False: 21.3k]
  ------------------
 2330|      0|            TY_(PrintBody)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2331|  21.3k|        else
 2332|  21.3k|            TY_(PPrintTree)( doc, NORMAL, 0, &doc->root );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2333|       |
 2334|  21.3k|        TY_(PFlushLine)( doc, 0 );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2335|  21.3k|        doc->docOut = NULL;
 2336|  21.3k|    }
 2337|       |
 2338|       |    /* @jsd: removing this should solve #673, and allow saving of the buffer multiple times. */
 2339|       |//    TY_(ResetConfigToSnapshot)( doc );
 2340|  21.3k|    doc->pConfigChangeCallback = callback;
 2341|       |    
 2342|  21.3k|    return tidyDocStatus( doc );
 2343|  21.3k|}
tidylib.c:showBodyOnly:
 2251|  21.3k|{
 2252|  21.3k|    Node* node;
 2253|       |
 2254|  21.3k|    switch( bodyOnly )
 2255|  21.3k|    {
 2256|  21.3k|    case TidyNoState:
  ------------------
  |  Branch (2256:5): [True: 21.3k, False: 0]
  ------------------
 2257|  21.3k|        return no;
 2258|      0|    case TidyYesState:
  ------------------
  |  Branch (2258:5): [True: 0, False: 21.3k]
  ------------------
 2259|      0|        return yes;
 2260|      0|    default:
  ------------------
  |  Branch (2260:5): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    }
 2265|      0|    return no;
 2266|  21.3k|}
tidylib.c:tidyDocSaveBuffer:
 1383|  21.3k|{
 1384|  21.3k|    int status = -EINVAL;
 1385|  21.3k|    if ( outbuf )
  ------------------
  |  Branch (1385:10): [True: 21.3k, False: 0]
  ------------------
 1386|  21.3k|    {
 1387|  21.3k|        uint outenc = cfg( doc, TidyOutCharEncoding );
  ------------------
  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1388|  21.3k|        uint nl = cfg( doc, TidyNewline );
  ------------------
  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1389|  21.3k|        StreamOut* out = TY_(BufferOutput)( doc, outbuf, outenc, nl );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1390|       |
 1391|  21.3k|        status = tidyDocSaveStream( doc, out );
 1392|  21.3k|        TidyDocFree( doc, out );
  ------------------
  |  |  159|  21.3k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  21.3k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1393|  21.3k|    }
 1394|  21.3k|    return status;
 1395|  21.3k|}
tidylib.c:tidyDocStatus:
 1408|  85.2k|{
 1409|  85.2k|    if ( doc->errors > 0 )
  ------------------
  |  Branch (1409:10): [True: 21.1k, False: 64.0k]
  ------------------
 1410|  21.1k|        return 2;
 1411|  64.0k|    if ( doc->warnings > 0 || doc->accessErrors > 0 )
  ------------------
  |  Branch (1411:10): [True: 64.0k, False: 4]
  |  Branch (1411:31): [True: 0, False: 4]
  ------------------
 1412|  64.0k|        return 1;
 1413|      4|    return 0;
 1414|  64.0k|}
tidylib.c:tidyDocRunDiagnostics:
 1521|  21.3k|{
 1522|  21.3k|    TY_(ReportMarkupVersion)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1523|  21.3k|    TY_(ReportNumWarnings)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1524|       |
 1525|  21.3k|    if ( doc->errors > 0 && !cfgBool( doc, TidyForceOutput ) )
  ------------------
  |  |  418|  5.29k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.29k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1525:10): [True: 5.29k, False: 16.0k]
  |  Branch (1525:29): [True: 5.29k, False: 0]
  ------------------
 1526|  5.29k|        TY_(Dialogue)(doc, STRING_NEEDS_INTERVENTION );
  ------------------
  |  |   23|  5.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1527|       |
 1528|  21.3k|     return tidyDocStatus( doc );
 1529|  21.3k|}
tidylib.c:tidyDocCleanAndRepair:
 2100|  21.3k|{
 2101|  21.3k|    Bool word2K   = cfgBool( doc, TidyWord2000 );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2102|  21.3k|    Bool logical  = cfgBool( doc, TidyLogicalEmphasis );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2103|  21.3k|    Bool clean    = cfgBool( doc, TidyMakeClean );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2104|  21.3k|    Bool gdoc     = cfgBool( doc, TidyGDocClean );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2105|  21.3k|    Bool htmlOut  = cfgBool( doc, TidyHtmlOut );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2106|  21.3k|    Bool xmlOut   = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2107|  21.3k|    Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2108|  21.3k|    Bool xmlDecl  = cfgBool( doc, TidyXmlDecl );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2109|  21.3k|    Bool tidyMark = cfgBool( doc, TidyMark );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2110|  21.3k|    Bool tidyXmlTags = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2111|  21.3k|    Bool wantNameAttr = cfgBool( doc, TidyAnchorAsName );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2112|  21.3k|    Bool mergeEmphasis = cfgBool( doc, TidyMergeEmphasis );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2113|  21.3k|    Node* node;
 2114|  21.3k|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 2115|  21.3k|    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|  21.3k|    if (tidyXmlTags)
  ------------------
  |  Branch (2121:9): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    TY_(CleanStyle)(doc, &doc->root);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2129|       |
 2130|       |    /* simplifies <b><b> ... </b> ...</b> etc. */
 2131|  21.3k|    if ( mergeEmphasis )
  ------------------
  |  Branch (2131:10): [True: 21.3k, False: 0]
  ------------------
 2132|  21.3k|        TY_(NestedEmphasis)( doc, &doc->root );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2133|       |
 2134|       |    /* cleans up <dir>indented text</dir> etc. */
 2135|  21.3k|    TY_(List2BQ)( doc, &doc->root );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2136|  21.3k|    TY_(BQ2Div)( doc, &doc->root );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2137|       |
 2138|       |    /* replaces i by em and b by strong */
 2139|  21.3k|    if ( logical )
  ------------------
  |  Branch (2139:10): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    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: 21.3k]
  |  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|  21.3k|    if ( clean )
  ------------------
  |  Branch (2153:10): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    if ( gdoc )
  ------------------
  |  Branch (2157:10): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    TY_(TidyMetaCharset)(doc);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2162|       |
 2163|  21.3k|    if ( !TY_(CheckNodeIntegrity)( &doc->root ) )
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2163:10): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    node = TY_(FindDocType)(doc);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2168|       |
 2169|  21.3k|    if (node)
  ------------------
  |  Branch (2169:9): [True: 2.35k, False: 18.9k]
  ------------------
 2170|  2.35k|    {
 2171|  2.35k|        AttVal* fpi = TY_(GetAttrByName)(node, "PUBLIC");
  ------------------
  |  |   23|  2.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2172|  2.35k|        if (AttrHasValue(fpi))
  ------------------
  |  |  171|  2.35k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 219, False: 2.14k]
  |  |  |  Branch (171:44): [True: 121, False: 98]
  |  |  ------------------
  ------------------
 2173|    121|        {
 2174|    121|            if (doc->givenDoctype)
  ------------------
  |  Branch (2174:17): [True: 0, False: 121]
  ------------------
 2175|    121|                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|    121|            doc->givenDoctype = TY_(tmbstrdup)(doc->allocator,fpi->value);
  ------------------
  |  |   23|    121|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    121|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2177|    121|        }
 2178|  2.35k|    }
 2179|       |
 2180|  21.3k|    if ( doc->root.content )
  ------------------
  |  Branch (2180:10): [True: 21.3k, False: 0]
  ------------------
 2181|  21.3k|    {
 2182|       |        /* If we had XHTML input but want HTML output */
 2183|  21.3k|        if ( htmlOut && doc->lexer->isvoyager )
  ------------------
  |  Branch (2183:14): [True: 0, False: 21.3k]
  |  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|  21.3k|        if (xhtmlOut && !htmlOut)
  ------------------
  |  Branch (2191:13): [True: 21.3k, False: 0]
  |  Branch (2191:25): [True: 21.3k, False: 0]
  ------------------
 2192|  21.3k|        {
 2193|  21.3k|            TY_(SetXHTMLDocType)(doc);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2194|  21.3k|            TY_(FixAnchors)(doc, &doc->root, wantNameAttr, yes);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2195|  21.3k|            TY_(FixXhtmlNamespace)(doc, yes);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2196|  21.3k|            TY_(FixLanguageInformation)(doc, &doc->root, yes, yes);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2197|  21.3k|        }
 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|  21.3k|        if (tidyMark )
  ------------------
  |  Branch (2206:13): [True: 21.3k, False: 0]
  ------------------
 2207|  21.3k|            TY_(AddGenerator)(doc);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2208|       |
 2209|  21.3k|    }
 2210|       |
 2211|       |    /* ensure presence of initial <?xml version="1.0"?> */
 2212|  21.3k|    if ( xmlOut && xmlDecl )
  ------------------
  |  Branch (2212:10): [True: 21.3k, False: 0]
  |  Branch (2212:20): [True: 0, False: 21.3k]
  ------------------
 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|  21.3k|    if (doc->lexer) 
  ------------------
  |  Branch (2219:9): [True: 21.3k, False: 0]
  ------------------
 2220|  21.3k|    {
 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|  21.3k|        if (doc->lexer->versionEmitted & VERS_HTML5)
  ------------------
  |  |  213|  21.3k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  21.3k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  21.3k|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (2227:13): [True: 21.1k, False: 171]
  ------------------
 2228|  21.1k|            TY_(CheckHTML5)( doc, &doc->root );
  ------------------
  |  |   23|  21.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2229|  21.3k|        TY_(CheckHTMLTagsAttribsVersions)( doc, &doc->root );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2230|       |
 2231|  21.3k|        if ( !doc->lexer->isvoyager && doc->xmlDetected )
  ------------------
  |  Branch (2231:14): [True: 19.9k, False: 1.37k]
  |  Branch (2231:40): [True: 137, False: 19.7k]
  ------------------
 2232|    137|        {
 2233|    137|            TY_(Report)(doc, NULL, TY_(FindXmlDecl)(doc), XML_DECLARATION_DETECTED );
  ------------------
  |  |   23|    137|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    137|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(Report)(doc, NULL, TY_(FindXmlDecl)(doc), XML_DECLARATION_DETECTED );
  ------------------
  |  |   23|    137|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    137|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2234|       |
 2235|    137|        }
 2236|  21.3k|    }
 2237|       |
 2238|  21.3k|    TY_(CleanHead)(doc); /* Is #692 - discard multiple <title> tags */
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#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|  21.3k|    doc->pConfigChangeCallback = callback;
 2246|  21.3k|    return tidyDocStatus( doc );
 2247|  21.3k|}
tidylib.c:prvTidyCheckHTML5:
 1632|  21.1k|{
 1633|  21.1k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  21.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1634|  21.1k|    Bool clean = cfgBool( doc, TidyMakeClean );
  ------------------
  |  |  418|  21.1k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.1k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1635|  21.1k|    Bool already_strict = cfgBool( doc, TidyStrictTagsAttr );
  ------------------
  |  |  418|  21.1k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.1k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1636|  21.1k|    Node* body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  21.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1637|  21.1k|    Node* next;
 1638|  21.1k|    Bool warn = yes;    /* should this be a warning, error, or report??? */
 1639|  21.1k|    AttVal* attr = NULL;
 1640|  21.1k|    int i = 0;
 1641|       |
 1642|  2.67M|    while (node)
  ------------------
  |  Branch (1642:12): [True: 2.64M, False: 21.1k]
  ------------------
 1643|  2.64M|    {
 1644|  2.64M|        next = node->next;
 1645|       |        
 1646|  2.64M|        if ( nodeHasAlignAttr( node ) ) {
  ------------------
  |  Branch (1646:14): [True: 4.86k, False: 2.64M]
  ------------------
 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|  4.86k|            if ( !already_strict )
  ------------------
  |  Branch (1655:18): [True: 4.86k, False: 0]
  ------------------
 1656|  4.86k|                TY_(ReportAttrError)(doc, node, TY_(AttrGetById)(node, TidyAttr_ALIGN), MISMATCHED_ATTRIBUTE_WARN);
  ------------------
  |  |   23|  4.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportAttrError)(doc, node, TY_(AttrGetById)(node, TidyAttr_ALIGN), MISMATCHED_ATTRIBUTE_WARN);
  ------------------
  |  |   23|  4.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1657|  4.86k|        }
 1658|  2.64M|        if ( node == body ) {
  ------------------
  |  Branch (1658:14): [True: 20.8k, False: 2.62M]
  ------------------
 1659|  20.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|  20.8k|            if ( !already_strict ) {
  ------------------
  |  Branch (1664:18): [True: 20.8k, False: 0]
  ------------------
 1665|   146k|                while ( BadBody5Attribs[i] != TidyAttr_UNKNOWN ) {
  ------------------
  |  Branch (1665:25): [True: 125k, False: 20.8k]
  ------------------
 1666|   125k|                    attr = TY_(AttrGetById)(node, BadBody5Attribs[i]);
  ------------------
  |  |   23|   125k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   125k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1667|   125k|                    if ( attr )
  ------------------
  |  Branch (1667:26): [True: 1, False: 125k]
  ------------------
 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|   125k|                    i++;
 1670|   125k|                }
 1671|  20.8k|            }
 1672|  20.8k|        } else
 1673|  2.62M|        if ( nodeIsACRONYM(node) ) {
  ------------------
  |  |  469|  2.62M|#define nodeIsACRONYM( node )    TagIsId( node, TidyTag_ACRONYM )
  |  |  ------------------
  |  |  |  |  275|  2.62M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.62M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.16M, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 2.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.62M|        if ( nodeIsAPPLET(node) ) {
  ------------------
  |  |  427|  2.62M|#define nodeIsAPPLET( node )     TagIsId( node, TidyTag_APPLET )
  |  |  ------------------
  |  |  |  |  275|  2.62M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.62M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.16M, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 689, False: 2.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1685|    689|            if (clean) {
  ------------------
  |  Branch (1685:17): [True: 0, False: 689]
  ------------------
 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|    689|            } else {
 1691|    689|                if ( !already_strict )
  ------------------
  |  Branch (1691:22): [True: 689, False: 0]
  ------------------
 1692|    689|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    689|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    689|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1693|    689|            }
 1694|    689|        } else
 1695|  2.62M|        if ( nodeIsBASEFONT(node) ) {
  ------------------
  |  |  444|  2.62M|#define nodeIsBASEFONT( node )   TagIsId( node, TidyTag_BASEFONT )
  |  |  ------------------
  |  |  |  |  275|  2.62M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.62M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.16M, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 199, False: 2.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    199|            if ( !already_strict )
  ------------------
  |  Branch (1704:18): [True: 199, False: 0]
  ------------------
 1705|    199|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    199|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    199|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1706|    199|        } else
 1707|  2.62M|        if ( nodeIsBIG(node) ) {
  ------------------
  |  |  407|  2.62M|#define nodeIsBIG( node )        TagIsId( node, TidyTag_BIG )
  |  |  ------------------
  |  |  |  |  275|  2.62M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.62M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.16M, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 215, False: 2.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    215|            if (clean) {
  ------------------
  |  Branch (1722:17): [True: 0, False: 215]
  ------------------
 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|    215|            } else {
 1726|    215|                if ( !already_strict )
  ------------------
  |  Branch (1726:22): [True: 215, False: 0]
  ------------------
 1727|    215|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    215|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    215|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1728|    215|            }
 1729|    215|        } else
 1730|  2.62M|        if ( nodeIsCENTER(node) ) {
  ------------------
  |  |  420|  2.62M|#define nodeIsCENTER( node )     TagIsId( node, TidyTag_CENTER )
  |  |  ------------------
  |  |  |  |  275|  2.62M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.62M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.16M, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 479, False: 2.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    479|            if ( !already_strict )
  ------------------
  |  Branch (1737:18): [True: 479, False: 0]
  ------------------
 1738|    479|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    479|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    479|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1739|    479|        } else
 1740|  2.62M|        if ( nodeIsDIR(node) ) {
  ------------------
  |  |  389|  2.62M|#define nodeIsDIR( node )        TagIsId( node, TidyTag_DIR )
  |  |  ------------------
  |  |  |  |  275|  2.62M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.62M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.16M, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 2.16M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.62M|        if ( nodeIsFONT(node) ) {
  ------------------
  |  |  417|  2.62M|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  2.62M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.62M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.16M, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 1.32M, False: 836k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.32M|            if ( !already_strict )
  ------------------
  |  Branch (1754:18): [True: 1.32M, False: 0]
  ------------------
 1755|  1.32M|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|  1.32M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.32M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1756|  1.32M|        } else
 1757|  1.29M|        if (( nodesIsFRAME(node) ) || ( nodeIsFRAMESET(node) ) || ( nodeIsNOFRAMES(node) )) {
  ------------------
  |  |  470|  1.29M|#define nodesIsFRAME( node )     TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|  1.29M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.29M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 836k, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 2.48k, False: 834k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (( nodesIsFRAME(node) ) || ( nodeIsFRAMESET(node) ) || ( nodeIsNOFRAMES(node) )) {
  ------------------
  |  |  376|  1.29M|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  1.29M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.29M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 834k, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 5.88k, False: 828k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (( nodesIsFRAME(node) ) || ( nodeIsFRAMESET(node) ) || ( nodeIsNOFRAMES(node) )) {
  ------------------
  |  |  379|  1.29M|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  1.29M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.29M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 828k, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 6.58k, False: 821k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1758|       |            /* YOW: What to do here?????? Maybe <iframe>????
 1759|       |             */
 1760|  14.9k|            if ( !already_strict )
  ------------------
  |  Branch (1760:18): [True: 14.9k, False: 0]
  ------------------
 1761|  14.9k|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|  14.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1762|  14.9k|        } else
 1763|  1.28M|        if ( nodeIsSTRIKE(node) ) {
  ------------------
  |  |  447|  1.28M|#define nodeIsSTRIKE( node )     TagIsId( node, TidyTag_STRIKE )
  |  |  ------------------
  |  |  |  |  275|  1.28M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.28M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 821k, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 200, False: 821k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1764|       |            /* strike: CSS equivalent 'text-decoration:line-through'
 1765|       |             * maybe should use static void RenameElem( TidyDocImpl* doc, Node* node, TidyTagId tid )
 1766|       |             */
 1767|    200|            if (clean) {
  ------------------
  |  Branch (1767:17): [True: 0, False: 200]
  ------------------
 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|    200|            } else {
 1771|    200|                if ( !already_strict )
  ------------------
  |  Branch (1771:22): [True: 200, False: 0]
  ------------------
 1772|    200|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    200|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    200|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1773|    200|            }
 1774|    200|        } else
 1775|  1.28M|        if ( nodeIsTT(node) ) {
  ------------------
  |  |  471|  1.28M|#define nodeIsTT( node )         TagIsId( node, TidyTag_TT )
  |  |  ------------------
  |  |  |  |  275|  1.28M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.28M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 821k, False: 461k]
  |  |  |  |  |  Branch (275:54): [True: 2.20k, False: 819k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.20k|            if (clean) {
  ------------------
  |  Branch (1781:17): [True: 0, False: 2.20k]
  ------------------
 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.20k|            } else {
 1785|  2.20k|                if ( !already_strict )
  ------------------
  |  Branch (1785:22): [True: 2.20k, False: 0]
  ------------------
 1786|  2.20k|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|  2.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.20k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1787|  2.20k|            }
 1788|  2.20k|        } else
 1789|  1.28M|            if (TY_(nodeIsElement)(node)) {
  ------------------
  |  |   23|  1.28M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.28M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1789:17): [True: 824k, False: 456k]
  ------------------
 1790|   824k|                if (node->tag) {
  ------------------
  |  Branch (1790:21): [True: 819k, False: 5.32k]
  ------------------
 1791|   819k|                    if ( (!(node->tag->versions & VERS_HTML5) && !(node->tag->versions & VERS_PROPRIETARY)) || (inRemovedInfo(node->tag->id)) ) {
  ------------------
  |  |  213|   819k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|   819k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|   819k|#define XH50              262144u
  |  |  ------------------
  ------------------
                                  if ( (!(node->tag->versions & VERS_HTML5) && !(node->tag->versions & VERS_PROPRIETARY)) || (inRemovedInfo(node->tag->id)) ) {
  ------------------
  |  |  231|  1.78k|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  1.78k|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  1.78k|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  1.78k|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  |  Branch (1791:27): [True: 1.78k, False: 817k]
  |  Branch (1791:66): [True: 285, False: 1.49k]
  |  Branch (1791:112): [True: 0, False: 819k]
  ------------------
 1792|    285|                        if ( !already_strict )
  ------------------
  |  Branch (1792:30): [True: 285, False: 0]
  ------------------
 1793|    285|                            TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    285|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    285|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1794|    285|                    }
 1795|   819k|                }
 1796|   824k|            }
 1797|       |
 1798|  2.64M|        if (node->content)
  ------------------
  |  Branch (1798:13): [True: 2.03M, False: 612k]
  ------------------
 1799|  2.03M|        {
 1800|  2.03M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.03M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.03M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1801|  2.03M|            node = node->content;
 1802|  2.03M|            continue;
 1803|  2.03M|        }
 1804|       |
 1805|   612k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   146k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   146k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1805:16): [True: 465k, False: 146k]
  ------------------
 1806|   612k|    }
 1807|  21.1k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  21.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1808|  21.1k|}
tidylib.c:nodeHasAlignAttr:
 1610|  2.64M|{
 1611|       |    /* #define attrIsALIGN(av) AttrIsId( av, TidyAttr_ALIGN  ) */
 1612|  2.64M|    AttVal* av;
 1613|  3.12M|    for ( av = node->attributes; av != NULL; av = av->next ) {
  ------------------
  |  Branch (1613:34): [True: 484k, False: 2.64M]
  ------------------
 1614|   484k|        if (attrIsALIGN(av))
  ------------------
  |  |  187|   484k|#define attrIsALIGN(av)             AttrIsId( av, TidyAttr_ALIGN  )
  |  |  ------------------
  |  |  |  |  169|   484k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 484k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 346k, False: 137k]
  |  |  |  |  |  Branch (169:51): [True: 4.86k, False: 341k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1615|  4.86k|            return yes;
 1616|   484k|    }
 1617|  2.64M|    return no;
 1618|  2.64M|}
tidylib.c:inRemovedInfo:
 1584|   819k|{
 1585|   819k|    int i;
 1586|  10.6M|    for (i = 0; ; i++) {
 1587|  10.6M|        if (html5Info[i].tag == 0)
  ------------------
  |  Branch (1587:13): [True: 819k, False: 9.82M]
  ------------------
 1588|   819k|            break;
 1589|  9.82M|        if (html5Info[i].id == tid)
  ------------------
  |  Branch (1589:13): [True: 0, False: 9.82M]
  ------------------
 1590|      0|            return yes;
 1591|  9.82M|    }
 1592|   819k|    return no;
 1593|   819k|}
tidylib.c:prvTidyCheckHTMLTagsAttribsVersions:
 1827|  21.3k|{
 1828|  21.3k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1829|  21.3k|    Node *next;
 1830|  21.3k|    uint versionEmitted = doc->lexer->versionEmitted;
 1831|  21.3k|    uint declared = doc->lexer->doctype;
 1832|  21.3k|    uint version = versionEmitted == 0 ? declared : versionEmitted;
  ------------------
  |  Branch (1832:20): [True: 22, False: 21.2k]
  ------------------
 1833|  21.3k|    int tagReportType = VERS_STRICT & version ? ELEMENT_VERS_MISMATCH_ERROR : ELEMENT_VERS_MISMATCH_WARN;
  ------------------
  |  |  225|  21.3k|#define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  213|  21.3k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  200|  21.3k|#define HT50              131072u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  201|  21.3k|#define XH50              262144u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  207|  21.3k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  21.3k|#define H40S                   4u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  21.3k|#define H41S                  32u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  185|  21.3k|#define X10S                 256u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1833:25): [True: 21.1k, False: 149]
  ------------------
 1834|  21.3k|    int attrReportType = VERS_STRICT & version ? MISMATCHED_ATTRIBUTE_ERROR : MISMATCHED_ATTRIBUTE_WARN;
  ------------------
  |  |  225|  21.3k|#define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  213|  21.3k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  200|  21.3k|#define HT50              131072u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  201|  21.3k|#define XH50              262144u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  207|  21.3k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  21.3k|#define H40S                   4u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  21.3k|#define H41S                  32u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  185|  21.3k|#define X10S                 256u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1834:26): [True: 21.1k, False: 149]
  ------------------
 1835|  21.3k|    Bool check_versions = cfgBool( doc, TidyStrictTagsAttr );
  ------------------
  |  |  418|  21.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  21.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1836|  21.3k|    AttVal *next_attr, *attval;
 1837|  21.3k|    Bool attrIsProprietary = no;
 1838|  21.3k|    Bool attrIsMismatched = yes;
 1839|  21.3k|    Bool tagLooksCustom = no;
 1840|  21.3k|    Bool htmlIs5 = (doc->lexer->doctype & VERS_HTML5) > 0;
  ------------------
  |  |  213|  21.3k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  21.3k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  21.3k|#define XH50              262144u
  |  |  ------------------
  ------------------
 1841|       |
 1842|  2.70M|    while (node)
  ------------------
  |  Branch (1842:12): [True: 2.68M, False: 21.3k]
  ------------------
 1843|  2.68M|    {
 1844|  2.68M|        next = node->next;
 1845|       |
 1846|       |        /* This bit here handles our HTML tags */
 1847|  2.68M|        if ( TY_(nodeIsElement)(node) && node->tag ) {
  ------------------
  |  |   23|  2.68M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.68M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1847:14): [True: 2.19M, False: 486k]
  |  Branch (1847:42): [True: 2.19M, False: 5.65k]
  ------------------
 1848|       |
 1849|       |            /* Leave XML stuff alone. */
 1850|  2.19M|            if ( !cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  2.19M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.19M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1850:18): [True: 2.19M, False: 0]
  ------------------
 1851|  2.19M|            {
 1852|       |                /* Version mismatches take priority. */
 1853|  2.19M|                if ( check_versions && !(node->tag->versions & version) )
  ------------------
  |  Branch (1853:22): [True: 0, False: 2.19M]
  |  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.19M|                else if ( node->tag->versions & VERS_PROPRIETARY )
  ------------------
  |  |  231|  2.19M|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  2.19M|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  2.19M|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  2.19M|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  |  Branch (1858:27): [True: 1.49k, False: 2.18M]
  ------------------
 1859|  1.49k|                {
 1860|  1.49k|                    if ( !cfgBool(doc, TidyMakeClean) ||
  ------------------
  |  |  418|  2.99k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.49k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1860:26): [True: 1.49k, 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.49k|                    {
 1863|       |                        /* It looks custom, despite whether it's a known tag. */
 1864|  1.49k|                        tagLooksCustom = TY_(nodeIsAutonomousCustomFormat)( node );
  ------------------
  |  |   23|  1.49k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.49k|#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.49k|                        if ( (htmlIs5 && !tagLooksCustom) || !htmlIs5 )
  ------------------
  |  Branch (1873:31): [True: 248, False: 1.25k]
  |  Branch (1873:42): [True: 248, False: 0]
  |  Branch (1873:62): [True: 1.25k, False: 0]
  ------------------
 1874|  1.49k|                        {
 1875|  1.49k|                            TY_(Report)(doc, NULL, node, PROPRIETARY_ELEMENT );
  ------------------
  |  |   23|  1.49k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.49k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1876|  1.49k|                        }
 1877|       |
 1878|  1.49k|                        if ( nodeIsLAYER(node) )
  ------------------
  |  |  418|  1.49k|#define nodeIsLAYER( node )      TagIsId( node, TidyTag_LAYER )
  |  |  ------------------
  |  |  |  |  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: 253, False: 1.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1879|    253|                            doc->badLayout |= USING_LAYER;
  ------------------
  |  |  292|    253|#define USING_LAYER             2
  ------------------
 1880|  1.24k|                        else if ( nodeIsSPACER(node) )
  ------------------
  |  |  419|  1.24k|#define nodeIsSPACER( node )     TagIsId( node, TidyTag_SPACER )
  |  |  ------------------
  |  |  |  |  275|  1.24k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.24k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.24k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 1.24k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1881|      0|                            doc->badLayout |= USING_SPACER;
  ------------------
  |  |  291|      0|#define USING_SPACER            1
  ------------------
 1882|  1.24k|                        else if ( nodeIsNOBR(node) )
  ------------------
  |  |  415|  1.24k|#define nodeIsNOBR( node )       TagIsId( node, TidyTag_NOBR )
  |  |  ------------------
  |  |  |  |  275|  1.24k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.24k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.24k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 985, False: 261]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1883|    985|                            doc->badLayout |= USING_NOBR;
  ------------------
  |  |  293|    985|#define USING_NOBR              4
  ------------------
 1884|  1.49k|                    }
 1885|  1.49k|                }
 1886|  2.19M|            }
 1887|  2.19M|        }
 1888|       |
 1889|       |        /* And this bit here handles our attributes */
 1890|  2.68M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  2.68M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.68M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1890:13): [True: 2.19M, False: 486k]
  ------------------
 1891|  2.19M|        {
 1892|  2.19M|            attval = node->attributes;
 1893|       |
 1894|  2.66M|            while (attval)
  ------------------
  |  Branch (1894:20): [True: 472k, False: 2.19M]
  ------------------
 1895|   472k|            {
 1896|   472k|                next_attr = attval->next;
 1897|       |
 1898|   472k|                attrIsProprietary = TY_(AttributeIsProprietary)(node, attval);
  ------------------
  |  |   23|   472k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   472k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1899|       |                /* Is. #729 - always check version match if HTML5 */
 1900|   472k|                attrIsMismatched = (check_versions | htmlIs5) ? TY_(AttributeIsMismatched)(node, attval, doc) : no;
  ------------------
  |  |   23|  8.41k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.41k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1900:36): [True: 8.41k, False: 464k]
  ------------------
 1901|       |                /* Let the PROPRIETARY_ATTRIBUTE warning have precedence. */
 1902|   472k|                if ( attrIsProprietary )
  ------------------
  |  Branch (1902:22): [True: 245k, False: 227k]
  ------------------
 1903|   245k|                {
 1904|   245k|                    if ( cfgBool(doc, TidyWarnPropAttrs) )
  ------------------
  |  |  418|   245k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   245k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 245k, False: 0]
  |  |  ------------------
  ------------------
 1905|   245k|                        TY_(ReportAttrError)(doc, node, attval, PROPRIETARY_ATTRIBUTE);
  ------------------
  |  |   23|   245k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   245k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1906|   245k|                }
 1907|   227k|                else if ( attrIsMismatched )
  ------------------
  |  Branch (1907:27): [True: 1.81k, False: 225k]
  ------------------
 1908|  1.81k|                {
 1909|  1.81k|                    if (htmlIs5) 
  ------------------
  |  Branch (1909:25): [True: 1.81k, False: 0]
  ------------------
 1910|  1.81k|                    { 
 1911|       |                        /* Is. #729 - In html5 TidyStrictTagsAttr controls error or warn */
 1912|  1.81k|                        TY_(ReportAttrError)(doc, node, attval,
  ------------------
  |  |   23|  1.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1913|  1.81k|                            check_versions ? MISMATCHED_ATTRIBUTE_ERROR : MISMATCHED_ATTRIBUTE_WARN);
  ------------------
  |  Branch (1913:29): [True: 0, False: 1.81k]
  ------------------
 1914|  1.81k|                    }
 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|  1.81k|                }
 1919|       |
 1920|       |                /* @todo: do we need a new option to drop mismatches? Or should we
 1921|       |                 simply drop them? */
 1922|   472k|                if ( ( attrIsProprietary || attrIsMismatched ) && cfgBool(doc, TidyDropPropAttrs) )
  ------------------
  |  |  418|   247k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   247k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 247k]
  |  |  ------------------
  ------------------
  |  Branch (1922:24): [True: 245k, False: 227k]
  |  Branch (1922:45): [True: 1.81k, False: 225k]
  ------------------
 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|   472k|                attval = next_attr;
 1926|   472k|            }
 1927|  2.19M|        }
 1928|       |
 1929|  2.68M|        if (node->content)
  ------------------
  |  Branch (1929:13): [True: 2.04M, False: 643k]
  ------------------
 1930|  2.04M|        {
 1931|  2.04M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.04M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.04M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1932|  2.04M|            node = node->content;
 1933|  2.04M|            continue;
 1934|  2.04M|        }
 1935|       |
 1936|   643k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   147k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   147k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1936:16): [True: 496k, False: 147k]
  ------------------
 1937|   643k|    }
 1938|  21.3k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1939|  21.3k|}

prvTidytmbstrdup:
   14|  3.42M|{
   15|  3.42M|    tmbstr s = NULL;
   16|  3.42M|    if ( str )
  ------------------
  |  Branch (16:10): [True: 3.24M, False: 185k]
  ------------------
   17|  3.24M|    {
   18|  3.24M|        uint len = TY_(tmbstrlen)( str );
  ------------------
  |  |   23|  3.24M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.24M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   19|  3.24M|        tmbstr cp = s = (tmbstr) TidyAlloc( allocator, 1+len );
  ------------------
  |  |   66|  3.24M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
   20|  58.6M|        while ( 0 != (*cp++ = *str++) )
  ------------------
  |  Branch (20:17): [True: 55.4M, False: 3.24M]
  ------------------
   21|  55.4M|            /**/;
   22|  3.24M|    }
   23|  3.42M|    return s;
   24|  3.42M|}
prvTidytmbstrndup:
   28|  1.45M|{
   29|  1.45M|    tmbstr s = NULL;
   30|  1.45M|    if ( str && len > 0 )
  ------------------
  |  Branch (30:10): [True: 1.45M, False: 0]
  |  Branch (30:17): [True: 1.39M, False: 63.8k]
  ------------------
   31|  1.39M|    {
   32|  1.39M|        tmbstr cp = s = (tmbstr) TidyAlloc( allocator, 1+len );
  ------------------
  |  |   66|  1.39M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
   33|  17.2M|        while ( len-- > 0 &&  (*cp++ = *str++) )
  ------------------
  |  Branch (33:17): [True: 15.8M, False: 1.38M]
  |  Branch (33:31): [True: 15.8M, False: 1.85k]
  ------------------
   34|  15.8M|          /**/;
   35|  1.39M|        *cp = 0;
   36|  1.39M|    }
   37|  1.45M|    return s;
   38|  1.45M|}
prvTidytmbstrcpy:
   56|  1.36k|{
   57|  1.36k|    uint ncpy = 0;
   58|   604k|    while (0 != (*s1++ = *s2++) )
  ------------------
  |  Branch (58:12): [True: 603k, False: 1.36k]
  ------------------
   59|   603k|        ++ncpy;
   60|  1.36k|    return ncpy;
   61|  1.36k|}
prvTidytmbstrcat:
   66|  2.52k|{
   67|  2.52k|    uint ncpy = 0;
   68|   887k|    while ( *s1 )
  ------------------
  |  Branch (68:13): [True: 885k, False: 2.52k]
  ------------------
   69|   885k|        ++s1;
   70|       |
   71|  12.1k|    while (0 != (*s1++ = *s2++) )
  ------------------
  |  Branch (71:12): [True: 9.61k, False: 2.52k]
  ------------------
   72|  9.61k|        ++ncpy;
   73|  2.52k|    return ncpy;
   74|  2.52k|}
prvTidytmbstrcmp:
   78|  46.9M|{
   79|  46.9M|    int c;
   80|   824M|    while ((c = *s1) == *s2)
  ------------------
  |  Branch (80:12): [True: 778M, False: 45.9M]
  ------------------
   81|   778M|    {
   82|   778M|        if (c == '\0')
  ------------------
  |  Branch (82:13): [True: 1.04M, False: 777M]
  ------------------
   83|  1.04M|            return 0;
   84|       |
   85|   777M|        ++s1;
   86|   777M|        ++s2;
   87|   777M|    }
   88|       |
   89|  45.9M|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (89:13): [True: 10.5M, False: 35.3M]
  ------------------
   90|  46.9M|}
prvTidytmbstrlen:
   94|  22.6M|{
   95|  22.6M|    uint len = 0;
   96|  22.6M|    if ( str ) 
  ------------------
  |  Branch (96:10): [True: 22.6M, False: 0]
  ------------------
   97|  22.6M|    {
   98|  19.4G|        while ( *str++ )
  ------------------
  |  Branch (98:17): [True: 19.4G, False: 22.6M]
  ------------------
   99|  19.4G|            ++len;
  100|  22.6M|    }
  101|  22.6M|    return len;
  102|  22.6M|}
prvTidytmbstrcasecmp:
  112|  70.7M|{
  113|  70.7M|    uint c;
  114|       |
  115|  76.4M|    while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  76.4M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  76.4M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  76.4M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  76.4M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (115:12): [True: 6.16M, False: 70.3M]
  ------------------
  116|  6.16M|    {
  117|  6.16M|        if (c == '\0')
  ------------------
  |  Branch (117:13): [True: 453k, False: 5.71M]
  ------------------
  118|   453k|            return 0;
  119|       |
  120|  5.71M|        ++s1;
  121|  5.71M|        ++s2;
  122|  5.71M|    }
  123|       |
  124|  70.3M|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (124:13): [True: 36.1M, False: 34.1M]
  ------------------
  125|  70.7M|}
prvTidytmbstrncmp:
  128|  12.6M|{
  129|  12.6M|    uint c;
  130|       |
  131|  12.6M|	if (s1 == NULL || s2 == NULL)
  ------------------
  |  Branch (131:6): [True: 0, False: 12.6M]
  |  Branch (131:20): [True: 0, False: 12.6M]
  ------------------
  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|  12.7M|    while ((c = (byte)*s1) == (byte)*s2)
  ------------------
  |  Branch (138:12): [True: 86.0k, False: 12.6M]
  ------------------
  139|  86.0k|    {
  140|  86.0k|        if (c == '\0')
  ------------------
  |  Branch (140:13): [True: 1.77k, False: 84.2k]
  ------------------
  141|  1.77k|            return 0;
  142|       |
  143|  84.2k|        if (n == 0)
  ------------------
  |  Branch (143:13): [True: 0, False: 84.2k]
  ------------------
  144|      0|            return 0;
  145|       |
  146|  84.2k|        ++s1;
  147|  84.2k|        ++s2;
  148|  84.2k|        --n;
  149|  84.2k|    }
  150|       |
  151|  12.6M|    if (n == 0)
  ------------------
  |  Branch (151:9): [True: 12.4k, False: 12.6M]
  ------------------
  152|  12.4k|        return 0;
  153|       |
  154|  12.6M|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (154:13): [True: 1.45M, False: 11.1M]
  ------------------
  155|  12.6M|}
prvTidytmbstrncasecmp:
  158|  22.7k|{
  159|  22.7k|    uint c;
  160|       |
  161|  68.6k|    while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  68.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  68.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  68.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  68.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (161:12): [True: 46.1k, False: 22.5k]
  ------------------
  162|  46.1k|    {
  163|  46.1k|        if (c == '\0')
  ------------------
  |  Branch (163:13): [True: 207, False: 45.9k]
  ------------------
  164|    207|            return 0;
  165|       |
  166|  45.9k|        if (n == 0)
  ------------------
  |  Branch (166:13): [True: 0, False: 45.9k]
  ------------------
  167|      0|            return 0;
  168|       |
  169|  45.9k|        ++s1;
  170|  45.9k|        ++s2;
  171|  45.9k|        --n;
  172|  45.9k|    }
  173|       |
  174|  22.5k|    if (n == 0)
  ------------------
  |  Branch (174:9): [True: 7.08k, False: 15.4k]
  ------------------
  175|  7.08k|        return 0;
  176|       |
  177|  15.4k|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (177:13): [True: 13.2k, False: 2.16k]
  ------------------
  178|  22.5k|}
prvTidytmbsubstrn:
  181|  2.79k|{
  182|  2.79k|    uint len2 = TY_(tmbstrlen)(s2);
  ------------------
  |  |   23|  2.79k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.79k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  183|  2.79k|    int ix, diff = len1 - len2;
  184|       |
  185|  11.7M|    for ( ix = 0; ix <= diff; ++ix )
  ------------------
  |  Branch (185:19): [True: 11.7M, False: 2.19k]
  ------------------
  186|  11.7M|    {
  187|  11.7M|        if ( TY_(tmbstrncmp)(s1+ix, s2, len2) == 0 )
  ------------------
  |  |   23|  11.7M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.7M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (187:14): [True: 596, False: 11.7M]
  ------------------
  188|    596|            return (ctmbstr) s1+ix;
  189|  11.7M|    }
  190|  2.19k|    return NULL;
  191|  2.79k|}
prvTidytmbsubstr:
  194|  2.04k|{
  195|  2.04k|    uint len1 = TY_(tmbstrlen)(s1), len2 = TY_(tmbstrlen)(s2);
  ------------------
  |  |   23|  2.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  uint len1 = TY_(tmbstrlen)(s1), len2 = TY_(tmbstrlen)(s2);
  ------------------
  |  |   23|  2.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  196|  2.04k|    int ix, diff = len1 - len2;
  197|       |
  198|  4.77k|    for ( ix = 0; ix <= diff; ++ix )
  ------------------
  |  Branch (198:19): [True: 3.14k, False: 1.63k]
  ------------------
  199|  3.14k|    {
  200|  3.14k|        if ( TY_(tmbstrncasecmp)(s1+ix, s2, len2) == 0 )
  ------------------
  |  |   23|  3.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (200:14): [True: 408, False: 2.73k]
  ------------------
  201|    408|            return (ctmbstr) s1+ix;
  202|  3.14k|    }
  203|  1.63k|    return NULL;
  204|  2.04k|}
prvTidytmbstrtolower:
  208|  79.6k|{
  209|  79.6k|    tmbstr cp;
  210|  2.60M|    for ( cp=s; *cp; ++cp )
  ------------------
  |  Branch (210:17): [True: 2.52M, False: 79.6k]
  ------------------
  211|  2.52M|        *cp = (tmbchar) TY_(ToLower)( *cp );
  ------------------
  |  |   23|  2.52M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.52M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  212|  79.6k|    return s;
  213|  79.6k|}
prvTidytmbstrtoupper:
  217|  1.32k|{
  218|  1.32k|    tmbstr cp;
  219|       |
  220|  10.5k|    for (cp = s; *cp; ++cp)
  ------------------
  |  Branch (220:18): [True: 9.26k, False: 1.32k]
  ------------------
  221|  9.26k|        *cp = (tmbchar)TY_(ToUpper)(*cp);
  ------------------
  |  |   23|  9.26k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.26k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  222|       |
  223|  1.32k|    return s;
  224|  1.32k|}
prvTidytmbvsnprintf:
  227|  72.6M|{
  228|  72.6M|    int retval;
  229|       |
  230|  72.6M|#if HAS_VSNPRINTF
  231|  72.6M|    retval = vsnprintf(buffer, count - 1, format, args);
  232|       |    /* todo: conditionally null-terminate the string? */
  233|  72.6M|    buffer[count - 1] = 0;
  234|       |#else
  235|       |    retval = vsprintf(buffer, format, args);
  236|       |#endif /* HAS_VSNPRINTF */
  237|  72.6M|    return retval;
  238|  72.6M|}
prvTidytmbsnprintf:
  241|  53.0M|{
  242|  53.0M|    int retval;
  243|  53.0M|    va_list args;
  244|  53.0M|    va_start(args, format);
  245|  53.0M|    retval = TY_(tmbvsnprintf)(buffer, count, format, args);
  ------------------
  |  |   23|  53.0M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  53.0M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  246|       |    va_end(args);
  247|  53.0M|    return retval;
  248|  53.0M|}
prvTidystrrep:
  251|  78.2M|{
  252|  78.2M|    char *p = strstr(buffer, str);
  253|  78.2M|    do
  254|  78.2M|    {
  255|  78.2M|        if(p)
  ------------------
  |  Branch (255:12): [True: 177k, False: 78.1M]
  ------------------
  256|   177k|        {
  257|   177k|            char buf[1024];
  258|   177k|            memset(buf,'\0',strlen(buf));
  259|       |
  260|   177k|            if(buffer == p)
  ------------------
  |  Branch (260:16): [True: 71.8k, False: 105k]
  ------------------
  261|  71.8k|            {
  262|  71.8k|                strcpy(buf,rep);
  263|  71.8k|                strcat(buf,p+strlen(str));
  264|  71.8k|            }
  265|   105k|            else
  266|   105k|            {
  267|   105k|                strncpy(buf,buffer,strlen(buffer) - strlen(p));
  268|   105k|                strcat(buf,rep);
  269|   105k|                strcat(buf,p+strlen(str));
  270|   105k|            }
  271|       |
  272|   177k|            memset(buffer,'\0',strlen(buffer));
  273|   177k|            strcpy(buffer,buf);
  274|   177k|        }
  275|       |
  276|  78.2M|    } while(p && (p = strstr(buffer, str)));
  ------------------
  |  Branch (276:13): [True: 177k, False: 78.1M]
  |  Branch (276:18): [True: 194, False: 177k]
  ------------------
  277|  78.2M|}

prvTidyDecodeUTF8BytesToChar:
  166|  91.2M|{
  167|  91.2M|    byte tempbuf[10];
  168|  91.2M|    byte *buf = &tempbuf[0];
  169|  91.2M|    uint ch = 0, n = 0;
  170|  91.2M|    int i, bytes = 0;
  171|  91.2M|    Bool hasError = no;
  172|       |    
  173|  91.2M|    if ( successorBytes )
  ------------------
  |  Branch (173:10): [True: 16.6M, False: 74.6M]
  ------------------
  174|  16.6M|        buf = (byte*) successorBytes;
  175|       |        
  176|       |    /* special check if we have been passed an EOF char */
  177|  91.2M|    if ( firstByte == EndOfStream )
  ------------------
  |  | 1064|  91.2M|#define EndOfStream (~0u)
  ------------------
  |  Branch (177:10): [True: 0, False: 91.2M]
  ------------------
  178|      0|    {
  179|       |        /* at present */
  180|      0|        *c = firstByte;
  181|      0|        *count = 1;
  182|      0|        return 0;
  183|      0|    }
  184|       |
  185|  91.2M|    ch = firstByte; /* first byte is passed in separately */
  186|       |    
  187|  91.2M|    if (ch <= 0x7F) /* 0XXX XXXX one byte */
  ------------------
  |  Branch (187:9): [True: 81.3M, False: 9.96M]
  ------------------
  188|  81.3M|    {
  189|  81.3M|        n = ch;
  190|  81.3M|        bytes = 1;
  191|  81.3M|    }
  192|  9.96M|    else if ((ch & 0xE0) == 0xC0)  /* 110X XXXX  two bytes */
  ------------------
  |  Branch (192:14): [True: 427k, False: 9.53M]
  ------------------
  193|   427k|    {
  194|   427k|        n = ch & 31;
  195|   427k|        bytes = 2;
  196|   427k|    }
  197|  9.53M|    else if ((ch & 0xF0) == 0xE0)  /* 1110 XXXX  three bytes */
  ------------------
  |  Branch (197:14): [True: 8.06M, False: 1.47M]
  ------------------
  198|  8.06M|    {
  199|  8.06M|        n = ch & 15;
  200|  8.06M|        bytes = 3;
  201|  8.06M|    }
  202|  1.47M|    else if ((ch & 0xF8) == 0xF0)  /* 1111 0XXX  four bytes */
  ------------------
  |  Branch (202:14): [True: 366k, False: 1.10M]
  ------------------
  203|   366k|    {
  204|   366k|        n = ch & 7;
  205|   366k|        bytes = 4;
  206|   366k|    }
  207|  1.10M|    else if ((ch & 0xFC) == 0xF8)  /* 1111 10XX  five bytes */
  ------------------
  |  Branch (207:14): [True: 21.6k, False: 1.08M]
  ------------------
  208|  21.6k|    {
  209|  21.6k|        n = ch & 3;
  210|  21.6k|        bytes = 5;
  211|  21.6k|        hasError = yes;
  212|  21.6k|    }
  213|  1.08M|    else if ((ch & 0xFE) == 0xFC)  /* 1111 110X  six bytes */
  ------------------
  |  Branch (213:14): [True: 13.2k, False: 1.06M]
  ------------------
  214|  13.2k|    {
  215|  13.2k|        n = ch & 1;
  216|  13.2k|        bytes = 6;
  217|  13.2k|        hasError = yes;
  218|  13.2k|    }
  219|  1.06M|    else
  220|  1.06M|    {
  221|       |        /* not a valid first byte of a UTF-8 sequence */
  222|  1.06M|        n = ch;
  223|  1.06M|        bytes = 1;
  224|  1.06M|        hasError = yes;
  225|  1.06M|    }
  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|  91.2M|    if ( successorBytes )
  ------------------
  |  Branch (232:10): [True: 16.6M, False: 74.6M]
  ------------------
  233|  16.6M|    {
  234|  32.8M|        for ( i=0; i < bytes-1; ++i )
  ------------------
  |  Branch (234:20): [True: 16.2M, False: 16.5M]
  ------------------
  235|  16.2M|        {
  236|  16.2M|            if ( !buf[i] || (buf[i] & 0xC0) != 0x80 )
  ------------------
  |  Branch (236:18): [True: 0, False: 16.2M]
  |  Branch (236:29): [True: 59.7k, False: 16.1M]
  ------------------
  237|  59.7k|            {
  238|  59.7k|                hasError = yes;
  239|  59.7k|                bytes = i+1;
  240|  59.7k|                break;
  241|  59.7k|            }
  242|  16.1M|            n = (n << 6) | (buf[i] & 0x3F);
  243|  16.1M|        }
  244|  16.6M|    }
  245|  74.6M|    else if ( inp )
  ------------------
  |  Branch (245:15): [True: 74.6M, False: 0]
  ------------------
  246|  74.6M|    {
  247|  75.2M|        for ( i=0; i < bytes-1 && !inp->eof(inp->sourceData); ++i )
  ------------------
  |  Branch (247:20): [True: 1.10M, False: 74.1M]
  |  Branch (247:35): [True: 1.10M, False: 641]
  ------------------
  248|  1.10M|        {
  249|  1.10M|            int b = inp->getByte( inp->sourceData );
  250|  1.10M|            buf[i] = (tmbchar) b;
  251|       |
  252|       |            /* End of data or illegal successor byte value */
  253|  1.10M|            if ( b == EOF || (buf[i] & 0xC0) != 0x80 )
  ------------------
  |  Branch (253:18): [True: 0, False: 1.10M]
  |  Branch (253:30): [True: 478k, False: 630k]
  ------------------
  254|   478k|            {
  255|   478k|                hasError = yes;
  256|   478k|                bytes = i+1;
  257|   478k|                if ( b != EOF )
  ------------------
  |  Branch (257:22): [True: 478k, False: 0]
  ------------------
  258|   478k|                    inp->ungetByte( inp->sourceData, buf[i] );
  259|   478k|                break;
  260|   478k|            }
  261|   630k|            n = (n << 6) | (buf[i] & 0x3F);
  262|   630k|        }
  263|  74.6M|    }
  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|  91.2M|    if (!hasError && ((n == kUTF8ByteSwapNotAChar) || (n == kUTF8NotAChar)))
  ------------------
  |  |  121|  89.6M|#define kUTF8ByteSwapNotAChar    0xFFFE
  ------------------
                  if (!hasError && ((n == kUTF8ByteSwapNotAChar) || (n == kUTF8NotAChar)))
  ------------------
  |  |  122|  89.6M|#define kUTF8NotAChar            0xFFFF
  ------------------
  |  Branch (270:9): [True: 89.6M, False: 1.60M]
  |  Branch (270:23): [True: 195, False: 89.6M]
  |  Branch (270:55): [True: 288, False: 89.6M]
  ------------------
  271|    483|        hasError = yes;
  272|       |        
  273|  91.2M|    if (!hasError && (n > kMaxUTF8FromUCS4))
  ------------------
  |  |  124|  89.6M|#define kMaxUTF8FromUCS4         0x10FFFF
  ------------------
  |  Branch (273:9): [True: 89.6M, False: 1.60M]
  |  Branch (273:22): [True: 232, False: 89.6M]
  ------------------
  274|    232|        hasError = yes;
  275|       |
  276|  91.2M|    if (!hasError)
  ------------------
  |  Branch (276:9): [True: 89.6M, False: 1.60M]
  ------------------
  277|  89.6M|    {
  278|  89.6M|        int lo, hi;
  279|       |        
  280|  89.6M|        lo = offsetUTF8Sequences[bytes - 1];
  281|  89.6M|        hi = offsetUTF8Sequences[bytes] - 1;
  282|       |        
  283|       |        /* check for overlong sequences */
  284|  89.6M|        if ((n < validUTF8[lo].lowChar) || (n > validUTF8[hi].highChar))
  ------------------
  |  Branch (284:13): [True: 5.14k, False: 89.6M]
  |  Branch (284:44): [True: 0, False: 89.6M]
  ------------------
  285|  5.14k|            hasError = yes;
  286|  89.6M|        else
  287|  89.6M|        {
  288|  89.6M|            hasError = yes; /* assume error until proven otherwise */
  289|       |        
  290|   187M|            for (i = lo; i <= hi; i++)
  ------------------
  |  Branch (290:26): [True: 98.0M, False: 89.6M]
  ------------------
  291|  98.0M|            {
  292|  98.0M|                int tempCount;
  293|  98.0M|                byte theByte;
  294|       |                
  295|   206M|                for (tempCount = 0; tempCount < bytes; tempCount++)
  ------------------
  |  Branch (295:37): [True: 116M, False: 90.2M]
  ------------------
  296|   116M|                {
  297|   116M|                    if (!tempCount)
  ------------------
  |  Branch (297:25): [True: 98.0M, False: 18.1M]
  ------------------
  298|  98.0M|                        theByte = (tmbchar) firstByte;
  299|  18.1M|                    else
  300|  18.1M|                        theByte = buf[tempCount - 1];
  301|       |                        
  302|   116M|                    if ( theByte >= validUTF8[i].validBytes[(tempCount * 2)] &&
  ------------------
  |  Branch (302:26): [True: 115M, False: 606k]
  ------------------
  303|   115M|                         theByte <= validUTF8[i].validBytes[(tempCount * 2) + 1] )
  ------------------
  |  Branch (303:26): [True: 107M, False: 8.02M]
  ------------------
  304|   107M|                        hasError = no;
  305|   116M|                    if (hasError)
  ------------------
  |  Branch (305:25): [True: 7.76M, False: 108M]
  ------------------
  306|  7.76M|                        break;
  307|   116M|                }
  308|  98.0M|            }
  309|  89.6M|        }
  310|  89.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|  91.2M|    *count = bytes;
  325|  91.2M|    *c = n;
  326|  91.2M|    if ( hasError )
  ------------------
  |  Branch (326:10): [True: 1.61M, False: 89.6M]
  ------------------
  327|  1.61M|        return -1;
  328|  89.6M|    return 0;
  329|  91.2M|}
prvTidyEncodeCharToUTF8Bytes:
  333|   730M|{
  334|   730M|    byte tempbuf[10] = {0};
  335|   730M|    byte* buf = &tempbuf[0];
  336|   730M|    int bytes = 0;
  337|   730M|    Bool hasError = no;
  338|       |    
  339|   730M|    if ( encodebuf )
  ------------------
  |  Branch (339:10): [True: 335M, False: 394M]
  ------------------
  340|   335M|        buf = (byte*) encodebuf;
  341|       |        
  342|   730M|    if (c <= 0x7F)  /* 0XXX XXXX one byte */
  ------------------
  |  Branch (342:9): [True: 725M, False: 4.60M]
  ------------------
  343|   725M|    {
  344|   725M|        buf[0] = (tmbchar) c;
  345|   725M|        bytes = 1;
  346|   725M|    }
  347|  4.60M|    else if (c <= 0x7FF)  /* 110X XXXX  two bytes */
  ------------------
  |  Branch (347:14): [True: 166k, False: 4.43M]
  ------------------
  348|   166k|    {
  349|   166k|        buf[0] = (tmbchar) ( 0xC0 | (c >> 6) );
  350|   166k|        buf[1] = (tmbchar) ( 0x80 | (c & 0x3F) );
  351|   166k|        bytes = 2;
  352|   166k|    }
  353|  4.43M|    else if (c <= 0xFFFF)  /* 1110 XXXX  three bytes */
  ------------------
  |  Branch (353:14): [True: 4.18M, False: 252k]
  ------------------
  354|  4.18M|    {
  355|  4.18M|        buf[0] = (tmbchar) (0xE0 | (c >> 12));
  356|  4.18M|        buf[1] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  357|  4.18M|        buf[2] = (tmbchar) (0x80 | (c & 0x3F));
  358|  4.18M|        bytes = 3;
  359|  4.18M|        if ( c == kUTF8ByteSwapNotAChar || c == kUTF8NotAChar )
  ------------------
  |  |  121|  8.37M|#define kUTF8ByteSwapNotAChar    0xFFFE
  ------------------
                      if ( c == kUTF8ByteSwapNotAChar || c == kUTF8NotAChar )
  ------------------
  |  |  122|  4.18M|#define kUTF8NotAChar            0xFFFF
  ------------------
  |  Branch (359:14): [True: 224, False: 4.18M]
  |  Branch (359:44): [True: 693, False: 4.18M]
  ------------------
  360|    917|            hasError = yes;
  361|  4.18M|    }
  362|   252k|    else if (c <= 0x1FFFFF)  /* 1111 0XXX  four bytes */
  ------------------
  |  Branch (362:14): [True: 198k, False: 53.5k]
  ------------------
  363|   198k|    {
  364|   198k|        buf[0] = (tmbchar) (0xF0 | (c >> 18));
  365|   198k|        buf[1] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  366|   198k|        buf[2] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  367|   198k|        buf[3] = (tmbchar) (0x80 | (c & 0x3F));
  368|   198k|        bytes = 4;
  369|   198k|        if (c > kMaxUTF8FromUCS4)
  ------------------
  |  |  124|   198k|#define kMaxUTF8FromUCS4         0x10FFFF
  ------------------
  |  Branch (369:13): [True: 201, False: 198k]
  ------------------
  370|    201|            hasError = yes;
  371|   198k|    }
  372|  53.5k|    else if (c <= 0x3FFFFFF)  /* 1111 10XX  five bytes */
  ------------------
  |  Branch (372:14): [True: 1.94k, False: 51.5k]
  ------------------
  373|  1.94k|    {
  374|  1.94k|        buf[0] = (tmbchar) (0xF8 | (c >> 24));
  375|  1.94k|        buf[1] = (tmbchar) (0x80 | (c >> 18));
  376|  1.94k|        buf[2] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  377|  1.94k|        buf[3] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  378|  1.94k|        buf[4] = (tmbchar) (0x80 | (c & 0x3F));
  379|  1.94k|        bytes = 5;
  380|  1.94k|        hasError = yes;
  381|  1.94k|    }
  382|  51.5k|    else if (c <= 0x7FFFFFFF)  /* 1111 110X  six bytes */
  ------------------
  |  Branch (382:14): [True: 391, False: 51.1k]
  ------------------
  383|    391|    {
  384|    391|        buf[0] = (tmbchar) (0xFC | (c >> 30));
  385|    391|        buf[1] = (tmbchar) (0x80 | ((c >> 24) & 0x3F));
  386|    391|        buf[2] = (tmbchar) (0x80 | ((c >> 18) & 0x3F));
  387|    391|        buf[3] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  388|    391|        buf[4] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  389|    391|        buf[5] = (tmbchar) (0x80 | (c & 0x3F));
  390|    391|        bytes = 6;
  391|    391|        hasError = yes;
  392|    391|    }
  393|  51.1k|    else
  394|  51.1k|        hasError = yes;
  395|       |        
  396|       |    /* don't output invalid UTF-8 byte sequence to a stream */
  397|   730M|    if ( !hasError && outp != NULL )
  ------------------
  |  Branch (397:10): [True: 730M, False: 54.6k]
  |  Branch (397:23): [True: 394M, False: 335M]
  ------------------
  398|   394M|    {
  399|   394M|        int ix;
  400|   793M|        for ( ix=0; ix < bytes; ++ix )
  ------------------
  |  Branch (400:21): [True: 399M, False: 394M]
  ------------------
  401|   399M|          outp->putByte( outp->sinkData, buf[ix] );
  402|   394M|    }
  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|   730M|    *count = bytes;
  416|   730M|    if (hasError)
  ------------------
  |  Branch (416:9): [True: 54.6k, False: 730M]
  ------------------
  417|  54.6k|        return -1;
  418|   730M|    return 0;
  419|   730M|}
prvTidyGetUTF8:
  426|  16.6M|{
  427|  16.6M|    uint n;
  428|  16.6M|    int bytes;
  429|       |
  430|  16.6M|    int err;
  431|       |    
  432|  16.6M|    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|  16.6M|    err = TY_(DecodeUTF8BytesToChar)( &n, str[0], str+1, NULL, &bytes );
  ------------------
  |  |   23|  16.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  437|  16.6M|    if (err)
  ------------------
  |  Branch (437:9): [True: 61.7k, False: 16.5M]
  ------------------
  438|  61.7k|    {
  439|       |#if 1 && defined(_DEBUG)
  440|       |        fprintf(stderr, "pprint UTF-8 decoding error for U+%x : ", n);
  441|       |#endif
  442|  61.7k|        n = 0xFFFD; /* replacement char */
  443|  61.7k|    }
  444|       |
  445|  16.6M|    *ch = n;
  446|  16.6M|    return bytes - 1;
  447|  16.6M|}
prvTidyPutUTF8:
  451|  7.50M|{
  452|  7.50M|    int err, count = 0;
  453|       |        
  454|  7.50M|    err = TY_(EncodeCharToUTF8Bytes)( c, buf, NULL, &count );
  ------------------
  |  |   23|  7.50M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.50M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  455|  7.50M|    if (err)
  ------------------
  |  Branch (455:9): [True: 0, False: 7.50M]
  ------------------
  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|  7.50M|    buf += count;
  468|  7.50M|    return buf;
  469|  7.50M|}
prvTidyIsValidUTF16FromUCS4:
  472|   399k|{
  473|   399k|  return ( ucs4 <= kMaxUTF16FromUCS4 );
  ------------------
  |  |  127|   399k|#define kMaxUTF16FromUCS4        0x10FFFF
  ------------------
  474|   399k|}
prvTidyIsHighSurrogate:
  477|  20.5k|{
  478|  20.5k|    return ( ch >= kUTF16HighSurrogateBegin && ch <= kUTF16HighSurrogateEnd );
  ------------------
  |  |  132|  41.1k|#define kUTF16HighSurrogateBegin 0xDC00
  ------------------
                  return ( ch >= kUTF16HighSurrogateBegin && ch <= kUTF16HighSurrogateEnd );
  ------------------
  |  |  133|  6.88k|#define kUTF16HighSurrogateEnd   0xDFFF
  ------------------
  |  Branch (478:14): [True: 6.88k, False: 13.7k]
  |  Branch (478:48): [True: 2.84k, False: 4.03k]
  ------------------
  479|  20.5k|}
prvTidyIsLowSurrogate:
  481|   417k|{
  482|   417k|    return ( ch >= kUTF16LowSurrogateBegin && ch <= kUTF16LowSurrogateEnd );
  ------------------
  |  |  130|   834k|#define kUTF16LowSurrogateBegin  0xD800
  ------------------
                  return ( ch >= kUTF16LowSurrogateBegin && ch <= kUTF16LowSurrogateEnd );
  ------------------
  |  |  131|  74.9k|#define kUTF16LowSurrogateEnd    0xDBFF
  ------------------
  |  Branch (482:14): [True: 74.9k, False: 342k]
  |  Branch (482:47): [True: 13.0k, False: 61.8k]
  ------------------
  483|   417k|}
prvTidyCombineSurrogatePair:
  486|  1.19k|{
  487|  1.19k|    assert( TY_(IsHighSurrogate)(high) && TY_(IsLowSurrogate)(low) );
  ------------------
  |  Branch (487:5): [True: 0, False: 1.19k]
  |  Branch (487:5): [True: 0, False: 0]
  |  Branch (487:5): [True: 1.19k, False: 0]
  |  Branch (487:5): [True: 1.19k, False: 0]
  ------------------
  488|  1.19k|    return ( ((low - kUTF16LowSurrogateBegin) * 0x400) + 
  ------------------
  |  |  130|  1.19k|#define kUTF16LowSurrogateBegin  0xD800
  ------------------
  489|  1.19k|             high - kUTF16HighSurrogateBegin + 0x10000 );
  ------------------
  |  |  132|  1.19k|#define kUTF16HighSurrogateBegin 0xDC00
  ------------------
  490|  1.19k|}
prvTidyIsValidCombinedChar:
  504|  1.19k|{
  505|  1.19k|    return ( ch >= kUTF16SurrogatesBegin &&
  ------------------
  |  |  126|  2.39k|#define kUTF16SurrogatesBegin    0x10000
  ------------------
  |  Branch (505:14): [True: 1.19k, False: 0]
  ------------------
  506|  1.19k|             (ch & 0x0000FFFE) != 0x0000FFFE &&
  ------------------
  |  Branch (506:14): [True: 667, False: 528]
  ------------------
  507|    667|             (ch & 0x0000FFFF) != 0x0000FFFF );
  ------------------
  |  Branch (507:14): [True: 667, False: 0]
  ------------------
  508|  1.19k|}

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

