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

prvTidyNodeAttributeVersions:
  503|  40.9k|{
  504|  40.9k|    uint i;
  505|       |
  506|  40.9k|    if (!node || !node->tag || !node->tag->attrvers)
  ------------------
  |  Branch (506:9): [True: 0, False: 40.9k]
  |  Branch (506:18): [True: 0, False: 40.9k]
  |  Branch (506:32): [True: 534, False: 40.4k]
  ------------------
  507|    534|        return VERS_UNKNOWN;
  ------------------
  |  |  204|    534|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|    534|#define xxxx                   0u
  |  |  ------------------
  ------------------
  508|       |
  509|  1.82M|    for (i = 0; node->tag->attrvers[i].attribute; ++i)
  ------------------
  |  Branch (509:17): [True: 1.82M, False: 0]
  ------------------
  510|  1.82M|        if (node->tag->attrvers[i].attribute == id)
  ------------------
  |  Branch (510:13): [True: 40.4k, False: 1.77M]
  ------------------
  511|  40.4k|            return node->tag->attrvers[i].versions;
  512|       |
  513|      0|    return VERS_UNKNOWN;
  ------------------
  |  |  204|      0|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|      0|#define xxxx                   0u
  |  |  ------------------
  ------------------
  514|  40.4k|}
prvTidyAttributeIsProprietary:
  522|   396k|{
  523|   396k|    if (!node || !attval)
  ------------------
  |  Branch (523:9): [True: 0, False: 396k]
  |  Branch (523:18): [True: 0, False: 396k]
  ------------------
  524|      0|        return no;
  525|       |
  526|   396k|    if (!node->tag)
  ------------------
  |  Branch (526:9): [True: 2.29k, False: 394k]
  ------------------
  527|  2.29k|        return no;
  528|       |
  529|   394k|    if (!(node->tag->versions & VERS_ALL))
  ------------------
  |  |  228|   394k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|   394k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|   394k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|   394k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|   394k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|   394k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|   394k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|   394k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|   394k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|   394k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|   394k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|   394k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|   394k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|   394k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|   394k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|   394k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|   394k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|   394k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|   394k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|   394k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|   394k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|   394k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|   394k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|   394k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|   394k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|   394k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|   394k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|   394k|#define HT50              131072u
  |  |  ------------------
  ------------------
  |  Branch (529:9): [True: 1.71k, False: 392k]
  ------------------
  530|  1.71k|        return no;
  531|       |
  532|   392k|    if (AttributeVersions(node, attval) & VERS_ALL)
  ------------------
  |  |  228|   392k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|   392k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|   392k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|   392k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|   392k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|   392k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|   392k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|   392k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|   392k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|   392k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|   392k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|   392k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|   392k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|   392k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|   392k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|   392k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|   392k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|   392k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|   392k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|   392k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|   392k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|   392k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|   392k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|   392k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|   392k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|   392k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|   392k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|   392k|#define HT50              131072u
  |  |  ------------------
  ------------------
  |  Branch (532:9): [True: 238k, False: 154k]
  ------------------
  533|   238k|        return no;
  534|       |
  535|   154k|    return yes;
  536|   392k|}
prvTidyAttributeIsMismatched:
  545|  6.33k|{
  546|  6.33k|    uint doctype;
  547|       |    
  548|  6.33k|    if (!node || !attval)
  ------------------
  |  Branch (548:9): [True: 0, False: 6.33k]
  |  Branch (548:18): [True: 0, False: 6.33k]
  ------------------
  549|      0|        return no;
  550|       |    
  551|  6.33k|    if (!node->tag)
  ------------------
  |  Branch (551:9): [True: 225, False: 6.10k]
  ------------------
  552|    225|        return no;
  553|       |    
  554|  6.10k|    if (!(node->tag->versions & VERS_ALL))
  ------------------
  |  |  228|  6.10k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|  6.10k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|  6.10k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|  6.10k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  6.10k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|  6.10k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|  6.10k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|  6.10k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|  6.10k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|  6.10k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|  6.10k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|  6.10k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|  6.10k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  6.10k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|  6.10k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|  6.10k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|  6.10k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|  6.10k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|  6.10k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|  6.10k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|  6.10k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|  6.10k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|  6.10k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|  6.10k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|  6.10k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|  6.10k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|  6.10k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|  6.10k|#define HT50              131072u
  |  |  ------------------
  ------------------
  |  Branch (554:9): [True: 257, False: 5.84k]
  ------------------
  555|    257|        return no;
  556|       |
  557|  5.84k|    doctype = doc->lexer->versionEmitted == 0 ? doc->lexer->doctype : doc->lexer->versionEmitted;
  ------------------
  |  Branch (557:15): [True: 0, False: 5.84k]
  ------------------
  558|       |
  559|  5.84k|    if (AttributeVersions(node, attval) & doctype)
  ------------------
  |  Branch (559:9): [True: 3.72k, False: 2.12k]
  ------------------
  560|  3.72k|        return no;
  561|       |    
  562|  2.12k|    return yes;
  563|  5.84k|}
prvTidyAttrGetById:
  857|  6.22M|{
  858|  6.22M|   AttVal* av;
  859|  7.03M|   for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (859:33): [True: 940k, False: 6.09M]
  ------------------
  860|   940k|   {
  861|   940k|     if ( AttrIsId(av, id) )
  ------------------
  |  |  169|   940k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  ------------------
  |  |  |  Branch (169:29): [True: 940k, False: 0]
  |  |  |  Branch (169:37): [True: 659k, False: 281k]
  |  |  |  Branch (169:51): [True: 121k, False: 537k]
  |  |  ------------------
  ------------------
  862|   121k|         return av;
  863|   940k|   }
  864|  6.09M|   return NULL;
  865|  6.22M|}
prvTidyFindAttribute:
  869|   445k|{
  870|   445k|    if ( attval )
  ------------------
  |  Branch (870:10): [True: 445k, False: 0]
  ------------------
  871|   445k|       return attrsLookup( doc, &doc->attribs, attval->attribute );
  872|      0|    return NULL;
  873|   445k|}
prvTidyGetAttrByName:
  876|   199k|{
  877|   199k|    AttVal *attr;
  878|   300k|    for (attr = node->attributes; attr != NULL; attr = attr->next)
  ------------------
  |  Branch (878:35): [True: 128k, False: 171k]
  ------------------
  879|   128k|    {
  880|   128k|        if (attr->attribute && TY_(tmbstrcmp)(attr->attribute, name) == 0)
  ------------------
  |  |   23|   126k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   126k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (880:13): [True: 126k, False: 2.55k]
  |  Branch (880:32): [True: 28.2k, False: 97.9k]
  ------------------
  881|  28.2k|            break;
  882|   128k|    }
  883|   199k|    return attr;
  884|   199k|}
prvTidyAddAttribute:
  909|   126k|{
  910|   126k|    AttVal *av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|   126k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   126k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  911|   126k|    av->delim = '"';
  912|   126k|    av->attribute = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|   126k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   126k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  913|       |
  914|   126k|    if (value)
  ------------------
  |  Branch (914:9): [True: 90.2k, False: 35.9k]
  ------------------
  915|  90.2k|        av->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|  90.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  90.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  916|  35.9k|    else
  917|  35.9k|        av->value = NULL;
  918|       |
  919|   126k|    av->dict = attrsLookup(doc, &doc->attribs, name);
  920|       |
  921|   126k|    TY_(InsertAttributeAtEnd)(node, av);
  ------------------
  |  |   23|   126k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   126k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  922|   126k|    return av;
  923|   126k|}
prvTidyRepairAttrValue:
  926|  57.5k|{
  927|  57.5k|    AttVal* old = TY_(GetAttrByName)(node, name);
  ------------------
  |  |   23|  57.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  928|       |
  929|  57.5k|    if (old)
  ------------------
  |  Branch (929:9): [True: 86, False: 57.4k]
  ------------------
  930|     86|    {
  931|     86|        if (old->value)
  ------------------
  |  Branch (931:13): [True: 82, False: 4]
  ------------------
  932|     86|            TidyDocFree(doc, old->value);
  ------------------
  |  |  159|     82|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|     82|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  933|     86|        if (value)
  ------------------
  |  Branch (933:13): [True: 86, False: 0]
  ------------------
  934|     86|            old->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|     86|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     86|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  935|      0|        else
  936|      0|            old->value = NULL;
  937|       |
  938|     86|        return old;
  939|     86|    }
  940|  57.4k|    else
  941|  57.4k|        return TY_(AddAttribute)(doc, node, name, value);
  ------------------
  |  |   23|  57.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  942|  57.5k|}
prvTidyFreeAttrPriorityList:
  946|  20.6k|{
  947|  20.6k|    PriorityAttribs *priorities = &(doc->attribs.priorityAttribs);
  948|       |
  949|  20.6k|    if ( priorities->list )
  ------------------
  |  Branch (949:10): [True: 0, False: 20.6k]
  ------------------
  950|      0|    {
  951|      0|        uint i = 0;
  952|      0|        while ( priorities->list[i] != NULL )
  ------------------
  |  Branch (952:17): [True: 0, False: 0]
  ------------------
  953|      0|        {
  954|      0|            TidyFree( doc->allocator, priorities->list[i] );
  ------------------
  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  955|      0|            i++;
  956|      0|        }
  957|       |
  958|      0|        TidyFree( doc->allocator, priorities->list );
  ------------------
  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  959|      0|    }
  960|  20.6k|}
prvTidyIsUrl:
 1024|  16.5k|{
 1025|  16.5k|    return CheckAttrType( doc, attrname, CH_URL );
  ------------------
  |  |   64|  16.5k|#define CH_URL         TY_(CheckUrl)
  |  |  ------------------
  |  |  |  |   23|  16.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  16.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1026|  16.5k|}
prvTidyIsScript:
 1036|  1.84k|{
 1037|  1.84k|    return CheckAttrType( doc, attrname, CH_SCRIPT );
  ------------------
  |  |   65|  1.84k|#define CH_SCRIPT      CheckScript
  ------------------
 1038|  1.84k|}
prvTidyIsAnchorElement:
 1042|  2.80M|{
 1043|  2.80M|    TidyTagId tid = TagId( node );
  ------------------
  |  |  270|  2.80M|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 2.80M, False: 0]
  |  |  |  Branch (270:39): [True: 2.30M, False: 504k]
  |  |  ------------------
  ------------------
 1044|  2.80M|    if ( tid == TidyTag_A      ||
  ------------------
  |  Branch (1044:10): [True: 21.3k, False: 2.78M]
  ------------------
 1045|  2.78M|         tid == TidyTag_APPLET ||
  ------------------
  |  Branch (1045:10): [True: 1.21k, False: 2.78M]
  ------------------
 1046|  2.78M|         tid == TidyTag_FORM   ||
  ------------------
  |  Branch (1046:10): [True: 9.11k, False: 2.77M]
  ------------------
 1047|  2.77M|         tid == TidyTag_FRAME  ||
  ------------------
  |  Branch (1047:10): [True: 2.74k, False: 2.77M]
  ------------------
 1048|  2.77M|         tid == TidyTag_IFRAME ||
  ------------------
  |  Branch (1048:10): [True: 1.58k, False: 2.77M]
  ------------------
 1049|  2.77M|         tid == TidyTag_IMG    ||
  ------------------
  |  Branch (1049:10): [True: 3.40k, False: 2.76M]
  ------------------
 1050|  2.76M|         tid == TidyTag_MAP )
  ------------------
  |  Branch (1050:10): [True: 70.0k, False: 2.69M]
  ------------------
 1051|   109k|        return yes;
 1052|       |
 1053|  2.69M|    return no;
 1054|  2.80M|}
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.2k|    for ( curr=attribs->anchor_hash[h]; curr!=NULL; curr=curr->next )
  ------------------
  |  Branch (1162:41): [True: 10.6k, False: 10.5k]
  ------------------
 1163|  10.6k|    {
 1164|  10.6k|        if ( curr->node == node )
  ------------------
  |  Branch (1164:14): [True: 1.20k, False: 9.45k]
  ------------------
 1165|  1.20k|        {
 1166|  1.20k|            if ( prev )
  ------------------
  |  Branch (1166:18): [True: 203, False: 997]
  ------------------
 1167|    203|                prev->next = curr->next;
 1168|    997|            else
 1169|    997|                attribs->anchor_hash[h] = curr->next;
 1170|  1.20k|            delme = curr;
 1171|  1.20k|            break;
 1172|  1.20k|        }
 1173|  9.45k|        prev = curr;
 1174|  9.45k|    }
 1175|  11.7k|    FreeAnchor( doc, delme );
 1176|  11.7k|}
prvTidyFreeAnchors:
 1256|  41.2k|{
 1257|  41.2k|    TidyAttribImpl* attribs = &doc->attribs;
 1258|  41.2k|    Anchor* a;
 1259|  41.2k|    uint h;
 1260|  42.1M|    for (h = 0; h < ANCHOR_HASH_SIZE; h++) {
  ------------------
  |  Branch (1260:17): [True: 42.0M, False: 41.2k]
  ------------------
 1261|  42.1M|        while (NULL != (a = attribs->anchor_hash[h]) )
  ------------------
  |  Branch (1261:16): [True: 36.8k, False: 42.0M]
  ------------------
 1262|  36.8k|        {
 1263|  36.8k|            attribs->anchor_hash[h] = a->next;
 1264|  36.8k|            FreeAnchor(doc, a);
 1265|  36.8k|        }
 1266|  42.0M|    }
 1267|  41.2k|}
prvTidyInitAttrs:
 1271|  20.6k|{
 1272|  20.6k|    TidyClearMemory( &doc->attribs, sizeof(TidyAttribImpl) );
  ------------------
  |  |   70|  20.6k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1273|       |#ifdef _DEBUG
 1274|       |    {
 1275|       |      /* Attribute ID is index position in Attribute type lookup table */
 1276|       |      uint ix;
 1277|       |      for ( ix=0; ix < N_TIDY_ATTRIBS; ++ix )
 1278|       |      {
 1279|       |        const Attribute* dict = &attribute_defs[ ix ];
 1280|       |        assert( (uint) dict->id == ix );
 1281|       |      }
 1282|       |    }
 1283|       |#endif
 1284|  20.6k|}
prvTidyFreeAttrTable:
 1301|  20.6k|{
 1302|  20.6k|    attrsEmptyHash( doc, &doc->attribs );
 1303|  20.6k|    TY_(FreeAnchors)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1304|  20.6k|    FreeDeclaredAttributes( doc );
 1305|  20.6k|}
prvTidyRepairDuplicateAttributes:
 1388|   762k|{
 1389|   762k|    AttVal *first;
 1390|       |
 1391|   869k|    for (first = node->attributes; first != NULL;)
  ------------------
  |  Branch (1391:36): [True: 106k, False: 762k]
  ------------------
 1392|   106k|    {
 1393|   106k|        AttVal *second;
 1394|   106k|        Bool firstRedefined = no;
 1395|       |
 1396|   106k|        if (!(first->asp == NULL && first->php == NULL))
  ------------------
  |  Branch (1396:15): [True: 106k, False: 977]
  |  Branch (1396:37): [True: 102k, False: 3.54k]
  ------------------
 1397|  4.52k|        {
 1398|  4.52k|            first = first->next;
 1399|  4.52k|            continue;
 1400|  4.52k|        }
 1401|       |
 1402|   152k|        for (second = first->next; second != NULL;)
  ------------------
  |  Branch (1402:36): [True: 50.5k, False: 102k]
  ------------------
 1403|  50.5k|        {
 1404|  50.5k|            AttVal *temp;
 1405|       |
 1406|  50.5k|            if (!(second->asp == NULL && second->php == NULL
  ------------------
  |  Branch (1406:19): [True: 49.9k, False: 540]
  |  Branch (1406:42): [True: 49.2k, False: 736]
  ------------------
 1407|  49.2k|                  && AttrsHaveSameName(first, second)))
  ------------------
  |  Branch (1407:22): [True: 7.57k, False: 41.6k]
  ------------------
 1408|  42.9k|            {
 1409|  42.9k|                second = second->next;
 1410|  42.9k|                continue;
 1411|  42.9k|            }
 1412|       |
 1413|       |            /* first and second attribute have same local name */
 1414|       |            /* now determine what to do with this duplicate... */
 1415|       |
 1416|  7.57k|            if (!isXml
  ------------------
  |  Branch (1416:17): [True: 7.57k, False: 0]
  ------------------
 1417|  7.57k|                && attrIsCLASS(first) && cfgBool(doc, TidyJoinClasses)
  ------------------
  |  |  206|  7.57k|#define attrIsCLASS(av)             AttrIsId( av, TidyAttr_CLASS  )
  |  |  ------------------
  |  |  |  |  169|  15.1k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 7.57k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 5.47k, False: 2.10k]
  |  |  |  |  |  Branch (169:51): [True: 194, False: 5.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              && attrIsCLASS(first) && cfgBool(doc, TidyJoinClasses)
  ------------------
  |  |  418|  7.77k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    194|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 194]
  |  |  ------------------
  ------------------
 1418|      0|                && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|  7.57k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 0, False: 0]
  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                              && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|      0|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 0, False: 0]
  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1419|      0|            {
 1420|       |                /* concatenate classes */
 1421|       |
 1422|      0|                TY_(AppendToClassAttr)(doc, first, second->value);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1423|       |
 1424|      0|                temp = second->next;
 1425|      0|                TY_(ReportAttrError)( doc, node, second, JOINING_ATTRIBUTE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1426|      0|                TY_(RemoveAttribute)( doc, node, second );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1427|      0|                second = temp;
 1428|      0|            }
 1429|  7.57k|            else if (!isXml
  ------------------
  |  Branch (1429:22): [True: 7.57k, False: 0]
  ------------------
 1430|  7.57k|                     && attrIsSTYLE(first) && cfgBool(doc, TidyJoinStyles)
  ------------------
  |  |  323|  7.57k|#define attrIsSTYLE(av)             AttrIsId( av, TidyAttr_STYLE  )
  |  |  ------------------
  |  |  |  |  169|  15.1k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 7.57k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 5.47k, False: 2.10k]
  |  |  |  |  |  Branch (169:51): [True: 1.72k, False: 3.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                   && attrIsSTYLE(first) && cfgBool(doc, TidyJoinStyles)
  ------------------
  |  |  418|  9.30k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.72k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 1.72k, False: 0]
  |  |  ------------------
  ------------------
 1431|  1.72k|                     && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|  9.30k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.72k, False: 0]
  |  |  |  Branch (171:44): [True: 1.48k, False: 243]
  |  |  ------------------
  ------------------
                                   && AttrHasValue(first) && AttrHasValue(second))
  ------------------
  |  |  171|  1.48k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.48k, False: 0]
  |  |  |  Branch (171:44): [True: 1.25k, False: 226]
  |  |  ------------------
  ------------------
 1432|  1.25k|            {
 1433|  1.25k|                AppendToStyleAttr( doc, first, second->value );
 1434|       |
 1435|  1.25k|                temp = second->next;
 1436|  1.25k|                TY_(ReportAttrError)( doc, node, second, JOINING_ATTRIBUTE);
  ------------------
  |  |   23|  1.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1437|  1.25k|                TY_(RemoveAttribute)( doc, node, second );
  ------------------
  |  |   23|  1.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1438|  1.25k|                second = temp;
 1439|  1.25k|            }
 1440|  6.31k|            else if ( cfg(doc, TidyDuplicateAttrs) == TidyKeepLast )
  ------------------
  |  |  415|  6.31k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1440:23): [True: 6.31k, False: 0]
  ------------------
 1441|  6.31k|            {
 1442|  6.31k|                temp = first->next;
 1443|  6.31k|                TY_(ReportAttrError)( doc, node, first, REPEATED_ATTRIBUTE);
  ------------------
  |  |   23|  6.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1444|  6.31k|                TY_(RemoveAttribute)( doc, node, first );
  ------------------
  |  |   23|  6.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1445|  6.31k|                firstRedefined = yes;
 1446|  6.31k|                first = temp;
 1447|  6.31k|                second = second->next;
 1448|  6.31k|            }
 1449|      0|            else /* TidyDuplicateAttrs == TidyKeepFirst */
 1450|      0|            {
 1451|      0|                temp = second->next;
 1452|      0|                TY_(ReportAttrError)( doc, node, second, REPEATED_ATTRIBUTE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1453|      0|                TY_(RemoveAttribute)( doc, node, second );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1454|      0|                second = temp;
 1455|      0|            }
 1456|  7.57k|        }
 1457|   102k|        if (!firstRedefined)
  ------------------
  |  Branch (1457:13): [True: 99.2k, False: 3.17k]
  ------------------
 1458|  99.2k|            first = first->next;
 1459|   102k|    }
 1460|   762k|}
prvTidyCheckAttribute:
 1464|   384k|{
 1465|   384k|    const Attribute* attribute = attval->dict;
 1466|       |
 1467|   384k|    if ( attribute != NULL )
  ------------------
  |  Branch (1467:10): [True: 265k, False: 119k]
  ------------------
 1468|   265k|    {
 1469|   265k|        if (attrIsXML_LANG(attval) || attrIsXML_SPACE(attval))
  ------------------
  |  |  341|   265k|#define attrIsXML_LANG(av)          AttrIsId( av, TidyAttr_XML_LANG  )
  |  |  ------------------
  |  |  |  |  169|   530k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 265k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 265k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 35.3k, False: 230k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (attrIsXML_LANG(attval) || attrIsXML_SPACE(attval))
  ------------------
  |  |  342|   230k|#define attrIsXML_SPACE(av)         AttrIsId( av, TidyAttr_XML_SPACE  )
  |  |  ------------------
  |  |  |  |  169|   230k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 230k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 230k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 226, False: 229k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1470|  35.6k|        {
 1471|  35.6k|            doc->lexer->isvoyager = yes;
 1472|  35.6k|            if (!cfgBool(doc, TidyHtmlOut))
  ------------------
  |  |  418|  35.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  35.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1472:17): [True: 35.6k, False: 0]
  ------------------
 1473|  35.6k|            {
 1474|  35.6k|                TY_(SetOptionBool)(doc, TidyXhtmlOut, yes);
  ------------------
  |  |   23|  35.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1475|  35.6k|                TY_(SetOptionBool)(doc, TidyXmlOut, yes);
  ------------------
  |  |   23|  35.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1476|  35.6k|            }
 1477|  35.6k|        }
 1478|       |
 1479|   265k|        TY_(ConstrainVersion)(doc, AttributeVersions(node, attval));
  ------------------
  |  |   23|   265k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   265k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1480|       |        
 1481|   265k|        if (attribute->attrchk)
  ------------------
  |  Branch (1481:13): [True: 216k, False: 48.5k]
  ------------------
 1482|   216k|            attribute->attrchk( doc, node, attval );
 1483|   265k|    }
 1484|       |
 1485|   384k|    return attribute;
 1486|   384k|}
prvTidyIsBoolAttribute:
 1489|   144k|{
 1490|   144k|    const Attribute *attribute = ( attval ? attval->dict : NULL );
  ------------------
  |  Branch (1490:36): [True: 144k, False: 0]
  ------------------
 1491|   144k|    if ( attribute && attribute->attrchk == CH_BOOL )
  ------------------
  |  |   73|  78.5k|#define CH_BOOL        CheckBool
  ------------------
  |  Branch (1491:10): [True: 78.5k, False: 65.8k]
  |  Branch (1491:23): [True: 750, False: 77.8k]
  ------------------
 1492|    750|        return yes;
 1493|   143k|    return no;
 1494|   144k|}
prvTidyattrIsEvent:
 1497|   144k|{
 1498|   144k|    TidyAttrId atid = AttrId( attval );
  ------------------
  |  |  168|   144k|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 144k, False: 0]
  |  |  |  Branch (168:29): [True: 78.5k, False: 65.8k]
  |  |  ------------------
  ------------------
 1499|       |
 1500|   144k|    return (atid == TidyAttr_OnAFTERUPDATE     ||
  ------------------
  |  Branch (1500:13): [True: 0, False: 144k]
  ------------------
 1501|   144k|            atid == TidyAttr_OnBEFOREUNLOAD    ||
  ------------------
  |  Branch (1501:13): [True: 0, False: 144k]
  ------------------
 1502|   144k|            atid == TidyAttr_OnBEFOREUPDATE    ||
  ------------------
  |  Branch (1502:13): [True: 0, False: 144k]
  ------------------
 1503|   144k|            atid == TidyAttr_OnBLUR            ||
  ------------------
  |  Branch (1503:13): [True: 0, False: 144k]
  ------------------
 1504|   144k|            atid == TidyAttr_OnCHANGE          ||
  ------------------
  |  Branch (1504:13): [True: 0, False: 144k]
  ------------------
 1505|   144k|            atid == TidyAttr_OnCLICK           ||
  ------------------
  |  Branch (1505:13): [True: 380, False: 144k]
  ------------------
 1506|   144k|            atid == TidyAttr_OnDATAAVAILABLE   ||
  ------------------
  |  Branch (1506:13): [True: 0, False: 144k]
  ------------------
 1507|   144k|            atid == TidyAttr_OnDATASETCHANGED  ||
  ------------------
  |  Branch (1507:13): [True: 0, False: 144k]
  ------------------
 1508|   144k|            atid == TidyAttr_OnDATASETCOMPLETE ||
  ------------------
  |  Branch (1508:13): [True: 0, False: 144k]
  ------------------
 1509|   144k|            atid == TidyAttr_OnDBLCLICK        ||
  ------------------
  |  Branch (1509:13): [True: 0, False: 144k]
  ------------------
 1510|   144k|            atid == TidyAttr_OnERRORUPDATE     ||
  ------------------
  |  Branch (1510:13): [True: 0, False: 144k]
  ------------------
 1511|   144k|            atid == TidyAttr_OnFOCUS           ||
  ------------------
  |  Branch (1511:13): [True: 0, False: 144k]
  ------------------
 1512|   144k|            atid == TidyAttr_OnKEYDOWN         ||
  ------------------
  |  Branch (1512:13): [True: 0, False: 144k]
  ------------------
 1513|   144k|            atid == TidyAttr_OnKEYPRESS        ||
  ------------------
  |  Branch (1513:13): [True: 0, False: 144k]
  ------------------
 1514|   144k|            atid == TidyAttr_OnKEYUP           ||
  ------------------
  |  Branch (1514:13): [True: 0, False: 144k]
  ------------------
 1515|   144k|            atid == TidyAttr_OnLOAD            ||
  ------------------
  |  Branch (1515:13): [True: 0, False: 144k]
  ------------------
 1516|   144k|            atid == TidyAttr_OnMOUSEDOWN       ||
  ------------------
  |  Branch (1516:13): [True: 0, False: 144k]
  ------------------
 1517|   144k|            atid == TidyAttr_OnMOUSEMOVE       ||
  ------------------
  |  Branch (1517:13): [True: 0, False: 144k]
  ------------------
 1518|   144k|            atid == TidyAttr_OnMOUSEOUT        ||
  ------------------
  |  Branch (1518:13): [True: 0, False: 144k]
  ------------------
 1519|   144k|            atid == TidyAttr_OnMOUSEOVER       ||
  ------------------
  |  Branch (1519:13): [True: 0, False: 144k]
  ------------------
 1520|   144k|            atid == TidyAttr_OnMOUSEUP         ||
  ------------------
  |  Branch (1520:13): [True: 0, False: 144k]
  ------------------
 1521|   144k|            atid == TidyAttr_OnRESET           ||
  ------------------
  |  Branch (1521:13): [True: 0, False: 144k]
  ------------------
 1522|   144k|            atid == TidyAttr_OnROWENTER        ||
  ------------------
  |  Branch (1522:13): [True: 0, False: 144k]
  ------------------
 1523|   144k|            atid == TidyAttr_OnROWEXIT         ||
  ------------------
  |  Branch (1523:13): [True: 0, False: 144k]
  ------------------
 1524|   144k|            atid == TidyAttr_OnSELECT          ||
  ------------------
  |  Branch (1524:13): [True: 0, False: 144k]
  ------------------
 1525|   144k|            atid == TidyAttr_OnSUBMIT          ||
  ------------------
  |  Branch (1525:13): [True: 0, False: 144k]
  ------------------
 1526|   144k|            atid == TidyAttr_OnUNLOAD);
  ------------------
  |  Branch (1526:13): [True: 0, False: 144k]
  ------------------
 1527|   144k|}
prvTidyCheckUrl:
 1620|  61.6k|{
 1621|  61.6k|    tmbchar c;
 1622|  61.6k|    tmbstr dest, p;
 1623|  61.6k|    uint escape_count = 0, backslash_count = 0, bad_codepoint_count = 0;
 1624|  61.6k|    uint i, pos = 0;
 1625|  61.6k|    uint len;
 1626|  61.6k|    uint increment;
 1627|  61.6k|    Bool isJavascript = no;
 1628|       |
 1629|  61.6k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  61.6k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 61.6k, False: 0]
  |  |  |  Branch (171:44): [True: 59.1k, False: 2.53k]
  |  |  ------------------
  ------------------
 1630|  2.53k|    {
 1631|  2.53k|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  2.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1632|  2.53k|        return;
 1633|  2.53k|    }
 1634|       |
 1635|  59.1k|    p = attval->value;
 1636|       |
 1637|  59.1k|    isJavascript =
 1638|  59.1k|        TY_(tmbstrncmp)(p,"javascript:",sizeof("javascript:")-1)==0;
  ------------------
  |  |   23|  59.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  59.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1639|       |
 1640|  7.73M|    for (i = 0; '\0' != (c = p[i]); ++i)
  ------------------
  |  Branch (1640:17): [True: 7.67M, False: 59.1k]
  ------------------
 1641|  7.67M|    {
 1642|  7.67M|        if (c == '\\')
  ------------------
  |  Branch (1642:13): [True: 49.2k, False: 7.62M]
  ------------------
 1643|  49.2k|        {
 1644|  49.2k|            ++backslash_count;
 1645|  49.2k|            if ( cfgBool(doc, TidyFixBackslash) && !isJavascript)
  ------------------
  |  |  418|  98.4k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  49.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 49.2k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1645:52): [True: 48.6k, False: 605]
  ------------------
 1646|  48.6k|                p[i] = '/';
 1647|  49.2k|        }
 1648|  7.62M|        else if ((c > 0x7e) || (c <= 0x20) || (strchr("<>", c)))
  ------------------
  |  Branch (1648:18): [True: 446, False: 7.62M]
  |  Branch (1648:32): [True: 6.51M, False: 1.11M]
  |  Branch (1648:47): [True: 21.1k, False: 1.08M]
  ------------------
 1649|  6.53M|            ++escape_count;
 1650|  7.67M|    }
 1651|       |
 1652|  4.33M|    while ( *p != 0 )
  ------------------
  |  Branch (1652:13): [True: 4.27M, False: 59.1k]
  ------------------
 1653|  4.27M|    {
 1654|  4.27M|        if ( !IsURLCodePoint( p, &increment ) )
  ------------------
  |  Branch (1654:14): [True: 3.19M, False: 1.08M]
  ------------------
 1655|  3.19M|            ++bad_codepoint_count;
 1656|  4.27M|         p = p + increment;
 1657|  4.27M|    }
 1658|  59.1k|    p = attval->value;
 1659|       |
 1660|  59.1k|    if ( cfgBool(doc, TidyFixUri) && escape_count )
  ------------------
  |  |  418|   118k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  59.1k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 59.1k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1660:38): [True: 56.6k, False: 2.52k]
  ------------------
 1661|  56.6k|    {
 1662|  56.6k|        Bool hadnonspace = no;
 1663|  56.6k|        len = TY_(tmbstrlen)(p) + escape_count * 2 + 1;
  ------------------
  |  |   23|  56.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  56.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1664|  56.6k|        dest = (tmbstr) TidyDocAlloc(doc, len);
  ------------------
  |  |  157|  56.6k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  56.6k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 1665|       | 
 1666|  7.72M|        for (i = 0; 0 != (c = p[i]); ++i)
  ------------------
  |  Branch (1666:21): [True: 7.66M, False: 56.6k]
  ------------------
 1667|  7.66M|        {
 1668|  7.66M|            if ((c > 0x7e) || (c <= 0x20) || (strchr("<>", c)))
  ------------------
  |  Branch (1668:17): [True: 446, False: 7.66M]
  |  Branch (1668:31): [True: 6.51M, False: 1.15M]
  |  Branch (1668:46): [True: 21.1k, False: 1.13M]
  ------------------
 1669|  6.53M|            {
 1670|  6.53M|                if (c == 0x20)
  ------------------
  |  Branch (1670:21): [True: 1.42M, False: 5.11M]
  ------------------
 1671|  1.42M|                {
 1672|       |                    /* #345 - special case for leading spaces - discard */
 1673|  1.42M|                    if (hadnonspace)
  ------------------
  |  Branch (1673:25): [True: 1.41M, False: 3.58k]
  ------------------
 1674|  1.41M|                        pos += sprintf( dest + pos, "%%%02X", (byte)c );
 1675|  1.42M|                }
 1676|  5.11M|                else
 1677|  5.11M|                {
 1678|  5.11M|                    pos += sprintf( dest + pos, "%%%02X", (byte)c );
 1679|  5.11M|                    hadnonspace = yes;
 1680|  5.11M|                }
 1681|  6.53M|            }
 1682|  1.13M|            else
 1683|  1.13M|            {
 1684|  1.13M|                hadnonspace = yes;
 1685|  1.13M|                dest[pos++] = c;
 1686|  1.13M|            }
 1687|  7.66M|        }
 1688|  56.6k|        dest[pos] = 0;
 1689|       |
 1690|  56.6k|        TidyDocFree(doc, attval->value);
  ------------------
  |  |  159|  56.6k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  56.6k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1691|  56.6k|        attval->value = dest;
 1692|  56.6k|    }
 1693|  59.1k|    if ( backslash_count )
  ------------------
  |  Branch (1693:10): [True: 46.6k, False: 12.4k]
  ------------------
 1694|  46.6k|    {
 1695|  46.6k|        if ( cfgBool(doc, TidyFixBackslash) && !isJavascript )
  ------------------
  |  |  418|  93.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  46.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 46.6k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1695:48): [True: 46.4k, False: 250]
  ------------------
 1696|  46.4k|            TY_(ReportAttrError)( doc, node, attval, FIXED_BACKSLASH );
  ------------------
  |  |   23|  46.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1697|    250|        else
 1698|    250|            TY_(ReportAttrError)( doc, node, attval, BACKSLASH_IN_URI );
  ------------------
  |  |   23|    250|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    250|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1699|  46.6k|    }
 1700|  59.1k|    if ( escape_count )
  ------------------
  |  Branch (1700:10): [True: 56.6k, False: 2.52k]
  ------------------
 1701|  56.6k|    {
 1702|  56.6k|        if ( cfgBool(doc, TidyFixUri) )
  ------------------
  |  |  418|  56.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  56.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 56.6k, False: 0]
  |  |  ------------------
  ------------------
 1703|  56.6k|            TY_(ReportAttrError)( doc, node, attval, ESCAPED_ILLEGAL_URI);
  ------------------
  |  |   23|  56.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  56.6k|#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|  56.6k|        doc->badChars |= BC_INVALID_URI;
  ------------------
  |  |  304|  56.6k|#define BC_INVALID_URI             32
  ------------------
 1708|  56.6k|    }
 1709|  59.1k|    if ( bad_codepoint_count )
  ------------------
  |  Branch (1709:10): [True: 55.5k, False: 3.57k]
  ------------------
 1710|  55.5k|    {
 1711|  55.5k|        TY_(ReportAttrError)( doc, node, attval, ILLEGAL_URI_CODEPOINT );
  ------------------
  |  |   23|  55.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1712|  55.5k|    }
 1713|  59.1k|}
prvTidyIsValidHTMLID:
 1733|  70.3k|{
 1734|  70.3k|    ctmbstr s = id;
 1735|       |
 1736|  70.3k|    if (!s)
  ------------------
  |  Branch (1736:9): [True: 208, False: 70.1k]
  ------------------
 1737|    208|        return no;
 1738|       |
 1739|  1.92M|    while (*s)
  ------------------
  |  Branch (1739:12): [True: 1.90M, False: 16.8k]
  ------------------
 1740|  1.90M|        if (TY_(IsHTMLSpace)(*s++))
  ------------------
  |  |   23|  1.90M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.90M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1740:13): [True: 53.3k, False: 1.85M]
  ------------------
 1741|  53.3k|            return no;
 1742|       |
 1743|  16.8k|    return yes;
 1744|       |
 1745|  70.1k|}
prvTidyIsValidXMLID:
 1748|  66.2k|{
 1749|  66.2k|    ctmbstr s = id;
 1750|  66.2k|    tchar c;
 1751|       |
 1752|  66.2k|    if (!s)
  ------------------
  |  Branch (1752:9): [True: 0, False: 66.2k]
  ------------------
 1753|      0|        return no;
 1754|       |
 1755|  66.2k|    c = *s++;
 1756|  66.2k|    if (c > 0x7F)
  ------------------
  |  Branch (1756:9): [True: 1.19k, False: 65.0k]
  ------------------
 1757|  1.19k|        s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|  1.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1758|       |
 1759|  66.2k|    if (!(TY_(IsXMLLetter)(c) || c == '_' || c == ':'))
  ------------------
  |  |   23|  66.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  66.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1759:11): [True: 56.9k, False: 9.35k]
  |  Branch (1759:34): [True: 455, False: 8.89k]
  |  Branch (1759:46): [True: 5.92k, False: 2.97k]
  ------------------
 1760|  2.97k|        return no;
 1761|       |
 1762|   834k|    while (*s)
  ------------------
  |  Branch (1762:12): [True: 807k, False: 26.4k]
  ------------------
 1763|   807k|    {
 1764|   807k|        c = (unsigned char)*s;
 1765|       |
 1766|   807k|        if (c > 0x7F)
  ------------------
  |  Branch (1766:13): [True: 220k, False: 587k]
  ------------------
 1767|   220k|            s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|   220k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   220k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1768|       |
 1769|   807k|        ++s;
 1770|       |
 1771|   807k|        if (!TY_(IsXMLNamechar)(c))
  ------------------
  |  |   23|   807k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   807k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1771:13): [True: 36.8k, False: 770k]
  ------------------
 1772|  36.8k|            return no;
 1773|   807k|    }
 1774|       |
 1775|  26.4k|    return yes;
 1776|  63.2k|}
prvTidySortAttributes:
 2460|  2.08M|{
 2461|  4.80M|    while (node)
  ------------------
  |  Branch (2461:12): [True: 2.71M, False: 2.08M]
  ------------------
 2462|  2.71M|    {
 2463|  2.71M|        node->attributes = SortAttVal( doc, node->attributes, strat );
 2464|  2.71M|        if (node->content)
  ------------------
  |  Branch (2464:13): [True: 2.06M, False: 656k]
  ------------------
 2465|  2.06M|            TY_(SortAttributes)(doc, node->content, strat);
  ------------------
  |  |   23|  2.06M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.06M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2466|  2.71M|        node = node->next;
 2467|  2.71M|    }
 2468|  2.08M|}
attrs.c:AttributeVersions:
  479|   664k|{
  480|   664k|    uint i;
  481|       |
  482|       |    /* Override or add to items in attrdict.c */
  483|   664k|    if (attval && attval->attribute) {
  ------------------
  |  Branch (483:9): [True: 664k, False: 0]
  |  Branch (483:19): [True: 642k, False: 21.5k]
  ------------------
  484|       |        /* HTML5 data-* attributes can't be added generically; handle here. */
  485|   642k|        if (TY_(tmbstrncmp)(attval->attribute, "data-", 5) == 0)
  ------------------
  |  |   23|   642k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   642k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (485:13): [True: 827, False: 641k]
  ------------------
  486|    827|            return (XH50 | HT50);
  ------------------
  |  |  201|    827|#define XH50              262144u
  ------------------
                          return (XH50 | HT50);
  ------------------
  |  |  200|    827|#define HT50              131072u
  ------------------
  487|   642k|    }
  488|       |    /* TODO: maybe this should return VERS_PROPRIETARY instead? */
  489|   663k|    if (!attval || !attval->dict)
  ------------------
  |  Branch (489:9): [True: 0, False: 663k]
  |  Branch (489:20): [True: 100k, False: 562k]
  ------------------
  490|   100k|        return VERS_UNKNOWN;
  ------------------
  |  |  204|   100k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|   100k|#define xxxx                   0u
  |  |  ------------------
  ------------------
  491|       |
  492|   562k|    if (!(!node || !node->tag || !node->tag->attrvers))
  ------------------
  |  Branch (492:11): [True: 0, False: 562k]
  |  Branch (492:20): [True: 0, False: 562k]
  |  Branch (492:34): [True: 1.56k, False: 561k]
  ------------------
  493|  40.3M|        for (i = 0; node->tag->attrvers[i].attribute; ++i)
  ------------------
  |  Branch (493:21): [True: 40.1M, False: 133k]
  ------------------
  494|  40.1M|            if (node->tag->attrvers[i].attribute == attval->dict->id)
  ------------------
  |  Branch (494:17): [True: 428k, False: 39.7M]
  ------------------
  495|   428k|                return node->tag->attrvers[i].versions;
  496|       |
  497|   134k|    return VERS_PROPRIETARY;
  ------------------
  |  |  231|   134k|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|   134k|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|   134k|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|   134k|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  498|   562k|}
attrs.c:attrsLookup:
  836|   590k|{
  837|   590k|    const Attribute *np;
  838|   590k|    const AttrHash *p;
  839|       |
  840|   590k|    if (!atnam)
  ------------------
  |  Branch (840:9): [True: 20.8k, False: 569k]
  ------------------
  841|  20.8k|        return NULL;
  842|       |
  843|   569k|    for (p = attribs->hashtab[attrsHash(atnam)]; p && p->attr; p = p->next)
  ------------------
  |  Branch (843:50): [True: 330k, False: 239k]
  |  Branch (843:55): [True: 330k, False: 0]
  ------------------
  844|   330k|        if (TY_(tmbstrcasecmp)(atnam, p->attr->name) == 0)
  ------------------
  |  |   23|   330k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   330k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (844:13): [True: 330k, False: 534]
  ------------------
  845|   330k|            return p->attr;
  846|       |
  847|  65.5M|    for (np = attribute_defs; np && np->name; ++np)
  ------------------
  |  Branch (847:31): [True: 65.5M, False: 0]
  |  Branch (847:37): [True: 65.4M, False: 168k]
  ------------------
  848|  65.4M|        if (TY_(tmbstrcasecmp)(atnam, np->name) == 0)
  ------------------
  |  |   23|  65.4M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  65.4M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (848:13): [True: 70.5k, False: 65.3M]
  ------------------
  849|  70.5k|            return attrsInstall(doc, attribs, np);
  850|       |
  851|   168k|    return NULL;
  852|   239k|}
attrs.c:attrsHash:
  764|   639k|{
  765|   639k|    uint hashval;
  766|       |
  767|  3.66M|    for (hashval = 0; *s != '\0'; s++)
  ------------------
  |  Branch (767:23): [True: 3.02M, False: 639k]
  ------------------
  768|  3.02M|        hashval = *s + 31*hashval;
  769|       |
  770|   639k|    return hashval % ATTRIBUTE_HASH_SIZE;
  771|   639k|}
attrs.c:CheckAction:
 1722|    497|{
 1723|    497|    if (AttrHasValue(attval))
  ------------------
  |  |  171|    497|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 497, False: 0]
  |  |  |  Branch (171:44): [True: 297, False: 200]
  |  |  ------------------
  ------------------
 1724|    297|        TY_(CheckUrl)( doc, node, attval );
  ------------------
  |  |   23|    297|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    297|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1725|    497|}
attrs.c:CheckAlign:
 1926|  12.6k|{
 1927|  12.6k|    ctmbstr const values[] = {"left", "right", "center", "justify", NULL};
 1928|       |
 1929|       |    /* IMG, OBJECT, APPLET and EMBED use align for vertical position */
 1930|  12.6k|    if (node->tag && (node->tag->model & CM_IMG))
  ------------------
  |  |  155|  12.6k|#define CM_IMG          (1 << 16)  /**< Elements that use "align" attribute for vertical position. */
  ------------------
  |  Branch (1930:9): [True: 12.6k, False: 0]
  |  Branch (1930:22): [True: 859, False: 11.7k]
  ------------------
 1931|    859|    {
 1932|    859|        CheckValign( doc, node, attval );
 1933|    859|        return;
 1934|    859|    }
 1935|       |
 1936|  11.7k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  11.7k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 11.7k, False: 0]
  |  |  |  Branch (171:44): [True: 11.4k, False: 399]
  |  |  ------------------
  ------------------
 1937|    399|    {
 1938|    399|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    399|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    399|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1939|    399|        return;
 1940|    399|    }
 1941|       |
 1942|  11.4k|    CheckLowerCaseAttrValue( doc, node, attval);
 1943|       |
 1944|       |    /* currently CheckCaption(...) takes care of the remaining cases */
 1945|  11.4k|    if (nodeIsCAPTION(node))
  ------------------
  |  |  394|  11.4k|#define nodeIsCAPTION( node )    TagIsId( node, TidyTag_CAPTION )
  |  |  ------------------
  |  |  |  |  275|  11.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 11.4k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 8.97k, False: 2.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1946|  8.97k|        return;
 1947|       |
 1948|  2.42k|    if (!AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (1948:9): [True: 1.31k, False: 1.10k]
  ------------------
 1949|  1.31k|    {
 1950|       |        /* align="char" is allowed for elements with CM_TABLE|CM_ROW
 1951|       |           except CAPTION which is excluded above, */
 1952|  1.31k|        if( !(AttrValueIs(attval, "char")
  ------------------
  |  |  172|  2.63k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  2.63k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 1.31k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 1.31k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  2.63k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  1.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 444, False: 873]
  |  |  ------------------
  ------------------
 1953|    444|              && TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)) )
  ------------------
  |  |   23|    444|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    444|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                            && TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)) )
  ------------------
  |  |  146|    444|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                            && TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)) )
  ------------------
  |  |  148|    444|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (1953:18): [True: 195, False: 249]
  ------------------
 1954|  1.12k|             TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  1.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1955|  1.31k|    }
 1956|  2.42k|}
attrs.c:CheckLowerCaseAttrValue:
 1530|  19.7k|{
 1531|  19.7k|    tmbstr p;
 1532|  19.7k|    Bool hasUpper = no;
 1533|       |    
 1534|  19.7k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  19.7k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 19.7k, False: 0]
  |  |  |  Branch (171:44): [True: 19.7k, False: 0]
  |  |  ------------------
  ------------------
 1535|      0|        return;
 1536|       |
 1537|  19.7k|    p = attval->value;
 1538|       |    
 1539|  75.8k|    while (*p)
  ------------------
  |  Branch (1539:12): [True: 69.2k, False: 6.67k]
  ------------------
 1540|  69.2k|    {
 1541|  69.2k|        if (TY_(IsUpper)(*p)) /* #501230 - fix by Terry Teague - 09 Jan 02 */
  ------------------
  |  |   23|  69.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  69.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1541:13): [True: 13.1k, False: 56.1k]
  ------------------
 1542|  13.1k|        {
 1543|  13.1k|            hasUpper = yes;
 1544|  13.1k|            break;
 1545|  13.1k|        }
 1546|  56.1k|        p++;
 1547|  56.1k|    }
 1548|       |
 1549|  19.7k|    if (hasUpper)
  ------------------
  |  Branch (1549:9): [True: 13.1k, False: 6.67k]
  ------------------
 1550|  13.1k|    {
 1551|  13.1k|        Lexer* lexer = doc->lexer;
 1552|  13.1k|        if (lexer->isvoyager)
  ------------------
  |  Branch (1552:13): [True: 1.37k, False: 11.7k]
  ------------------
 1553|  1.37k|            TY_(ReportAttrError)( doc, node, attval, ATTR_VALUE_NOT_LCASE);
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1554|       |  
 1555|  13.1k|        if ( lexer->isvoyager || cfgBool(doc, TidyLowerLiterals) )
  ------------------
  |  |  418|  11.7k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  11.7k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 11.7k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1555:14): [True: 1.37k, False: 11.7k]
  ------------------
 1556|  13.1k|            attval->value = TY_(tmbstrtolower)(attval->value);
  ------------------
  |  |   23|  13.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1557|  13.1k|    }
 1558|  19.7k|}
attrs.c:AttrValueIsAmong:
 1803|  17.1k|{
 1804|  17.1k|    const ctmbstr *v;   
 1805|  61.6k|    for (v = list; *v; ++v)
  ------------------
  |  Branch (1805:20): [True: 50.0k, False: 11.5k]
  ------------------
 1806|  50.0k|        if (AttrValueIs(attval, *v))
  ------------------
  |  |  172|  50.0k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|   100k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 50.0k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 50.0k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  50.0k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  50.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  50.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 5.54k, False: 44.4k]
  |  |  ------------------
  ------------------
 1807|  5.54k|            return yes;
 1808|  11.5k|    return no;
 1809|  17.1k|}
attrs.c:CheckColor:
 2139|  4.82k|{
 2140|  4.82k|    Bool valid = no;
 2141|  4.82k|    tmbstr given;
 2142|       |
 2143|  4.82k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  4.82k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 4.82k, False: 0]
  |  |  |  Branch (171:44): [True: 4.61k, False: 209]
  |  |  ------------------
  ------------------
 2144|    209|    {
 2145|    209|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    209|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    209|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2146|    209|        return;
 2147|    209|    }
 2148|       |
 2149|  4.61k|    given = attval->value;
 2150|       |
 2151|       |    /* 727851 - add hash to hash-less color values */
 2152|  4.61k|    if (given[0] != '#' && (valid = IsValidColorCode(given)))
  ------------------
  |  Branch (2152:9): [True: 3.88k, False: 724]
  |  Branch (2152:28): [True: 883, False: 3.00k]
  ------------------
 2153|    883|    {
 2154|    883|        tmbstr cp, s;
 2155|       |
 2156|    883|        cp = s = (tmbstr) TidyDocAlloc(doc, 2 + TY_(tmbstrlen)(given));
  ------------------
  |  |  157|    883|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|    883|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 2157|    883|        *cp++ = '#';
 2158|  6.18k|        while ('\0' != (*cp++ = *given++))
  ------------------
  |  Branch (2158:16): [True: 5.29k, False: 883]
  ------------------
 2159|  5.29k|            continue;
 2160|       |
 2161|    883|        TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE_REPLACED);
  ------------------
  |  |   23|    883|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    883|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2162|       |
 2163|    883|        TidyDocFree(doc, attval->value);
  ------------------
  |  |  159|    883|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|    883|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2164|    883|        given = attval->value = s;
 2165|    883|    }
 2166|       |
 2167|  4.61k|    if (!valid && given[0] == '#')
  ------------------
  |  Branch (2167:9): [True: 3.72k, False: 883]
  |  Branch (2167:19): [True: 724, False: 3.00k]
  ------------------
 2168|    724|        valid = IsValidColorCode(given + 1);
 2169|       |
 2170|  4.61k|    if (valid && given[0] == '#' && cfgBool(doc, TidyReplaceColor))
  ------------------
  |  |  418|  1.20k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.20k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 1.20k]
  |  |  ------------------
  ------------------
  |  Branch (2170:9): [True: 1.20k, False: 3.40k]
  |  Branch (2170:18): [True: 1.20k, False: 0]
  ------------------
 2171|      0|    {
 2172|      0|        ctmbstr newName = GetColorName(given, TY_(IsHTML5Mode)(doc));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2173|       |
 2174|      0|        if (newName)
  ------------------
  |  Branch (2174:13): [True: 0, False: 0]
  ------------------
 2175|      0|        {
 2176|      0|            TidyDocFree(doc, attval->value);
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2177|      0|            given = attval->value = TY_(tmbstrdup)(doc->allocator, newName);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2178|      0|        }
 2179|      0|    }
 2180|       |
 2181|       |    /* if it is not a valid color code, it is a color name */
 2182|  4.61k|    if (!valid)
  ------------------
  |  Branch (2182:9): [True: 3.40k, False: 1.20k]
  ------------------
 2183|  3.40k|        valid = GetColorCode(given, TY_(IsHTML5Mode)(doc)) != NULL;
  ------------------
  |  |   23|  3.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2184|       |
 2185|  4.61k|    if (valid && given[0] == '#')
  ------------------
  |  Branch (2185:9): [True: 1.93k, False: 2.68k]
  |  Branch (2185:18): [True: 1.20k, False: 729]
  ------------------
 2186|  1.20k|        attval->value = TY_(tmbstrtoupper)(attval->value);
  ------------------
  |  |   23|  1.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.20k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2187|  3.40k|    else if (valid)
  ------------------
  |  Branch (2187:14): [True: 729, False: 2.68k]
  ------------------
 2188|    729|        attval->value = TY_(tmbstrtolower)(attval->value);
  ------------------
  |  |   23|    729|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    729|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2189|       |
 2190|  4.61k|    if (!valid)
  ------------------
  |  Branch (2190:9): [True: 2.68k, False: 1.93k]
  ------------------
 2191|  2.68k|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  2.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2192|  4.61k|}
attrs.c:IsValidColorCode:
 2123|  4.61k|{
 2124|  4.61k|    uint i;
 2125|       |
 2126|  4.61k|    if (TY_(tmbstrlen)(color) != 6)
  ------------------
  |  |   23|  4.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2126:9): [True: 2.36k, False: 2.25k]
  ------------------
 2127|  2.36k|        return no;
 2128|       |
 2129|       |    /* check if valid hex digits and letters */
 2130|  12.9k|    for (i = 0; i < 6; i++)
  ------------------
  |  Branch (2130:17): [True: 11.7k, False: 1.20k]
  ------------------
 2131|  11.7k|        if (!TY_(IsDigit)(color[i]) && !strchr("abcdef", TY_(ToLower)(color[i])))
  ------------------
  |  |   23|  11.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.7k|#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: 957]
  |  Branch (2131:40): [True: 1.04k, False: 9.76k]
  ------------------
 2132|  1.04k|            return no;
 2133|       |
 2134|  1.20k|    return yes;
 2135|  2.25k|}
attrs.c:GetColorCode:
  732|  3.40k|{
  733|  3.40k|    uint i;
  734|       |
  735|  51.1k|    for (i = 0; colors[i].name; ++i)
  ------------------
  |  Branch (735:17): [True: 48.2k, False: 2.92k]
  ------------------
  736|  48.2k|        if (TY_(tmbstrcasecmp)(name, colors[i].name) == 0)
  ------------------
  |  |   23|  48.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  48.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (736:13): [True: 486, False: 47.7k]
  ------------------
  737|    486|            return colors[i].hex;
  738|       |
  739|  2.92k|    if (use_css_colors)
  ------------------
  |  Branch (739:9): [True: 2.71k, False: 210]
  ------------------
  740|   354k|        for (i = 0; extended_colors[i].name; ++i)
  ------------------
  |  Branch (740:21): [True: 351k, False: 2.47k]
  ------------------
  741|   351k|            if (TY_(tmbstrcasecmp)(name, extended_colors[i].name) == 0)
  ------------------
  |  |   23|   351k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   351k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (741:17): [True: 243, False: 351k]
  ------------------
  742|    243|                return extended_colors[i].hex;
  743|       |
  744|  2.68k|    return NULL;
  745|  2.92k|}
attrs.c:CheckNumber:
 2087|  6.44k|{
 2088|  6.44k|    tmbstr p;
 2089|       |    
 2090|  6.44k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  6.44k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 6.44k, False: 0]
  |  |  |  Branch (171:44): [True: 6.22k, False: 219]
  |  |  ------------------
  ------------------
 2091|    219|    {
 2092|    219|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    219|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    219|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2093|    219|        return;
 2094|    219|    }
 2095|       |
 2096|       |    /* don't check <frameset cols=... rows=...> */
 2097|  6.22k|    if ( nodeIsFRAMESET(node) &&
  ------------------
  |  |  376|  6.22k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  12.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.22k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.22k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.94k, False: 2.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2098|  3.94k|        (attrIsCOLS(attval) || attrIsROWS(attval)))
  ------------------
  |  |  213|  3.94k|#define attrIsCOLS(av)              AttrIsId( av, TidyAttr_COLS  )
  |  |  ------------------
  |  |  |  |  169|  7.89k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.94k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.94k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 3.94k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      (attrIsCOLS(attval) || attrIsROWS(attval)))
  ------------------
  |  |  306|  3.94k|#define attrIsROWS(av)              AttrIsId( av, TidyAttr_ROWS  )
  |  |  ------------------
  |  |  |  |  169|  3.94k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.94k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.94k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 194, False: 3.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2099|    194|     return;
 2100|       |
 2101|  6.02k|    p  = attval->value;
 2102|       |    
 2103|       |    /* font size may be preceded by + or - */
 2104|  6.02k|    if ( nodeIsFONT(node) && (*p == '+' || *p == '-') )
  ------------------
  |  |  417|  6.02k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  12.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.02k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.02k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 838, False: 5.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2104:31): [True: 253, False: 585]
  |  Branch (2104:44): [True: 200, False: 385]
  ------------------
 2105|    453|        ++p;
 2106|       |    /* tabindex may be preceded by - */
 2107|  6.02k|    if (attval->attribute && (strcmp(attval->attribute,"tabindex") == 0) && (*p == '-'))
  ------------------
  |  Branch (2107:9): [True: 6.02k, False: 0]
  |  Branch (2107:30): [True: 399, False: 5.62k]
  |  Branch (2107:77): [True: 198, False: 201]
  ------------------
 2108|    198|        ++p;
 2109|       |
 2110|  9.65k|    while (*p)
  ------------------
  |  Branch (2110:12): [True: 8.54k, False: 1.11k]
  ------------------
 2111|  8.54k|    {
 2112|  8.54k|        if (!TY_(IsDigit)(*p))
  ------------------
  |  |   23|  8.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2112:13): [True: 4.91k, False: 3.63k]
  ------------------
 2113|  4.91k|        {
 2114|  4.91k|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  4.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2115|  4.91k|            break;
 2116|  4.91k|        }
 2117|  3.63k|        ++p;
 2118|  3.63k|    }
 2119|  6.02k|}
attrs.c:CheckLength:
 1992|  2.68k|{
 1993|  2.68k|    tmbstr p;
 1994|       |    
 1995|  2.68k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  2.68k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 2.68k, False: 0]
  |  |  |  Branch (171:44): [True: 2.46k, False: 219]
  |  |  ------------------
  ------------------
 1996|    219|    {
 1997|    219|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    219|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    219|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1998|    219|        return;
 1999|    219|    }
 2000|       |
 2001|       |    /* don't check for <col width=...> and <colgroup width=...> */
 2002|  2.46k|    if (attrIsWIDTH(attval) && (nodeIsCOL(node) || nodeIsCOLGROUP(node)))
  ------------------
  |  |  338|  2.46k|#define attrIsWIDTH(av)             AttrIsId( av, TidyAttr_WIDTH  )
  |  |  ------------------
  |  |  |  |  169|  4.93k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.46k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.46k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 1.71k, False: 750]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (attrIsWIDTH(attval) && (nodeIsCOL(node) || nodeIsCOLGROUP(node)))
  ------------------
  |  |  398|  1.71k|#define nodeIsCOL( node )        TagIsId( node, TidyTag_COL )
  |  |  ------------------
  |  |  |  |  275|  3.43k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.71k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.71k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 219, False: 1.49k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (attrIsWIDTH(attval) && (nodeIsCOL(node) || nodeIsCOLGROUP(node)))
  ------------------
  |  |  399|  1.49k|#define nodeIsCOLGROUP( node )   TagIsId( node, TidyTag_COLGROUP )
  |  |  ------------------
  |  |  |  |  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: 199, False: 1.30k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2003|    418|        return;
 2004|       |
 2005|  2.05k|    p = attval->value;
 2006|       |    
 2007|  2.05k|    if (!TY_(IsDigit)(*p++))
  ------------------
  |  |   23|  2.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2007:9): [True: 647, False: 1.40k]
  ------------------
 2008|    647|    {
 2009|    647|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    647|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    647|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2010|    647|    }
 2011|  1.40k|    else
 2012|  1.40k|    {
 2013|  1.40k|        Bool percentFound = no;
 2014|  2.77k|        while (*p)
  ------------------
  |  Branch (2014:16): [True: 1.77k, False: 1.00k]
  ------------------
 2015|  1.77k|        {
 2016|  1.77k|            if (!percentFound && *p == '%')
  ------------------
  |  Branch (2016:17): [True: 1.56k, False: 206]
  |  Branch (2016:34): [True: 206, False: 1.36k]
  ------------------
 2017|    206|            {
 2018|    206|                percentFound = yes;
 2019|    206|            }
 2020|  1.56k|            else if (percentFound || !TY_(IsDigit)(*p))
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2020:22): [True: 206, False: 1.36k]
  |  Branch (2020:38): [True: 195, False: 1.16k]
  ------------------
 2021|    401|            {
 2022|    401|                TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    401|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    401|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2023|    401|                break;
 2024|    401|            }
 2025|       |
 2026|  1.37k|            ++p;
 2027|  1.37k|        }
 2028|  1.40k|    }
 2029|  2.05k|}
attrs.c:CheckClear:
 2057|  1.27k|{
 2058|  1.27k|    ctmbstr const values[] = {"none", "left", "right", "all", NULL};
 2059|       |
 2060|  1.27k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.27k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.27k, False: 0]
  |  |  |  Branch (171:44): [True: 1.07k, False: 197]
  |  |  ------------------
  ------------------
 2061|    197|    {
 2062|    197|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    197|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    197|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2063|    197|        if (attval->value == NULL)
  ------------------
  |  Branch (2063:13): [True: 197, False: 0]
  ------------------
 2064|    197|            attval->value = TY_(tmbstrdup)( doc->allocator, "none" );
  ------------------
  |  |   23|    197|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    197|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2065|    197|        return;
 2066|    197|    }
 2067|       |
 2068|  1.07k|    CheckLowerCaseAttrValue( doc, node, attval );
 2069|       |        
 2070|  1.07k|    if (!AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2070:9): [True: 841, False: 233]
  ------------------
 2071|    841|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    841|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    841|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2072|  1.07k|}
attrs.c:CheckTextDir:
 2210|  1.60k|{
 2211|  1.60k|    ctmbstr const values4[] = { "rtl", "ltr", NULL };
 2212|       |    /* PR #712 - add 'auto' for HTML5 - @doronbehar */
 2213|  1.60k|    ctmbstr const values5[] = { "rtl", "ltr", "auto", NULL };
 2214|  1.60k|    CheckAttrValidity(doc, node, attval,
 2215|  1.60k|        (TY_(IsHTML5Mode)(doc) ? values5 : values4));
  ------------------
  |  |   23|  1.60k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.60k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2215:10): [True: 1.25k, False: 346]
  ------------------
 2216|  1.60k|}
attrs.c:CheckAttrValidity:
 1813|  4.27k|{
 1814|  4.27k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  4.27k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 4.27k, False: 0]
  |  |  |  Branch (171:44): [True: 1.96k, 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.96k|    CheckLowerCaseAttrValue( doc, node, attval );
 1821|       |
 1822|  1.96k|    if (!AttrValueIsAmong(attval, list))
  ------------------
  |  Branch (1822:9): [True: 1.41k, False: 552]
  ------------------
 1823|  1.41k|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  1.41k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.41k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1824|  1.96k|}
attrs.c:CheckLang:
 2220|  36.2k|{
 2221|       |    /* empty xml:lang is allowed through XML 1.0 SE errata */
 2222|  36.2k|    if (!AttrHasValue(attval) && !attrIsXML_LANG(attval))
  ------------------
  |  |  171|  72.5k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 36.2k, False: 0]
  |  |  |  Branch (171:44): [True: 483, False: 35.7k]
  |  |  ------------------
  ------------------
                  if (!AttrHasValue(attval) && !attrIsXML_LANG(attval))
  ------------------
  |  |  341|  35.7k|#define attrIsXML_LANG(av)          AttrIsId( av, TidyAttr_XML_LANG  )
  |  |  ------------------
  |  |  |  |  169|  35.7k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 35.7k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 35.7k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 34.9k, False: 800]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2223|    800|    {
 2224|    800|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|    800|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (2224:14): [True: 800, False: 0]
  ------------------
 2225|    800|        {
 2226|    800|            TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE );
  ------------------
  |  |   23|    800|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    800|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2227|    800|        }
 2228|    800|        return;
 2229|    800|    }
 2230|  36.2k|}
attrs.c:CheckId:
 1854|  68.6k|{
 1855|  68.6k|    Lexer* lexer = doc->lexer;
 1856|  68.6k|    Node *old;
 1857|       |
 1858|  68.6k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  68.6k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 68.6k, False: 0]
  |  |  |  Branch (171:44): [True: 65.9k, False: 2.70k]
  |  |  ------------------
  ------------------
 1859|  2.70k|    {
 1860|  2.70k|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  2.70k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.70k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1861|  2.70k|        return;
 1862|  2.70k|    }
 1863|       |
 1864|  65.9k|    if (!TY_(IsValidHTMLID)(attval->value))
  ------------------
  |  |   23|  65.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  65.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1864:9): [True: 53.0k, False: 12.9k]
  ------------------
 1865|  53.0k|    {
 1866|  53.0k|        if (lexer->isvoyager && TY_(IsValidXMLID)(attval->value))
  ------------------
  |  |   23|  35.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1866:13): [True: 35.2k, False: 17.8k]
  |  Branch (1866:33): [True: 0, False: 35.2k]
  ------------------
 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|  53.0k|        else
 1869|  53.0k|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  53.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  53.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1870|  53.0k|    }
 1871|       |
 1872|  65.9k|    if ((old = GetNodeByAnchor(doc, attval->value)) &&  old != node)
  ------------------
  |  Branch (1872:9): [True: 28.7k, False: 37.2k]
  |  Branch (1872:57): [True: 28.7k, False: 7]
  ------------------
 1873|  28.7k|    {
 1874|  28.7k|        if (node->implicit) /* Is #709 - improve warning text */
  ------------------
  |  Branch (1874:13): [True: 27.5k, False: 1.21k]
  ------------------
 1875|  27.5k|            TY_(ReportAttrError)(doc, node, attval, ANCHOR_DUPLICATED);
  ------------------
  |  |   23|  27.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1876|  1.21k|        else
 1877|  1.21k|            TY_(ReportAttrError)( doc, node, attval, ANCHOR_NOT_UNIQUE);
  ------------------
  |  |   23|  1.21k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.21k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1878|  28.7k|    }
 1879|  37.2k|    else
 1880|  37.2k|        AddAnchor( doc, attval->value, node );
 1881|  65.9k|}
attrs.c:GetNodeByAnchor:
 1228|  70.9k|{
 1229|  70.9k|    TidyAttribImpl* attribs = &doc->attribs;
 1230|  70.9k|    Anchor *found;
 1231|  70.9k|    uint h;
 1232|  70.9k|    tmbstr lname = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|  70.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  70.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1233|  70.9k|    if (TY_(HTMLVersion)(doc) == HT50) {
  ------------------
  |  |   23|  70.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  70.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (TY_(HTMLVersion)(doc) == HT50) {
  ------------------
  |  |  200|  70.9k|#define HT50              131072u
  ------------------
  |  Branch (1233:9): [True: 0, False: 70.9k]
  ------------------
 1234|      0|        h = anchorNameHash5(name);
 1235|      0|    }
 1236|  70.9k|    else
 1237|  70.9k|    {
 1238|  70.9k|        h = anchorNameHash(name);
 1239|  70.9k|        lname = TY_(tmbstrtolower)(lname);
  ------------------
  |  |   23|  70.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  70.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1240|  70.9k|    }
 1241|       |
 1242|  15.5M|    for ( found = attribs->anchor_hash[h]; found != NULL; found = found->next )
  ------------------
  |  Branch (1242:44): [True: 15.4M, False: 37.9k]
  ------------------
 1243|  15.4M|    {
 1244|  15.4M|        if ( TY_(tmbstrcmp)(found->name, lname) == 0 )
  ------------------
  |  |   23|  15.4M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.4M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1244:14): [True: 32.9k, False: 15.4M]
  ------------------
 1245|  32.9k|            break;
 1246|  15.4M|    }
 1247|       |    
 1248|  70.9k|    TidyDocFree(doc, lname);
  ------------------
  |  |  159|  70.9k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  70.9k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1249|  70.9k|    if ( found )
  ------------------
  |  Branch (1249:10): [True: 32.9k, False: 37.9k]
  ------------------
 1250|  32.9k|        return found->node;
 1251|  37.9k|    return NULL;
 1252|  70.9k|}
attrs.c:AddAnchor:
 1200|  38.0k|{
 1201|  38.0k|    TidyAttribImpl* attribs = &doc->attribs;
 1202|  38.0k|    Anchor *a = NewAnchor( doc, name, node );
 1203|  38.0k|    uint h;
 1204|  38.0k|    if (TY_(HTMLVersion)(doc) == HT50)
  ------------------
  |  |   23|  38.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (TY_(HTMLVersion)(doc) == HT50)
  ------------------
  |  |  200|  38.0k|#define HT50              131072u
  ------------------
  |  Branch (1204:9): [True: 0, False: 38.0k]
  ------------------
 1205|      0|        h = anchorNameHash5(name);
 1206|  38.0k|    else
 1207|  38.0k|        h = anchorNameHash(name);
 1208|       |
 1209|  38.0k|    if ( attribs->anchor_hash[h] == NULL)
  ------------------
  |  Branch (1209:10): [True: 2.47k, False: 35.5k]
  ------------------
 1210|  2.47k|         attribs->anchor_hash[h] = a;
 1211|  35.5k|    else
 1212|  35.5k|    {
 1213|  35.5k|        Anchor *here =  attribs->anchor_hash[h];
 1214|  15.4M|        while (here->next)
  ------------------
  |  Branch (1214:16): [True: 15.4M, False: 35.5k]
  ------------------
 1215|  15.4M|            here = here->next;
 1216|  35.5k|        here->next = a;
 1217|  35.5k|    }
 1218|       |
 1219|  38.0k|    return attribs->anchor_hash[h];
 1220|  38.0k|}
attrs.c:NewAnchor:
 1182|  38.0k|{
 1183|  38.0k|    Anchor *a = (Anchor*) TidyDocAlloc( doc, sizeof(Anchor) );
  ------------------
  |  |  157|  38.0k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  38.0k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 1184|       |
 1185|  38.0k|    a->name = TY_(tmbstrdup)( doc->allocator, name );
  ------------------
  |  |   23|  38.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1186|  38.0k|    if (!TY_(IsHTML5Mode)(doc)) /* Is. #726 - if NOT HTML5, to lowercase */
  ------------------
  |  |   23|  38.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1186:9): [True: 246, False: 37.7k]
  ------------------
 1187|    246|        a->name = TY_(tmbstrtolower)(a->name);
  ------------------
  |  |   23|    246|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    246|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1188|  38.0k|    a->node = node;
 1189|  38.0k|    a->next = NULL;
 1190|       |
 1191|  38.0k|    return a;
 1192|  38.0k|}
attrs.c:CheckIs:
 1884|    820|{
 1885|    820|    const char *ptr;
 1886|    820|    Bool go = yes;
 1887|       |
 1888|       |    /* `is` MUST NOT be in an autonomous custom tag */
 1889|    820|    ptr = strchr(node->element, '-');
 1890|    820|    if ( ( ptr && (ptr - node->element > 0) ) )
  ------------------
  |  Branch (1890:12): [True: 0, False: 820]
  |  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|    820|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|    820|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 820, False: 0]
  |  |  |  Branch (171:44): [True: 623, False: 197]
  |  |  ------------------
  ------------------
 1901|    197|    {
 1902|    197|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    197|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    197|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1903|    197|        return;
 1904|    197|    }
 1905|       |
 1906|       |    /* `is` MUST contain a hyphen and no space. */
 1907|    623|    ptr = strchr(attval->value, '-');
 1908|    623|    go = ( ptr && (ptr - attval->value > 0) );
  ------------------
  |  Branch (1908:12): [True: 200, False: 423]
  |  Branch (1908:19): [True: 199, False: 1]
  ------------------
 1909|    623|    ptr = strchr(attval->value, ' ');
 1910|    623|    go = go & (ptr == NULL);
 1911|    623|    if ( !go )
  ------------------
  |  Branch (1911:10): [True: 424, False: 199]
  ------------------
 1912|    424|    {
 1913|    424|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    424|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    424|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1914|    424|    }
 1915|    623|}
attrs.c:CheckFsubmit:
 2051|    394|{
 2052|       |    ctmbstr const values[] = {"get", "post", NULL};
 2053|    394|    CheckAttrValidity( doc, node, attval, values );
 2054|    394|}
attrs.c:CheckName:
 1827|  5.98k|{
 1828|  5.98k|    Node *old;
 1829|       |
 1830|  5.98k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  5.98k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 5.98k, False: 0]
  |  |  |  Branch (171:44): [True: 5.24k, False: 749]
  |  |  ------------------
  ------------------
 1831|    749|    {
 1832|    749|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    749|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    749|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1833|    749|        return;
 1834|    749|    }
 1835|       |
 1836|  5.24k|    if ( TY_(IsAnchorElement)(doc, node) )
  ------------------
  |  |   23|  5.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1836:10): [True: 4.98k, False: 259]
  ------------------
 1837|  4.98k|    {
 1838|  4.98k|        if (cfgBool(doc, TidyXmlOut) && !IsValidNMTOKEN(attval->value))
  ------------------
  |  |  418|  9.96k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  4.98k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 4.98k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1838:41): [True: 3.30k, False: 1.67k]
  ------------------
 1839|  3.30k|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  3.30k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.30k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1840|       |
 1841|  4.98k|        if ((old = GetNodeByAnchor(doc, attval->value)) &&  old != node)
  ------------------
  |  Branch (1841:13): [True: 4.18k, False: 797]
  |  Branch (1841:61): [True: 4.18k, False: 1]
  ------------------
 1842|  4.18k|        {
 1843|  4.18k|            if (node->implicit) /* Is #709 - improve warning text */
  ------------------
  |  Branch (1843:17): [True: 2.52k, False: 1.66k]
  ------------------
 1844|  2.52k|                TY_(ReportAttrError)(doc, node, attval, ANCHOR_DUPLICATED);
  ------------------
  |  |   23|  2.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1845|  1.66k|            else
 1846|  1.66k|                TY_(ReportAttrError)( doc, node, attval, ANCHOR_NOT_UNIQUE);
  ------------------
  |  |   23|  1.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1847|  4.18k|        }
 1848|    798|        else
 1849|    798|            AddAnchor( doc, attval->value, node );
 1850|  4.98k|    }
 1851|  5.24k|}
attrs.c:IsValidNMTOKEN:
 1779|  4.98k|{
 1780|  4.98k|    ctmbstr s = name;
 1781|  4.98k|    tchar c;
 1782|       |
 1783|  4.98k|    if (!s)
  ------------------
  |  Branch (1783:9): [True: 0, False: 4.98k]
  ------------------
 1784|      0|        return no;
 1785|       |
 1786|  26.1k|    while (*s)
  ------------------
  |  Branch (1786:12): [True: 24.5k, False: 1.67k]
  ------------------
 1787|  24.5k|    {
 1788|  24.5k|        c = (unsigned char)*s;
 1789|       |
 1790|  24.5k|        if (c > 0x7F)
  ------------------
  |  Branch (1790:13): [True: 18.1k, False: 6.37k]
  ------------------
 1791|  18.1k|            s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|  18.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1792|       |
 1793|  24.5k|        ++s;
 1794|       |
 1795|  24.5k|        if (!TY_(IsXMLNamechar)(c))
  ------------------
  |  |   23|  24.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1795:13): [True: 3.30k, False: 21.2k]
  ------------------
 1796|  3.30k|            return no;
 1797|  24.5k|    }
 1798|       |
 1799|  1.67k|    return yes;
 1800|  4.98k|}
attrs.c:CheckScope:
 2081|    201|{
 2082|       |    ctmbstr const values[] = {"row", "rowgroup", "col", "colgroup", NULL};
 2083|    201|    CheckAttrValidity( doc, node, attval, values );
 2084|    201|}
attrs.c:CheckScroll:
 2203|    356|{
 2204|       |    ctmbstr const values[] = {"no", "auto", "yes", NULL};
 2205|    356|    CheckAttrValidity( doc, node, attval, values );
 2206|    356|}
attrs.c:CheckShape:
 2075|    213|{
 2076|       |    ctmbstr const values[] = {"rect", "default", "circle", "poly", NULL};
 2077|    213|    CheckAttrValidity( doc, node, attval, values );
 2078|    213|}
attrs.c:CheckTarget:
 2032|  1.50k|{
 2033|  1.50k|    ctmbstr const values[] = {"_blank", "_self", "_parent", "_top", NULL};
 2034|       |
 2035|  1.50k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.50k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.50k, False: 0]
  |  |  |  Branch (171:44): [True: 1.10k, False: 397]
  |  |  ------------------
  ------------------
 2036|    397|    {
 2037|    397|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    397|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    397|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2038|    397|        return;
 2039|    397|    }
 2040|       |
 2041|       |    /* target names must begin with A-Za-z ... */
 2042|  1.10k|    if (TY_(IsLetter)(attval->value[0]))
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2042:9): [True: 209, False: 900]
  ------------------
 2043|    209|        return;
 2044|       |
 2045|       |    /* or be one of the allowed list */
 2046|    900|    if (!AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2046:9): [True: 619, False: 281]
  ------------------
 2047|    619|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    619|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    619|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2048|    900|}
attrs.c:CheckType:
 2241|  3.16k|{
 2242|  3.16k|    ctmbstr const valuesINPUT[] = {
 2243|  3.16k|        "text", "password", "checkbox", "radio", "submit", "reset", "file",
 2244|  3.16k|        "hidden", "image", "button", "color", "date", "datetime",
 2245|  3.16k|        "datetime-local", "email", "month", "number", "range", "search",
 2246|  3.16k|        "tel", "time", "url", "week", NULL};
 2247|  3.16k|    ctmbstr const valuesBUTTON[] = {"button", "submit", "reset", NULL};
 2248|  3.16k|    ctmbstr const valuesUL[] = {"disc", "square", "circle", NULL};
 2249|  3.16k|    ctmbstr const valuesOL[] = {"1", "a", "i", NULL};
 2250|       |
 2251|  3.16k|    if (nodeIsINPUT(node))
  ------------------
  |  |  431|  3.16k|#define nodeIsINPUT( node )      TagIsId( node, TidyTag_INPUT )
  |  |  ------------------
  |  |  |  |  275|  3.16k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.16k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.16k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 237, False: 2.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2252|    237|        CheckAttrValidity( doc, node, attval, valuesINPUT );
 2253|  2.93k|    else if (nodeIsBUTTON(node))
  ------------------
  |  |  453|  2.93k|#define nodeIsBUTTON( node )     TagIsId( node, TidyTag_BUTTON )
  |  |  ------------------
  |  |  |  |  275|  2.93k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.93k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.93k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 272, False: 2.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2254|    272|        CheckAttrValidity( doc, node, attval, valuesBUTTON );
 2255|  2.65k|    else if (nodeIsUL(node))
  ------------------
  |  |  386|  2.65k|#define nodeIsUL( node )         TagIsId( node, TidyTag_UL )
  |  |  ------------------
  |  |  |  |  275|  2.65k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.65k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.65k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 211, False: 2.44k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2256|    211|        CheckAttrValidity( doc, node, attval, valuesUL );
 2257|  2.44k|    else if (nodeIsOL(node))
  ------------------
  |  |  387|  2.44k|#define nodeIsOL( node )         TagIsId( node, TidyTag_OL )
  |  |  ------------------
  |  |  |  |  275|  2.44k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.44k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.44k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 736, False: 1.71k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2258|    736|    {
 2259|    736|        if (!AttrHasValue(attval))
  ------------------
  |  |  171|    736|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 736, False: 0]
  |  |  |  Branch (171:44): [True: 540, 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|    540|        if (!AttrValueIsAmong(attval, valuesOL))
  ------------------
  |  Branch (2264:13): [True: 273, False: 267]
  ------------------
 2265|    273|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    273|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    273|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2266|    540|    }
 2267|  1.71k|    else if (nodeIsLI(node))
  ------------------
  |  |  390|  1.71k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|  1.71k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.71k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.71k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.26k, False: 450]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2268|  1.26k|    {
 2269|  1.26k|        if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.26k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.26k, False: 0]
  |  |  |  Branch (171:44): [True: 1.06k, False: 202]
  |  |  ------------------
  ------------------
 2270|    202|        {
 2271|    202|            TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    202|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    202|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2272|    202|            return;
 2273|    202|        }
 2274|  1.06k|        if (AttrValueIsAmong(attval, valuesUL))
  ------------------
  |  Branch (2274:13): [True: 498, False: 562]
  ------------------
 2275|    498|            CheckLowerCaseAttrValue( doc, node, attval );
 2276|    562|        else if (!AttrValueIsAmong(attval, valuesOL))
  ------------------
  |  Branch (2276:18): [True: 365, False: 197]
  ------------------
 2277|    365|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    365|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    365|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2278|  1.06k|    }
 2279|  2.77k|    return;
 2280|  3.16k|}
attrs.c:CheckValign:
 1959|  2.64k|{
 1960|  2.64k|    ctmbstr const values[] = {"top", "middle", "bottom", "baseline", NULL};
 1961|  2.64k|    ctmbstr const values2[] = {"left", "right", NULL};
 1962|  2.64k|    ctmbstr const valuesp[] = {"texttop", "absmiddle", "absbottom",
 1963|  2.64k|                               "textbottom", NULL};
 1964|       |
 1965|  2.64k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  2.64k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 2.64k, False: 0]
  |  |  |  Branch (171:44): [True: 2.36k, False: 281]
  |  |  ------------------
  ------------------
 1966|    281|    {
 1967|    281|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    281|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    281|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1968|    281|        return;
 1969|    281|    }
 1970|       |
 1971|  2.36k|    CheckLowerCaseAttrValue( doc, node, attval );
 1972|       |
 1973|  2.36k|    if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (1973:9): [True: 330, False: 2.03k]
  ------------------
 1974|    330|    {
 1975|       |            /* all is fine */
 1976|    330|    }
 1977|  2.03k|    else if (AttrValueIsAmong(attval, values2))
  ------------------
  |  Branch (1977:14): [True: 399, False: 1.63k]
  ------------------
 1978|    399|    {
 1979|    399|        if (!(node->tag && (node->tag->model & CM_IMG)))
  ------------------
  |  |  155|    399|#define CM_IMG          (1 << 16)  /**< Elements that use "align" attribute for vertical position. */
  ------------------
  |  Branch (1979:15): [True: 399, False: 0]
  |  Branch (1979:28): [True: 198, False: 201]
  ------------------
 1980|    201|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    201|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    201|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1981|    399|    }
 1982|  1.63k|    else if (AttrValueIsAmong(attval, valuesp))
  ------------------
  |  Branch (1982:14): [True: 413, False: 1.21k]
  ------------------
 1983|    413|    {
 1984|    413|        TY_(ConstrainVersion)( doc, VERS_PROPRIETARY );
  ------------------
  |  |   23|    413|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    413|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(ConstrainVersion)( doc, VERS_PROPRIETARY );
  ------------------
  |  |  231|    413|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|    413|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|    413|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|    413|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
 1985|    413|        TY_(ReportAttrError)( doc, node, attval, PROPRIETARY_ATTR_VALUE);
  ------------------
  |  |   23|    413|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    413|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1986|    413|    }
 1987|  1.21k|    else
 1988|  1.21k|        TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  1.21k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.21k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1989|  2.36k|}
attrs.c:CheckVType:
 2196|    590|{
 2197|       |    ctmbstr const values[] = {"data", "object", "ref", NULL};
 2198|    590|    CheckAttrValidity( doc, node, attval, values );
 2199|    590|}
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|    405|{
 2748|    405|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|    405|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 405, False: 0]
  |  |  |  Branch (171:44): [True: 201, False: 204]
  |  |  ------------------
  ------------------
 2749|    204|    {
 2750|    204|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    204|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    204|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2751|    204|        return;
 2752|    204|    }
 2753|       |
 2754|    405|}
attrs.c:CheckRDFaPrefix:
 2691|  1.67k|{
 2692|  1.67k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  1.67k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 1.67k, False: 0]
  |  |  |  Branch (171:44): [True: 1.47k, False: 207]
  |  |  ------------------
  ------------------
 2693|    207|    {
 2694|    207|        TY_(ReportAttrError)( doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    207|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    207|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2695|    207|        return;
 2696|    207|    }
 2697|       |
 2698|       |    /* Copy the attribute value so we can split it */
 2699|  1.47k|    if (attval->value) {
  ------------------
  |  Branch (2699:9): [True: 1.47k, False: 0]
  ------------------
 2700|  1.47k|        tmbstr t, tPtr ;
 2701|       |
 2702|  1.47k|        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.47k|        uint isPrefix = 1;
 2706|       |
 2707|       |        /* Copy it over */
 2708|       |
 2709|  1.47k|        uint len = TY_(tmbstrlen)(attval->value);
  ------------------
  |  |   23|  1.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2710|  1.47k|        tmbstr s = (tmbstr) TidyDocAlloc( doc, len + 1 );
  ------------------
  |  |  157|  1.47k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  1.47k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 2711|  1.47k|        s[0] = '\0';
 2712|  1.47k|        TY_(tmbstrcpy)( s, attval->value );
  ------------------
  |  |   23|  1.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2713|       |
 2714|       |        /* iterate over value */
 2715|  1.47k|        tPtr = s;
 2716|       |
 2717|  74.9k|        while ( ( t = strtok(tPtr, " ") ) != NULL ) {
  ------------------
  |  Branch (2717:17): [True: 73.5k, False: 1.47k]
  ------------------
 2718|  73.5k|            tPtr = NULL;
 2719|  73.5k|            if (isPrefix) {
  ------------------
  |  Branch (2719:17): [True: 37.1k, False: 36.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|  37.1k|                tmbstr i = strchr(t, ':') ;
 2725|  37.1k|                if (i == NULL) {
  ------------------
  |  Branch (2725:21): [True: 36.1k, False: 914]
  ------------------
 2726|       |                    /* no colon - bad! */
 2727|  36.1k|                    TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|  36.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2728|  36.1k|                } else if (i != ( t + TY_(tmbstrlen)(t) - 1) ) {
  ------------------
  |  |   23|    914|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    914|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2728:28): [True: 194, False: 720]
  ------------------
 2729|       |                    /* not at the end - also bad */
 2730|    194|                    TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2731|    194|                }
 2732|  37.1k|            } else {
 2733|       |                /* this piece should be a URL */
 2734|  36.3k|                prefixCount ++;
 2735|  36.3k|            }
 2736|  73.5k|            isPrefix = !isPrefix;
 2737|  73.5k|        }
 2738|  1.47k|        TidyDocFree( doc, s ) ;
  ------------------
  |  |  159|  1.47k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  1.47k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2739|  1.47k|    }
 2740|  1.47k|}
attrs.c:CheckLoading:
 2234|    199|{
 2235|       |    ctmbstr const values[] = {"lazy", "eager", NULL};
 2236|    199|    CheckAttrValidity( doc, node, attval, values );
 2237|    199|}
attrs.c:CheckSvgAttr:
 2335|  5.21k|{
 2336|  5.21k|    if (!nodeIsSVG(node))
  ------------------
  |  |  460|  5.21k|#define nodeIsSVG( node )        TagIsId( node, TidyTag_SVG )
  |  |  ------------------
  |  |  |  |  275|  5.21k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.21k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.21k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.02k, False: 199]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2337|    199|    {
 2338|    199|        TY_(ReportAttrError)(doc, node, attval, ATTRIBUTE_IS_NOT_ALLOWED);
  ------------------
  |  |   23|    199|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    199|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2339|    199|        return;
 2340|    199|    }
 2341|       |
 2342|       |    /* Issue #903 - check SVG paint attributes */
 2343|  5.02k|    if (IsSvgPaintAttr(attval))
  ------------------
  |  Branch (2343:9): [True: 5.02k, False: 0]
  ------------------
 2344|  5.02k|    {
 2345|       |        /* all valid paint attributes have values */
 2346|  5.02k|        if (!AttrHasValue(attval))
  ------------------
  |  |  171|  5.02k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 5.02k, False: 0]
  |  |  |  Branch (171:44): [True: 4.74k, False: 275]
  |  |  ------------------
  ------------------
 2347|    275|        {
 2348|    275|            TY_(ReportAttrError)(doc, node, attval, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|    275|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    275|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2349|    275|            return;
 2350|    275|        }
 2351|       |        /* all paint attributes support an 'inherit' value,
 2352|       |        per https://dev.w3.org/SVG/profiles/1.1F2/publish/painting.html#SpecifyingPaint */
 2353|  4.74k|        if (AttrValueIs(attval, "inherit"))
  ------------------
  |  |  172|  4.74k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  9.49k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 4.74k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 4.74k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  4.74k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|  4.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  4.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 4.74k]
  |  |  ------------------
  ------------------
 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.74k|        if (attrIsSVG_FILL(attval) || attrIsSVG_STROKE(attval))
  ------------------
  |  |  378|  4.74k|#define attrIsSVG_FILL(av)              AttrIsId( av,  TidyAttr_FILL  )
  |  |  ------------------
  |  |  |  |  169|  9.49k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.74k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.74k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 197, False: 4.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (attrIsSVG_FILL(attval) || attrIsSVG_STROKE(attval))
  ------------------
  |  |  380|  4.54k|#define attrIsSVG_STROKE(av)            AttrIsId( av,  TidyAttr_STROKE  )
  |  |  ------------------
  |  |  |  |  169|  4.54k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.54k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.54k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 400, False: 4.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2362|    597|        {
 2363|       |            /* TODO: support funciri */
 2364|    597|            static ctmbstr const values[] = {
 2365|    597|                "none", "currentColor", NULL};
 2366|       |
 2367|    597|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2367:17): [True: 320, False: 277]
  ------------------
 2368|    320|                CheckLowerCaseAttrValue(doc, node, attval);
 2369|    277|            else
 2370|    277|                CheckColor(doc, node, attval);
 2371|    597|        } 
 2372|  4.14k|        else if (attrIsSVG_FILLRULE(attval))
  ------------------
  |  |  379|  4.14k|#define attrIsSVG_FILLRULE(av)          AttrIsId( av,  TidyAttr_FILLRULE  )
  |  |  ------------------
  |  |  |  |  169|  4.14k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.14k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.14k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 406, False: 3.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2373|    406|        {
 2374|    406|            static ctmbstr const values[] = {"nonzero", "evenodd", NULL};
 2375|       |
 2376|    406|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2376:17): [True: 198, False: 208]
  ------------------
 2377|    198|                CheckLowerCaseAttrValue(doc, node, attval);
 2378|    208|            else
 2379|    208|                TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    208|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    208|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2380|    406|        }
 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: 386, False: 3.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2382|    386|        {
 2383|    386|            static ctmbstr const values[] = {"none", NULL};
 2384|       |
 2385|    386|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2385:17): [True: 80, False: 306]
  ------------------
 2386|     80|                CheckLowerCaseAttrValue(doc, node, attval);
 2387|    306|            else
 2388|    306|            {
 2389|       |                /* TODO: process dash arrays */
 2390|    306|            }
 2391|    386|        }
 2392|  3.35k|        else if (attrIsSVG_STROKEDASHOFFSET(attval))
  ------------------
  |  |  382|  3.35k|#define attrIsSVG_STROKEDASHOFFSET(av)  AttrIsId( av,  TidyAttr_STROKEDASHOFFSET  )
  |  |  ------------------
  |  |  |  |  169|  3.35k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.35k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.35k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 196, False: 3.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2393|    196|        {
 2394|    196|            CheckLength(doc, node, attval);
 2395|    196|        }
 2396|  3.16k|        else if (attrIsSVG_STROKELINECAP(attval))
  ------------------
  |  |  383|  3.16k|#define attrIsSVG_STROKELINECAP(av)     AttrIsId( av,  TidyAttr_STROKELINECAP  )
  |  |  ------------------
  |  |  |  |  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: 551, False: 2.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2397|    551|        {
 2398|    551|            static ctmbstr const values[] = {"butt", "round", "square", NULL};
 2399|       |
 2400|    551|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2400:17): [True: 289, False: 262]
  ------------------
 2401|    289|                CheckLowerCaseAttrValue(doc, node, attval);
 2402|    262|            else
 2403|    262|                TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    262|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    262|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2404|    551|        }
 2405|  2.60k|        else if (attrIsSVG_STROKELINEJOIN(attval))
  ------------------
  |  |  384|  2.60k|#define attrIsSVG_STROKELINEJOIN(av)    AttrIsId( av,  TidyAttr_STROKELINEJOIN  )
  |  |  ------------------
  |  |  |  |  169|  2.60k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.60k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.60k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 618, False: 1.99k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2406|    618|        {
 2407|    618|            static ctmbstr const values[] = {"miter", "round", "bevel", NULL};
 2408|       |
 2409|    618|            if (AttrValueIsAmong(attval, values))
  ------------------
  |  Branch (2409:17): [True: 379, False: 239]
  ------------------
 2410|    379|                CheckLowerCaseAttrValue(doc, node, attval);
 2411|    239|            else
 2412|    239|                TY_(ReportAttrError)(doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    239|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    239|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2413|    618|        }
 2414|  1.99k|        else if (attrIsSVG_STROKEMITERLIMIT(attval))
  ------------------
  |  |  385|  1.99k|#define attrIsSVG_STROKEMITERLIMIT(av)  AttrIsId( av,  TidyAttr_STROKEMITERLIMIT  )
  |  |  ------------------
  |  |  |  |  169|  1.99k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.99k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.99k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 375, False: 1.61k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2415|    375|        {
 2416|    375|            CheckNumber(doc, node, attval);
 2417|    375|        }
 2418|  1.61k|        else if (attrIsSVG_STROKEWIDTH(attval))
  ------------------
  |  |  386|  1.61k|#define attrIsSVG_STROKEWIDTH(av)       AttrIsId( av,  TidyAttr_STROKEWIDTH  )
  |  |  ------------------
  |  |  |  |  169|  1.61k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.61k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.61k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 68, False: 1.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2419|     68|        {
 2420|     68|            CheckLength(doc, node, attval);
 2421|     68|        }
 2422|  1.54k|        else if (attrIsSVG_COLORINTERPOLATION(attval))
  ------------------
  |  |  387|  1.54k|#define attrIsSVG_COLORINTERPOLATION(a) AttrIsId(  a,  TidyAttr_COLORINTERPOLATION  )
  |  |  ------------------
  |  |  |  |  169|  1.54k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.54k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.54k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.54k|        else if (attrIsSVG_COLORRENDERING(attval))
  ------------------
  |  |  388|  1.54k|#define attrIsSVG_COLORRENDERING(av)    AttrIsId( av,  TidyAttr_COLORRENDERING  )
  |  |  ------------------
  |  |  |  |  169|  1.54k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.54k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.54k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.54k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.54k|        else if(attrIsSVG_OPACITY(attval))
  ------------------
  |  |  389|  1.54k|#define attrIsSVG_OPACITY(av)           AttrIsId( av,  TidyAttr_OPACITY  )
  |  |  ------------------
  |  |  |  |  169|  1.54k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.54k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.54k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 827, False: 721]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2442|    827|        {
 2443|    827|            CheckDecimal(doc, node, attval);
 2444|    827|        }
 2445|    721|        else if(attrIsSVG_STROKEOPACITY(attval))
  ------------------
  |  |  390|    721|#define attrIsSVG_STROKEOPACITY(av)     AttrIsId( av,  TidyAttr_STROKEOPACITY  )
  |  |  ------------------
  |  |  |  |  169|    721|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 721, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 721, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 284, False: 437]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2446|    284|        {
 2447|    284|            CheckDecimal(doc, node, attval);
 2448|    284|        }
 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.74k|    }
 2454|  5.02k|}
attrs.c:IsSvgPaintAttr:
 2315|  5.02k|{
 2316|  5.02k|    return attrIsCOLOR(attval)
  ------------------
  |  |  212|  5.02k|#define attrIsCOLOR(av)             AttrIsId( av, TidyAttr_COLOR  )
  |  |  ------------------
  |  |  |  |  169|  10.0k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 5.02k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 5.02k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 5.02k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2317|  5.02k|        || attrIsSVG_FILL(attval)
  ------------------
  |  |  378|  5.02k|#define attrIsSVG_FILL(av)              AttrIsId( av,  TidyAttr_FILL  )
  |  |  ------------------
  |  |  |  |  169|  10.0k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 5.02k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 5.02k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 433, False: 4.58k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2318|  5.02k|        || attrIsSVG_FILLRULE(attval)
  ------------------
  |  |  379|  4.58k|#define attrIsSVG_FILLRULE(av)          AttrIsId( av,  TidyAttr_FILLRULE  )
  |  |  ------------------
  |  |  |  |  169|  9.60k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.58k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.58k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 407, False: 4.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2319|  5.02k|        || attrIsSVG_STROKE(attval)
  ------------------
  |  |  380|  4.18k|#define attrIsSVG_STROKE(av)            AttrIsId( av,  TidyAttr_STROKE  )
  |  |  ------------------
  |  |  |  |  169|  9.20k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 4.18k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 4.18k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 413, False: 3.76k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2320|  5.02k|        || attrIsSVG_STROKEDASHARRAY(attval)
  ------------------
  |  |  381|  3.76k|#define attrIsSVG_STROKEDASHARRAY(av)   AttrIsId( av,  TidyAttr_STROKEDASHARRAY  )
  |  |  ------------------
  |  |  |  |  169|  8.78k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.76k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.76k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 386, False: 3.38k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2321|  5.02k|        || attrIsSVG_STROKEDASHOFFSET(attval)
  ------------------
  |  |  382|  3.38k|#define attrIsSVG_STROKEDASHOFFSET(av)  AttrIsId( av,  TidyAttr_STROKEDASHOFFSET  )
  |  |  ------------------
  |  |  |  |  169|  8.40k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.38k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.38k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 197, False: 3.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2322|  5.02k|        || attrIsSVG_STROKELINECAP(attval)
  ------------------
  |  |  383|  3.18k|#define attrIsSVG_STROKELINECAP(av)     AttrIsId( av,  TidyAttr_STROKELINECAP  )
  |  |  ------------------
  |  |  |  |  169|  8.20k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.18k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 3.18k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 557, False: 2.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2323|  5.02k|        || attrIsSVG_STROKELINEJOIN(attval)
  ------------------
  |  |  384|  2.62k|#define attrIsSVG_STROKELINEJOIN(av)    AttrIsId( av,  TidyAttr_STROKELINEJOIN  )
  |  |  ------------------
  |  |  |  |  169|  7.64k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.62k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.62k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 619, False: 2.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2324|  5.02k|        || attrIsSVG_STROKEMITERLIMIT(attval)
  ------------------
  |  |  385|  2.00k|#define attrIsSVG_STROKEMITERLIMIT(av)  AttrIsId( av,  TidyAttr_STROKEMITERLIMIT  )
  |  |  ------------------
  |  |  |  |  169|  7.02k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.00k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.00k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 375, False: 1.63k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2325|  5.02k|        || attrIsSVG_STROKEWIDTH(attval)
  ------------------
  |  |  386|  1.63k|#define attrIsSVG_STROKEWIDTH(av)       AttrIsId( av,  TidyAttr_STROKEWIDTH  )
  |  |  ------------------
  |  |  |  |  169|  6.65k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.63k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.63k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 68, False: 1.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2326|  5.02k|        || attrIsSVG_COLORINTERPOLATION(attval)
  ------------------
  |  |  387|  1.56k|#define attrIsSVG_COLORINTERPOLATION(a) AttrIsId(  a,  TidyAttr_COLORINTERPOLATION  )
  |  |  ------------------
  |  |  |  |  169|  6.58k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.56k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.56k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2327|  5.02k|        || attrIsSVG_COLORRENDERING(attval)
  ------------------
  |  |  388|  1.56k|#define attrIsSVG_COLORRENDERING(av)    AttrIsId( av,  TidyAttr_COLORRENDERING  )
  |  |  ------------------
  |  |  |  |  169|  6.58k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.56k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.56k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 0, False: 1.56k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2328|  5.02k|        || attrIsSVG_OPACITY(attval)
  ------------------
  |  |  389|  1.56k|#define attrIsSVG_OPACITY(av)           AttrIsId( av,  TidyAttr_OPACITY  )
  |  |  ------------------
  |  |  |  |  169|  6.58k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 1.56k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.56k, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 831, False: 734]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2329|  5.02k|        || attrIsSVG_STROKEOPACITY(attval)
  ------------------
  |  |  390|    734|#define attrIsSVG_STROKEOPACITY(av)     AttrIsId( av,  TidyAttr_STROKEOPACITY  )
  |  |  ------------------
  |  |  |  |  169|  5.75k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 734, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 734, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 284, False: 450]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2330|  5.02k|        || attrIsSVG_FILLOPACITY(attval);
  ------------------
  |  |  391|    450|#define attrIsSVG_FILLOPACITY(av)       AttrIsId( av,  TidyAttr_FILLOPACITY  )
  |  |  ------------------
  |  |  |  |  169|  5.47k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 450, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 450, False: 0]
  |  |  |  |  |  Branch (169:51): [True: 450, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2331|  5.02k|}
attrs.c:CheckDecimal:
 2283|  1.54k|{
 2284|  1.54k|    tmbstr p;
 2285|  1.54k|    Bool hasPoint = no;
 2286|       |
 2287|  1.54k|    p  = attval->value;
 2288|       |
 2289|       |    /* Allow leading sign */
 2290|  1.54k|    if (*p == '+' || *p == '-')
  ------------------
  |  Branch (2290:9): [True: 689, False: 859]
  |  Branch (2290:22): [True: 257, False: 602]
  ------------------
 2291|    946|        ++p;
 2292|       |
 2293|  2.62k|    while (*p)
  ------------------
  |  Branch (2293:12): [True: 2.18k, False: 434]
  ------------------
 2294|  2.18k|    {
 2295|       |        /* Allow a single decimal point */
 2296|  2.18k|        if (*p == '.')
  ------------------
  |  Branch (2296:13): [True: 196, False: 1.99k]
  ------------------
 2297|    196|        {
 2298|    196|            if (!hasPoint)
  ------------------
  |  Branch (2298:17): [True: 196, False: 0]
  ------------------
 2299|    196|                hasPoint = yes;
 2300|      0|            else
 2301|      0|                TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2302|    196|                break;
 2303|    196|        }
 2304|       |        
 2305|  1.99k|        if (!TY_(IsDigit)(*p))
  ------------------
  |  |   23|  1.99k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.99k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2305:13): [True: 918, False: 1.07k]
  ------------------
 2306|    918|        {
 2307|    918|            TY_(ReportAttrError)( doc, node, attval, BAD_ATTRIBUTE_VALUE);
  ------------------
  |  |   23|    918|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    918|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2308|    918|            break;
 2309|    918|        }
 2310|  1.07k|        ++p;
 2311|  1.07k|    }
 2312|  1.54k|}
attrs.c:attrsInstall:
  775|  70.5k|{
  776|  70.5k|    AttrHash *np;
  777|  70.5k|    uint hashval;
  778|       |
  779|  70.5k|    if (old)
  ------------------
  |  Branch (779:9): [True: 70.5k, False: 0]
  ------------------
  780|  70.5k|    {
  781|  70.5k|        np = (AttrHash *)TidyDocAlloc(doc, sizeof(*np));
  ------------------
  |  |  157|  70.5k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  70.5k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  782|  70.5k|        np->attr = old;
  783|       |
  784|  70.5k|        hashval = attrsHash(old->name);
  785|  70.5k|        np->next = attribs->hashtab[hashval];
  786|  70.5k|        attribs->hashtab[hashval] = np;
  787|  70.5k|    }
  788|       |
  789|  70.5k|    return old;
  790|  70.5k|}
attrs.c:CheckAttrType:
 1018|  18.4k|{
 1019|  18.4k|    const Attribute* np = attrsLookup( doc, &doc->attribs, attrname );
 1020|  18.4k|    return (Bool)( np && np->attrchk == type );
  ------------------
  |  Branch (1020:20): [True: 7.90k, False: 10.5k]
  |  Branch (1020:26): [True: 6.36k, False: 1.53k]
  ------------------
 1021|  18.4k|}
attrs.c:anchorNameHash:
 1114|   120k|{
 1115|   120k|    uint hashval = 0;
 1116|       |    /* Issue #149 - an inferred name can be null. avoid crash */
 1117|   120k|    if (s) 
  ------------------
  |  Branch (1117:9): [True: 118k, False: 2.15k]
  ------------------
 1118|   118k|    {
 1119|  3.59M|        for ( ; *s != '\0'; s++) {
  ------------------
  |  Branch (1119:17): [True: 3.47M, False: 118k]
  ------------------
 1120|  3.47M|            tmbchar c = TY_(ToLower)( *s );
  ------------------
  |  |   23|  3.47M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.47M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1121|  3.47M|            hashval = c + 31*hashval;
 1122|  3.47M|        }
 1123|   118k|    }
 1124|   120k|    return hashval % ANCHOR_HASH_SIZE;
 1125|   120k|}
attrs.c:FreeAnchor:
 1107|  48.5k|{
 1108|  48.5k|    if ( a )
  ------------------
  |  Branch (1108:10): [True: 38.0k, False: 10.5k]
  ------------------
 1109|  48.5k|        TidyDocFree( doc, a->name );
  ------------------
  |  |  159|  38.0k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  38.0k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1110|  48.5k|    TidyDocFree( doc, a );
  ------------------
  |  |  159|  48.5k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  48.5k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1111|  48.5k|}
attrs.c:attrsEmptyHash:
  814|  20.6k|{
  815|  20.6k|    AttrHash *dict, *next;
  816|  20.6k|    uint i;
  817|       |
  818|  3.68M|    for (i = 0; i < ATTRIBUTE_HASH_SIZE; ++i)
  ------------------
  |  Branch (818:17): [True: 3.66M, False: 20.6k]
  ------------------
  819|  3.66M|    {
  820|  3.66M|        dict = attribs->hashtab[i];
  821|       |
  822|  3.73M|        while(dict)
  ------------------
  |  Branch (822:15): [True: 70.5k, False: 3.66M]
  ------------------
  823|  70.5k|        {
  824|  70.5k|            next = dict->next;
  825|  70.5k|            TidyDocFree(doc, dict);
  ------------------
  |  |  159|  70.5k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  70.5k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  826|  70.5k|            dict = next;
  827|  70.5k|        }
  828|       |
  829|       |        attribs->hashtab[i] = NULL;
  830|  3.66M|    }
  831|  20.6k|}
attrs.c:FreeDeclaredAttributes:
 1288|  20.6k|{
 1289|  20.6k|    TidyAttribImpl* attribs = &doc->attribs;
 1290|  20.6k|    Attribute* dict;
 1291|  20.6k|    while ( NULL != (dict = attribs->declared_attr_list) )
  ------------------
  |  Branch (1291:13): [True: 0, False: 20.6k]
  ------------------
 1292|      0|    {
 1293|      0|        attribs->declared_attr_list = dict->next;
 1294|      0|        attrsRemoveFromHash( doc, &doc->attribs, dict->name );
 1295|      0|        TidyDocFree( doc, dict->name );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1296|      0|        TidyDocFree( doc, dict );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1297|      0|    }
 1298|  20.6k|}
attrs.c:AttrsHaveSameName:
 1373|  49.2k|{
 1374|  49.2k|    TidyAttrId id1, id2;
 1375|       |
 1376|  49.2k|    id1 = AttrId(av1);
  ------------------
  |  |  168|  49.2k|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 49.2k, False: 0]
  |  |  |  Branch (168:29): [True: 20.2k, False: 28.9k]
  |  |  ------------------
  ------------------
 1377|  49.2k|    id2 = AttrId(av2);
  ------------------
  |  |  168|  49.2k|#define AttrId(av) ((av) && (av)->dict ? (av)->dict->id : TidyAttr_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (168:21): [True: 49.2k, False: 0]
  |  |  |  Branch (168:29): [True: 21.8k, False: 27.4k]
  |  |  ------------------
  ------------------
 1378|  49.2k|    if (id1 != TidyAttr_UNKNOWN && id2 != TidyAttr_UNKNOWN)
  ------------------
  |  Branch (1378:9): [True: 20.2k, False: 28.9k]
  |  Branch (1378:36): [True: 14.5k, False: 5.71k]
  ------------------
 1379|  14.5k|        return AttrsHaveSameId(av1, av2);
  ------------------
  |  |  178|  14.5k|#define AttrsHaveSameId(a, b) (a && b && a->dict && b->dict && a->dict->id && \
  |  |  ------------------
  |  |  |  Branch (178:32): [True: 14.5k, False: 0]
  |  |  |  Branch (178:37): [True: 14.5k, False: 0]
  |  |  |  Branch (178:42): [True: 14.5k, False: 0]
  |  |  |  Branch (178:53): [True: 14.5k, False: 0]
  |  |  |  Branch (178:64): [True: 14.5k, False: 0]
  |  |  ------------------
  |  |  179|  14.5k|                               b->dict->id && a->dict->id == b->dict->id)
  |  |  ------------------
  |  |  |  Branch (179:32): [True: 14.5k, False: 0]
  |  |  |  Branch (179:47): [True: 5.47k, False: 9.08k]
  |  |  ------------------
  ------------------
 1380|  34.6k|    if (id1 != TidyAttr_UNKNOWN || id2 != TidyAttr_UNKNOWN)
  ------------------
  |  Branch (1380:9): [True: 5.71k, False: 28.9k]
  |  Branch (1380:36): [True: 7.26k, False: 21.6k]
  ------------------
 1381|  12.9k|        return no;
 1382|  21.6k|    if (av1->attribute && av2->attribute)
  ------------------
  |  Branch (1382:9): [True: 21.0k, False: 590]
  |  Branch (1382:27): [True: 21.0k, False: 0]
  ------------------
 1383|  21.0k|        return TY_(tmbstrcmp)(av1->attribute, av2->attribute) == 0;
  ------------------
  |  |   23|  21.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1384|    590|     return no;
 1385|  21.6k|}
attrs.c:AppendToStyleAttr:
 1326|  1.25k|{
 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.25k|    uint end = TY_(tmbstrlen)(styleattr->value);
  ------------------
  |  |   23|  1.25k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.25k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1333|       |
 1334|  1.25k|    if (end >0 && styleattr->value[end - 1] == ';')
  ------------------
  |  Branch (1334:9): [True: 1.03k, False: 225]
  |  Branch (1334:19): [True: 199, False: 835]
  ------------------
 1335|    199|    {
 1336|       |        /* attribute ends with declaration separator */
 1337|       |
 1338|    199|        styleattr->value = (tmbstr) TidyDocRealloc(doc, styleattr->value,
  ------------------
  |  |  158|    199|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|    199|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
 1339|    199|            end + TY_(tmbstrlen)(styleprop) + 2);
 1340|       |
 1341|    199|        TY_(tmbstrcat)(styleattr->value, " ");
  ------------------
  |  |   23|    199|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    199|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1342|    199|        TY_(tmbstrcat)(styleattr->value, styleprop);
  ------------------
  |  |   23|    199|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    199|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1343|    199|    }
 1344|  1.06k|    else if (end >0 && styleattr->value[end - 1] == '}')
  ------------------
  |  Branch (1344:14): [True: 835, False: 225]
  |  Branch (1344:24): [True: 269, False: 566]
  ------------------
 1345|    269|    {
 1346|       |        /* attribute ends with rule set */
 1347|       |
 1348|    269|        styleattr->value = (tmbstr) TidyDocRealloc(doc, styleattr->value,
  ------------------
  |  |  158|    269|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|    269|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
 1349|    269|            end + TY_(tmbstrlen)(styleprop) + 6);
 1350|       |
 1351|    269|        TY_(tmbstrcat)(styleattr->value, " { ");
  ------------------
  |  |   23|    269|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    269|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1352|    269|        TY_(tmbstrcat)(styleattr->value, styleprop);
  ------------------
  |  |   23|    269|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    269|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1353|    269|        TY_(tmbstrcat)(styleattr->value, " }");
  ------------------
  |  |   23|    269|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    269|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1354|    269|    }
 1355|    791|    else
 1356|    791|    {
 1357|       |        /* attribute ends with property value */
 1358|       |
 1359|    791|        styleattr->value = (tmbstr) TidyDocRealloc(doc, styleattr->value,
  ------------------
  |  |  158|    791|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|    791|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
 1360|    791|            end + TY_(tmbstrlen)(styleprop) + 3);
 1361|       |
 1362|    791|        if (end > 0)
  ------------------
  |  Branch (1362:13): [True: 566, False: 225]
  ------------------
 1363|    566|            TY_(tmbstrcat)(styleattr->value, "; ");
  ------------------
  |  |   23|    566|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    566|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1364|    791|        TY_(tmbstrcat)(styleattr->value, styleprop);
  ------------------
  |  |   23|    791|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    791|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1365|    791|    }
 1366|  1.25k|}
attrs.c:IsURLCodePoint:
 1572|  4.27M|{
 1573|  4.27M|    uint c;
 1574|  4.27M|    *increment = TY_(GetUTF8)( p, &c ) + 1;
  ------------------
  |  |   23|  4.27M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.27M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1575|       |
 1576|  4.27M|    return ISALNUM( c ) ||
  ------------------
  |  | 1569|  8.55M|#define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1566|  8.55M|#define ISUPPER(a) ((a >= 'A') && (a <= 'Z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1566:21): [True: 2.63M, False: 1.64M]
  |  |  |  |  |  Branch (1566:35): [True: 780k, False: 1.85M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1567|  7.77M|#define ISLOWER(a) ((a >= 'a') && (a <= 'z'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1567:21): [True: 1.74M, False: 1.75M]
  |  |  |  |  |  Branch (1567:35): [True: 48.6k, False: 1.69M]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define ISALNUM(a) (ISUPPER(a) || ISLOWER(a) || ISNUMERIC(a))
  |  |  ------------------
  |  |  |  | 1568|  3.45M|#define ISNUMERIC(a) ((a >= '0') && (a <= '9'))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1568:23): [True: 1.93M, False: 1.51M]
  |  |  |  |  |  Branch (1568:37): [True: 12.2k, False: 1.92M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1577|  3.43M|        c == '%' ||    /* not a valid codepoint, but an escape sequence */
  ------------------
  |  Branch (1577:9): [True: 1.62k, False: 3.43M]
  ------------------
 1578|  3.43M|        c == '#' ||    /* not a valid codepoint, but a delimiter */
  ------------------
  |  Branch (1578:9): [True: 12.6k, False: 3.42M]
  ------------------
 1579|  3.42M|        c == '!' ||
  ------------------
  |  Branch (1579:9): [True: 5.92k, False: 3.41M]
  ------------------
 1580|  3.41M|        c == '$' ||
  ------------------
  |  Branch (1580:9): [True: 340, False: 3.41M]
  ------------------
 1581|  3.41M|        c == '&' ||
  ------------------
  |  Branch (1581:9): [True: 13.2k, False: 3.40M]
  ------------------
 1582|  3.40M|        c == '\'' ||
  ------------------
  |  Branch (1582:9): [True: 793, False: 3.40M]
  ------------------
 1583|  3.40M|        c == '(' ||
  ------------------
  |  Branch (1583:9): [True: 366, False: 3.40M]
  ------------------
 1584|  3.40M|        c == ')' ||
  ------------------
  |  Branch (1584:9): [True: 394, False: 3.40M]
  ------------------
 1585|  3.40M|        c == '*' ||
  ------------------
  |  Branch (1585:9): [True: 256, False: 3.40M]
  ------------------
 1586|  3.40M|        c == '+' ||
  ------------------
  |  Branch (1586:9): [True: 461, False: 3.40M]
  ------------------
 1587|  3.40M|        c == ',' ||
  ------------------
  |  Branch (1587:9): [True: 583, False: 3.40M]
  ------------------
 1588|  3.40M|        c == '-' ||
  ------------------
  |  Branch (1588:9): [True: 876, False: 3.40M]
  ------------------
 1589|  3.40M|        c == '.' ||
  ------------------
  |  Branch (1589:9): [True: 789, False: 3.40M]
  ------------------
 1590|  3.40M|        c == '/' ||
  ------------------
  |  Branch (1590:9): [True: 49.7k, False: 3.35M]
  ------------------
 1591|  3.35M|        c == ':' ||
  ------------------
  |  Branch (1591:9): [True: 1.09k, False: 3.34M]
  ------------------
 1592|  3.34M|        c == ';' ||
  ------------------
  |  Branch (1592:9): [True: 47.0k, False: 3.30M]
  ------------------
 1593|  3.30M|        c == '=' ||
  ------------------
  |  Branch (1593:9): [True: 4.68k, False: 3.29M]
  ------------------
 1594|  3.29M|        c == '?' ||
  ------------------
  |  Branch (1594:9): [True: 969, False: 3.29M]
  ------------------
 1595|  3.29M|        c == '@' ||
  ------------------
  |  Branch (1595:9): [True: 46.5k, False: 3.25M]
  ------------------
 1596|  3.25M|        c == '_' ||
  ------------------
  |  Branch (1596:9): [True: 46.7k, False: 3.20M]
  ------------------
 1597|  3.20M|        c == '~' ||
  ------------------
  |  Branch (1597:9): [True: 506, False: 3.20M]
  ------------------
 1598|  3.20M|        (c >= 0x00A0 && c <= 0xD7FF) ||
  ------------------
  |  Branch (1598:10): [True: 1.69M, False: 1.50M]
  |  Branch (1598:25): [True: 2.94k, False: 1.69M]
  ------------------
 1599|  3.20M|        (c >= 0xE000 && c <= 0xFDCF) ||
  ------------------
  |  Branch (1599:10): [True: 1.69M, False: 1.50M]
  |  Branch (1599:25): [True: 346, False: 1.69M]
  ------------------
 1600|  3.19M|        (c >= 0xFDF0 && c <= 0xFFEF) ||
  ------------------
  |  Branch (1600:10): [True: 1.69M, False: 1.50M]
  |  Branch (1600:25): [True: 224, False: 1.69M]
  ------------------
 1601|  3.19M|        (c >= 0x10000 && c <= 0x1FFFD) ||
  ------------------
  |  Branch (1601:10): [True: 6.57k, False: 3.19M]
  |  Branch (1601:26): [True: 272, False: 6.30k]
  ------------------
 1602|  3.19M|        (c >= 0x20000 && c <= 0x2FFFD) ||
  ------------------
  |  Branch (1602:10): [True: 6.30k, False: 3.19M]
  |  Branch (1602:26): [True: 217, False: 6.08k]
  ------------------
 1603|  3.19M|        (c >= 0x30000 && c <= 0x3FFFD) ||
  ------------------
  |  Branch (1603:10): [True: 6.08k, False: 3.19M]
  |  Branch (1603:26): [True: 328, False: 5.75k]
  ------------------
 1604|  3.19M|        (c >= 0x40000 && c <= 0x4FFFD) ||
  ------------------
  |  Branch (1604:10): [True: 5.75k, False: 3.19M]
  |  Branch (1604:26): [True: 347, False: 5.40k]
  ------------------
 1605|  3.19M|        (c >= 0x50000 && c <= 0x5FFFD) ||
  ------------------
  |  Branch (1605:10): [True: 5.40k, False: 3.19M]
  |  Branch (1605:26): [True: 244, False: 5.16k]
  ------------------
 1606|  3.19M|        (c >= 0x60000 && c <= 0x6FFFD) ||
  ------------------
  |  Branch (1606:10): [True: 5.16k, False: 3.19M]
  |  Branch (1606:26): [True: 203, False: 4.96k]
  ------------------
 1607|  3.19M|        (c >= 0x70000 && c <= 0x7FFFD) ||
  ------------------
  |  Branch (1607:10): [True: 4.95k, False: 3.19M]
  |  Branch (1607:26): [True: 240, False: 4.71k]
  ------------------
 1608|  3.19M|        (c >= 0x80000 && c <= 0x8FFFD) ||
  ------------------
  |  Branch (1608:10): [True: 4.71k, False: 3.19M]
  |  Branch (1608:26): [True: 80, False: 4.63k]
  ------------------
 1609|  3.19M|        (c >= 0x90000 && c <= 0x9FFFD) ||
  ------------------
  |  Branch (1609:10): [True: 4.63k, False: 3.19M]
  |  Branch (1609:26): [True: 1.42k, False: 3.21k]
  ------------------
 1610|  3.19M|        (c >= 0xA0000 && c <= 0xAFFFD) ||
  ------------------
  |  Branch (1610:10): [True: 3.21k, False: 3.19M]
  |  Branch (1610:26): [True: 481, False: 2.73k]
  ------------------
 1611|  3.19M|        (c >= 0xB0000 && c <= 0xBFFFD) ||
  ------------------
  |  Branch (1611:10): [True: 2.73k, False: 3.19M]
  |  Branch (1611:26): [True: 344, False: 2.38k]
  ------------------
 1612|  3.19M|        (c >= 0xC0000 && c <= 0xCFFFD) ||
  ------------------
  |  Branch (1612:10): [True: 2.38k, False: 3.19M]
  |  Branch (1612:26): [True: 245, False: 2.14k]
  ------------------
 1613|  3.19M|        (c >= 0xD0000 && c <= 0xDFFFD) ||
  ------------------
  |  Branch (1613:10): [True: 2.14k, False: 3.19M]
  |  Branch (1613:26): [True: 269, False: 1.87k]
  ------------------
 1614|  3.19M|        (c >= 0xE0000 && c <= 0xEFFFD) ||
  ------------------
  |  Branch (1614:10): [True: 1.87k, False: 3.19M]
  |  Branch (1614:26): [True: 796, False: 1.07k]
  ------------------
 1615|  3.19M|        (c >= 0xF0000 && c <= 0xFFFFD) ||
  ------------------
  |  Branch (1615:10): [True: 1.07k, False: 3.19M]
  |  Branch (1615:26): [True: 538, False: 535]
  ------------------
 1616|  3.19M|        (c >= 0x100000 && c <= 0x10FFFD);
  ------------------
  |  Branch (1616:10): [True: 528, False: 3.19M]
  |  Branch (1616:27): [True: 476, False: 52]
  ------------------
 1617|  4.27M|}
attrs.c:CheckScript:
 1729|  3.42k|{
 1730|  3.42k|}
attrs.c:CheckBool:
 1918|  2.27k|{
 1919|  2.27k|    if (!AttrHasValue(attval))
  ------------------
  |  |  171|  2.27k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 2.27k, False: 0]
  |  |  |  Branch (171:44): [True: 1.21k, False: 1.06k]
  |  |  ------------------
  ------------------
 1920|  1.06k|        return;
 1921|       |
 1922|  1.21k|    CheckLowerCaseAttrValue( doc, node, attval );
 1923|  1.21k|}
attrs.c:SortAttVal:
 2592|  2.71M|{
 2593|       |    /* Get the list from the passed-in tidyDoc. */
 2594|  2.71M|    ctmbstr* priorityList = (ctmbstr*)doc->attribs.priorityAttribs.list;
 2595|       |
 2596|  2.71M|    ptAttValComparator ptComparator = GetAttValComparator(strat, priorityList);
 2597|  2.71M|    AttVal *p, *q, *e, *tail;
 2598|  2.71M|    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.71M|    if (!list)
  ------------------
  |  Branch (2604:9): [True: 2.44M, False: 269k]
  ------------------
 2605|  2.44M|        return NULL;
 2606|       |
 2607|       |    /* If no comparator, return the list as-is */
 2608|   269k|    if (ptComparator == 0)
  ------------------
  |  Branch (2608:9): [True: 269k, False: 0]
  ------------------
 2609|   269k|        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.71M|{
 2577|  2.71M|    switch (strat)
  ------------------
  |  Branch (2577:13): [True: 2.71M, False: 0]
  ------------------
 2578|  2.71M|    {
 2579|      0|    case TidySortAttrAlpha:
  ------------------
  |  Branch (2579:5): [True: 0, False: 2.71M]
  ------------------
 2580|      0|        return AlphaComparator;
 2581|  2.71M|    case TidySortAttrNone:
  ------------------
  |  Branch (2581:5): [True: 2.71M, False: 0]
  ------------------
 2582|  2.71M|        if ( list && list[0] )
  ------------------
  |  Branch (2582:14): [True: 0, False: 2.71M]
  |  Branch (2582:22): [True: 0, False: 0]
  ------------------
 2583|      0|            return PriorityComparator;
 2584|  2.71M|        break;
 2585|  2.71M|    }
 2586|  2.71M|    return 0;
 2587|  2.71M|}

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

prvTidyFreeStyles:
  267|  20.6k|{
  268|  20.6k|    Lexer* lexer = doc->lexer;
  269|  20.6k|    if ( lexer )
  ------------------
  |  Branch (269:10): [True: 20.6k, False: 0]
  ------------------
  270|  20.6k|    {
  271|  20.6k|        TagStyle *style, *next;
  272|  20.6k|        for ( style = lexer->styles; style; style = next )
  ------------------
  |  Branch (272:38): [True: 0, False: 20.6k]
  ------------------
  273|      0|        {
  274|      0|            next = style->next;
  275|      0|            TidyDocFree( doc, style->tag );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  276|      0|            TidyDocFree( doc, style->tag_class );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  277|      0|            TidyDocFree( doc, style->properties );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  278|      0|            TidyDocFree( doc, style );
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  279|      0|        }
  280|  20.6k|    }
  281|  20.6k|}
prvTidyFixNodeLinks:
  559|  2.07k|{
  560|  2.07k|    Node *child;
  561|       |
  562|  2.07k|    if (node->prev)
  ------------------
  |  Branch (562:9): [True: 614, False: 1.46k]
  ------------------
  563|    614|        node->prev->next = node;
  564|  1.46k|    else
  565|  1.46k|        node->parent->content = node;
  566|       |
  567|  2.07k|    if (node->next)
  ------------------
  |  Branch (567:9): [True: 223, False: 1.85k]
  ------------------
  568|    223|        node->next->prev = node;
  569|  1.85k|    else
  570|  1.85k|        node->parent->last = node;
  571|       |
  572|  3.75k|    for (child = node->content; child; child = child->next)
  ------------------
  |  Branch (572:33): [True: 1.67k, False: 2.07k]
  ------------------
  573|  1.67k|        child->parent = node;
  574|  2.07k|}
prvTidyAddStyleProperty:
  661|  43.4k|{
  662|  43.4k|    AttVal *av = TY_(AttrGetById)(node, TidyAttr_STYLE);
  ------------------
  |  |   23|  43.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  43.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  663|       |
  664|       |    /* if style attribute already exists then insert property */
  665|       |
  666|  43.4k|    if ( av )
  ------------------
  |  Branch (666:10): [True: 1.26k, False: 42.1k]
  ------------------
  667|  1.26k|    {
  668|  1.26k|        if (av->value != NULL)
  ------------------
  |  Branch (668:13): [True: 1.22k, False: 39]
  ------------------
  669|  1.22k|        {
  670|  1.22k|            tmbstr s = MergeProperties( doc, av->value, property );
  671|  1.22k|            TidyDocFree( doc, av->value );
  ------------------
  |  |  159|  1.22k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  1.22k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  672|  1.22k|            av->value = s;
  673|  1.22k|        }
  674|     39|        else
  675|     39|        {
  676|     39|            av->value = TY_(tmbstrdup)( doc->allocator, property );
  ------------------
  |  |   23|     39|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     39|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  677|     39|        }
  678|  1.26k|    }
  679|  42.1k|    else /* else create new style attribute */
  680|  42.1k|    {
  681|  42.1k|        av = TY_(NewAttributeEx)( doc, "style", property, '"' );
  ------------------
  |  |   23|  42.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  682|  42.1k|        TY_(InsertAttributeAtStart)( node, av );
  ------------------
  |  |   23|  42.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  683|  42.1k|    }
  684|  43.4k|}
prvTidyNestedEmphasis:
 1507|  2.15M|{
 1508|  2.15M|    Node *next;
 1509|       |
 1510|  4.91M|    while (node)
  ------------------
  |  Branch (1510:12): [True: 2.75M, False: 2.15M]
  ------------------
 1511|  2.75M|    {
 1512|  2.75M|        next = node->next;
 1513|       |
 1514|  2.75M|        if ( (nodeIsB(node) || nodeIsI(node))
  ------------------
  |  |  403|  2.75M|#define nodeIsB( node )          TagIsId( node, TidyTag_B )
  |  |  ------------------
  |  |  |  |  275|  5.51M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.75M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.27M, False: 485k]
  |  |  |  |  |  Branch (275:54): [True: 51.2k, False: 2.22M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( (nodeIsB(node) || nodeIsI(node))
  ------------------
  |  |  404|  2.70M|#define nodeIsI( node )          TagIsId( node, TidyTag_I )
  |  |  ------------------
  |  |  |  |  275|  2.70M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.70M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.22M, False: 485k]
  |  |  |  |  |  Branch (275:54): [True: 15.6k, False: 2.20M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1515|  66.9k|             && node->parent && node->parent->tag == node->tag)
  ------------------
  |  Branch (1515:17): [True: 66.9k, False: 0]
  |  Branch (1515:33): [True: 2.49k, False: 64.4k]
  ------------------
 1516|  2.49k|        {
 1517|       |            /* strip redundant inner element */
 1518|  2.49k|            DiscardContainer( doc, node, &next );
 1519|  2.49k|            node = next;
 1520|  2.49k|            continue;
 1521|  2.49k|        }
 1522|       |
 1523|  2.75M|        if ( node->content )
  ------------------
  |  Branch (1523:14): [True: 2.13M, False: 621k]
  ------------------
 1524|  2.13M|            TY_(NestedEmphasis)( doc, node->content );
  ------------------
  |  |   23|  2.13M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.13M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1525|       |
 1526|  2.75M|        node = next;
 1527|  2.75M|    }
 1528|  2.15M|}
prvTidyList2BQ:
 1562|  2.15M|{
 1563|  4.91M|    while (node)
  ------------------
  |  Branch (1563:12): [True: 2.75M, False: 2.15M]
  ------------------
 1564|  2.75M|    {
 1565|  2.75M|        if (node->content)
  ------------------
  |  Branch (1565:13): [True: 2.13M, False: 621k]
  ------------------
 1566|  2.13M|            TY_(List2BQ)( doc, node->content );
  ------------------
  |  |   23|  2.13M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.13M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1567|       |
 1568|  2.75M|        if ( node->tag && node->tag->parser == TY_(ParseList) &&
  ------------------
  |  |   23|  2.27M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.27M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1568:14): [True: 2.27M, False: 485k]
  |  Branch (1568:27): [True: 50.8k, False: 2.21M]
  ------------------
 1569|  50.8k|             HasOneChild(node) && node->content->implicit )
  ------------------
  |  Branch (1569:14): [True: 46.0k, False: 4.81k]
  |  Branch (1569:35): [True: 38.5k, False: 7.51k]
  ------------------
 1570|  38.5k|        {
 1571|  38.5k|            StripOnlyChild( doc, node );
 1572|  38.5k|            RenameElem( doc, node, TidyTag_BLOCKQUOTE );
 1573|  38.5k|            node->implicit = yes;
 1574|  38.5k|        }
 1575|       |
 1576|  2.75M|        node = node->next;
 1577|  2.75M|    }
 1578|  2.15M|}
prvTidyBQ2Div:
 1587|  20.6k|{
 1588|  20.6k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1589|  20.6k|    Node *next;
 1590|       |    
 1591|  20.6k|    tmbchar indent_buf[ 32 ];
 1592|  20.6k|    uint indent;
 1593|       |
 1594|  2.70M|    while (node)
  ------------------
  |  Branch (1594:12): [True: 2.68M, False: 20.6k]
  ------------------
 1595|  2.68M|    {
 1596|  2.68M|        next = node->next;
 1597|       |        
 1598|  2.68M|        if ( nodeIsBLOCKQUOTE(node) && node->implicit )
  ------------------
  |  |  426|  2.68M|#define nodeIsBLOCKQUOTE( node ) TagIsId( node, TidyTag_BLOCKQUOTE )
  |  |  ------------------
  |  |  |  |  275|  5.36M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.68M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.19M, False: 485k]
  |  |  |  |  |  Branch (275:54): [True: 4.94k, False: 2.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1598:40): [True: 4.71k, False: 229]
  ------------------
 1599|  4.71k|        {
 1600|  4.71k|            indent = 1;
 1601|       |
 1602|  37.8k|            while( HasOneChild(node) &&
  ------------------
  |  Branch (1602:20): [True: 33.7k, False: 4.12k]
  ------------------
 1603|  37.8k|                   nodeIsBLOCKQUOTE(node->content) &&
  ------------------
  |  |  426|  33.7k|#define nodeIsBLOCKQUOTE( node ) TagIsId( node, TidyTag_BLOCKQUOTE )
  |  |  ------------------
  |  |  |  |  275|  71.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 33.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 33.3k, False: 353]
  |  |  |  |  |  Branch (275:54): [True: 33.1k, False: 244]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1604|  33.1k|                   node->implicit)
  ------------------
  |  Branch (1604:20): [True: 33.1k, False: 0]
  ------------------
 1605|  33.1k|            {
 1606|  33.1k|                ++indent;
 1607|  33.1k|                StripOnlyChild( doc, node );
 1608|  33.1k|            }
 1609|       |
 1610|  4.71k|            TY_(tmbsnprintf)(indent_buf, sizeof(indent_buf), "margin-left: %dem",
  ------------------
  |  |   23|  4.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1611|  4.71k|                             2*indent);
 1612|       |
 1613|  4.71k|            RenameElem( doc, node, TidyTag_DIV );
 1614|  4.71k|            TY_(AddStyleProperty)(doc, node, indent_buf );
  ------------------
  |  |   23|  4.71k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.71k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1615|       |
 1616|  4.71k|            if (node->content)
  ------------------
  |  Branch (1616:17): [True: 4.70k, False: 10]
  ------------------
 1617|  4.70k|            {
 1618|  4.70k|                TY_(push)(stack, next);
  ------------------
  |  |   23|  4.70k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.70k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1619|  4.70k|                node = node->content;
 1620|  4.70k|                continue;
 1621|  4.70k|            }
 1622|  4.71k|        }
 1623|  2.67M|        else if (node->content)
  ------------------
  |  Branch (1623:18): [True: 2.05M, False: 621k]
  ------------------
 1624|  2.05M|        {
 1625|  2.05M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.05M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.05M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1626|  2.05M|            node = node->content;
 1627|  2.05M|            continue;
 1628|  2.05M|        }
 1629|       |
 1630|   621k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   152k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   152k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1630:16): [True: 468k, False: 152k]
  ------------------
 1631|   621k|    }
 1632|  20.6k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1633|  20.6k|}
prvTidyNormalizeSpaces:
 1811|  14.3k|{
 1812|  44.1k|    while ( node )
  ------------------
  |  Branch (1812:13): [True: 29.7k, False: 14.3k]
  ------------------
 1813|  29.7k|    {
 1814|  29.7k|        if ( node->content )
  ------------------
  |  Branch (1814:14): [True: 8.60k, False: 21.1k]
  ------------------
 1815|  8.60k|            TY_(NormalizeSpaces)( lexer, node->content );
  ------------------
  |  |   23|  8.60k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.60k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1816|       |
 1817|  29.7k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  29.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1817:13): [True: 13.7k, False: 16.0k]
  ------------------
 1818|  13.7k|        {
 1819|  13.7k|            uint i, c;
 1820|  13.7k|            tmbstr p = lexer->lexbuf + node->start;
 1821|       |
 1822|  8.00M|            for (i = node->start; i < node->end; ++i)
  ------------------
  |  Branch (1822:35): [True: 7.98M, False: 13.7k]
  ------------------
 1823|  7.98M|            {
 1824|  7.98M|                c = (byte) lexer->lexbuf[i];
 1825|       |
 1826|       |                /* look for UTF-8 multibyte character */
 1827|  7.98M|                if ( c > 0x7F )
  ------------------
  |  Branch (1827:22): [True: 42.2k, False: 7.94M]
  ------------------
 1828|  42.2k|                    i += TY_(GetUTF8)( lexer->lexbuf + i, &c );
  ------------------
  |  |   23|  42.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1829|       |
 1830|  7.98M|                if ( c == 160 )
  ------------------
  |  Branch (1830:22): [True: 3.04k, False: 7.98M]
  ------------------
 1831|  3.04k|                    c = ' ';
 1832|       |
 1833|  7.98M|                p = TY_(PutUTF8)(p, c);
  ------------------
  |  |   23|  7.98M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.98M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1834|  7.98M|            }
 1835|  13.7k|            node->end = p - lexer->lexbuf;
 1836|  13.7k|        }
 1837|       |
 1838|  29.7k|        node = node->next;
 1839|  29.7k|    }
 1840|  14.3k|}
prvTidyBumpObject:
 2138|  60.4k|{
 2139|  60.4k|    Node *node, *next, *head = NULL, *body = NULL;
 2140|       |
 2141|  60.4k|    if (!html)
  ------------------
  |  Branch (2141:9): [True: 426, False: 60.0k]
  ------------------
 2142|    426|        return;
 2143|       |
 2144|   385k|    for ( node = html->content; node != NULL; node = node->next )
  ------------------
  |  Branch (2144:33): [True: 325k, False: 60.0k]
  ------------------
 2145|   325k|    {
 2146|   325k|        if ( nodeIsHEAD(node) )
  ------------------
  |  |  371|   325k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|   325k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 325k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 318k, False: 6.95k]
  |  |  |  |  |  Branch (275:54): [True: 44.6k, False: 273k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2147|  44.6k|            head = node;
 2148|       |
 2149|   325k|        if ( nodeIsBODY(node) )
  ------------------
  |  |  375|   325k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   325k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 325k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 318k, False: 6.95k]
  |  |  |  |  |  Branch (275:54): [True: 132k, False: 185k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2150|   132k|            body = node;
 2151|   325k|    }
 2152|       |
 2153|  60.0k|    if ( head != NULL && body != NULL )
  ------------------
  |  Branch (2153:10): [True: 44.6k, False: 15.3k]
  |  Branch (2153:26): [True: 44.6k, False: 0]
  ------------------
 2154|  44.6k|    {
 2155|  53.4k|        for (node = head->content; node != NULL; node = next)
  ------------------
  |  Branch (2155:36): [True: 8.80k, False: 44.6k]
  ------------------
 2156|  8.80k|        {
 2157|  8.80k|            next = node->next;
 2158|       |
 2159|  8.80k|            if ( nodeIsOBJECT(node) )
  ------------------
  |  |  428|  8.80k|#define nodeIsOBJECT( node )     TagIsId( node, TidyTag_OBJECT )
  |  |  ------------------
  |  |  |  |  275|  8.80k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.80k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 7.68k, False: 1.11k]
  |  |  |  |  |  Branch (275:54): [True: 1.68k, False: 6.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2160|  1.68k|            {
 2161|  1.68k|                Node *child;
 2162|  1.68k|                Bool bump = no;
 2163|       |
 2164|  2.42k|                for (child = node->content; child != NULL; child = child->next)
  ------------------
  |  Branch (2164:45): [True: 1.74k, False: 678]
  ------------------
 2165|  1.74k|                {
 2166|       |                    /* bump to body unless content is param */
 2167|  1.74k|                    if ( (TY_(nodeIsText)(child) && !TY_(IsBlank)(doc->lexer, node))
  ------------------
  |  |   23|  1.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( (TY_(nodeIsText)(child) && !TY_(IsBlank)(doc->lexer, node))
  ------------------
  |  |   23|    469|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    469|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2167:27): [True: 469, False: 1.27k]
  |  Branch (2167:53): [True: 469, False: 0]
  ------------------
 2168|  1.27k|                         || !nodeIsPARAM(child) )
  ------------------
  |  |  409|  1.27k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|  1.27k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.27k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.04k, False: 232]
  |  |  |  |  |  Branch (275:54): [True: 736, False: 305]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2169|  1.00k|                    {
 2170|  1.00k|                            bump = yes;
 2171|  1.00k|                            break;
 2172|  1.00k|                    }
 2173|  1.74k|                }
 2174|       |
 2175|  1.68k|                if ( bump )
  ------------------
  |  Branch (2175:22): [True: 1.00k, False: 678]
  ------------------
 2176|  1.00k|                {
 2177|  1.00k|                    TY_(RemoveNode)( node );
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2178|  1.00k|                    TY_(InsertNodeAtStart)( body, node );
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2179|  1.00k|                }
 2180|  1.68k|            }
 2181|  8.80k|        }
 2182|  44.6k|    }
 2183|  60.0k|}
prvTidyTidyMetaCharset:
 2194|  20.6k|{
 2195|  20.6k|    AttVal *charsetAttr;
 2196|  20.6k|    AttVal *contentAttr;
 2197|  20.6k|    AttVal *httpEquivAttr;
 2198|  20.6k|    Bool charsetFound = no;
 2199|  20.6k|    uint outenc = cfg(doc, TidyOutCharEncoding);
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 2200|  20.6k|    ctmbstr enc = TY_(GetEncodingNameFromTidyId)(outenc);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2201|  20.6k|    Node *currentNode;
 2202|  20.6k|    Node *head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2203|  20.6k|    Node *metaTag;
 2204|  20.6k|    Node *prevNode;
 2205|  20.6k|    TidyBuffer buf;
 2206|  20.6k|    TidyBuffer charsetString;
 2207|       |    /* tmbstr httpEquivAttrValue; */
 2208|       |    /* tmbstr lcontent; */
 2209|  20.6k|    tmbstr newValue;
 2210|  20.6k|    Bool add_meta = cfgBool(doc, TidyMetaCharset);
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2211|       |
 2212|       |    /* We can't do anything we don't have a head or encoding is NULL */
 2213|  20.6k|    if (!head || !enc || !TY_(tmbstrlen)(enc))
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2213:9): [True: 0, False: 20.6k]
  |  Branch (2213:18): [True: 0, False: 20.6k]
  |  Branch (2213:26): [True: 0, False: 20.6k]
  ------------------
 2214|      0|        return no;
 2215|  20.6k|    if (outenc == RAW)
  ------------------
  |  |  133|  20.6k|#define RAW         0
  ------------------
  |  Branch (2215:9): [True: 0, False: 20.6k]
  ------------------
 2216|      0|        return no;
 2217|  20.6k|#ifndef NO_NATIVE_ISO2022_SUPPORT
 2218|  20.6k|    if (outenc == ISO2022)
  ------------------
  |  |  138|  20.6k|#define ISO2022     5
  ------------------
  |  Branch (2218:9): [True: 0, False: 20.6k]
  ------------------
 2219|      0|        return no;
 2220|  20.6k|#endif
 2221|  20.6k|    if (cfgAutoBool(doc, TidyBodyOnly) == TidyYesState)
  ------------------
  |  |  421|  20.6k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2221:9): [True: 0, False: 20.6k]
  ------------------
 2222|      0|        return no; /* nothing to do here if showing body only */
 2223|       |
 2224|  20.6k|    tidyBufInit(&charsetString);
 2225|       |    /* Set up the content test 'charset=value' */
 2226|  20.6k|    tidyBufClear(&charsetString);
 2227|  20.6k|    tidyBufAppend(&charsetString, "charset=", 8);
 2228|  20.6k|    tidyBufAppend(&charsetString, (char*)enc, TY_(tmbstrlen)(enc));
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2229|  20.6k|    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|  51.1k|    for (currentNode = head->content; currentNode; 
  ------------------
  |  Branch (2232:39): [True: 30.5k, False: 20.6k]
  ------------------
 2233|  30.5k|        currentNode = (currentNode ? currentNode->next : NULL))
  ------------------
  |  Branch (2233:24): [True: 30.5k, False: 0]
  ------------------
 2234|  30.5k|    {
 2235|  30.5k|        if (!nodeIsMETA(currentNode))
  ------------------
  |  |  374|  30.5k|#define nodeIsMETA( node )       TagIsId( node, TidyTag_META )
  |  |  ------------------
  |  |  |  |  275|  30.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 30.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 29.4k, False: 1.10k]
  |  |  |  |  |  Branch (275:54): [True: 252, False: 29.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2236|  30.2k|            continue;   /* not a meta node */
 2237|    252|        charsetAttr = attrGetCHARSET(currentNode);
  ------------------
  |  |  415|    252|#define attrGetCHARSET( nod )     TY_(AttrGetById)( nod, TidyAttr_CHARSET  )
  |  |  ------------------
  |  |  |  |   23|    252|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    252|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2238|    252|        httpEquivAttr = attrGetHTTP_EQUIV(currentNode);
  ------------------
  |  |  419|    252|#define attrGetHTTP_EQUIV( nod )  TY_(AttrGetById)( nod, TidyAttr_HTTP_EQUIV  )
  |  |  ------------------
  |  |  |  |   23|    252|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    252|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2239|    252|        if (!charsetAttr && !httpEquivAttr)
  ------------------
  |  Branch (2239:13): [True: 252, False: 0]
  |  Branch (2239:29): [True: 252, False: 0]
  ------------------
 2240|    252|            continue;   /* has no charset attribute */
 2241|       |                        /*
 2242|       |                        Meta charset comes in quite a few flavors:
 2243|       |                        1. <meta charset="value"> - expected for (X)HTML5.
 2244|       |                        */
 2245|      0|        if (charsetAttr && !httpEquivAttr)
  ------------------
  |  Branch (2245:13): [True: 0, False: 0]
  |  Branch (2245:28): [True: 0, False: 0]
  ------------------
 2246|      0|        {
 2247|       |            /* we already found one, so remove the rest. */
 2248|      0|            if (charsetFound || !charsetAttr->value)
  ------------------
  |  Branch (2248:17): [True: 0, False: 0]
  |  Branch (2248:33): [True: 0, False: 0]
  ------------------
 2249|      0|            {
 2250|      0|                prevNode = currentNode->prev;
 2251|      0|                TY_(Report)(doc, head, currentNode, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2252|      0|                TY_(DiscardElement)(doc, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2253|      0|                currentNode = prevNode;
 2254|      0|                continue;
 2255|      0|            }
 2256|      0|            charsetFound = yes;
 2257|       |            /* Fix mismatched attribute value */
 2258|      0|            if (TY_(tmbstrcasecmp)(charsetAttr->value, enc) != 0)
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2258:17): [True: 0, False: 0]
  ------------------
 2259|      0|            {
 2260|      0|                newValue = (tmbstr)TidyDocAlloc(doc, TY_(tmbstrlen)(enc) + 1);   /* allocate + 1 for 0 */
  ------------------
  |  |  157|      0|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|      0|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 2261|      0|                TY_(tmbstrcpy)(newValue, enc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2262|       |                /* Note: previously http-equiv had been modified, without warning
 2263|       |                in void TY_(VerifyHTTPEquiv)(TidyDocImpl* doc, Node *head)
 2264|       |                */
 2265|      0|                TY_(ReportAttrError)(doc, currentNode, charsetAttr, ATTRIBUTE_VALUE_REPLACED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2266|      0|                TidyDocFree(doc, charsetAttr->value);   /* free current value */
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2267|      0|                charsetAttr->value = newValue;
 2268|      0|            }
 2269|       |            /* Make sure it's the first element. */
 2270|      0|            if (currentNode != head->content->next) {
  ------------------
  |  Branch (2270:17): [True: 0, False: 0]
  ------------------
 2271|      0|                TY_(RemoveNode)(currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2272|      0|                TY_(InsertNodeAtStart)(head, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2273|      0|            }
 2274|      0|            continue;
 2275|      0|        }
 2276|       |        /*
 2277|       |        2. <meta http-equiv="content-type" content="text/html; charset=UTF-8">
 2278|       |        expected for HTML4. This is normally ok - but can clash.
 2279|       |        */
 2280|      0|        if (httpEquivAttr && !charsetAttr)
  ------------------
  |  Branch (2280:13): [True: 0, False: 0]
  |  Branch (2280:30): [True: 0, False: 0]
  ------------------
 2281|      0|        {
 2282|      0|            contentAttr = TY_(AttrGetById)(currentNode, TidyAttr_CONTENT);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2283|      0|            if (!contentAttr)
  ------------------
  |  Branch (2283:17): [True: 0, False: 0]
  ------------------
 2284|      0|                continue;   /* has no 'content' attribute */
 2285|      0|            if (!httpEquivAttr->value)
  ------------------
  |  Branch (2285:17): [True: 0, False: 0]
  ------------------
 2286|      0|            {
 2287|      0|                prevNode = currentNode->prev;
 2288|      0|                TY_(Report)(doc, head, currentNode, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2289|      0|                TY_(DiscardElement)(doc, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2290|      0|                currentNode = prevNode;
 2291|      0|                continue;
 2292|      0|            }
 2293|       |            /* httpEquivAttrValue = TY_(tmbstrtolower)(httpEquivAttr->value); */
 2294|      0|            if (TY_(tmbstrcasecmp)(httpEquivAttr->value, (tmbstr) "content-type") != 0)
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2294:17): [True: 0, False: 0]
  ------------------
 2295|      0|                continue;   /* is not 'content-type' */
 2296|      0|            if (!contentAttr->value)
  ------------------
  |  Branch (2296:17): [True: 0, False: 0]
  ------------------
 2297|      0|            {
 2298|      0|                continue; /* has no 'content' attribute has NO VALUE! */
 2299|      0|            }
 2300|       |            /* check encoding matches
 2301|       |            If a miss-match found here, fix it. previous silently done
 2302|       |            in void TY_(VerifyHTTPEquiv)(TidyDocImpl* doc, Node *head)
 2303|       |            lcontent = TY_(tmbstrtolower)(contentAttr->value);
 2304|       |            */
 2305|      0|            if (TY_(tmbstrcasecmp)(contentAttr->value, (ctmbstr)charsetString.bp) == 0)
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2305:17): [True: 0, False: 0]
  ------------------
 2306|      0|            {
 2307|       |                /* we already found one, so remove the rest. */
 2308|      0|                if (charsetFound)
  ------------------
  |  Branch (2308:21): [True: 0, False: 0]
  ------------------
 2309|      0|                {
 2310|      0|                    prevNode = currentNode->prev;
 2311|      0|                    TY_(Report)(doc, head, currentNode, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2312|      0|                    TY_(DiscardElement)(doc, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2313|      0|                    currentNode = prevNode;
 2314|      0|                    continue;
 2315|      0|                }
 2316|      0|                charsetFound = yes;
 2317|      0|            }
 2318|      0|            else
 2319|      0|            {
 2320|       |                /* fix a mismatch */
 2321|      0|                if (charsetFound)
  ------------------
  |  Branch (2321:21): [True: 0, False: 0]
  ------------------
 2322|      0|                {
 2323|      0|                    prevNode = currentNode->prev;
 2324|      0|                    TY_(Report)(doc, head, currentNode, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2325|      0|                    TY_(DiscardElement)(doc, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2326|      0|                    currentNode = prevNode;
 2327|      0|                }
 2328|      0|                else
 2329|      0|                {
 2330|       |                    /* correct the content */
 2331|      0|                    newValue = (tmbstr)TidyDocAlloc(doc, 19 + TY_(tmbstrlen)(enc) + 1);
  ------------------
  |  |  157|      0|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|      0|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 2332|      0|                    TY_(tmbstrcpy)(newValue, "text/html; charset=");
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2333|      0|                    TY_(tmbstrcpy)(newValue + 19, enc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2334|      0|                    if (cfgBool(doc, TidyShowMetaChange))   /* Issue #456 - backward compatibility only */
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2335|      0|                        TY_(ReportAttrError)(doc, currentNode, contentAttr, ATTRIBUTE_VALUE_REPLACED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2336|      0|                    TidyDocFree(doc, contentAttr->value);
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2337|      0|                    contentAttr->value = newValue;
 2338|      0|                    charsetFound = yes;
 2339|      0|                }
 2340|      0|            }
 2341|      0|            continue;
 2342|      0|        }
 2343|       |        /*
 2344|       |        3. <meta charset="utf-8" http-equiv="Content-Type" content="...">
 2345|       |        This is generally bad. Discard and warn.
 2346|       |        */
 2347|      0|        if (httpEquivAttr && charsetAttr)
  ------------------
  |  Branch (2347:13): [True: 0, False: 0]
  |  Branch (2347:30): [True: 0, False: 0]
  ------------------
 2348|      0|        {
 2349|       |            /* printf("WARN ABOUT HTTP EQUIV AND CHARSET ATTR! \n"); */
 2350|      0|            prevNode = currentNode->prev;
 2351|      0|            TY_(Report)(doc, head, currentNode, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2352|      0|            TY_(DiscardElement)(doc, currentNode);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2353|      0|            currentNode = prevNode;
 2354|      0|        }
 2355|      0|    }
 2356|       |
 2357|       |    /* completed head scan - add appropriate meta - if 'yes' and none exists */
 2358|  20.6k|    if (add_meta && !charsetFound)
  ------------------
  |  Branch (2358:9): [True: 0, False: 20.6k]
  |  Branch (2358:21): [True: 0, False: 0]
  ------------------
 2359|      0|    {
 2360|       |        /* add appropriate meta charset tag - no warning */
 2361|      0|        metaTag = TY_(InferredTag)(doc, TidyTag_META);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2362|      0|        switch (TY_(HTMLVersion)(doc))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2363|      0|        {
 2364|      0|        case HT50:
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
  |  Branch (2364:9): [True: 0, False: 0]
  ------------------
 2365|      0|        case XH50:
  ------------------
  |  |  201|      0|#define XH50              262144u
  ------------------
  |  Branch (2365:9): [True: 0, False: 0]
  ------------------
 2366|      0|            TY_(AddAttribute)(doc, metaTag, "charset", enc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2367|      0|            break;
 2368|      0|        default:
  ------------------
  |  Branch (2368:9): [True: 0, False: 0]
  ------------------
 2369|      0|            tidyBufInit(&buf);
 2370|      0|            tidyBufAppend(&buf, "text/html; ", 11);
 2371|      0|            tidyBufAppend(&buf, charsetString.bp, TY_(tmbstrlen)((ctmbstr)charsetString.bp));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2372|      0|            tidyBufAppend(&buf, "\0", 1);   /* zero terminate the buffer */
 2373|      0|            TY_(AddAttribute)(doc, metaTag, "http-equiv", "Content-Type"); /* add 'http-equiv' const. */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2374|      0|            TY_(AddAttribute)(doc, metaTag, "content", (char*)buf.bp);  /* add 'content="<enc>"' */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2375|      0|            tidyBufFree(&buf);
 2376|      0|        }
 2377|      0|        TY_(InsertNodeAtStart)(head, metaTag);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2378|      0|        TY_(Report)(doc, metaTag, head, ADDED_MISSING_CHARSET); /* actually just 'Info:' */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2379|      0|    }
 2380|  20.6k|    tidyBufFree(&charsetString);
 2381|  20.6k|    return yes;
 2382|  20.6k|}
prvTidyReplacePreformattedSpaces:
 2547|  2.06M|{
 2548|  2.06M|    Node* next;
 2549|       |
 2550|  4.75M|    while (node)
  ------------------
  |  Branch (2550:12): [True: 2.68M, False: 2.06M]
  ------------------
 2551|  2.68M|    {
 2552|  2.68M|        next = node->next;
 2553|       |
 2554|  2.68M|        if (node->tag && node->tag->parser == TY_(ParsePre))
  ------------------
  |  |   23|  2.20M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.20M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2554:13): [True: 2.20M, False: 488k]
  |  Branch (2554:26): [True: 5.73k, False: 2.19M]
  ------------------
 2555|  5.73k|        {
 2556|  5.73k|            TY_(NormalizeSpaces)(doc->lexer, node->content);
  ------------------
  |  |   23|  5.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2557|  5.73k|            node = next;
 2558|  5.73k|            continue;
 2559|  5.73k|        }
 2560|       |
 2561|  2.68M|        if (node->content)
  ------------------
  |  Branch (2561:13): [True: 2.04M, False: 634k]
  ------------------
 2562|  2.04M|            TY_(ReplacePreformattedSpaces)(doc, node->content);
  ------------------
  |  |   23|  2.04M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.04M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2563|       |
 2564|  2.68M|        node = next;
 2565|  2.68M|    }
 2566|  2.06M|}
prvTidyFixLanguageInformation:
 2594|  20.6k|{
 2595|  20.6k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2596|  20.6k|    Node* next;
 2597|       |
 2598|  2.72M|    while (node)
  ------------------
  |  Branch (2598:12): [True: 2.70M, False: 20.6k]
  ------------------
 2599|  2.70M|    {
 2600|  2.70M|        next = node->next;
 2601|       |
 2602|       |        /* todo: report modifications made here to the report system */
 2603|       |
 2604|  2.70M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  2.70M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.70M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2604:13): [True: 2.20M, False: 498k]
  ------------------
 2605|  2.20M|        {
 2606|  2.20M|            AttVal* lang = TY_(AttrGetById)(node, TidyAttr_LANG);
  ------------------
  |  |   23|  2.20M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.20M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2607|  2.20M|            AttVal* xmlLang = TY_(AttrGetById)(node, TidyAttr_XML_LANG);
  ------------------
  |  |   23|  2.20M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.20M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2608|       |
 2609|  2.20M|            if (lang && xmlLang)
  ------------------
  |  Branch (2609:17): [True: 735, False: 2.20M]
  |  Branch (2609:25): [True: 199, False: 536]
  ------------------
 2610|    199|            {
 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|    199|            }
 2618|  2.20M|            else if (lang && wantXmlLang)
  ------------------
  |  Branch (2618:22): [True: 536, False: 2.20M]
  |  Branch (2618:30): [True: 536, False: 0]
  ------------------
 2619|    536|            {
 2620|    536|                if (TY_(NodeAttributeVersions)( node, TidyAttr_XML_LANG )
  ------------------
  |  |   23|    536|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    536|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2620:21): [True: 307, False: 229]
  ------------------
 2621|    536|                    & doc->lexer->versionEmitted)
 2622|    307|                    TY_(RepairAttrValue)(doc, node, "xml:lang", lang->value);
  ------------------
  |  |   23|    307|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    307|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2623|    536|            }
 2624|  2.20M|            else if (xmlLang && wantLang)
  ------------------
  |  Branch (2624:22): [True: 34.1k, False: 2.16M]
  |  Branch (2624:33): [True: 34.1k, False: 0]
  ------------------
 2625|  34.1k|            {
 2626|  34.1k|                if (TY_(NodeAttributeVersions)( node, TidyAttr_LANG )
  ------------------
  |  |   23|  34.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2626:21): [True: 32.1k, False: 2.00k]
  ------------------
 2627|  34.1k|                    & doc->lexer->versionEmitted)
 2628|  32.1k|                    TY_(RepairAttrValue)(doc, node, "lang", xmlLang->value);
  ------------------
  |  |   23|  32.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2629|  34.1k|            }
 2630|       |
 2631|  2.20M|            if (lang && !wantLang)
  ------------------
  |  Branch (2631:17): [True: 735, False: 2.20M]
  |  Branch (2631:25): [True: 0, False: 735]
  ------------------
 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.20M|            if (xmlLang && !wantXmlLang)
  ------------------
  |  Branch (2634:17): [True: 34.3k, False: 2.16M]
  |  Branch (2634:28): [True: 0, False: 34.3k]
  ------------------
 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.20M|        }
 2637|       |
 2638|  2.70M|        if (node->content)
  ------------------
  |  Branch (2638:13): [True: 2.06M, False: 639k]
  ------------------
 2639|  2.06M|        {
 2640|  2.06M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.06M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.06M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2641|  2.06M|            node = node->content;
 2642|  2.06M|            continue;
 2643|  2.06M|        }
 2644|       |
 2645|   639k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   152k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   152k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2645:16): [True: 487k, False: 152k]
  ------------------
 2646|   639k|    }
 2647|  20.6k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2648|  20.6k|}
prvTidyFixXhtmlNamespace:
 2654|  20.6k|{
 2655|  20.6k|    Node* html = TY_(FindHTML)(doc);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2656|  20.6k|    AttVal* xmlns;
 2657|       |
 2658|  20.6k|    if (!html)
  ------------------
  |  Branch (2658:9): [True: 0, False: 20.6k]
  ------------------
 2659|      0|        return;
 2660|       |
 2661|  20.6k|    xmlns = TY_(AttrGetById)(html, TidyAttr_XMLNS);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2662|       |
 2663|  20.6k|    if (wantXmlns)
  ------------------
  |  Branch (2663:9): [True: 20.6k, False: 0]
  ------------------
 2664|  20.6k|    {
 2665|  20.6k|        if (!AttrValueIs(xmlns, XHTML_NAMESPACE))
  ------------------
  |  |  172|  20.6k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  41.2k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 0, False: 20.6k]
  |  |  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  20.6k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 2666|  20.6k|            TY_(RepairAttrValue)(doc, html, "xmlns", XHTML_NAMESPACE);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, html, "xmlns", XHTML_NAMESPACE);
  ------------------
  |  |   80|  20.6k|#define XHTML_NAMESPACE "http://www.w3.org/1999/xhtml"
  ------------------
 2667|  20.6k|    }
 2668|      0|    else if (xmlns)
  ------------------
  |  Branch (2668:14): [True: 0, False: 0]
  ------------------
 2669|      0|    {
 2670|      0|        TY_(RemoveAttribute)(doc, html, xmlns);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2671|      0|    }
 2672|  20.6k|}
prvTidyFixAnchors:
 2678|  20.6k|{
 2679|  20.6k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2680|  20.6k|    Node* next;
 2681|       |
 2682|  2.72M|    while (node)
  ------------------
  |  Branch (2682:12): [True: 2.70M, False: 20.6k]
  ------------------
 2683|  2.70M|    {
 2684|  2.70M|        next = node->next;
 2685|       |
 2686|  2.70M|        if (TY_(IsAnchorElement)(doc, node))
  ------------------
  |  |   23|  2.70M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.70M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2686:13): [True: 92.7k, False: 2.60M]
  ------------------
 2687|  92.7k|        {
 2688|  92.7k|            AttVal *name = TY_(AttrGetById)(node, TidyAttr_NAME);
  ------------------
  |  |   23|  92.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  92.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2689|  92.7k|            AttVal *id = TY_(AttrGetById)(node, TidyAttr_ID);
  ------------------
  |  |   23|  92.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  92.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2690|  92.7k|            Bool hadName = name!=NULL;
 2691|  92.7k|            Bool hadId = id!=NULL;
 2692|  92.7k|            Bool IdEmitted = no;
 2693|  92.7k|            Bool NameEmitted = no;
 2694|       |
 2695|       |            /* todo: how are empty name/id attributes handled? */
 2696|       |
 2697|  92.7k|            if (name && id)
  ------------------
  |  Branch (2697:17): [True: 5.46k, False: 87.2k]
  |  Branch (2697:25): [True: 568, False: 4.89k]
  ------------------
 2698|    568|            {
 2699|    568|                Bool NameHasValue = AttrHasValue(name);
  ------------------
  |  |  171|    568|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 568, False: 0]
  |  |  |  Branch (171:44): [True: 296, False: 272]
  |  |  ------------------
  ------------------
 2700|    568|                Bool IdHasValue = AttrHasValue(id);
  ------------------
  |  |  171|    568|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 568, False: 0]
  |  |  |  Branch (171:44): [True: 223, False: 345]
  |  |  ------------------
  ------------------
 2701|    568|                if ( (NameHasValue != IdHasValue) ||
  ------------------
  |  Branch (2701:22): [True: 211, False: 357]
  ------------------
 2702|    357|                     (NameHasValue && IdHasValue &&
  ------------------
  |  Branch (2702:23): [True: 154, False: 203]
  |  Branch (2702:39): [True: 154, False: 0]
  ------------------
 2703|    154|                     TY_(tmbstrcmp)(name->value, id->value) != 0 ) )
  ------------------
  |  |   23|    154|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    154|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2703:22): [True: 72, False: 82]
  ------------------
 2704|    283|                    TY_(ReportAttrError)( doc, node, name, ID_NAME_MISMATCH);
  ------------------
  |  |   23|    283|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    283|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2705|    568|            }
 2706|  92.1k|            else if (name && wantId)
  ------------------
  |  Branch (2706:22): [True: 4.89k, False: 87.2k]
  |  Branch (2706:30): [True: 4.89k, False: 0]
  ------------------
 2707|  4.89k|            {
 2708|  4.89k|                if (TY_(NodeAttributeVersions)( node, TidyAttr_ID )
  ------------------
  |  |   23|  4.89k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.89k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2708:21): [True: 4.40k, False: 494]
  ------------------
 2709|  4.89k|                    & doc->lexer->versionEmitted)
 2710|  4.40k|                {
 2711|  4.40k|                    if (TY_(IsValidHTMLID)(name->value))
  ------------------
  |  |   23|  4.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2711:25): [True: 3.92k, False: 484]
  ------------------
 2712|  3.92k|                    {
 2713|  3.92k|                        TY_(RepairAttrValue)(doc, node, "id", name->value);
  ------------------
  |  |   23|  3.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2714|  3.92k|                        IdEmitted = yes;
 2715|  3.92k|                    }
 2716|    484|                    else
 2717|    484|                        TY_(ReportAttrError)(doc, node, name, INVALID_XML_ID);
  ------------------
  |  |   23|    484|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    484|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2718|  4.40k|                 }
 2719|  4.89k|            }
 2720|  87.2k|            else if (id && wantName)
  ------------------
  |  Branch (2720:22): [True: 1.41k, False: 85.8k]
  |  Branch (2720:28): [True: 1.41k, False: 0]
  ------------------
 2721|  1.41k|            {
 2722|  1.41k|                if (TY_(NodeAttributeVersions)( node, TidyAttr_NAME )
  ------------------
  |  |   23|  1.41k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.41k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2722:21): [True: 339, False: 1.07k]
  ------------------
 2723|  1.41k|                    & doc->lexer->versionEmitted)
 2724|    339|                {
 2725|       |                    /* todo: do not assume id is valid */
 2726|    339|                    TY_(RepairAttrValue)(doc, node, "name", id->value);
  ------------------
  |  |   23|    339|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    339|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2727|    339|                    NameEmitted = yes;
 2728|    339|                }
 2729|  1.41k|            }
 2730|       |
 2731|  92.7k|            if (id && !wantId
  ------------------
  |  Branch (2731:17): [True: 1.98k, False: 90.7k]
  |  Branch (2731:23): [True: 0, False: 1.98k]
  ------------------
 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|  92.7k|            if (name && !wantName
  ------------------
  |  Branch (2739:17): [True: 5.46k, False: 87.2k]
  |  Branch (2739:25): [True: 0, False: 5.46k]
  ------------------
 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|  92.7k|        }
 2747|       |
 2748|  2.70M|        if (node->content)
  ------------------
  |  Branch (2748:13): [True: 2.06M, False: 639k]
  ------------------
 2749|  2.06M|        {
 2750|  2.06M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.06M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.06M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2751|  2.06M|            node = node->content;
 2752|  2.06M|            continue;
 2753|  2.06M|        }
 2754|       |
 2755|   639k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   152k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   152k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2755:16): [True: 487k, False: 152k]
  ------------------
 2756|   639k|    }
 2757|  20.6k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2758|  20.6k|}
prvTidyCleanStyle:
 2806|  20.6k|{
 2807|  20.6k|    Node *head = NULL, *body = NULL;
 2808|  20.6k|    Bool fix = cfgBool(doc, TidyStyleTags);
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2809|       |
 2810|  20.6k|    if (!html)
  ------------------
  |  Branch (2810:9): [True: 0, False: 20.6k]
  ------------------
 2811|      0|        return; /* oops, not given a start node */
 2812|       |
 2813|  20.6k|    head = TY_(FindHEAD)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2814|  20.6k|    body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2815|       |
 2816|  20.6k|    if ((head != NULL) && (body != NULL))
  ------------------
  |  Branch (2816:9): [True: 20.6k, False: 0]
  |  Branch (2816:27): [True: 20.3k, False: 234]
  ------------------
 2817|  20.3k|    {
 2818|  20.3k|		StyleToHead(doc, head, body, fix, 0); /* found head and body */
 2819|  20.3k|    }
 2820|  20.6k|}
prvTidyCleanHead:
 2830|  20.6k|{
 2831|  20.6k|    Node *head, *node, *next;
 2832|  20.6k|    uint titles = 0;
 2833|  20.6k|    if (cfgAutoBool(doc, TidyBodyOnly) == TidyYesState)
  ------------------
  |  |  421|  20.6k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2833:9): [True: 0, False: 20.6k]
  ------------------
 2834|      0|        return; /* not going to show head, so forget it */
 2835|  20.6k|    head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2836|  20.6k|    if (!head)
  ------------------
  |  Branch (2836:9): [True: 0, False: 20.6k]
  ------------------
 2837|      0|        return;
 2838|  20.6k|    node = head->content;
 2839|  71.7k|    while (node)
  ------------------
  |  Branch (2839:12): [True: 51.1k, False: 20.6k]
  ------------------
 2840|  51.1k|    {
 2841|  51.1k|        next = node->next;  /* get any 'next' */
 2842|  51.1k|        if (nodeIsTITLE(node))
  ------------------
  |  |  372|  51.1k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  51.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 51.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 50.0k, False: 1.10k]
  |  |  |  |  |  Branch (275:54): [True: 23.8k, False: 26.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2843|  23.8k|        {
 2844|  23.8k|            titles++;
 2845|  23.8k|            if (titles > 1)
  ------------------
  |  Branch (2845:17): [True: 3.24k, False: 20.6k]
  ------------------
 2846|  3.24k|            {
 2847|  3.24k|                TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  3.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2848|  3.24k|                TY_(DiscardElement)(doc, node); /* delete this node */
  ------------------
  |  |   23|  3.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2849|  3.24k|            }
 2850|  23.8k|        }
 2851|  51.1k|        node = next;
 2852|  51.1k|    }
 2853|  20.6k|}
clean.c:MergeProperties:
  645|  1.22k|{
  646|  1.22k|    tmbstr s;
  647|  1.22k|    StyleProp *prop;
  648|       |
  649|       |    prop = CreateProps(doc, NULL, s1);
  650|  1.22k|    prop = CreateProps(doc, prop, s2);
  651|  1.22k|    s = CreatePropString(doc, prop);
  652|  1.22k|    FreeStyleProps(doc, prop);
  653|  1.22k|    return s;
  654|  1.22k|}
clean.c:CreateProps:
  140|  2.44k|{
  141|  2.44k|    tmbstr name, value = NULL, name_end, value_end, line;
  142|  2.44k|    Bool more;
  143|       |
  144|  2.44k|    line = TY_(tmbstrdup)(doc->allocator, style);
  ------------------
  |  |   23|  2.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  145|  2.44k|    name = line;
  146|       |
  147|  4.47k|    while (*name)
  ------------------
  |  Branch (147:12): [True: 3.84k, False: 623]
  ------------------
  148|  3.84k|    {
  149|  4.06k|        while (*name == ' ')
  ------------------
  |  Branch (149:16): [True: 214, False: 3.84k]
  ------------------
  150|    214|            ++name;
  151|       |
  152|  3.84k|        name_end = name;
  153|       |
  154|  33.0k|        while (*name_end)
  ------------------
  |  Branch (154:16): [True: 32.7k, False: 306]
  ------------------
  155|  32.7k|        {
  156|  32.7k|            if (*name_end == ':')
  ------------------
  |  Branch (156:17): [True: 3.54k, False: 29.2k]
  ------------------
  157|  3.54k|            {
  158|  3.54k|                value = name_end + 1;
  159|  3.54k|                break;
  160|  3.54k|            }
  161|       |
  162|  29.2k|            ++name_end;
  163|  29.2k|        }
  164|       |
  165|  3.84k|        if (*name_end != ':')
  ------------------
  |  Branch (165:13): [True: 306, False: 3.54k]
  ------------------
  166|    306|            break;
  167|       |
  168|  4.76k|        while ( value && *value == ' ')
  ------------------
  |  Branch (168:17): [True: 4.76k, False: 0]
  |  Branch (168:26): [True: 1.22k, False: 3.54k]
  ------------------
  169|  1.22k|            ++value;
  170|       |
  171|  3.54k|        value_end = value;
  172|  3.54k|        more = no;
  173|       |
  174|  30.9k|        while (*value_end)
  ------------------
  |  Branch (174:16): [True: 29.4k, False: 1.51k]
  ------------------
  175|  29.4k|        {
  176|  29.4k|            if (*value_end == ';')
  ------------------
  |  Branch (176:17): [True: 2.02k, False: 27.4k]
  ------------------
  177|  2.02k|            {
  178|  2.02k|                more = yes;
  179|  2.02k|                break;
  180|  2.02k|            }
  181|       |
  182|  27.4k|            ++value_end;
  183|  27.4k|        }
  184|       |
  185|  3.54k|        *name_end = '\0';
  186|  3.54k|        *value_end = '\0';
  187|       |
  188|  3.54k|        prop = InsertProperty(doc, prop, name, value);
  189|  3.54k|        *name_end = ':';
  190|       |
  191|  3.54k|        if (more)
  ------------------
  |  Branch (191:13): [True: 2.02k, False: 1.51k]
  ------------------
  192|  2.02k|        {
  193|  2.02k|            *value_end = ';';
  194|  2.02k|            name = value_end + 1;
  195|  2.02k|            continue;
  196|  2.02k|        }
  197|       |
  198|  1.51k|        break;
  199|  3.54k|    }
  200|       |
  201|  2.44k|    TidyDocFree(doc, line);  /* free temporary copy */
  ------------------
  |  |  159|  2.44k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  2.44k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  202|  2.44k|    return prop;
  203|  2.44k|}
clean.c:InsertProperty:
   81|  3.54k|{
   82|  3.54k|    StyleProp *first, *prev, *prop;
   83|  3.54k|    int cmp;
   84|       |
   85|  3.54k|    prev = NULL;
   86|  3.54k|    first = props;
   87|       |
   88|  5.24k|    while (props)
  ------------------
  |  Branch (88:12): [True: 3.73k, False: 1.51k]
  ------------------
   89|  3.73k|    {
   90|  3.73k|        cmp = TY_(tmbstrcmp)(props->name, name);
  ------------------
  |  |   23|  3.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   91|       |
   92|  3.73k|        if (cmp == 0)
  ------------------
  |  Branch (92:13): [True: 1.14k, False: 2.58k]
  ------------------
   93|  1.14k|        {
   94|       |            /* this property is already defined, ignore new value */
   95|  1.14k|            return first;
   96|  1.14k|        }
   97|       |
   98|  2.58k|        if (cmp > 0)
  ------------------
  |  Branch (98:13): [True: 887, False: 1.70k]
  ------------------
   99|    887|        {
  100|       |            /* insert before this */
  101|       |
  102|    887|            prop = (StyleProp *)TidyDocAlloc(doc, sizeof(StyleProp));
  ------------------
  |  |  157|    887|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|    887|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  103|    887|            prop->name = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|    887|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    887|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  104|    887|            prop->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|    887|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    887|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  105|    887|            prop->next = props;
  106|       |
  107|    887|            if (prev)
  ------------------
  |  Branch (107:17): [True: 168, False: 719]
  ------------------
  108|    168|                prev->next = prop;
  109|    719|            else
  110|    719|                first = prop;
  111|       |
  112|    887|            return first;
  113|    887|        }
  114|       |
  115|  1.70k|        prev = props;
  116|  1.70k|        props = props->next;
  117|  1.70k|    }
  118|       |
  119|  1.51k|    prop = (StyleProp *)TidyDocAlloc(doc, sizeof(StyleProp));
  ------------------
  |  |  157|  1.51k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  1.51k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  120|  1.51k|    prop->name = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|  1.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  121|  1.51k|    prop->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|  1.51k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.51k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  122|  1.51k|    prop->next = NULL;
  123|       |
  124|  1.51k|    if (prev)
  ------------------
  |  Branch (124:9): [True: 292, False: 1.22k]
  ------------------
  125|    292|        prev->next = prop;
  126|  1.22k|    else
  127|  1.22k|        first = prop;
  128|       |
  129|  1.51k|    return first;
  130|  3.54k|}
clean.c:CreatePropString:
  206|  1.22k|{
  207|  1.22k|    tmbstr style, p, s;
  208|  1.22k|    uint len;
  209|  1.22k|    StyleProp *prop;
  210|       |
  211|       |    /* compute length */
  212|       |
  213|  3.62k|    for (len = 0, prop = props; prop; prop = prop->next)
  ------------------
  |  Branch (213:33): [True: 2.40k, False: 1.22k]
  ------------------
  214|  2.40k|    {
  215|  2.40k|        len += TY_(tmbstrlen)(prop->name) + 2;
  ------------------
  |  |   23|  2.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  216|  2.40k|        if (prop->value)
  ------------------
  |  Branch (216:13): [True: 2.40k, False: 0]
  ------------------
  217|  2.40k|            len += TY_(tmbstrlen)(prop->value) + 2;
  ------------------
  |  |   23|  2.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  218|  2.40k|    }
  219|       |
  220|  1.22k|    style = (tmbstr) TidyDocAlloc(doc, len+1);
  ------------------
  |  |  157|  1.22k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  1.22k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  221|  1.22k|    style[0] = '\0';
  222|       |
  223|  2.40k|    for (p = style, prop = props; prop; prop = prop->next)
  ------------------
  |  Branch (223:35): [True: 2.40k, False: 0]
  ------------------
  224|  2.40k|    {
  225|  2.40k|        s = prop->name;
  226|       |
  227|  28.5k|        while((*p++ = *s++))
  ------------------
  |  Branch (227:15): [True: 26.1k, False: 2.40k]
  ------------------
  228|  26.1k|            continue;
  229|       |
  230|  2.40k|        if (prop->value)
  ------------------
  |  Branch (230:13): [True: 2.40k, False: 0]
  ------------------
  231|  2.40k|        {
  232|  2.40k|            *--p = ':';
  233|  2.40k|            *++p = ' ';
  234|  2.40k|            ++p;
  235|       |
  236|  2.40k|            s = prop->value;
  237|  24.6k|            while((*p++ = *s++))
  ------------------
  |  Branch (237:19): [True: 22.2k, False: 2.40k]
  ------------------
  238|  22.2k|                continue;
  239|  2.40k|        }
  240|  2.40k|        if (prop->next == NULL)
  ------------------
  |  Branch (240:13): [True: 1.22k, False: 1.17k]
  ------------------
  241|  1.22k|            break;
  242|       |
  243|  1.17k|        *--p = ';';
  244|  1.17k|        *++p = ' ';
  245|  1.17k|        ++p;
  246|  1.17k|    }
  247|       |
  248|  1.22k|    return style;
  249|  1.22k|}
clean.c:FreeStyleProps:
   67|  1.22k|{
   68|  1.22k|    StyleProp *next;
   69|       |
   70|  3.62k|    while (props)
  ------------------
  |  Branch (70:12): [True: 2.40k, False: 1.22k]
  ------------------
   71|  2.40k|    {
   72|  2.40k|        next = props->next;
   73|  2.40k|        TidyDocFree(doc, props->name);
  ------------------
  |  |  159|  2.40k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  2.40k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   74|  2.40k|        TidyDocFree(doc, props->value);
  ------------------
  |  |  159|  2.40k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  2.40k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   75|  2.40k|        TidyDocFree(doc, props);
  ------------------
  |  |  159|  2.40k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  2.40k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   76|  2.40k|        props = next;
   77|  2.40k|    }
   78|  1.22k|}
clean.c:DiscardContainer:
  599|  2.49k|{
  600|  2.49k|    if (element->content)
  ------------------
  |  Branch (600:9): [True: 2.15k, False: 343]
  ------------------
  601|  2.15k|    {
  602|  2.15k|        Node *node, *parent = element->parent;
  603|       |
  604|  2.15k|        element->last->next = element->next;
  605|       |
  606|  2.15k|        if (element->next)
  ------------------
  |  Branch (606:13): [True: 423, False: 1.72k]
  ------------------
  607|    423|        {
  608|    423|            element->next->prev = element->last;
  609|    423|        }
  610|  1.72k|        else
  611|  1.72k|            parent->last = element->last;
  612|       |
  613|  2.15k|        if (element->prev)
  ------------------
  |  Branch (613:13): [True: 1.13k, False: 1.02k]
  ------------------
  614|  1.13k|        {
  615|  1.13k|            element->content->prev = element->prev;
  616|  1.13k|            element->prev->next = element->content;
  617|  1.13k|        }
  618|  1.02k|        else
  619|  1.02k|            parent->content = element->content;
  620|       |
  621|  7.62k|        for (node = element->content; node; node = node->next)
  ------------------
  |  Branch (621:39): [True: 5.47k, False: 2.15k]
  ------------------
  622|  5.47k|            node->parent = parent;
  623|       |
  624|  2.15k|        *pnode = element->content;
  625|       |
  626|  2.15k|        element->next = element->content = NULL;
  627|  2.15k|        TY_(FreeNode)(doc, element);
  ------------------
  |  |   23|  2.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  628|  2.15k|    }
  629|    343|    else
  630|    343|    {
  631|    343|        *pnode = TY_(DiscardElement)(doc, element);
  ------------------
  |  |   23|    343|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    343|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  632|    343|    }
  633|  2.49k|}
clean.c:RenameElem:
   59|  43.2k|{
   60|  43.2k|    const Dict* dict = TY_(LookupTagDef)( tid );
  ------------------
  |  |   23|  43.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  43.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   61|  43.2k|    TidyDocFree( doc, node->element );
  ------------------
  |  |  159|  43.2k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  43.2k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
   62|  43.2k|    node->element = TY_(tmbstrdup)( doc->allocator, dict->name );
  ------------------
  |  |   23|  43.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  43.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   63|  43.2k|    node->tag = dict;
   64|  43.2k|}
clean.c:HasOneChild:
 1550|  88.7k|{
 1551|  88.7k|    return (node->content && node->content->next == NULL);
  ------------------
  |  Branch (1551:13): [True: 88.0k, False: 657]
  |  Branch (1551:30): [True: 79.7k, False: 8.28k]
  ------------------
 1552|  88.7k|}
clean.c:StripOnlyChild:
  581|  71.6k|{
  582|  71.6k|    Node *child;
  583|       |
  584|  71.6k|    child = node->content;
  585|  71.6k|    node->content = child->content;
  586|  71.6k|    node->last = child->last;
  587|  71.6k|    child->content = NULL;
  588|  71.6k|    TY_(FreeNode)(doc, child);
  ------------------
  |  |   23|  71.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  71.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  589|       |
  590|   152k|    for (child = node->content; child; child = child->next)
  ------------------
  |  Branch (590:33): [True: 80.8k, False: 71.6k]
  ------------------
  591|  80.8k|        child->parent = node;
  592|  71.6k|}
clean.c:StyleToHead:
 2764|  20.3k|{
 2765|  20.3k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2766|  20.3k|    Node *next;
 2767|       |    
 2768|  2.54M|    while (node)
  ------------------
  |  Branch (2768:12): [True: 2.52M, False: 20.3k]
  ------------------
 2769|  2.52M|    {
 2770|  2.52M|        next = node->next;
 2771|       |        
 2772|  2.52M|        if (nodeIsSTYLE(node))
  ------------------
  |  |  421|  2.52M|#define nodeIsSTYLE( node )      TagIsId( node, TidyTag_STYLE )
  |  |  ------------------
  |  |  |  |  275|  2.52M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.52M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.15M, False: 369k]
  |  |  |  |  |  Branch (275:54): [True: 737, False: 2.15M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2773|    737|        {
 2774|    737|            if (fix)
  ------------------
  |  Branch (2774:17): [True: 737, False: 0]
  ------------------
 2775|    737|            {
 2776|    737|                TY_(RemoveNode)(node); /* unhook style node from body */
  ------------------
  |  |   23|    737|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    737|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2777|    737|                TY_(InsertNodeAtEnd)(head, node);   /* add to end of head */
  ------------------
  |  |   23|    737|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    737|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2778|    737|                TY_(Report)(doc, node, head, MOVED_STYLE_TO_HEAD); /* report move */
  ------------------
  |  |   23|    737|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    737|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2779|    737|            }
 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|    737|        }
 2785|  2.52M|        else if (node->content)
  ------------------
  |  Branch (2785:18): [True: 2.03M, False: 492k]
  ------------------
 2786|  2.03M|        {
 2787|  2.03M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.03M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.03M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2788|  2.03M|            node = node->content;
 2789|  2.03M|            indent++;
 2790|  2.03M|            continue;
 2791|  2.03M|        }
 2792|       |        
 2793|   493k|        if (next)
  ------------------
  |  Branch (2793:13): [True: 371k, False: 122k]
  ------------------
 2794|   371k|            node = next;
 2795|   122k|        else
 2796|   122k|        {
 2797|   122k|            node = TY_(pop)(stack);
  ------------------
  |  |   23|   122k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   122k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2798|   122k|            indent--;
 2799|   122k|        }
 2800|   493k|    }
 2801|  20.3k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2802|  20.3k|}

prvTidyInitConfig:
  311|  20.6k|{
  312|  20.6k|    TidyClearMemory( &doc->config, sizeof(TidyConfigImpl) );
  ------------------
  |  |   70|  20.6k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  313|  20.6k|    TY_(ResetConfigToDefault)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  314|  20.6k|}
prvTidyFreeConfig:
  318|  20.6k|{
  319|  20.6k|    doc->pConfigChangeCallback = NULL;
  320|  20.6k|    TY_(ResetConfigToDefault)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  321|  20.6k|    TY_(TakeConfigSnapshot)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  322|  20.6k|}
prvTidySetOptionInt:
  482|  91.8k|{
  483|  91.8k|    Bool status = ( optId < N_TIDY_OPTIONS );
  484|  91.8k|    if ( status )
  ------------------
  |  Branch (484:10): [True: 91.8k, False: 0]
  ------------------
  485|  91.8k|    {
  486|  91.8k|        assert( option_defs[ optId ].type == TidyInteger );
  ------------------
  |  Branch (486:9): [True: 0, False: 91.8k]
  |  Branch (486:9): [True: 91.8k, False: 0]
  ------------------
  487|  91.8k|        SetOptionInteger( doc, optId, val );
  488|  91.8k|    }
  489|  91.8k|    return status;
  490|  91.8k|}
prvTidySetOptionBool:
  494|   305k|{
  495|   305k|    Bool status = ( optId < N_TIDY_OPTIONS );
  496|   305k|    if ( status )
  ------------------
  |  Branch (496:10): [True: 305k, False: 0]
  ------------------
  497|   305k|    {
  498|   305k|        assert( option_defs[ optId ].type == TidyBoolean );
  ------------------
  |  Branch (498:9): [True: 0, False: 305k]
  |  Branch (498:9): [True: 305k, False: 0]
  ------------------
  499|   305k|        SetOptionInteger( doc, optId, (ulong)val );
  500|   305k|    }
  501|   305k|    return status;
  502|   305k|}
prvTidyResetConfigToDefault:
  693|  41.2k|{
  694|  41.2k|    uint ixVal;
  695|  41.2k|    const TidyOptionImpl* option = option_defs;
  696|  41.2k|    TidyOptionValue* value = &doc->config.value[ 0 ];
  697|  4.32M|    for ( ixVal=0; ixVal < N_TIDY_OPTIONS; ++option, ++ixVal )
  ------------------
  |  Branch (697:20): [True: 4.28M, False: 41.2k]
  ------------------
  698|  4.28M|    {
  699|  4.28M|        TidyOptionValue dflt;
  700|  4.28M|        assert( ixVal == (uint) option->id );
  ------------------
  |  Branch (700:9): [True: 0, False: 4.28M]
  |  Branch (700:9): [True: 4.28M, False: 0]
  ------------------
  701|  4.28M|        GetOptionDefault( option, &dflt );
  702|  4.28M|        CopyOptionValue( doc, option, &value[ixVal], &dflt );
  703|  4.28M|    }
  704|  41.2k|    TY_(FreeDeclaredTags)( doc, tagtype_null );
  ------------------
  |  |   23|  41.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  705|  41.2k|}
prvTidyTakeConfigSnapshot:
  709|  41.2k|{
  710|  41.2k|    uint ixVal;
  711|  41.2k|    const TidyOptionImpl* option = option_defs;
  712|  41.2k|    const TidyOptionValue* value = &doc->config.value[ 0 ];
  713|  41.2k|    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.32M|    for ( ixVal=0; ixVal < N_TIDY_OPTIONS; ++option, ++ixVal )
  ------------------
  |  Branch (720:20): [True: 4.28M, False: 41.2k]
  ------------------
  721|  4.28M|    {
  722|  4.28M|        assert( ixVal == (uint) option->id );
  ------------------
  |  Branch (722:9): [True: 0, False: 4.28M]
  |  Branch (722:9): [True: 4.28M, False: 0]
  ------------------
  723|  4.28M|        CopyOptionValue( doc, option, &snap[ixVal], &value[ixVal] );
  724|  4.28M|    }
  725|  41.2k|}
prvTidyAdjustConfig:
 1230|  20.6k|{
 1231|  20.6k|    if ( cfgBool(doc, TidyEncloseBlockText) )
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.6k]
  |  |  ------------------
  ------------------
 1232|      0|        TY_(SetOptionBool)( doc, TidyEncloseBodyText, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1233|       |
 1234|  20.6k|    if ( cfgAutoBool(doc, TidyIndentContent) == TidyNoState )
  ------------------
  |  |  421|  20.6k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1234:10): [True: 20.6k, False: 0]
  ------------------
 1235|  20.6k|        TY_(SetOptionInt)( doc, TidyIndentSpaces, 0 );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1236|       |
 1237|       |    /* disable wrapping */
 1238|  20.6k|    if ( cfg(doc, TidyWrapLen) == 0 )
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1238:10): [True: 0, False: 20.6k]
  ------------------
 1239|      0|        TY_(SetOptionInt)( doc, TidyWrapLen, 0x7FFFFFFF );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1240|       |
 1241|       |    /* Word 2000 needs o:p to be declared as inline */
 1242|  20.6k|    if ( cfgBool(doc, TidyWord2000) )
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.6k]
  |  |  ------------------
  ------------------
 1243|      0|    {
 1244|      0|        doc->config.defined_tags |= tagtype_inline;
 1245|      0|        TY_(DefineTag)( doc, tagtype_inline, "o:p" );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1246|      0|    }
 1247|       |
 1248|       |    /* #480701 disable XHTML output flag if both output-xhtml and xml input are set */
 1249|  20.6k|    if ( cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.6k]
  |  |  ------------------
  ------------------
 1250|      0|        TY_(SetOptionBool)( doc, TidyXhtmlOut, no );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1251|       |
 1252|       |    /* XHTML is written in lower case */
 1253|  20.6k|    if ( cfgBool(doc, TidyXhtmlOut) )
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 20.6k, False: 0]
  |  |  ------------------
  ------------------
 1254|  20.6k|    {
 1255|  20.6k|        TY_(SetOptionBool)( doc, TidyXmlOut, yes );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1256|  20.6k|        TY_(SetOptionBool)( doc, TidyUpperCaseTags, no );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1257|  20.6k|        TY_(SetOptionInt)( doc, TidyUpperCaseAttrs, no );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1258|       |        /* TY_(SetOptionBool)( doc, TidyXmlPIs, yes ); */
 1259|  20.6k|    }
 1260|       |
 1261|       |    /* if XML in, then XML out */
 1262|  20.6k|    if ( cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.6k]
  |  |  ------------------
  ------------------
 1263|      0|    {
 1264|      0|        TY_(SetOptionBool)( doc, TidyXmlOut, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1265|      0|        TY_(SetOptionBool)( doc, TidyXmlPIs, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1266|      0|    }
 1267|       |
 1268|       |    /* #427837 - fix by Dave Raggett 02 Jun 01
 1269|       |    ** generate <?xml version="1.0" encoding="iso-8859-1"?>
 1270|       |    ** if the output character encoding is Latin-1 etc.
 1271|       |    */
 1272|  20.6k|    if ( cfg(doc, TidyOutCharEncoding) != ASCII &&
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                  if ( cfg(doc, TidyOutCharEncoding) != ASCII &&
  ------------------
  |  |  134|  41.2k|#define ASCII       1
  ------------------
  |  Branch (1272:10): [True: 20.6k, False: 0]
  ------------------
 1273|  20.6k|         cfg(doc, TidyOutCharEncoding) != UTF8 &&
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != UTF8 &&
  ------------------
  |  |  137|  41.2k|#define UTF8        4
  ------------------
  |  Branch (1273:10): [True: 0, False: 20.6k]
  ------------------
 1274|      0|         cfg(doc, TidyOutCharEncoding) != UTF16 &&
  ------------------
  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != UTF16 &&
  ------------------
  |  |  144|  20.6k|#define UTF16       11
  ------------------
  |  Branch (1274:10): [True: 0, False: 0]
  ------------------
 1275|      0|         cfg(doc, TidyOutCharEncoding) != UTF16BE &&
  ------------------
  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != UTF16BE &&
  ------------------
  |  |  143|  20.6k|#define UTF16BE     10
  ------------------
  |  Branch (1275:10): [True: 0, False: 0]
  ------------------
 1276|      0|         cfg(doc, TidyOutCharEncoding) != UTF16LE &&
  ------------------
  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != UTF16LE &&
  ------------------
  |  |  142|  20.6k|#define UTF16LE     9
  ------------------
  |  Branch (1276:10): [True: 0, False: 0]
  ------------------
 1277|      0|         cfg(doc, TidyOutCharEncoding) != RAW &&
  ------------------
  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                       cfg(doc, TidyOutCharEncoding) != RAW &&
  ------------------
  |  |  133|  20.6k|#define RAW         0
  ------------------
  |  Branch (1277:10): [True: 0, False: 0]
  ------------------
 1278|      0|         cfgBool(doc, TidyXmlOut) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1279|      0|    {
 1280|      0|        TY_(SetOptionBool)( doc, TidyXmlDecl, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1281|      0|    }
 1282|       |
 1283|       |    /* XML requires end tags */
 1284|  20.6k|    if ( cfgBool(doc, TidyXmlOut) )
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 20.6k, False: 0]
  |  |  ------------------
  ------------------
 1285|  20.6k|    {
 1286|       |        /* XML requires a BOM on output if using UTF-16 encoding */
 1287|  20.6k|        ulong enc = cfg( doc, TidyOutCharEncoding );
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1288|  20.6k|        if ( enc == UTF16LE || enc == UTF16BE || enc == UTF16 )
  ------------------
  |  |  142|  41.2k|#define UTF16LE     9
  ------------------
                      if ( enc == UTF16LE || enc == UTF16BE || enc == UTF16 )
  ------------------
  |  |  143|  41.2k|#define UTF16BE     10
  ------------------
                      if ( enc == UTF16LE || enc == UTF16BE || enc == UTF16 )
  ------------------
  |  |  144|  20.6k|#define UTF16       11
  ------------------
  |  Branch (1288:14): [True: 0, False: 20.6k]
  |  Branch (1288:32): [True: 0, False: 20.6k]
  |  Branch (1288:50): [True: 0, False: 20.6k]
  ------------------
 1289|      0|            TY_(SetOptionInt)( doc, TidyOutputBOM, yes );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1290|       |        
 1291|  20.6k|        TY_(SetOptionBool)( doc, TidyQuoteAmpersand, yes );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1292|  20.6k|        TY_(SetOptionBool)( doc, TidyOmitOptionalTags, no );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1293|  20.6k|    }
 1294|       |    
 1295|       |    /* Setup the indent character. */
 1296|  20.6k|    if cfgBool(doc, TidyPPrintTabs) 
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:34): [True: 0, False: 20.6k]
  |  |  ------------------
  ------------------
 1297|      0|        doc->indent_char = '\t';
 1298|  20.6k|    else
 1299|  20.6k|        doc->indent_char = ' ';
 1300|  20.6k|}
prvTidyCharEncodingName:
 1714|    368|{
 1715|    368|    ctmbstr encodingName = TY_(GetEncodingNameFromTidyId)(encoding);
  ------------------
  |  |   23|    368|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    368|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1716|       |
 1717|    368|    if (!encodingName)
  ------------------
  |  Branch (1717:9): [True: 0, False: 368]
  ------------------
 1718|      0|        encodingName = "unknown";
 1719|       |
 1720|    368|    return encodingName;
 1721|    368|}
config.c:SetOptionInteger:
  470|   397k|{
  471|   397k|    const TidyOptionImpl* option = &option_defs[ optId ];
  472|   397k|    ulong* optVal = &(doc->config.value[ optId ].v);
  473|   397k|    Bool fire_callback = doc->pConfigChangeCallback && *optVal != val;
  ------------------
  |  Branch (473:26): [True: 0, False: 397k]
  |  Branch (473:56): [True: 0, False: 0]
  ------------------
  474|       |
  475|   397k|    *optVal = val;
  476|       |
  477|   397k|    if ( fire_callback )
  ------------------
  |  Branch (477:10): [True: 0, False: 397k]
  ------------------
  478|      0|        PerformOptionChangedCallback( doc, option );
  479|   397k|}
config.c:GetOptionDefault:
  507|  4.28M|{
  508|  4.28M|    if ( option->type == TidyString )
  ------------------
  |  Branch (508:10): [True: 535k, False: 3.75M]
  ------------------
  509|   535k|        dflt->p = (char*)option->pdflt;
  510|  3.75M|    else
  511|  3.75M|        dflt->v = option->dflt;
  512|  4.28M|}
config.c:CopyOptionValue:
  386|  8.57M|{
  387|  8.57M|    Bool fire_callback = no;
  388|  8.57M|    assert( oldval != NULL );
  ------------------
  |  Branch (388:5): [True: 0, False: 8.57M]
  |  Branch (388:5): [True: 8.57M, False: 0]
  ------------------
  389|       |
  390|       |    /* Compare the old and new values. */
  391|  8.57M|    if ( doc->pConfigChangeCallback )
  ------------------
  |  Branch (391:10): [True: 0, False: 8.57M]
  ------------------
  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.57M|    FreeOptionValue( doc, option, oldval );
  400|       |
  401|  8.57M|    if ( option->type == TidyString )
  ------------------
  |  Branch (401:10): [True: 1.07M, False: 7.50M]
  ------------------
  402|  1.07M|    {
  403|  1.07M|        if ( newval->p && newval->p != option->pdflt )
  ------------------
  |  Branch (403:14): [True: 82.4k, False: 989k]
  |  Branch (403:27): [True: 0, False: 82.4k]
  ------------------
  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.07M|        else
  406|  1.07M|            oldval->p = newval->p;
  407|  1.07M|    }
  408|  7.50M|    else
  409|  7.50M|        oldval->v = newval->v;
  410|       |
  411|  8.57M|    if ( fire_callback )
  ------------------
  |  Branch (411:10): [True: 0, False: 8.57M]
  ------------------
  412|      0|        PerformOptionChangedCallback( doc, option );
  413|  8.57M|}
config.c:FreeOptionValue:
  378|  8.57M|{
  379|  8.57M|    if ( option->type == TidyString && value->p && value->p != option->pdflt )
  ------------------
  |  Branch (379:10): [True: 1.07M, False: 7.50M]
  |  Branch (379:40): [True: 41.2k, False: 1.03M]
  |  Branch (379:52): [True: 0, False: 41.2k]
  ------------------
  380|  8.57M|        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.57M|}

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

prvTidyDupAttrs:
   16|  2.22M|{
   17|  2.22M|    AttVal *newattrs;
   18|       |
   19|  2.22M|    if (attrs == NULL)
  ------------------
  |  Branch (19:9): [True: 1.96M, False: 256k]
  ------------------
   20|  1.96M|        return attrs;
   21|       |
   22|   256k|    newattrs = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|   256k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   256k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   23|   256k|    *newattrs = *attrs;
   24|   256k|    newattrs->next = TY_(DupAttrs)( doc, attrs->next );
  ------------------
  |  |   23|   256k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   256k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   25|   256k|    newattrs->attribute = TY_(tmbstrdup)(doc->allocator, attrs->attribute);
  ------------------
  |  |   23|   256k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   256k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   26|   256k|    newattrs->value = TY_(tmbstrdup)(doc->allocator, attrs->value);
  ------------------
  |  |   23|   256k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   256k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   27|   256k|    newattrs->dict = TY_(FindAttribute)(doc, newattrs);
  ------------------
  |  |   23|   256k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   256k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   28|   256k|    newattrs->asp = attrs->asp ? TY_(CloneNode)(doc, attrs->asp) : NULL;
  ------------------
  |  |   23|  4.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (28:21): [True: 4.12k, False: 251k]
  ------------------
   29|   256k|    newattrs->php = attrs->php ? TY_(CloneNode)(doc, attrs->php) : NULL;
  ------------------
  |  |   23|  16.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (29:21): [True: 16.6k, False: 239k]
  ------------------
   30|   256k|    return newattrs;
   31|  2.22M|}
prvTidyPushInline:
   70|  1.97M|{
   71|  1.97M|    Lexer* lexer = doc->lexer;
   72|  1.97M|    IStack *istack;
   73|       |
   74|  1.97M|    if (node->implicit)
  ------------------
  |  Branch (74:9): [True: 1.79M, False: 178k]
  ------------------
   75|  1.79M|        return;
   76|       |
   77|   178k|    if ( !IsNodePushable(node) )
  ------------------
  |  Branch (77:10): [True: 1.19k, False: 177k]
  ------------------
   78|  1.19k|        return;
   79|       |
   80|   177k|    if ( !nodeIsFONT(node) && TY_(IsPushed)(doc, node) )
  ------------------
  |  |  417|   177k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|   354k|#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: 135k, False: 41.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( !nodeIsFONT(node) && TY_(IsPushed)(doc, node) )
  ------------------
  |  |   23|  41.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (80:31): [True: 27.6k, False: 14.1k]
  ------------------
   81|  27.6k|        return;
   82|       |
   83|       |    /* make sure there is enough space for the stack */
   84|   149k|    if (lexer->istacksize + 1 > lexer->istacklength)
  ------------------
  |  Branch (84:9): [True: 8.04k, False: 141k]
  ------------------
   85|  8.04k|    {
   86|  8.04k|        if (lexer->istacklength == 0)
  ------------------
  |  Branch (86:13): [True: 6.82k, False: 1.21k]
  ------------------
   87|  6.82k|            lexer->istacklength = 6;   /* this is perhaps excessive */
   88|       |
   89|  8.04k|        lexer->istacklength = lexer->istacklength * 2;
   90|  8.04k|        lexer->istack = (IStack *)TidyDocRealloc(doc, lexer->istack,
  ------------------
  |  |  158|  8.04k|#define TidyDocRealloc(doc, block, size) TidyRealloc((doc)->allocator, block, size)
  |  |  ------------------
  |  |  |  |   67|  8.04k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  |  |  ------------------
  ------------------
   91|  8.04k|                            sizeof(IStack)*(lexer->istacklength));
   92|  8.04k|    }
   93|       |
   94|   149k|    istack = &(lexer->istack[lexer->istacksize]);
   95|   149k|    istack->tag = node->tag;
   96|       |
   97|   149k|    istack->element = TY_(tmbstrdup)(doc->allocator, node->element);
  ------------------
  |  |   23|   149k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   149k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   98|   149k|    istack->attributes = TY_(DupAttrs)( doc, node->attributes );
  ------------------
  |  |   23|   149k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   149k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   99|   149k|    ++(lexer->istacksize);
  100|   149k|}
prvTidyPopInline:
  137|  94.3k|{
  138|  94.3k|    Lexer* lexer = doc->lexer;
  139|       |
  140|  94.3k|    if (node)
  ------------------
  |  Branch (140:9): [True: 25.1k, False: 69.2k]
  ------------------
  141|  25.1k|    {
  142|  25.1k|        if ( !IsNodePushable(node) )
  ------------------
  |  Branch (142:14): [True: 816, False: 24.2k]
  ------------------
  143|    816|            return;
  144|       |
  145|       |        /* if node is </a> then pop until we find an <a> */
  146|  24.2k|        if ( nodeIsA(node) )
  ------------------
  |  |  401|  24.2k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  24.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 24.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 24.2k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.24k, False: 21.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  147|  3.24k|        {
  148|  3.24k|            PopIStackUntil( doc, TidyTag_A );
  149|  3.24k|            return;
  150|  3.24k|        }
  151|  24.2k|    }
  152|       |
  153|  90.2k|    if (lexer->istacksize > 0)
  ------------------
  |  Branch (153:9): [True: 87.7k, False: 2.51k]
  ------------------
  154|  87.7k|    {
  155|  87.7k|        PopIStack( doc );
  156|       |
  157|       |        /* #427822 - fix by Randy Waki 7 Aug 00 */
  158|  87.7k|        if (lexer->insert >= lexer->istack + lexer->istacksize)
  ------------------
  |  Branch (158:13): [True: 226, False: 87.5k]
  ------------------
  159|    226|            lexer->insert = NULL;
  160|  87.7k|    }
  161|  90.2k|}
prvTidyIsPushed:
  164|  4.72M|{
  165|  4.72M|    Lexer* lexer = doc->lexer;
  166|  4.72M|    int i;
  167|       |
  168|   330M|    for (i = lexer->istacksize - 1; i >= 0; --i)
  ------------------
  |  Branch (168:37): [True: 329M, False: 1.03M]
  ------------------
  169|   329M|    {
  170|   329M|        if (lexer->istack[i].tag == node->tag)
  ------------------
  |  Branch (170:13): [True: 3.68M, False: 325M]
  ------------------
  171|  3.68M|            return yes;
  172|   329M|    }
  173|       |
  174|  1.03M|    return no;
  175|  4.72M|}
prvTidyIsPushedLast:
  181|  29.5k|{
  182|  29.5k|    Lexer* lexer = doc->lexer;
  183|       |
  184|  29.5k|    if ( element && !IsNodePushable(element) )
  ------------------
  |  Branch (184:10): [True: 29.5k, False: 0]
  |  Branch (184:21): [True: 729, False: 28.8k]
  ------------------
  185|    729|        return no;
  186|       |
  187|  28.8k|    if (lexer->istacksize > 0) {
  ------------------
  |  Branch (187:9): [True: 28.6k, False: 196]
  ------------------
  188|  28.6k|        if (lexer->istack[lexer->istacksize - 1].tag == node->tag) {
  ------------------
  |  Branch (188:13): [True: 0, False: 28.6k]
  ------------------
  189|      0|            return yes;
  190|      0|        }
  191|  28.6k|    }
  192|       |
  193|  28.8k|    return no;
  194|  28.8k|}
prvTidyInlineDup:
  214|   360k|{
  215|   360k|    Lexer* lexer = doc->lexer;
  216|   360k|    int n;
  217|       |
  218|   360k|    if ((n = lexer->istacksize - lexer->istackbase) > 0)
  ------------------
  |  Branch (218:9): [True: 183k, False: 177k]
  ------------------
  219|   183k|    {
  220|   183k|        lexer->insert = &(lexer->istack[lexer->istackbase]);
  221|   183k|        lexer->inode = node;
  222|   183k|    }
  223|       |
  224|   360k|    return n;
  225|   360k|}
prvTidyDeferDup:
  232|  36.3k|{
  233|  36.3k|    doc->lexer->insert = NULL;
  234|       |    doc->lexer->inode = NULL;
  235|  36.3k|}
prvTidyInsertedToken:
  238|  1.79M|{
  239|  1.79M|    Lexer* lexer = doc->lexer;
  240|  1.79M|    Node *node;
  241|  1.79M|    IStack *istack;
  242|  1.79M|    uint n;
  243|       |
  244|       |    /* this will only be NULL if inode != NULL */
  245|  1.79M|    if (lexer->insert == NULL)
  ------------------
  |  Branch (245:9): [True: 4.15k, False: 1.79M]
  ------------------
  246|  4.15k|    {
  247|  4.15k|        node = lexer->inode;
  248|  4.15k|        lexer->inode = NULL;
  249|  4.15k|        return node;
  250|  4.15k|    }
  251|       |
  252|       |    /*
  253|       |      If this is the "latest" node then update
  254|       |      the position, otherwise use current values
  255|       |    */
  256|       |
  257|  1.79M|    if (lexer->inode == NULL)
  ------------------
  |  Branch (257:9): [True: 1.73M, False: 62.6k]
  ------------------
  258|  1.73M|    {
  259|  1.73M|        lexer->lines = doc->docIn->curline;
  260|  1.73M|        lexer->columns = doc->docIn->curcol;
  261|  1.73M|    }
  262|       |
  263|  1.79M|    node = TY_(NewNode)(doc->allocator, lexer);
  ------------------
  |  |   23|  1.79M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.79M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  264|  1.79M|    node->type = StartTag;
  265|  1.79M|    node->implicit = yes;
  266|  1.79M|    node->start = lexer->txtstart;
  267|       |    /* #431734 [JTidy bug #226261 (was 126261)] - fix by Gary Peskin 20 Dec 00 */ 
  268|  1.79M|    node->end = lexer->txtend; /* was : lexer->txtstart; */
  269|  1.79M|    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.79M|    node->element = TY_(tmbstrdup)(doc->allocator, istack->element);
  ------------------
  |  |   23|  1.79M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.79M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  280|  1.79M|    node->tag = istack->tag;
  281|  1.79M|    node->attributes = TY_(DupAttrs)( doc, istack->attributes );
  ------------------
  |  |   23|  1.79M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.79M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  282|       |
  283|       |    /* advance lexer to next item on the stack */
  284|  1.79M|    n = (uint)(lexer->insert - &(lexer->istack[0]));
  285|       |
  286|       |    /* and recover state if we have reached the end */
  287|  1.79M|    if (++n < lexer->istacksize)
  ------------------
  |  Branch (287:9): [True: 1.62M, False: 173k]
  ------------------
  288|  1.62M|        lexer->insert = &(lexer->istack[n]);
  289|   173k|    else
  290|   173k|        lexer->insert = NULL;
  291|       |
  292|  1.79M|    return node;
  293|  1.79M|}
prvTidySwitchInline:
  304|  13.0k|{
  305|  13.0k|    Lexer* lexer = doc->lexer;
  306|  13.0k|    if ( lexer
  ------------------
  |  Branch (306:10): [True: 13.0k, False: 0]
  ------------------
  307|  13.0k|         && element && element->tag
  ------------------
  |  Branch (307:13): [True: 13.0k, False: 0]
  |  Branch (307:24): [True: 13.0k, False: 0]
  ------------------
  308|  13.0k|         && node && node->tag
  ------------------
  |  Branch (308:13): [True: 13.0k, False: 0]
  |  Branch (308:21): [True: 13.0k, False: 0]
  ------------------
  309|  13.0k|         && TY_(IsPushed)( doc, element )
  ------------------
  |  |   23|  13.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (309:13): [True: 13.0k, False: 0]
  ------------------
  310|  13.0k|         && TY_(IsPushed)( doc, node ) 
  ------------------
  |  |   23|  13.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (310:13): [True: 13.0k, False: 0]
  ------------------
  311|  13.0k|         && ((lexer->istacksize - lexer->istackbase) >= 2) )
  ------------------
  |  Branch (311:13): [True: 12.8k, False: 205]
  ------------------
  312|  12.8k|    {
  313|       |        /* we have a chance of succeeding ... */
  314|  12.8k|        int i;
  315|  23.8k|        for (i = (lexer->istacksize - lexer->istackbase - 1); i >= 0; --i)
  ------------------
  |  Branch (315:63): [True: 22.7k, False: 1.14k]
  ------------------
  316|  22.7k|        {
  317|  22.7k|            if (lexer->istack[i].tag == element->tag) {
  ------------------
  |  Branch (317:17): [True: 12.6k, False: 10.0k]
  ------------------
  318|       |                /* found the element tag - phew */
  319|  12.6k|                IStack *istack1 = &lexer->istack[i];
  320|  12.6k|                IStack *istack2 = NULL;
  321|  12.6k|                --i; /* back one more, and continue */
  322|   119k|                for ( ; i >= 0; --i)
  ------------------
  |  Branch (322:25): [True: 118k, False: 888]
  ------------------
  323|   118k|                {
  324|   118k|                    if (lexer->istack[i].tag == node->tag)
  ------------------
  |  Branch (324:25): [True: 11.7k, False: 107k]
  ------------------
  325|  11.7k|                    {
  326|       |                        /* found the element tag - phew */
  327|  11.7k|                        istack2 = &lexer->istack[i];
  328|  11.7k|                        break;
  329|  11.7k|                    }
  330|   118k|                }
  331|  12.6k|                if ( istack2 )
  ------------------
  |  Branch (331:22): [True: 11.7k, False: 888]
  ------------------
  332|  11.7k|                {
  333|       |                    /* perform the swap */
  334|  11.7k|                    IStack tmp_istack = *istack2;
  335|  11.7k|                    *istack2 = *istack1;
  336|  11.7k|                    *istack1 = tmp_istack;
  337|  11.7k|                    return yes;
  338|  11.7k|                }
  339|  12.6k|            }
  340|  22.7k|        }
  341|  12.8k|    }
  342|  1.34k|    return no;
  343|  13.0k|}
prvTidyInlineDup1:
  351|  11.7k|{
  352|  11.7k|    Lexer* lexer = doc->lexer;
  353|  11.7k|    int n, i;
  354|  11.7k|    if ( element
  ------------------
  |  Branch (354:10): [True: 11.7k, False: 0]
  ------------------
  355|  11.7k|         && (element->tag != NULL)
  ------------------
  |  Branch (355:13): [True: 11.7k, False: 0]
  ------------------
  356|  11.7k|         && ((n = lexer->istacksize - lexer->istackbase) > 0) )
  ------------------
  |  Branch (356:13): [True: 11.7k, False: 0]
  ------------------
  357|  11.7k|    {
  358|  49.0k|        for ( i = n - 1; i >=0; --i ) {
  ------------------
  |  Branch (358:26): [True: 49.0k, False: 0]
  ------------------
  359|  49.0k|            if (lexer->istack[i].tag == element->tag) {
  ------------------
  |  Branch (359:17): [True: 11.7k, False: 37.2k]
  ------------------
  360|       |                /* found our element tag - insert it */
  361|  11.7k|                lexer->insert = &(lexer->istack[i]);
  362|  11.7k|                lexer->inode = node;
  363|  11.7k|                return yes;
  364|  11.7k|            }
  365|  49.0k|        }
  366|  11.7k|    }
  367|      0|    return no;
  368|  11.7k|}
istack.c:IsNodePushable:
   34|   233k|{
   35|   233k|    if (node->tag == NULL)
  ------------------
  |  Branch (35:9): [True: 0, False: 233k]
  ------------------
   36|      0|        return no;
   37|       |
   38|   233k|    if (!(node->tag->model & CM_INLINE))
  ------------------
  |  |  143|   233k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (38:9): [True: 312, False: 232k]
  ------------------
   39|    312|        return no;
   40|       |
   41|   232k|    if (node->tag->model & CM_OBJECT)
  ------------------
  |  |  150|   232k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (41:9): [True: 200, False: 232k]
  ------------------
   42|    200|        return no;
   43|       |
   44|       |    /*\ Issue #92: OLD problem of ins and del which are marked as both
   45|       |     *  inline and block, thus should NOT ever be 'inserted'
   46|       |    \*/
   47|   232k|    if (nodeIsINS(node) || nodeIsDEL(node))
  ------------------
  |  |  457|   232k|#define nodeIsINS( node )        TagIsId( node, TidyTag_INS )
  |  |  ------------------
  |  |  |  |  275|   465k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 232k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 232k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 919, False: 231k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if (nodeIsINS(node) || nodeIsDEL(node))
  ------------------
  |  |  458|   231k|#define nodeIsDEL( node )        TagIsId( node, TidyTag_DEL )
  |  |  ------------------
  |  |  |  |  275|   231k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 231k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 231k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.31k, False: 230k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
   48|  2.23k|        return no;
   49|       |
   50|   230k|    return yes;
   51|   232k|}
istack.c:PopIStackUntil:
  122|  3.24k|{
  123|  3.24k|    Lexer* lexer = doc->lexer;
  124|  3.24k|    IStack *istack;
  125|       |
  126|  64.3k|    while (lexer->istacksize > 0)
  ------------------
  |  Branch (126:12): [True: 61.9k, False: 2.39k]
  ------------------
  127|  61.9k|    {
  128|  61.9k|        PopIStack( doc );
  129|  61.9k|        istack = &(lexer->istack[lexer->istacksize]);
  130|  61.9k|        if ( istack->tag->id == tid )
  ------------------
  |  Branch (130:14): [True: 845, False: 61.0k]
  ------------------
  131|    845|            break;
  132|  61.9k|    }
  133|  3.24k|}
istack.c:PopIStack:
  103|   149k|{
  104|   149k|    Lexer* lexer = doc->lexer;
  105|   149k|    IStack *istack;
  106|   149k|    AttVal *av;
  107|       |
  108|   149k|    --(lexer->istacksize);
  109|   149k|    istack = &(lexer->istack[lexer->istacksize]);
  110|       |
  111|   159k|    while (istack->attributes)
  ------------------
  |  Branch (111:12): [True: 10.2k, False: 149k]
  ------------------
  112|  10.2k|    {
  113|  10.2k|        av = istack->attributes;
  114|  10.2k|        istack->attributes = av->next;
  115|  10.2k|        TY_(FreeAttribute)( doc, av );
  ------------------
  |  |   23|  10.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  116|  10.2k|    }
  117|   149k|    TidyDocFree(doc, istack->element);
  ------------------
  |  |  159|   149k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   149k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  118|       |    istack->element = NULL; /* remove the freed element */
  119|   149k|}

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

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

prvTidyHTMLVersion:
  257|  3.60M|{
  258|  3.60M|    uint i;
  259|  3.60M|    uint j = 0;
  260|  3.60M|    uint score = 0;
  261|  3.60M|    uint vers = doc->lexer->versions;
  262|  3.60M|    uint dtver = doc->lexer->doctype;
  263|  3.60M|    TidyDoctypeModes dtmode = (TidyDoctypeModes)cfg(doc, TidyDoctypeMode);
  ------------------
  |  |  415|  3.60M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  264|  3.60M|    Bool xhtml = (cfgBool(doc, TidyXmlOut) || doc->lexer->isvoyager) &&
  ------------------
  |  |  418|  7.21M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.60M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 3.60M, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (264:47): [True: 0, False: 0]
  ------------------
  265|  3.60M|                 !cfgBool(doc, TidyHtmlOut);
  ------------------
  |  |  418|  7.21M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.60M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (265:18): [True: 3.60M, False: 0]
  ------------------
  266|  3.60M|    Bool html4 = ((dtmode == TidyDoctypeStrict) || (dtmode == TidyDoctypeLoose) ||
  ------------------
  |  Branch (266:19): [True: 0, False: 3.60M]
  |  Branch (266:52): [True: 0, False: 3.60M]
  ------------------
  267|  3.60M|                  (VERS_HMTL40PX & dtver) ? yes : no);
  ------------------
  |  |  254|  3.60M|#define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  216|  3.60M|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  207|  3.60M|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  179|  3.60M|#define H40S                   4u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  182|  3.60M|#define H41S                  32u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  185|  3.60M|#define X10S                 256u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|  3.60M|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|  3.60M|#define H40T                   8u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|  3.60M|#define H41T                  64u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|  3.60M|#define X10T                 512u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  209|  3.60M|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|  3.60M|#define H40F                  16u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|  3.60M|#define H41F                 128u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|  3.60M|#define X10F                1024u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  210|  3.60M|#define VERS_XHTML11       (XH11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  188|  3.60M|#define XH11                2048u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  211|  3.60M|#define VERS_BASIC         (XB10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|  3.60M|#define XB10                4096u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (267:19): [True: 33.3k, False: 3.57M]
  ------------------
  268|  3.60M|    Bool html5 = (!html4 && ((dtmode == TidyDoctypeAuto) ||
  ------------------
  |  Branch (268:19): [True: 3.57M, False: 33.3k]
  |  Branch (268:30): [True: 3.57M, False: 0]
  ------------------
  269|  3.57M|                  (dtmode == TidyDoctypeHtml5)) ? yes : no);
  ------------------
  |  Branch (269:19): [True: 0, False: 0]
  ------------------
  270|       |
  271|  3.60M|    if (xhtml && dtver == VERS_UNKNOWN) return XH50;
  ------------------
  |  |  204|  3.60M|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  3.60M|#define xxxx                   0u
  |  |  ------------------
  ------------------
                  if (xhtml && dtver == VERS_UNKNOWN) return XH50;
  ------------------
  |  |  201|  3.50M|#define XH50              262144u
  ------------------
  |  Branch (271:9): [True: 3.60M, False: 0]
  |  Branch (271:18): [True: 3.50M, False: 103k]
  ------------------
  272|   103k|    if (dtver == VERS_UNKNOWN) return HT50;
  ------------------
  |  |  204|   103k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|   103k|#define xxxx                   0u
  |  |  ------------------
  ------------------
                  if (dtver == VERS_UNKNOWN) return HT50;
  ------------------
  |  |  200|      0|#define HT50              131072u
  ------------------
  |  Branch (272:9): [True: 0, False: 103k]
  ------------------
  273|       |    /* Issue #167 - if NOT XHTML, and doctype is default VERS_HTML5, then return HT50 */
  274|   103k|    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: 103k]
  |  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|   103k|    if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  213|  70.3k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  70.3k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  70.3k|#define XH50              262144u
  |  |  ------------------
  ------------------
                  if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  201|  70.3k|#define XH50              262144u
  ------------------
                  if (xhtml && html5 && ((vers & VERS_HTML5) == XH50)) return XH50;
  ------------------
  |  |  201|    899|#define XH50              262144u
  ------------------
  |  Branch (277:9): [True: 103k, False: 0]
  |  Branch (277:18): [True: 70.3k, False: 33.3k]
  |  Branch (277:27): [True: 899, False: 69.4k]
  ------------------
  278|       |
  279|  2.05M|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (279:17): [True: 1.95M, False: 102k]
  ------------------
  280|  1.95M|    {
  281|  1.95M|        if ((xhtml && !(VERS_XHTML & W3C_Doctypes[i].vers)) ||
  ------------------
  |  |  222|  1.95M|#define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  185|  1.95M|#define X10S                 256u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  186|  1.95M|#define X10T                 512u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  187|  1.95M|#define X10F                1024u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  188|  1.95M|#define XH11                2048u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  189|  1.95M|#define XB10                4096u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  201|  1.95M|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (281:14): [True: 1.95M, False: 0]
  |  Branch (281:23): [True: 1.33M, False: 616k]
  ------------------
  282|   616k|            (html4 && !(VERS_HMTL40PX & W3C_Doctypes[i].vers)))
  ------------------
  |  |  254|   199k|#define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  216|   199k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  207|   199k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  179|   199k|#define H40S                   4u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  182|   199k|#define H41S                  32u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  185|   199k|#define X10S                 256u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|   199k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|   199k|#define H40T                   8u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|   199k|#define H41T                  64u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|   199k|#define X10T                 512u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  209|   199k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|   199k|#define H40F                  16u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|   199k|#define H41F                 128u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|   199k|#define X10F                1024u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  210|   199k|#define VERS_XHTML11       (XH11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  188|   199k|#define XH11                2048u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HMTL40PX        (VERS_HTML40|VERS_XHTML11|VERS_BASIC)
  |  |  ------------------
  |  |  |  |  211|   199k|#define VERS_BASIC         (XB10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  189|   199k|#define XB10                4096u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (282:14): [True: 199k, False: 416k]
  |  Branch (282:23): [True: 33.3k, False: 166k]
  ------------------
  283|  1.36M|            continue;
  284|       |
  285|   583k|        if (vers & W3C_Doctypes[i].vers &&
  ------------------
  |  Branch (285:13): [True: 316k, False: 266k]
  ------------------
  286|   316k|            (W3C_Doctypes[i].score < score || !score))
  ------------------
  |  Branch (286:14): [True: 1.12k, False: 315k]
  |  Branch (286:47): [True: 95.9k, False: 219k]
  ------------------
  287|  97.0k|        {
  288|  97.0k|            score = W3C_Doctypes[i].score;
  289|  97.0k|            j = i;
  290|  97.0k|        }
  291|   583k|    }
  292|       |
  293|   102k|    if (score)
  ------------------
  |  Branch (293:9): [True: 95.9k, False: 6.76k]
  ------------------
  294|  95.9k|        return W3C_Doctypes[j].vers;
  295|       |
  296|  6.76k|    return VERS_UNKNOWN;
  ------------------
  |  |  204|  6.76k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  6.76k|#define xxxx                   0u
  |  |  ------------------
  ------------------
  297|   102k|}
prvTidyConstrainVersion:
  442|  1.16M|{
  443|  1.16M|    doc->lexer->versions &= (vers | VERS_PROPRIETARY);
  ------------------
  |  |  231|  1.16M|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  1.16M|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  1.16M|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  1.16M|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  444|  1.16M|}
prvTidyIsWhite:
  448|   323M|{
  449|   323M|    uint map = MAP(c);
  ------------------
  |  |  206|   323M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 320M, False: 3.35M]
  |  |  ------------------
  ------------------
  450|       |
  451|   323M|    return (map & white)!=0;
  ------------------
  |  |   71|   323M|#define white       8u
  ------------------
  452|   323M|}
prvTidyIsDigit:
  461|  42.7k|{
  462|  42.7k|    uint map;
  463|       |
  464|  42.7k|    map = MAP(c);
  ------------------
  |  |  206|  42.7k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 36.1k, False: 6.63k]
  |  |  ------------------
  ------------------
  465|       |
  466|  42.7k|    return (map & digit)!=0;
  ------------------
  |  |   68|  42.7k|#define digit       1u
  ------------------
  467|  42.7k|}
prvTidyIsLetter:
  479|  1.75M|{
  480|  1.75M|    uint map;
  481|       |
  482|  1.75M|    map = MAP(c);
  ------------------
  |  |  206|  1.75M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 1.71M, False: 42.5k]
  |  |  ------------------
  ------------------
  483|       |
  484|  1.75M|    return (map & letter)!=0;
  ------------------
  |  |   69|  1.75M|#define letter      2u
  ------------------
  485|  1.75M|}
prvTidyIsHTMLSpace:
  488|  1.90M|{
  489|  1.90M|    return c == 0x020 || c == 0x009 || c == 0x00a || c == 0x00c || c == 0x00d;
  ------------------
  |  Branch (489:12): [True: 22.5k, False: 1.88M]
  |  Branch (489:26): [True: 720, False: 1.88M]
  |  Branch (489:40): [True: 1.11k, False: 1.88M]
  |  Branch (489:54): [True: 28.4k, False: 1.85M]
  |  Branch (489:68): [True: 519, False: 1.85M]
  ------------------
  490|  1.90M|}
prvTidyIsNamechar:
  493|  9.91M|{
  494|  9.91M|    uint map = MAP(c);
  ------------------
  |  |  206|  9.91M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 9.83M, False: 79.5k]
  |  |  ------------------
  ------------------
  495|  9.91M|    return (map & namechar)!=0;
  ------------------
  |  |   70|  9.91M|#define namechar    4u
  ------------------
  496|  9.91M|}
prvTidyIsXMLLetter:
  499|   898k|{
  500|   898k|    return ((c >= 0x41 && c <= 0x5a) ||
  ------------------
  |  Branch (500:14): [True: 868k, False: 29.4k]
  |  Branch (500:27): [True: 40.7k, False: 828k]
  ------------------
  501|   857k|        (c >= 0x61 && c <= 0x7a) ||
  ------------------
  |  Branch (501:10): [True: 826k, False: 31.3k]
  |  Branch (501:23): [True: 586k, False: 240k]
  ------------------
  502|   271k|        (c >= 0xc0 && c <= 0xd6) ||
  ------------------
  |  Branch (502:10): [True: 239k, False: 32.1k]
  |  Branch (502:23): [True: 338, False: 238k]
  ------------------
  503|   271k|        (c >= 0xd8 && c <= 0xf6) ||
  ------------------
  |  Branch (503:10): [True: 238k, False: 32.1k]
  |  Branch (503:23): [True: 474, False: 238k]
  ------------------
  504|   270k|        (c >= 0xf8 && c <= 0xff) ||
  ------------------
  |  Branch (504:10): [True: 238k, False: 32.1k]
  |  Branch (504:23): [True: 271, False: 238k]
  ------------------
  505|   270k|        (c >= 0x100 && c <= 0x131) ||
  ------------------
  |  Branch (505:10): [True: 238k, False: 32.1k]
  |  Branch (505:24): [True: 228, False: 238k]
  ------------------
  506|   270k|        (c >= 0x134 && c <= 0x13e) ||
  ------------------
  |  Branch (506:10): [True: 238k, False: 32.1k]
  |  Branch (506:24): [True: 262, False: 237k]
  ------------------
  507|   269k|        (c >= 0x141 && c <= 0x148) ||
  ------------------
  |  Branch (507:10): [True: 237k, False: 32.1k]
  |  Branch (507:24): [True: 202, False: 237k]
  ------------------
  508|   269k|        (c >= 0x14a && c <= 0x17e) ||
  ------------------
  |  Branch (508:10): [True: 237k, False: 32.1k]
  |  Branch (508:24): [True: 797, False: 236k]
  ------------------
  509|   268k|        (c >= 0x180 && c <= 0x1c3) ||
  ------------------
  |  Branch (509:10): [True: 236k, False: 32.1k]
  |  Branch (509:24): [True: 635, False: 236k]
  ------------------
  510|   268k|        (c >= 0x1cd && c <= 0x1f0) ||
  ------------------
  |  Branch (510:10): [True: 236k, False: 32.1k]
  |  Branch (510:24): [True: 800, False: 235k]
  ------------------
  511|   267k|        (c >= 0x1f4 && c <= 0x1f5) ||
  ------------------
  |  Branch (511:10): [True: 235k, False: 32.1k]
  |  Branch (511:24): [True: 198, False: 235k]
  ------------------
  512|   267k|        (c >= 0x1fa && c <= 0x217) ||
  ------------------
  |  Branch (512:10): [True: 235k, False: 32.1k]
  |  Branch (512:24): [True: 702, False: 234k]
  ------------------
  513|   266k|        (c >= 0x250 && c <= 0x2a8) ||
  ------------------
  |  Branch (513:10): [True: 234k, False: 32.1k]
  |  Branch (513:24): [True: 679, False: 233k]
  ------------------
  514|   265k|        (c >= 0x2bb && c <= 0x2c1) ||
  ------------------
  |  Branch (514:10): [True: 233k, False: 32.1k]
  |  Branch (514:24): [True: 925, False: 232k]
  ------------------
  515|   264k|        c == 0x386 ||
  ------------------
  |  Branch (515:9): [True: 563, False: 264k]
  ------------------
  516|   264k|        (c >= 0x388 && c <= 0x38a) ||
  ------------------
  |  Branch (516:10): [True: 228k, False: 35.4k]
  |  Branch (516:24): [True: 301, False: 228k]
  ------------------
  517|   264k|        c == 0x38c ||
  ------------------
  |  Branch (517:9): [True: 200, False: 263k]
  ------------------
  518|   263k|        (c >= 0x38e && c <= 0x3a1) ||
  ------------------
  |  Branch (518:10): [True: 228k, False: 35.4k]
  |  Branch (518:24): [True: 1.42k, False: 227k]
  ------------------
  519|   262k|        (c >= 0x3a3 && c <= 0x3ce) ||
  ------------------
  |  Branch (519:10): [True: 227k, False: 35.4k]
  |  Branch (519:24): [True: 919, False: 226k]
  ------------------
  520|   261k|        (c >= 0x3d0 && c <= 0x3d6) ||
  ------------------
  |  Branch (520:10): [True: 226k, False: 35.4k]
  |  Branch (520:24): [True: 1.02k, False: 225k]
  ------------------
  521|   260k|        c == 0x3da ||
  ------------------
  |  Branch (521:9): [True: 283, False: 260k]
  ------------------
  522|   260k|        c == 0x3dc ||
  ------------------
  |  Branch (522:9): [True: 206, False: 260k]
  ------------------
  523|   260k|        c == 0x3de ||
  ------------------
  |  Branch (523:9): [True: 586, False: 259k]
  ------------------
  524|   259k|        c == 0x3e0 ||
  ------------------
  |  Branch (524:9): [True: 339, False: 259k]
  ------------------
  525|   259k|        (c >= 0x3e2 && c <= 0x3f3) ||
  ------------------
  |  Branch (525:10): [True: 223k, False: 35.4k]
  |  Branch (525:24): [True: 448, False: 223k]
  ------------------
  526|   258k|        (c >= 0x401 && c <= 0x40c) ||
  ------------------
  |  Branch (526:10): [True: 223k, False: 35.4k]
  |  Branch (526:24): [True: 832, False: 222k]
  ------------------
  527|   257k|        (c >= 0x40e && c <= 0x44f) ||
  ------------------
  |  Branch (527:10): [True: 222k, False: 35.4k]
  |  Branch (527:24): [True: 216, False: 222k]
  ------------------
  528|   257k|        (c >= 0x451 && c <= 0x45c) ||
  ------------------
  |  Branch (528:10): [True: 222k, False: 35.4k]
  |  Branch (528:24): [True: 329, False: 221k]
  ------------------
  529|   257k|        (c >= 0x45e && c <= 0x481) ||
  ------------------
  |  Branch (529:10): [True: 221k, False: 35.4k]
  |  Branch (529:24): [True: 451, False: 221k]
  ------------------
  530|   256k|        (c >= 0x490 && c <= 0x4c4) ||
  ------------------
  |  Branch (530:10): [True: 221k, False: 35.7k]
  |  Branch (530:24): [True: 1.51k, False: 219k]
  ------------------
  531|   255k|        (c >= 0x4c7 && c <= 0x4c8) ||
  ------------------
  |  Branch (531:10): [True: 219k, False: 35.7k]
  |  Branch (531:24): [True: 203, False: 219k]
  ------------------
  532|   255k|        (c >= 0x4cb && c <= 0x4cc) ||
  ------------------
  |  Branch (532:10): [True: 219k, False: 35.7k]
  |  Branch (532:24): [True: 198, False: 219k]
  ------------------
  533|   254k|        (c >= 0x4d0 && c <= 0x4eb) ||
  ------------------
  |  Branch (533:10): [True: 219k, False: 35.7k]
  |  Branch (533:24): [True: 316, False: 218k]
  ------------------
  534|   254k|        (c >= 0x4ee && c <= 0x4f5) ||
  ------------------
  |  Branch (534:10): [True: 218k, False: 35.7k]
  |  Branch (534:24): [True: 250, False: 218k]
  ------------------
  535|   254k|        (c >= 0x4f8 && c <= 0x4f9) ||
  ------------------
  |  Branch (535:10): [True: 218k, False: 35.7k]
  |  Branch (535:24): [True: 265, False: 218k]
  ------------------
  536|   254k|        (c >= 0x531 && c <= 0x556) ||
  ------------------
  |  Branch (536:10): [True: 218k, False: 35.8k]
  |  Branch (536:24): [True: 1.12k, False: 217k]
  ------------------
  537|   253k|        c == 0x559 ||
  ------------------
  |  Branch (537:9): [True: 628, False: 252k]
  ------------------
  538|   252k|        (c >= 0x561 && c <= 0x586) ||
  ------------------
  |  Branch (538:10): [True: 216k, False: 35.8k]
  |  Branch (538:24): [True: 314, False: 216k]
  ------------------
  539|   252k|        (c >= 0x5d0 && c <= 0x5ea) ||
  ------------------
  |  Branch (539:10): [True: 212k, False: 39.5k]
  |  Branch (539:24): [True: 706, False: 211k]
  ------------------
  540|   251k|        (c >= 0x5f0 && c <= 0x5f2) ||
  ------------------
  |  Branch (540:10): [True: 211k, False: 39.5k]
  |  Branch (540:24): [True: 474, False: 211k]
  ------------------
  541|   250k|        (c >= 0x621 && c <= 0x63a) ||
  ------------------
  |  Branch (541:10): [True: 211k, False: 39.5k]
  |  Branch (541:24): [True: 1.62k, False: 209k]
  ------------------
  542|   249k|        (c >= 0x641 && c <= 0x64a) ||
  ------------------
  |  Branch (542:10): [True: 209k, False: 39.8k]
  |  Branch (542:24): [True: 285, False: 209k]
  ------------------
  543|   248k|        (c >= 0x671 && c <= 0x6b7) ||
  ------------------
  |  Branch (543:10): [True: 206k, False: 42.1k]
  |  Branch (543:24): [True: 1.38k, False: 205k]
  ------------------
  544|   247k|        (c >= 0x6ba && c <= 0x6be) ||
  ------------------
  |  Branch (544:10): [True: 205k, False: 42.1k]
  |  Branch (544:24): [True: 1.98k, False: 203k]
  ------------------
  545|   245k|        (c >= 0x6c0 && c <= 0x6ce) ||
  ------------------
  |  Branch (545:10): [True: 203k, False: 42.1k]
  |  Branch (545:24): [True: 304, False: 203k]
  ------------------
  546|   245k|        (c >= 0x6d0 && c <= 0x6d3) ||
  ------------------
  |  Branch (546:10): [True: 203k, False: 42.1k]
  |  Branch (546:24): [True: 606, False: 202k]
  ------------------
  547|   244k|        c == 0x6d5 ||
  ------------------
  |  Branch (547:9): [True: 572, False: 244k]
  ------------------
  548|   244k|        (c >= 0x6e5 && c <= 0x6e6) ||
  ------------------
  |  Branch (548:10): [True: 198k, False: 45.4k]
  |  Branch (548:24): [True: 385, False: 198k]
  ------------------
  549|   243k|        (c >= 0x905 && c <= 0x939) ||
  ------------------
  |  Branch (549:10): [True: 193k, False: 50.5k]
  |  Branch (549:24): [True: 505, False: 192k]
  ------------------
  550|   243k|        c == 0x93d ||
  ------------------
  |  Branch (550:9): [True: 433, False: 242k]
  ------------------
  551|   242k|        (c >= 0x958 && c <= 0x961) ||
  ------------------
  |  Branch (551:10): [True: 189k, False: 52.8k]
  |  Branch (551:24): [True: 510, False: 189k]
  ------------------
  552|   242k|        (c >= 0x985 && c <= 0x98c) ||
  ------------------
  |  Branch (552:10): [True: 188k, False: 54.0k]
  |  Branch (552:24): [True: 453, False: 187k]
  ------------------
  553|   241k|        (c >= 0x98f && c <= 0x990) ||
  ------------------
  |  Branch (553:10): [True: 187k, False: 54.0k]
  |  Branch (553:24): [True: 399, False: 187k]
  ------------------
  554|   241k|        (c >= 0x993 && c <= 0x9a8) ||
  ------------------
  |  Branch (554:10): [True: 187k, False: 54.0k]
  |  Branch (554:24): [True: 720, False: 186k]
  ------------------
  555|   240k|        (c >= 0x9aa && c <= 0x9b0) ||
  ------------------
  |  Branch (555:10): [True: 186k, False: 54.0k]
  |  Branch (555:24): [True: 864, False: 185k]
  ------------------
  556|   239k|        c == 0x9b2 ||
  ------------------
  |  Branch (556:9): [True: 206, False: 239k]
  ------------------
  557|   239k|        (c >= 0x9b6 && c <= 0x9b9) ||
  ------------------
  |  Branch (557:10): [True: 185k, False: 54.0k]
  |  Branch (557:24): [True: 464, False: 185k]
  ------------------
  558|   239k|        (c >= 0x9dc && c <= 0x9dd) ||
  ------------------
  |  Branch (558:10): [True: 182k, False: 56.8k]
  |  Branch (558:24): [True: 511, False: 181k]
  ------------------
  559|   238k|        (c >= 0x9df && c <= 0x9e1) ||
  ------------------
  |  Branch (559:10): [True: 181k, False: 56.8k]
  |  Branch (559:24): [True: 751, False: 181k]
  ------------------
  560|   237k|        (c >= 0x9f0 && c <= 0x9f1) ||
  ------------------
  |  Branch (560:10): [True: 180k, False: 57.7k]
  |  Branch (560:24): [True: 377, False: 179k]
  ------------------
  561|   237k|        (c >= 0xa05 && c <= 0xa0a) ||
  ------------------
  |  Branch (561:10): [True: 178k, False: 58.9k]
  |  Branch (561:24): [True: 2.49k, False: 176k]
  ------------------
  562|   235k|        (c >= 0xa0f && c <= 0xa10) ||
  ------------------
  |  Branch (562:10): [True: 176k, False: 58.9k]
  |  Branch (562:24): [True: 815, False: 175k]
  ------------------
  563|   234k|        (c >= 0xa13 && c <= 0xa28) ||
  ------------------
  |  Branch (563:10): [True: 175k, False: 58.9k]
  |  Branch (563:24): [True: 210, False: 175k]
  ------------------
  564|   234k|        (c >= 0xa2a && c <= 0xa30) ||
  ------------------
  |  Branch (564:10): [True: 175k, False: 58.9k]
  |  Branch (564:24): [True: 1.24k, False: 173k]
  ------------------
  565|   232k|        (c >= 0xa32 && c <= 0xa33) ||
  ------------------
  |  Branch (565:10): [True: 173k, False: 58.9k]
  |  Branch (565:24): [True: 416, False: 173k]
  ------------------
  566|   232k|        (c >= 0xa35 && c <= 0xa36) ||
  ------------------
  |  Branch (566:10): [True: 173k, False: 58.9k]
  |  Branch (566:24): [True: 803, False: 172k]
  ------------------
  567|   231k|        (c >= 0xa38 && c <= 0xa39) ||
  ------------------
  |  Branch (567:10): [True: 172k, False: 58.9k]
  |  Branch (567:24): [True: 1.05k, False: 171k]
  ------------------
  568|   230k|        (c >= 0xa59 && c <= 0xa5c) ||
  ------------------
  |  Branch (568:10): [True: 168k, False: 61.6k]
  |  Branch (568:24): [True: 1.35k, False: 167k]
  ------------------
  569|   229k|        c == 0xa5e ||
  ------------------
  |  Branch (569:9): [True: 524, False: 228k]
  ------------------
  570|   228k|        (c >= 0xa72 && c <= 0xa74) ||
  ------------------
  |  Branch (570:10): [True: 165k, False: 63.1k]
  |  Branch (570:24): [True: 614, False: 164k]
  ------------------
  571|   228k|        (c >= 0xa85 && c <= 0xa8b) ||
  ------------------
  |  Branch (571:10): [True: 164k, False: 63.5k]
  |  Branch (571:24): [True: 1.60k, False: 162k]
  ------------------
  572|   226k|        c == 0xa8d ||
  ------------------
  |  Branch (572:9): [True: 254, False: 226k]
  ------------------
  573|   226k|        (c >= 0xa8f && c <= 0xa91) ||
  ------------------
  |  Branch (573:10): [True: 162k, False: 63.5k]
  |  Branch (573:24): [True: 548, False: 162k]
  ------------------
  574|   225k|        (c >= 0xa93 && c <= 0xaa8) ||
  ------------------
  |  Branch (574:10): [True: 162k, False: 63.5k]
  |  Branch (574:24): [True: 1.23k, False: 160k]
  ------------------
  575|   224k|        (c >= 0xaaa && c <= 0xab0) ||
  ------------------
  |  Branch (575:10): [True: 160k, False: 63.5k]
  |  Branch (575:24): [True: 1.94k, False: 158k]
  ------------------
  576|   222k|        (c >= 0xab2 && c <= 0xab3) ||
  ------------------
  |  Branch (576:10): [True: 158k, False: 63.5k]
  |  Branch (576:24): [True: 906, False: 157k]
  ------------------
  577|   221k|        (c >= 0xab5 && c <= 0xab9) ||
  ------------------
  |  Branch (577:10): [True: 157k, False: 63.5k]
  |  Branch (577:24): [True: 1.28k, False: 156k]
  ------------------
  578|   220k|        c == 0xabd ||
  ------------------
  |  Branch (578:9): [True: 196, False: 220k]
  ------------------
  579|   220k|        c == 0xae0 ||
  ------------------
  |  Branch (579:9): [True: 204, False: 219k]
  ------------------
  580|   219k|        (c >= 0xb05 && c <= 0xb0c) ||
  ------------------
  |  Branch (580:10): [True: 152k, False: 67.1k]
  |  Branch (580:24): [True: 1.00k, False: 151k]
  ------------------
  581|   218k|        (c >= 0xb0f && c <= 0xb10) ||
  ------------------
  |  Branch (581:10): [True: 151k, False: 67.1k]
  |  Branch (581:24): [True: 305, False: 151k]
  ------------------
  582|   218k|        (c >= 0xb13 && c <= 0xb28) ||
  ------------------
  |  Branch (582:10): [True: 151k, False: 67.1k]
  |  Branch (582:24): [True: 299, False: 151k]
  ------------------
  583|   218k|        (c >= 0xb2a && c <= 0xb30) ||
  ------------------
  |  Branch (583:10): [True: 151k, False: 67.1k]
  |  Branch (583:24): [True: 1.37k, False: 149k]
  ------------------
  584|   216k|        (c >= 0xb32 && c <= 0xb33) ||
  ------------------
  |  Branch (584:10): [True: 149k, False: 67.1k]
  |  Branch (584:24): [True: 708, False: 148k]
  ------------------
  585|   216k|        (c >= 0xb36 && c <= 0xb39) ||
  ------------------
  |  Branch (585:10): [True: 148k, False: 67.1k]
  |  Branch (585:24): [True: 1.39k, False: 147k]
  ------------------
  586|   214k|        c == 0xb3d ||
  ------------------
  |  Branch (586:9): [True: 374, False: 214k]
  ------------------
  587|   214k|        (c >= 0xb5c && c <= 0xb5d) ||
  ------------------
  |  Branch (587:10): [True: 144k, False: 69.7k]
  |  Branch (587:24): [True: 525, False: 144k]
  ------------------
  588|   213k|        (c >= 0xb5f && c <= 0xb61) ||
  ------------------
  |  Branch (588:10): [True: 144k, False: 69.7k]
  |  Branch (588:24): [True: 1.27k, False: 142k]
  ------------------
  589|   212k|        (c >= 0xb85 && c <= 0xb8a) ||
  ------------------
  |  Branch (589:10): [True: 142k, False: 70.4k]
  |  Branch (589:24): [True: 1.13k, False: 141k]
  ------------------
  590|   211k|        (c >= 0xb8e && c <= 0xb90) ||
  ------------------
  |  Branch (590:10): [True: 141k, False: 70.4k]
  |  Branch (590:24): [True: 1.49k, False: 139k]
  ------------------
  591|   209k|        (c >= 0xb92 && c <= 0xb95) ||
  ------------------
  |  Branch (591:10): [True: 139k, False: 70.4k]
  |  Branch (591:24): [True: 607, False: 138k]
  ------------------
  592|   209k|        (c >= 0xb99 && c <= 0xb9a) ||
  ------------------
  |  Branch (592:10): [True: 138k, False: 70.4k]
  |  Branch (592:24): [True: 1.11k, False: 137k]
  ------------------
  593|   208k|        c == 0xb9c ||
  ------------------
  |  Branch (593:9): [True: 1.16k, False: 207k]
  ------------------
  594|   207k|        (c >= 0xb9e && c <= 0xb9f) ||
  ------------------
  |  Branch (594:10): [True: 136k, False: 70.4k]
  |  Branch (594:24): [True: 789, False: 135k]
  ------------------
  595|   206k|        (c >= 0xba3 && c <= 0xba4) ||
  ------------------
  |  Branch (595:10): [True: 135k, False: 70.4k]
  |  Branch (595:24): [True: 292, False: 135k]
  ------------------
  596|   205k|        (c >= 0xba8 && c <= 0xbaa) ||
  ------------------
  |  Branch (596:10): [True: 135k, False: 70.4k]
  |  Branch (596:24): [True: 208, False: 135k]
  ------------------
  597|   205k|        (c >= 0xbae && c <= 0xbb5) ||
  ------------------
  |  Branch (597:10): [True: 135k, False: 70.4k]
  |  Branch (597:24): [True: 261, False: 135k]
  ------------------
  598|   205k|        (c >= 0xbb7 && c <= 0xbb9) ||
  ------------------
  |  Branch (598:10): [True: 135k, False: 70.4k]
  |  Branch (598:24): [True: 1.34k, False: 133k]
  ------------------
  599|   204k|        (c >= 0xc05 && c <= 0xc0c) ||
  ------------------
  |  Branch (599:10): [True: 128k, False: 75.2k]
  |  Branch (599:24): [True: 256, False: 128k]
  ------------------
  600|   203k|        (c >= 0xc0e && c <= 0xc10) ||
  ------------------
  |  Branch (600:10): [True: 128k, False: 75.2k]
  |  Branch (600:24): [True: 606, False: 128k]
  ------------------
  601|   203k|        (c >= 0xc12 && c <= 0xc28) ||
  ------------------
  |  Branch (601:10): [True: 128k, False: 75.2k]
  |  Branch (601:24): [True: 650, False: 127k]
  ------------------
  602|   202k|        (c >= 0xc2a && c <= 0xc33) ||
  ------------------
  |  Branch (602:10): [True: 127k, False: 75.2k]
  |  Branch (602:24): [True: 216, False: 127k]
  ------------------
  603|   202k|        (c >= 0xc35 && c <= 0xc39) ||
  ------------------
  |  Branch (603:10): [True: 127k, False: 75.2k]
  |  Branch (603:24): [True: 199, False: 127k]
  ------------------
  604|   202k|        (c >= 0xc60 && c <= 0xc61) ||
  ------------------
  |  Branch (604:10): [True: 123k, False: 78.4k]
  |  Branch (604:24): [True: 247, False: 123k]
  ------------------
  605|   202k|        (c >= 0xc85 && c <= 0xc8c) ||
  ------------------
  |  Branch (605:10): [True: 122k, False: 79.6k]
  |  Branch (605:24): [True: 1.08k, False: 121k]
  ------------------
  606|   200k|        (c >= 0xc8e && c <= 0xc90) ||
  ------------------
  |  Branch (606:10): [True: 121k, False: 79.6k]
  |  Branch (606:24): [True: 387, False: 120k]
  ------------------
  607|   200k|        (c >= 0xc92 && c <= 0xca8) ||
  ------------------
  |  Branch (607:10): [True: 120k, False: 79.6k]
  |  Branch (607:24): [True: 1.26k, False: 119k]
  ------------------
  608|   199k|        (c >= 0xcaa && c <= 0xcb3) ||
  ------------------
  |  Branch (608:10): [True: 119k, False: 79.6k]
  |  Branch (608:24): [True: 2.96k, False: 116k]
  ------------------
  609|   196k|        (c >= 0xcb5 && c <= 0xcb9) ||
  ------------------
  |  Branch (609:10): [True: 116k, False: 79.6k]
  |  Branch (609:24): [True: 1.22k, False: 115k]
  ------------------
  610|   195k|        c == 0xcde ||
  ------------------
  |  Branch (610:9): [True: 212, False: 194k]
  ------------------
  611|   194k|        (c >= 0xce0 && c <= 0xce1) ||
  ------------------
  |  Branch (611:10): [True: 111k, False: 83.6k]
  |  Branch (611:24): [True: 596, False: 110k]
  ------------------
  612|   194k|        (c >= 0xd05 && c <= 0xd0c) ||
  ------------------
  |  Branch (612:10): [True: 109k, False: 84.8k]
  |  Branch (612:24): [True: 194, False: 109k]
  ------------------
  613|   194k|        (c >= 0xd0e && c <= 0xd10) ||
  ------------------
  |  Branch (613:10): [True: 109k, False: 84.8k]
  |  Branch (613:24): [True: 391, False: 108k]
  ------------------
  614|   193k|        (c >= 0xd12 && c <= 0xd28) ||
  ------------------
  |  Branch (614:10): [True: 108k, False: 84.8k]
  |  Branch (614:24): [True: 259, False: 108k]
  ------------------
  615|   193k|        (c >= 0xd2a && c <= 0xd39) ||
  ------------------
  |  Branch (615:10): [True: 108k, False: 84.8k]
  |  Branch (615:24): [True: 682, False: 107k]
  ------------------
  616|   192k|        (c >= 0xd60 && c <= 0xd61) ||
  ------------------
  |  Branch (616:10): [True: 104k, False: 88.5k]
  |  Branch (616:24): [True: 273, False: 103k]
  ------------------
  617|   192k|        (c >= 0xe01 && c <= 0xe2e) ||
  ------------------
  |  Branch (617:10): [True: 103k, False: 89.1k]
  |  Branch (617:24): [True: 517, False: 102k]
  ------------------
  618|   191k|        c == 0xe30 ||
  ------------------
  |  Branch (618:9): [True: 480, False: 191k]
  ------------------
  619|   191k|        (c >= 0xe32 && c <= 0xe33) ||
  ------------------
  |  Branch (619:10): [True: 102k, False: 89.4k]
  |  Branch (619:24): [True: 2.70k, False: 99.3k]
  ------------------
  620|   188k|        (c >= 0xe40 && c <= 0xe45) ||
  ------------------
  |  Branch (620:10): [True: 97.7k, False: 90.9k]
  |  Branch (620:24): [True: 674, False: 97.1k]
  ------------------
  621|   188k|        (c >= 0xe81 && c <= 0xe82) ||
  ------------------
  |  Branch (621:10): [True: 95.3k, False: 92.7k]
  |  Branch (621:24): [True: 467, False: 94.9k]
  ------------------
  622|   187k|        c == 0xe84 ||
  ------------------
  |  Branch (622:9): [True: 456, False: 187k]
  ------------------
  623|   187k|        (c >= 0xe87 && c <= 0xe88) ||
  ------------------
  |  Branch (623:10): [True: 94.3k, False: 92.8k]
  |  Branch (623:24): [True: 514, False: 93.8k]
  ------------------
  624|   186k|        c == 0xe8a ||
  ------------------
  |  Branch (624:9): [True: 523, False: 186k]
  ------------------
  625|   186k|        c == 0xe8d ||
  ------------------
  |  Branch (625:9): [True: 427, False: 185k]
  ------------------
  626|   185k|        (c >= 0xe94 && c <= 0xe97) ||
  ------------------
  |  Branch (626:10): [True: 92.8k, False: 92.8k]
  |  Branch (626:24): [True: 273, False: 92.6k]
  ------------------
  627|   185k|        (c >= 0xe99 && c <= 0xe9f) ||
  ------------------
  |  Branch (627:10): [True: 92.6k, False: 92.8k]
  |  Branch (627:24): [True: 3.21k, False: 89.3k]
  ------------------
  628|   182k|        (c >= 0xea1 && c <= 0xea3) ||
  ------------------
  |  Branch (628:10): [True: 89.3k, False: 92.8k]
  |  Branch (628:24): [True: 1.02k, False: 88.3k]
  ------------------
  629|   181k|        c == 0xea5 ||
  ------------------
  |  Branch (629:9): [True: 207, False: 181k]
  ------------------
  630|   181k|        c == 0xea7 ||
  ------------------
  |  Branch (630:9): [True: 232, False: 180k]
  ------------------
  631|   180k|        (c >= 0xeaa && c <= 0xeab) ||
  ------------------
  |  Branch (631:10): [True: 87.9k, False: 92.8k]
  |  Branch (631:24): [True: 549, False: 87.3k]
  ------------------
  632|   180k|        (c >= 0xead && c <= 0xeae) ||
  ------------------
  |  Branch (632:10): [True: 87.3k, False: 92.8k]
  |  Branch (632:24): [True: 426, False: 86.9k]
  ------------------
  633|   179k|        c == 0xeb0 ||
  ------------------
  |  Branch (633:9): [True: 252, False: 179k]
  ------------------
  634|   179k|        (c >= 0xeb2 && c <= 0xeb3) ||
  ------------------
  |  Branch (634:10): [True: 86.4k, False: 93.0k]
  |  Branch (634:24): [True: 1.28k, False: 85.1k]
  ------------------
  635|   178k|        c == 0xebd ||
  ------------------
  |  Branch (635:9): [True: 1.04k, False: 177k]
  ------------------
  636|   177k|        (c >= 0xec0 && c <= 0xec4) ||
  ------------------
  |  Branch (636:10): [True: 83.1k, False: 94.1k]
  |  Branch (636:24): [True: 262, False: 82.8k]
  ------------------
  637|   176k|        (c >= 0xf40 && c <= 0xf47) ||
  ------------------
  |  Branch (637:10): [True: 78.7k, False: 98.2k]
  |  Branch (637:24): [True: 481, False: 78.2k]
  ------------------
  638|   176k|        (c >= 0xf49 && c <= 0xf69) ||
  ------------------
  |  Branch (638:10): [True: 78.2k, False: 98.2k]
  |  Branch (638:24): [True: 327, False: 77.9k]
  ------------------
  639|   176k|        (c >= 0x10a0 && c <= 0x10c5) ||
  ------------------
  |  Branch (639:10): [True: 71.4k, False: 104k]
  |  Branch (639:25): [True: 497, False: 70.9k]
  ------------------
  640|   175k|        (c >= 0x10d0 && c <= 0x10f6) ||
  ------------------
  |  Branch (640:10): [True: 70.9k, False: 104k]
  |  Branch (640:25): [True: 710, False: 70.2k]
  ------------------
  641|   174k|        c == 0x1100 ||
  ------------------
  |  Branch (641:9): [True: 795, False: 174k]
  ------------------
  642|   174k|        (c >= 0x1102 && c <= 0x1103) ||
  ------------------
  |  Branch (642:10): [True: 69.4k, False: 104k]
  |  Branch (642:25): [True: 1.64k, False: 67.7k]
  ------------------
  643|   172k|        (c >= 0x1105 && c <= 0x1107) ||
  ------------------
  |  Branch (643:10): [True: 67.7k, False: 104k]
  |  Branch (643:25): [True: 1.96k, False: 65.8k]
  ------------------
  644|   170k|        c == 0x1109 ||
  ------------------
  |  Branch (644:9): [True: 202, False: 170k]
  ------------------
  645|   170k|        (c >= 0x110b && c <= 0x110c) ||
  ------------------
  |  Branch (645:10): [True: 65.6k, False: 104k]
  |  Branch (645:25): [True: 253, False: 65.3k]
  ------------------
  646|   170k|        (c >= 0x110e && c <= 0x1112) ||
  ------------------
  |  Branch (646:10): [True: 65.3k, False: 104k]
  |  Branch (646:25): [True: 2.29k, False: 63.0k]
  ------------------
  647|   167k|        c == 0x113c ||
  ------------------
  |  Branch (647:9): [True: 204, False: 167k]
  ------------------
  648|   167k|        c == 0x113e ||
  ------------------
  |  Branch (648:9): [True: 507, False: 167k]
  ------------------
  649|   167k|        c == 0x1140 ||
  ------------------
  |  Branch (649:9): [True: 319, False: 166k]
  ------------------
  650|   166k|        c == 0x114c ||
  ------------------
  |  Branch (650:9): [True: 299, False: 166k]
  ------------------
  651|   166k|        c == 0x114e ||
  ------------------
  |  Branch (651:9): [True: 1.80k, False: 164k]
  ------------------
  652|   164k|        c == 0x1150 ||
  ------------------
  |  Branch (652:9): [True: 315, False: 164k]
  ------------------
  653|   164k|        (c >= 0x1154 && c <= 0x1155) ||
  ------------------
  |  Branch (653:10): [True: 59.6k, False: 104k]
  |  Branch (653:25): [True: 2.06k, False: 57.5k]
  ------------------
  654|   162k|        c == 0x1159 ||
  ------------------
  |  Branch (654:9): [True: 200, False: 162k]
  ------------------
  655|   162k|        (c >= 0x115f && c <= 0x1161) ||
  ------------------
  |  Branch (655:10): [True: 57.3k, False: 104k]
  |  Branch (655:25): [True: 258, False: 57.0k]
  ------------------
  656|   161k|        c == 0x1163 ||
  ------------------
  |  Branch (656:9): [True: 221, False: 161k]
  ------------------
  657|   161k|        c == 0x1165 ||
  ------------------
  |  Branch (657:9): [True: 204, False: 161k]
  ------------------
  658|   161k|        c == 0x1167 ||
  ------------------
  |  Branch (658:9): [True: 906, False: 160k]
  ------------------
  659|   160k|        c == 0x1169 ||
  ------------------
  |  Branch (659:9): [True: 557, False: 159k]
  ------------------
  660|   159k|        (c >= 0x116d && c <= 0x116e) ||
  ------------------
  |  Branch (660:10): [True: 55.1k, False: 104k]
  |  Branch (660:25): [True: 562, False: 54.6k]
  ------------------
  661|   159k|        (c >= 0x1172 && c <= 0x1173) ||
  ------------------
  |  Branch (661:10): [True: 54.6k, False: 104k]
  |  Branch (661:25): [True: 690, False: 53.9k]
  ------------------
  662|   158k|        c == 0x1175 ||
  ------------------
  |  Branch (662:9): [True: 525, False: 158k]
  ------------------
  663|   158k|        c == 0x119e ||
  ------------------
  |  Branch (663:9): [True: 277, False: 157k]
  ------------------
  664|   157k|        c == 0x11a8 ||
  ------------------
  |  Branch (664:9): [True: 684, False: 157k]
  ------------------
  665|   157k|        c == 0x11ab ||
  ------------------
  |  Branch (665:9): [True: 271, False: 156k]
  ------------------
  666|   156k|        (c >= 0x11ae && c <= 0x11af) ||
  ------------------
  |  Branch (666:10): [True: 52.1k, False: 104k]
  |  Branch (666:25): [True: 197, False: 51.9k]
  ------------------
  667|   156k|        (c >= 0x11b7 && c <= 0x11b8) ||
  ------------------
  |  Branch (667:10): [True: 51.9k, False: 104k]
  |  Branch (667:25): [True: 336, False: 51.6k]
  ------------------
  668|   156k|        c == 0x11ba ||
  ------------------
  |  Branch (668:9): [True: 195, False: 156k]
  ------------------
  669|   156k|        (c >= 0x11bc && c <= 0x11c2) ||
  ------------------
  |  Branch (669:10): [True: 51.4k, False: 104k]
  |  Branch (669:25): [True: 468, False: 50.9k]
  ------------------
  670|   155k|        c == 0x11eb ||
  ------------------
  |  Branch (670:9): [True: 196, False: 155k]
  ------------------
  671|   155k|        c == 0x11f0 ||
  ------------------
  |  Branch (671:9): [True: 540, False: 154k]
  ------------------
  672|   154k|        c == 0x11f9 ||
  ------------------
  |  Branch (672:9): [True: 506, False: 154k]
  ------------------
  673|   154k|        (c >= 0x1e00 && c <= 0x1e9b) ||
  ------------------
  |  Branch (673:10): [True: 49.6k, False: 104k]
  |  Branch (673:25): [True: 1.04k, False: 48.6k]
  ------------------
  674|   153k|        (c >= 0x1ea0 && c <= 0x1ef9) ||
  ------------------
  |  Branch (674:10): [True: 48.6k, False: 104k]
  |  Branch (674:25): [True: 605, False: 48.0k]
  ------------------
  675|   152k|        (c >= 0x1f00 && c <= 0x1f15) ||
  ------------------
  |  Branch (675:10): [True: 48.0k, False: 104k]
  |  Branch (675:25): [True: 491, False: 47.5k]
  ------------------
  676|   152k|        (c >= 0x1f18 && c <= 0x1f1d) ||
  ------------------
  |  Branch (676:10): [True: 47.5k, False: 104k]
  |  Branch (676:25): [True: 387, False: 47.1k]
  ------------------
  677|   151k|        (c >= 0x1f20 && c <= 0x1f45) ||
  ------------------
  |  Branch (677:10): [True: 47.1k, False: 104k]
  |  Branch (677:25): [True: 1.15k, False: 45.9k]
  ------------------
  678|   150k|        (c >= 0x1f48 && c <= 0x1f4d) ||
  ------------------
  |  Branch (678:10): [True: 45.9k, False: 104k]
  |  Branch (678:25): [True: 471, False: 45.4k]
  ------------------
  679|   150k|        (c >= 0x1f50 && c <= 0x1f57) ||
  ------------------
  |  Branch (679:10): [True: 45.4k, False: 104k]
  |  Branch (679:25): [True: 196, False: 45.3k]
  ------------------
  680|   150k|        c == 0x1f59 ||
  ------------------
  |  Branch (680:9): [True: 454, False: 149k]
  ------------------
  681|   149k|        c == 0x1f5b ||
  ------------------
  |  Branch (681:9): [True: 243, False: 149k]
  ------------------
  682|   149k|        c == 0x1f5d ||
  ------------------
  |  Branch (682:9): [True: 205, False: 149k]
  ------------------
  683|   149k|        (c >= 0x1f5f && c <= 0x1f7d) ||
  ------------------
  |  Branch (683:10): [True: 44.3k, False: 104k]
  |  Branch (683:25): [True: 403, False: 43.9k]
  ------------------
  684|   148k|        (c >= 0x1f80 && c <= 0x1fb4) ||
  ------------------
  |  Branch (684:10): [True: 43.9k, False: 104k]
  |  Branch (684:25): [True: 1.19k, False: 42.8k]
  ------------------
  685|   147k|        (c >= 0x1fb6 && c <= 0x1fbc) ||
  ------------------
  |  Branch (685:10): [True: 42.7k, False: 104k]
  |  Branch (685:25): [True: 708, False: 42.0k]
  ------------------
  686|   146k|        c == 0x1fbe ||
  ------------------
  |  Branch (686:9): [True: 774, False: 146k]
  ------------------
  687|   146k|        (c >= 0x1fc2 && c <= 0x1fc4) ||
  ------------------
  |  Branch (687:10): [True: 41.3k, False: 104k]
  |  Branch (687:25): [True: 469, False: 40.8k]
  ------------------
  688|   145k|        (c >= 0x1fc6 && c <= 0x1fcc) ||
  ------------------
  |  Branch (688:10): [True: 40.8k, False: 104k]
  |  Branch (688:25): [True: 345, False: 40.5k]
  ------------------
  689|   145k|        (c >= 0x1fd0 && c <= 0x1fd3) ||
  ------------------
  |  Branch (689:10): [True: 40.4k, False: 104k]
  |  Branch (689:25): [True: 305, False: 40.1k]
  ------------------
  690|   145k|        (c >= 0x1fd6 && c <= 0x1fdb) ||
  ------------------
  |  Branch (690:10): [True: 40.1k, False: 104k]
  |  Branch (690:25): [True: 713, False: 39.4k]
  ------------------
  691|   144k|        (c >= 0x1fe0 && c <= 0x1fec) ||
  ------------------
  |  Branch (691:10): [True: 39.4k, False: 104k]
  |  Branch (691:25): [True: 456, False: 38.9k]
  ------------------
  692|   143k|        (c >= 0x1ff2 && c <= 0x1ff4) ||
  ------------------
  |  Branch (692:10): [True: 38.9k, False: 104k]
  |  Branch (692:25): [True: 217, False: 38.7k]
  ------------------
  693|   143k|        (c >= 0x1ff6 && c <= 0x1ffc) ||
  ------------------
  |  Branch (693:10): [True: 38.7k, False: 104k]
  |  Branch (693:25): [True: 1.79k, False: 36.9k]
  ------------------
  694|   141k|        c == 0x2126 ||
  ------------------
  |  Branch (694:9): [True: 210, False: 141k]
  ------------------
  695|   141k|        (c >= 0x212a && c <= 0x212b) ||
  ------------------
  |  Branch (695:10): [True: 35.8k, False: 105k]
  |  Branch (695:25): [True: 204, False: 35.6k]
  ------------------
  696|   141k|        c == 0x212e ||
  ------------------
  |  Branch (696:9): [True: 203, False: 141k]
  ------------------
  697|   141k|        (c >= 0x2180 && c <= 0x2182) ||
  ------------------
  |  Branch (697:10): [True: 35.4k, False: 105k]
  |  Branch (697:25): [True: 491, False: 34.9k]
  ------------------
  698|   140k|        (c >= 0x3041 && c <= 0x3094) ||
  ------------------
  |  Branch (698:10): [True: 33.2k, False: 107k]
  |  Branch (698:25): [True: 435, False: 32.8k]
  ------------------
  699|   140k|        (c >= 0x30a1 && c <= 0x30fa) ||
  ------------------
  |  Branch (699:10): [True: 29.0k, False: 111k]
  |  Branch (699:25): [True: 861, False: 28.2k]
  ------------------
  700|   139k|        (c >= 0x3105 && c <= 0x312c) ||
  ------------------
  |  Branch (700:10): [True: 27.8k, False: 111k]
  |  Branch (700:25): [True: 544, False: 27.3k]
  ------------------
  701|   138k|        (c >= 0xac00 && c <= 0xd7a3) ||
  ------------------
  |  Branch (701:10): [True: 25.7k, False: 113k]
  |  Branch (701:25): [True: 777, False: 25.0k]
  ------------------
  702|   138k|        (c >= 0x4e00 && c <= 0x9fa5) ||
  ------------------
  |  Branch (702:10): [True: 26.5k, False: 111k]
  |  Branch (702:25): [True: 1.51k, False: 25.0k]
  ------------------
  703|   136k|        c == 0x3007 ||
  ------------------
  |  Branch (703:9): [True: 198, False: 136k]
  ------------------
  704|   136k|        (c >= 0x3021 && c <= 0x3029) ||
  ------------------
  |  Branch (704:10): [True: 30.3k, False: 106k]
  |  Branch (704:25): [True: 255, False: 30.0k]
  ------------------
  705|   136k|        (c >= 0x4e00 && c <= 0x9fa5) ||
  ------------------
  |  Branch (705:10): [True: 25.0k, False: 111k]
  |  Branch (705:25): [True: 0, False: 25.0k]
  ------------------
  706|   136k|        c == 0x3007 ||
  ------------------
  |  Branch (706:9): [True: 0, False: 136k]
  ------------------
  707|   136k|        (c >= 0x3021 && c <= 0x3029));
  ------------------
  |  Branch (707:10): [True: 30.0k, False: 106k]
  |  Branch (707:25): [True: 0, False: 30.0k]
  ------------------
  708|   898k|}
prvTidyIsXMLNamechar:
  711|   832k|{
  712|   832k|    return (TY_(IsXMLLetter)(c) ||
  ------------------
  |  |   23|   832k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   832k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (712:13): [True: 705k, False: 126k]
  ------------------
  713|   126k|        c == '.' || c == '_' ||
  ------------------
  |  Branch (713:9): [True: 441, False: 126k]
  |  Branch (713:21): [True: 1.27k, False: 125k]
  ------------------
  714|   125k|        c == ':' || c == '-' ||
  ------------------
  |  Branch (714:9): [True: 891, False: 124k]
  |  Branch (714:21): [True: 1.45k, False: 122k]
  ------------------
  715|   122k|        (c >= 0x300 && c <= 0x345) ||
  ------------------
  |  Branch (715:10): [True: 101k, False: 21.5k]
  |  Branch (715:24): [True: 910, False: 100k]
  ------------------
  716|   121k|        (c >= 0x360 && c <= 0x361) ||
  ------------------
  |  Branch (716:10): [True: 100k, False: 21.5k]
  |  Branch (716:24): [True: 579, False: 99.7k]
  ------------------
  717|   121k|        (c >= 0x483 && c <= 0x486) ||
  ------------------
  |  Branch (717:10): [True: 99.4k, False: 21.7k]
  |  Branch (717:24): [True: 267, False: 99.1k]
  ------------------
  718|   120k|        (c >= 0x591 && c <= 0x5a1) ||
  ------------------
  |  Branch (718:10): [True: 99.1k, False: 21.8k]
  |  Branch (718:24): [True: 1.09k, False: 98.0k]
  ------------------
  719|   119k|        (c >= 0x5a3 && c <= 0x5b9) ||
  ------------------
  |  Branch (719:10): [True: 98.0k, False: 21.8k]
  |  Branch (719:24): [True: 1.05k, False: 96.9k]
  ------------------
  720|   118k|        (c >= 0x5bb && c <= 0x5bd) ||
  ------------------
  |  Branch (720:10): [True: 96.9k, False: 21.8k]
  |  Branch (720:24): [True: 302, False: 96.6k]
  ------------------
  721|   118k|        c == 0x5bf ||
  ------------------
  |  Branch (721:9): [True: 68, False: 118k]
  ------------------
  722|   118k|        (c >= 0x5c1 && c <= 0x5c2) ||
  ------------------
  |  Branch (722:10): [True: 96.6k, False: 21.8k]
  |  Branch (722:24): [True: 695, False: 95.9k]
  ------------------
  723|   117k|        c == 0x5c4 ||
  ------------------
  |  Branch (723:9): [True: 546, False: 117k]
  ------------------
  724|   117k|        (c >= 0x64b && c <= 0x652) ||
  ------------------
  |  Branch (724:10): [True: 95.1k, False: 22.0k]
  |  Branch (724:24): [True: 1.33k, False: 93.8k]
  ------------------
  725|   115k|        c == 0x670 ||
  ------------------
  |  Branch (725:9): [True: 452, False: 115k]
  ------------------
  726|   115k|        (c >= 0x6d6 && c <= 0x6dc) ||
  ------------------
  |  Branch (726:10): [True: 92.7k, False: 22.6k]
  |  Branch (726:24): [True: 1.20k, False: 91.5k]
  ------------------
  727|   114k|        (c >= 0x6dd && c <= 0x6df) ||
  ------------------
  |  Branch (727:10): [True: 91.5k, False: 22.6k]
  |  Branch (727:24): [True: 730, False: 90.8k]
  ------------------
  728|   113k|        (c >= 0x6e0 && c <= 0x6e4) ||
  ------------------
  |  Branch (728:10): [True: 90.8k, False: 22.6k]
  |  Branch (728:24): [True: 1.34k, False: 89.4k]
  ------------------
  729|   112k|        (c >= 0x6e7 && c <= 0x6e8) ||
  ------------------
  |  Branch (729:10): [True: 89.4k, False: 22.6k]
  |  Branch (729:24): [True: 520, False: 88.9k]
  ------------------
  730|   111k|        (c >= 0x6ea && c <= 0x6ed) ||
  ------------------
  |  Branch (730:10): [True: 88.9k, False: 22.6k]
  |  Branch (730:24): [True: 2.33k, False: 86.6k]
  ------------------
  731|   109k|        (c >= 0x901 && c <= 0x903) ||
  ------------------
  |  Branch (731:10): [True: 85.3k, False: 23.9k]
  |  Branch (731:24): [True: 945, False: 84.4k]
  ------------------
  732|   108k|        c == 0x93c ||
  ------------------
  |  Branch (732:9): [True: 366, False: 107k]
  ------------------
  733|   107k|        (c >= 0x93e && c <= 0x94c) ||
  ------------------
  |  Branch (733:10): [True: 84.0k, False: 23.9k]
  |  Branch (733:24): [True: 482, False: 83.5k]
  ------------------
  734|   107k|        c == 0x94d ||
  ------------------
  |  Branch (734:9): [True: 578, False: 106k]
  ------------------
  735|   106k|        (c >= 0x951 && c <= 0x954) ||
  ------------------
  |  Branch (735:10): [True: 83.0k, False: 23.9k]
  |  Branch (735:24): [True: 944, False: 82.0k]
  ------------------
  736|   105k|        (c >= 0x962 && c <= 0x963) ||
  ------------------
  |  Branch (736:10): [True: 82.0k, False: 23.9k]
  |  Branch (736:24): [True: 278, False: 81.7k]
  ------------------
  737|   105k|        (c >= 0x981 && c <= 0x983) ||
  ------------------
  |  Branch (737:10): [True: 81.5k, False: 24.1k]
  |  Branch (737:24): [True: 663, False: 80.9k]
  ------------------
  738|   105k|        c == 0x9bc ||
  ------------------
  |  Branch (738:9): [True: 360, False: 104k]
  ------------------
  739|   104k|        c == 0x9be ||
  ------------------
  |  Branch (739:9): [True: 498, False: 104k]
  ------------------
  740|   104k|        c == 0x9bf ||
  ------------------
  |  Branch (740:9): [True: 316, False: 103k]
  ------------------
  741|   103k|        (c >= 0x9c0 && c <= 0x9c4) ||
  ------------------
  |  Branch (741:10): [True: 79.7k, False: 24.1k]
  |  Branch (741:24): [True: 449, False: 79.2k]
  ------------------
  742|   103k|        (c >= 0x9c7 && c <= 0x9c8) ||
  ------------------
  |  Branch (742:10): [True: 79.2k, False: 24.1k]
  |  Branch (742:24): [True: 522, False: 78.7k]
  ------------------
  743|   102k|        (c >= 0x9cb && c <= 0x9cd) ||
  ------------------
  |  Branch (743:10): [True: 78.7k, False: 24.1k]
  |  Branch (743:24): [True: 249, False: 78.4k]
  ------------------
  744|   102k|        c == 0x9d7 ||
  ------------------
  |  Branch (744:9): [True: 374, False: 102k]
  ------------------
  745|   102k|        (c >= 0x9e2 && c <= 0x9e3) ||
  ------------------
  |  Branch (745:10): [True: 78.1k, False: 24.1k]
  |  Branch (745:24): [True: 452, False: 77.6k]
  ------------------
  746|   101k|        c == 0xa02 ||
  ------------------
  |  Branch (746:9): [True: 1.19k, False: 100k]
  ------------------
  747|   100k|        c == 0xa3c ||
  ------------------
  |  Branch (747:9): [True: 197, False: 100k]
  ------------------
  748|   100k|        c == 0xa3e ||
  ------------------
  |  Branch (748:9): [True: 630, False: 99.7k]
  ------------------
  749|  99.7k|        c == 0xa3f ||
  ------------------
  |  Branch (749:9): [True: 210, False: 99.5k]
  ------------------
  750|  99.5k|        (c >= 0xa40 && c <= 0xa42) ||
  ------------------
  |  Branch (750:10): [True: 74.9k, False: 24.6k]
  |  Branch (750:24): [True: 524, False: 74.4k]
  ------------------
  751|  99.0k|        (c >= 0xa47 && c <= 0xa48) ||
  ------------------
  |  Branch (751:10): [True: 74.4k, False: 24.6k]
  |  Branch (751:24): [True: 609, False: 73.8k]
  ------------------
  752|  98.4k|        (c >= 0xa4b && c <= 0xa4d) ||
  ------------------
  |  Branch (752:10): [True: 73.8k, False: 24.6k]
  |  Branch (752:24): [True: 542, False: 73.2k]
  ------------------
  753|  97.9k|        (c >= 0xa70 && c <= 0xa71) ||
  ------------------
  |  Branch (753:10): [True: 72.8k, False: 25.0k]
  |  Branch (753:24): [True: 1.04k, False: 71.7k]
  ------------------
  754|  96.8k|        (c >= 0xa81 && c <= 0xa83) ||
  ------------------
  |  Branch (754:10): [True: 71.7k, False: 25.0k]
  |  Branch (754:24): [True: 417, False: 71.3k]
  ------------------
  755|  96.4k|        c == 0xabc ||
  ------------------
  |  Branch (755:9): [True: 268, False: 96.1k]
  ------------------
  756|  96.1k|        (c >= 0xabe && c <= 0xac5) ||
  ------------------
  |  Branch (756:10): [True: 71.0k, False: 25.0k]
  |  Branch (756:24): [True: 1.29k, False: 69.7k]
  ------------------
  757|  94.8k|        (c >= 0xac7 && c <= 0xac9) ||
  ------------------
  |  Branch (757:10): [True: 69.7k, False: 25.0k]
  |  Branch (757:24): [True: 672, False: 69.1k]
  ------------------
  758|  94.2k|        (c >= 0xacb && c <= 0xacd) ||
  ------------------
  |  Branch (758:10): [True: 69.1k, False: 25.0k]
  |  Branch (758:24): [True: 644, False: 68.4k]
  ------------------
  759|  93.5k|        (c >= 0xb01 && c <= 0xb03) ||
  ------------------
  |  Branch (759:10): [True: 68.2k, False: 25.3k]
  |  Branch (759:24): [True: 503, False: 67.7k]
  ------------------
  760|  93.0k|        c == 0xb3c ||
  ------------------
  |  Branch (760:9): [True: 531, False: 92.5k]
  ------------------
  761|  92.5k|        (c >= 0xb3e && c <= 0xb43) ||
  ------------------
  |  Branch (761:10): [True: 67.2k, False: 25.3k]
  |  Branch (761:24): [True: 1.00k, False: 66.2k]
  ------------------
  762|  91.5k|        (c >= 0xb47 && c <= 0xb48) ||
  ------------------
  |  Branch (762:10): [True: 66.2k, False: 25.3k]
  |  Branch (762:24): [True: 458, False: 65.7k]
  ------------------
  763|  91.0k|        (c >= 0xb4b && c <= 0xb4d) ||
  ------------------
  |  Branch (763:10): [True: 65.7k, False: 25.3k]
  |  Branch (763:24): [True: 263, False: 65.4k]
  ------------------
  764|  90.8k|        (c >= 0xb56 && c <= 0xb57) ||
  ------------------
  |  Branch (764:10): [True: 65.4k, False: 25.3k]
  |  Branch (764:24): [True: 253, False: 65.2k]
  ------------------
  765|  90.5k|        (c >= 0xb82 && c <= 0xb83) ||
  ------------------
  |  Branch (765:10): [True: 64.8k, False: 25.7k]
  |  Branch (765:24): [True: 312, False: 64.5k]
  ------------------
  766|  90.2k|        (c >= 0xbbe && c <= 0xbc2) ||
  ------------------
  |  Branch (766:10): [True: 64.4k, False: 25.7k]
  |  Branch (766:24): [True: 1.62k, False: 62.8k]
  ------------------
  767|  88.6k|        (c >= 0xbc6 && c <= 0xbc8) ||
  ------------------
  |  Branch (767:10): [True: 62.8k, False: 25.7k]
  |  Branch (767:24): [True: 389, False: 62.4k]
  ------------------
  768|  88.2k|        (c >= 0xbca && c <= 0xbcd) ||
  ------------------
  |  Branch (768:10): [True: 62.4k, False: 25.7k]
  |  Branch (768:24): [True: 1.08k, False: 61.3k]
  ------------------
  769|  87.1k|        c == 0xbd7 ||
  ------------------
  |  Branch (769:9): [True: 642, False: 86.5k]
  ------------------
  770|  86.5k|        (c >= 0xc01 && c <= 0xc03) ||
  ------------------
  |  Branch (770:10): [True: 60.1k, False: 26.3k]
  |  Branch (770:24): [True: 438, False: 59.7k]
  ------------------
  771|  86.0k|        (c >= 0xc3e && c <= 0xc44) ||
  ------------------
  |  Branch (771:10): [True: 59.7k, False: 26.3k]
  |  Branch (771:24): [True: 1.16k, False: 58.5k]
  ------------------
  772|  84.9k|        (c >= 0xc46 && c <= 0xc48) ||
  ------------------
  |  Branch (772:10): [True: 58.5k, False: 26.3k]
  |  Branch (772:24): [True: 1.10k, False: 57.4k]
  ------------------
  773|  83.8k|        (c >= 0xc4a && c <= 0xc4d) ||
  ------------------
  |  Branch (773:10): [True: 57.4k, False: 26.3k]
  |  Branch (773:24): [True: 552, False: 56.9k]
  ------------------
  774|  83.2k|        (c >= 0xc55 && c <= 0xc56) ||
  ------------------
  |  Branch (774:10): [True: 56.9k, False: 26.3k]
  |  Branch (774:24): [True: 375, False: 56.5k]
  ------------------
  775|  82.8k|        (c >= 0xc82 && c <= 0xc83) ||
  ------------------
  |  Branch (775:10): [True: 56.0k, False: 26.7k]
  |  Branch (775:24): [True: 804, False: 55.2k]
  ------------------
  776|  82.0k|        (c >= 0xcbe && c <= 0xcc4) ||
  ------------------
  |  Branch (776:10): [True: 55.2k, False: 26.7k]
  |  Branch (776:24): [True: 1.06k, False: 54.2k]
  ------------------
  777|  81.0k|        (c >= 0xcc6 && c <= 0xcc8) ||
  ------------------
  |  Branch (777:10): [True: 54.2k, False: 26.7k]
  |  Branch (777:24): [True: 1.52k, False: 52.6k]
  ------------------
  778|  79.4k|        (c >= 0xcca && c <= 0xccd) ||
  ------------------
  |  Branch (778:10): [True: 52.6k, False: 26.7k]
  |  Branch (778:24): [True: 743, False: 51.9k]
  ------------------
  779|  78.7k|        (c >= 0xcd5 && c <= 0xcd6) ||
  ------------------
  |  Branch (779:10): [True: 51.9k, False: 26.7k]
  |  Branch (779:24): [True: 684, False: 51.2k]
  ------------------
  780|  78.0k|        (c >= 0xd02 && c <= 0xd03) ||
  ------------------
  |  Branch (780:10): [True: 50.8k, False: 27.2k]
  |  Branch (780:24): [True: 674, False: 50.1k]
  ------------------
  781|  77.3k|        (c >= 0xd3e && c <= 0xd43) ||
  ------------------
  |  Branch (781:10): [True: 50.1k, False: 27.2k]
  |  Branch (781:24): [True: 807, False: 49.3k]
  ------------------
  782|  76.5k|        (c >= 0xd46 && c <= 0xd48) ||
  ------------------
  |  Branch (782:10): [True: 49.3k, False: 27.2k]
  |  Branch (782:24): [True: 1.83k, False: 47.5k]
  ------------------
  783|  74.7k|        (c >= 0xd4a && c <= 0xd4d) ||
  ------------------
  |  Branch (783:10): [True: 47.5k, False: 27.2k]
  |  Branch (783:24): [True: 870, False: 46.6k]
  ------------------
  784|  73.8k|        c == 0xd57 ||
  ------------------
  |  Branch (784:9): [True: 195, False: 73.6k]
  ------------------
  785|  73.6k|        c == 0xe31 ||
  ------------------
  |  Branch (785:9): [True: 328, False: 73.3k]
  ------------------
  786|  73.3k|        (c >= 0xe34 && c <= 0xe3a) ||
  ------------------
  |  Branch (786:10): [True: 45.4k, False: 27.8k]
  |  Branch (786:24): [True: 1.54k, False: 43.9k]
  ------------------
  787|  71.8k|        (c >= 0xe47 && c <= 0xe4e) ||
  ------------------
  |  Branch (787:10): [True: 43.5k, False: 28.2k]
  |  Branch (787:24): [True: 1.06k, False: 42.5k]
  ------------------
  788|  70.7k|        c == 0xeb1 ||
  ------------------
  |  Branch (788:9): [True: 240, False: 70.5k]
  ------------------
  789|  70.5k|        (c >= 0xeb4 && c <= 0xeb9) ||
  ------------------
  |  Branch (789:10): [True: 41.8k, False: 28.6k]
  |  Branch (789:24): [True: 744, False: 41.1k]
  ------------------
  790|  69.7k|        (c >= 0xebb && c <= 0xebc) ||
  ------------------
  |  Branch (790:10): [True: 41.1k, False: 28.6k]
  |  Branch (790:24): [True: 273, False: 40.8k]
  ------------------
  791|  69.4k|        (c >= 0xec8 && c <= 0xecd) ||
  ------------------
  |  Branch (791:10): [True: 40.6k, False: 28.8k]
  |  Branch (791:24): [True: 1.11k, False: 39.5k]
  ------------------
  792|  68.3k|        (c >= 0xf18 && c <= 0xf19) ||
  ------------------
  |  Branch (792:10): [True: 39.1k, False: 29.1k]
  |  Branch (792:24): [True: 486, False: 38.7k]
  ------------------
  793|  67.8k|        c == 0xf35 ||
  ------------------
  |  Branch (793:9): [True: 277, False: 67.6k]
  ------------------
  794|  67.6k|        c == 0xf37 ||
  ------------------
  |  Branch (794:9): [True: 508, False: 67.1k]
  ------------------
  795|  67.1k|        c == 0xf39 ||
  ------------------
  |  Branch (795:9): [True: 264, False: 66.8k]
  ------------------
  796|  66.8k|        c == 0xf3e ||
  ------------------
  |  Branch (796:9): [True: 272, False: 66.5k]
  ------------------
  797|  66.5k|        c == 0xf3f ||
  ------------------
  |  Branch (797:9): [True: 369, False: 66.1k]
  ------------------
  798|  66.1k|        (c >= 0xf71 && c <= 0xf84) ||
  ------------------
  |  Branch (798:10): [True: 36.7k, False: 29.4k]
  |  Branch (798:24): [True: 455, False: 36.2k]
  ------------------
  799|  65.7k|        (c >= 0xf86 && c <= 0xf8b) ||
  ------------------
  |  Branch (799:10): [True: 36.2k, False: 29.4k]
  |  Branch (799:24): [True: 348, False: 35.9k]
  ------------------
  800|  65.3k|        (c >= 0xf90 && c <= 0xf95) ||
  ------------------
  |  Branch (800:10): [True: 35.9k, False: 29.4k]
  |  Branch (800:24): [True: 721, False: 35.2k]
  ------------------
  801|  64.6k|        c == 0xf97 ||
  ------------------
  |  Branch (801:9): [True: 502, False: 64.1k]
  ------------------
  802|  64.1k|        (c >= 0xf99 && c <= 0xfad) ||
  ------------------
  |  Branch (802:10): [True: 34.6k, False: 29.4k]
  |  Branch (802:24): [True: 522, False: 34.1k]
  ------------------
  803|  63.6k|        (c >= 0xfb1 && c <= 0xfb7) ||
  ------------------
  |  Branch (803:10): [True: 34.0k, False: 29.5k]
  |  Branch (803:24): [True: 3.54k, False: 30.5k]
  ------------------
  804|  60.1k|        c == 0xfb9 ||
  ------------------
  |  Branch (804:9): [True: 279, False: 59.8k]
  ------------------
  805|  59.8k|        (c >= 0x20d0 && c <= 0x20dc) ||
  ------------------
  |  Branch (805:10): [True: 29.8k, False: 29.9k]
  |  Branch (805:25): [True: 464, False: 29.4k]
  ------------------
  806|  59.3k|        c == 0x20e1 ||
  ------------------
  |  Branch (806:9): [True: 197, False: 59.1k]
  ------------------
  807|  59.1k|        (c >= 0x302a && c <= 0x302f) ||
  ------------------
  |  Branch (807:10): [True: 28.8k, False: 30.3k]
  |  Branch (807:25): [True: 205, False: 28.6k]
  ------------------
  808|  58.9k|        c == 0x3099 ||
  ------------------
  |  Branch (808:9): [True: 195, False: 58.7k]
  ------------------
  809|  58.7k|        c == 0x309a ||
  ------------------
  |  Branch (809:9): [True: 1.28k, False: 57.4k]
  ------------------
  810|  57.4k|        (c >= 0x30 && c <= 0x39) ||
  ------------------
  |  Branch (810:10): [True: 45.7k, False: 11.7k]
  |  Branch (810:23): [True: 4.63k, False: 41.0k]
  ------------------
  811|  52.8k|        (c >= 0x660 && c <= 0x669) ||
  ------------------
  |  Branch (811:10): [True: 35.4k, False: 17.4k]
  |  Branch (811:24): [True: 537, False: 34.8k]
  ------------------
  812|  52.3k|        (c >= 0x6f0 && c <= 0x6f9) ||
  ------------------
  |  Branch (812:10): [True: 34.8k, False: 17.4k]
  |  Branch (812:24): [True: 964, False: 33.8k]
  ------------------
  813|  51.3k|        (c >= 0x966 && c <= 0x96f) ||
  ------------------
  |  Branch (813:10): [True: 33.5k, False: 17.7k]
  |  Branch (813:24): [True: 199, False: 33.3k]
  ------------------
  814|  51.1k|        (c >= 0x9e6 && c <= 0x9ef) ||
  ------------------
  |  Branch (814:10): [True: 33.3k, False: 17.8k]
  |  Branch (814:24): [True: 456, False: 32.8k]
  ------------------
  815|  50.6k|        (c >= 0xa66 && c <= 0xa6f) ||
  ------------------
  |  Branch (815:10): [True: 32.8k, False: 17.8k]
  |  Branch (815:24): [True: 444, False: 32.4k]
  ------------------
  816|  50.2k|        (c >= 0xae6 && c <= 0xaef) ||
  ------------------
  |  Branch (816:10): [True: 32.3k, False: 17.8k]
  |  Branch (816:24): [True: 207, False: 32.1k]
  ------------------
  817|  50.0k|        (c >= 0xb66 && c <= 0xb6f) ||
  ------------------
  |  Branch (817:10): [True: 32.1k, False: 17.8k]
  |  Branch (817:24): [True: 413, False: 31.7k]
  ------------------
  818|  49.6k|        (c >= 0xbe7 && c <= 0xbef) ||
  ------------------
  |  Branch (818:10): [True: 31.7k, False: 17.9k]
  |  Branch (818:24): [True: 558, False: 31.1k]
  ------------------
  819|  49.0k|        (c >= 0xc66 && c <= 0xc6f) ||
  ------------------
  |  Branch (819:10): [True: 31.1k, False: 17.9k]
  |  Branch (819:24): [True: 375, False: 30.7k]
  ------------------
  820|  48.6k|        (c >= 0xce6 && c <= 0xcef) ||
  ------------------
  |  Branch (820:10): [True: 30.7k, False: 17.9k]
  |  Branch (820:24): [True: 448, False: 30.2k]
  ------------------
  821|  48.2k|        (c >= 0xd66 && c <= 0xd6f) ||
  ------------------
  |  Branch (821:10): [True: 30.2k, False: 18.0k]
  |  Branch (821:24): [True: 543, False: 29.6k]
  ------------------
  822|  47.7k|        (c >= 0xe50 && c <= 0xe59) ||
  ------------------
  |  Branch (822:10): [True: 29.2k, False: 18.4k]
  |  Branch (822:24): [True: 277, False: 29.0k]
  ------------------
  823|  47.4k|        (c >= 0xed0 && c <= 0xed9) ||
  ------------------
  |  Branch (823:10): [True: 28.6k, False: 18.8k]
  |  Branch (823:24): [True: 311, False: 28.3k]
  ------------------
  824|  47.1k|        (c >= 0xf20 && c <= 0xf29) ||
  ------------------
  |  Branch (824:10): [True: 28.3k, False: 18.8k]
  |  Branch (824:24): [True: 282, False: 28.0k]
  ------------------
  825|  46.8k|        c == 0xb7 ||
  ------------------
  |  Branch (825:9): [True: 413, False: 46.4k]
  ------------------
  826|  46.4k|        c == 0x2d0 ||
  ------------------
  |  Branch (826:9): [True: 961, False: 45.4k]
  ------------------
  827|  45.4k|        c == 0x2d1 ||
  ------------------
  |  Branch (827:9): [True: 571, False: 44.8k]
  ------------------
  828|  44.8k|        c == 0x387 ||
  ------------------
  |  Branch (828:9): [True: 246, False: 44.6k]
  ------------------
  829|  44.6k|        c == 0x640 ||
  ------------------
  |  Branch (829:9): [True: 226, False: 44.4k]
  ------------------
  830|  44.4k|        c == 0xe46 ||
  ------------------
  |  Branch (830:9): [True: 358, False: 44.0k]
  ------------------
  831|  44.0k|        c == 0xec6 ||
  ------------------
  |  Branch (831:9): [True: 233, False: 43.8k]
  ------------------
  832|  43.8k|        c == 0x3005 ||
  ------------------
  |  Branch (832:9): [True: 280, False: 43.5k]
  ------------------
  833|  43.5k|        (c >= 0x3031 && c <= 0x3035) ||
  ------------------
  |  Branch (833:10): [True: 27.1k, False: 16.3k]
  |  Branch (833:25): [True: 738, False: 26.4k]
  ------------------
  834|  42.8k|        (c >= 0x309d && c <= 0x309e) ||
  ------------------
  |  Branch (834:10): [True: 26.4k, False: 16.3k]
  |  Branch (834:25): [True: 2.27k, False: 24.1k]
  ------------------
  835|  40.5k|        (c >= 0x30fc && c <= 0x30fe));
  ------------------
  |  Branch (835:10): [True: 24.1k, False: 16.3k]
  |  Branch (835:25): [True: 355, False: 23.8k]
  ------------------
  836|   832k|}
prvTidyIsUpper:
  839|  9.32M|{
  840|  9.32M|    uint map = MAP(c);
  ------------------
  |  |  206|  9.32M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 9.01M, False: 304k]
  |  |  ------------------
  ------------------
  841|       |
  842|  9.32M|    return (map & uppercase)!=0;
  ------------------
  |  |   74|  9.32M|#define uppercase   64u
  ------------------
  843|  9.32M|}
prvTidyToLower:
  846|   153M|{
  847|   153M|    uint map = MAP(c);
  ------------------
  |  |  206|   153M|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 146M, False: 7.40M]
  |  |  ------------------
  ------------------
  848|       |
  849|   153M|    if (map & uppercase)
  ------------------
  |  |   74|   153M|#define uppercase   64u
  ------------------
  |  Branch (849:9): [True: 12.4M, False: 141M]
  ------------------
  850|  12.4M|        c += 'a' - 'A';
  851|       |
  852|   153M|    return c;
  853|   153M|}
prvTidyToUpper:
  856|   237k|{
  857|   237k|    uint map = MAP(c);
  ------------------
  |  |  206|   237k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 229k, False: 7.78k]
  |  |  ------------------
  ------------------
  858|       |
  859|   237k|    if (map & lowercase)
  ------------------
  |  |   73|   237k|#define lowercase   32u
  ------------------
  |  Branch (859:9): [True: 11.6k, False: 225k]
  ------------------
  860|  11.6k|        c += (uint) ('A' - 'a' );
  861|       |
  862|   237k|    return c;
  863|   237k|}
prvTidyNewLexer:
  881|  20.6k|{
  882|  20.6k|    Lexer* lexer = (Lexer*) TidyDocAlloc( doc, sizeof(Lexer) );
  ------------------
  |  |  157|  20.6k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|  20.6k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
  883|       |
  884|  20.6k|    if ( lexer != NULL )
  ------------------
  |  Branch (884:10): [True: 20.6k, False: 0]
  ------------------
  885|  20.6k|    {
  886|  20.6k|        TidyClearMemory( lexer, sizeof(Lexer) );
  ------------------
  |  |   70|  20.6k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  887|       |
  888|  20.6k|        lexer->allocator = doc->allocator;
  889|  20.6k|        lexer->lines = 1;
  890|  20.6k|        lexer->columns = 1;
  891|  20.6k|        lexer->state = LEX_CONTENT;
  892|       |
  893|  20.6k|        lexer->versions = (VERS_ALL|VERS_PROPRIETARY);
  ------------------
  |  |  228|  20.6k|#define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  205|  20.6k|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|  20.6k|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  206|  20.6k|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|  20.6k|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  221|  20.6k|#define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  216|  20.6k|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  207|  20.6k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  179|  20.6k|#define H40S                   4u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  182|  20.6k|#define H41S                  32u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  185|  20.6k|#define X10S                 256u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  208|  20.6k|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  180|  20.6k|#define H40T                   8u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  183|  20.6k|#define H41T                  64u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  186|  20.6k|#define X10T                 512u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  209|  20.6k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  181|  20.6k|#define H40F                  16u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  184|  20.6k|#define H41F                 128u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  |  |  187|  20.6k|#define X10F                1024u
  |  |  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  210|  20.6k|#define VERS_XHTML11       (XH11)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  188|  20.6k|#define XH11                2048u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  211|  20.6k|#define VERS_BASIC         (XB10)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  189|  20.6k|#define XB10                4096u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FROM40        (VERS_HTML40|VERS_XHTML11|VERS_BASIC|VERS_HTML5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  213|  20.6k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  200|  20.6k|#define HT50              131072u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  201|  20.6k|#define XH50              262144u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  201|  20.6k|#define XH50              262144u
  |  |  ------------------
  |  |               #define VERS_ALL           (VERS_HTML20|VERS_HTML32|VERS_FROM40|XH50|HT50)
  |  |  ------------------
  |  |  |  |  200|  20.6k|#define HT50              131072u
  |  |  ------------------
  ------------------
                      lexer->versions = (VERS_ALL|VERS_PROPRIETARY);
  ------------------
  |  |  231|  20.6k|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  20.6k|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  20.6k|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  20.6k|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  894|  20.6k|        lexer->doctype = VERS_UNKNOWN;
  ------------------
  |  |  204|  20.6k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  20.6k|#define xxxx                   0u
  |  |  ------------------
  ------------------
  895|  20.6k|        lexer->root = &doc->root;
  896|  20.6k|    }
  897|  20.6k|    return lexer;
  898|  20.6k|}
prvTidyFreeLexer:
  907|  41.2k|{
  908|  41.2k|    Lexer *lexer = doc->lexer;
  909|  41.2k|    if ( lexer )
  ------------------
  |  Branch (909:10): [True: 20.6k, False: 20.6k]
  ------------------
  910|  20.6k|    {
  911|  20.6k|        TY_(FreeStyles)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  912|       |
  913|       |        /* See GetToken() */
  914|  20.6k|        if ( lexer->pushed || lexer->itoken )
  ------------------
  |  Branch (914:14): [True: 0, False: 20.6k]
  |  Branch (914:31): [True: 0, False: 20.6k]
  ------------------
  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|  61.5k|        while ( lexer->istacksize > 0 )
  ------------------
  |  Branch (921:17): [True: 40.9k, False: 20.6k]
  ------------------
  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|  20.6k|        TidyDocFree( doc, lexer->istack );
  ------------------
  |  |  159|  20.6k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.6k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  925|  20.6k|        TidyDocFree( doc, lexer->lexbuf );
  ------------------
  |  |  159|  20.6k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.6k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  926|  20.6k|        TidyDocFree( doc, lexer );
  ------------------
  |  |  159|  20.6k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.6k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  927|       |        doc->lexer = NULL;
  928|  20.6k|    }
  929|  41.2k|}
prvTidyAddCharToLexer:
  975|   315M|{
  976|   315M|    int i, err, count = 0;
  977|   315M|    tmbchar buf[10] = {0};
  978|       |    
  979|   315M|    err = TY_(EncodeCharToUTF8Bytes)( c, buf, NULL, &count );
  ------------------
  |  |   23|   315M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   315M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  980|   315M|    if (err)
  ------------------
  |  Branch (980:9): [True: 6.04k, False: 315M]
  ------------------
  981|  6.04k|    {
  982|       |        /* replacement character 0xFFFD encoded as UTF-8 */
  983|  6.04k|        buf[0] = (byte) 0xEF;
  984|  6.04k|        buf[1] = (byte) 0xBF;
  985|  6.04k|        buf[2] = (byte) 0xBD;
  986|  6.04k|        count = 3;
  987|  6.04k|    }
  988|       |    
  989|   636M|    for ( i = 0; i < count; ++i )
  ------------------
  |  Branch (989:18): [True: 320M, False: 315M]
  ------------------
  990|   320M|        AddByte( lexer, buf[i] );
  991|   315M|}
prvTidyNewNode:
 1425|  3.69M|{
 1426|  3.69M|    Node* node = (Node*) TidyAlloc( allocator, sizeof(Node) );
  ------------------
  |  |   66|  3.69M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 1427|  3.69M|    TidyClearMemory( node, sizeof(Node) );
  ------------------
  |  |   70|  3.69M|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1428|  3.69M|    if ( lexer )
  ------------------
  |  Branch (1428:10): [True: 3.67M, False: 18.3k]
  ------------------
 1429|  3.67M|    {
 1430|  3.67M|        node->line = lexer->lines;
 1431|  3.67M|        node->column = lexer->columns;
 1432|  3.67M|    }
 1433|  3.69M|    node->type = TextNode;
 1434|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_ALLOCATION)
 1435|       |    SPRTF("Allocated node %p\n", node );
 1436|       |#endif
 1437|  3.69M|    return node;
 1438|  3.69M|}
prvTidyCloneNode:
 1442|  23.2k|{
 1443|  23.2k|    Lexer* lexer = doc->lexer;
 1444|  23.2k|    Node *node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|  23.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1445|       |
 1446|  23.2k|    node->start = lexer->lexsize;
 1447|  23.2k|    node->end   = lexer->lexsize;
 1448|       |
 1449|  23.2k|    if ( element )
  ------------------
  |  Branch (1449:10): [True: 23.2k, False: 0]
  ------------------
 1450|  23.2k|    {
 1451|  23.2k|        node->parent     = element->parent;
 1452|  23.2k|        node->type       = element->type;
 1453|  23.2k|        node->closed     = element->closed;
 1454|  23.2k|        node->implicit   = element->implicit;
 1455|  23.2k|        node->tag        = element->tag;
 1456|  23.2k|        node->element    = TY_(tmbstrdup)( doc->allocator, element->element );
  ------------------
  |  |   23|  23.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1457|  23.2k|        node->attributes = TY_(DupAttrs)( doc, element->attributes );
  ------------------
  |  |   23|  23.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1458|  23.2k|    }
 1459|  23.2k|    return node;
 1460|  23.2k|}
prvTidyFreeAttrs:
 1464|  3.60M|{
 1465|  4.16M|    while ( node->attributes )
  ------------------
  |  Branch (1465:13): [True: 561k, False: 3.60M]
  ------------------
 1466|   561k|    {
 1467|   561k|        AttVal *av = node->attributes;
 1468|       |
 1469|   561k|        if ( av->attribute )
  ------------------
  |  Branch (1469:14): [True: 531k, False: 30.7k]
  ------------------
 1470|   531k|        {
 1471|   531k|            if ( (attrIsID(av) || attrIsNAME(av)) &&
  ------------------
  |  |  243|   531k|#define attrIsID(av)                AttrIsId( av, TidyAttr_ID  )
  |  |  ------------------
  |  |  |  |  169|  1.06M|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 531k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 373k, False: 157k]
  |  |  |  |  |  Branch (169:51): [True: 73.2k, False: 300k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( (attrIsID(av) || attrIsNAME(av)) &&
  ------------------
  |  |  265|   458k|#define attrIsNAME(av)              AttrIsId( av, TidyAttr_NAME  )
  |  |  ------------------
  |  |  |  |  169|   458k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 458k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 300k, False: 157k]
  |  |  |  |  |  Branch (169:51): [True: 27.0k, False: 273k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.4k]
  ------------------
 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|   531k|        }
 1477|       |
 1478|   561k|        node->attributes = av->next;
 1479|   561k|        TY_(FreeAttribute)( doc, av );
  ------------------
  |  |   23|   561k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   561k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1480|   561k|    }
 1481|  3.60M|}
prvTidyFreeAttribute:
 1485|   635k|{
 1486|   635k|    TY_(FreeNode)( doc, av->asp );
  ------------------
  |  |   23|   635k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   635k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1487|   635k|    TY_(FreeNode)( doc, av->php );
  ------------------
  |  |   23|   635k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   635k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1488|   635k|    TidyDocFree( doc, av->attribute );
  ------------------
  |  |  159|   635k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   635k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1489|   635k|    TidyDocFree( doc, av->value );
  ------------------
  |  |  159|   635k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   635k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1490|   635k|    TidyDocFree( doc, av );
  ------------------
  |  |  159|   635k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|   635k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1491|   635k|}
prvTidyDetachAttribute:
 1496|  7.57k|{
 1497|  7.57k|    AttVal *av, *prev = NULL;
 1498|       |
 1499|  16.8k|    for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (1499:34): [True: 16.8k, False: 0]
  ------------------
 1500|  16.8k|    {
 1501|  16.8k|        if ( av == attr )
  ------------------
  |  Branch (1501:14): [True: 7.57k, False: 9.27k]
  ------------------
 1502|  7.57k|        {
 1503|  7.57k|            if ( prev )
  ------------------
  |  Branch (1503:18): [True: 4.45k, False: 3.12k]
  ------------------
 1504|  4.45k|                prev->next = attr->next;
 1505|  3.12k|            else
 1506|  3.12k|                node->attributes = attr->next;
 1507|  7.57k|            break;
 1508|  7.57k|        }
 1509|  9.27k|        prev = av;
 1510|  9.27k|    }
 1511|  7.57k|}
prvTidyRemoveAttribute:
 1516|  7.57k|{
 1517|  7.57k|    TY_(DetachAttribute)( node, attr );
  ------------------
  |  |   23|  7.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1518|  7.57k|    TY_(FreeAttribute)( doc, attr );
  ------------------
  |  |   23|  7.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1519|  7.57k|}
prvTidyFreeNode:
 1527|  5.73M|{
 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.33M|    while ( node )
  ------------------
  |  Branch (1540:13): [True: 3.59M, False: 5.73M]
  ------------------
 1541|  3.59M|    {
 1542|  3.59M|        Node* next = node->next;
 1543|       |
 1544|  3.59M|        TY_(FreeAttrs)( doc, node );
  ------------------
  |  |   23|  3.59M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.59M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1545|  3.59M|        TY_(FreeNode)( doc, node->content );
  ------------------
  |  |   23|  3.59M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.59M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1546|  3.59M|        TidyDocFree( doc, node->element );
  ------------------
  |  |  159|  3.59M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.59M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1547|  3.59M|        if (RootNode != node->type)
  ------------------
  |  Branch (1547:13): [True: 3.55M, False: 41.2k]
  ------------------
 1548|  3.59M|            TidyDocFree( doc, node );
  ------------------
  |  |  159|  3.55M|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.55M|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1549|  41.2k|        else
 1550|  41.2k|            node->content = NULL;
 1551|       |
 1552|  3.59M|        node = next;
 1553|  3.59M|    }
 1554|  5.73M|}
prvTidyTextToken:
 1557|   257k|{
 1558|   257k|    Node *node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|   257k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   257k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1559|   257k|    node->start = lexer->txtstart;
 1560|   257k|    node->end = lexer->txtend;
 1561|   257k|    return node;
 1562|   257k|}
prvTidyFindDocType:
 1649|  63.0k|{
 1650|  63.0k|    Node* node;
 1651|  63.0k|    for ( node = (doc ? doc->root.content : NULL);
  ------------------
  |  Branch (1651:19): [True: 63.0k, False: 0]
  ------------------
 1652|   113k|          node && node->type != DocTypeTag; 
  ------------------
  |  Branch (1652:11): [True: 57.6k, False: 55.5k]
  |  Branch (1652:19): [True: 50.0k, False: 7.54k]
  ------------------
 1653|  63.0k|          node = node->next )
 1654|  50.0k|        /**/;
 1655|  63.0k|    return node;
 1656|  63.0k|}
prvTidyFindHTML:
 1672|   187k|{
 1673|   187k|    Node *node;
 1674|   187k|    for ( node = (doc ? doc->root.content : NULL);
  ------------------
  |  Branch (1674:19): [True: 187k, False: 0]
  ------------------
 1675|   330k|          node && !nodeIsHTML(node); 
  ------------------
  |  |  370|   327k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   327k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 327k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 184k, False: 143k]
  |  |  |  |  |  Branch (275:54): [True: 184k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1675:11): [True: 327k, False: 3.38k]
  ------------------
 1676|   187k|          node = node->next )
 1677|   143k|        /**/;
 1678|       |
 1679|   187k|    return node;
 1680|   187k|}
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: 134]
  |  Branch (1687:19): [True: 210, False: 868]
  ------------------
 1688|  1.00k|          node = node->next )
 1689|    210|        /**/;
 1690|       |
 1691|  1.00k|    return node;
 1692|  1.00k|}
prvTidyFindHEAD:
 1696|   127k|{
 1697|   127k|    Node *node = TY_(FindHTML)( doc );
  ------------------
  |  |   23|   127k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   127k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1698|       |
 1699|   127k|    if ( node )
  ------------------
  |  Branch (1699:10): [True: 127k, False: 0]
  ------------------
 1700|   127k|    {
 1701|   127k|        for ( node = node->content;
 1702|   130k|              node && !nodeIsHEAD(node); 
  ------------------
  |  |  371|   130k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|   130k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 130k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 127k, False: 2.87k]
  |  |  |  |  |  Branch (275:54): [True: 127k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1702:15): [True: 130k, False: 0]
  ------------------
 1703|   127k|              node = node->next )
 1704|  2.87k|            /**/;
 1705|   127k|    }
 1706|       |
 1707|   127k|    return node;
 1708|   127k|}
prvTidyFindTITLE:
 1711|  20.6k|{
 1712|  20.6k|    Node *node = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1713|       |
 1714|  20.6k|    if (node)
  ------------------
  |  Branch (1714:9): [True: 20.6k, False: 0]
  ------------------
 1715|  20.6k|        for (node = node->content;
 1716|  27.4k|             node && !nodeIsTITLE(node);
  ------------------
  |  |  372|  6.97k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  6.97k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.97k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.87k, False: 1.10k]
  |  |  |  |  |  Branch (275:54): [True: 122, False: 5.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1716:14): [True: 6.97k, False: 20.4k]
  ------------------
 1717|  20.6k|             node = node->next) {}
 1718|       |
 1719|  20.6k|    return node;
 1720|  20.6k|}
prvTidyFindBody:
 1723|  64.1k|{
 1724|  64.1k|    Node *node = ( doc ? doc->root.content : NULL );
  ------------------
  |  Branch (1724:20): [True: 64.1k, False: 0]
  ------------------
 1725|       |
 1726|   104k|    while ( node && !nodeIsHTML(node) )
  ------------------
  |  |  370|   104k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   104k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 104k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 64.1k, False: 40.7k]
  |  |  |  |  |  Branch (275:54): [True: 64.1k, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1726:13): [True: 104k, False: 0]
  ------------------
 1727|  40.7k|        node = node->next;
 1728|       |
 1729|  64.1k|    if (node == NULL)
  ------------------
  |  Branch (1729:9): [True: 0, False: 64.1k]
  ------------------
 1730|      0|        return NULL;
 1731|       |
 1732|  64.1k|    node = node->content;
 1733|   329k|    while ( node && !nodeIsBODY(node) && !nodeIsFRAMESET(node) )
  ------------------
  |  |  375|   321k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   650k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 321k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 167k, False: 153k]
  |  |  |  |  |  Branch (275:54): [True: 46.9k, False: 120k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  while ( node && !nodeIsBODY(node) && !nodeIsFRAMESET(node) )
  ------------------
  |  |  376|   274k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|   274k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 274k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 120k, False: 153k]
  |  |  |  |  |  Branch (275:54): [True: 8.90k, False: 111k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1733:13): [True: 321k, False: 8.20k]
  ------------------
 1734|   265k|        node = node->next;
 1735|       |
 1736|  64.1k|    if ( node && nodeIsFRAMESET(node) )
  ------------------
  |  |  376|  55.9k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  55.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 55.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 55.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 8.90k, False: 46.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1736:10): [True: 55.9k, False: 8.20k]
  ------------------
 1737|  8.90k|    {
 1738|  8.90k|        node = node->content;
 1739|  11.4k|        while ( node && !nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|  10.5k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  10.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 10.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 9.77k, False: 823]
  |  |  |  |  |  Branch (275:54): [True: 8.02k, False: 1.75k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1739:17): [True: 10.5k, False: 885]
  ------------------
 1740|  2.57k|            node = node->next;
 1741|       |
 1742|  8.90k|        if ( node )
  ------------------
  |  Branch (1742:14): [True: 8.02k, False: 885]
  ------------------
 1743|  8.02k|        {
 1744|  8.02k|            node = node->content;
 1745|   166k|            while ( node && !nodeIsBODY(node) )
  ------------------
  |  |  375|   164k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   164k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 164k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 158k, False: 6.10k]
  |  |  |  |  |  Branch (275:54): [True: 6.03k, False: 152k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1745:21): [True: 164k, False: 1.99k]
  ------------------
 1746|   158k|                node = node->next;
 1747|  8.02k|        }
 1748|  8.90k|    }
 1749|       |
 1750|  64.1k|    return node;
 1751|  64.1k|}
prvTidyAddGenerator:
 1755|  20.6k|{
 1756|  20.6k|    AttVal *attval;
 1757|  20.6k|    Node *node;
 1758|  20.6k|    Node *head = TY_(FindHEAD)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1759|  20.6k|    tmbchar buf[256];
 1760|       |    
 1761|  20.6k|    if (head)
  ------------------
  |  Branch (1761:9): [True: 20.6k, False: 0]
  ------------------
 1762|  20.6k|    {
 1763|  20.6k|#ifdef PLATFORM_NAME
 1764|  20.6k|        TY_(tmbsnprintf)(buf, sizeof(buf), "HTML Tidy for HTML5 for "PLATFORM_NAME" version %s",
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1765|  20.6k|                         tidyLibraryVersion());
 1766|       |#else
 1767|       |        TY_(tmbsnprintf)(buf, sizeof(buf), "HTML Tidy for HTML5 version %s", tidyLibraryVersion());
 1768|       |#endif
 1769|       |
 1770|  51.1k|        for ( node = head->content; node; node = node->next )
  ------------------
  |  Branch (1770:37): [True: 30.5k, False: 20.6k]
  ------------------
 1771|  30.5k|        {
 1772|  30.5k|            if ( nodeIsMETA(node) )
  ------------------
  |  |  374|  30.5k|#define nodeIsMETA( node )       TagIsId( node, TidyTag_META )
  |  |  ------------------
  |  |  |  |  275|  30.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 30.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 29.4k, False: 1.10k]
  |  |  |  |  |  Branch (275:54): [True: 252, False: 29.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1773|    252|            {
 1774|    252|                attval = TY_(AttrGetById)(node, TidyAttr_NAME);
  ------------------
  |  |   23|    252|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    252|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1775|       |
 1776|    252|                if (AttrValueIs(attval, "generator"))
  ------------------
  |  |  172|    252|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|    504|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 36, False: 216]
  |  |  |  |  |  Branch (171:44): [True: 26, False: 10]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|    252|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|     26|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     26|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 26]
  |  |  ------------------
  ------------------
 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|    252|            }
 1792|  30.5k|        }
 1793|       |
 1794|  20.6k|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (1794:14): [True: 20.6k, False: 0]
  ------------------
 1795|  20.6k|        {
 1796|  20.6k|            node = TY_(InferredTag)(doc, TidyTag_META);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1797|  20.6k|            TY_(AddAttribute)( doc, node, "name", "generator" );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1798|  20.6k|            TY_(AddAttribute)( doc, node, "content", buf );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1799|  20.6k|            TY_(InsertNodeAtStart)( head, node );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1800|  20.6k|            return yes;
 1801|  20.6k|        }
 1802|  20.6k|    }
 1803|       |
 1804|      0|    return no;
 1805|  20.6k|}
prvTidyApparentVersion:
 1850|  41.2k|{
 1851|  41.2k|    if ((doc->lexer->doctype == XH11 ||
  ------------------
  |  |  188|  82.4k|#define XH11                2048u
  ------------------
  |  Branch (1851:10): [True: 96, False: 41.1k]
  ------------------
 1852|  41.1k|         doc->lexer->doctype == XB10) &&
  ------------------
  |  |  189|  41.1k|#define XB10                4096u
  ------------------
  |  Branch (1852:10): [True: 0, False: 41.1k]
  ------------------
 1853|     96|        (doc->lexer->versions & doc->lexer->doctype))
  ------------------
  |  Branch (1853:9): [True: 84, False: 12]
  ------------------
 1854|     84|        return doc->lexer->doctype;
 1855|  41.1k|    else
 1856|  41.1k|        return TY_(HTMLVersion)(doc);
  ------------------
  |  |   23|  41.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1857|  41.2k|}
prvTidyHTMLVersionNameFromCode:
 1860|  51.0k|{
 1861|  51.0k|    ctmbstr name = GetNameFromVers(vers);
 1862|  51.0k|    return name;
 1863|  51.0k|}
prvTidyWarnMissingSIInEmittedDocType:
 1877|  20.6k|{
 1878|  20.6k|    Bool isXhtml = doc->lexer->isvoyager;
 1879|  20.6k|    Node* doctype;
 1880|       |    
 1881|       |    /* Do not warn in XHTML mode */
 1882|  20.6k|    if ( isXhtml )
  ------------------
  |  Branch (1882:10): [True: 1.45k, False: 19.1k]
  ------------------
 1883|  1.45k|        return no;
 1884|       |
 1885|       |    /* Do not warn if emitted doctype is proprietary */
 1886|  19.1k|    if ( TY_(HTMLVersionNameFromCode)(doc->lexer->versionEmitted, isXhtml ) == NULL )
  ------------------
  |  |   23|  19.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1886:10): [True: 0, False: 19.1k]
  ------------------
 1887|      0|        return no;
 1888|       |
 1889|       |    /* Do not warn if no SI is possible */
 1890|  19.1k|    if ( GetSIFromVers(doc->lexer->versionEmitted) == NULL )
  ------------------
  |  Branch (1890:10): [True: 19.1k, False: 0]
  ------------------
 1891|  19.1k|        return no;
 1892|       |
 1893|      0|    if ( (doctype = TY_(FindDocType)( doc )) != NULL
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1893:10): [True: 0, False: 0]
  ------------------
 1894|      0|         && TY_(GetAttrByName)(doctype, "SYSTEM") == NULL )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1894:13): [True: 0, False: 0]
  ------------------
 1895|      0|        return yes;
 1896|       |
 1897|      0|    return no;
 1898|      0|}
prvTidySetXHTMLDocType:
 1922|  20.6k|{
 1923|  20.6k|    Lexer *lexer = doc->lexer;
 1924|  20.6k|    Node *doctype = TY_(FindDocType)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1925|  20.6k|    TidyDoctypeModes dtmode = (TidyDoctypeModes)cfg(doc, TidyDoctypeMode);
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1926|  20.6k|    ctmbstr pub = "PUBLIC";
 1927|  20.6k|    ctmbstr sys = "SYSTEM";
 1928|       |
 1929|  20.6k|    lexer->versionEmitted = TY_(ApparentVersion)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1930|       |
 1931|  20.6k|    if (dtmode == TidyDoctypeOmit)
  ------------------
  |  Branch (1931:9): [True: 0, False: 20.6k]
  ------------------
 1932|      0|    {
 1933|      0|        if (doctype)
  ------------------
  |  Branch (1933:13): [True: 0, False: 0]
  ------------------
 1934|      0|            TY_(DiscardElement)(doc, doctype);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1935|      0|        return yes;
 1936|      0|    }
 1937|       |
 1938|  20.6k|    if (dtmode == TidyDoctypeUser && !cfgStr(doc, TidyDoctype))
  ------------------
  |  |  424|      0|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  ------------------
  |  Branch (1938:9): [True: 0, False: 20.6k]
  |  Branch (1938:38): [True: 0, False: 0]
  ------------------
 1939|      0|        return no;
 1940|       |
 1941|  20.6k|    if (!doctype)
  ------------------
  |  Branch (1941:9): [True: 18.3k, False: 2.22k]
  ------------------
 1942|  18.3k|    {
 1943|  18.3k|        doctype = NewDocTypeNode(doc);
 1944|  18.3k|        doctype->element = TY_(tmbstrdup)(doc->allocator, "html");
  ------------------
  |  |   23|  18.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1945|  18.3k|    }
 1946|  2.22k|    else
 1947|  2.22k|    {
 1948|  2.22k|        doctype->element = TY_(tmbstrtolower)(doctype->element);
  ------------------
  |  |   23|  2.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1949|  2.22k|    }
 1950|       |
 1951|  20.6k|    switch(dtmode)
  ------------------
  |  Branch (1951:12): [True: 20.6k, False: 0]
  ------------------
 1952|  20.6k|    {
 1953|      0|    case TidyDoctypeHtml5:
  ------------------
  |  Branch (1953:5): [True: 0, False: 20.6k]
  ------------------
 1954|       |        /* HTML5 */
 1955|      0|        TY_(RepairAttrValue)(doc, doctype, pub, NULL);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1956|      0|        TY_(RepairAttrValue)(doc, doctype, sys, NULL);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1957|      0|        lexer->versionEmitted = XH50;
  ------------------
  |  |  201|      0|#define XH50              262144u
  ------------------
 1958|      0|        break;
 1959|      0|    case TidyDoctypeStrict:
  ------------------
  |  Branch (1959:5): [True: 0, False: 20.6k]
  ------------------
 1960|       |        /* XHTML 1.0 Strict */
 1961|      0|        TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10S));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10S));
  ------------------
  |  |  185|      0|#define X10S                 256u
  ------------------
 1962|      0|        TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10S));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10S));
  ------------------
  |  |  185|      0|#define X10S                 256u
  ------------------
 1963|      0|        lexer->versionEmitted = X10S;
  ------------------
  |  |  185|      0|#define X10S                 256u
  ------------------
 1964|      0|        break;
 1965|      0|    case TidyDoctypeLoose:
  ------------------
  |  Branch (1965:5): [True: 0, False: 20.6k]
  ------------------
 1966|       |        /* XHTML 1.0 Transitional */
 1967|      0|        TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10T));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10T));
  ------------------
  |  |  186|      0|#define X10T                 512u
  ------------------
 1968|      0|        TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10T));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10T));
  ------------------
  |  |  186|      0|#define X10T                 512u
  ------------------
 1969|      0|        lexer->versionEmitted = X10T;
  ------------------
  |  |  186|      0|#define X10T                 512u
  ------------------
 1970|      0|        break;
 1971|      0|    case TidyDoctypeUser:
  ------------------
  |  Branch (1971:5): [True: 0, False: 20.6k]
  ------------------
 1972|       |        /* user defined document type declaration */
 1973|      0|        TY_(RepairAttrValue)(doc, doctype, pub, cfgStr(doc, TidyDoctype));
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(RepairAttrValue)(doc, doctype, pub, cfgStr(doc, TidyDoctype));
  ------------------
  |  |  424|      0|#define cfgStr(doc, id)         ((ctmbstr) (doc)->config.value[ (id) ].p)
  ------------------
 1974|      0|        TY_(RepairAttrValue)(doc, doctype, sys, "");
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1975|      0|        break;
 1976|  20.6k|    case TidyDoctypeAuto:
  ------------------
  |  Branch (1976:5): [True: 20.6k, False: 0]
  ------------------
 1977|  20.6k|        if (lexer->doctype == VERS_UNKNOWN || lexer->doctype == VERS_HTML5) {
  ------------------
  |  |  204|  41.2k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  20.6k|#define xxxx                   0u
  |  |  ------------------
  ------------------
                      if (lexer->doctype == VERS_UNKNOWN || lexer->doctype == VERS_HTML5) {
  ------------------
  |  |  213|    355|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|    355|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|    355|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (1977:13): [True: 20.2k, False: 355]
  |  Branch (1977:47): [True: 185, False: 170]
  ------------------
 1978|  20.4k|          lexer->versionEmitted = XH50;
  ------------------
  |  |  201|  20.4k|#define XH50              262144u
  ------------------
 1979|  20.4k|          return yes;
 1980|  20.4k|        }
 1981|    170|        else if (lexer->versions & XH11 && lexer->doctype == XH11)
  ------------------
  |  |  188|    340|#define XH11                2048u
  ------------------
                      else if (lexer->versions & XH11 && lexer->doctype == XH11)
  ------------------
  |  |  188|    138|#define XH11                2048u
  ------------------
  |  Branch (1981:18): [True: 138, False: 32]
  |  Branch (1981:44): [True: 42, False: 96]
  ------------------
 1982|     42|        {
 1983|     42|            if (!TY_(GetAttrByName)(doctype, sys))
  ------------------
  |  |   23|     42|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     42|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1983:17): [True: 33, False: 9]
  ------------------
 1984|     33|                TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |   23|     33|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     33|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |  188|     33|#define XH11                2048u
  ------------------
 1985|     42|            lexer->versionEmitted = XH11;
  ------------------
  |  |  188|     42|#define XH11                2048u
  ------------------
 1986|     42|            return yes;
 1987|     42|        }
 1988|    128|        else if (lexer->versions & XH11 && !(lexer->versions & VERS_HTML40))
  ------------------
  |  |  188|    256|#define XH11                2048u
  ------------------
                      else if (lexer->versions & XH11 && !(lexer->versions & VERS_HTML40))
  ------------------
  |  |  216|     96|#define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  ------------------
  |  |  |  |  207|     96|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|     96|#define H40S                   4u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|     96|#define H41S                  32u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  185|     96|#define X10S                 256u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  ------------------
  |  |  |  |  208|     96|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  ------------------
  |  |  |  |  |  |  180|     96|#define H40T                   8u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  ------------------
  |  |  |  |  |  |  183|     96|#define H41T                  64u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  ------------------
  |  |  |  |  |  |  186|     96|#define X10T                 512u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_HTML40        (VERS_HTML40_STRICT|VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  ------------------
  |  |  |  |  209|     96|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  ------------------
  |  |  |  |  |  |  181|     96|#define H40F                  16u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  ------------------
  |  |  |  |  |  |  184|     96|#define H41F                 128u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  ------------------
  |  |  |  |  |  |  187|     96|#define X10F                1024u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1988:18): [True: 96, False: 32]
  |  Branch (1988:44): [True: 16, False: 80]
  ------------------
 1989|     16|        {
 1990|     16|            TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(XH11));
  ------------------
  |  |   23|     16|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     16|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(XH11));
  ------------------
  |  |  188|     16|#define XH11                2048u
  ------------------
 1991|     16|            TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |   23|     16|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     16|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(XH11));
  ------------------
  |  |  188|     16|#define XH11                2048u
  ------------------
 1992|     16|            lexer->versionEmitted = XH11;
  ------------------
  |  |  188|     16|#define XH11                2048u
  ------------------
 1993|     16|        }
 1994|    112|        else if (lexer->versions & XB10 && lexer->doctype == XB10)
  ------------------
  |  |  189|    224|#define XB10                4096u
  ------------------
                      else if (lexer->versions & XB10 && lexer->doctype == XB10)
  ------------------
  |  |  189|     33|#define XB10                4096u
  ------------------
  |  Branch (1994:18): [True: 33, False: 79]
  |  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|    112|        else if (lexer->versions & VERS_HTML40_STRICT)
  ------------------
  |  |  207|    112|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|    112|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|    112|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|    112|#define X10S                 256u
  |  |  ------------------
  ------------------
  |  Branch (2001:18): [True: 4, False: 108]
  ------------------
 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|    108|        else if (lexer->versions & VERS_FRAMESET)
  ------------------
  |  |  209|    108|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|    108|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|    108|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|    108|#define X10F                1024u
  |  |  ------------------
  ------------------
  |  Branch (2007:18): [True: 3, False: 105]
  ------------------
 2008|      3|        {
 2009|      3|            TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10F));
  ------------------
  |  |   23|      3|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      3|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10F));
  ------------------
  |  |  187|      3|#define X10F                1024u
  ------------------
 2010|      3|            TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10F));
  ------------------
  |  |   23|      3|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      3|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10F));
  ------------------
  |  |  187|      3|#define X10F                1024u
  ------------------
 2011|      3|            lexer->versionEmitted = X10F;
  ------------------
  |  |  187|      3|#define X10F                1024u
  ------------------
 2012|      3|        }
 2013|    105|        else if (lexer->versions & VERS_LOOSE)
  ------------------
  |  |  218|    105|#define VERS_LOOSE         (VERS_HTML20|VERS_HTML32|VERS_IFRAME)
  |  |  ------------------
  |  |  |  |  205|    105|#define VERS_HTML20        (HT20)
  |  |  |  |  ------------------
  |  |  |  |  |  |  177|    105|#define HT20                   1u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_LOOSE         (VERS_HTML20|VERS_HTML32|VERS_IFRAME)
  |  |  ------------------
  |  |  |  |  206|    105|#define VERS_HTML32        (HT32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  178|    105|#define HT32                   2u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_LOOSE         (VERS_HTML20|VERS_HTML32|VERS_IFRAME)
  |  |  ------------------
  |  |  |  |  217|    105|#define VERS_IFRAME        (VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  208|    105|#define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  180|    105|#define H40T                   8u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  183|    105|#define H41T                  64u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_HTML40_LOOSE  (H40T|H41T|X10T)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  186|    105|#define X10T                 512u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_IFRAME        (VERS_HTML40_LOOSE|VERS_FRAMESET)
  |  |  |  |  ------------------
  |  |  |  |  |  |  209|    105|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  181|    105|#define H40F                  16u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  184|    105|#define H41F                 128u
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  187|    105|#define X10F                1024u
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2013:18): [True: 81, False: 24]
  ------------------
 2014|     81|        {
 2015|     81|            TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10T));
  ------------------
  |  |   23|     81|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     81|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, pub, GetFPIFromVers(X10T));
  ------------------
  |  |  186|     81|#define X10T                 512u
  ------------------
 2016|     81|            TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10T));
  ------------------
  |  |   23|     81|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     81|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(RepairAttrValue)(doc, doctype, sys, GetSIFromVers(X10T));
  ------------------
  |  |  186|     81|#define X10T                 512u
  ------------------
 2017|     81|            lexer->versionEmitted = X10T;
  ------------------
  |  |  186|     81|#define X10T                 512u
  ------------------
 2018|     81|        }
 2019|     24|        else if (lexer->versions & VERS_HTML5)
  ------------------
  |  |  213|     24|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|     24|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|     24|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (2019:18): [True: 9, False: 15]
  ------------------
 2020|      9|        {
 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|      9|        }
 2029|     15|        else
 2030|     15|        {
 2031|     15|            if (doctype)
  ------------------
  |  Branch (2031:17): [True: 15, False: 0]
  ------------------
 2032|     15|                TY_(DiscardElement)(doc, doctype);
  ------------------
  |  |   23|     15|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     15|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2033|     15|            return no;
 2034|     15|        }
 2035|    113|        break;
 2036|    113|    case TidyDoctypeOmit:
  ------------------
  |  Branch (2036:5): [True: 0, False: 20.6k]
  ------------------
 2037|      0|        assert(0);
  ------------------
  |  Branch (2037:9): [Folded, False: 0]
  |  Branch (2037:9): [Folded, False: 0]
  ------------------
 2038|      0|        break;
 2039|  20.6k|    }
 2040|       |
 2041|    113|    return no;
 2042|  20.6k|}
prvTidyInferredTag:
 2174|   300k|{
 2175|   300k|    Lexer *lexer = doc->lexer;
 2176|   300k|    Node *node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|   300k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   300k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2177|   300k|    const Dict* dict = TY_(LookupTagDef)(id);
  ------------------
  |  |   23|   300k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   300k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2178|       |
 2179|   300k|    assert( dict != NULL );
  ------------------
  |  Branch (2179:5): [True: 0, False: 300k]
  |  Branch (2179:5): [True: 300k, False: 0]
  ------------------
 2180|       |
 2181|   300k|    node->type = StartTag;
 2182|   300k|    node->implicit = yes;
 2183|   300k|    node->element = TY_(tmbstrdup)(doc->allocator, dict->name);
  ------------------
  |  |   23|   300k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   300k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2184|   300k|    node->tag = dict;
 2185|   300k|    node->start = lexer->txtstart;
 2186|   300k|    node->end = lexer->txtend;
 2187|       |
 2188|   300k|    return node;
 2189|   300k|}
prvTidyUngetToken:
 2409|  1.01M|{
 2410|  1.01M|    doc->lexer->pushed = yes;
 2411|  1.01M|}
prvTidyGetToken:
 2441|  6.01M|{
 2442|  6.01M|    Node *node;
 2443|  6.01M|    Lexer* lexer = doc->lexer;
 2444|       |
 2445|  6.01M|    if (lexer->pushed || lexer->itoken)
  ------------------
  |  Branch (2445:9): [True: 1.01M, False: 4.99M]
  |  Branch (2445:26): [True: 8.76k, False: 4.98M]
  ------------------
 2446|  1.02M|    {
 2447|       |        /* Deal with previously returned duplicate inline token */
 2448|  1.02M|        if (lexer->itoken)
  ------------------
  |  Branch (2448:13): [True: 8.79k, False: 1.01M]
  ------------------
 2449|  8.79k|        {
 2450|       |            /* itoken rejected */
 2451|  8.79k|            if (lexer->pushed)
  ------------------
  |  Branch (2451:17): [True: 24, False: 8.76k]
  ------------------
 2452|     24|            {
 2453|     24|                lexer->pushed = no;
 2454|     24|                node = lexer->itoken;
 2455|     24|                GTDBG(doc,"lex-itoken", node);
 2456|     24|                return node;
 2457|     24|            }
 2458|       |            /* itoken has been accepted */
 2459|  8.76k|            lexer->itoken = NULL;
 2460|  8.76k|        }
 2461|       |            
 2462|       |        /* duplicate inlines in preference to pushed text nodes when appropriate */
 2463|  1.02M|        lexer->pushed = no;
 2464|  1.02M|        if (lexer->token->type != TextNode
  ------------------
  |  Branch (2464:13): [True: 978k, False: 48.5k]
  ------------------
 2465|  1.01M|            || !(lexer->insert || lexer->inode)) {
  ------------------
  |  Branch (2465:18): [True: 8.76k, False: 39.7k]
  |  Branch (2465:35): [True: 0, False: 39.7k]
  ------------------
 2466|  1.01M|            node = lexer->token;
 2467|  1.01M|            GTDBG(doc,"lex-token", node);
 2468|  1.01M|            return node;
 2469|  1.01M|        }
 2470|  8.76k|        lexer->itoken = TY_(InsertedToken)( doc );
  ------------------
  |  |   23|  8.76k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.76k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2471|  8.76k|        node = lexer->itoken;
 2472|  8.76k|        GTDBG(doc,"lex-inserted", node);
 2473|  8.76k|        return node;
 2474|  1.02M|    }
 2475|       |
 2476|  6.01M|    assert( !(lexer->pushed || lexer->itoken) );
  ------------------
  |  Branch (2476:5): [True: 4.98M, False: 0]
  |  Branch (2476:5): [True: 0, False: 0]
  |  Branch (2476:5): [True: 0, False: 4.98M]
  |  Branch (2476:5): [True: 0, False: 4.98M]
  ------------------
 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.98M|    if ((lexer->insert || lexer->inode) && lexer->istacksize)
  ------------------
  |  Branch (2482:10): [True: 1.78M, False: 3.20M]
  |  Branch (2482:27): [True: 4.15k, False: 3.19M]
  |  Branch (2482:44): [True: 1.78M, False: 1.51k]
  ------------------
 2483|  1.78M|    {
 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.78M|        lexer->token = TY_(InsertedToken)( doc );
  ------------------
  |  |   23|  1.78M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.78M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2488|  1.78M|        node = lexer->token;
 2489|  1.78M|        GTDBG(doc,"lex-inserted2", node);
 2490|  1.78M|        return node;
 2491|  1.78M|    }
 2492|       |
 2493|  3.19M|    if (mode == CdataContent)
  ------------------
  |  Branch (2493:9): [True: 3.96k, False: 3.19M]
  ------------------
 2494|  3.96k|    {
 2495|  3.96k|        assert( lexer->parent != NULL );
  ------------------
  |  Branch (2495:9): [True: 0, False: 3.96k]
  |  Branch (2495:9): [True: 3.96k, False: 0]
  ------------------
 2496|  3.96k|        node = GetCDATA(doc, lexer->parent);
 2497|  3.96k|        GTDBG(doc,"lex-cdata", node);
 2498|  3.96k|        return node;
 2499|  3.96k|    }
 2500|       |
 2501|  3.19M|    return GetTokenFromStream( doc, mode );
 2502|  3.19M|}
prvTidyInitMap:
 3480|  20.6k|{
 3481|  20.6k|    MapStr("\r\n\f", newline|white);
  ------------------
  |  |   72|  20.6k|#define newline     16u
  ------------------
                  MapStr("\r\n\f", newline|white);
  ------------------
  |  |   71|  20.6k|#define white       8u
  ------------------
 3482|  20.6k|    MapStr(" \t", white);
  ------------------
  |  |   71|  20.6k|#define white       8u
  ------------------
 3483|  20.6k|    MapStr("-.:_", namechar);
  ------------------
  |  |   70|  20.6k|#define namechar    4u
  ------------------
 3484|  20.6k|    MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   68|  20.6k|#define digit       1u
  ------------------
                  MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   75|  20.6k|#define digithex    128u
  ------------------
                  MapStr("0123456789", digit|digithex|namechar);
  ------------------
  |  |   70|  20.6k|#define namechar    4u
  ------------------
 3485|  20.6k|    MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   73|  20.6k|#define lowercase   32u
  ------------------
                  MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   69|  20.6k|#define letter      2u
  ------------------
                  MapStr("abcdefghijklmnopqrstuvwxyz", lowercase|letter|namechar);
  ------------------
  |  |   70|  20.6k|#define namechar    4u
  ------------------
 3486|  20.6k|    MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   74|  20.6k|#define uppercase   64u
  ------------------
                  MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   69|  20.6k|#define letter      2u
  ------------------
                  MapStr("ABCDEFGHIJKLMNOPQRSTUVWXYZ", uppercase|letter|namechar);
  ------------------
  |  |   70|  20.6k|#define namechar    4u
  ------------------
 3487|  20.6k|    MapStr("abcdefABCDEF", digithex);
  ------------------
  |  |   75|  20.6k|#define digithex    128u
  ------------------
 3488|  20.6k|}
prvTidyNewAttribute:
 4155|   639k|{
 4156|   639k|    AttVal *av = (AttVal*) TidyDocAlloc( doc, sizeof(AttVal) );
  ------------------
  |  |  157|   639k|#define TidyDocAlloc(doc, size) TidyAlloc((doc)->allocator, size)
  |  |  ------------------
  |  |  |  |   66|   639k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  |  |  ------------------
  ------------------
 4157|   639k|    TidyClearMemory( av, sizeof(AttVal) );
  ------------------
  |  |   70|   639k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 4158|   639k|    return av;
 4159|   639k|}
prvTidyNewAttributeEx:
 4164|  42.1k|{
 4165|  42.1k|    AttVal *av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  42.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4166|  42.1k|    av->attribute = TY_(tmbstrdup)(doc->allocator, name);
  ------------------
  |  |   23|  42.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4167|  42.1k|    av->value = TY_(tmbstrdup)(doc->allocator, value);
  ------------------
  |  |   23|  42.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4168|  42.1k|    av->delim = delim;
 4169|  42.1k|    av->dict = TY_(FindAttribute)( doc, av );
  ------------------
  |  |   23|  42.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4170|  42.1k|    return av;
 4171|  42.1k|}
prvTidyInsertAttributeAtEnd:
 4187|   126k|{
 4188|   126k|    AddAttrToList(&node->attributes, av);
 4189|   126k|}
prvTidyInsertAttributeAtStart:
 4192|  42.1k|{
 4193|  42.1k|    av->next = node->attributes;
 4194|  42.1k|    node->attributes = av;
 4195|  42.1k|}
prvTidynewStack:
 4461|   143k|{
 4462|   143k|    Stack *stack = (Stack *)TidyAlloc(doc->allocator, sizeof(Stack));
  ------------------
  |  |   66|   143k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 4463|   143k|    stack->top = -1;
 4464|   143k|    stack->capacity = capacity;
 4465|   143k|    stack->firstNode = (Node **)TidyAlloc(doc->allocator, stack->capacity * sizeof(Node**));
  ------------------
  |  |   66|   143k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 4466|   143k|    stack->allocator = doc->allocator;
 4467|   143k|    return stack;
 4468|   143k|}
prvTidygrowStack:
 4477|    438|{
 4478|    438|    uint new_capacity = stack->capacity * 2;
 4479|       |    
 4480|    438|    Node **firstNode = (Node **)TidyAlloc(stack->allocator, new_capacity * sizeof(Node**));
  ------------------
  |  |   66|    438|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
 4481|       |    
 4482|    438|    memcpy( firstNode, stack->firstNode, sizeof(Node**) * (stack->top + 1) );
 4483|    438|    TidyFree(stack->allocator, stack->firstNode);
  ------------------
  |  |   68|    438|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 4484|       |
 4485|    438|    stack->firstNode = firstNode;
 4486|    438|    stack->capacity = new_capacity;
 4487|    438|}
prvTidystackFull:
 4494|  14.4M|{
 4495|  14.4M|    return stack->top == stack->capacity - 1;
 4496|  14.4M|}
prvTidystackEmpty:
 4503|  1.03M|{
 4504|  1.03M|    return stack->top == -1;
 4505|  1.03M|}
prvTidypush:
 4512|  14.4M|{
 4513|  14.4M|    if (TY_(stackFull)(stack))
  ------------------
  |  |   23|  14.4M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.4M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4513:9): [True: 438, False: 14.4M]
  ------------------
 4514|    438|        TY_(growStack)(stack);
  ------------------
  |  |   23|    438|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    438|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4515|       |    
 4516|  14.4M|    if (node)
  ------------------
  |  Branch (4516:9): [True: 892k, False: 13.5M]
  ------------------
 4517|   892k|        stack->firstNode[++stack->top] = node;
 4518|  14.4M|}
prvTidypop:
 4525|  1.03M|{
 4526|  1.03M|    return TY_(stackEmpty)(stack) ? NULL : stack->firstNode[stack->top--];
  ------------------
  |  |   23|  1.03M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.03M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4526:12): [True: 143k, False: 892k]
  ------------------
 4527|  1.03M|}
prvTidyfreeStack:
 4542|   143k|{
 4543|   143k|    TidyFree( stack->allocator, stack->firstNode );
  ------------------
  |  |   68|   143k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 4544|   143k|    stack->top = -1;
 4545|   143k|    stack->capacity = 0;
 4546|   143k|    stack->firstNode = NULL;
 4547|       |    stack->allocator = NULL;
 4548|   143k|}
lexer.c:AddByte:
  936|   320M|{
  937|   320M|    if ( lexer->lexsize + 2 >= lexer->lexlength )
  ------------------
  |  Branch (937:10): [True: 22.5k, False: 320M]
  ------------------
  938|  22.5k|    {
  939|  22.5k|        tmbstr buf = NULL;
  940|  22.5k|        uint allocAmt = lexer->lexlength;
  941|  22.5k|        uint prev = allocAmt; /* Is. #761 */
  942|  45.0k|        while ( lexer->lexsize + 2 >= allocAmt )
  ------------------
  |  Branch (942:17): [True: 22.5k, False: 22.5k]
  ------------------
  943|  22.5k|        {
  944|  22.5k|            if ( allocAmt == 0 )
  ------------------
  |  Branch (944:18): [True: 20.5k, False: 1.95k]
  ------------------
  945|  20.5k|                allocAmt = 8192;
  946|  1.95k|            else
  947|  1.95k|                allocAmt *= 2;
  948|  22.5k|            if (allocAmt < prev) /* Is. #761 - watch for wrap - and */
  ------------------
  |  Branch (948:17): [True: 0, False: 22.5k]
  ------------------
  949|      0|                TidyPanic(lexer->allocator, "\nPanic: out of internal memory!\nDocument input too big!\n");
  ------------------
  |  |   69|      0|#define TidyPanic(allocator, msg) ((allocator)->vtbl->panic((allocator), (msg)))
  ------------------
  950|  22.5k|        }
  951|  22.5k|        buf = (tmbstr) TidyRealloc( lexer->allocator, lexer->lexbuf, allocAmt );
  ------------------
  |  |   67|  22.5k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  952|  22.5k|        if ( buf )
  ------------------
  |  Branch (952:14): [True: 22.5k, False: 0]
  ------------------
  953|  22.5k|        {
  954|  22.5k|          TidyClearMemory( buf + lexer->lexlength, 
  ------------------
  |  |   70|  22.5k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  955|  22.5k|                           allocAmt - lexer->lexlength );
  956|  22.5k|          lexer->lexbuf = buf;
  957|  22.5k|          lexer->lexlength = allocAmt;
  958|  22.5k|        }
  959|  22.5k|    }
  960|       |
  961|   320M|    lexer->lexbuf[ lexer->lexsize++ ] = ch;
  962|   320M|    lexer->lexbuf[ lexer->lexsize ]   = '\0';  /* debug */
  963|   320M|}
lexer.c:GetNameFromVers:
  322|  51.0k|{
  323|  51.0k|    uint i;
  324|       |
  325|   969k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (325:17): [True: 969k, False: 76]
  ------------------
  326|   969k|        if (W3C_Doctypes[i].vers == vers)
  ------------------
  |  Branch (326:13): [True: 50.9k, False: 918k]
  ------------------
  327|  50.9k|            return W3C_Doctypes[i].name;
  328|       |
  329|     76|    return NULL;
  330|  51.0k|}
lexer.c:GetSIFromVers:
  311|  19.2k|{
  312|  19.2k|    uint i;
  313|       |
  314|   365k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (314:17): [True: 365k, False: 0]
  ------------------
  315|   365k|        if (W3C_Doctypes[i].vers == vers)
  ------------------
  |  Branch (315:13): [True: 19.2k, False: 346k]
  ------------------
  316|  19.2k|            return W3C_Doctypes[i].si;
  317|       |
  318|      0|    return NULL;
  319|  19.2k|}
lexer.c:NewDocTypeNode:
 1908|  18.3k|{
 1909|  18.3k|    Node* doctype = NULL;
 1910|  18.3k|    Node* html = TY_(FindHTML)( doc );
  ------------------
  |  |   23|  18.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1911|       |
 1912|  18.3k|    if ( !html )
  ------------------
  |  Branch (1912:10): [True: 0, False: 18.3k]
  ------------------
 1913|      0|        return NULL;
 1914|       |
 1915|  18.3k|    doctype = TY_(NewNode)( doc->allocator, NULL );
  ------------------
  |  |   23|  18.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1916|  18.3k|    doctype->type = DocTypeTag;
 1917|  18.3k|    TY_(InsertNodeBeforeElement)(html, doctype);
  ------------------
  |  |   23|  18.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1918|  18.3k|    return doctype;
 1919|  18.3k|}
lexer.c:GetFPIFromVers:
  300|  3.90k|{
  301|  3.90k|    uint i;
  302|       |
  303|  76.5k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (303:17): [True: 72.8k, False: 3.63k]
  ------------------
  304|  72.8k|        if (W3C_Doctypes[i].vers == vers)
  ------------------
  |  Branch (304:13): [True: 274, False: 72.5k]
  ------------------
  305|    274|            return W3C_Doctypes[i].fpi;
  306|       |
  307|  3.63k|    return NULL;
  308|  3.90k|}
lexer.c:GetCDATA:
 2220|  3.96k|{
 2221|  3.96k|    Lexer* lexer = doc->lexer;
 2222|  3.96k|    uint start = 0;
 2223|  3.96k|    int nested = 0;
 2224|  3.96k|    CDATAState state = CDATA_INTERMEDIATE;
 2225|  3.96k|    uint i;
 2226|  3.96k|    Bool isEmpty = yes;
 2227|  3.96k|    Bool matches = no;
 2228|  3.96k|    uint c;
 2229|  3.96k|    Bool hasSrc = (TY_(AttrGetById)(container, TidyAttr_SRC) != NULL) ? yes : no;
  ------------------
  |  |   23|  3.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2229:19): [True: 1.14k, False: 2.82k]
  ------------------
 2230|       |    /*\ Issue #65 (1642186) and #280 - is script or style, and the option on
 2231|       |     *  If yes, then avoid incrementing nested...
 2232|       |    \*/
 2233|  3.96k|    Bool nonested = ((nodeIsSCRIPT(container) || (nodeIsSTYLE(container))) && 
  ------------------
  |  |  422|  3.96k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  7.93k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.96k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.96k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.41k, False: 2.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  Bool nonested = ((nodeIsSCRIPT(container) || (nodeIsSTYLE(container))) && 
  ------------------
  |  |  421|  2.55k|#define nodeIsSTYLE( node )      TagIsId( node, TidyTag_STYLE )
  |  |  ------------------
  |  |  |  |  275|  2.55k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.55k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.55k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.12k, False: 426]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2234|  3.54k|        cfgBool(doc, TidySkipNested)) ? yes : no;
  ------------------
  |  |  418|  3.54k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.54k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 3.54k, False: 0]
  |  |  ------------------
  ------------------
 2235|       |
 2236|  3.96k|    SetLexerLocus( doc, lexer );
 2237|  3.96k|    lexer->waswhite = no;
 2238|  3.96k|    lexer->txtstart = lexer->txtend = lexer->lexsize;
 2239|       |
 2240|       |    /* seen start tag, look for matching end tag */
 2241|  14.1M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|  14.1M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.1M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|  14.1M|#define EndOfStream (~0u)
  ------------------
  |  Branch (2241:12): [True: 14.1M, False: 552]
  ------------------
 2242|  14.1M|    {
 2243|  14.1M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  14.1M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.1M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2244|  14.1M|        lexer->txtend = lexer->lexsize;
 2245|       |
 2246|  14.1M|        if (state == CDATA_INTERMEDIATE)
  ------------------
  |  Branch (2246:13): [True: 13.7M, False: 395k]
  ------------------
 2247|  13.7M|        {
 2248|  13.7M|            if (c != '<')
  ------------------
  |  Branch (2248:17): [True: 13.6M, False: 21.8k]
  ------------------
 2249|  13.6M|            {
 2250|  13.6M|                if (isEmpty && !TY_(IsWhite)(c))
  ------------------
  |  |   23|  6.59k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.59k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2250:21): [True: 6.59k, False: 13.6M]
  |  Branch (2250:32): [True: 1.27k, False: 5.32k]
  ------------------
 2251|  1.27k|                    isEmpty = no;
 2252|  13.6M|                continue;
 2253|  13.6M|            }
 2254|       |
 2255|  21.8k|            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  21.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2256|       |
 2257|  21.8k|            if (TY_(IsLetter)(c))
  ------------------
  |  |   23|  21.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2257:17): [True: 8.66k, False: 13.2k]
  ------------------
 2258|  8.66k|            {
 2259|       |                /* <head><script src=foo><meta name=foo content=bar>*/
 2260|  8.66k|                if (hasSrc && isEmpty && nodeIsSCRIPT(container))
  ------------------
  |  |  422|  1.35k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  1.35k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.35k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.35k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.10k, False: 244]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2260:21): [True: 1.54k, False: 7.11k]
  |  Branch (2260:31): [True: 1.35k, False: 196]
  ------------------
 2261|  1.10k|                {
 2262|       |                    /* ReportError(doc, container, NULL, MISSING_ENDTAG_FOR); */
 2263|  1.10k|                    lexer->lexsize = lexer->txtstart;
 2264|  1.10k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2265|  1.10k|                    TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2266|  1.10k|                    return NULL;
 2267|  1.10k|                }
 2268|  7.55k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  7.55k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.55k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2269|  7.55k|                start = lexer->lexsize - 1;
 2270|  7.55k|                state = CDATA_STARTTAG;
 2271|  7.55k|            }
 2272|  13.2k|            else if (c == '/')
  ------------------
  |  Branch (2272:22): [True: 6.00k, False: 7.20k]
  ------------------
 2273|  6.00k|            {
 2274|  6.00k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  6.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2275|       |
 2276|  6.00k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  6.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2277|       |                
 2278|  6.00k|                if (!TY_(IsLetter)(c))
  ------------------
  |  |   23|  6.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2278:21): [True: 653, False: 5.35k]
  ------------------
 2279|    653|                {
 2280|    653|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    653|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    653|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2281|    653|                    continue;
 2282|    653|                }
 2283|  5.35k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  5.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2284|       |
 2285|  5.35k|                start = lexer->lexsize;
 2286|  5.35k|                state = CDATA_ENDTAG;
 2287|  5.35k|            }
 2288|  7.20k|            else if (c == '\\')
  ------------------
  |  Branch (2288:22): [True: 1.17k, False: 6.03k]
  ------------------
 2289|  1.17k|            {
 2290|       |                /* recognize document.write("<script><\/script>") */
 2291|  1.17k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  1.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2292|       |
 2293|  1.17k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2294|       |
 2295|  1.17k|                if (c != '/')
  ------------------
  |  Branch (2295:21): [True: 274, False: 903]
  ------------------
 2296|    274|                {
 2297|    274|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    274|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    274|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2298|    274|                    continue;
 2299|    274|                }
 2300|       |
 2301|    903|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|    903|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    903|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2302|       |
 2303|    903|                if (nonested) {
  ------------------
  |  Branch (2303:21): [True: 200, False: 703]
  ------------------
 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|    200|                    continue;
 2311|    200|                }
 2312|       |
 2313|    703|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    703|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    703|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2314|       |                
 2315|    703|                if (!TY_(IsLetter)(c))
  ------------------
  |  |   23|    703|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    703|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2315:21): [True: 398, False: 305]
  ------------------
 2316|    398|                {
 2317|    398|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    398|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    398|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2318|    398|                    continue;
 2319|    398|                }
 2320|    305|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    305|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    305|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2321|       |
 2322|    305|                start = lexer->lexsize;
 2323|    305|                state = CDATA_ENDTAG;
 2324|    305|            }
 2325|  6.03k|            else
 2326|  6.03k|            {
 2327|  6.03k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  6.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2328|  6.03k|            }
 2329|  21.8k|        }
 2330|       |        /* '<' + Letter found */
 2331|   395k|        else if (state == CDATA_STARTTAG)
  ------------------
  |  Branch (2331:18): [True: 27.1k, False: 368k]
  ------------------
 2332|  27.1k|        {
 2333|  27.1k|            if (TY_(IsLetter)(c))
  ------------------
  |  |   23|  27.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2333:17): [True: 19.6k, False: 7.50k]
  ------------------
 2334|  19.6k|                continue;
 2335|       |
 2336|  7.50k|            matches = TY_(tmbstrncasecmp)(container->element, lexer->lexbuf + start,
  ------------------
  |  |   23|  7.50k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.50k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2337|  7.50k|                                          TY_(tmbstrlen)(container->element)) == 0;
  ------------------
  |  |   23|  7.50k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.50k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2338|  7.50k|            if (matches && !nonested)
  ------------------
  |  Branch (2338:17): [True: 2.04k, False: 5.46k]
  |  Branch (2338:28): [True: 1.03k, False: 1.01k]
  ------------------
 2339|  1.03k|                nested++;
 2340|       |
 2341|  7.50k|            state = CDATA_INTERMEDIATE;
 2342|  7.50k|        }
 2343|       |        /* '<' + '/' + Letter found */
 2344|   368k|        else if (state == CDATA_ENDTAG)
  ------------------
  |  Branch (2344:18): [True: 368k, False: 0]
  ------------------
 2345|   368k|        {
 2346|   368k|            if (TY_(IsLetter)(c))
  ------------------
  |  |   23|   368k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   368k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2346:17): [True: 362k, False: 5.64k]
  ------------------
 2347|   362k|                continue;
 2348|       |
 2349|  5.64k|            matches = TY_(tmbstrncasecmp)(container->element, lexer->lexbuf + start,
  ------------------
  |  |   23|  5.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2350|  5.64k|                                          TY_(tmbstrlen)(container->element)) == 0;
  ------------------
  |  |   23|  5.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2351|       |
 2352|  5.64k|            if (isEmpty && !matches)
  ------------------
  |  Branch (2352:17): [True: 1.52k, False: 4.12k]
  |  Branch (2352:28): [True: 747, False: 778]
  ------------------
 2353|    747|            {
 2354|       |                /* ReportError(doc, container, NULL, MISSING_ENDTAG_FOR); */
 2355|       |
 2356|  65.0k|                for (i = lexer->lexsize - 1; i >= start; --i)
  ------------------
  |  Branch (2356:46): [True: 64.2k, False: 747]
  ------------------
 2357|  64.2k|                    TY_(UngetChar)((uint)lexer->lexbuf[i], doc->docIn);
  ------------------
  |  |   23|  64.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  64.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2358|    747|                TY_(UngetChar)('/', doc->docIn);
  ------------------
  |  |   23|    747|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    747|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2359|    747|                TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|    747|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    747|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2360|    747|                break;
 2361|    747|            }
 2362|       |
 2363|  4.90k|            if (matches && nested-- <= 0)
  ------------------
  |  Branch (2363:17): [True: 1.75k, False: 3.14k]
  |  Branch (2363:28): [True: 1.56k, False: 197]
  ------------------
 2364|  1.56k|            {
 2365|   156k|                for (i = lexer->lexsize - 1; i >= start; --i)
  ------------------
  |  Branch (2365:46): [True: 155k, False: 1.56k]
  ------------------
 2366|   155k|                    TY_(UngetChar)((uint)lexer->lexbuf[i], doc->docIn);
  ------------------
  |  |   23|   155k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   155k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2367|  1.56k|                TY_(UngetChar)('/', doc->docIn);
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2368|  1.56k|                TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2369|  1.56k|                lexer->lexsize -= (lexer->lexsize - start) + 2;
 2370|  1.56k|                break;
 2371|  1.56k|            }
 2372|  3.34k|            else if (lexer->lexbuf[start - 2] != '\\')
  ------------------
  |  Branch (2372:22): [True: 3.03k, False: 304]
  ------------------
 2373|  3.03k|            {
 2374|       |                /* if the end tag is not already escaped using backslash */
 2375|  3.03k|                SetLexerLocus( doc, lexer );
 2376|  3.03k|                lexer->columns -= 3;
 2377|       |
 2378|       |                /*\ if javascript insert backslash before / 
 2379|       |                 *  Issue #348 - Add option, escape-scripts, to skip
 2380|       |                \*/
 2381|  3.03k|                if ((TY_(IsJavaScript)(container)) && cfgBool(doc, TidyEscapeScripts) &&
  ------------------
  |  |   23|  3.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ((TY_(IsJavaScript)(container)) && cfgBool(doc, TidyEscapeScripts) &&
  ------------------
  |  |  418|  4.49k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.45k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 1.45k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (2381:21): [True: 1.45k, False: 1.58k]
  ------------------
 2382|  1.45k|                    !TY_(IsHTML5Mode)(doc) )    /* Is #700 - This only applies to legacy html4 mode */
  ------------------
  |  |   23|  1.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2382:21): [True: 354, False: 1.10k]
  ------------------
 2383|    354|                {
 2384|       |                    /* Issue #281 - only warn if adding the escape! */
 2385|    354|                    TY_(Report)(doc, NULL, NULL, BAD_CDATA_CONTENT);
  ------------------
  |  |   23|    354|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    354|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2386|       |
 2387|   141k|                    for (i = lexer->lexsize; i > start-1; --i)
  ------------------
  |  Branch (2387:46): [True: 141k, False: 354]
  ------------------
 2388|   141k|                        lexer->lexbuf[i] = lexer->lexbuf[i-1];
 2389|       |
 2390|    354|                    lexer->lexbuf[start-1] = '\\';
 2391|    354|                    lexer->lexsize++;
 2392|    354|                }
 2393|  3.03k|            }
 2394|  3.34k|            state = CDATA_INTERMEDIATE;
 2395|  3.34k|        }
 2396|  14.1M|    }
 2397|  2.85k|    if (isEmpty)
  ------------------
  |  Branch (2397:9): [True: 1.58k, False: 1.27k]
  ------------------
 2398|  1.58k|        lexer->lexsize = lexer->txtstart = lexer->txtend;
 2399|  1.27k|    else
 2400|  1.27k|        lexer->txtend = lexer->lexsize;
 2401|       |
 2402|  2.85k|    if (c == EndOfStream)
  ------------------
  |  | 1064|  2.85k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2402:9): [True: 552, False: 2.30k]
  ------------------
 2403|    552|        TY_(Report)(doc, container, NULL, MISSING_ENDTAG_FOR );
  ------------------
  |  |   23|    552|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    552|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2404|       |
 2405|  2.85k|    return TY_(TextToken)(lexer);
  ------------------
  |  |   23|  2.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2406|  3.96k|}
lexer.c:SetLexerLocus:
 1007|  7.47M|{
 1008|  7.47M|    lexer->lines = doc->docIn->curline;
 1009|  7.47M|    lexer->columns = doc->docIn->curcol;
 1010|  7.47M|}
lexer.c:GetTokenFromStream:
 2512|  3.19M|{
 2513|  3.19M|    Lexer* lexer = doc->lexer;
 2514|  3.19M|    uint c, lexdump, badcomment = 0;
 2515|  3.19M|    Bool isempty = no;
 2516|  3.19M|    AttVal *attributes = NULL;
 2517|  3.19M|    Node *node;
 2518|  3.19M|    Bool fixComments;
 2519|       |    
 2520|  3.19M|    switch ( cfgAutoBool(doc, TidyFixComments) )
  ------------------
  |  |  421|  3.19M|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.19M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2521|  3.19M|    {
 2522|      0|        case TidyYesState:
  ------------------
  |  Branch (2522:9): [True: 0, False: 3.19M]
  ------------------
 2523|      0|            fixComments = yes;
 2524|      0|            break;
 2525|       |
 2526|      0|        case TidyNoState:
  ------------------
  |  Branch (2526:9): [True: 0, False: 3.19M]
  ------------------
 2527|      0|            fixComments = no;
 2528|      0|            break;
 2529|       |
 2530|  3.19M|        default:
  ------------------
  |  Branch (2530:9): [True: 3.19M, False: 0]
  ------------------
 2531|  3.19M|            fixComments = (TY_(HTMLVersion)(doc) & HT50) == 0;
  ------------------
  |  |   23|  3.19M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.19M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          fixComments = (TY_(HTMLVersion)(doc) & HT50) == 0;
  ------------------
  |  |  200|  3.19M|#define HT50              131072u
  ------------------
 2532|  3.19M|            break;
 2533|  3.19M|    }
 2534|       |
 2535|       |    /* Lexer->token must be set on return. Nullify it for safety. */
 2536|  3.19M|    lexer->token = NULL;
 2537|       |
 2538|  3.19M|    SetLexerLocus( doc, lexer );
 2539|  3.19M|    lexer->waswhite = no;
 2540|       |
 2541|  3.19M|    lexer->txtstart = lexer->txtend = lexer->lexsize;
 2542|       |
 2543|   258M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|   258M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   258M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|   258M|#define EndOfStream (~0u)
  ------------------
  |  Branch (2543:12): [True: 256M, False: 1.66M]
  ------------------
 2544|   256M|    {
 2545|   256M|        if (lexer->insertspace)
  ------------------
  |  Branch (2545:13): [True: 1.42k, False: 256M]
  ------------------
 2546|  1.42k|        {
 2547|  1.42k|            TY_(AddCharToLexer)(lexer, ' ');
  ------------------
  |  |   23|  1.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2548|  1.42k|            lexer->waswhite = yes;
 2549|  1.42k|            lexer->insertspace = no;
 2550|  1.42k|        }
 2551|       |
 2552|   256M|        if (c == 160 && (mode == Preformatted))
  ------------------
  |  Branch (2552:13): [True: 684, False: 256M]
  |  Branch (2552:25): [True: 210, False: 474]
  ------------------
 2553|    210|            c = ' ';
 2554|       |
 2555|   256M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   256M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   256M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2556|       |
 2557|   256M|        switch (lexer->state)
  ------------------
  |  Branch (2557:17): [True: 256M, False: 0]
  ------------------
 2558|   256M|        {
 2559|   157M|            case LEX_CONTENT:  /* element content */
  ------------------
  |  Branch (2559:13): [True: 157M, False: 98.8M]
  ------------------
 2560|       |
 2561|       |                /*
 2562|       |                 Discard white space if appropriate. Its cheaper
 2563|       |                 to do this here rather than in parser methods
 2564|       |                 for elements that don't have mixed content.
 2565|       |                */
 2566|   157M|                if (TY_(IsWhite)(c) && (mode == IgnoreWhitespace) 
  ------------------
  |  |   23|   157M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   157M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2566:21): [True: 144M, False: 13.3M]
  |  Branch (2566:40): [True: 1.14M, False: 143M]
  ------------------
 2567|  1.14M|                      && lexer->lexsize == lexer->txtstart + 1)
  ------------------
  |  Branch (2567:26): [True: 1.06M, False: 79.5k]
  ------------------
 2568|  1.06M|                {
 2569|  1.06M|                    --(lexer->lexsize);
 2570|  1.06M|                    lexer->waswhite = no;
 2571|  1.06M|                    SetLexerLocus( doc, lexer );
 2572|  1.06M|                    continue;
 2573|  1.06M|                }
 2574|       |
 2575|   156M|                if (c == '<')
  ------------------
  |  Branch (2575:21): [True: 1.43M, False: 155M]
  ------------------
 2576|  1.43M|                {
 2577|  1.43M|                    lexer->state = LEX_GT;
 2578|  1.43M|                    continue;
 2579|  1.43M|                }
 2580|       |
 2581|   155M|                if (TY_(IsWhite)(c))
  ------------------
  |  |   23|   155M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   155M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2581:21): [True: 143M, False: 11.8M]
  ------------------
 2582|   143M|                {
 2583|       |                    /* was previous character white? */
 2584|   143M|                    if (lexer->waswhite)
  ------------------
  |  Branch (2584:25): [True: 142M, False: 263k]
  ------------------
 2585|   142M|                    {
 2586|   142M|                        if (mode != Preformatted && mode != IgnoreMarkup)
  ------------------
  |  Branch (2586:29): [True: 3.00M, False: 139M]
  |  Branch (2586:53): [True: 3.00M, False: 0]
  ------------------
 2587|  3.00M|                        {
 2588|  3.00M|                            --(lexer->lexsize);
 2589|  3.00M|                            SetLexerLocus( doc, lexer );
 2590|  3.00M|                        }
 2591|   142M|                    }
 2592|   263k|                    else /* prev character wasn't white */
 2593|   263k|                    {
 2594|   263k|                        lexer->waswhite = yes;
 2595|       |
 2596|   263k|                        if (mode != Preformatted && mode != IgnoreMarkup && c != ' ')
  ------------------
  |  Branch (2596:29): [True: 81.2k, False: 181k]
  |  Branch (2596:53): [True: 81.2k, False: 0]
  |  Branch (2596:77): [True: 36.4k, False: 44.8k]
  ------------------
 2597|  36.4k|                            ChangeChar(lexer, ' ');
 2598|   263k|                    }
 2599|       |
 2600|   143M|                    continue;
 2601|   143M|                }
 2602|  11.8M|                else if (c == '&' && mode != IgnoreMarkup)
  ------------------
  |  Branch (2602:26): [True: 184k, False: 11.6M]
  |  Branch (2602:38): [True: 184k, False: 0]
  ------------------
 2603|   184k|                    ParseEntity( doc, mode );
 2604|       |
 2605|       |                /* this is needed to avoid trimming trailing whitespace */
 2606|  11.8M|                if (mode == IgnoreWhitespace)
  ------------------
  |  Branch (2606:21): [True: 98.2k, False: 11.7M]
  ------------------
 2607|  98.2k|                    mode = MixedContent;
 2608|       |
 2609|  11.8M|                lexer->waswhite = no;
 2610|  11.8M|                continue;
 2611|       |
 2612|  1.43M|            case LEX_GT:  /* < */
  ------------------
  |  Branch (2612:13): [True: 1.43M, False: 255M]
  ------------------
 2613|       |
 2614|       |                /* check for endtag */
 2615|  1.43M|                if (c == '/')
  ------------------
  |  Branch (2615:21): [True: 91.9k, False: 1.33M]
  ------------------
 2616|  91.9k|                {
 2617|  91.9k|                    if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  91.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  91.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  91.9k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2617:25): [True: 31, False: 91.9k]
  ------------------
 2618|     31|                    {
 2619|     31|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     31|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     31|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2620|     31|                        continue;
 2621|     31|                    }
 2622|       |
 2623|  91.9k|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  91.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  91.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2624|       |
 2625|  91.9k|                    if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|  91.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  91.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |  418|  33.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  16.8k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 16.8k]
  |  |  ------------------
  ------------------
                                  if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2625:25): [True: 75.1k, False: 16.8k]
  |  Branch (2625:75): [True: 0, False: 0]
  ------------------
 2626|  75.1k|                    {
 2627|  75.1k|                        lexer->lexsize -= 3;
 2628|  75.1k|                        lexer->txtend = lexer->lexsize;
 2629|  75.1k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  75.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  75.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2630|  75.1k|                        lexer->state = LEX_ENDTAG;
 2631|  75.1k|                        lexer->lexbuf[lexer->lexsize] = '\0';  /* debug */
 2632|  75.1k|                        doc->docIn->curcol -= 2;
 2633|       |
 2634|       |                        /* if some text before the </ return it now */
 2635|  75.1k|                        if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (2635:29): [True: 11.0k, False: 64.0k]
  ------------------
 2636|  11.0k|                        {
 2637|       |                            /* trim space character before end tag */
 2638|  11.0k|                            if (mode == IgnoreWhitespace && lexer->lexbuf[lexer->lexsize - 1] == ' ')
  ------------------
  |  Branch (2638:33): [True: 1.32k, False: 9.70k]
  |  Branch (2638:61): [True: 565, False: 762]
  ------------------
 2639|    565|                            {
 2640|    565|                                lexer->lexsize -= 1;
 2641|    565|                                lexer->txtend = lexer->lexsize;
 2642|    565|                            }
 2643|  11.0k|                            lexer->token = TY_(TextToken)(lexer);
  ------------------
  |  |   23|  11.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2644|  11.0k|                            node = lexer->token;
 2645|  11.0k|                            GTDBG(doc,"text", node);
 2646|  11.0k|                            return node;
 2647|  11.0k|                        }
 2648|       |
 2649|  64.0k|                        continue;       /* no text so keep going */
 2650|  75.1k|                    }
 2651|       |
 2652|       |                    /* otherwise treat as CDATA */
 2653|  16.8k|                    lexer->waswhite = no;
 2654|  16.8k|                    lexer->state = LEX_CONTENT;
 2655|  16.8k|                    continue;
 2656|  91.9k|                }
 2657|       |
 2658|  1.33M|                if (mode == IgnoreMarkup)
  ------------------
  |  Branch (2658:21): [True: 0, False: 1.33M]
  ------------------
 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.33M|                if (c == '!')
  ------------------
  |  Branch (2670:21): [True: 172k, False: 1.16M]
  ------------------
 2671|   172k|                {
 2672|   172k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   172k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   172k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2673|       |
 2674|   172k|                    if (c == '-')
  ------------------
  |  Branch (2674:25): [True: 90.2k, False: 82.5k]
  ------------------
 2675|  90.2k|                    {
 2676|  90.2k|                        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  90.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  90.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2677|       |
 2678|  90.2k|                        if (c == '-')
  ------------------
  |  Branch (2678:29): [True: 87.5k, False: 2.67k]
  ------------------
 2679|  87.5k|                        {
 2680|  87.5k|                            lexer->state = LEX_COMMENT;  /* comment */
 2681|  87.5k|                            lexer->lexsize -= 2;
 2682|  87.5k|                            lexer->txtend = lexer->lexsize;
 2683|       |
 2684|  87.5k|                            CondReturnTextNode(doc, 4)
  ------------------
  |  | 2424|  87.5k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 4.38k, False: 83.1k]
  |  |  ------------------
  |  | 2425|  87.5k|            { \
  |  | 2426|  4.38k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  4.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  4.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  4.38k|                return lexer->token; \
  |  | 2428|  4.38k|            }
  ------------------
 2685|       |
 2686|  83.1k|                            lexer->txtstart = lexer->lexsize;
 2687|  83.1k|                            continue;
 2688|  87.5k|                        }
 2689|       |
 2690|       |                        /*
 2691|       |                           TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_DROPPING );
 2692|       |                           Warning now done later - see issue #487
 2693|       |                         */
 2694|  90.2k|                    }
 2695|  82.5k|                    else if (c == 'd' || c == 'D')
  ------------------
  |  Branch (2695:30): [True: 24.5k, False: 58.0k]
  |  Branch (2695:42): [True: 33.6k, False: 24.3k]
  ------------------
 2696|  58.2k|                    {
 2697|       |                        /* todo: check for complete "<!DOCTYPE" not just <!D */
 2698|       |
 2699|  58.2k|                        uint skip = 0;
 2700|       |
 2701|  58.2k|                        lexer->state = LEX_DOCTYPE; /* doctype */
 2702|  58.2k|                        lexer->lexsize -= 2;
 2703|  58.2k|                        lexer->txtend = lexer->lexsize;
 2704|  58.2k|                        mode = IgnoreWhitespace;
 2705|       |
 2706|       |                        /* skip until white space or '>' */
 2707|       |
 2708|  58.2k|                        for (;;)
 2709|  78.0k|                        {
 2710|  78.0k|                            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  78.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  78.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2711|  78.0k|                            ++skip;
 2712|       |
 2713|  78.0k|                            if (c == EndOfStream || c == '>')
  ------------------
  |  | 1064|   156k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2713:33): [True: 70, False: 77.9k]
  |  Branch (2713:53): [True: 25.5k, False: 52.4k]
  ------------------
 2714|  25.5k|                            {
 2715|  25.5k|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  25.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  25.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2716|  25.5k|                                break;
 2717|  25.5k|                            }
 2718|       |
 2719|       |
 2720|  52.4k|                            if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|  52.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  52.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2720:33): [True: 19.8k, False: 32.6k]
  ------------------
 2721|  19.8k|                                continue;
 2722|       |
 2723|       |                            /* and skip to end of whitespace */
 2724|       |
 2725|  32.6k|                            for (;;)
 2726|   104k|                            {
 2727|   104k|                                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   104k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   104k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2728|   104k|                                ++skip;
 2729|       |
 2730|   104k|                                if (c == EndOfStream || c == '>')
  ------------------
  |  | 1064|   208k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2730:37): [True: 40, False: 104k]
  |  Branch (2730:57): [True: 1.31k, False: 103k]
  ------------------
 2731|  1.35k|                                {
 2732|  1.35k|                                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2733|  1.35k|                                    break;
 2734|  1.35k|                                }
 2735|       |
 2736|       |
 2737|   103k|                                if (TY_(IsWhite)(c))
  ------------------
  |  |   23|   103k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   103k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2737:37): [True: 71.7k, False: 31.2k]
  ------------------
 2738|  71.7k|                                    continue;
 2739|       |
 2740|  31.2k|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  31.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2741|  31.2k|                                break;
 2742|   103k|                            }
 2743|       |
 2744|  32.6k|                            break;
 2745|  52.4k|                        }
 2746|       |
 2747|  58.2k|                        CondReturnTextNode(doc, (skip + 3))
  ------------------
  |  | 2424|  58.2k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 15.7k, False: 42.4k]
  |  |  ------------------
  |  | 2425|  58.2k|            { \
  |  | 2426|  15.7k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  15.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  15.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  15.7k|                return lexer->token; \
  |  | 2428|  15.7k|            }
  ------------------
 2748|       |
 2749|  42.4k|                        lexer->txtstart = lexer->lexsize;
 2750|  42.4k|                        continue;
 2751|  58.2k|                    }
 2752|  24.3k|                    else if (c == '[')
  ------------------
  |  Branch (2752:30): [True: 18.8k, False: 5.53k]
  ------------------
 2753|  18.8k|                    {
 2754|       |                        /* Word 2000 embeds <![if ...]> ... <![endif]> sequences */
 2755|  18.8k|                        lexer->lexsize -= 2;
 2756|  18.8k|                        lexer->state = LEX_SECTION;
 2757|  18.8k|                        lexer->txtend = lexer->lexsize;
 2758|       |
 2759|  18.8k|                        CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  18.8k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 14.5k, False: 4.25k]
  |  |  ------------------
  |  | 2425|  18.8k|            { \
  |  | 2426|  14.5k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  14.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  14.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  14.5k|                return lexer->token; \
  |  | 2428|  14.5k|            }
  ------------------
 2760|       |
 2761|  4.25k|                        lexer->txtstart = lexer->lexsize;
 2762|  4.25k|                        continue;
 2763|  18.8k|                    }
 2764|       |
 2765|       |
 2766|       |                    /*
 2767|       |                       We only print this message if there's a missing
 2768|       |                       starting hyphen; this comment will be dropped.
 2769|       |                     */
 2770|  8.20k|                    TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_DROPPING ); /* Is. #487 */
  ------------------
  |  |   23|  8.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.20k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2771|       |
 2772|       |                    /* else swallow characters up to and including next '>' */
 2773|  49.8k|                    while ((c = TY_(ReadChar)(doc->docIn)) != '>')
  ------------------
  |  |   23|  49.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2773:28): [True: 41.7k, False: 8.05k]
  ------------------
 2774|  41.7k|                    {
 2775|  41.7k|                        if (c == EndOfStream)
  ------------------
  |  | 1064|  41.7k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2775:29): [True: 150, False: 41.6k]
  ------------------
 2776|    150|                        {
 2777|    150|                            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    150|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    150|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2778|    150|                            break;
 2779|    150|                        }
 2780|  41.7k|                    }
 2781|       |
 2782|  8.20k|                    lexer->lexsize -= 2;
 2783|  8.20k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 2784|  8.20k|                    lexer->state = LEX_CONTENT;
 2785|  8.20k|                    continue;
 2786|   172k|                }
 2787|       |
 2788|       |                /*
 2789|       |                   processing instructions
 2790|       |                */
 2791|       |
 2792|  1.16M|                if (c == '?')
  ------------------
  |  Branch (2792:21): [True: 113k, False: 1.05M]
  ------------------
 2793|   113k|                {
 2794|   113k|                    lexer->lexsize -= 2;
 2795|   113k|                    lexer->state = LEX_PROCINSTR;
 2796|   113k|                    lexer->txtend = lexer->lexsize;
 2797|       |
 2798|   113k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|   113k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 84.5k, False: 29.4k]
  |  |  ------------------
  |  | 2425|   113k|            { \
  |  | 2426|  84.5k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  84.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  84.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  84.5k|                return lexer->token; \
  |  | 2428|  84.5k|            }
  ------------------
 2799|       |
 2800|  29.4k|                    lexer->txtstart = lexer->lexsize;
 2801|  29.4k|                    continue;
 2802|   113k|                }
 2803|       |
 2804|       |                /* Microsoft ASP's e.g. <% ... server-code ... %> */
 2805|  1.05M|                if (c == '%')
  ------------------
  |  Branch (2805:21): [True: 2.49k, False: 1.04M]
  ------------------
 2806|  2.49k|                {
 2807|  2.49k|                    lexer->lexsize -= 2;
 2808|  2.49k|                    lexer->state = LEX_ASP;
 2809|  2.49k|                    lexer->txtend = lexer->lexsize;
 2810|       |
 2811|  2.49k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  2.49k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 684, False: 1.81k]
  |  |  ------------------
  |  | 2425|  2.49k|            { \
  |  | 2426|    684|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|    684|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    684|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|    684|                return lexer->token; \
  |  | 2428|    684|            }
  ------------------
 2812|       |
 2813|  1.81k|                    lexer->txtstart = lexer->lexsize;
 2814|  1.81k|                    continue;
 2815|  2.49k|                }
 2816|       |
 2817|       |                /* Netscapes JSTE e.g. <# ... server-code ... #> */
 2818|  1.04M|                if (c == '#')
  ------------------
  |  Branch (2818:21): [True: 4.13k, False: 1.04M]
  ------------------
 2819|  4.13k|                {
 2820|  4.13k|                    lexer->lexsize -= 2;
 2821|  4.13k|                    lexer->state = LEX_JSTE;
 2822|  4.13k|                    lexer->txtend = lexer->lexsize;
 2823|       |
 2824|  4.13k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|  4.13k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 1.42k, False: 2.71k]
  |  |  ------------------
  |  | 2425|  4.13k|            { \
  |  | 2426|  1.42k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|  1.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|  1.42k|                return lexer->token; \
  |  | 2428|  1.42k|            }
  ------------------
 2825|       |
 2826|  2.71k|                    lexer->txtstart = lexer->lexsize;
 2827|  2.71k|                    continue;
 2828|  4.13k|                }
 2829|       |
 2830|       |                /* check for start tag */
 2831|  1.04M|                if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|  1.04M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if (TY_(IsLetter)(c) || (cfgBool(doc, TidyXmlTags) && TY_(IsXMLNamechar)(c)))
  ------------------
  |  |  418|   247k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   123k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 123k]
  |  |  ------------------
  ------------------
                              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: 921k, False: 123k]
  |  Branch (2831:71): [True: 0, False: 0]
  ------------------
 2832|   921k|                {
 2833|   921k|                    TY_(UngetChar)(c, doc->docIn);     /* push back letter */
  ------------------
  |  |   23|   921k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   921k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2834|   921k|                    TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|   921k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   921k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2835|   921k|                    lexer->lexsize -= 2;      /* discard "<" + letter */
 2836|   921k|                    lexer->txtend = lexer->lexsize;
 2837|   921k|                    lexer->state = LEX_STARTTAG;         /* ready to read tag name */
 2838|       |
 2839|   921k|                    CondReturnTextNode(doc, 2)
  ------------------
  |  | 2424|   921k|            if (lexer->txtend > lexer->txtstart) \
  |  |  ------------------
  |  |  |  Branch (2424:17): [True: 116k, False: 804k]
  |  |  ------------------
  |  | 2425|   921k|            { \
  |  | 2426|   116k|                lexer->token = TY_(TextToken)(lexer); \
  |  |  ------------------
  |  |  |  |   23|   116k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   116k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  | 2427|   116k|                return lexer->token; \
  |  | 2428|   116k|            }
  ------------------
 2840|       |
 2841|       |                    /* lexer->txtstart = lexer->lexsize; missing here? */
 2842|   804k|                    continue;       /* no text so keep going */
 2843|   921k|                }
 2844|       |
 2845|       |                /* otherwise treat as CDATA */
 2846|       |                /* fix for bug 762102 (486) */
 2847|       |                /* Issue #384 - Fix skipping parsing character, particularly '<<' */
 2848|   123k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   123k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   123k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2849|   123k|                lexer->lexsize -= 1;
 2850|   123k|                lexer->state = LEX_CONTENT;
 2851|   123k|                lexer->waswhite = no;
 2852|   123k|                continue;
 2853|       |
 2854|  75.8k|            case LEX_ENDTAG:  /* </letter */
  ------------------
  |  Branch (2854:13): [True: 75.8k, False: 256M]
  ------------------
 2855|  75.8k|                lexer->txtstart = lexer->lexsize - 1;
 2856|  75.8k|                doc->docIn->curcol += 2;
 2857|  75.8k|                c = ParseTagName( doc );
 2858|  75.8k|                lexer->token = TagToken( doc, EndTag );  /* create endtag token */
 2859|  75.8k|                lexer->lexsize = lexer->txtend = lexer->txtstart;
 2860|       |
 2861|       |                /* skip to '>' */
 2862|   753k|                while ( c != '>' && c != EndOfStream )
  ------------------
  |  | 1064|   678k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2862:25): [True: 678k, False: 74.8k]
  |  Branch (2862:37): [True: 677k, False: 1.02k]
  ------------------
 2863|   677k|                {
 2864|   677k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   677k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   677k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2865|   677k|                }
 2866|       |
 2867|  75.8k|                if (c == EndOfStream)
  ------------------
  |  | 1064|  75.8k|#define EndOfStream (~0u)
  ------------------
  |  Branch (2867:21): [True: 1.02k, False: 74.8k]
  ------------------
 2868|  1.02k|                {
 2869|  1.02k|                    TY_(FreeNode)( doc, lexer->token );
  ------------------
  |  |   23|  1.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2870|  1.02k|                    continue;
 2871|  1.02k|                }
 2872|       |
 2873|  74.8k|                lexer->state = LEX_CONTENT;
 2874|  74.8k|                lexer->waswhite = no;
 2875|  74.8k|                node = lexer->token;
 2876|  74.8k|                GTDBG(doc,"endtag", node);
 2877|  74.8k|                return node;  /* the endtag token */
 2878|       |
 2879|   921k|            case LEX_STARTTAG: /* first letter of tagname */
  ------------------
  |  Branch (2879:13): [True: 921k, False: 255M]
  ------------------
 2880|   921k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   921k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   921k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2881|   921k|                ChangeChar(lexer, (tmbchar)c);
 2882|   921k|                lexer->txtstart = lexer->lexsize - 1; /* set txtstart to first letter */
 2883|   921k|                c = ParseTagName( doc );
 2884|   921k|                isempty = no;
 2885|   921k|                attributes = NULL;
 2886|   921k|                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|   921k|                if (c != '>')
  ------------------
  |  Branch (2889:21): [True: 352k, False: 568k]
  ------------------
 2890|   352k|                {
 2891|   352k|                    if (c == '/')
  ------------------
  |  Branch (2891:25): [True: 10.3k, False: 342k]
  ------------------
 2892|  10.3k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  10.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2893|       |
 2894|   352k|                    attributes = ParseAttrs( doc, &isempty );
 2895|   352k|                }
 2896|       |
 2897|   921k|                if (isempty)
  ------------------
  |  Branch (2897:21): [True: 14.2k, False: 906k]
  ------------------
 2898|  14.2k|                    lexer->token->type = StartEndTag;
 2899|       |
 2900|   921k|                lexer->token->attributes = attributes;
 2901|   921k|                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|   921k|                if ( nodeIsPRE(lexer->token) )
  ------------------
  |  |  383|   921k|#define nodeIsPRE( node )        TagIsId( node, TidyTag_PRE )
  |  |  ------------------
  |  |  |  |  275|   921k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 921k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 762k, False: 158k]
  |  |  |  |  |  Branch (275:54): [True: 36.0k, False: 726k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2914|  36.0k|                {
 2915|  36.0k|                    mode = Preformatted;
 2916|  36.0k|                }
 2917|       |
 2918|   921k|                if ((mode != Preformatted && ExpectsContent(lexer->token))
  ------------------
  |  Branch (2918:22): [True: 833k, False: 87.5k]
  |  Branch (2918:46): [True: 782k, False: 51.0k]
  ------------------
 2919|   921k|                    || nodeIsBR(lexer->token) || nodeIsHR(lexer->token))
  ------------------
  |  |  400|   138k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  1.05M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 138k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 122k, False: 16.1k]
  |  |  |  |  |  Branch (275:54): [True: 5.46k, False: 117k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  || nodeIsBR(lexer->token) || nodeIsHR(lexer->token))
  ------------------
  |  |  380|   133k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|   133k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 133k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 117k, False: 16.1k]
  |  |  |  |  |  Branch (275:54): [True: 7.49k, False: 109k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2920|   795k|                {
 2921|   795k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   795k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   795k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2922|       |
 2923|   795k|                    if ((c == '\n') && (mode != IgnoreWhitespace)) /* Issue #329 - Can NOT afford to lose this newline */
  ------------------
  |  Branch (2923:25): [True: 4.78k, False: 790k]
  |  Branch (2923:40): [True: 4.32k, False: 460]
  ------------------
 2924|  4.32k|                        TY_(UngetChar)(c, doc->docIn);  /* Issue #329 - make sure the newline is maintained for now */
  ------------------
  |  |   23|  4.32k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.32k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2925|   791k|                    else if (c != '\n' && c != '\f')
  ------------------
  |  Branch (2925:30): [True: 790k, False: 460]
  |  Branch (2925:43): [True: 790k, False: 0]
  ------------------
 2926|   790k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   790k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   790k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2927|       |
 2928|   795k|                    lexer->waswhite = yes;  /* to swallow leading whitespace */
 2929|   795k|                }
 2930|   125k|                else
 2931|   125k|                    lexer->waswhite = no;
 2932|       |
 2933|   921k|                lexer->state = LEX_CONTENT;
 2934|   921k|                if (lexer->token->tag == NULL) 
  ------------------
  |  Branch (2934:21): [True: 158k, False: 762k]
  ------------------
 2935|   158k|                {
 2936|   158k|                    if (mode != OtherNamespace) /* [i_a]2 only issue warning if NOT 'OtherNamespace', and tag null */
  ------------------
  |  Branch (2936:25): [True: 153k, False: 5.37k]
  ------------------
 2937|   153k|                    {
 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|   153k|                        if ( (doc->lexer->doctype & VERS_HTML5) > 0 && TY_(elementIsAutonomousCustomFormat)( lexer->token->element ) )
  ------------------
  |  |  213|   153k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|   153k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|   153k|#define XH50              262144u
  |  |  ------------------
  ------------------
                                      if ( (doc->lexer->doctype & VERS_HTML5) > 0 && TY_(elementIsAutonomousCustomFormat)( lexer->token->element ) )
  ------------------
  |  |   23|  56.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  56.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2943:30): [True: 56.3k, False: 96.6k]
  |  Branch (2943:72): [True: 55.4k, False: 882]
  ------------------
 2944|  55.4k|                            TY_(Report)( doc, NULL, lexer->token, UNKNOWN_ELEMENT_LOOKS_CUSTOM );
  ------------------
  |  |   23|  55.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2945|  97.5k|                        else
 2946|  97.5k|                            TY_(Report)( doc, NULL, lexer->token, UNKNOWN_ELEMENT );
  ------------------
  |  |   23|  97.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  97.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2947|   153k|                    }
 2948|   158k|                }
 2949|   762k|                else if ( !cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|   762k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   762k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2949:27): [True: 762k, False: 0]
  ------------------
 2950|   762k|                {
 2951|   762k|                    TY_(ConstrainVersion)( doc, lexer->token->tag->versions );
  ------------------
  |  |   23|   762k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   762k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2952|   762k|                    TY_(RepairDuplicateAttributes)( doc, lexer->token, no );
  ------------------
  |  |   23|   762k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   762k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2953|   762k|                } 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|   921k|                node = lexer->token;
 2956|   921k|                GTDBG(doc,"starttag", node);
 2957|   921k|                return node;  /* return start tag */
 2958|       |
 2959|  2.26M|            case LEX_COMMENT:  /* seen <!-- so look for --> */
  ------------------
  |  Branch (2959:13): [True: 2.26M, False: 254M]
  ------------------
 2960|       |
 2961|  2.26M|                if (c != '-')
  ------------------
  |  Branch (2961:21): [True: 2.13M, False: 135k]
  ------------------
 2962|  2.13M|                    continue;
 2963|       |
 2964|   135k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   135k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   135k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2965|       |
 2966|       |                /* Fix hyphens at beginning of tag */
 2967|   135k|                if ( c != '-' && fixComments && lexer->lexsize - lexer->txtstart == 1 )
  ------------------
  |  Branch (2967:22): [True: 30.2k, False: 105k]
  |  Branch (2967:34): [True: 30.2k, False: 0]
  |  Branch (2967:49): [True: 28.6k, False: 1.65k]
  ------------------
 2968|  28.6k|                {
 2969|  28.6k|                    lexer->lexbuf[lexer->lexsize - 1] = '=';
 2970|  28.6k|                }
 2971|       |
 2972|   135k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   135k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   135k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2973|       |
 2974|   135k|                if (c != '-')
  ------------------
  |  Branch (2974:21): [True: 30.2k, False: 105k]
  ------------------
 2975|  30.2k|                    continue;
 2976|       |
 2977|   662k|            end_comment:
 2978|   662k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   662k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   662k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2979|       |
 2980|   662k|                if (c == '>')
  ------------------
  |  Branch (2980:21): [True: 87.3k, False: 575k]
  ------------------
 2981|  87.3k|                {
 2982|  87.3k|                    if (badcomment)
  ------------------
  |  Branch (2982:25): [True: 10.4k, False: 76.9k]
  ------------------
 2983|  10.4k|                    {
 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|  10.4k|                        if ( (TY_(HTMLVersion)(doc) & HT50) )
  ------------------
  |  |   23|  10.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                      if ( (TY_(HTMLVersion)(doc) & HT50) )
  ------------------
  |  |  200|  10.4k|#define HT50              131072u
  ------------------
  |  Branch (2989:30): [True: 0, False: 10.4k]
  ------------------
 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|  10.4k|                        else
 2996|  10.4k|                        {
 2997|  10.4k|                            if ( fixComments )
  ------------------
  |  Branch (2997:34): [True: 10.4k, False: 0]
  ------------------
 2998|  10.4k|                                TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT );
  ------------------
  |  |   23|  10.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.4k|#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|  10.4k|                        }
 3002|  10.4k|                    }
 3003|       |
 3004|       |                    /* do not store closing -- in lexbuf */
 3005|  87.3k|                    lexer->lexsize -= 2;
 3006|  87.3k|                    lexer->txtend = lexer->lexsize;
 3007|  87.3k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3008|  87.3k|                    lexer->state = LEX_CONTENT;
 3009|  87.3k|                    lexer->waswhite = no;
 3010|  87.3k|                    lexer->token = CommentToken(doc);
  ------------------
  |  | 1611|  87.3k|#define CommentToken(doc) NewToken(doc, CommentTag)
  ------------------
 3011|       |
 3012|       |                    /* now look for a line break */
 3013|       |
 3014|  87.3k|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  87.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  87.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3015|       |
 3016|  87.3k|                    if (c == '\n')
  ------------------
  |  Branch (3016:25): [True: 1.90k, False: 85.4k]
  ------------------
 3017|  1.90k|                        lexer->token->linebreak = yes;
 3018|  85.4k|                    else
 3019|  85.4k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  85.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  85.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3020|       |
 3021|  87.3k|                    node = lexer->token;
 3022|  87.3k|                    GTDBG(doc,"comment", node);
 3023|  87.3k|                    return node;
 3024|  87.3k|                }
 3025|       |
 3026|       |                /* note position of first such error in the comment */
 3027|   575k|                if (!badcomment)
  ------------------
  |  Branch (3027:21): [True: 10.4k, False: 564k]
  ------------------
 3028|  10.4k|                {
 3029|  10.4k|                    SetLexerLocus( doc, lexer );
 3030|  10.4k|                    lexer->columns -= 3;
 3031|  10.4k|                }
 3032|       |
 3033|   575k|                badcomment++;
 3034|       |
 3035|       |                /* fix hyphens in the middle */
 3036|   575k|                if ( fixComments )
  ------------------
  |  Branch (3036:22): [True: 575k, False: 0]
  ------------------
 3037|   575k|                    lexer->lexbuf[lexer->lexsize - 2] = '=';
 3038|       |
 3039|       |                /* if '-' then look for '>' to end the comment */
 3040|   575k|                if (c == '-')
  ------------------
  |  Branch (3040:21): [True: 556k, False: 18.2k]
  ------------------
 3041|   556k|                {
 3042|   556k|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   556k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   556k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3043|   556k|                    goto end_comment;
 3044|   556k|                }
 3045|       |
 3046|       |                /* fix hyphens end, and continue to look for --> */
 3047|  18.2k|                if ( fixComments )
  ------------------
  |  Branch (3047:22): [True: 18.2k, False: 0]
  ------------------
 3048|  18.2k|                    lexer->lexbuf[lexer->lexsize - 1] = '=';
 3049|       |
 3050|       |                /* http://tidy.sf.net/bug/1266647 */
 3051|  18.2k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  18.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3052|       |
 3053|  18.2k|                continue; 
 3054|       |
 3055|  58.1k|            case LEX_DOCTYPE:  /* seen <!d so look for '>' munging whitespace */
  ------------------
  |  Branch (3055:13): [True: 58.1k, False: 256M]
  ------------------
 3056|       |
 3057|       |                /* use ParseDocTypeDecl() to tokenize doctype declaration */
 3058|  58.1k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  58.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  58.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3059|  58.1k|                lexer->lexsize -= 1;
 3060|  58.1k|                lexer->token = ParseDocTypeDecl(doc);
 3061|       |
 3062|  58.1k|                lexer->txtend = lexer->lexsize;
 3063|  58.1k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3064|  58.1k|                lexer->state = LEX_CONTENT;
 3065|  58.1k|                lexer->waswhite = no;
 3066|       |
 3067|       |                /* make a note of the version named by the 1st doctype */
 3068|  58.1k|                if (lexer->doctype == VERS_UNKNOWN && lexer->token && !cfgBool(doc, TidyXmlTags))
  ------------------
  |  |  204|   116k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  58.1k|#define xxxx                   0u
  |  |  ------------------
  ------------------
                              if (lexer->doctype == VERS_UNKNOWN && lexer->token && !cfgBool(doc, TidyXmlTags))
  ------------------
  |  |  418|  15.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  15.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (3068:21): [True: 45.6k, False: 12.4k]
  |  Branch (3068:55): [True: 15.2k, False: 30.3k]
  |  Branch (3068:71): [True: 15.2k, False: 0]
  ------------------
 3069|  15.2k|                {
 3070|  15.2k|                    lexer->doctype = FindGivenVersion(doc, lexer->token);
 3071|  15.2k|                    if (lexer->doctype != VERS_HTML5)
  ------------------
  |  |  213|  15.2k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  15.2k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  15.2k|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (3071:25): [True: 15.0k, False: 185]
  ------------------
 3072|  15.0k|                    {
 3073|       |                        /*\
 3074|       |                         *  Back to legacy HTML4 mode for -
 3075|       |                         *  Issue #167 & #169 - TidyTag_A
 3076|       |                         *  Issue #196        - TidyTag_CAPTION
 3077|       |                         *  others?
 3078|       |                        \*/ 
 3079|  15.0k|                        TY_(AdjustTags)(doc); /* Dynamically modify the tags table  */
  ------------------
  |  |   23|  15.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3080|  15.0k|                    }
 3081|  15.2k|                }
 3082|  58.1k|                node = lexer->token;
 3083|  58.1k|                GTDBG(doc,"doctype", node);
 3084|  58.1k|                return node;
 3085|       |
 3086|  36.4M|            case LEX_PROCINSTR:  /* seen <? so look for '>' */
  ------------------
  |  Branch (3086:13): [True: 36.4M, False: 220M]
  ------------------
 3087|       |                /* check for PHP preprocessor instructions <?php ... ?> */
 3088|       |
 3089|  36.4M|                if  (lexer->lexsize - lexer->txtstart == 3)
  ------------------
  |  Branch (3089:22): [True: 26.3k, False: 36.3M]
  ------------------
 3090|  26.3k|                {
 3091|  26.3k|                    if (TY_(tmbstrncmp)(lexer->lexbuf + lexer->txtstart, "php", 3) == 0)
  ------------------
  |  |   23|  26.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3091:25): [True: 399, False: 25.9k]
  ------------------
 3092|    399|                    {
 3093|    399|                        lexer->state = LEX_PHP;
 3094|    399|                        continue;
 3095|    399|                    }
 3096|  26.3k|                }
 3097|       |
 3098|  36.4M|                if  (lexer->lexsize - lexer->txtstart == 4)
  ------------------
  |  Branch (3098:22): [True: 24.3k, False: 36.4M]
  ------------------
 3099|  24.3k|                {
 3100|  24.3k|                    if (TY_(tmbstrncmp)(lexer->lexbuf + lexer->txtstart, "xml", 3) == 0 &&
  ------------------
  |  |   23|  24.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3100:25): [True: 21.7k, False: 2.60k]
  ------------------
 3101|  21.7k|                        TY_(IsWhite)(lexer->lexbuf[lexer->txtstart + 3]))
  ------------------
  |  |   23|  21.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3101:25): [True: 20.4k, False: 1.28k]
  ------------------
 3102|  20.4k|                    {
 3103|  20.4k|                        lexer->state = LEX_XMLDECL;
 3104|  20.4k|                        attributes = NULL;
 3105|  20.4k|                        continue;
 3106|  20.4k|                    }
 3107|  24.3k|                }
 3108|       |
 3109|  36.4M|                if (cfgBool(doc, TidyXmlPIs) || lexer->isvoyager) /* insist on ?> as terminator */
  ------------------
  |  |  418|  72.8M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  36.4M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 36.4M]
  |  |  ------------------
  ------------------
  |  Branch (3109:49): [True: 3.77k, False: 36.4M]
  ------------------
 3110|  3.77k|                {
 3111|  3.77k|                    if (c != '?')
  ------------------
  |  Branch (3111:25): [True: 3.34k, False: 432]
  ------------------
 3112|  3.34k|                        continue;
 3113|       |
 3114|       |                    /* now look for '>' */
 3115|    432|                    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    432|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    432|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3116|       |
 3117|    432|                    if (c == EndOfStream)
  ------------------
  |  | 1064|    432|#define EndOfStream (~0u)
  ------------------
  |  Branch (3117:25): [True: 3, False: 429]
  ------------------
 3118|      3|                    {
 3119|      3|                        TY_(Report)(doc, NULL, NULL, UNEXPECTED_END_OF_FILE );
  ------------------
  |  |   23|      3|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      3|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3120|      3|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|      3|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      3|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3121|      3|                        continue;
 3122|      3|                    }
 3123|       |
 3124|    429|                    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|    429|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    429|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3125|    429|                }
 3126|       |
 3127|       |
 3128|  36.4M|                if (c != '>')
  ------------------
  |  Branch (3128:21): [True: 36.3M, False: 92.9k]
  ------------------
 3129|  36.3M|                    continue;
 3130|       |
 3131|  92.9k|                lexer->lexsize -= 1;
 3132|       |
 3133|  92.9k|                if (lexer->lexsize)
  ------------------
  |  Branch (3133:21): [True: 90.9k, False: 1.99k]
  ------------------
 3134|  90.9k|                {
 3135|  90.9k|                    uint i;
 3136|  90.9k|                    Bool closed;
 3137|       |
 3138|   174k|                    for (i = 0; i < lexer->lexsize - lexer->txtstart &&
  ------------------
  |  Branch (3138:33): [True: 85.7k, False: 88.8k]
  ------------------
 3139|  85.7k|                        !TY_(IsWhite)(lexer->lexbuf[i + lexer->txtstart]); ++i)
  ------------------
  |  |   23|  85.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  85.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3139:25): [True: 83.6k, False: 2.06k]
  ------------------
 3140|  83.6k|                        /**/;
 3141|       |
 3142|  90.9k|                    closed = lexer->lexbuf[lexer->lexsize - 1] == '?';
 3143|       |
 3144|  90.9k|                    if (closed)
  ------------------
  |  Branch (3144:25): [True: 3.50k, False: 87.4k]
  ------------------
 3145|  3.50k|                        lexer->lexsize -= 1;
 3146|       |
 3147|  90.9k|                    lexer->txtstart += i;
 3148|  90.9k|                    lexer->txtend = lexer->lexsize;
 3149|  90.9k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3150|       |
 3151|  90.9k|                    lexer->token = PIToken(doc);
  ------------------
  |  | 1613|  90.9k|#define PIToken(doc)      NewToken(doc, ProcInsTag)
  ------------------
 3152|  90.9k|                    lexer->token->closed = closed;
 3153|  90.9k|                    lexer->token->element = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  90.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  90.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3154|  90.9k|                                                            lexer->lexbuf +
 3155|  90.9k|                                                            lexer->txtstart - i, i);
 3156|  90.9k|                }
 3157|  1.99k|                else
 3158|  1.99k|                {
 3159|  1.99k|                    lexer->txtend = lexer->lexsize;
 3160|  1.99k|                    lexer->lexbuf[lexer->lexsize] = '\0';
 3161|  1.99k|                    lexer->token = PIToken(doc);
  ------------------
  |  | 1613|  1.99k|#define PIToken(doc)      NewToken(doc, ProcInsTag)
  ------------------
 3162|  1.99k|                }
 3163|       |
 3164|  92.9k|                lexer->state = LEX_CONTENT;
 3165|  92.9k|                lexer->waswhite = no;
 3166|  92.9k|                node = lexer->token;
 3167|  92.9k|                GTDBG(doc,"procinstr", node);
 3168|  92.9k|                return node;
 3169|       |
 3170|  1.10M|            case LEX_ASP:  /* seen <% so look for "%>" */
  ------------------
  |  Branch (3170:13): [True: 1.10M, False: 255M]
  ------------------
 3171|  1.10M|                if (c != '%')
  ------------------
  |  Branch (3171:21): [True: 1.10M, False: 3.34k]
  ------------------
 3172|  1.10M|                    continue;
 3173|       |
 3174|       |                /* now look for '>' */
 3175|  3.34k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  3.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3176|       |
 3177|       |
 3178|  3.34k|                if (c != '>')
  ------------------
  |  Branch (3178:21): [True: 946, False: 2.39k]
  ------------------
 3179|    946|                {
 3180|    946|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    946|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    946|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3181|    946|                    continue;
 3182|    946|                }
 3183|       |
 3184|  2.39k|                lexer->lexsize -= 1;
 3185|  2.39k|                lexer->txtend = lexer->lexsize;
 3186|  2.39k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3187|  2.39k|                lexer->state = LEX_CONTENT;
 3188|  2.39k|                lexer->waswhite = no;
 3189|  2.39k|                lexer->token = AspToken(doc);
  ------------------
  |  | 1614|  2.39k|#define AspToken(doc)     NewToken(doc, AspTag)
  ------------------
 3190|  2.39k|                node = lexer->token;
 3191|  2.39k|                GTDBG(doc,"ASP", node);
 3192|  2.39k|                return node;  /* the endtag token */
 3193|       |
 3194|       |
 3195|       |
 3196|  3.57M|            case LEX_JSTE:  /* seen <# so look for "#>" */
  ------------------
  |  Branch (3196:13): [True: 3.57M, False: 252M]
  ------------------
 3197|  3.57M|                if (c != '#')
  ------------------
  |  Branch (3197:21): [True: 3.57M, False: 4.50k]
  ------------------
 3198|  3.57M|                    continue;
 3199|       |
 3200|       |                /* now look for '>' */
 3201|  4.50k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  4.50k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.50k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3202|       |
 3203|       |
 3204|  4.50k|                if (c != '>')
  ------------------
  |  Branch (3204:21): [True: 469, False: 4.03k]
  ------------------
 3205|    469|                {
 3206|    469|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    469|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    469|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3207|    469|                    continue;
 3208|    469|                }
 3209|       |
 3210|  4.03k|                lexer->lexsize -= 1;
 3211|  4.03k|                lexer->txtend = lexer->lexsize;
 3212|  4.03k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3213|  4.03k|                lexer->state = LEX_CONTENT;
 3214|  4.03k|                lexer->waswhite = no;
 3215|  4.03k|                lexer->token = JsteToken(doc);
  ------------------
  |  | 1615|  4.03k|#define JsteToken(doc)    NewToken(doc, JsteTag)
  ------------------
 3216|  4.03k|                node = lexer->token;
 3217|  4.03k|                GTDBG(doc,"JSTE", node);
 3218|  4.03k|                return node;  /* the JSTE token */
 3219|       |
 3220|       |
 3221|  2.46k|            case LEX_PHP: /* seen "<?php" so look for "?>" */
  ------------------
  |  Branch (3221:13): [True: 2.46k, False: 256M]
  ------------------
 3222|  2.46k|                if (c != '?')
  ------------------
  |  Branch (3222:21): [True: 1.62k, False: 832]
  ------------------
 3223|  1.62k|                    continue;
 3224|       |
 3225|       |                /* now look for '>' */
 3226|    832|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    832|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    832|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3227|       |
 3228|    832|                if (c != '>')
  ------------------
  |  Branch (3228:21): [True: 465, False: 367]
  ------------------
 3229|    465|                {
 3230|    465|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    465|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    465|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3231|    465|                    continue;
 3232|    465|                }
 3233|       |
 3234|    367|                lexer->lexsize -= 1;
 3235|    367|                lexer->txtend = lexer->lexsize;
 3236|    367|                lexer->lexbuf[lexer->lexsize] = '\0';
 3237|    367|                lexer->state = LEX_CONTENT;
 3238|    367|                lexer->waswhite = no;
 3239|    367|                lexer->token = PhpToken(doc);
  ------------------
  |  | 1616|    367|#define PhpToken(doc)     NewToken(doc, PhpTag)
  ------------------
 3240|    367|                node = lexer->token;
 3241|    367|                GTDBG(doc,"PHP", node);
 3242|    367|                return node;  /* the PHP token */
 3243|       |
 3244|  56.1k|            case LEX_XMLDECL: /* seen "<?xml" so look for "?>" */
  ------------------
  |  Branch (3244:13): [True: 56.1k, False: 256M]
  ------------------
 3245|       |
 3246|  56.1k|                if (TY_(IsWhite)(c) && c != '?')
  ------------------
  |  |   23|  56.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  56.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3246:21): [True: 28.1k, False: 27.9k]
  |  Branch (3246:40): [True: 28.1k, False: 0]
  ------------------
 3247|  28.1k|                    continue;
 3248|       |
 3249|       |                /* get pseudo-attribute */
 3250|  27.9k|                if (c != '?')
  ------------------
  |  Branch (3250:21): [True: 27.2k, False: 750]
  ------------------
 3251|  27.2k|                {
 3252|  27.2k|                    tmbstr name;
 3253|  27.2k|                    Node *asp, *php;
 3254|  27.2k|                    AttVal *av = NULL;
 3255|  27.2k|                    int pdelim = 0;
 3256|  27.2k|                    isempty = no;
 3257|       |
 3258|  27.2k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  27.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3259|       |
 3260|  27.2k|                    name = ParseAttribute( doc, &isempty, &asp, &php );
 3261|       |
 3262|  27.2k|                    if (!name)
  ------------------
  |  Branch (3262:25): [True: 19.0k, False: 8.12k]
  ------------------
 3263|  19.0k|                    {
 3264|       |                        /* check if attributes are created by ASP markup */
 3265|  19.0k|                        if (asp)
  ------------------
  |  Branch (3265:29): [True: 3.67k, False: 15.4k]
  ------------------
 3266|  3.67k|                        {
 3267|  3.67k|                            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  3.67k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.67k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3268|  3.67k|                            av->asp = asp;
 3269|  3.67k|                            AddAttrToList( &attributes, av ); 
 3270|  3.67k|                        }
 3271|       |
 3272|       |                        /* check if attributes are created by PHP markup */
 3273|  19.0k|                        if (php)
  ------------------
  |  Branch (3273:29): [True: 2.86k, False: 16.2k]
  ------------------
 3274|  2.86k|                        {
 3275|  2.86k|                            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  2.86k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.86k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3276|  2.86k|                            av->php = php;
 3277|  2.86k|                            AddAttrToList( &attributes, av ); 
 3278|  2.86k|                        }
 3279|       |                      
 3280|       |                        /* fix for http://tidy.sf.net/bug/788031 */
 3281|  19.0k|                        lexer->lexsize -= 1;
 3282|  19.0k|                        lexer->txtend = lexer->txtstart;
 3283|  19.0k|                        lexer->lexbuf[lexer->txtend] = '\0';
 3284|  19.0k|                        lexer->state = LEX_CONTENT;
 3285|  19.0k|                        lexer->waswhite = no;
 3286|  19.0k|                        lexer->token = XmlDeclToken(doc);
  ------------------
  |  | 1617|  19.0k|#define XmlDeclToken(doc) NewToken(doc, XmlDecl)
  ------------------
 3287|  19.0k|                        lexer->token->attributes = attributes;
 3288|  19.0k|                        node = lexer->token;
 3289|  19.0k|                        GTDBG(doc,"xml", node);
 3290|  19.0k|                        return node;  /* the xml token */
 3291|  19.0k|                    }
 3292|       |
 3293|  8.12k|                    av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  8.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3294|  8.12k|                    av->attribute = name;
 3295|  8.12k|                    av->value = ParseValue( doc, name, yes, &isempty, &pdelim );
 3296|  8.12k|                    av->delim = pdelim;
 3297|  8.12k|                    av->dict = TY_(FindAttribute)( doc, av );
  ------------------
  |  |   23|  8.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3298|       |
 3299|  8.12k|                    AddAttrToList( &attributes, av );
 3300|       |                    /* continue; */
 3301|  8.12k|                }
 3302|       |
 3303|       |                /* now look for '>' */
 3304|  8.87k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  8.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3305|       |
 3306|  8.87k|                if (c != '>')
  ------------------
  |  Branch (3306:21): [True: 7.60k, False: 1.26k]
  ------------------
 3307|  7.60k|                {
 3308|  7.60k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  7.60k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.60k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3309|  7.60k|                    continue;
 3310|  7.60k|                }
 3311|  1.26k|                lexer->lexsize -= 1;
 3312|  1.26k|                lexer->txtend = lexer->txtstart;
 3313|  1.26k|                lexer->lexbuf[lexer->txtend] = '\0';
 3314|  1.26k|                lexer->state = LEX_CONTENT;
 3315|  1.26k|                lexer->waswhite = no;
 3316|  1.26k|                lexer->token = XmlDeclToken(doc);
  ------------------
  |  | 1617|  1.26k|#define XmlDeclToken(doc) NewToken(doc, XmlDecl)
  ------------------
 3317|  1.26k|                lexer->token->attributes = attributes;
 3318|  1.26k|                node = lexer->token;
 3319|  1.26k|                GTDBG(doc,"XML", node);
 3320|  1.26k|                return node;  /* the XML token */
 3321|       |
 3322|  52.8M|            case LEX_SECTION: /* seen "<![" so look for "]>" */
  ------------------
  |  Branch (3322:13): [True: 52.8M, False: 203M]
  ------------------
 3323|  52.8M|                if (c == '[')
  ------------------
  |  Branch (3323:21): [True: 17.6k, False: 52.8M]
  ------------------
 3324|  17.6k|                {
 3325|  17.6k|                    if (lexer->lexsize == (lexer->txtstart + 6) &&
  ------------------
  |  Branch (3325:25): [True: 12.9k, False: 4.67k]
  ------------------
 3326|  12.9k|                        TY_(tmbstrncmp)(lexer->lexbuf+lexer->txtstart, "CDATA[", 6) == 0)
  ------------------
  |  |   23|  12.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3326:25): [True: 1.86k, False: 11.1k]
  ------------------
 3327|  1.86k|                    {
 3328|  1.86k|                        lexer->state = LEX_CDATA;
 3329|  1.86k|                        lexer->lexsize -= 6;
 3330|  1.86k|                        continue;
 3331|  1.86k|                    }
 3332|  17.6k|                }
 3333|       |
 3334|  52.8M|                if (c == '>')
  ------------------
  |  Branch (3334:21): [True: 5.64k, False: 52.8M]
  ------------------
 3335|  5.64k|                {
 3336|       |                    /* Is. #462 - reached '>' before ']' */
 3337|  5.64k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  5.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3338|  52.8M|                } else if (c != ']')
  ------------------
  |  Branch (3338:28): [True: 52.8M, False: 14.7k]
  ------------------
 3339|  52.8M|                    continue;
 3340|       |
 3341|       |                /* now look for '>' */
 3342|  20.4k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  20.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3343|       |
 3344|  20.4k|                lexdump = 1;
 3345|  20.4k|                if (c != '>')
  ------------------
  |  Branch (3345:21): [True: 3.81k, False: 16.6k]
  ------------------
 3346|  3.81k|                {
 3347|       |                    /* Issue #153 - can also be ]'-->' */
 3348|  3.81k|                    if (c == '-') 
  ------------------
  |  Branch (3348:25): [True: 1.34k, False: 2.47k]
  ------------------
 3349|  1.34k|                    {
 3350|  1.34k|                        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3351|  1.34k|                        if (c == '-')
  ------------------
  |  Branch (3351:29): [True: 472, False: 873]
  ------------------
 3352|    472|                        {
 3353|    472|                            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|    472|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    472|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3354|    472|                            if (c != '>')
  ------------------
  |  Branch (3354:33): [True: 247, False: 225]
  ------------------
 3355|    247|                            {
 3356|    247|                                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    247|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    247|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3357|    247|                                TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|    247|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    247|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3358|    247|                                TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|    247|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    247|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3359|    247|                                continue;
 3360|    247|                            }
 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|    472|                        }
 3366|    873|                        else
 3367|    873|                        {
 3368|    873|                            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    873|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    873|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3369|    873|                            TY_(UngetChar)('-', doc->docIn);
  ------------------
  |  |   23|    873|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    873|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3370|    873|                            continue;
 3371|    873|                        }
 3372|  1.34k|                    } 
 3373|  2.47k|                    else 
 3374|  2.47k|                    {
 3375|  2.47k|                        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  2.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3376|  2.47k|                        continue;
 3377|  2.47k|                    }
 3378|  3.81k|                }
 3379|       | 
 3380|  16.8k|                lexer->lexsize -= lexdump;
 3381|  16.8k|                lexer->txtend = lexer->lexsize;
 3382|  16.8k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3383|  16.8k|                lexer->state = LEX_CONTENT;
 3384|  16.8k|                lexer->waswhite = no;
 3385|  16.8k|                lexer->token = SectionToken(doc);
  ------------------
  |  | 1618|  16.8k|#define SectionToken(doc) NewToken(doc, SectionTag)
  ------------------
 3386|  16.8k|                node = lexer->token;
 3387|  16.8k|                GTDBG(doc,"SECTION", node);
 3388|  16.8k|                return node;  /* the SECTION token */
 3389|       |
 3390|  32.5k|            case LEX_CDATA: /* seen "<![CDATA[" so look for "]]>" */
  ------------------
  |  Branch (3390:13): [True: 32.5k, False: 256M]
  ------------------
 3391|  32.5k|                if (c != ']')
  ------------------
  |  Branch (3391:21): [True: 29.5k, False: 3.01k]
  ------------------
 3392|  29.5k|                    continue;
 3393|       |
 3394|       |                /* now look for ']' */
 3395|  3.01k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  3.01k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.01k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3396|       |
 3397|  3.01k|                if (c != ']')
  ------------------
  |  Branch (3397:21): [True: 315, False: 2.70k]
  ------------------
 3398|    315|                {
 3399|    315|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    315|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    315|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3400|    315|                    continue;
 3401|    315|                }
 3402|       |
 3403|       |                /* now look for '>' */
 3404|  2.70k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  2.70k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.70k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3405|       |
 3406|  2.70k|                if (c != '>')
  ------------------
  |  Branch (3406:21): [True: 886, False: 1.81k]
  ------------------
 3407|    886|                {
 3408|    886|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    886|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    886|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3409|    886|                    TY_(UngetChar)(']', doc->docIn);
  ------------------
  |  |   23|    886|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    886|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3410|    886|                    continue;
 3411|    886|                }
 3412|       |
 3413|  1.81k|                lexer->lexsize -= 1;
 3414|  1.81k|                lexer->txtend = lexer->lexsize;
 3415|  1.81k|                lexer->lexbuf[lexer->lexsize] = '\0';
 3416|  1.81k|                lexer->state = LEX_CONTENT;
 3417|  1.81k|                lexer->waswhite = no;
 3418|  1.81k|                lexer->token = CDATAToken(doc);
  ------------------
  |  | 1619|  1.81k|#define CDATAToken(doc)   NewToken(doc, CDATATag)
  ------------------
 3419|  1.81k|                node = lexer->token;
 3420|  1.81k|                GTDBG(doc,"CDATA", node);
 3421|  1.81k|                return node;  /* the CDATA token */
 3422|   256M|        }
 3423|   256M|    }
 3424|       |
 3425|  1.66M|    if (lexer->state == LEX_CONTENT)  /* text string */
  ------------------
  |  Branch (3425:9): [True: 1.56M, False: 99.3k]
  ------------------
 3426|  1.56M|    {
 3427|  1.56M|        lexer->txtend = lexer->lexsize;
 3428|       |
 3429|  1.56M|        if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3429:13): [True: 4.17k, False: 1.56M]
  ------------------
 3430|  4.17k|        {
 3431|  4.17k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  4.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3432|       |
 3433|  4.17k|            if (lexer->lexbuf[lexer->lexsize - 1] == ' ')
  ------------------
  |  Branch (3433:17): [True: 344, False: 3.82k]
  ------------------
 3434|    344|            {
 3435|    344|                lexer->lexsize -= 1;
 3436|    344|                lexer->txtend = lexer->lexsize;
 3437|    344|            }
 3438|  4.17k|            lexer->token = TY_(TextToken)(lexer);
  ------------------
  |  |   23|  4.17k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.17k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3439|  4.17k|            node = lexer->token;
 3440|  4.17k|            GTDBG(doc,"textstring", node);
 3441|  4.17k|            return node;  /* the textstring token */
 3442|  4.17k|        }
 3443|  1.56M|    }
 3444|  99.3k|    else if (lexer->state == LEX_COMMENT) /* comment */
  ------------------
  |  Branch (3444:14): [True: 161, False: 99.1k]
  ------------------
 3445|    161|    {
 3446|    161|        if (c == EndOfStream)
  ------------------
  |  | 1064|    161|#define EndOfStream (~0u)
  ------------------
  |  Branch (3446:13): [True: 161, False: 0]
  ------------------
 3447|    161|        {
 3448|       |            /* We print this if we reached end of the stream mid-comment. */
 3449|    161|            TY_(Report)(doc, NULL, NULL, MALFORMED_COMMENT_EOS );
  ------------------
  |  |   23|    161|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    161|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3450|    161|        }
 3451|       |
 3452|    161|        lexer->txtend = lexer->lexsize;
 3453|    161|        lexer->lexbuf[lexer->lexsize] = '\0';
 3454|    161|        lexer->state = LEX_CONTENT;
 3455|    161|        lexer->waswhite = no;
 3456|    161|        lexer->token = CommentToken(doc);
  ------------------
  |  | 1611|    161|#define CommentToken(doc) NewToken(doc, CommentTag)
  ------------------
 3457|    161|        node = lexer->token;
 3458|    161|        GTDBG(doc,"COMMENT", node);
 3459|    161|        return node;  /* the COMMENT token */
 3460|    161|    }
 3461|       |
 3462|       |    /* check attributes before return NULL */
 3463|  1.66M|    if (attributes)
  ------------------
  |  Branch (3463:9): [True: 56, False: 1.66M]
  ------------------
 3464|     56|        TY_(FreeAttribute)( doc, attributes );
  ------------------
  |  |   23|     56|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     56|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3465|       |
 3466|  1.66M|    DEBUG_LOG(SPRTF("Returning NULL...\n"));
 3467|       |    return NULL;
 3468|  1.66M|}
lexer.c:ChangeChar:
  966|   958k|{
  967|   958k|    if ( lexer->lexsize > 0 )
  ------------------
  |  Branch (967:10): [True: 958k, False: 0]
  ------------------
  968|   958k|    {
  969|   958k|        lexer->lexbuf[ lexer->lexsize-1 ] = c;
  970|   958k|    }
  971|   958k|}
lexer.c:ParseEntity:
 1157|   192k|{
 1158|   192k|    typedef enum
 1159|   192k|    {
 1160|   192k|        ENT_default,
 1161|   192k|        ENT_numdec,
 1162|   192k|        ENT_numhex
 1163|   192k|    } ENTState;
 1164|       |    
 1165|   192k|    typedef Bool (*ENTfn)(uint);
 1166|   192k|    const ENTfn entFn[] = {
 1167|   192k|        TY_(IsNamechar),
  ------------------
  |  |   23|   192k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   192k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1168|   192k|        TY_(IsDigit),
  ------------------
  |  |   23|   192k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   192k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1169|   192k|        IsDigitHex
 1170|   192k|    };
 1171|   192k|    uint start;
 1172|   192k|    ENTState entState = ENT_default;
 1173|   192k|    uint charRead = 0;
 1174|   192k|    Bool semicolon = no, found = no;
 1175|   192k|    Bool isXml = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|   192k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   192k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1176|   192k|    Bool preserveEntities = cfgBool( doc, TidyPreserveEntities );
  ------------------
  |  |  418|   192k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   192k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1177|   192k|    uint c, ch, startcol, entver = 0;
 1178|   192k|    Lexer* lexer = doc->lexer;
 1179|       |
 1180|   192k|    start = lexer->lexsize - 1;  /* to start at "&" */
 1181|   192k|    startcol = doc->docIn->curcol - 1;
 1182|       |
 1183|  2.78M|    while ( (c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  |   23|  2.78M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.78M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ( (c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  | 1064|  2.78M|#define EndOfStream (~0u)
  ------------------
  |  Branch (1183:13): [True: 2.78M, False: 509]
  ------------------
 1184|  2.78M|    {
 1185|  2.78M|        if ( c == ';' )
  ------------------
  |  Branch (1185:14): [True: 6.49k, False: 2.78M]
  ------------------
 1186|  6.49k|        {
 1187|  6.49k|            semicolon = yes;
 1188|  6.49k|            break;
 1189|  6.49k|        }
 1190|  2.78M|        ++charRead;
 1191|       |
 1192|  2.78M|        if (charRead == 1 && c == '#')
  ------------------
  |  Branch (1192:13): [True: 191k, False: 2.59M]
  |  Branch (1192:30): [True: 154k, False: 36.4k]
  ------------------
 1193|   154k|        {
 1194|   154k|            if ( !cfgBool(doc, TidyNCR) ||
  ------------------
  |  |  418|   309k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   154k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1194:18): [True: 0, False: 154k]
  ------------------
 1195|   154k|                 cfg(doc, TidyInCharEncoding) == BIG5 ||
  ------------------
  |  |  415|   154k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                               cfg(doc, TidyInCharEncoding) == BIG5 ||
  ------------------
  |  |  145|   309k|#define BIG5        12
  ------------------
  |  Branch (1195:18): [True: 0, False: 154k]
  ------------------
 1196|   154k|                 cfg(doc, TidyInCharEncoding) == SHIFTJIS )
  ------------------
  |  |  415|   154k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                               cfg(doc, TidyInCharEncoding) == SHIFTJIS )
  ------------------
  |  |  146|   154k|#define SHIFTJIS    13
  ------------------
  |  Branch (1196:18): [True: 0, False: 154k]
  ------------------
 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|   154k|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|   154k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   154k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1203|   154k|            entState = ENT_numdec;
 1204|   154k|            continue;
 1205|   154k|        }
 1206|  2.62M|        else if (charRead == 2 && entState == ENT_numdec
  ------------------
  |  Branch (1206:18): [True: 171k, False: 2.45M]
  |  Branch (1206:35): [True: 154k, False: 16.2k]
  ------------------
 1207|   154k|                 && (c == 'x' || (!isXml && c == 'X')) )
  ------------------
  |  Branch (1207:22): [True: 32.1k, False: 122k]
  |  Branch (1207:35): [True: 122k, False: 0]
  |  Branch (1207:45): [True: 116k, False: 5.75k]
  ------------------
 1208|   149k|        {
 1209|   149k|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|   149k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   149k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1210|   149k|            entState = ENT_numhex;
 1211|   149k|            continue;
 1212|   149k|        }
 1213|       |
 1214|  2.47M|        if ( entFn[entState](c) )
  ------------------
  |  Branch (1214:14): [True: 2.29M, False: 185k]
  ------------------
 1215|  2.29M|        {
 1216|  2.29M|            TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|  2.29M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.29M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1217|  2.29M|            continue;
 1218|  2.29M|        }
 1219|       |
 1220|       |        /* otherwise put it back */
 1221|   185k|        TY_(UngetChar)( c, doc->docIn );
  ------------------
  |  |   23|   185k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   185k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1222|   185k|        break;
 1223|  2.47M|    }
 1224|       |
 1225|       |    /* make sure entity is NULL terminated */
 1226|   192k|    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|   192k|    if ( TY_(tmbstrcmp)(lexer->lexbuf+start, "&apos") == 0
  ------------------
  |  |   23|   192k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   192k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1232:10): [True: 210, False: 191k]
  ------------------
 1233|    210|         && !cfgBool(doc, TidyXmlOut)
  ------------------
  |  |  418|   192k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    210|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1233:13): [True: 0, False: 210]
  ------------------
 1234|      0|         && !lexer->isvoyager
  ------------------
  |  Branch (1234:13): [True: 0, False: 0]
  ------------------
 1235|      0|         && !cfgBool(doc, TidyXhtmlOut)
  ------------------
  |  |  418|   192k|#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|   192k|    if (( mode == OtherNamespace ) && ( c == ';' ))
  ------------------
  |  Branch (1239:9): [True: 1.85k, False: 190k]
  |  Branch (1239:39): [True: 405, False: 1.45k]
  ------------------
 1240|    405|    {
 1241|       |        /* #130 MathML attr and entity fix! */
 1242|    405|        found = yes;
 1243|    405|        ch = 255;
 1244|    405|        entver = XH50|HT50;
  ------------------
  |  |  201|    405|#define XH50              262144u
  ------------------
                      entver = XH50|HT50;
  ------------------
  |  |  200|    405|#define HT50              131072u
  ------------------
 1245|    405|        preserveEntities = yes;
 1246|    405|    }
 1247|   191k|    else
 1248|   191k|    {
 1249|       |        /* Lookup entity code and version
 1250|       |        */
 1251|   191k|        found = TY_(EntityInfo)( lexer->lexbuf+start, isXml, &ch, &entver );
  ------------------
  |  |   23|   191k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   191k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1252|   191k|    }
 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|   192k|    if (!preserveEntities && found && TY_(IsLowSurrogate)(ch))
  ------------------
  |  |   23|  54.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  54.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1258:9): [True: 191k, False: 405]
  |  Branch (1258:30): [True: 54.7k, False: 137k]
  |  Branch (1258:39): [True: 37.9k, False: 16.7k]
  ------------------
 1259|  37.9k|    {
 1260|  37.9k|        uint c1;
 1261|  37.9k|        if ((c1 = TY_(ReadChar)(doc->docIn)) == '&')
  ------------------
  |  |   23|  37.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1261:13): [True: 36.7k, False: 1.24k]
  ------------------
 1262|  36.7k|        {
 1263|  36.7k|            SPStatus status;
 1264|       |            /* Have a following entity, 
 1265|       |               so there is a chance of having a valid surrogate pair */
 1266|  36.7k|            c1 = ch;    /* keep first value, in case of error */
 1267|  36.7k|            status = GetSurrogatePair(doc, isXml, &ch);
 1268|  36.7k|            if (status == SP_error)
  ------------------
  |  Branch (1268:17): [True: 36.3k, False: 389]
  ------------------
 1269|  36.3k|            {
 1270|  36.3k|                TY_(ReportSurrogateError)(doc, BAD_SURROGATE_TAIL, c1, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|  36.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1271|  36.3k|                TY_(UngetChar)('&', doc->docIn);  /* otherwise put it back */
  ------------------
  |  |   23|  36.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1272|  36.3k|            }
 1273|  36.7k|        }
 1274|  1.24k|        else
 1275|  1.24k|        {
 1276|       |            /* put this non-entity lead char back */
 1277|  1.24k|            TY_(UngetChar)(c1, doc->docIn);
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1278|       |            /* Have leading surrogate pair, with no tail */
 1279|  1.24k|            TY_(ReportSurrogateError)(doc, BAD_SURROGATE_TAIL, ch, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1280|  1.24k|            ch = 0xFFFD;
 1281|  1.24k|        }
 1282|  37.9k|    } 
 1283|   154k|    else if (!preserveEntities && found && TY_(IsHighSurrogate)(ch))
  ------------------
  |  |   23|  16.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1283:14): [True: 153k, False: 405]
  |  Branch (1283:35): [True: 16.7k, False: 137k]
  |  Branch (1283:44): [True: 469, False: 16.2k]
  ------------------
 1284|    469|    {
 1285|       |        /* Have trailing surrogate pair, with no lead */
 1286|    469|        TY_(ReportSurrogateError)(doc, BAD_SURROGATE_LEAD, ch, 0); /* SP WARNING: - using substitute character */
  ------------------
  |  |   23|    469|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    469|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1287|    469|        ch = 0xFFFD;
 1288|    469|    }
 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|   192k|    if ( !found || (ch >= 128 && ch <= 159) || (ch >= 256 && c != ';') )
  ------------------
  |  Branch (1293:10): [True: 137k, False: 55.1k]
  |  Branch (1293:21): [True: 49.8k, False: 5.29k]
  |  Branch (1293:34): [True: 700, False: 49.1k]
  |  Branch (1293:49): [True: 42.9k, False: 11.4k]
  |  Branch (1293:62): [True: 39.8k, False: 3.17k]
  ------------------
 1294|   177k|    {
 1295|       |        /* set error position just before offending character */
 1296|   177k|        SetLexerLocus( doc, lexer );
 1297|   177k|        lexer->columns = startcol;
 1298|       |
 1299|   177k|        if (lexer->lexsize > start + 1)
  ------------------
  |  Branch (1299:13): [True: 157k, False: 20.4k]
  ------------------
 1300|   157k|        {
 1301|   157k|            if (ch >= 128 && ch <= 159)
  ------------------
  |  Branch (1301:17): [True: 40.5k, False: 116k]
  |  Branch (1301:30): [True: 700, False: 39.8k]
  ------------------
 1302|    700|            {
 1303|       |                /* invalid numeric character reference */
 1304|       |                
 1305|    700|                uint c1 = 0;
 1306|    700|                int replaceMode = DISCARDED_CHAR;
  ------------------
  |  |  314|    700|#define DISCARDED_CHAR          1
  ------------------
 1307|       |            
 1308|       |                /* Always assume Win1252 in this circumstance. */
 1309|    700|                c1 = TY_(DecodeWin1252)( ch );
  ------------------
  |  |   23|    700|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    700|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1310|       |
 1311|    700|                if ( c1 )
  ------------------
  |  Branch (1311:22): [True: 385, False: 315]
  ------------------
 1312|    385|                    replaceMode = REPLACED_CHAR;
  ------------------
  |  |  313|    385|#define REPLACED_CHAR           0
  ------------------
 1313|       |                
 1314|    700|                if ( c != ';' )  /* issue warning if not terminated by ';' */
  ------------------
  |  Branch (1314:22): [True: 503, False: 197]
  ------------------
 1315|    503|                    TY_(ReportEntityError)( doc, MISSING_SEMICOLON_NCR,
  ------------------
  |  |   23|    503|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    503|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1316|    503|                                            lexer->lexbuf+start, c );
 1317|       | 
 1318|    700|                TY_(ReportEncodingError)(doc, INVALID_NCR, ch, replaceMode == DISCARDED_CHAR);
  ------------------
  |  |   23|    700|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    700|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportEncodingError)(doc, INVALID_NCR, ch, replaceMode == DISCARDED_CHAR);
  ------------------
  |  |  314|    700|#define DISCARDED_CHAR          1
  ------------------
 1319|       |                
 1320|    700|                if ( c1 )
  ------------------
  |  Branch (1320:22): [True: 385, False: 315]
  ------------------
 1321|    385|                {
 1322|       |                    /* make the replacement */
 1323|    385|                    lexer->lexsize = start;
 1324|    385|                    TY_(AddCharToLexer)( lexer, c1 );
  ------------------
  |  |   23|    385|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    385|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1325|    385|                    semicolon = no;
 1326|    385|                }
 1327|    315|                else
 1328|    315|                {
 1329|       |                    /* discard */
 1330|    315|                    lexer->lexsize = start;
 1331|    315|                    semicolon = no;
 1332|    315|               }
 1333|       |               
 1334|    700|            }
 1335|   156k|            else
 1336|   156k|                TY_(ReportEntityError)( doc, UNKNOWN_ENTITY,
  ------------------
  |  |   23|   156k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   156k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1337|   156k|                                        lexer->lexbuf+start, ch );
 1338|       |
 1339|   157k|            if (semicolon)
  ------------------
  |  Branch (1339:17): [True: 440, False: 156k]
  ------------------
 1340|    440|                TY_(AddCharToLexer)( lexer, ';' );
  ------------------
  |  |   23|    440|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    440|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1341|   157k|        }
 1342|  20.4k|        else
 1343|  20.4k|        {
 1344|       |            /*\ 
 1345|       |             *  Issue #207 - A naked & is allowed in HTML5, as an unambiguous ampersand!
 1346|       |            \*/
 1347|  20.4k|            if (TY_(HTMLVersion)(doc) != HT50) 
  ------------------
  |  |   23|  20.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(HTMLVersion)(doc) != HT50) 
  ------------------
  |  |  200|  20.4k|#define HT50              131072u
  ------------------
  |  Branch (1347:17): [True: 20.4k, False: 0]
  ------------------
 1348|  20.4k|            {
 1349|  20.4k|                TY_(ReportEntityError)( doc, UNESCAPED_AMPERSAND,
  ------------------
  |  |   23|  20.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1350|  20.4k|                                    lexer->lexbuf+start, ch );
 1351|  20.4k|            }
 1352|  20.4k|        }
 1353|   177k|    }
 1354|  14.6k|    else
 1355|  14.6k|    {
 1356|  14.6k|        if ( c != ';' )    /* issue warning if not terminated by ';' */
  ------------------
  |  Branch (1356:14): [True: 9.14k, False: 5.46k]
  ------------------
 1357|  9.14k|        {
 1358|       |            /* set error position just before offending character */
 1359|  9.14k|            SetLexerLocus( doc, lexer );
 1360|  9.14k|            lexer->columns = startcol;
 1361|  9.14k|            TY_(ReportEntityError)( doc, MISSING_SEMICOLON, lexer->lexbuf+start, c );
  ------------------
  |  |   23|  9.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1362|  9.14k|        }
 1363|       |
 1364|  14.6k|        if (preserveEntities)
  ------------------
  |  Branch (1364:13): [True: 405, False: 14.2k]
  ------------------
 1365|    405|            TY_(AddCharToLexer)( lexer, ';' );
  ------------------
  |  |   23|    405|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    405|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1366|  14.2k|        else
 1367|  14.2k|        {
 1368|  14.2k|            lexer->lexsize = start;
 1369|  14.2k|            if ( ch == 160 && (mode == Preformatted) )
  ------------------
  |  Branch (1369:18): [True: 5.60k, False: 8.59k]
  |  Branch (1369:31): [True: 225, False: 5.38k]
  ------------------
 1370|    225|                ch = ' ';
 1371|  14.2k|            TY_(AddCharToLexer)( lexer, ch );
  ------------------
  |  |   23|  14.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1372|       |
 1373|  14.2k|            if ( ch == '&' && !cfgBool(doc, TidyQuoteAmpersand) )
  ------------------
  |  |  418|    206|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    206|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1373:18): [True: 206, False: 13.9k]
  |  Branch (1373:31): [True: 0, False: 206]
  ------------------
 1374|      0|                AddStringToLexer( lexer, "amp;" );
 1375|  14.2k|        }
 1376|       |
 1377|       |        /* Detect extended vs. basic entities */
 1378|  14.6k|        TY_(ConstrainVersion)( doc, entver );
  ------------------
  |  |   23|  14.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1379|  14.6k|    }
 1380|   192k|}
lexer.c:IsDigitHex:
  470|   732k|{
  471|   732k|    uint map;
  472|       |
  473|   732k|    map = MAP(c);
  ------------------
  |  |  206|   732k|#define MAP(c) ((unsigned)c < 128 ? lexmap[(unsigned)c] : 0)
  |  |  ------------------
  |  |  |  Branch (206:17): [True: 729k, False: 3.38k]
  |  |  ------------------
  ------------------
  474|       |
  475|   732k|    return (map & digithex)!=0;
  ------------------
  |  |   75|   732k|#define digithex    128u
  ------------------
  476|   732k|}
lexer.c:GetSurrogatePair:
 1026|  36.7k|{
 1027|  36.7k|    Lexer* lexer = doc->lexer;
 1028|  36.7k|    uint bufSize = 32;
 1029|  36.7k|    uint c, ch = 0, offset = 0;
 1030|  36.7k|    tmbstr buf = 0;
 1031|  36.7k|    SPStatus status = SP_error;  /* assume failed */
 1032|  36.7k|    int type = 0;   /* assume numeric */
 1033|  36.7k|    uint fch = *pch;
 1034|  36.7k|    int i;  /* has to be signed due to for i >= 0 */
 1035|  36.7k|    if (!lexer)
  ------------------
  |  Branch (1035:9): [True: 0, False: 36.7k]
  ------------------
 1036|      0|        return status;
 1037|  36.7k|    buf = (tmbstr)TidyRealloc(lexer->allocator, buf, bufSize);
  ------------------
  |  |   67|  36.7k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
 1038|  36.7k|    if (!buf)
  ------------------
  |  Branch (1038:9): [True: 0, False: 36.7k]
  ------------------
 1039|      0|        return status;
 1040|   358k|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  |   23|   358k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   358k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream )
  ------------------
  |  | 1064|   358k|#define EndOfStream (~0u)
  ------------------
  |  Branch (1040:12): [True: 358k, False: 87]
  ------------------
 1041|   358k|    {
 1042|   358k|        if (c == ';')
  ------------------
  |  Branch (1042:13): [True: 840, False: 357k]
  ------------------
 1043|    840|        {
 1044|    840|            break;  /* reached end of entity */
 1045|    840|        }
 1046|   357k|        if ((offset + 2) > bufSize)
  ------------------
  |  Branch (1046:13): [True: 383, False: 357k]
  ------------------
 1047|    383|        {
 1048|    383|            bufSize *= 2;
 1049|    383|            buf = (tmbstr)TidyRealloc(lexer->allocator, buf, bufSize);
  ------------------
  |  |   67|    383|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
 1050|    383|            if (!buf)
  ------------------
  |  Branch (1050:17): [True: 0, False: 383]
  ------------------
 1051|      0|            {
 1052|      0|                break;
 1053|      0|            }
 1054|    383|        }
 1055|   357k|        buf[offset++] = c;  /* add char to buffer */
 1056|   357k|        if (offset == 1)
  ------------------
  |  Branch (1056:13): [True: 36.5k, False: 321k]
  ------------------
 1057|  36.5k|        {
 1058|  36.5k|            if (c != '#')   /* is a numeric entity */
  ------------------
  |  Branch (1058:17): [True: 1.06k, False: 35.4k]
  ------------------
 1059|  1.06k|                break;
 1060|  36.5k|        }
 1061|   321k|        else if (offset == 2 && ((c == 'x') || (!isXml && c == 'X')))
  ------------------
  |  Branch (1061:18): [True: 35.4k, False: 285k]
  |  Branch (1061:34): [True: 20.2k, False: 15.2k]
  |  Branch (1061:49): [True: 15.2k, False: 0]
  |  Branch (1061:59): [True: 13.5k, False: 1.63k]
  ------------------
 1062|  33.8k|        {
 1063|  33.8k|            type = 1;   /* set hex digits */
 1064|  33.8k|        }
 1065|   287k|        else
 1066|   287k|        {
 1067|   287k|            if (type)   /* if hex digits */
  ------------------
  |  Branch (1067:17): [True: 283k, False: 3.64k]
  ------------------
 1068|   283k|            {
 1069|   283k|                if (!IsDigitHex(c))
  ------------------
  |  Branch (1069:21): [True: 33.1k, False: 250k]
  ------------------
 1070|  33.1k|                    break;
 1071|   283k|            }
 1072|  3.64k|            else    /* if numeric */
 1073|  3.64k|            {
 1074|  3.64k|                if (!TY_(IsDigit)(c))
  ------------------
  |  |   23|  3.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1074:21): [True: 1.62k, False: 2.01k]
  ------------------
 1075|  1.62k|                    break;
 1076|  3.64k|            }
 1077|   287k|        }
 1078|   357k|    }
 1079|       |
 1080|  36.7k|    if (c == ';')
  ------------------
  |  Branch (1080:9): [True: 840, False: 35.9k]
  ------------------
 1081|    840|    {
 1082|    840|        int scanned;
 1083|       |
 1084|    840|        buf[offset] = 0;
 1085|    840|        if (type)
  ------------------
  |  Branch (1085:13): [True: 645, False: 195]
  ------------------
 1086|    645|            scanned = sscanf(buf + 2, "%x", &ch);
 1087|    195|        else
 1088|    195|            scanned = sscanf(buf + 1, "%d", &ch);
 1089|       |
 1090|    840|        if (scanned == 1 && TY_(IsHighSurrogate)(ch))
  ------------------
  |  |   23|    638|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    638|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1090:13): [True: 638, False: 202]
  |  Branch (1090:29): [True: 389, False: 249]
  ------------------
 1091|    389|        {
 1092|    389|            ch = TY_(CombineSurrogatePair)(ch, fch);
  ------------------
  |  |   23|    389|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    389|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1093|    389|            if (TY_(IsValidCombinedChar)(ch))
  ------------------
  |  |   23|    389|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    389|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1093:17): [True: 195, False: 194]
  ------------------
 1094|    195|            {
 1095|    195|                *pch = ch;  /* return combined pair value */
 1096|    195|                status = SP_ok; /* full success - pair used */
 1097|    195|            }
 1098|    194|            else
 1099|    194|            {
 1100|    194|                status = SP_failed; /* is one of the 32 out-of-range pairs */
 1101|    194|                *pch = 0xFFFD;  /* return substitute character */
 1102|    194|                TY_(ReportSurrogateError)(doc, BAD_SURROGATE_PAIR, fch, ch); /* SP WARNING: -  */
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1103|    194|            }
 1104|    389|        }
 1105|    840|    }
 1106|       |
 1107|  36.7k|    if (status == SP_error)
  ------------------
  |  Branch (1107:9): [True: 36.3k, False: 389]
  ------------------
 1108|  36.3k|    {
 1109|       |        /* Error condition - can only put back all the chars */
 1110|  36.3k|        if (c == ';') /* if last, not added to buffer */
  ------------------
  |  Branch (1110:13): [True: 451, False: 35.9k]
  ------------------
 1111|    451|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    451|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    451|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1112|  36.3k|        if (buf && offset)
  ------------------
  |  Branch (1112:13): [True: 36.3k, False: 0]
  |  Branch (1112:20): [True: 36.1k, False: 212]
  ------------------
 1113|  36.1k|        {
 1114|       |            /* correct the order for unget - last first */
 1115|   391k|            for (i = offset - 1; i >= 0; i--)
  ------------------
  |  Branch (1115:34): [True: 355k, False: 36.1k]
  ------------------
 1116|   355k|            {
 1117|   355k|                c = buf[i];
 1118|   355k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   355k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   355k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1119|   355k|            }
 1120|  36.1k|        }
 1121|  36.3k|    }
 1122|       |
 1123|  36.7k|    if (buf)
  ------------------
  |  Branch (1123:9): [True: 36.7k, False: 0]
  ------------------
 1124|  36.7k|        TidyFree(lexer->allocator, buf);
  ------------------
  |  |   68|  36.7k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 1125|       |
 1126|  36.7k|    return status;
 1127|  36.7k|}
lexer.c:ParseTagName:
 1383|   997k|{
 1384|   997k|    Lexer *lexer = doc->lexer;
 1385|   997k|    uint c = lexer->lexbuf[ lexer->txtstart ];
 1386|   997k|    Bool xml = cfgBool(doc, TidyXmlTags);
  ------------------
  |  |  418|   997k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   997k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1387|       |
 1388|       |    /* fold case of first character in buffer */
 1389|   997k|    if (!xml && TY_(IsUpper)(c))
  ------------------
  |  |   23|   997k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   997k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1389:9): [True: 997k, False: 0]
  |  Branch (1389:17): [True: 480k, False: 516k]
  ------------------
 1390|   480k|        lexer->lexbuf[lexer->txtstart] = (tmbchar) TY_(ToLower)(c);
  ------------------
  |  |   23|   480k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   480k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1391|       |
 1392|  7.24M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|  7.24M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.24M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|  7.24M|#define EndOfStream (~0u)
  ------------------
  |  Branch (1392:12): [True: 7.23M, False: 4.89k]
  ------------------
 1393|  7.23M|    {
 1394|  7.23M|        if ((!xml && !TY_(IsNamechar)(c)) ||
  ------------------
  |  |   23|  7.23M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.23M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1394:14): [True: 7.23M, False: 0]
  |  Branch (1394:22): [True: 992k, False: 6.24M]
  ------------------
 1395|  6.24M|            (xml && !TY_(IsXMLNamechar)(c)))
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1395:14): [True: 0, False: 6.24M]
  |  Branch (1395:21): [True: 0, False: 0]
  ------------------
 1396|   992k|            break;
 1397|       |
 1398|       |        /* fold case of subsequent characters */
 1399|  6.24M|        if (!xml && TY_(IsUpper)(c))
  ------------------
  |  |   23|  6.24M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.24M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1399:13): [True: 6.24M, False: 0]
  |  Branch (1399:21): [True: 1.26M, False: 4.97M]
  ------------------
 1400|  1.26M|             c = TY_(ToLower)(c);
  ------------------
  |  |   23|  1.26M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.26M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1401|       |
 1402|  6.24M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  6.24M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.24M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1403|  6.24M|    }
 1404|       |
 1405|   997k|    lexer->txtend = lexer->lexsize;
 1406|   997k|    return (tmbchar) c;
 1407|   997k|}
lexer.c:TagToken:
 1585|   997k|{
 1586|   997k|    Lexer* lexer = doc->lexer;
 1587|   997k|    Node* node = TY_(NewNode)( lexer->allocator, lexer );
  ------------------
  |  |   23|   997k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   997k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1588|   997k|    node->type = type;
 1589|   997k|    node->element = TY_(tmbstrndup)( doc->allocator,
  ------------------
  |  |   23|   997k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   997k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1590|   997k|                                     lexer->lexbuf + lexer->txtstart,
 1591|   997k|                                     lexer->txtend - lexer->txtstart );
 1592|   997k|    node->start = lexer->txtstart;
 1593|   997k|    node->end = lexer->txtstart;
 1594|       |
 1595|   997k|    if ( type == StartTag || type == StartEndTag || type == EndTag )
  ------------------
  |  Branch (1595:10): [True: 921k, False: 75.8k]
  |  Branch (1595:30): [True: 0, False: 75.8k]
  |  Branch (1595:53): [True: 75.8k, False: 0]
  ------------------
 1596|   997k|        TY_(FindTag)(doc, node);
  ------------------
  |  |   23|   997k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   997k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1597|       |
 1598|   997k|    return node;
 1599|   997k|}
lexer.c:ParseAttrs:
 4200|   352k|{
 4201|   352k|    Lexer* lexer = doc->lexer;
 4202|   352k|    AttVal *av, *list;
 4203|   352k|    tmbstr value;
 4204|   352k|    int delim;
 4205|   352k|    Node *asp, *php;
 4206|       |
 4207|   352k|    list = NULL;
 4208|       |
 4209|   553k|    while ( !EndOfInput(doc) )
  ------------------
  |  Branch (4209:13): [True: 544k, False: 8.44k]
  ------------------
 4210|   544k|    {
 4211|   544k|        tmbstr attribute = ParseAttribute( doc, isempty, &asp, &php );
 4212|       |
 4213|   544k|        if (attribute == NULL)
  ------------------
  |  Branch (4213:13): [True: 349k, False: 195k]
  ------------------
 4214|   349k|        {
 4215|       |            /* check if attributes are created by ASP markup */
 4216|   349k|            if (asp)
  ------------------
  |  Branch (4216:17): [True: 1.29k, False: 348k]
  ------------------
 4217|  1.29k|            {
 4218|  1.29k|                av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  1.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4219|  1.29k|                av->asp = asp;
 4220|  1.29k|                AddAttrToList( &list, av ); 
 4221|  1.29k|                continue;
 4222|  1.29k|            }
 4223|       |
 4224|       |            /* check if attributes are created by PHP markup */
 4225|   348k|            if (php)
  ------------------
  |  Branch (4225:17): [True: 3.84k, False: 344k]
  ------------------
 4226|  3.84k|            {
 4227|  3.84k|                av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  3.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4228|  3.84k|                av->php = php;
 4229|  3.84k|                AddAttrToList( &list, av ); 
 4230|  3.84k|                continue;
 4231|  3.84k|            }
 4232|       |
 4233|   344k|            break;
 4234|   348k|        }
 4235|       |
 4236|   195k|        value = ParseValue( doc, attribute, no, isempty, &delim );
 4237|       |
 4238|   195k|        if (attribute && (IsValidAttrName(attribute) ||
  ------------------
  |  Branch (4238:13): [True: 195k, False: 0]
  |  Branch (4238:27): [True: 139k, False: 55.8k]
  ------------------
 4239|  55.8k|            (cfgBool(doc, TidyXmlTags) && IsValidXMLAttrName(attribute))))
  ------------------
  |  |  418|   111k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  55.8k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 55.8k]
  |  |  ------------------
  ------------------
                          (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|   139k|        {
 4241|   139k|            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|   139k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   139k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4242|   139k|            av->delim = delim ? delim : '"';
  ------------------
  |  Branch (4242:25): [True: 93.5k, False: 45.6k]
  ------------------
 4243|   139k|            av->attribute = attribute;
 4244|   139k|            av->value = value;
 4245|   139k|            av->dict = TY_(FindAttribute)( doc, av );
  ------------------
  |  |   23|   139k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   139k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4246|   139k|            AddAttrToList( &list, av );
 4247|   139k|            if ( !delim && value )
  ------------------
  |  Branch (4247:18): [True: 45.6k, False: 93.5k]
  |  Branch (4247:28): [True: 44.6k, False: 1.01k]
  ------------------
 4248|  44.6k|                TY_(ReportAttrError)( doc, lexer->token, av, MISSING_QUOTEMARK_OPEN);
  ------------------
  |  |   23|  44.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4249|   139k|        }
 4250|  55.8k|        else
 4251|  55.8k|        {
 4252|  55.8k|            av = TY_(NewAttribute)(doc);
  ------------------
  |  |   23|  55.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4253|  55.8k|            av->attribute = attribute;
 4254|  55.8k|            av->value = value;
 4255|       |
 4256|  55.8k|            if (LastChar(attribute) == '"')
  ------------------
  |  Branch (4256:17): [True: 1.38k, False: 54.4k]
  ------------------
 4257|  1.38k|                TY_(ReportAttrError)( doc, lexer->token, av, MISSING_QUOTEMARK);
  ------------------
  |  |   23|  1.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4258|  54.4k|            else if (value == NULL)
  ------------------
  |  Branch (4258:22): [True: 49.9k, False: 4.53k]
  ------------------
 4259|  49.9k|                TY_(ReportAttrError)(doc, lexer->token, av, MISSING_ATTR_VALUE);
  ------------------
  |  |   23|  49.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4260|  4.53k|            else
 4261|  4.53k|                TY_(ReportAttrError)(doc, lexer->token, av, INVALID_ATTRIBUTE);
  ------------------
  |  |   23|  4.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4262|       |
 4263|  55.8k|            TY_(FreeAttribute)( doc, av );
  ------------------
  |  |   23|  55.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4264|  55.8k|        }
 4265|   195k|    }
 4266|       |
 4267|   352k|    return list;
 4268|   352k|}
lexer.c:EndOfInput:
  901|   553k|{
  902|   553k|    assert( doc->docIn != NULL );
  ------------------
  |  Branch (902:5): [True: 0, False: 553k]
  |  Branch (902:5): [True: 553k, False: 0]
  ------------------
  903|   553k|    return ( !doc->docIn->pushed && TY_(IsEOF)(doc->docIn) );
  ------------------
  |  |   23|   358k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   358k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (903:14): [True: 358k, False: 194k]
  |  Branch (903:37): [True: 8.44k, False: 350k]
  ------------------
  904|   553k|}
lexer.c:IsValidAttrName:
 4132|   195k|{
 4133|   195k|    uint i, c = attr[0];
 4134|       |
 4135|       |    /* first character should be a letter */
 4136|   195k|    if (!TY_(IsLetter)(c))
  ------------------
  |  |   23|   195k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   195k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4136:9): [True: 43.5k, False: 151k]
  ------------------
 4137|  43.5k|        return no;
 4138|       |
 4139|       |    /* remaining characters should be namechars */
 4140|   804k|    for( i = 1; i < TY_(tmbstrlen)(attr); i++)
  ------------------
  |  |   23|   804k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   804k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4140:17): [True: 665k, False: 139k]
  ------------------
 4141|   665k|    {
 4142|   665k|        c = attr[i];
 4143|       |
 4144|   665k|        if (TY_(IsNamechar)(c))
  ------------------
  |  |   23|   665k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   665k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4144:13): [True: 652k, False: 12.3k]
  ------------------
 4145|   652k|            continue;
 4146|       |
 4147|  12.3k|        return no;
 4148|   665k|    }
 4149|       |
 4150|   139k|    return yes;
 4151|   151k|}
lexer.c:LastChar:
  871|  55.8k|{
  872|  55.8k|    if ( str && *str )
  ------------------
  |  Branch (872:10): [True: 55.8k, False: 0]
  |  Branch (872:17): [True: 55.4k, False: 391]
  ------------------
  873|  55.4k|    {
  874|  55.4k|        int n = TY_(tmbstrlen)(str);
  ------------------
  |  |   23|  55.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  875|  55.4k|        return str[n-1];
  876|  55.4k|    }
  877|    391|    return 0;
  878|  55.8k|}
lexer.c:ExpectsContent:
 2192|   833k|{
 2193|   833k|    if (node->type != StartTag)
  ------------------
  |  Branch (2193:9): [True: 14.1k, False: 819k]
  ------------------
 2194|  14.1k|        return no;
 2195|       |
 2196|       |    /* unknown element? */
 2197|   819k|    if (node->tag == NULL)
  ------------------
  |  Branch (2197:9): [True: 142k, False: 677k]
  ------------------
 2198|   142k|        return yes;
 2199|       |
 2200|   677k|    if (node->tag->model & CM_EMPTY)
  ------------------
  |  |  139|   677k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (2200:9): [True: 36.9k, False: 640k]
  ------------------
 2201|  36.9k|        return no;
 2202|       |
 2203|   640k|    return yes;
 2204|   677k|}
lexer.c:NewToken:
 1602|   237k|{
 1603|   237k|    Lexer* lexer = doc->lexer;
 1604|   237k|    Node* node = TY_(NewNode)(lexer->allocator, lexer);
  ------------------
  |  |   23|   237k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   237k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1605|   237k|    node->type = type;
 1606|   237k|    node->start = lexer->txtstart;
 1607|   237k|    node->end = lexer->txtend;
 1608|   237k|    return node;
 1609|   237k|}
lexer.c:ParseDocTypeDecl:
 4284|  58.1k|{
 4285|  58.1k|    Lexer *lexer = doc->lexer;
 4286|  58.1k|    int start = lexer->lexsize;
 4287|  58.1k|    ParseDocTypeDeclState state = DT_DOCTYPENAME;
 4288|  58.1k|    uint c;
 4289|  58.1k|    uint delim = 0;
 4290|  58.1k|    Bool hasfpi = yes;
 4291|       |
 4292|  58.1k|    Node* node = TY_(NewNode)(lexer->allocator, lexer);
  ------------------
  |  |   23|  58.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  58.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4293|  58.1k|    node->type = DocTypeTag;
 4294|  58.1k|    node->start = lexer->txtstart;
 4295|  58.1k|    node->end = lexer->txtend;
 4296|       |
 4297|  58.1k|    lexer->waswhite = no;
 4298|       |
 4299|       |    /* todo: reset lexer->lexsize when appropriate to avoid wasting memory */
 4300|       |
 4301|  1.28M|    while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  |   23|  1.28M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.28M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while ((c = TY_(ReadChar)(doc->docIn)) != EndOfStream)
  ------------------
  |  | 1064|  1.28M|#define EndOfStream (~0u)
  ------------------
  |  Branch (4301:12): [True: 1.28M, False: 284]
  ------------------
 4302|  1.28M|    {
 4303|       |        /* convert newlines to spaces */
 4304|  1.28M|        if (state != DT_INTSUBSET)
  ------------------
  |  Branch (4304:13): [True: 1.23M, False: 46.6k]
  ------------------
 4305|  1.23M|            c = c == '\n' ? ' ' : c;
  ------------------
  |  Branch (4305:17): [True: 1.08k, False: 1.23M]
  ------------------
 4306|       |
 4307|       |        /* convert white-space sequences to single space character */
 4308|  1.28M|        if (TY_(IsWhite)(c) && state != DT_INTSUBSET)
  ------------------
  |  |   23|  1.28M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.28M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4308:13): [True: 308k, False: 972k]
  |  Branch (4308:32): [True: 283k, False: 24.6k]
  ------------------
 4309|   283k|        {
 4310|   283k|            if (!lexer->waswhite)
  ------------------
  |  Branch (4310:17): [True: 43.2k, False: 240k]
  ------------------
 4311|  43.2k|            {
 4312|  43.2k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  43.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  43.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4313|  43.2k|                lexer->waswhite = yes;
 4314|  43.2k|            }
 4315|   240k|            else
 4316|   240k|            {
 4317|       |                /* discard space */
 4318|   240k|                continue;
 4319|   240k|            }
 4320|   283k|        }
 4321|   997k|        else
 4322|   997k|        {
 4323|   997k|            TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   997k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   997k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4324|   997k|            lexer->waswhite = no;
 4325|   997k|        }
 4326|       |
 4327|  1.04M|        switch(state)
  ------------------
  |  Branch (4327:16): [True: 1.04M, False: 0]
  ------------------
 4328|  1.04M|        {
 4329|   115k|        case DT_INTERMEDIATE:
  ------------------
  |  Branch (4329:9): [True: 115k, False: 925k]
  ------------------
 4330|       |            /* determine what's next */
 4331|   115k|            if (TY_(ToUpper)(c) == 'P' || TY_(ToUpper)(c) == 'S')
  ------------------
  |  |   23|   115k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   115k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(ToUpper)(c) == 'P' || TY_(ToUpper)(c) == 'S')
  ------------------
  |  |   23|   113k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   113k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4331:17): [True: 1.92k, False: 113k]
  |  Branch (4331:43): [True: 517, False: 113k]
  ------------------
 4332|  2.44k|            {
 4333|  2.44k|                start = lexer->lexsize - 1;
 4334|  2.44k|                state = DT_PUBLICSYSTEM;
 4335|  2.44k|                continue;
 4336|  2.44k|            }
 4337|   113k|            else if (c == '[')
  ------------------
  |  Branch (4337:22): [True: 1.39k, False: 111k]
  ------------------
 4338|  1.39k|            {
 4339|  1.39k|                start = lexer->lexsize;
 4340|  1.39k|                state = DT_INTSUBSET;
 4341|  1.39k|                continue;
 4342|  1.39k|            }
 4343|   111k|            else if (c == '\'' || c == '"')
  ------------------
  |  Branch (4343:22): [True: 26.7k, False: 84.9k]
  |  Branch (4343:35): [True: 813, False: 84.1k]
  ------------------
 4344|  27.5k|            {
 4345|  27.5k|                start = lexer->lexsize;
 4346|  27.5k|                delim = c;
 4347|  27.5k|                state = DT_QUOTEDSTRING;
 4348|  27.5k|                continue;
 4349|  27.5k|            }
 4350|  84.1k|            else if (c == '>')
  ------------------
  |  Branch (4350:22): [True: 57.8k, False: 26.3k]
  ------------------
 4351|  57.8k|            {
 4352|  57.8k|                AttVal* si;
 4353|       |
 4354|  57.8k|                node->end = --(lexer->lexsize);
 4355|       |
 4356|  57.8k|                si = TY_(GetAttrByName)(node, "SYSTEM");
  ------------------
  |  |   23|  57.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4357|  57.8k|                if (si)
  ------------------
  |  Branch (4357:21): [True: 7.03k, False: 50.7k]
  ------------------
 4358|  7.03k|                    TY_(CheckUrl)(doc, node, si);
  ------------------
  |  |   23|  7.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4359|       |
 4360|  57.8k|                if (!node->element || !IsValidXMLElemName(node->element))
  ------------------
  |  |  210|  30.9k|#define IsValidXMLElemName(name) TY_(IsValidXMLID)(name)
  |  |  ------------------
  |  |  |  |   23|  30.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  30.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4360:21): [True: 26.8k, False: 30.9k]
  |  Branch (4360:39): [True: 4.57k, False: 26.4k]
  ------------------
 4361|  31.4k|                {
 4362|  31.4k|                    TY_(Report)(doc, NULL, NULL, MALFORMED_DOCTYPE);
  ------------------
  |  |   23|  31.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4363|  31.4k|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  31.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4364|  31.4k|                    return NULL;
 4365|  31.4k|                }
 4366|  26.4k|                return node;
 4367|  57.8k|            }
 4368|  26.3k|            else
 4369|  26.3k|            {
 4370|       |                /* error */
 4371|  26.3k|            }
 4372|  26.3k|            break;
 4373|   663k|        case DT_DOCTYPENAME:
  ------------------
  |  Branch (4373:9): [True: 663k, False: 377k]
  ------------------
 4374|       |            /* read document type name */
 4375|   663k|            if (TY_(IsWhite)(c) || c == '>' || c == '[')
  ------------------
  |  |   23|   663k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   663k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4375:17): [True: 18.4k, False: 644k]
  |  Branch (4375:36): [True: 38.8k, False: 605k]
  |  Branch (4375:48): [True: 804, False: 605k]
  ------------------
 4376|  58.0k|            {
 4377|  58.0k|                node->element = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  58.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  58.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4378|  58.0k|                                                lexer->lexbuf + start,
 4379|  58.0k|                                                lexer->lexsize - start - 1);
 4380|  58.0k|                if (c == '>' || c == '[')
  ------------------
  |  Branch (4380:21): [True: 38.8k, False: 19.2k]
  |  Branch (4380:33): [True: 804, False: 18.4k]
  ------------------
 4381|  39.6k|                {
 4382|  39.6k|                    --(lexer->lexsize);
 4383|  39.6k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  39.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  39.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4384|  39.6k|                }
 4385|       |
 4386|  58.0k|                state = DT_INTERMEDIATE;
 4387|  58.0k|                continue;
 4388|  58.0k|            }
 4389|   605k|            break;
 4390|   605k|        case DT_PUBLICSYSTEM:
  ------------------
  |  Branch (4390:9): [True: 17.2k, False: 1.02M]
  ------------------
 4391|       |            /* read PUBLIC/SYSTEM */
 4392|  17.2k|            if (TY_(IsWhite)(c) || c == '>')
  ------------------
  |  |   23|  17.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4392:17): [True: 1.50k, False: 15.7k]
  |  Branch (4392:36): [True: 906, False: 14.8k]
  ------------------
 4393|  2.41k|            {
 4394|  2.41k|                char *attname = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  2.41k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.41k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4395|  2.41k|                                                lexer->lexbuf + start,
 4396|  2.41k|                                                lexer->lexsize - start - 1);
 4397|  2.41k|                hasfpi = !(TY_(tmbstrcasecmp)(attname, "SYSTEM") == 0);
  ------------------
  |  |   23|  2.41k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.41k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4398|       |
 4399|  2.41k|                TidyDocFree(doc, attname);
  ------------------
  |  |  159|  2.41k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  2.41k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 4400|       |
 4401|       |                /* todo: report an error if SYSTEM/PUBLIC not uppercase */
 4402|       |
 4403|  2.41k|                if (c == '>')
  ------------------
  |  Branch (4403:21): [True: 906, False: 1.50k]
  ------------------
 4404|    906|                {
 4405|    906|                    --(lexer->lexsize);
 4406|    906|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    906|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    906|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4407|    906|                }
 4408|       |
 4409|  2.41k|                state = DT_INTERMEDIATE;
 4410|  2.41k|                continue;
 4411|  2.41k|            }
 4412|  14.8k|            break;
 4413|   198k|        case DT_QUOTEDSTRING:
  ------------------
  |  Branch (4413:9): [True: 198k, False: 842k]
  ------------------
 4414|       |            /* read quoted string */
 4415|   198k|            if (c == delim)
  ------------------
  |  Branch (4415:17): [True: 27.4k, False: 170k]
  ------------------
 4416|  27.4k|            {
 4417|  27.4k|                char *value = TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  27.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4418|  27.4k|                                              lexer->lexbuf + start,
 4419|  27.4k|                                              lexer->lexsize - start - 1);
 4420|  27.4k|                AttVal* att = TY_(AddAttribute)(doc, node, hasfpi ? "PUBLIC" : "SYSTEM", value);
  ------------------
  |  |   23|  27.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4420:60): [True: 17.2k, False: 10.2k]
  ------------------
 4421|  27.4k|                TidyDocFree(doc, value);
  ------------------
  |  |  159|  27.4k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  27.4k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 4422|  27.4k|                att->delim = delim;
 4423|  27.4k|                hasfpi = no;
 4424|  27.4k|                state = DT_INTERMEDIATE;
 4425|  27.4k|                delim = 0;
 4426|  27.4k|                continue;
 4427|  27.4k|            }
 4428|   170k|            break;
 4429|   170k|        case DT_INTSUBSET:
  ------------------
  |  Branch (4429:9): [True: 46.6k, False: 994k]
  ------------------
 4430|       |            /* read internal subset */
 4431|  46.6k|            if (c == ']')
  ------------------
  |  Branch (4431:17): [True: 1.35k, False: 45.3k]
  ------------------
 4432|  1.35k|            {
 4433|  1.35k|                Node* subset;
 4434|  1.35k|                lexer->txtstart = start;
 4435|  1.35k|                lexer->txtend = lexer->lexsize - 1;
 4436|  1.35k|                subset = TY_(TextToken)(lexer);
  ------------------
  |  |   23|  1.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4437|  1.35k|                TY_(InsertNodeAtEnd)(node, subset);
  ------------------
  |  |   23|  1.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4438|  1.35k|                state = DT_INTERMEDIATE;
 4439|  1.35k|            }
 4440|  46.6k|            break;
 4441|  1.04M|        }
 4442|  1.04M|    }
 4443|       |
 4444|       |    /* document type declaration not finished */
 4445|    284|    TY_(Report)(doc, NULL, NULL, MALFORMED_DOCTYPE);
  ------------------
  |  |   23|    284|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    284|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4446|    284|    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    284|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    284|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4447|       |    return NULL;
 4448|  58.1k|}
lexer.c:FindGivenVersion:
 1815|  15.2k|{
 1816|  15.2k|    AttVal * fpi = TY_(GetAttrByName)(doctype, "PUBLIC");
  ------------------
  |  |   23|  15.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1817|  15.2k|    uint vers;
 1818|       |
 1819|  15.2k|    if (!fpi || !fpi->value) 
  ------------------
  |  Branch (1819:9): [True: 9.18k, False: 6.05k]
  |  Branch (1819:17): [True: 2.24k, False: 3.80k]
  ------------------
 1820|  11.4k|    {
 1821|       |        /*\
 1822|       |         * Is. #815 - change to case-insensitive test
 1823|       |         * See REC: https://www.w3.org/TR/html5/syntax.html#the-doctype
 1824|       |        \*/
 1825|  11.4k|        if (doctype->element && (TY_(tmbstrcasecmp)(doctype->element,"html") == 0))
  ------------------
  |  |   23|  11.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1825:13): [True: 11.4k, False: 0]
  |  Branch (1825:33): [True: 185, False: 11.2k]
  ------------------
 1826|    185|        {
 1827|    185|            return VERS_HTML5;  /* TODO: do we need to check MORE? */
  ------------------
  |  |  213|    185|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|    185|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|    185|#define XH50              262144u
  |  |  ------------------
  ------------------
 1828|    185|        }
 1829|       |        /* TODO: Consider warning, error message */
 1830|  11.2k|        return VERS_UNKNOWN;
  ------------------
  |  |  204|  11.2k|#define VERS_UNKNOWN       (xxxx)
  |  |  ------------------
  |  |  |  |  174|  11.2k|#define xxxx                   0u
  |  |  ------------------
  ------------------
 1831|  11.4k|    }
 1832|  3.80k|    vers = GetVersFromFPI(fpi->value);
 1833|       |
 1834|  3.80k|    if (VERS_XHTML & vers)
  ------------------
  |  |  222|  3.80k|#define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  185|  3.80k|#define X10S                 256u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  186|  3.80k|#define X10T                 512u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  187|  3.80k|#define X10F                1024u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  188|  3.80k|#define XH11                2048u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  189|  3.80k|#define XB10                4096u
  |  |  ------------------
  |  |               #define VERS_XHTML         (X10S|X10T|X10F|XH11|XB10|XH50)
  |  |  ------------------
  |  |  |  |  201|  3.80k|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (1834:9): [True: 170, False: 3.63k]
  ------------------
 1835|    170|    {
 1836|    170|        TY_(SetOptionBool)(doc, TidyXmlOut, yes);
  ------------------
  |  |   23|    170|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    170|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1837|    170|        TY_(SetOptionBool)(doc, TidyXhtmlOut, yes);
  ------------------
  |  |   23|    170|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    170|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1838|    170|        doc->lexer->isvoyager = yes;
 1839|    170|    }
 1840|       |
 1841|       |    /* todo: add a warning if case does not match? */
 1842|  3.80k|    TidyDocFree(doc, fpi->value);
  ------------------
  |  |  159|  3.80k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.80k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1843|  3.80k|    fpi->value = TY_(tmbstrdup)(doc->allocator, GetFPIFromVers(vers));
  ------------------
  |  |   23|  3.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1844|       |
 1845|  3.80k|    return vers;
 1846|  15.2k|}
lexer.c:GetVersFromFPI:
  333|  3.80k|{
  334|  3.80k|    uint i;
  335|       |
  336|  75.0k|    for (i = 0; W3C_Doctypes[i].name; ++i)
  ------------------
  |  Branch (336:17): [True: 71.3k, False: 3.63k]
  ------------------
  337|  71.3k|        if (W3C_Doctypes[i].fpi != NULL && TY_(tmbstrcasecmp)(W3C_Doctypes[i].fpi, fpi) == 0)
  ------------------
  |  |   23|  64.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  64.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (337:13): [True: 64.1k, False: 7.26k]
  |  Branch (337:44): [True: 170, False: 63.9k]
  ------------------
  338|    170|            return W3C_Doctypes[i].vers;
  339|       |
  340|  3.63k|    return 0;
  341|  3.80k|}
lexer.c:ParseAttribute:
 3594|   572k|{
 3595|   572k|    Lexer* lexer = doc->lexer;
 3596|   572k|    int start, len = 0;
 3597|   572k|    tmbstr attr = NULL;
 3598|   572k|    uint c, lastc;
 3599|       |
 3600|   572k|    *asp = NULL;  /* clear asp pointer */
 3601|   572k|    *php = NULL;  /* clear php pointer */
 3602|       |
 3603|       | /* skip white space before the attribute */
 3604|       |
 3605|   572k|    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: 24.9k, False: 624k]
  ------------------
 3611|  24.9k|        {
 3612|  24.9k|            c = TY_(ReadChar)( doc->docIn );
  ------------------
  |  |   23|  24.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3613|       |
 3614|  24.9k|            if (c == '>')
  ------------------
  |  Branch (3614:17): [True: 13.4k, False: 11.4k]
  ------------------
 3615|  13.4k|            {
 3616|  13.4k|                *isempty = yes;
 3617|  13.4k|                return NULL;
 3618|  13.4k|            }
 3619|       |
 3620|  11.4k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  11.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3621|  11.4k|            c = '/';
 3622|  11.4k|            break;
 3623|  24.9k|        }
 3624|       |
 3625|   624k|        if (c == '>')
  ------------------
  |  Branch (3625:13): [True: 89.9k, False: 534k]
  ------------------
 3626|  89.9k|            return NULL;
 3627|       |
 3628|   534k|        if (c =='<')
  ------------------
  |  Branch (3628:13): [True: 264k, False: 270k]
  ------------------
 3629|   264k|        {
 3630|   264k|            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   264k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   264k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3631|       |
 3632|   264k|            if (c == '%')
  ------------------
  |  Branch (3632:17): [True: 5.19k, False: 259k]
  ------------------
 3633|  5.19k|            {
 3634|  5.19k|                *asp = ParseAsp( doc );
 3635|  5.19k|                return NULL;
 3636|  5.19k|            }
 3637|   259k|            else if (c == '?')
  ------------------
  |  Branch (3637:22): [True: 6.92k, False: 252k]
  ------------------
 3638|  6.92k|            {
 3639|  6.92k|                *php = ParsePhp( doc );
 3640|  6.92k|                return NULL;
 3641|  6.92k|            }
 3642|       |
 3643|   252k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   252k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   252k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3644|   252k|            TY_(UngetChar)('<', doc->docIn);
  ------------------
  |  |   23|   252k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   252k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3645|   252k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|   252k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   252k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3646|   252k|            return NULL;
 3647|   264k|        }
 3648|       |
 3649|   270k|        if (c == '=')
  ------------------
  |  Branch (3649:13): [True: 2.34k, False: 267k]
  ------------------
 3650|  2.34k|        {
 3651|  2.34k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_EQUALSIGN );
  ------------------
  |  |   23|  2.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3652|  2.34k|            continue;
 3653|  2.34k|        }
 3654|       |
 3655|   267k|        if (c == '"' || c == '\'')
  ------------------
  |  Branch (3655:13): [True: 1.26k, False: 266k]
  |  Branch (3655:25): [True: 471, False: 266k]
  ------------------
 3656|  1.73k|        {
 3657|  1.73k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_QUOTEMARK );
  ------------------
  |  |   23|  1.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3658|  1.73k|            continue;
 3659|  1.73k|        }
 3660|       |
 3661|   266k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   266k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3661:13): [True: 58, False: 266k]
  ------------------
 3662|     58|        {
 3663|     58|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|     58|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     58|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3664|     58|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     58|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     58|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3665|     58|            return NULL;
 3666|     58|        }
 3667|       |
 3668|       |
 3669|   266k|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|   266k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   266k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3669:13): [True: 192k, False: 73.6k]
  ------------------
 3670|   192k|           break;
 3671|   266k|    }
 3672|       |
 3673|   203k|    start = lexer->lexsize;
 3674|   203k|    lastc = c;
 3675|       |
 3676|   203k|    for (;;)
 3677|  2.21M|    {
 3678|       |     /* but push back '=' for parseValue() */
 3679|  2.21M|        if (c == '=' || c == '>')
  ------------------
  |  Branch (3679:13): [True: 60.1k, False: 2.15M]
  |  Branch (3679:25): [True: 31.7k, False: 2.12M]
  ------------------
 3680|  91.9k|        {
 3681|  91.9k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  91.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  91.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3682|  91.9k|            break;
 3683|  91.9k|        }
 3684|       |
 3685|  2.12M|        if (c == '<' || c == EndOfStream)
  ------------------
  |  | 1064|  2.05M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3685:13): [True: 63.2k, False: 2.05M]
  |  Branch (3685:25): [True: 1.30k, False: 2.05M]
  ------------------
 3686|  64.5k|        {
 3687|  64.5k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  64.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  64.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3688|  64.5k|            break;
 3689|  64.5k|        }
 3690|       |
 3691|  2.05M|        if (lastc == '-' && (c == '"' || c == '\''))
  ------------------
  |  Branch (3691:13): [True: 13.1k, False: 2.04M]
  |  Branch (3691:30): [True: 206, False: 12.9k]
  |  Branch (3691:42): [True: 732, False: 12.2k]
  ------------------
 3692|    938|        {
 3693|    938|            lexer->lexsize--;
 3694|    938|            --len;
 3695|    938|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    938|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    938|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3696|    938|            break;
 3697|    938|        }
 3698|       |
 3699|  2.05M|        if (TY_(IsWhite)(c))
  ------------------
  |  |   23|  2.05M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.05M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3699:13): [True: 45.8k, False: 2.01M]
  ------------------
 3700|  45.8k|            break;
 3701|       |
 3702|  2.01M|        if (c == '/') /* Issue #395 - potential self closing tag */
  ------------------
  |  Branch (3702:13): [True: 13.3k, False: 1.99M]
  ------------------
 3703|  13.3k|        {
 3704|  13.3k|            c = TY_(ReadChar)(doc->docIn);  /* read next */
  ------------------
  |  |   23|  13.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3705|  13.3k|            if (c == '>')
  ------------------
  |  Branch (3705:17): [True: 609, False: 12.7k]
  ------------------
 3706|    609|            {
 3707|       |                /* got a self closing tag - put is back and continue... */
 3708|    609|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    609|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    609|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3709|    609|                break;
 3710|    609|            }
 3711|  12.7k|            else
 3712|  12.7k|            {
 3713|       |                /* Not '/>' - put it back */
 3714|  12.7k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  12.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3715|  12.7k|                c = '/';  /* restore original char */
 3716|  12.7k|            }
 3717|  13.3k|        }
 3718|       |
 3719|       |        /* what should be done about non-namechar characters? */
 3720|       |        /* currently these are incorporated into the attr name */
 3721|       |
 3722|  2.00M|        if ( cfg(doc, TidyUpperCaseAttrs) != TidyUppercasePreserve )
  ------------------
  |  |  415|  2.00M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (3722:14): [True: 2.00M, False: 0]
  ------------------
 3723|  2.00M|        {
 3724|  2.00M|            if ( !cfgBool(doc, TidyXmlTags) && TY_(IsUpper)(c) )
  ------------------
  |  |  418|  4.01M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.00M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                          if ( !cfgBool(doc, TidyXmlTags) && TY_(IsUpper)(c) )
  ------------------
  |  |   23|  2.00M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.00M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3724:18): [True: 2.00M, False: 0]
  |  Branch (3724:48): [True: 187k, False: 1.82M]
  ------------------
 3725|   187k|                c = TY_(ToLower)(c);
  ------------------
  |  |   23|   187k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   187k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3726|  2.00M|        }
 3727|       |
 3728|  2.00M|        TY_(AddCharToLexer)( lexer, c );
  ------------------
  |  |   23|  2.00M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.00M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3729|  2.00M|        lastc = c;
 3730|  2.00M|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  2.00M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.00M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3731|  2.00M|    }
 3732|       |
 3733|       |    /* handle attribute names with multibyte chars */
 3734|   203k|    len = lexer->lexsize - start;
 3735|   203k|    attr = (len > 0 ? TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|   203k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   203k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3735:13): [True: 203k, False: 636]
  ------------------
 3736|   203k|                                      lexer->lexbuf+start, len) : NULL);
 3737|   203k|    lexer->lexsize = start;
 3738|   203k|    return attr;
 3739|   572k|}
lexer.c:ParseAsp:
 3508|  5.19k|{
 3509|  5.19k|    Lexer* lexer = doc->lexer;
 3510|  5.19k|    uint c;
 3511|  5.19k|    Node *asp = NULL;
 3512|       |
 3513|  5.19k|    lexer->txtstart = lexer->lexsize;
 3514|       |
 3515|  5.19k|    for (;;)
 3516|  5.32M|    {
 3517|  5.32M|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  5.32M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.32M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  5.32M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3517:13): [True: 123, False: 5.32M]
  ------------------
 3518|    123|            break;
 3519|       |
 3520|  5.32M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  5.32M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.32M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3521|       |
 3522|       |
 3523|  5.32M|        if (c != '%')
  ------------------
  |  Branch (3523:13): [True: 5.32M, False: 7.80k]
  ------------------
 3524|  5.32M|            continue;
 3525|       |
 3526|  7.80k|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  7.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  7.80k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3526:13): [True: 4, False: 7.80k]
  ------------------
 3527|      4|            break;
 3528|       |
 3529|  7.80k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  7.80k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.80k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3530|       |
 3531|  7.80k|        if (c == '>')
  ------------------
  |  Branch (3531:13): [True: 5.07k, False: 2.73k]
  ------------------
 3532|  5.07k|        {
 3533|  5.07k|            lexer->lexsize -= 2;
 3534|  5.07k|            break;
 3535|  5.07k|        }
 3536|  7.80k|    }
 3537|       |
 3538|  5.19k|    lexer->txtend = lexer->lexsize;
 3539|  5.19k|    if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3539:9): [True: 4.97k, False: 222]
  ------------------
 3540|  4.97k|        asp = AspToken(doc);
  ------------------
  |  | 1614|  4.97k|#define AspToken(doc)     NewToken(doc, AspTag)
  ------------------
 3541|       |
 3542|  5.19k|    lexer->txtstart = lexer->txtend;
 3543|  5.19k|    return asp;
 3544|  5.19k|}   
lexer.c:ParsePhp:
 3552|  6.92k|{
 3553|  6.92k|    Lexer* lexer = doc->lexer;
 3554|  6.92k|    uint c;
 3555|  6.92k|    Node *php = NULL;
 3556|       |
 3557|  6.92k|    lexer->txtstart = lexer->lexsize;
 3558|       |
 3559|  6.92k|    for (;;)
 3560|  20.9M|    {
 3561|  20.9M|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  20.9M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.9M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  20.9M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3561:13): [True: 171, False: 20.9M]
  ------------------
 3562|    171|            break;
 3563|       |
 3564|  20.9M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  20.9M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.9M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3565|       |
 3566|       |
 3567|  20.9M|        if (c != '?')
  ------------------
  |  Branch (3567:13): [True: 20.9M, False: 10.3k]
  ------------------
 3568|  20.9M|            continue;
 3569|       |
 3570|  10.3k|        if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  |   23|  10.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((c = TY_(ReadChar)(doc->docIn)) == EndOfStream)
  ------------------
  |  | 1064|  10.3k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3570:13): [True: 14, False: 10.3k]
  ------------------
 3571|     14|            break;
 3572|       |
 3573|  10.3k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  10.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3574|       |
 3575|  10.3k|        if (c == '>')
  ------------------
  |  Branch (3575:13): [True: 6.73k, False: 3.63k]
  ------------------
 3576|  6.73k|        {
 3577|  6.73k|            lexer->lexsize -= 2;
 3578|  6.73k|            break;
 3579|  6.73k|        }
 3580|  10.3k|    }
 3581|       |
 3582|  6.92k|    lexer->txtend = lexer->lexsize;
 3583|  6.92k|    if (lexer->txtend > lexer->txtstart)
  ------------------
  |  Branch (3583:9): [True: 6.71k, False: 203]
  ------------------
 3584|  6.71k|        php = PhpToken(doc);
  ------------------
  |  | 1616|  6.71k|#define PhpToken(doc)     NewToken(doc, PhpTag)
  ------------------
 3585|       |
 3586|  6.92k|    lexer->txtstart = lexer->txtend;
 3587|  6.92k|    return php;
 3588|  6.92k|}   
lexer.c:ParseValue:
 3842|   203k|{
 3843|   203k|    Lexer* lexer = doc->lexer;
 3844|   203k|    int len = 0, start;
 3845|   203k|    Bool seen_gt = no;
 3846|   203k|    Bool munge = yes;
 3847|   203k|    uint c, lastc, delim, quotewarning;
 3848|   203k|    tmbstr value;
 3849|       |
 3850|   203k|    delim = (tmbchar) 0;
 3851|   203k|    *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|   203k|    if ( cfgBool(doc, TidyLiteralAttribs) )
  ------------------
  |  |  418|   203k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   203k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 203k]
  |  |  ------------------
  ------------------
 3859|      0|        munge = no;
 3860|       |
 3861|       | /* skip white space before the '=' */
 3862|       |
 3863|   203k|    for (;;)
 3864|   907k|    {
 3865|   907k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   907k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   907k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3866|       |
 3867|   907k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   907k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3867:13): [True: 1.37k, False: 906k]
  ------------------
 3868|  1.37k|        {
 3869|  1.37k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.37k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.37k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3870|  1.37k|            break;
 3871|  1.37k|        }
 3872|       |
 3873|   906k|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|   906k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   906k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3873:13): [True: 201k, False: 704k]
  ------------------
 3874|   201k|           break;
 3875|   906k|    }
 3876|       |
 3877|       |/*
 3878|       |  c should be '=' if there is a value
 3879|       |  other legal possibilities are white
 3880|       |  space, '/' and '>'
 3881|       |*/
 3882|       |
 3883|   203k|    if (c != '=' && c != '"' && c != '\'')
  ------------------
  |  Branch (3883:9): [True: 143k, False: 60.1k]
  |  Branch (3883:21): [True: 142k, False: 233]
  |  Branch (3883:33): [True: 142k, False: 731]
  ------------------
 3884|   142k|    {
 3885|   142k|        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|   142k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   142k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3886|   142k|        return NULL;
 3887|   142k|    }
 3888|       |
 3889|       | /* skip white space after '=' */
 3890|       |
 3891|  61.0k|    for (;;)
 3892|  65.3k|    {
 3893|  65.3k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  65.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  65.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3894|       |
 3895|  65.3k|        if (c == EndOfStream)
  ------------------
  |  | 1064|  65.3k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3895:13): [True: 78, False: 65.2k]
  ------------------
 3896|     78|        {
 3897|     78|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     78|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     78|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3898|     78|            break;
 3899|     78|        }
 3900|       |
 3901|  65.2k|        if (!TY_(IsWhite)(c))
  ------------------
  |  |   23|  65.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  65.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3901:13): [True: 61.0k, False: 4.27k]
  ------------------
 3902|  61.0k|           break;
 3903|  65.2k|    }
 3904|       |
 3905|       | /* check for quote marks */
 3906|       |
 3907|  61.0k|    if (c == '"' || c == '\'')
  ------------------
  |  Branch (3907:9): [True: 8.61k, False: 52.4k]
  |  Branch (3907:21): [True: 681, False: 51.7k]
  ------------------
 3908|  9.29k|        delim = c;
 3909|  51.7k|    else if (c == '<')
  ------------------
  |  Branch (3909:14): [True: 3.18k, False: 48.6k]
  ------------------
 3910|  3.18k|    {
 3911|  3.18k|        start = lexer->lexsize;
 3912|  3.18k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  3.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3913|  3.18k|        *pdelim = ParseServerInstruction( doc );
 3914|  3.18k|        len = lexer->lexsize - start;
 3915|  3.18k|        lexer->lexsize = start;
 3916|  3.18k|        return (len > 0 ? TY_(tmbstrndup)(doc->allocator,
  ------------------
  |  |   23|  3.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3916:17): [True: 3.18k, False: 0]
  ------------------
 3917|  3.18k|                                          lexer->lexbuf+start, len) : NULL);
 3918|  3.18k|    }
 3919|  48.6k|    else
 3920|  48.6k|        TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  48.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  48.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3921|       |
 3922|       | /*
 3923|       |   and read the value string
 3924|       |   check for quote mark if needed
 3925|       | */
 3926|       |
 3927|  57.9k|    quotewarning = 0;
 3928|  57.9k|    start = lexer->lexsize;
 3929|  57.9k|    c = '\0';
 3930|       |
 3931|  57.9k|    for (;;)
 3932|   648k|    {
 3933|   648k|        lastc = c;  /* track last character */
 3934|   648k|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|   648k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   648k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3935|       |
 3936|   648k|        if (c == EndOfStream)
  ------------------
  |  | 1064|   648k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3936:13): [True: 1.28k, False: 647k]
  ------------------
 3937|  1.28k|        {
 3938|  1.28k|            TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|  1.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3939|  1.28k|            TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  1.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3940|  1.28k|            break;
 3941|  1.28k|        }
 3942|       |
 3943|   647k|        if (delim == (tmbchar)0)
  ------------------
  |  Branch (3943:13): [True: 428k, False: 219k]
  ------------------
 3944|   428k|        {
 3945|   428k|            if (c == '>')
  ------------------
  |  Branch (3945:17): [True: 7.45k, False: 420k]
  ------------------
 3946|  7.45k|            {
 3947|  7.45k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  7.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3948|  7.45k|                break;
 3949|  7.45k|            }
 3950|       |
 3951|   420k|            if (c == '"' || c == '\'')
  ------------------
  |  Branch (3951:17): [True: 1.62k, False: 419k]
  |  Branch (3951:29): [True: 1.40k, False: 417k]
  ------------------
 3952|  3.03k|            {
 3953|  3.03k|                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|  3.03k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  3.03k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.03k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3960|  3.03k|                if (c == '>')
  ------------------
  |  Branch (3960:21): [True: 345, False: 2.68k]
  ------------------
 3961|    345|                {
 3962|    345|                    TY_(AddCharToLexer)(lexer, q);
  ------------------
  |  |   23|    345|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    345|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3963|    345|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    345|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    345|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3964|    345|                    break;
 3965|    345|                }
 3966|  2.68k|                else
 3967|  2.68k|                {
 3968|  2.68k|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  2.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3969|  2.68k|                    c = q;
 3970|  2.68k|                }
 3971|  3.03k|            }
 3972|       |
 3973|   420k|            if (c == '<')
  ------------------
  |  Branch (3973:17): [True: 30.5k, False: 389k]
  ------------------
 3974|  30.5k|            {
 3975|  30.5k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  30.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  30.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3976|  30.5k|                c = '>';
 3977|  30.5k|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|  30.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  30.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3978|  30.5k|                TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|  30.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  30.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3979|  30.5k|                break;
 3980|  30.5k|            }
 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|   389k|            if (c == '/')
  ------------------
  |  Branch (3988:17): [True: 1.72k, False: 388k]
  ------------------
 3989|  1.72k|            {
 3990|       |                /* peek ahead in case of /> */
 3991|  1.72k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3992|       |
 3993|  1.72k|                if ( c == '>' && !TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|    935|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    935|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3993:22): [True: 935, False: 786]
  |  Branch (3993:34): [True: 737, False: 198]
  ------------------
 3994|    737|                {
 3995|    737|                    *isempty = yes;
 3996|    737|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    737|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    737|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3997|    737|                    break;
 3998|    737|                }
 3999|       |
 4000|       |                /* unget peeked character */
 4001|    984|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    984|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    984|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4002|    984|                c = '/';
 4003|    984|            }
 4004|   389k|        }
 4005|   219k|        else  /* delim is '\'' or '"' */
 4006|   219k|        {
 4007|   219k|            if (c == delim)
  ------------------
  |  Branch (4007:17): [True: 9.06k, False: 210k]
  ------------------
 4008|  9.06k|                break;
 4009|       |
 4010|   210k|            if (c == '\n' || c == '<' || c == '>')
  ------------------
  |  Branch (4010:17): [True: 5.04k, False: 205k]
  |  Branch (4010:30): [True: 16.8k, False: 188k]
  |  Branch (4010:42): [True: 10.8k, False: 177k]
  ------------------
 4011|  32.7k|                ++quotewarning;
 4012|       |
 4013|   210k|            if (c == '>')
  ------------------
  |  Branch (4013:17): [True: 10.8k, False: 199k]
  ------------------
 4014|  10.8k|                seen_gt = yes;
 4015|   210k|        }
 4016|       |
 4017|   599k|        if (c == '&')
  ------------------
  |  Branch (4017:13): [True: 7.95k, False: 591k]
  ------------------
 4018|  7.95k|        {
 4019|  7.95k|            TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  7.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4020|  7.95k|            ParseEntity( doc, IgnoreWhitespace );
 4021|  7.95k|            if (lexer->lexbuf[lexer->lexsize - 1] == '\n' && munge)
  ------------------
  |  Branch (4021:17): [True: 1.39k, False: 6.56k]
  |  Branch (4021:62): [True: 1.39k, False: 0]
  ------------------
 4022|  1.39k|                ChangeChar(lexer, ' ');
 4023|  7.95k|            continue;
 4024|  7.95k|        }
 4025|       |
 4026|       |        /*
 4027|       |         kludge for JavaScript attribute values
 4028|       |         with line continuations in string literals
 4029|       |        */
 4030|   591k|        if (c == '\\')
  ------------------
  |  Branch (4030:13): [True: 1.40k, False: 590k]
  ------------------
 4031|  1.40k|        {
 4032|  1.40k|            c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  1.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4033|       |
 4034|  1.40k|            if (c != '\n')
  ------------------
  |  Branch (4034:17): [True: 785, False: 615]
  ------------------
 4035|    785|            {
 4036|    785|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    785|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    785|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4037|    785|                c = '\\';
 4038|    785|            }
 4039|  1.40k|        }
 4040|       |
 4041|   591k|        if (TY_(IsWhite)(c))
  ------------------
  |  |   23|   591k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   591k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4041:13): [True: 31.0k, False: 560k]
  ------------------
 4042|  31.0k|        {
 4043|  31.0k|            if ( delim == 0 )
  ------------------
  |  Branch (4043:18): [True: 8.42k, False: 22.5k]
  ------------------
 4044|  8.42k|                break;
 4045|       |
 4046|  22.5k|            if (munge)
  ------------------
  |  Branch (4046:17): [True: 22.5k, False: 0]
  ------------------
 4047|  22.5k|            {
 4048|       |                /* discard line breaks in quoted URLs */ 
 4049|       |                /* #438650 - fix by Randy Waki */
 4050|  22.5k|                if ( c == '\n' && TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|  5.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4050:22): [True: 5.04k, False: 17.5k]
  |  Branch (4050:35): [True: 871, False: 4.17k]
  ------------------
 4051|    871|                {
 4052|       |                    /* warn that we discard this newline */
 4053|    871|                    TY_(ReportAttrError)( doc, lexer->token, NULL, NEWLINE_IN_URI);
  ------------------
  |  |   23|    871|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    871|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4054|    871|                    continue;
 4055|    871|                }
 4056|       |                
 4057|  21.7k|                c = ' ';
 4058|       |
 4059|  21.7k|                if (lastc == ' ')
  ------------------
  |  Branch (4059:21): [True: 9.69k, False: 12.0k]
  ------------------
 4060|  9.69k|                {
 4061|  9.69k|                    if (TY_(IsUrl)(doc, name) )
  ------------------
  |  |   23|  9.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4061:25): [True: 4.06k, False: 5.63k]
  ------------------
 4062|  4.06k|                        TY_(ReportAttrError)( doc, lexer->token, NULL, WHITE_IN_URI);
  ------------------
  |  |   23|  4.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4063|  9.69k|                    continue;
 4064|  9.69k|                }
 4065|  21.7k|            }
 4066|  22.5k|        }
 4067|   560k|        else if (foldCase && TY_(IsUpper)(c))
  ------------------
  |  |   23|  1.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4067:18): [True: 1.29k, False: 559k]
  |  Branch (4067:30): [True: 316, False: 978]
  ------------------
 4068|    316|            c = TY_(ToLower)(c);
  ------------------
  |  |   23|    316|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    316|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4069|       |
 4070|   572k|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|   572k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   572k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4071|   572k|    }
 4072|       |
 4073|  57.9k|    if (quotewarning > 10 && seen_gt && munge)
  ------------------
  |  Branch (4073:9): [True: 2.07k, False: 55.8k]
  |  Branch (4073:30): [True: 1.84k, False: 222]
  |  Branch (4073:41): [True: 1.84k, False: 0]
  ------------------
 4074|  1.84k|    {
 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|  1.84k|        if ( !TY_(IsScript)(doc, name) &&
  ------------------
  |  |   23|  1.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4084:14): [True: 875, False: 974]
  ------------------
 4085|    875|             !(TY_(IsUrl)(doc, name) && TY_(tmbstrncmp)(lexer->lexbuf+start, "javascript:", 11) == 0) &&
  ------------------
  |  |   23|    875|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    875|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           !(TY_(IsUrl)(doc, name) && TY_(tmbstrncmp)(lexer->lexbuf+start, "javascript:", 11) == 0) &&
  ------------------
  |  |   23|    264|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    264|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4085:16): [True: 264, False: 611]
  |  Branch (4085:41): [True: 66, False: 198]
  ------------------
 4086|    809|             !(TY_(tmbstrncmp)(lexer->lexbuf+start, "<xml ", 5) == 0)
  ------------------
  |  |   23|    809|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    809|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4086:14): [True: 575, False: 234]
  ------------------
 4087|  1.84k|           )
 4088|    575|            TY_(Report)( doc, NULL, NULL, SUSPECTED_MISSING_QUOTE ); 
  ------------------
  |  |   23|    575|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    575|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4089|  1.84k|    }
 4090|       |
 4091|  57.9k|    len = lexer->lexsize - start;
 4092|  57.9k|    lexer->lexsize = start;
 4093|       |
 4094|       |
 4095|  57.9k|    if (len > 0 || delim)
  ------------------
  |  Branch (4095:9): [True: 55.3k, False: 2.56k]
  |  Branch (4095:20): [True: 696, False: 1.87k]
  ------------------
 4096|  56.0k|    {
 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|  56.0k|        if ((len > 0) && munge &&
  ------------------
  |  Branch (4102:13): [True: 55.3k, False: 696]
  |  Branch (4102:26): [True: 55.3k, False: 0]
  ------------------
 4103|  55.3k|            TY_(tmbstrcasecmp)(name, "alt") &&
  ------------------
  |  |   23|  55.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4103:13): [True: 55.1k, False: 202]
  ------------------
 4104|  55.1k|            TY_(tmbstrcasecmp)(name, "title") &&
  ------------------
  |  |   23|  55.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4104:13): [True: 55.0k, False: 75]
  ------------------
 4105|  55.0k|            TY_(tmbstrcasecmp)(name, "value") &&
  ------------------
  |  |   23|  55.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4105:13): [True: 54.8k, False: 217]
  ------------------
 4106|  54.8k|            TY_(tmbstrcasecmp)(name, "prompt"))
  ------------------
  |  |   23|  54.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  54.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4106:13): [True: 54.6k, False: 194]
  ------------------
 4107|  54.6k|        {
 4108|  55.4k|            while (TY_(IsWhite)(lexer->lexbuf[start+len-1]) && (len > 0))
  ------------------
  |  |   23|  55.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4108:20): [True: 824, False: 54.6k]
  |  Branch (4108:64): [True: 824, False: 0]
  ------------------
 4109|    824|                --len;
 4110|       |
 4111|       |            /* Issue #497 - Fix leading space trimming */
 4112|  55.1k|            while (TY_(IsWhite)(lexer->lexbuf[start]) && (len > 0))
  ------------------
  |  |   23|  55.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4112:20): [True: 723, False: 54.4k]
  |  Branch (4112:58): [True: 542, False: 181]
  ------------------
 4113|    542|            {
 4114|    542|                ++start;
 4115|    542|                --len;
 4116|    542|            }
 4117|  54.6k|        }
 4118|       |
 4119|  56.0k|        value = TY_(tmbstrndup)(doc->allocator, lexer->lexbuf + start, len);
  ------------------
  |  |   23|  56.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  56.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4120|  56.0k|    }
 4121|  1.87k|    else
 4122|  1.87k|        value = NULL;
 4123|       |
 4124|       |    /* note delimiter if given */
 4125|  57.9k|    *pdelim = delim;
 4126|       |
 4127|  57.9k|    return value;
 4128|  61.0k|}
lexer.c:ParseServerInstruction:
 3747|  3.18k|{
 3748|  3.18k|    Lexer* lexer = doc->lexer;
 3749|  3.18k|    uint c;
 3750|  3.18k|    int delim = '"';
 3751|  3.18k|    Bool isrule = no;
 3752|       |
 3753|  3.18k|    c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  3.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3754|  3.18k|    TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  3.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3755|       |
 3756|       |    /* check for ASP, PHP or Tango */
 3757|  3.18k|    if (c == '%' || c == '?' || c == '@')
  ------------------
  |  Branch (3757:9): [True: 249, False: 2.93k]
  |  Branch (3757:21): [True: 706, False: 2.22k]
  |  Branch (3757:33): [True: 224, False: 2.00k]
  ------------------
 3758|  1.17k|        isrule = yes;
 3759|       |
 3760|  3.18k|    for (;;)
 3761|  5.59M|    {
 3762|  5.59M|        c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  5.59M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.59M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3763|       |
 3764|  5.59M|        if (c == EndOfStream)
  ------------------
  |  | 1064|  5.59M|#define EndOfStream (~0u)
  ------------------
  |  Branch (3764:13): [True: 167, False: 5.59M]
  ------------------
 3765|    167|            break;
 3766|       |
 3767|  5.59M|        if (c == '>')
  ------------------
  |  Branch (3767:13): [True: 1.68k, False: 5.59M]
  ------------------
 3768|  1.68k|        {
 3769|  1.68k|            if (isrule)
  ------------------
  |  Branch (3769:17): [True: 1.13k, False: 545]
  ------------------
 3770|  1.13k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3771|    545|            else
 3772|    545|                TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    545|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    545|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3773|       |
 3774|  1.68k|            break;
 3775|  1.68k|        }
 3776|       |
 3777|       |        /* if not recognized as ASP, PHP or Tango */
 3778|       |        /* then also finish value on whitespace */
 3779|  5.59M|        if (!isrule)
  ------------------
  |  Branch (3779:13): [True: 4.23M, False: 1.35M]
  ------------------
 3780|  4.23M|        {
 3781|  4.23M|            if (TY_(IsWhite)(c))
  ------------------
  |  |   23|  4.23M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.23M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3781:17): [True: 709, False: 4.23M]
  ------------------
 3782|    709|                break;
 3783|  4.23M|        }
 3784|       |
 3785|  5.59M|        TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  5.59M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.59M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3786|       |
 3787|  5.59M|        if (c == '"')
  ------------------
  |  Branch (3787:13): [True: 845, False: 5.59M]
  ------------------
 3788|    845|        {
 3789|    845|            do
 3790|  6.66k|            {
 3791|  6.66k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  6.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3792|  6.66k|                if (c == EndOfStream) /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  | 1064|  6.66k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3792:21): [True: 28, False: 6.63k]
  ------------------
 3793|     28|                {
 3794|     28|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|     28|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     28|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3795|     28|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     28|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     28|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3796|     28|                    return 0;
 3797|     28|                }
 3798|  6.63k|                if (c == '>') /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  Branch (3798:21): [True: 225, False: 6.40k]
  ------------------
 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|  6.40k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  6.40k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.40k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3805|  6.40k|            }
 3806|  6.40k|            while (c != '"');
  ------------------
  |  Branch (3806:20): [True: 5.81k, False: 592]
  ------------------
 3807|    592|            delim = '\'';
 3808|    592|            continue;
 3809|    845|        }
 3810|       |
 3811|  5.59M|        if (c == '\'')
  ------------------
  |  Branch (3811:13): [True: 640, False: 5.59M]
  ------------------
 3812|    640|        {
 3813|    640|            do
 3814|  86.8k|            {
 3815|  86.8k|                c = TY_(ReadChar)(doc->docIn);
  ------------------
  |  |   23|  86.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  86.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3816|  86.8k|                if (c == EndOfStream) /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  | 1064|  86.8k|#define EndOfStream (~0u)
  ------------------
  |  Branch (3816:21): [True: 20, False: 86.8k]
  ------------------
 3817|     20|                {
 3818|     20|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_END_OF_FILE_ATTR );
  ------------------
  |  |   23|     20|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     20|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3819|     20|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|     20|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     20|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3820|     20|                    return 0;
 3821|     20|                }
 3822|  86.8k|                if (c == '>') /* #427840 - fix by Terry Teague 30 Jun 01 */
  ------------------
  |  Branch (3822:21): [True: 352, False: 86.4k]
  ------------------
 3823|    352|                {
 3824|    352|                    TY_(UngetChar)(c, doc->docIn);
  ------------------
  |  |   23|    352|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    352|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3825|    352|                    TY_(ReportAttrError)( doc, lexer->token, NULL, UNEXPECTED_GT );
  ------------------
  |  |   23|    352|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    352|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3826|    352|                    return 0;
 3827|    352|                }
 3828|  86.4k|                TY_(AddCharToLexer)(lexer, c);
  ------------------
  |  |   23|  86.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  86.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3829|  86.4k|            }
 3830|  86.4k|            while (c != '\'');
  ------------------
  |  Branch (3830:20): [True: 86.2k, False: 268]
  ------------------
 3831|    640|        }
 3832|  5.59M|    }
 3833|       |
 3834|  2.55k|    return delim;
 3835|  3.18k|}
lexer.c:MapStr:
 3471|   144k|{
 3472|  1.85M|    while ( *str )
  ------------------
  |  Branch (3472:13): [True: 1.71M, False: 144k]
  ------------------
 3473|  1.71M|    {
 3474|  1.71M|        uint i = (byte) *str++;
 3475|  1.71M|        lexmap[i] |= code;
 3476|  1.71M|    }
 3477|   144k|}
lexer.c:AddAttrToList:
 4174|   285k|{
 4175|   285k|  if ( *list == NULL )
  ------------------
  |  Branch (4175:8): [True: 175k, False: 109k]
  ------------------
 4176|   175k|    *list = av;
 4177|   109k|  else
 4178|   109k|  {
 4179|   109k|    AttVal* here = *list;
 4180|   505k|    while ( here->next )
  ------------------
  |  Branch (4180:13): [True: 396k, False: 109k]
  ------------------
 4181|   396k|      here = here->next;
 4182|   109k|    here->next = av;
 4183|   109k|  }
 4184|   285k|}

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

prvTidytidyLibraryVersion:
   31|  20.6k|{
   32|  20.6k|  return TY_(library_version);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   33|  20.6k|}
prvTidyReport:
  943|  9.45M|{
  944|  9.45M|    va_list args;
  945|  9.45M|    va_start(args, code);
  946|  9.45M|    vReport(doc, element, node, code, args);
  947|       |    va_end(args);
  948|  9.45M|}
prvTidyReportAttrError:
  965|   888k|{
  966|   888k|    TY_(Report)( doc, NULL, node, code, av );
  ------------------
  |  |   23|   888k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   888k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  967|   888k|}
prvTidyReportEntityError:
  978|   186k|{
  979|       |    /* Note that the report formatter currently doesn't use argument c */
  980|   186k|    TY_(Report)( doc, NULL, NULL, code, entity, c );
  ------------------
  |  |   23|   186k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   186k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  981|   186k|}
prvTidyReportEncodingError:
  991|  1.48M|{
  992|  1.48M|    TY_(Report)( doc, NULL, NULL, code, c, discarded );
  ------------------
  |  |   23|  1.48M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.48M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  993|  1.48M|}
prvTidyReportEncodingWarning:
  996|    184|{
  997|       |    /* va_list in formatter expects trailing `no` argument */
  998|    184|    TY_(Report)( doc, NULL, NULL, code, encoding, no );
  ------------------
  |  |   23|    184|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    184|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  999|    184|}
prvTidyReportMissingAttr:
 1003|  8.50k|{
 1004|  8.50k|    TY_(Report)( doc, NULL, node, MISSING_ATTRIBUTE, name );
  ------------------
  |  |   23|  8.50k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.50k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1005|  8.50k|}
prvTidyReportSurrogateError:
 1009|  38.2k|{
 1010|  38.2k|    TY_(Report)( doc, NULL, NULL, code, c1,c2 );
  ------------------
  |  |   23|  38.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1011|  38.2k|}
prvTidyDialogue:
 1130|  25.9k|{
 1131|  25.9k|    int i = 0;
 1132|  25.9k|    va_list args;
 1133|       |
 1134|   127k|    while ( dialogueDispatchTable[i].code != 0 )
  ------------------
  |  Branch (1134:13): [True: 127k, False: 0]
  ------------------
 1135|   127k|    {
 1136|   127k|        if ( dialogueDispatchTable[i].code == code )
  ------------------
  |  Branch (1136:14): [True: 25.9k, False: 101k]
  ------------------
 1137|  25.9k|        {
 1138|  25.9k|            TidyMessageImpl *message;
 1139|  25.9k|            TidyReportLevel level = dialogueDispatchTable[i].level;
 1140|  25.9k|            va_start(args, code);
 1141|  25.9k|            message = formatDialogue( doc, code, level, args );
 1142|  25.9k|            va_end(args);
 1143|  25.9k|            messageOut( message );
 1144|  25.9k|            break;
 1145|  25.9k|        }
 1146|   101k|        i++;
 1147|   101k|    }
 1148|  25.9k|}
prvTidyReportMarkupVersion:
 1274|  20.6k|{
 1275|  20.6k|    if ( doc->givenDoctype )
  ------------------
  |  Branch (1275:10): [True: 134, False: 20.4k]
  ------------------
 1276|    134|        TY_(Report)( doc, NULL, NULL, STRING_DOCTYPE_GIVEN, doc->givenDoctype );
  ------------------
  |  |   23|    134|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    134|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1277|       |
 1278|  20.6k|    if ( ! cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1278:10): [True: 20.6k, False: 0]
  ------------------
 1279|  20.6k|    {
 1280|  20.6k|        Bool isXhtml = doc->lexer->isvoyager;
 1281|  20.6k|        uint apparentVers = TY_(ApparentVersion)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1282|  20.6k|        ctmbstr vers = TY_(HTMLVersionNameFromCode)( apparentVers, isXhtml );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1283|       |
 1284|  20.6k|        if ( !vers )
  ------------------
  |  Branch (1284:14): [True: 76, False: 20.5k]
  ------------------
 1285|     76|            vers = tidyLocalizedString(STRING_HTML_PROPRIETARY);
 1286|       |
 1287|  20.6k|        TY_(Report)( doc, NULL, NULL, STRING_CONTENT_LOOKS, vers );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1288|       |
 1289|       |        /* Warn about missing system identifier (SI) in emitted doctype */
 1290|  20.6k|        if ( TY_(WarnMissingSIInEmittedDocType)( doc ) )
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1290:14): [True: 0, False: 20.6k]
  ------------------
 1291|      0|            TY_(Report)( doc, NULL, NULL, STRING_NO_SYSID );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1292|  20.6k|    }
 1293|  20.6k|}
prvTidyReportNumWarnings:
 1300|  20.6k|{
 1301|  20.6k|    if ( doc->warnings > 0 || doc->errors > 0 )
  ------------------
  |  Branch (1301:10): [True: 20.6k, False: 1]
  |  Branch (1301:31): [True: 0, False: 1]
  ------------------
 1302|  20.6k|    {
 1303|  20.6k|        if ( doc->errors > cfg(doc, TidyShowErrors) || !cfgBool(doc, TidyShowWarnings) )
  ------------------
  |  |  415|  41.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
                      if ( doc->errors > cfg(doc, TidyShowErrors) || !cfgBool(doc, TidyShowWarnings) )
  ------------------
  |  |  418|  19.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  19.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1303:14): [True: 1.34k, False: 19.2k]
  |  Branch (1303:56): [True: 0, False: 19.2k]
  ------------------
 1304|  1.34k|        {
 1305|  1.34k|            TY_(Dialogue)( doc, STRING_NOT_ALL_SHOWN );
  ------------------
  |  |   23|  1.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1306|  1.34k|        }
 1307|  19.2k|        else
 1308|  19.2k|        {
 1309|  19.2k|            TY_(Dialogue)( doc, STRING_ERROR_COUNT );
  ------------------
  |  |   23|  19.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1310|  19.2k|        }
 1311|       |
 1312|  20.6k|    }
 1313|      1|    else
 1314|      1|    {
 1315|      1|        TY_(Dialogue)( doc, STRING_NO_ERRORS );
  ------------------
  |  |   23|      1|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      1|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1316|      1|    }
 1317|  20.6k|}
prvTidyFreeMutedMessageList:
 1326|  20.6k|{
 1327|  20.6k|    TidyMutedMessages *list = &(doc->muted);
 1328|       |
 1329|  20.6k|    if ( list->list )
  ------------------
  |  Branch (1329:10): [True: 0, False: 20.6k]
  ------------------
 1330|      0|        TidyFree( doc->allocator, list->list );
  ------------------
  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
 1331|  20.6k|}
prvTidytidyErrorCodeAsKey:
 1436|  9.60M|{
 1437|  9.60M|    uint i = 0;
 1438|  1.09G|    while (tidyStringsKeys[i].key) {
  ------------------
  |  Branch (1438:12): [True: 1.09G, False: 0]
  ------------------
 1439|  1.09G|        if ( tidyStringsKeys[i].value == code )
  ------------------
  |  Branch (1439:14): [True: 9.60M, False: 1.08G]
  ------------------
 1440|  9.60M|            return tidyStringsKeys[i].key;
 1441|  1.08G|        i++;
 1442|  1.08G|    }
 1443|      0|    return "UNDEFINED";
 1444|  9.60M|}
message.c:vReport:
  903|  9.58M|{
  904|  9.58M|    int i = 0;
  905|  9.58M|    va_list args_copy;
  906|       |
  907|   558M|    while ( dispatchTable[i].code != 0 )
  ------------------
  |  Branch (907:13): [True: 558M, False: 0]
  ------------------
  908|   558M|    {
  909|   558M|        if ( dispatchTable[i].code == code )
  ------------------
  |  Branch (909:14): [True: 9.58M, False: 548M]
  ------------------
  910|  9.58M|        {
  911|  9.58M|            TidyMessageImpl *message;
  912|  9.58M|            messageFormatter *handler = dispatchTable[i].handler;
  913|  9.58M|            TidyReportLevel level = dispatchTable[i].level;
  914|       |
  915|  9.58M|            va_copy(args_copy, args);
  916|  9.58M|            message = handler( doc, element, node, code, level, args_copy );
  917|  9.58M|            va_end(args_copy);
  918|       |
  919|  9.58M|            messageOut( message );
  920|       |
  921|  9.58M|            if ( dispatchTable[i].next )
  ------------------
  |  Branch (921:18): [True: 128k, False: 9.45M]
  ------------------
  922|   128k|            {
  923|   128k|                va_copy(args_copy, args);
  924|   128k|                vReport(doc, element, node, dispatchTable[i].next, args_copy);
  925|   128k|                va_end(args_copy);
  926|   128k|            }
  927|  9.58M|            break;
  928|  9.58M|        }
  929|   548M|        i++;
  930|   548M|    }
  931|  9.58M|}
message.c:formatStandard:
  673|  6.96M|{
  674|  6.96M|    char nodedesc[ 256 ] = {0};
  675|  6.96M|    char elemdesc[ 256 ] = {0};
  676|  6.96M|    Node* rpt = ( element ? element : node );
  ------------------
  |  Branch (676:19): [True: 6.48M, False: 477k]
  ------------------
  677|       |
  678|  6.96M|    TagToString(node, nodedesc, sizeof(nodedesc));
  679|       |
  680|  6.96M|    if ( element )
  ------------------
  |  Branch (680:10): [True: 6.48M, False: 477k]
  ------------------
  681|  6.48M|        TagToString(element, elemdesc, sizeof(elemdesc));
  682|       |
  683|  6.96M|    switch ( code )
  ------------------
  |  Branch (683:14): [True: 6.96M, False: 0]
  ------------------
  684|  6.96M|    {
  685|      0|        case CUSTOM_TAG_DETECTED:
  ------------------
  |  Branch (685:9): [True: 0, False: 6.96M]
  ------------------
  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.96M]
  ------------------
  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.96M]
  ------------------
  711|      0|        case FILE_CANT_OPEN_CFG:
  ------------------
  |  Branch (711:9): [True: 0, False: 6.96M]
  ------------------
  712|      0|        case FILE_NOT_FILE:
  ------------------
  |  Branch (712:9): [True: 0, False: 6.96M]
  ------------------
  713|  20.6k|        case STRING_CONTENT_LOOKS:
  ------------------
  |  Branch (713:9): [True: 20.6k, False: 6.94M]
  ------------------
  714|  20.7k|        case STRING_DOCTYPE_GIVEN:
  ------------------
  |  Branch (714:9): [True: 134, False: 6.96M]
  ------------------
  715|  20.7k|        case STRING_MISSING_MALFORMED:
  ------------------
  |  Branch (715:9): [True: 0, False: 6.96M]
  ------------------
  716|  20.7k|        case STRING_MUTING_TYPE:
  ------------------
  |  Branch (716:9): [True: 0, False: 6.96M]
  ------------------
  717|  20.7k|        {
  718|  20.7k|            ctmbstr str;
  719|  20.7k|            if ( (str = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (719:18): [True: 20.7k, False: 0]
  ------------------
  720|  20.7k|                return TY_(tidyMessageCreate)( doc, code, level, str );
  ------------------
  |  |   23|  20.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  721|       |
  722|  20.7k|        } break;
  723|       |
  724|      0|        case APOS_UNDEFINED:
  ------------------
  |  Branch (724:9): [True: 0, False: 6.96M]
  ------------------
  725|    503|        case MISSING_SEMICOLON_NCR:
  ------------------
  |  Branch (725:9): [True: 503, False: 6.96M]
  ------------------
  726|  9.64k|        case MISSING_SEMICOLON:
  ------------------
  |  Branch (726:9): [True: 9.14k, False: 6.95M]
  ------------------
  727|  30.0k|        case UNESCAPED_AMPERSAND:
  ------------------
  |  Branch (727:9): [True: 20.4k, False: 6.94M]
  ------------------
  728|   186k|        case UNKNOWN_ENTITY:
  ------------------
  |  Branch (728:9): [True: 156k, False: 6.80M]
  ------------------
  729|   186k|        {
  730|   186k|            ctmbstr entityname;
  731|   186k|            if ( !(entityname = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (731:18): [True: 0, False: 186k]
  ------------------
  732|      0|            {
  733|      0|                entityname = "NULL";
  734|      0|            }
  735|   186k|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, entityname);
  ------------------
  |  |   23|   186k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   186k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  736|  30.0k|        }
  737|       |
  738|  8.50k|        case MISSING_ATTRIBUTE:
  ------------------
  |  Branch (738:9): [True: 8.50k, False: 6.95M]
  ------------------
  739|  8.50k|        {
  740|  8.50k|            ctmbstr name;
  741|  8.50k|            if ( (name = va_arg( args, ctmbstr)) )
  ------------------
  |  Branch (741:18): [True: 8.50k, False: 0]
  ------------------
  742|  8.50k|                return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc, name );
  ------------------
  |  |   23|  8.50k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.50k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  743|  8.50k|        } break;
  744|       |
  745|      0|        case STRING_UNKNOWN_OPTION:
  ------------------
  |  Branch (745:9): [True: 0, False: 6.96M]
  ------------------
  746|      0|        case OPTION_REMOVED:
  ------------------
  |  Branch (746:9): [True: 0, False: 6.96M]
  ------------------
  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.96M]
  ------------------
  754|      0|        case STRING_ARGUMENT_BAD:
  ------------------
  |  Branch (754:9): [True: 0, False: 6.96M]
  ------------------
  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.96M]
  ------------------
  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|    469|        case BAD_SURROGATE_LEAD:
  ------------------
  |  Branch (770:9): [True: 469, False: 6.96M]
  ------------------
  771|    663|        case BAD_SURROGATE_PAIR:
  ------------------
  |  Branch (771:9): [True: 194, False: 6.96M]
  ------------------
  772|  38.2k|        case BAD_SURROGATE_TAIL:
  ------------------
  |  Branch (772:9): [True: 37.5k, False: 6.92M]
  ------------------
  773|  38.2k|        {
  774|  38.2k|            uint c1 = va_arg( args, uint );
  775|  38.2k|            uint c2 = va_arg( args, uint );
  776|  38.2k|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, c1, c2);
  ------------------
  |  |   23|  38.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  777|    663|        }
  778|       |
  779|     63|        case SPACE_PRECEDING_XMLDECL:
  ------------------
  |  Branch (779:9): [True: 63, False: 6.96M]
  ------------------
  780|       |            /* @TODO: Should this be a TidyInfo "silent" fix? */
  781|     63|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level );
  ------------------
  |  |   23|     63|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     63|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  782|       |
  783|  5.35k|        case CANT_BE_NESTED:
  ------------------
  |  Branch (783:9): [True: 5.35k, False: 6.95M]
  ------------------
  784|  6.21k|        case NOFRAMES_CONTENT:
  ------------------
  |  Branch (784:9): [True: 868, False: 6.96M]
  ------------------
  785|  11.3k|        case USING_BR_INPLACE_OF:
  ------------------
  |  Branch (785:9): [True: 5.09k, False: 6.95M]
  ------------------
  786|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  787|  11.3k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc );
  ------------------
  |  |   23|  11.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  788|       |
  789|      0|        case ELEMENT_VERS_MISMATCH_ERROR:
  ------------------
  |  Branch (789:9): [True: 0, False: 6.96M]
  ------------------
  790|      0|        case ELEMENT_VERS_MISMATCH_WARN:
  ------------------
  |  Branch (790:9): [True: 0, False: 6.96M]
  ------------------
  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|   125k|        case TAG_NOT_ALLOWED_IN:
  ------------------
  |  Branch (793:9): [True: 125k, False: 6.83M]
  ------------------
  794|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  795|   125k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, nodedesc, element ? element->element : NULL );
  ------------------
  |  |   23|   125k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   125k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (795:85): [True: 125k, False: 0]
  ------------------
  796|       |
  797|  1.89M|        case INSERTING_TAG:
  ------------------
  |  Branch (797:9): [True: 1.89M, False: 5.07M]
  ------------------
  798|  1.95M|        case MISSING_STARTTAG:
  ------------------
  |  Branch (798:9): [True: 66.2k, False: 6.89M]
  ------------------
  799|  1.95M|        case TOO_MANY_ELEMENTS:
  ------------------
  |  Branch (799:9): [True: 0, False: 6.96M]
  ------------------
  800|  1.95M|        case UNEXPECTED_ENDTAG:
  ------------------
  |  Branch (800:9): [True: 0, False: 6.96M]
  ------------------
  801|  1.95M|        case UNEXPECTED_ENDTAG_ERR:  /* generated by XML docs */
  ------------------
  |  Branch (801:9): [True: 0, False: 6.96M]
  ------------------
  802|       |            /* Can we use `rpt` here? No; `element` has a value in every case. */
  803|  1.95M|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, node->element );
  ------------------
  |  |   23|  1.95M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.95M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  804|       |
  805|      0|        case UNEXPECTED_ENDTAG_IN:
  ------------------
  |  Branch (805:9): [True: 0, False: 6.96M]
  ------------------
  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|    354|        case BAD_CDATA_CONTENT:
  ------------------
  |  Branch (809:9): [True: 354, False: 6.96M]
  ------------------
  810|  7.17k|        case CONTENT_AFTER_BODY:
  ------------------
  |  Branch (810:9): [True: 6.82k, False: 6.95M]
  ------------------
  811|  9.20k|        case DOCTYPE_AFTER_TAGS:
  ------------------
  |  Branch (811:9): [True: 2.02k, False: 6.96M]
  ------------------
  812|  10.6k|        case DUPLICATE_FRAMESET:
  ------------------
  |  Branch (812:9): [True: 1.47k, False: 6.96M]
  ------------------
  813|  21.0k|        case MALFORMED_COMMENT:
  ------------------
  |  Branch (813:9): [True: 10.4k, False: 6.95M]
  ------------------
  814|  29.2k|        case MALFORMED_COMMENT_DROPPING:
  ------------------
  |  Branch (814:9): [True: 8.20k, False: 6.95M]
  ------------------
  815|  29.4k|        case MALFORMED_COMMENT_EOS:
  ------------------
  |  Branch (815:9): [True: 161, False: 6.96M]
  ------------------
  816|  29.4k|        case MALFORMED_COMMENT_WARN:
  ------------------
  |  Branch (816:9): [True: 0, False: 6.96M]
  ------------------
  817|  61.1k|        case MALFORMED_DOCTYPE:
  ------------------
  |  Branch (817:9): [True: 31.6k, False: 6.93M]
  ------------------
  818|  77.8k|        case MISSING_DOCTYPE:
  ------------------
  |  Branch (818:9): [True: 16.7k, False: 6.94M]
  ------------------
  819|  98.3k|        case MISSING_TITLE_ELEMENT:
  ------------------
  |  Branch (819:9): [True: 20.4k, False: 6.94M]
  ------------------
  820|   122k|        case NESTED_QUOTATION:
  ------------------
  |  Branch (820:9): [True: 24.1k, False: 6.93M]
  ------------------
  821|   123k|        case SUSPECTED_MISSING_QUOTE:
  ------------------
  |  Branch (821:9): [True: 575, False: 6.96M]
  ------------------
  822|   123k|        case XML_DECLARATION_DETECTED:
  ------------------
  |  Branch (822:9): [True: 133, False: 6.96M]
  ------------------
  823|   123k|        case BLANK_TITLE_ELEMENT:
  ------------------
  |  Branch (823:9): [True: 73, False: 6.96M]
  ------------------
  824|   123k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level );
  ------------------
  |  |   23|   123k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   123k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  825|       |
  826|      0|        case ELEMENT_NOT_EMPTY:
  ------------------
  |  Branch (826:9): [True: 0, False: 6.96M]
  ------------------
  827|      0|        case FOUND_STYLE_IN_BODY:
  ------------------
  |  Branch (827:9): [True: 0, False: 6.96M]
  ------------------
  828|  8.13k|        case ILLEGAL_NESTING:
  ------------------
  |  Branch (828:9): [True: 8.13k, False: 6.95M]
  ------------------
  829|  8.86k|        case MOVED_STYLE_TO_HEAD:
  ------------------
  |  Branch (829:9): [True: 737, False: 6.96M]
  ------------------
  830|   423k|        case TRIM_EMPTY_ELEMENT:
  ------------------
  |  Branch (830:9): [True: 414k, False: 6.54M]
  ------------------
  831|   423k|        case UNEXPECTED_END_OF_FILE:
  ------------------
  |  Branch (831:9): [True: 3, False: 6.96M]
  ------------------
  832|   423k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, elemdesc );
  ------------------
  |  |   23|   423k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   423k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  833|       |
  834|  1.81k|        case OBSOLETE_ELEMENT:
  ------------------
  |  Branch (834:9): [True: 1.81k, False: 6.96M]
  ------------------
  835|  9.84k|        case REPLACING_ELEMENT:
  ------------------
  |  Branch (835:9): [True: 8.02k, False: 6.95M]
  ------------------
  836|  9.84k|        case REPLACING_UNEX_ELEMENT:
  ------------------
  |  Branch (836:9): [True: 0, False: 6.96M]
  ------------------
  837|  9.84k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, elemdesc, nodedesc );
  ------------------
  |  |   23|  9.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  838|       |
  839|      0|        case ADDED_MISSING_CHARSET:
  ------------------
  |  Branch (839:9): [True: 0, False: 6.96M]
  ------------------
  840|    198|        case BAD_SUMMARY_HTML5:
  ------------------
  |  Branch (840:9): [True: 198, False: 6.96M]
  ------------------
  841|  5.49k|        case NESTED_EMPHASIS:
  ------------------
  |  Branch (841:9): [True: 5.30k, False: 6.95M]
  ------------------
  842|  6.70k|        case PROPRIETARY_ELEMENT:
  ------------------
  |  Branch (842:9): [True: 1.20k, False: 6.96M]
  ------------------
  843|  1.54M|        case REMOVED_HTML5:
  ------------------
  |  Branch (843:9): [True: 1.53M, False: 5.42M]
  ------------------
  844|  1.64M|        case UNKNOWN_ELEMENT:
  ------------------
  |  Branch (844:9): [True: 97.5k, False: 6.86M]
  ------------------
  845|  1.69M|        case UNKNOWN_ELEMENT_LOOKS_CUSTOM:
  ------------------
  |  Branch (845:9): [True: 55.4k, False: 6.90M]
  ------------------
  846|  1.69M|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, nodedesc );
  ------------------
  |  |   23|  1.69M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.69M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  847|       |
  848|  1.54M|        case MISSING_ENDTAG_FOR:
  ------------------
  |  Branch (848:9): [True: 1.54M, False: 5.41M]
  ------------------
  849|  1.56M|        case MISSING_ENDTAG_OPTIONAL:
  ------------------
  |  Branch (849:9): [True: 14.7k, False: 6.94M]
  ------------------
  850|  1.69M|        case PREVIOUS_LOCATION:
  ------------------
  |  Branch (850:9): [True: 128k, False: 6.83M]
  ------------------
  851|  1.69M|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, element? element->element : NULL );
  ------------------
  |  |   23|  1.69M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.69M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (851:74): [True: 1.69M, False: 516]
  ------------------
  852|       |
  853|   641k|        case MISSING_ENDTAG_BEFORE:
  ------------------
  |  Branch (853:9): [True: 641k, False: 6.32M]
  ------------------
  854|   641k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, element? element->element : NULL, nodedesc );
  ------------------
  |  |   23|   641k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   641k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (854:74): [True: 641k, False: 0]
  ------------------
  855|       |
  856|  6.24k|        case COERCE_TO_ENDTAG:
  ------------------
  |  Branch (856:9): [True: 6.24k, False: 6.95M]
  ------------------
  857|  20.5k|        case NON_MATCHING_ENDTAG:
  ------------------
  |  Branch (857:9): [True: 14.3k, False: 6.94M]
  ------------------
  858|  20.5k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, node->element, node->element );
  ------------------
  |  |   23|  20.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  859|  3.18k|        case TOO_MANY_ELEMENTS_IN:
  ------------------
  |  Branch (859:9): [True: 3.18k, False: 6.95M]
  ------------------
  860|  3.18k|            return TY_(tidyMessageCreateWithNode)(doc, rpt, code, level, node->element, element ? element->element : NULL);
  ------------------
  |  |   23|  3.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (860:89): [True: 3.18k, False: 0]
  ------------------
  861|       |
  862|  6.96M|    }
  863|       |
  864|      0|    return NULL;
  865|  6.96M|}
message.c:TagToString:
   42|  14.5M|{
   43|  14.5M|    *buf = 0;
   44|  14.5M|    if (tag)
  ------------------
  |  Branch (44:9): [True: 12.2M, False: 2.29M]
  ------------------
   45|  12.2M|    {
   46|  12.2M|        if (TY_(nodeIsElement)(tag))
  ------------------
  |  |   23|  12.2M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.2M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (46:13): [True: 11.9M, False: 321k]
  ------------------
   47|  11.9M|            TY_(tmbsnprintf)(buf, count, "<%s>", tag->element);
  ------------------
  |  |   23|  11.9M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.9M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   48|   321k|        else if (tag->type == EndTag)
  ------------------
  |  Branch (48:18): [True: 100k, False: 221k]
  ------------------
   49|   100k|            TY_(tmbsnprintf)(buf, count, "</%s>", tag->element);
  ------------------
  |  |   23|   100k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   100k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   50|   221k|        else if (tag->type == DocTypeTag)
  ------------------
  |  Branch (50:18): [True: 23.2k, False: 197k]
  ------------------
   51|  23.2k|            TY_(tmbsnprintf)(buf, count, "<!DOCTYPE>");
  ------------------
  |  |   23|  23.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   52|   197k|        else if (tag->type == TextNode)
  ------------------
  |  Branch (52:18): [True: 179k, False: 18.6k]
  ------------------
   53|   179k|            TY_(tmbsnprintf)(buf, count, "%s", "STRING_PLAIN_TEXT");
  ------------------
  |  |   23|   179k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   179k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   54|  18.6k|        else if (tag->type == XmlDecl)
  ------------------
  |  Branch (54:18): [True: 17.3k, False: 1.26k]
  ------------------
   55|  17.3k|            TY_(tmbsnprintf)(buf, count, "%s", "STRING_XML_DECLARATION");
  ------------------
  |  |   23|  17.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   56|  1.26k|        else if (tag->element)
  ------------------
  |  Branch (56:18): [True: 1.13k, False: 137]
  ------------------
   57|  1.13k|            TY_(tmbsnprintf)(buf, count, "%s", tag->element);
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   58|  12.2M|    }
   59|  14.5M|    return buf + TY_(tmbstrlen)(buf);
  ------------------
  |  |   23|  14.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   60|  14.5M|}
message.c:HTMLVersion:
   93|  11.3k|{
   94|  11.3k|    uint versionEmitted = doc->lexer->versionEmitted;
   95|  11.3k|    uint declared = doc->lexer->doctype;
   96|  11.3k|    uint version = versionEmitted == 0 ? declared : versionEmitted;
  ------------------
  |  Branch (96:20): [True: 0, False: 11.3k]
  ------------------
   97|  11.3k|    ctmbstr result = TY_(HTMLVersionNameFromCode)(version, 0);
  ------------------
  |  |   23|  11.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   98|  11.3k|    if (!result)
  ------------------
  |  Branch (98:9): [True: 0, False: 11.3k]
  ------------------
   99|      0|        result = tidyLocalizedString(STRING_HTML_PROPRIETARY);
  100|  11.3k|    return result;
  101|  11.3k|}
message.c:formatAttributeReport:
  533|   888k|{
  534|   888k|    AttVal *av = NULL;
  535|   888k|    char const *name = "NULL";
  536|   888k|    char const *value = "NULL";
  537|   888k|    char tagdesc[64];
  538|       |
  539|   888k|    TagToString(node, tagdesc, sizeof(tagdesc));
  540|       |
  541|   888k|    if ( ( av = va_arg(args, AttVal*) ) )
  ------------------
  |  Branch (541:10): [True: 594k, False: 294k]
  ------------------
  542|   594k|    {
  543|   594k|        if (av->attribute)
  ------------------
  |  Branch (543:13): [True: 572k, False: 21.2k]
  ------------------
  544|   572k|            name = av->attribute;
  545|   594k|        if (av->value)
  ------------------
  |  Branch (545:13): [True: 437k, False: 156k]
  ------------------
  546|   437k|            value = av->value;
  547|   594k|    }
  548|       |
  549|   888k|    switch (code)
  ------------------
  |  Branch (549:13): [True: 888k, False: 0]
  ------------------
  550|   888k|    {
  551|  44.6k|        case MISSING_QUOTEMARK_OPEN:
  ------------------
  |  Branch (551:9): [True: 44.6k, False: 843k]
  ------------------
  552|  44.6k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, name );
  ------------------
  |  |   23|  44.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  553|       |		
  554|    250|        case BACKSLASH_IN_URI:
  ------------------
  |  Branch (554:9): [True: 250, False: 888k]
  ------------------
  555|  56.8k|        case ESCAPED_ILLEGAL_URI:
  ------------------
  |  Branch (555:9): [True: 56.6k, False: 831k]
  ------------------
  556|   103k|        case FIXED_BACKSLASH:
  ------------------
  |  Branch (556:9): [True: 46.4k, False: 842k]
  ------------------
  557|   103k|        case ID_NAME_MISMATCH:
  ------------------
  |  Branch (557:9): [True: 283, False: 888k]
  ------------------
  558|   159k|        case ILLEGAL_URI_CODEPOINT:
  ------------------
  |  Branch (558:9): [True: 55.5k, False: 832k]
  ------------------
  559|   159k|        case ILLEGAL_URI_REFERENCE:
  ------------------
  |  Branch (559:9): [True: 0, False: 888k]
  ------------------
  560|   159k|        case INVALID_XML_ID:
  ------------------
  |  Branch (560:9): [True: 484, False: 888k]
  ------------------
  561|   159k|        case MISSING_IMAGEMAP:
  ------------------
  |  Branch (561:9): [True: 200, False: 888k]
  ------------------
  562|   161k|        case MISSING_QUOTEMARK:
  ------------------
  |  Branch (562:9): [True: 1.38k, False: 887k]
  ------------------
  563|   162k|        case NEWLINE_IN_URI:
  ------------------
  |  Branch (563:9): [True: 871, False: 887k]
  ------------------
  564|   164k|        case UNEXPECTED_EQUALSIGN:
  ------------------
  |  Branch (564:9): [True: 2.34k, False: 886k]
  ------------------
  565|   448k|        case UNEXPECTED_GT:
  ------------------
  |  Branch (565:9): [True: 283k, False: 604k]
  ------------------
  566|   449k|        case UNEXPECTED_QUOTEMARK:
  ------------------
  |  Branch (566:9): [True: 1.73k, False: 886k]
  ------------------
  567|   453k|        case WHITE_IN_URI:
  ------------------
  |  Branch (567:9): [True: 4.06k, False: 884k]
  ------------------
  568|   453k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc );
  ------------------
  |  |   23|   453k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   453k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  569|       |
  570|    199|        case ATTRIBUTE_IS_NOT_ALLOWED:
  ------------------
  |  Branch (570:9): [True: 199, False: 888k]
  ------------------
  571|  1.45k|        case JOINING_ATTRIBUTE:
  ------------------
  |  Branch (571:9): [True: 1.25k, False: 887k]
  ------------------
  572|  63.9k|        case MISSING_ATTR_VALUE:
  ------------------
  |  Branch (572:9): [True: 62.4k, False: 826k]
  ------------------
  573|   218k|        case PROPRIETARY_ATTRIBUTE:
  ------------------
  |  Branch (573:9): [True: 154k, False: 734k]
  ------------------
  574|   218k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name );
  ------------------
  |  |   23|   218k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   218k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  575|       |
  576|      0|        case ATTRIBUTE_VALUE_REPLACED:
  ------------------
  |  Branch (576:9): [True: 0, False: 888k]
  ------------------
  577|   112k|        case BAD_ATTRIBUTE_VALUE:
  ------------------
  |  Branch (577:9): [True: 112k, False: 775k]
  ------------------
  578|   113k|        case BAD_ATTRIBUTE_VALUE_REPLACED:
  ------------------
  |  Branch (578:9): [True: 883, False: 887k]
  ------------------
  579|   113k|        case INSERTING_AUTO_ATTRIBUTE:
  ------------------
  |  Branch (579:9): [True: 0, False: 888k]
  ------------------
  580|   117k|        case INVALID_ATTRIBUTE:
  ------------------
  |  Branch (580:9): [True: 4.53k, False: 883k]
  ------------------
  581|   117k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name, value );
  ------------------
  |  |   23|   117k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   117k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  582|       |
  583|      0|        case MISMATCHED_ATTRIBUTE_ERROR:
  ------------------
  |  Branch (583:9): [True: 0, False: 888k]
  ------------------
  584|  11.3k|        case MISMATCHED_ATTRIBUTE_WARN:
  ------------------
  |  Branch (584:9): [True: 11.3k, False: 877k]
  ------------------
  585|  11.3k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, name, HTMLVersion(doc));
  ------------------
  |  |   23|  11.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  586|       |
  587|  2.87k|        case ANCHOR_NOT_UNIQUE:
  ------------------
  |  Branch (587:9): [True: 2.87k, False: 885k]
  ------------------
  588|  32.9k|        case ANCHOR_DUPLICATED:
  ------------------
  |  Branch (588:9): [True: 30.0k, False: 858k]
  ------------------
  589|  34.3k|        case ATTR_VALUE_NOT_LCASE:
  ------------------
  |  Branch (589:9): [True: 1.37k, False: 887k]
  ------------------
  590|  34.7k|        case PROPRIETARY_ATTR_VALUE:
  ------------------
  |  Branch (590:9): [True: 413, False: 888k]
  ------------------
  591|  34.7k|        case XML_ID_SYNTAX:
  ------------------
  |  Branch (591:9): [True: 0, False: 888k]
  ------------------
  592|  34.7k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, value );
  ------------------
  |  |   23|  34.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  593|       |
  594|  6.31k|        case REPEATED_ATTRIBUTE:
  ------------------
  |  Branch (594:9): [True: 6.31k, False: 882k]
  ------------------
  595|  6.31k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, level, tagdesc, value, name );
  ------------------
  |  |   23|  6.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  596|       |
  597|  1.39k|        case UNEXPECTED_END_OF_FILE_ATTR:
  ------------------
  |  Branch (597:9): [True: 1.39k, False: 887k]
  ------------------
  598|       |            /* on end of file adjust reported position to end of input */
  599|  1.39k|            doc->lexer->lines   = doc->docIn->curline;
  600|  1.39k|            doc->lexer->columns = doc->docIn->curcol;
  601|  1.39k|            return TY_(tidyMessageCreateWithLexer)(doc, code, level, tagdesc );
  ------------------
  |  |   23|  1.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  602|   888k|    }
  603|       |
  604|      0|    return NULL;
  605|   888k|}
message.c:formatStandardDynamic:
  872|   240k|{
  873|   240k|    char nodedesc[ 256 ] = {0};
  874|       |
  875|   240k|    TagToString(node, nodedesc, sizeof(nodedesc));
  876|       |
  877|   240k|    switch (code)
  ------------------
  |  Branch (877:13): [True: 240k, False: 0]
  ------------------
  878|   240k|    {
  879|   240k|        case DISCARDING_UNEXPECTED:
  ------------------
  |  Branch (879:9): [True: 240k, 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|   240k|            return TY_(tidyMessageCreateWithNode)(doc, node, code, doc->badForm ? TidyError : TidyWarning, nodedesc );
  ------------------
  |  |   23|   240k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   240k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (882:68): [True: 24.6k, False: 216k]
  ------------------
  883|      0|            break;
  884|   240k|    }
  885|       |
  886|      0|    return NULL;
  887|   240k|}
message.c:formatEncodingReport:
  616|  1.48M|{
  617|  1.48M|    char buf[ 32 ] = {'\0'};
  618|  1.48M|    uint c = va_arg( args, uint );
  619|  1.48M|    Bool discarded = va_arg( args, Bool );
  620|  1.48M|    ctmbstr action = tidyLocalizedString(discarded ? STRING_DISCARDING : STRING_REPLACING);
  ------------------
  |  Branch (620:42): [True: 7.50k, False: 1.48M]
  ------------------
  621|       |
  622|  1.48M|    switch (code)
  ------------------
  |  Branch (622:13): [True: 1.48M, False: 0]
  ------------------
  623|  1.48M|    {
  624|    700|        case INVALID_NCR:
  ------------------
  |  Branch (624:9): [True: 700, False: 1.48M]
  ------------------
  625|    700|            NtoS(c, buf);
  626|    700|            doc->badChars |= BC_INVALID_NCR;
  ------------------
  |  |  305|    700|#define BC_INVALID_NCR             64
  ------------------
  627|    700|            break;
  628|       |
  629|    923|        case INVALID_SGML_CHARS:
  ------------------
  |  Branch (629:9): [True: 923, False: 1.48M]
  ------------------
  630|    923|            NtoS(c, buf);
  631|    923|            doc->badChars |= BC_INVALID_SGML_CHARS;
  ------------------
  |  |  300|    923|#define BC_INVALID_SGML_CHARS      2
  ------------------
  632|    923|            break;
  633|       |
  634|  1.47M|        case INVALID_UTF8:
  ------------------
  |  Branch (634:9): [True: 1.47M, False: 8.56k]
  ------------------
  635|  1.47M|            TY_(tmbsnprintf)(buf, sizeof(buf), "U+%04X", c);
  ------------------
  |  |   23|  1.47M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.47M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  636|  1.47M|            doc->badChars |= BC_INVALID_UTF8;
  ------------------
  |  |  301|  1.47M|#define BC_INVALID_UTF8            4
  ------------------
  637|  1.47M|            break;
  638|       |
  639|  6.75k|        case INVALID_UTF16:
  ------------------
  |  Branch (639:9): [True: 6.75k, False: 1.48M]
  ------------------
  640|  6.75k|            TY_(tmbsnprintf)(buf, sizeof(buf), "U+%04X", c);
  ------------------
  |  |   23|  6.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  641|  6.75k|            doc->badChars |= BC_INVALID_UTF16;
  ------------------
  |  |  302|  6.75k|#define BC_INVALID_UTF16           8
  ------------------
  642|  6.75k|            break;
  643|       |
  644|      0|        case VENDOR_SPECIFIC_CHARS:
  ------------------
  |  Branch (644:9): [True: 0, False: 1.48M]
  ------------------
  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|    184|        case ENCODING_MISMATCH:
  ------------------
  |  Branch (649:9): [True: 184, False: 1.48M]
  ------------------
  650|    184|            doc->badChars |= BC_ENCODING_MISMATCH;
  ------------------
  |  |  303|    184|#define BC_ENCODING_MISMATCH       16 /* fatal error */
  ------------------
  651|    184|            return TY_(tidyMessageCreateWithLexer)(doc,
  ------------------
  |  |   23|    184|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    184|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  652|    184|                                                   code,
  653|    184|                                                   level,
  654|    184|                                                   TY_(CharEncodingName)(doc->docIn->encoding),
  ------------------
  |  |   23|    184|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    184|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  655|    184|                                                   TY_(CharEncodingName)(c));
  ------------------
  |  |   23|    184|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    184|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  656|      0|            break;
  657|  1.48M|    }
  658|       |
  659|  1.48M|    return TY_(tidyMessageCreateWithLexer)(doc, code, level, action, buf );
  ------------------
  |  |   23|  1.48M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.48M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  660|       |
  661|  1.48M|}
message.c:NtoS:
   65|  1.62k|{
   66|  1.62k|    tmbchar buf[40];
   67|  1.62k|    int i;
   68|       |    
   69|  3.24k|    for (i = 0;; ++i)
   70|  4.86k|    {
   71|  4.86k|        buf[i] = (tmbchar)( (n % 10) + '0' );
   72|       |        
   73|  4.86k|        n = n / 10;
   74|       |        
   75|  4.86k|        if (n == 0)
  ------------------
  |  Branch (75:13): [True: 1.62k, False: 3.24k]
  ------------------
   76|  1.62k|            break;
   77|  4.86k|    }
   78|       |    
   79|  1.62k|    n = i;
   80|       |    
   81|  6.49k|    while (i >= 0)
  ------------------
  |  Branch (81:12): [True: 4.86k, False: 1.62k]
  ------------------
   82|  4.86k|    {
   83|  4.86k|        str[n-i] = buf[i];
   84|  4.86k|        --i;
   85|  4.86k|    }
   86|       |    
   87|  1.62k|    str[n+1] = '\0';
   88|  1.62k|}
message.c:formatDialogue:
 1077|  25.9k|{
 1078|  25.9k|    switch (code)
 1079|  25.9k|    {
 1080|      0|        case TEXT_SGML_CHARS:
  ------------------
  |  Branch (1080:9): [True: 0, False: 25.9k]
  ------------------
 1081|      0|        case TEXT_VENDOR_CHARS:
  ------------------
  |  Branch (1081:9): [True: 0, False: 25.9k]
  ------------------
 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.2k|        case STRING_ERROR_COUNT:
  ------------------
  |  Branch (1087:9): [True: 19.2k, False: 6.72k]
  ------------------
 1088|  20.6k|        case STRING_NOT_ALL_SHOWN:
  ------------------
  |  Branch (1088:9): [True: 1.34k, False: 24.6k]
  ------------------
 1089|  20.6k|            return TY_(tidyMessageCreate)( doc, code, level,
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1090|  20.6k|                                           doc->warnings, "STRING_ERROR_COUNT_WARNING",
 1091|  20.6k|                                           doc->errors, "STRING_ERROR_COUNT_ERROR" );
 1092|       |
 1093|      0|        case FOOTNOTE_TRIM_EMPTY_ELEMENT:
  ------------------
  |  Branch (1093:9): [True: 0, False: 25.9k]
  ------------------
 1094|      0|        case STRING_HELLO_ACCESS:
  ------------------
  |  Branch (1094:9): [True: 0, False: 25.9k]
  ------------------
 1095|  5.38k|        case STRING_NEEDS_INTERVENTION:
  ------------------
  |  Branch (1095:9): [True: 5.38k, False: 20.6k]
  ------------------
 1096|  5.38k|        case STRING_NO_ERRORS:
  ------------------
  |  Branch (1096:9): [True: 1, False: 25.9k]
  ------------------
 1097|  5.38k|        case TEXT_ACCESS_ADVICE1:
  ------------------
  |  Branch (1097:9): [True: 0, False: 25.9k]
  ------------------
 1098|  5.38k|        case TEXT_ACCESS_ADVICE2:
  ------------------
  |  Branch (1098:9): [True: 0, False: 25.9k]
  ------------------
 1099|  5.38k|        case TEXT_BAD_FORM:
  ------------------
  |  Branch (1099:9): [True: 0, False: 25.9k]
  ------------------
 1100|  5.38k|        case TEXT_BAD_MAIN:
  ------------------
  |  Branch (1100:9): [True: 0, False: 25.9k]
  ------------------
 1101|  5.38k|        case TEXT_GENERAL_INFO:
  ------------------
  |  Branch (1101:9): [True: 0, False: 25.9k]
  ------------------
 1102|  5.38k|        case TEXT_GENERAL_INFO_PLEA:
  ------------------
  |  Branch (1102:9): [True: 0, False: 25.9k]
  ------------------
 1103|  5.38k|        case TEXT_HTML_T_ALGORITHM:
  ------------------
  |  Branch (1103:9): [True: 0, False: 25.9k]
  ------------------
 1104|  5.38k|        case TEXT_INVALID_URI:
  ------------------
  |  Branch (1104:9): [True: 0, False: 25.9k]
  ------------------
 1105|  5.38k|        case TEXT_INVALID_UTF8:
  ------------------
  |  Branch (1105:9): [True: 0, False: 25.9k]
  ------------------
 1106|  5.38k|        case TEXT_INVALID_UTF16:
  ------------------
  |  Branch (1106:9): [True: 0, False: 25.9k]
  ------------------
 1107|  5.38k|        case TEXT_M_IMAGE_ALT:
  ------------------
  |  Branch (1107:9): [True: 0, False: 25.9k]
  ------------------
 1108|  5.38k|        case TEXT_M_IMAGE_MAP:
  ------------------
  |  Branch (1108:9): [True: 0, False: 25.9k]
  ------------------
 1109|  5.38k|        case TEXT_M_LINK_ALT:
  ------------------
  |  Branch (1109:9): [True: 0, False: 25.9k]
  ------------------
 1110|  5.38k|        case TEXT_M_SUMMARY:
  ------------------
  |  Branch (1110:9): [True: 0, False: 25.9k]
  ------------------
 1111|  5.38k|        case TEXT_USING_BODY:
  ------------------
  |  Branch (1111:9): [True: 0, False: 25.9k]
  ------------------
 1112|  5.38k|        case TEXT_USING_FONT:
  ------------------
  |  Branch (1112:9): [True: 0, False: 25.9k]
  ------------------
 1113|  5.38k|        case TEXT_USING_FRAMES:
  ------------------
  |  Branch (1113:9): [True: 0, False: 25.9k]
  ------------------
 1114|  5.38k|        case TEXT_USING_LAYER:
  ------------------
  |  Branch (1114:9): [True: 0, False: 25.9k]
  ------------------
 1115|  5.38k|        case TEXT_USING_NOBR:
  ------------------
  |  Branch (1115:9): [True: 0, False: 25.9k]
  ------------------
 1116|  5.38k|        case TEXT_USING_SPACER:
  ------------------
  |  Branch (1116:9): [True: 0, False: 25.9k]
  ------------------
 1117|  5.38k|        default:
  ------------------
  |  Branch (1117:9): [True: 0, False: 25.9k]
  ------------------
 1118|  5.38k|            return TY_(tidyMessageCreate)( doc, code, level );
  ------------------
  |  |   23|  5.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1119|  25.9k|    }
 1120|       |    
 1121|      0|    return NULL;
 1122|  25.9k|}
message.c:messageOut:
  116|  9.60M|{
  117|  9.60M|    TidyDocImpl *doc;
  118|  9.60M|    Bool go = yes;
  119|       |
  120|  9.60M|    if ( !message )
  ------------------
  |  Branch (120:10): [True: 0, False: 9.60M]
  ------------------
  121|      0|        return;
  122|       |
  123|  9.60M|    doc = message->tidyDoc;
  124|       |
  125|       |    /* The filter has had a chance to suppress *any* message from output. */
  126|  9.60M|    go = message->allowMessage;
  127|       |
  128|       |    /* Update the count of each report type. */
  129|  9.60M|    switch ( message->level )
  130|  9.60M|    {
  131|   219k|        case TidyInfo:
  ------------------
  |  Branch (131:9): [True: 219k, False: 9.38M]
  ------------------
  132|   219k|            doc->infoMessages++;
  133|   219k|            break;
  134|  9.18M|        case TidyWarning:
  ------------------
  |  Branch (134:9): [True: 9.18M, False: 424k]
  ------------------
  135|  9.18M|            doc->warnings++;
  136|  9.18M|            break;
  137|      0|        case TidyConfig:
  ------------------
  |  Branch (137:9): [True: 0, False: 9.60M]
  ------------------
  138|      0|            doc->optionErrors++;
  139|      0|            break;
  140|      0|        case TidyAccess:
  ------------------
  |  Branch (140:9): [True: 0, False: 9.60M]
  ------------------
  141|      0|            doc->accessErrors++;
  142|      0|            break;
  143|   179k|        case TidyError:
  ------------------
  |  Branch (143:9): [True: 179k, False: 9.42M]
  ------------------
  144|   179k|            doc->errors++;
  145|   179k|            break;
  146|      0|        case TidyBadDocument:
  ------------------
  |  Branch (146:9): [True: 0, False: 9.60M]
  ------------------
  147|      0|            doc->docErrors++;
  148|      0|            break;
  149|      0|        case TidyFatal:
  ------------------
  |  Branch (149:9): [True: 0, False: 9.60M]
  ------------------
  150|       |            /* Ack! */
  151|      0|            break;
  152|  25.9k|        default:
  ------------------
  |  Branch (152:9): [True: 25.9k, False: 9.58M]
  ------------------
  153|  25.9k|            break;
  154|  9.60M|    }
  155|       |
  156|       |    /* Suppress report messages if they've been muted. */
  157|  9.60M|    go = go & !message->muted;
  158|       |
  159|       |    /* Suppress report messages if we've already reached the reporting limit. */
  160|  9.60M|    if ( message->level <= TidyFatal )
  ------------------
  |  Branch (160:10): [True: 9.58M, False: 25.9k]
  ------------------
  161|  9.58M|    {
  162|  9.58M|        go = go & ( doc->errors < cfg(doc, TidyShowErrors) );
  ------------------
  |  |  415|  9.58M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  163|  9.58M|    }
  164|       |
  165|       |    /* Let TidyQuiet silence a lot of things. */
  166|  9.60M|    if ( cfgBool( doc, TidyQuiet ) == yes )
  ------------------
  |  |  418|  9.60M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  9.60M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (166:10): [True: 0, False: 9.60M]
  ------------------
  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.60M|    if ( cfgBool( doc, TidyShowInfo ) == no )
  ------------------
  |  |  418|  9.60M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  9.60M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (179:10): [True: 0, False: 9.60M]
  ------------------
  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.60M|    if ( cfgBool( doc, TidyShowWarnings ) == no )
  ------------------
  |  |  418|  9.60M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  9.60M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (190:10): [True: 0, False: 9.60M]
  ------------------
  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.60M|    if ( go )
  ------------------
  |  Branch (196:10): [True: 4.24M, False: 5.35M]
  ------------------
  197|  4.24M|    {
  198|  4.24M|        TidyOutputSink *outp = &doc->errout->sink;
  199|  4.24M|        ctmbstr cp;
  200|  4.24M|        byte b = '\0';
  201|   326M|        for ( cp = message->messageOutput; *cp; ++cp )
  ------------------
  |  Branch (201:44): [True: 322M, False: 4.24M]
  ------------------
  202|   322M|        {
  203|   322M|            b = (*cp & 0xff);
  204|   322M|            if (b == (byte)'\n')
  ------------------
  |  Branch (204:17): [True: 55.5k, False: 322M]
  ------------------
  205|  55.5k|                TY_(WriteChar)( b, doc->errout );   /* for EOL translation */
  ------------------
  |  |   23|  55.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  206|   322M|            else
  207|   322M|                outp->putByte( outp->sinkData, b ); /* #383 - no encoding */
  208|   322M|        }
  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.24M|        TY_(WriteChar)( '\n', doc->errout );
  ------------------
  |  |   23|  4.24M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.24M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  214|  4.24M|    }
  215|       |
  216|  9.60M|    TY_(tidyMessageRelease)(message);
  ------------------
  |  |   23|  9.60M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.60M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  217|  9.60M|}

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

prvTidyInitParserStack:
  843|  20.6k|{
  844|  20.6k|    enum { default_size = 32 };
  845|  20.6k|    TidyParserMemory *content = (TidyParserMemory *) TidyAlloc( doc->allocator, sizeof(TidyParserMemory) * default_size );
  ------------------
  |  |   66|  20.6k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  846|       |
  847|  20.6k|    doc->stack.content = content;
  848|  20.6k|    doc->stack.size = default_size;
  849|  20.6k|    doc->stack.top = -1;
  850|  20.6k|}
prvTidyFreeParserStack:
  857|  20.6k|{
  858|  20.6k|    TidyFree( doc->allocator, doc->stack.content );
  ------------------
  |  |   68|  20.6k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  859|       |
  860|       |    doc->stack.content = NULL;
  861|  20.6k|    doc->stack.size = 0;
  862|  20.6k|    doc->stack.top = -1;
  863|  20.6k|}
prvTidyisEmptyParserStack:
  886|  5.05M|{
  887|  5.05M|    return doc->stack.top < 0;
  888|  5.05M|}
prvTidypeekMemoryIdentity:
  905|  2.52M|{
  906|  2.52M|    return doc->stack.content[doc->stack.top].identity;
  907|  2.52M|}
prvTidypeekMemoryMode:
  915|  21.4k|{
  916|  21.4k|    return doc->stack.content[doc->stack.top].mode;
  917|  21.4k|}
prvTidypopMemory:
  924|  2.52M|{
  925|  2.52M|    if ( !TY_(isEmptyParserStack)( doc ) )
  ------------------
  |  |   23|  2.52M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.52M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (925:10): [True: 2.52M, False: 0]
  ------------------
  926|  2.52M|    {
  927|  2.52M|        TidyParserMemory data = doc->stack.content[doc->stack.top];
  928|  2.52M|        DEBUG_LOG(SPRTF("\n"
  929|  2.52M|                        "<--POP  original: %s @ %p\n"
  930|  2.52M|                        "         reentry: %s @ %p\n"
  931|  2.52M|                        "     stack depth: %lu @ %p\n"
  932|  2.52M|                        "            mode: %u\n"
  933|  2.52M|                        "      register 1: %i\n"
  934|  2.52M|                        "      register 2: %i\n\n",
  935|  2.52M|                        data.original_node ? data.original_node->element : "none", data.original_node,
  936|  2.52M|                        data.reentry_node ? data.reentry_node->element : "none", data.reentry_node,
  937|  2.52M|                        doc->stack.top, &doc->stack.content[doc->stack.top],
  938|  2.52M|                        data.mode,
  939|  2.52M|                        data.register_1,
  940|  2.52M|                        data.register_2
  941|  2.52M|                        ));
  942|  2.52M|        doc->stack.top = doc->stack.top - 1;
  943|  2.52M|        return data;
  944|  2.52M|    }
  945|      0|    TidyParserMemory blank = { NULL };
  946|      0|    return blank;
  947|  2.52M|}
prvTidypushMemory:
  954|  2.69M|{
  955|  2.69M|    if ( doc->stack.top == doc->stack.size - 1 )
  ------------------
  |  Branch (955:10): [True: 4.24k, False: 2.69M]
  ------------------
  956|  4.24k|        growParserStack( doc );
  957|       |
  958|  2.69M|    doc->stack.top++;
  959|       |    
  960|  2.69M|    doc->stack.content[doc->stack.top] = data;
  961|  2.69M|    DEBUG_LOG(SPRTF("\n"
  962|  2.69M|                    "-->PUSH original: %s @ %p\n"
  963|  2.69M|                    "         reentry: %s @ %p\n"
  964|  2.69M|                    "     stack depth: %lu @ %p\n"
  965|  2.69M|                    "            mode: %u\n"
  966|  2.69M|                    "      register 1: %i\n"
  967|  2.69M|                    "      register 2: %i\n\n",
  968|  2.69M|                    data.original_node ? data.original_node->element : "none", data.original_node,
  969|  2.69M|                    data.reentry_node ? data.reentry_node->element : "none", data.reentry_node,
  970|  2.69M|                    doc->stack.top, &doc->stack.content[doc->stack.top],
  971|  2.69M|                    data.mode,
  972|  2.69M|                    data.register_1,
  973|  2.69M|                    data.register_2
  974|  2.69M|                    ));
  975|  2.69M|}
ParseHTMLWithNode:
 1064|  20.6k|{
 1065|  20.6k|    GetTokenMode mode = IgnoreWhitespace;
 1066|  20.6k|    Parser* parser = GetParserForNode( doc, node );
 1067|  20.6k|    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.24M|    while (something_to_do)
  ------------------
  |  Branch (1075:12): [True: 5.22M, False: 20.6k]
  ------------------
 1076|  5.22M|    {
 1077|  5.22M|        node = parser ? parser( doc, node, mode ) : NULL;
  ------------------
  |  Branch (1077:16): [True: 5.21M, False: 16.0k]
  ------------------
 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.22M|        if ( node )
  ------------------
  |  Branch (1083:14): [True: 2.69M, False: 2.52M]
  ------------------
 1084|  2.69M|        {
 1085|  2.69M|            parser = GetParserForNode( doc, node );
 1086|  2.69M|            continue;
 1087|  2.69M|        }
 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.52M|        if ( !TY_(isEmptyParserStack)(doc))
  ------------------
  |  |   23|  2.52M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.52M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1093:14): [True: 2.52M, False: 8.23k]
  ------------------
 1094|  2.52M|        {
 1095|  2.52M|            parser = TY_(peekMemoryIdentity)(doc);
  ------------------
  |  |   23|  2.52M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.52M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1096|  2.52M|            if (parser)
  ------------------
  |  Branch (1096:17): [True: 2.49M, False: 21.4k]
  ------------------
 1097|  2.49M|            {
 1098|  2.49M|                continue;
 1099|  2.49M|            }
 1100|  21.4k|            else
 1101|  21.4k|            {
 1102|       |                /* No parser means we're only passing back a parsing mode. */
 1103|  21.4k|                mode = TY_(peekMemoryMode)( doc );
  ------------------
  |  |   23|  21.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1104|  21.4k|                TY_(popMemory)( doc );
  ------------------
  |  |   23|  21.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1105|  21.4k|            }
 1106|  2.52M|        }
 1107|       |        
 1108|       |        /*
 1109|       |         At this point, there's nothing being returned from parsers, and
 1110|       |         nothing on the stack, so we can draw a new node from the lexer.
 1111|       |         */
 1112|  29.6k|        node = TY_(GetToken)( doc, mode );
  ------------------
  |  |   23|  29.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1113|  29.6k|        DEBUG_LOG_GOT_TOKEN(node);
 1114|       |
 1115|  29.6k|        if (node)
  ------------------
  |  Branch (1115:13): [True: 9.06k, False: 20.6k]
  ------------------
 1116|  9.06k|            parser = GetParserForNode( doc, node );
 1117|  20.6k|        else
 1118|  20.6k|            something_to_do = no;
 1119|  29.6k|    }
 1120|  20.6k|}
prvTidyParseBlock:
 1138|   357k|{
 1139|   357k|    Lexer* lexer = doc->lexer;
 1140|   357k|    Node *node = NULL;
 1141|   357k|    Bool checkstack = yes;
 1142|   357k|    uint istackbase = 0;
 1143|   357k|    DEBUG_LOG_COUNTERS;
 1144|       |    
 1145|   357k|    if ( element == NULL )
  ------------------
  |  Branch (1145:10): [True: 174k, False: 183k]
  ------------------
 1146|   174k|    {
 1147|   174k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|   174k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   174k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1148|   174k|        node = memory.reentry_node; /* Throwaway, because the loop overwrites this immediately. */
 1149|   174k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 1150|   174k|        element = memory.original_node;
 1151|   174k|        DEBUG_LOG_GET_OLD_MODE;
 1152|   174k|        mode = memory.reentry_mode;
 1153|   174k|        DEBUG_LOG_CHANGE_MODE;
 1154|   174k|    }
 1155|   183k|    else
 1156|   183k|    {
 1157|   183k|        DEBUG_LOG_ENTER_WITH_NODE(element);
 1158|       |
 1159|   183k|        if ( element->tag->model & CM_EMPTY )
  ------------------
  |  |  139|   183k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (1159:14): [True: 917, False: 182k]
  ------------------
 1160|    917|        {
 1161|    917|            DEBUG_LOG_EXIT;
 1162|    917|            return NULL;
 1163|    917|        }
 1164|       |
 1165|   182k|        if ( nodeIsDIV(element) && nodeIsDL(element->parent) && TY_(IsHTML5Mode)(doc) )
  ------------------
  |  |  429|   182k|#define nodeIsDIV( node )        TagIsId( node, TidyTag_DIV )
  |  |  ------------------
  |  |  |  |  275|   364k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 182k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 182k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.16k, False: 180k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsDIV(element) && nodeIsDL(element->parent) && TY_(IsHTML5Mode)(doc) )
  ------------------
  |  |  388|  1.16k|#define nodeIsDL( node )         TagIsId( node, TidyTag_DL )
  |  |  ------------------
  |  |  |  |  275|   183k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 961, False: 208]
  |  |  |  |  |  Branch (275:39): [True: 961, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 261, False: 700]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsDIV(element) && nodeIsDL(element->parent) && TY_(IsHTML5Mode)(doc) )
  ------------------
  |  |   23|    261|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    261|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1165:65): [True: 261, False: 0]
  ------------------
 1166|    261|        {
 1167|    261|            DEBUG_LOG_EXIT;
 1168|    261|            return TY_(ParseDefList)(doc, element, mode); /* @warning: possible recursion! */
  ------------------
  |  |   23|    261|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    261|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1169|    261|        }
 1170|       |        
 1171|   181k|        if ( nodeIsFORM(element) && DescendantOf(element, TidyTag_FORM) )
  ------------------
  |  |  424|   181k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|   363k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 181k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 181k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 9.38k, False: 172k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1171:37): [True: 8.13k, False: 1.25k]
  ------------------
 1172|  8.13k|        {
 1173|  8.13k|            TY_(Report)(doc, element, NULL, ILLEGAL_NESTING );
  ------------------
  |  |   23|  8.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1174|  8.13k|        }
 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|   181k|        if (element->tag->model & CM_OBJECT)
  ------------------
  |  |  150|   181k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1184:13): [True: 4.48k, False: 177k]
  ------------------
 1185|  4.48k|        {
 1186|  4.48k|            istackbase = lexer->istackbase;
 1187|  4.48k|            lexer->istackbase = lexer->istacksize;
 1188|  4.48k|        }
 1189|       |
 1190|   181k|        if (!(element->tag->model & CM_MIXED))
  ------------------
  |  |  156|   181k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (1190:13): [True: 175k, False: 6.62k]
  ------------------
 1191|   175k|        {
 1192|   175k|            TY_(InlineDup)( doc, NULL );
  ------------------
  |  |   23|   175k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   175k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1193|   175k|        }
 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|   181k|        if ( !(element->tag->model & CM_INLINE) ||
  ------------------
  |  |  143|   181k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1201:14): [True: 98.5k, False: 83.3k]
  ------------------
 1202|  83.3k|              (element->tag->model & CM_FIELD ) )
  ------------------
  |  |  149|  83.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 (1202:15): [True: 0, False: 83.3k]
  ------------------
 1203|  98.5k|        {
 1204|  98.5k|            DEBUG_LOG_GET_OLD_MODE;
 1205|  98.5k|            mode = IgnoreWhitespace;
 1206|  98.5k|            DEBUG_LOG_CHANGE_MODE;
 1207|  98.5k|        }
 1208|  83.3k|        else if (mode == IgnoreWhitespace)
  ------------------
  |  Branch (1208:18): [True: 83.3k, False: 0]
  ------------------
 1209|  83.3k|        {
 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|  83.3k|            DEBUG_LOG_GET_OLD_MODE;
 1214|  83.3k|            mode = MixedContent;
 1215|  83.3k|            DEBUG_LOG_CHANGE_MODE;
 1216|  83.3k|        }
 1217|   181k|    } /* Re-Entering */
 1218|       |    
 1219|       |    /*
 1220|       |     Main Loop
 1221|       |     */
 1222|       |    
 1223|   387k|    while ((node = TY_(GetToken)(doc, mode /*MixedContent*/)) != NULL)
  ------------------
  |  |   23|   387k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   387k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1223:12): [True: 248k, False: 139k]
  ------------------
 1224|   248k|    {
 1225|   248k|        DEBUG_LOG_GOT_TOKEN(node);
 1226|       |        /* end tag for this element */
 1227|   248k|        if (node->type == EndTag && node->tag &&
  ------------------
  |  Branch (1227:13): [True: 13.2k, False: 234k]
  |  Branch (1227:37): [True: 12.7k, False: 545]
  ------------------
 1228|  12.7k|            (node->tag == element->tag || element->was == node->tag))
  ------------------
  |  Branch (1228:14): [True: 3.65k, False: 9.05k]
  |  Branch (1228:43): [True: 0, False: 9.05k]
  ------------------
 1229|  3.65k|        {
 1230|  3.65k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  3.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1231|       |
 1232|  3.65k|            if (element->tag->model & CM_OBJECT)
  ------------------
  |  |  150|  3.65k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1232:17): [True: 1.15k, False: 2.49k]
  ------------------
 1233|  1.15k|            {
 1234|       |                /* pop inline stack */
 1235|  20.9k|                while (lexer->istacksize > lexer->istackbase)
  ------------------
  |  Branch (1235:24): [True: 19.8k, False: 1.15k]
  ------------------
 1236|  19.8k|                    TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|  19.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1237|  1.15k|                lexer->istackbase = istackbase;
 1238|  1.15k|            }
 1239|       |
 1240|  3.65k|            element->closed = yes;
 1241|  3.65k|            TrimSpaces( doc, element );
 1242|  3.65k|            DEBUG_LOG_EXIT;
 1243|  3.65k|            return NULL;
 1244|  3.65k|        }
 1245|       |
 1246|   244k|        if ( nodeIsHTML(node) || nodeIsHEAD(node) || nodeIsBODY(node) )
  ------------------
  |  |  370|   244k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   488k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 244k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 224k, False: 20.2k]
  |  |  |  |  |  Branch (275:54): [True: 209, False: 223k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsHTML(node) || nodeIsHEAD(node) || nodeIsBODY(node) )
  ------------------
  |  |  371|   244k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|   488k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 244k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 223k, False: 20.2k]
  |  |  |  |  |  Branch (275:54): [True: 451, False: 223k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsHTML(node) || nodeIsHEAD(node) || nodeIsBODY(node) )
  ------------------
  |  |  375|   243k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   243k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 243k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 223k, False: 20.2k]
  |  |  |  |  |  Branch (275:54): [True: 473, False: 223k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1247|  1.13k|        {
 1248|  1.13k|            if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1248:18): [True: 729, False: 404]
  ------------------
 1249|    729|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    729|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    729|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1250|  1.13k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  1.13k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1251|  1.13k|            continue;
 1252|  1.13k|        }
 1253|       |
 1254|       |
 1255|   243k|        if (node->type == EndTag)
  ------------------
  |  Branch (1255:13): [True: 9.19k, False: 234k]
  ------------------
 1256|  9.19k|        {
 1257|  9.19k|            if (node->tag == NULL)
  ------------------
  |  Branch (1257:17): [True: 545, False: 8.64k]
  ------------------
 1258|    545|            {
 1259|    545|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    545|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    545|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1260|    545|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    545|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    545|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1261|    545|                continue;
 1262|    545|            }
 1263|  8.64k|            else if ( nodeIsBR(node) )
  ------------------
  |  |  400|  8.64k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  8.64k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.64k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.64k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 198, False: 8.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1264|    198|            {
 1265|    198|                node->type = StartTag;
 1266|    198|            }
 1267|  8.45k|            else if ( nodeIsP(node) )
  ------------------
  |  |  385|  8.45k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  8.45k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.45k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.45k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 305, False: 8.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1268|    305|            {
 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|    305|                node->type = StartEndTag;
 1276|    305|                node->implicit = yes;
 1277|    305|            }
 1278|  8.14k|            else if (DescendantOf( element, node->tag->id ))
  ------------------
  |  Branch (1278:22): [True: 4.12k, False: 4.01k]
  ------------------
 1279|  4.12k|            {
 1280|       |                /*
 1281|       |                  if this is the end tag for an ancestor element
 1282|       |                  then infer end tag for this element
 1283|       |                */
 1284|  4.12k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  4.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1285|  4.12k|                break;
 1286|  4.12k|            }
 1287|  4.01k|            else
 1288|  4.01k|            {
 1289|       |                /* special case </tr> etc. for stuff moved in front of table */
 1290|  4.01k|                if ( lexer->exiled
  ------------------
  |  Branch (1290:22): [True: 1.84k, False: 2.17k]
  ------------------
 1291|  1.84k|                     && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |   23|  1.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  146|  1.84k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  393|  1.57k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  1.57k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.57k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.57k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 426, False: 1.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1291:26): [True: 275, False: 1.57k]
  ------------------
 1292|    701|                {
 1293|    701|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    701|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    701|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1294|    701|                    TrimSpaces( doc, element );
 1295|    701|                    DEBUG_LOG_EXIT;
 1296|    701|                    return NULL;
 1297|    701|                }
 1298|  4.01k|            }
 1299|  9.19k|        }
 1300|       |
 1301|       |        /* mixed content model permits text */
 1302|   237k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|   237k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   237k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1302:13): [True: 10.9k, False: 226k]
  ------------------
 1303|  10.9k|        {
 1304|  10.9k|            if ( checkstack )
  ------------------
  |  Branch (1304:18): [True: 7.99k, False: 2.99k]
  ------------------
 1305|  7.99k|            {
 1306|  7.99k|                checkstack = no;
 1307|  7.99k|                if (!(element->tag->model & CM_MIXED))
  ------------------
  |  |  156|  7.99k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (1307:21): [True: 6.56k, False: 1.43k]
  ------------------
 1308|  6.56k|                {
 1309|  6.56k|                    if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  6.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1309:26): [True: 973, False: 5.59k]
  ------------------
 1310|    973|                        continue;
 1311|  6.56k|                }
 1312|  7.99k|            }
 1313|       |
 1314|  10.0k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  10.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1315|  10.0k|            DEBUG_LOG_GET_OLD_MODE
 1316|  10.0k|            mode = MixedContent;
 1317|  10.0k|            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|  10.0k|            if ( nodeIsBODY(element)       ||
  ------------------
  |  |  375|  10.0k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  20.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 10.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 10.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1327|  10.0k|                 nodeIsMAP(element)        ||
  ------------------
  |  |  413|  10.0k|#define nodeIsMAP( node )        TagIsId( node, TidyTag_MAP )
  |  |  ------------------
  |  |  |  |  275|  20.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 10.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 765, False: 9.25k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1328|  10.0k|                 nodeIsBLOCKQUOTE(element) ||
  ------------------
  |  |  426|  9.25k|#define nodeIsBLOCKQUOTE( node ) TagIsId( node, TidyTag_BLOCKQUOTE )
  |  |  ------------------
  |  |  |  |  275|  19.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 9.25k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 9.25k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 741, False: 8.51k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1329|  10.0k|                 nodeIsFORM(element)       ||
  ------------------
  |  |  424|  8.51k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  18.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.51k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.51k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 330, False: 8.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1330|  8.18k|                 nodeIsNOSCRIPT(element) )
  ------------------
  |  |  423|  8.18k|#define nodeIsNOSCRIPT( node )   TagIsId( node, TidyTag_NOSCRIPT )
  |  |  ------------------
  |  |  |  |  275|  8.18k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.18k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.18k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 217, False: 7.96k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1331|  2.05k|                TY_(ConstrainVersion)( doc, ~VERS_HTML40_STRICT );
  ------------------
  |  |   23|  2.05k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.05k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ConstrainVersion)( doc, ~VERS_HTML40_STRICT );
  ------------------
  |  |  207|  2.05k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  2.05k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  2.05k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  2.05k|#define X10S                 256u
  |  |  ------------------
  ------------------
 1332|  10.0k|            continue;
 1333|  10.9k|        }
 1334|       |
 1335|   226k|        if ( InsertMisc(element, node) )
  ------------------
  |  Branch (1335:14): [True: 1.21k, False: 225k]
  ------------------
 1336|  1.21k|            continue;
 1337|       |
 1338|       |        /* allow PARAM elements? */
 1339|   225k|        if ( nodeIsPARAM(node) )
  ------------------
  |  |  409|   225k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|   225k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 225k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 218k, False: 7.53k]
  |  |  |  |  |  Branch (275:54): [True: 1.76k, False: 216k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1340|  1.76k|        {
 1341|  1.76k|            if ( TY_(nodeHasCM)(element, CM_PARAM) && TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.76k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.76k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if ( TY_(nodeHasCM)(element, CM_PARAM) && TY_(nodeIsElement)(node) )
  ------------------
  |  |  151|  1.76k|#define CM_PARAM        (1 << 12)  /**< Elements that allows "PARAM". */
  ------------------
                          if ( TY_(nodeHasCM)(element, CM_PARAM) && TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1341:18): [True: 1.56k, False: 207]
  |  Branch (1341:55): [True: 1.36k, False: 195]
  ------------------
 1342|  1.36k|            {
 1343|  1.36k|                TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1344|  1.36k|                continue;
 1345|  1.36k|            }
 1346|       |
 1347|       |            /* otherwise discard it */
 1348|    402|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    402|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    402|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1349|    402|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    402|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    402|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1350|    402|            continue;
 1351|  1.76k|        }
 1352|       |
 1353|       |        /* allow AREA elements? */
 1354|   223k|        if ( nodeIsAREA(node) )
  ------------------
  |  |  414|   223k|#define nodeIsAREA( node )       TagIsId( node, TidyTag_AREA )
  |  |  ------------------
  |  |  |  |  275|   223k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 223k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 216k, False: 7.53k]
  |  |  |  |  |  Branch (275:54): [True: 1.11k, False: 215k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1355|  1.11k|        {
 1356|  1.11k|            if ( nodeIsMAP(element) && TY_(nodeIsElement)(node) )
  ------------------
  |  |  413|  1.11k|#define nodeIsMAP( node )        TagIsId( node, TidyTag_MAP )
  |  |  ------------------
  |  |  |  |  275|  2.23k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.11k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.11k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 912, False: 205]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsMAP(element) && TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|    912|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    912|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1356:40): [True: 473, False: 439]
  ------------------
 1357|    473|            {
 1358|    473|                TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|    473|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    473|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1359|    473|                continue;
 1360|    473|            }
 1361|       |
 1362|       |            /* otherwise discard it */
 1363|    644|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    644|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    644|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1364|    644|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    644|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    644|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1365|    644|            continue;
 1366|  1.11k|        }
 1367|       |
 1368|       |        /* ignore unknown start/end tags */
 1369|   222k|        if ( node->tag == NULL )
  ------------------
  |  Branch (1369:14): [True: 7.53k, False: 215k]
  ------------------
 1370|  7.53k|        {
 1371|  7.53k|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  7.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1372|  7.53k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  7.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1373|  7.53k|            continue;
 1374|  7.53k|        }
 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|   215k|        if ( !TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|   215k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   215k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( !TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|   215k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1387:14): [True: 122k, False: 93.0k]
  ------------------
 1388|   122k|        {
 1389|   122k|            if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|   122k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   122k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1389:18): [True: 835, False: 121k]
  ------------------
 1390|    835|            {
 1391|    835|                if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    835|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    835|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 835, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 835, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 202, False: 633]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1392|    202|                    BadForm( doc );
 1393|       |
 1394|    835|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    835|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    835|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1395|    835|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    835|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    835|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1396|    835|                continue;
 1397|    835|            }
 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|   121k|            if ( nodeIsLI(element) )
  ------------------
  |  |  390|   121k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|   121k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 121k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 121k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 44.8k, False: 76.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1416|  44.8k|            {
 1417|  44.8k|                if ( nodeIsFRAME(node)    ||
  ------------------
  |  |  377|  44.8k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|  89.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 44.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 44.8k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 226, False: 44.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1418|  44.8k|                     nodeIsFRAMESET(node) ||
  ------------------
  |  |  376|  44.6k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  89.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 44.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 44.6k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 199, False: 44.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1419|  44.8k|                     nodeIsOPTGROUP(node) ||
  ------------------
  |  |  411|  44.4k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  89.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 44.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 44.4k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 247, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1420|  44.2k|                     nodeIsOPTION(node) )
  ------------------
  |  |  410|  44.2k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  44.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 44.2k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 44.2k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 206, False: 44.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1421|    878|                {
 1422|    878|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    878|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    878|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1423|    878|                    TY_(FreeNode)( doc, node );  /* DSR - 27Apr02 avoid memory leak */
  ------------------
  |  |   23|    878|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    878|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1424|    878|                    continue;
 1425|    878|                }
 1426|  44.8k|            }
 1427|       |
 1428|   120k|            if ( nodeIsTD(element) || nodeIsTH(element) )
  ------------------
  |  |  395|   120k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  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: 10.9k, False: 109k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsTD(element) || nodeIsTH(element) )
  ------------------
  |  |  396|   109k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|   109k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 109k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 109k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 9.31k, False: 100k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1429|  20.2k|            {
 1430|       |                /* if parent is a table cell, avoid inferring the end of the cell */
 1431|       |
 1432|  20.2k|                if ( TY_(nodeHasCM)(node, CM_HEAD) )
  ------------------
  |  |   23|  20.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_HEAD) )
  ------------------
  |  |  141|  20.2k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1432:22): [True: 301, False: 19.9k]
  ------------------
 1433|    301|                {
 1434|    301|                    MoveToHead( doc, element, node );
 1435|    301|                    continue;
 1436|    301|                }
 1437|       |
 1438|  19.9k|                if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |   23|  19.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |  144|  19.9k|#define CM_LIST         (1 << 5)   /**< Elements that mark list item ("LI"). */
  ------------------
  |  Branch (1438:22): [True: 220, False: 19.6k]
  ------------------
 1439|    220|                {
 1440|    220|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    220|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    220|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1441|    220|                    node = TY_(InferredTag)(doc, TidyTag_UL);
  ------------------
  |  |   23|    220|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    220|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1442|    220|                    AddClassNoIndent(doc, node);
 1443|    220|                    lexer->excludeBlocks = yes;
 1444|    220|                }
 1445|  19.6k|                else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |   23|  19.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |  145|  19.6k|#define CM_DEFLIST      (1 << 6)   /**< Elements that mark definition list item ("DL", "DT"). */
  ------------------
  |  Branch (1445:27): [True: 8.22k, False: 11.4k]
  ------------------
 1446|  8.22k|                {
 1447|  8.22k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  8.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1448|  8.22k|                    node = TY_(InferredTag)(doc, TidyTag_DL);
  ------------------
  |  |   23|  8.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1449|  8.22k|                    lexer->excludeBlocks = yes;
 1450|  8.22k|                }
 1451|       |
 1452|       |                /* infer end of current table cell */
 1453|  19.9k|                if ( !TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |   23|  19.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( !TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |  142|  19.9k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (1453:22): [True: 3.07k, False: 16.8k]
  ------------------
 1454|  3.07k|                {
 1455|  3.07k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  3.07k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.07k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1456|  3.07k|                    TrimSpaces( doc, element );
 1457|  3.07k|                    DEBUG_LOG_EXIT;
 1458|  3.07k|                    return NULL;
 1459|  3.07k|                }
 1460|  19.9k|            }
 1461|   100k|            else if ( TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |   23|   100k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   100k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |  142|   100k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (1461:23): [True: 60.4k, False: 39.9k]
  ------------------
 1462|  60.4k|            {
 1463|  60.4k|                if ( lexer->excludeBlocks )
  ------------------
  |  Branch (1463:22): [True: 2.78k, False: 57.6k]
  ------------------
 1464|  2.78k|                {
 1465|  2.78k|                    if ( !TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |   23|  2.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( !TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |  154|  2.78k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1465:26): [True: 1.36k, False: 1.42k]
  ------------------
 1466|  1.36k|                        TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1467|       |
 1468|  2.78k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1469|       |
 1470|  2.78k|                    if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |   23|  2.78k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.78k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |  150|  2.78k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1470:26): [True: 198, False: 2.59k]
  ------------------
 1471|    198|                        lexer->istackbase = istackbase;
 1472|       |
 1473|  2.78k|                    TrimSpaces( doc, element );
 1474|  2.78k|                    DEBUG_LOG_EXIT;
 1475|  2.78k|                    return NULL;
 1476|  2.78k|                }
 1477|  60.4k|            }
 1478|  39.9k|            else if ( ! nodeIsTEMPLATE( element ) )/* things like list items */
  ------------------
  |  |  466|  39.9k|#define nodeIsTEMPLATE( node )   TagIsId( node, TidyTag_TEMPLATE )
  |  |  ------------------
  |  |  |  |  275|  39.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 39.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 39.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 659, False: 39.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1479|  39.3k|            {
 1480|  39.3k|                if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  39.3k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1480:21): [True: 278, False: 39.0k]
  ------------------
 1481|    278|                {
 1482|    278|                    MoveToHead( doc, element, node );
 1483|    278|                    continue;
 1484|    278|                }
 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|  39.0k|                if ( nodeIsFORM(element) &&
  ------------------
  |  |  424|  39.0k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  78.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 39.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 39.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 8.15k, False: 30.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1492|  39.0k|                     nodeIsTD(element->parent) &&
  ------------------
  |  |  395|  8.15k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  47.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.58k, False: 564]
  |  |  |  |  |  Branch (275:39): [True: 7.58k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 6.35k, False: 1.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1493|  6.35k|                     element->parent->implicit )
  ------------------
  |  Branch (1493:22): [True: 6.13k, False: 224]
  ------------------
 1494|  6.13k|                {
 1495|  6.13k|                    if ( nodeIsTD(node) )
  ------------------
  |  |  395|  6.13k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  6.13k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.13k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.13k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 196, False: 5.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1496|    196|                    {
 1497|    196|                        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    196|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    196|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1498|    196|                        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    196|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    196|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1499|    196|                        continue;
 1500|    196|                    }
 1501|       |
 1502|  5.93k|                    if ( nodeIsTH(node) )
  ------------------
  |  |  396|  5.93k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  5.93k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.93k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.93k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 242, False: 5.69k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1503|    242|                    {
 1504|    242|                        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    242|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    242|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1505|    242|                        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    242|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    242|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1506|    242|                        node = element->parent;
 1507|    242|                        TidyDocFree(doc, node->element);
  ------------------
  |  |  159|    242|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|    242|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1508|    242|                        node->element = TY_(tmbstrdup)(doc->allocator, "th");
  ------------------
  |  |   23|    242|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    242|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1509|    242|                        node->tag = TY_(LookupTagDef)( TidyTag_TH );
  ------------------
  |  |   23|    242|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    242|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1510|    242|                        continue;
 1511|    242|                    }
 1512|  5.93k|                }
 1513|       |
 1514|  38.5k|                if ( !TY_(nodeHasCM)(element, CM_OPT) && !element->implicit )
  ------------------
  |  |   23|  38.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( !TY_(nodeHasCM)(element, CM_OPT) && !element->implicit )
  ------------------
  |  |  154|  38.5k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1514:22): [True: 23.8k, False: 14.7k]
  |  Branch (1514:58): [True: 23.5k, False: 328]
  ------------------
 1515|  23.5k|                    TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|  23.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  23.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1516|       |
 1517|       |                /* #521, warn on missing optional end-tags if not omitting them. */
 1518|  38.5k|                if ( cfgBool( doc, TidyOmitOptionalTags ) == no && TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |  418|  38.5k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  38.5k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                              if ( cfgBool( doc, TidyOmitOptionalTags ) == no && TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |   23|  38.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( cfgBool( doc, TidyOmitOptionalTags ) == no && TY_(nodeHasCM)(element, CM_OPT) )
  ------------------
  |  |  154|  38.5k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1518:22): [True: 38.5k, False: 0]
  |  Branch (1518:68): [True: 14.7k, False: 23.8k]
  ------------------
 1519|  14.7k|                    TY_(Report)(doc, element, node, MISSING_ENDTAG_OPTIONAL );
  ------------------
  |  |   23|  14.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1520|       |
 1521|       |
 1522|  38.5k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  38.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1523|       |
 1524|  38.5k|                if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |   23|  38.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_LIST) )
  ------------------
  |  |  144|  38.5k|#define CM_LIST         (1 << 5)   /**< Elements that mark list item ("LI"). */
  ------------------
  |  Branch (1524:22): [True: 3.07k, False: 35.5k]
  ------------------
 1525|  3.07k|                {
 1526|  3.07k|                    if ( element->parent && element->parent->tag &&
  ------------------
  |  Branch (1526:26): [True: 2.87k, False: 200]
  |  Branch (1526:45): [True: 2.87k, False: 0]
  ------------------
 1527|  2.87k|                         element->parent->tag->parser == TY_(ParseList) )
  ------------------
  |  |   23|  2.87k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.87k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1527:26): [True: 1.79k, False: 1.08k]
  ------------------
 1528|  1.79k|                    {
 1529|  1.79k|                        TrimSpaces( doc, element );
 1530|  1.79k|                        DEBUG_LOG_EXIT;
 1531|  1.79k|                        return NULL;
 1532|  1.79k|                    }
 1533|       |
 1534|  1.28k|                    node = TY_(InferredTag)(doc, TidyTag_UL);
  ------------------
  |  |   23|  1.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1535|  1.28k|                    AddClassNoIndent(doc, node);
 1536|  1.28k|                }
 1537|  35.5k|                else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |   23|  35.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_DEFLIST) )
  ------------------
  |  |  145|  35.5k|#define CM_DEFLIST      (1 << 6)   /**< Elements that mark definition list item ("DL", "DT"). */
  ------------------
  |  Branch (1537:27): [True: 2.11k, False: 33.4k]
  ------------------
 1538|  2.11k|                {
 1539|  2.11k|                    if ( nodeIsDL(element->parent) )
  ------------------
  |  |  388|  2.11k|#define nodeIsDL( node )         TagIsId( node, TidyTag_DL )
  |  |  ------------------
  |  |  |  |  275|  2.11k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.82k, False: 292]
  |  |  |  |  |  Branch (275:39): [True: 1.82k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 627, False: 1.19k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1540|    627|                    {
 1541|    627|                        TrimSpaces( doc, element );
 1542|    627|                        DEBUG_LOG_EXIT;
 1543|    627|                        return NULL;
 1544|    627|                    }
 1545|       |
 1546|  1.48k|                    node = TY_(InferredTag)(doc, TidyTag_DL);
  ------------------
  |  |   23|  1.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1547|  1.48k|                }
 1548|  33.4k|                else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |   23|  33.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  33.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |  146|  33.4k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |   23|  14.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_TABLE) || TY_(nodeHasCM)(node, CM_ROW) )
  ------------------
  |  |  148|  14.0k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (1548:27): [True: 19.3k, False: 14.0k]
  |  Branch (1548:61): [True: 8.83k, False: 5.22k]
  ------------------
 1549|  28.1k|                {
 1550|       |                    /* http://tidy.sf.net/issue/1316307 */
 1551|       |                    /* In exiled mode, return so table processing can
 1552|       |                       continue. */
 1553|  28.1k|                    if (lexer->exiled)
  ------------------
  |  Branch (1553:25): [True: 2.62k, False: 25.5k]
  ------------------
 1554|  2.62k|                    {
 1555|  2.62k|                        DEBUG_LOG_EXIT;
 1556|  2.62k|                        return NULL;
 1557|  2.62k|                    }
 1558|  25.5k|                    node = TY_(InferredTag)(doc, TidyTag_TABLE);
  ------------------
  |  |   23|  25.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  25.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1559|  25.5k|                }
 1560|  5.22k|                else if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |   23|  5.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(element, CM_OBJECT) )
  ------------------
  |  |  150|  5.22k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1560:27): [True: 1.46k, False: 3.76k]
  ------------------
 1561|  1.46k|                {
 1562|       |                    /* pop inline stack */
 1563|  2.17k|                    while ( lexer->istacksize > lexer->istackbase )
  ------------------
  |  Branch (1563:29): [True: 710, False: 1.46k]
  ------------------
 1564|    710|                        TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|    710|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    710|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1565|  1.46k|                    lexer->istackbase = istackbase;
 1566|  1.46k|                    TrimSpaces( doc, element );
 1567|  1.46k|                    DEBUG_LOG_EXIT;
 1568|  1.46k|                    return NULL;
 1569|       |
 1570|  1.46k|                }
 1571|  3.76k|                else
 1572|  3.76k|                {
 1573|  3.76k|                    TrimSpaces( doc, element );
 1574|  3.76k|                    DEBUG_LOG_EXIT;
 1575|  3.76k|                    return NULL;
 1576|  3.76k|                }
 1577|  38.5k|            }
 1578|   120k|        }
 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|   196k|        if ( nodeIsA(node) && !node->implicit &&
  ------------------
  |  |  401|   196k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|   392k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 196k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 196k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 11.0k, False: 185k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1587:31): [True: 7.79k, False: 3.27k]
  ------------------
 1588|  7.79k|             (nodeIsA(element) || DescendantOf(element, TidyTag_A)) )
  ------------------
  |  |  401|  7.79k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  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: 4.08k, False: 3.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1588:35): [True: 1.83k, False: 1.87k]
  ------------------
 1589|  5.91k|        {
 1590|  5.91k|            if (node->type != EndTag && node->attributes == NULL
  ------------------
  |  Branch (1590:17): [True: 5.91k, False: 0]
  |  Branch (1590:41): [True: 2.53k, False: 3.37k]
  ------------------
 1591|  2.53k|                && cfgBool(doc, TidyCoerceEndTags) )
  ------------------
  |  |  418|  2.53k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.53k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 2.53k, False: 0]
  |  |  ------------------
  ------------------
 1592|  2.53k|            {
 1593|  2.53k|                node->type = EndTag;
 1594|  2.53k|                TY_(Report)(doc, element, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|  2.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1595|  2.53k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1596|  2.53k|                continue;
 1597|  2.53k|            }
 1598|       |
 1599|  3.37k|            if (nodeIsA(element))
  ------------------
  |  |  401|  3.37k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  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: 2.94k, False: 432]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1600|  2.94k|            {
 1601|  2.94k|                TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  2.94k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.94k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1602|  2.94k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.94k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.94k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1603|  2.94k|            }
 1604|    432|            else
 1605|    432|            {
 1606|       |                /* Issue #597 - if we not 'UngetToken' then it is being discarded.
 1607|       |                   Add message, and 'FreeNode' - thanks @ralfjunker */
 1608|    432|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    432|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    432|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1609|    432|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    432|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    432|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1610|    432|            }
 1611|       |
 1612|  3.37k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (1612:17): [True: 3.37k, False: 0]
  ------------------
 1613|  3.37k|                TrimSpaces(doc, element);
 1614|       |
 1615|  3.37k|            DEBUG_LOG_EXIT;
 1616|  3.37k|            return NULL;
 1617|  5.91k|        }
 1618|       |
 1619|       |        /* parse known element */
 1620|   190k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|   190k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   190k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1620:13): [True: 188k, False: 1.77k]
  ------------------
 1621|   188k|        {
 1622|   188k|            if (node->tag->model & CM_INLINE)
  ------------------
  |  |  143|   188k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1622:17): [True: 85.3k, False: 103k]
  ------------------
 1623|  85.3k|            {
 1624|  85.3k|                if (checkstack && !node->implicit)
  ------------------
  |  Branch (1624:21): [True: 82.4k, False: 2.86k]
  |  Branch (1624:35): [True: 7.85k, False: 74.5k]
  ------------------
 1625|  7.85k|                {
 1626|  7.85k|                    checkstack = no;
 1627|       |
 1628|  7.85k|                    if (!(element->tag->model & CM_MIXED)) /* #431731 - fix by Randy Waki 25 Dec 00 */
  ------------------
  |  |  156|  7.85k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (1628:25): [True: 6.97k, False: 879]
  ------------------
 1629|  6.97k|                    {
 1630|  6.97k|                        if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  6.97k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.97k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1630:30): [True: 627, False: 6.34k]
  ------------------
 1631|    627|                            continue;
 1632|  6.97k|                    }
 1633|  7.85k|                }
 1634|       |
 1635|  84.6k|                DEBUG_LOG_GET_OLD_MODE;
 1636|  84.6k|                mode = MixedContent;
 1637|  84.6k|                DEBUG_LOG_CHANGE_MODE;
 1638|  84.6k|            }
 1639|   103k|            else
 1640|   103k|            {
 1641|   103k|                checkstack = yes;
 1642|   103k|                DEBUG_LOG_GET_OLD_MODE;
 1643|   103k|                mode = IgnoreWhitespace;
 1644|   103k|                DEBUG_LOG_CHANGE_MODE;
 1645|   103k|            }
 1646|       |
 1647|       |            /* trim white space before <br> */
 1648|   188k|            if ( nodeIsBR(node) )
  ------------------
  |  |  400|   188k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   188k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 188k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 188k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 621, False: 187k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1649|    621|                TrimSpaces( doc, element );
 1650|       |
 1651|   188k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|   188k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   188k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1652|       |
 1653|   188k|            if (node->implicit)
  ------------------
  |  Branch (1653:17): [True: 113k, False: 74.8k]
  ------------------
 1654|   113k|                TY_(Report)(doc, element, node, INSERTING_TAG );
  ------------------
  |  |   23|   113k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   113k|#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|   188k|            {
 1661|   188k|                TidyParserMemory memory = {0};
 1662|   188k|                memory.identity = TY_(ParseBlock);
  ------------------
  |  |   23|   188k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   188k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1663|   188k|                memory.reentry_node = node;
 1664|   188k|                memory.reentry_mode = mode;
 1665|   188k|                memory.original_node = element;
 1666|   188k|                TY_(pushMemory)(doc, memory);
  ------------------
  |  |   23|   188k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   188k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1667|   188k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 1668|   188k|            }
 1669|   188k|            return node;
 1670|   188k|        }
 1671|       |
 1672|       |        /* discard unexpected tags */
 1673|  1.77k|        if (node->type == EndTag)
  ------------------
  |  Branch (1673:13): [True: 1.77k, False: 0]
  ------------------
 1674|  1.77k|            TY_(PopInline)( doc, node );  /* if inline end tag */
  ------------------
  |  |   23|  1.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1675|       |
 1676|  1.77k|        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  1.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1677|  1.77k|        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  1.77k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.77k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1678|  1.77k|        continue;
 1679|   190k|    }
 1680|       |
 1681|   143k|    if (!(element->tag->model & CM_OPT))
  ------------------
  |  |  154|   143k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (1681:9): [True: 90.5k, False: 53.4k]
  ------------------
 1682|  90.5k|        TY_(Report)(doc, element, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  90.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  90.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1683|       |
 1684|   143k|    if (element->tag->model & CM_OBJECT)
  ------------------
  |  |  150|   143k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1684:9): [True: 1.63k, False: 142k]
  ------------------
 1685|  1.63k|    {
 1686|       |        /* pop inline stack */
 1687|  3.07k|        while ( lexer->istacksize > lexer->istackbase )
  ------------------
  |  Branch (1687:17): [True: 1.43k, False: 1.63k]
  ------------------
 1688|  1.43k|            TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|  1.43k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.43k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1689|  1.63k|        lexer->istackbase = istackbase;
 1690|  1.63k|    }
 1691|       |
 1692|   143k|    TrimSpaces( doc, element );
 1693|       |
 1694|   143k|    DEBUG_LOG_EXIT;
 1695|       |    return NULL;
 1696|   355k|}
prvTidyParseBody:
 1708|   199k|{
 1709|   199k|    Lexer* lexer = doc->lexer;
 1710|   199k|    Node *node = NULL;
 1711|   199k|    Bool checkstack = no;
 1712|   199k|    Bool iswhitenode = no;
 1713|   199k|    DEBUG_LOG_COUNTERS;
 1714|       |
 1715|   199k|    mode = IgnoreWhitespace;
 1716|   199k|    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|   199k|    if ( body == NULL )
  ------------------
  |  Branch (1723:10): [True: 139k, False: 60.4k]
  ------------------
 1724|   139k|    {
 1725|   139k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|   139k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   139k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1726|   139k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 1727|   139k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 1728|   139k|        body = memory.original_node;
 1729|   139k|        checkstack = memory.register_1;
 1730|   139k|        iswhitenode = memory.register_2;
 1731|   139k|        DEBUG_LOG_GET_OLD_MODE;
 1732|   139k|        mode = memory.mode;
 1733|   139k|        DEBUG_LOG_CHANGE_MODE;
 1734|   139k|    }
 1735|  60.4k|    else
 1736|  60.4k|    {
 1737|  60.4k|        DEBUG_LOG_ENTER_WITH_NODE(body);
 1738|  60.4k|        TY_(BumpObject)( doc, body->parent );
  ------------------
  |  |   23|  60.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1739|  60.4k|    }
 1740|       |    
 1741|   410k|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|   410k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   410k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1741:12): [True: 379k, False: 31.0k]
  ------------------
 1742|   379k|    {
 1743|   379k|        DEBUG_LOG_GOT_TOKEN(node);
 1744|       |        /* find and discard multiple <body> elements */
 1745|   379k|        if (node->tag == body->tag && node->type == StartTag)
  ------------------
  |  Branch (1745:13): [True: 6.85k, False: 372k]
  |  Branch (1745:39): [True: 2.04k, False: 4.80k]
  ------------------
 1746|  2.04k|        {
 1747|  2.04k|            TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1748|  2.04k|            TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  2.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1749|  2.04k|            continue;
 1750|  2.04k|        }
 1751|       |
 1752|       |        /* #538536 Extra endtags not detected */
 1753|   377k|        if ( nodeIsHTML(node) )
  ------------------
  |  |  370|   377k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   377k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 377k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 178k, False: 199k]
  |  |  |  |  |  Branch (275:54): [True: 796, False: 177k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1754|    796|        {
 1755|    796|            if (TY_(nodeIsElement)(node) || lexer->seenEndHtml)
  ------------------
  |  |   23|    796|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    796|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1755:17): [True: 502, False: 294]
  |  Branch (1755:45): [True: 262, False: 32]
  ------------------
 1756|    764|                TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    764|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    764|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1757|     32|            else
 1758|     32|                lexer->seenEndHtml = 1;
 1759|       |
 1760|    796|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    796|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    796|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1761|    796|            continue;
 1762|    796|        }
 1763|       |
 1764|   376k|        if ( lexer->seenEndBody &&
  ------------------
  |  Branch (1764:14): [True: 4.97k, False: 371k]
  ------------------
 1765|  4.97k|             ( node->type == StartTag ||
  ------------------
  |  Branch (1765:16): [True: 1.31k, False: 3.65k]
  ------------------
 1766|  3.65k|               node->type == EndTag   ||
  ------------------
  |  Branch (1766:16): [True: 2.66k, False: 997]
  ------------------
 1767|    997|               node->type == StartEndTag ) )
  ------------------
  |  Branch (1767:16): [True: 301, False: 696]
  ------------------
 1768|  4.27k|        {
 1769|  4.27k|            TY_(Report)(doc, body, node, CONTENT_AFTER_BODY );
  ------------------
  |  |   23|  4.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1770|  4.27k|        }
 1771|       |
 1772|   376k|        if ( node->tag == body->tag && node->type == EndTag )
  ------------------
  |  Branch (1772:14): [True: 4.80k, False: 371k]
  |  Branch (1772:40): [True: 2.63k, False: 2.17k]
  ------------------
 1773|  2.63k|        {
 1774|  2.63k|            body->closed = yes;
 1775|  2.63k|            TrimSpaces(doc, body);
 1776|  2.63k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1777|  2.63k|            lexer->seenEndBody = 1;
 1778|  2.63k|            DEBUG_LOG_GET_OLD_MODE;
 1779|  2.63k|            mode = IgnoreWhitespace;
 1780|  2.63k|            DEBUG_LOG_CHANGE_MODE;
 1781|       |
 1782|  2.63k|            if ( nodeIsNOFRAMES(body->parent) )
  ------------------
  |  |  379|  2.63k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  2.63k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.42k, False: 205]
  |  |  |  |  |  Branch (275:39): [True: 2.42k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.77k, False: 655]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1783|  1.77k|                break;
 1784|       |
 1785|    860|            continue;
 1786|  2.63k|        }
 1787|       |
 1788|   373k|        if ( nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|   373k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|   373k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 373k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 174k, False: 199k]
  |  |  |  |  |  Branch (275:54): [True: 8.87k, False: 165k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1789|  8.87k|        {
 1790|  8.87k|            if (node->type == StartTag)
  ------------------
  |  Branch (1790:17): [True: 8.02k, False: 857]
  ------------------
 1791|  8.02k|            {
 1792|  8.02k|                TidyParserMemory memory = {0};
 1793|       |
 1794|  8.02k|                TY_(InsertNodeAtEnd)(body, node);
  ------------------
  |  |   23|  8.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1795|       |                
 1796|  8.02k|                memory.identity = TY_(ParseBody);
  ------------------
  |  |   23|  8.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1797|  8.02k|                memory.original_node = body;
 1798|  8.02k|                memory.reentry_node = node;
 1799|  8.02k|                memory.register_1 = checkstack;
 1800|  8.02k|                memory.register_2 = iswhitenode;
 1801|  8.02k|                memory.mode = mode;
 1802|  8.02k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  8.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1803|  8.02k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 1804|  8.02k|                return node;
 1805|  8.02k|            }
 1806|       |
 1807|    857|            if (node->type == EndTag && nodeIsNOFRAMES(body->parent) )
  ------------------
  |  |  379|    600|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|    600|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 399, False: 201]
  |  |  |  |  |  Branch (275:39): [True: 399, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 203, False: 196]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1807:17): [True: 600, False: 257]
  ------------------
 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|    857|        }
 1814|       |
 1815|   365k|        if ( (nodeIsFRAME(node) || nodeIsFRAMESET(node))
  ------------------
  |  |  377|   365k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|   731k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 365k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 166k, False: 199k]
  |  |  |  |  |  Branch (275:54): [True: 2.65k, False: 163k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( (nodeIsFRAME(node) || nodeIsFRAMESET(node))
  ------------------
  |  |  376|   362k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|   362k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 362k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 163k, False: 199k]
  |  |  |  |  |  Branch (275:54): [True: 1.25k, False: 162k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1816|  3.91k|             && nodeIsNOFRAMES(body->parent) )
  ------------------
  |  |  379|  3.91k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  3.91k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.68k, False: 223]
  |  |  |  |  |  Branch (275:39): [True: 3.68k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 938, False: 2.74k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1817|    938|        {
 1818|    938|            TrimSpaces(doc, body);
 1819|    938|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    938|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    938|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1820|    938|            break;
 1821|    938|        }
 1822|       |
 1823|   364k|        iswhitenode = no;
 1824|       |
 1825|   364k|        if ( TY_(nodeIsText)(node) &&
  ------------------
  |  |   23|   364k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   364k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1825:14): [True: 42.3k, False: 322k]
  ------------------
 1826|  42.3k|             node->end <= node->start + 1 &&
  ------------------
  |  Branch (1826:14): [True: 14.3k, False: 27.9k]
  ------------------
 1827|  14.3k|             lexer->lexbuf[node->start] == ' ' )
  ------------------
  |  Branch (1827:14): [True: 1.17k, False: 13.1k]
  ------------------
 1828|  1.17k|            iswhitenode = yes;
 1829|       |
 1830|       |        /* deal with comments etc. */
 1831|   364k|        if (InsertMisc(body, node))
  ------------------
  |  Branch (1831:13): [True: 80.1k, False: 284k]
  ------------------
 1832|  80.1k|            continue;
 1833|       |
 1834|       |        /* mixed content model permits text */
 1835|   284k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|   284k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   284k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1835:13): [True: 42.3k, False: 242k]
  ------------------
 1836|  42.3k|        {
 1837|  42.3k|            if (iswhitenode && mode == IgnoreWhitespace)
  ------------------
  |  Branch (1837:17): [True: 1.17k, False: 41.1k]
  |  Branch (1837:32): [True: 246, False: 925]
  ------------------
 1838|    246|            {
 1839|    246|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    246|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    246|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1840|    246|                continue;
 1841|    246|            }
 1842|       |
 1843|       |            /* HTML 2 and HTML4 strict don't allow text here */
 1844|  42.0k|            TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT | VERS_HTML20));
  ------------------
  |  |   23|  42.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT | VERS_HTML20));
  ------------------
  |  |  207|  42.0k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  42.0k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  42.0k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  42.0k|#define X10S                 256u
  |  |  ------------------
  ------------------
                          TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT | VERS_HTML20));
  ------------------
  |  |  205|  42.0k|#define VERS_HTML20        (HT20)
  |  |  ------------------
  |  |  |  |  177|  42.0k|#define HT20                   1u
  |  |  ------------------
  ------------------
 1845|       |
 1846|  42.0k|            if (checkstack)
  ------------------
  |  Branch (1846:17): [True: 15.3k, False: 26.7k]
  ------------------
 1847|  15.3k|            {
 1848|  15.3k|                checkstack = no;
 1849|       |
 1850|  15.3k|                if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  15.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1850:22): [True: 1.77k, False: 13.5k]
  ------------------
 1851|  1.77k|                    continue;
 1852|  15.3k|            }
 1853|       |
 1854|  40.2k|            TY_(InsertNodeAtEnd)(body, node);
  ------------------
  |  |   23|  40.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  40.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1855|  40.2k|            DEBUG_LOG_GET_OLD_MODE;
 1856|  40.2k|            mode = MixedContent;
 1857|  40.2k|            DEBUG_LOG_CHANGE_MODE;
 1858|  40.2k|            continue;
 1859|  42.0k|        }
 1860|       |
 1861|   242k|        if (node->type == DocTypeTag)
  ------------------
  |  Branch (1861:13): [True: 3.59k, False: 238k]
  ------------------
 1862|  3.59k|        {
 1863|  3.59k|            InsertDocType(doc, body, node);
 1864|  3.59k|            continue;
 1865|  3.59k|        }
 1866|       |        /* discard unknown  and PARAM tags */
 1867|   238k|        if ( node->tag == NULL || nodeIsPARAM(node) )
  ------------------
  |  |  409|   165k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|   165k|#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: 267, False: 165k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1867:14): [True: 73.0k, False: 165k]
  ------------------
 1868|  73.2k|        {
 1869|  73.2k|            TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  73.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1870|  73.2k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  73.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1871|  73.2k|            continue;
 1872|  73.2k|        }
 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|   165k|        lexer->excludeBlocks = no;
 1881|       |
 1882|   165k|        if ((( nodeIsINPUT(node) ||
  ------------------
  |  |  431|   165k|#define nodeIsINPUT( node )      TagIsId( node, TidyTag_INPUT )
  |  |  ------------------
  |  |  |  |  275|   330k|#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: 743, False: 164k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1883|   164k|             (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |   23|   164k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   164k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |  142|   164k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                           (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |   23|  46.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  46.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           (!TY_(nodeHasCM)(node, CM_BLOCK) && !TY_(nodeHasCM)(node, CM_INLINE))
  ------------------
  |  |  143|  46.7k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1883:15): [True: 46.7k, False: 117k]
  |  Branch (1883:50): [True: 27.4k, False: 19.3k]
  ------------------
 1884|   165k|           ) && !TY_(IsHTML5Mode)(doc)) || nodeIsLI(node) )
  ------------------
  |  |   23|  28.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                         ) && !TY_(IsHTML5Mode)(doc)) || nodeIsLI(node) )
  ------------------
  |  |  390|   160k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|   160k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 160k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 160k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 582, False: 160k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1884:17): [True: 4.61k, False: 23.5k]
  ------------------
 1885|  5.19k|        {
 1886|       |            /* avoid this error message being issued twice */
 1887|  5.19k|            if (!(node->tag->model & CM_HEAD))
  ------------------
  |  |  141|  5.19k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1887:17): [True: 4.72k, False: 469]
  ------------------
 1888|  4.72k|                TY_(Report)(doc, body, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  4.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1889|       |
 1890|  5.19k|            if (node->tag->model & CM_HTML)
  ------------------
  |  |  140|  5.19k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
  |  Branch (1890:17): [True: 1.18k, False: 4.01k]
  ------------------
 1891|  1.18k|            {
 1892|       |                /* copy body attributes if current body was inferred */
 1893|  1.18k|                if ( nodeIsBODY(node) && body->implicit
  ------------------
  |  |  375|  1.18k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  2.36k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.18k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.18k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 592, False: 590]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1893:42): [True: 398, False: 194]
  ------------------
 1894|    398|                     && body->attributes == NULL )
  ------------------
  |  Branch (1894:25): [True: 204, False: 194]
  ------------------
 1895|    204|                {
 1896|    204|                    body->attributes = node->attributes;
 1897|    204|                    node->attributes = NULL;
 1898|    204|                }
 1899|       |
 1900|  1.18k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1901|  1.18k|                continue;
 1902|  1.18k|            }
 1903|       |
 1904|  4.01k|            if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  4.01k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (1904:17): [True: 469, False: 3.54k]
  ------------------
 1905|    469|            {
 1906|    469|                MoveToHead(doc, body, node);
 1907|    469|                continue;
 1908|    469|            }
 1909|       |
 1910|  3.54k|            if (node->tag->model & CM_LIST)
  ------------------
  |  |  144|  3.54k|#define CM_LIST         (1 << 5)   /**< Elements that mark list item ("LI"). */
  ------------------
  |  Branch (1910:17): [True: 731, False: 2.81k]
  ------------------
 1911|    731|            {
 1912|    731|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    731|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    731|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1913|    731|                node = TY_(InferredTag)(doc, TidyTag_UL);
  ------------------
  |  |   23|    731|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    731|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1914|    731|                AddClassNoIndent(doc, node);
 1915|    731|                lexer->excludeBlocks = yes;
 1916|    731|            }
 1917|  2.81k|            else if (node->tag->model & CM_DEFLIST)
  ------------------
  |  |  145|  2.81k|#define CM_DEFLIST      (1 << 6)   /**< Elements that mark definition list item ("DL", "DT"). */
  ------------------
  |  Branch (1917:22): [True: 682, False: 2.13k]
  ------------------
 1918|    682|            {
 1919|    682|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    682|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    682|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1920|    682|                node = TY_(InferredTag)(doc, TidyTag_DL);
  ------------------
  |  |   23|    682|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    682|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1921|    682|                lexer->excludeBlocks = yes;
 1922|    682|            }
 1923|  2.13k|            else if (node->tag->model & (CM_TABLE | CM_ROWGRP | CM_ROW))
  ------------------
  |  |  146|  2.13k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                          else if (node->tag->model & (CM_TABLE | CM_ROWGRP | CM_ROW))
  ------------------
  |  |  147|  2.13k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
                          else if (node->tag->model & (CM_TABLE | CM_ROWGRP | CM_ROW))
  ------------------
  |  |  148|  2.13k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (1923:22): [True: 932, False: 1.19k]
  ------------------
 1924|    932|            {
 1925|       |                /* http://tidy.sf.net/issue/2855621 */
 1926|    932|                if (node->type != EndTag) {
  ------------------
  |  Branch (1926:21): [True: 716, False: 216]
  ------------------
 1927|    716|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    716|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    716|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1928|    716|                    node = TY_(InferredTag)(doc, TidyTag_TABLE);
  ------------------
  |  |   23|    716|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    716|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1929|    716|                }
 1930|    932|                lexer->excludeBlocks = yes;
 1931|    932|            }
 1932|  1.19k|            else if ( nodeIsINPUT(node) )
  ------------------
  |  |  431|  1.19k|#define nodeIsINPUT( node )      TagIsId( node, TidyTag_INPUT )
  |  |  ------------------
  |  |  |  |  275|  1.19k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.19k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.19k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 334, False: 864]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1933|    334|            {
 1934|    334|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    334|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    334|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1935|    334|                node = TY_(InferredTag)(doc, TidyTag_FORM);
  ------------------
  |  |   23|    334|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    334|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1936|    334|                lexer->excludeBlocks = yes;
 1937|    334|            }
 1938|    864|            else
 1939|    864|            {
 1940|    864|                if ( !TY_(nodeHasCM)(node, CM_ROW | CM_FIELD) )
  ------------------
  |  |   23|    864|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    864|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( !TY_(nodeHasCM)(node, CM_ROW | CM_FIELD) )
  ------------------
  |  |  148|    864|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
                              if ( !TY_(nodeHasCM)(node, CM_ROW | CM_FIELD) )
  ------------------
  |  |  149|    864|#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: 656, False: 208]
  ------------------
 1941|    656|                {
 1942|    656|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    656|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    656|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1943|    656|                    DEBUG_LOG_EXIT;
 1944|    656|                    return NULL;
 1945|    656|                }
 1946|       |
 1947|       |                /* ignore </td> </th> <option> etc. */
 1948|    208|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    208|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    208|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1949|    208|                continue;
 1950|    864|            }
 1951|  3.54k|        }
 1952|       |
 1953|   162k|        if (node->type == EndTag)
  ------------------
  |  Branch (1953:13): [True: 5.95k, False: 156k]
  ------------------
 1954|  5.95k|        {
 1955|  5.95k|            if ( nodeIsBR(node) )
  ------------------
  |  |  400|  5.95k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  5.95k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.95k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.95k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 332, False: 5.62k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1956|    332|            {
 1957|    332|                node->type = StartTag;
 1958|    332|            }
 1959|  5.62k|            else if ( nodeIsP(node) )
  ------------------
  |  |  385|  5.62k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  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: 1.09k, False: 4.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1960|  1.09k|            {
 1961|  1.09k|                node->type = StartEndTag;
 1962|  1.09k|                node->implicit = yes;
 1963|  1.09k|            }
 1964|  4.53k|            else if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|  4.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|  4.53k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1964:23): [True: 2.42k, False: 2.10k]
  ------------------
 1965|  2.42k|                TY_(PopInline)( doc, node );
  ------------------
  |  |   23|  2.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1966|  5.95k|        }
 1967|       |
 1968|   162k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|   162k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   162k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1968:13): [True: 158k, False: 4.53k]
  ------------------
 1969|   158k|        {
 1970|   158k|            if (nodeIsMAIN(node))
  ------------------
  |  |  452|   158k|#define nodeIsMAIN( node )       TagIsId( node, TidyTag_MAIN )
  |  |  ------------------
  |  |  |  |  275|   158k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 158k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 158k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 453, False: 157k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1971|    453|            {
 1972|       |                /*\ Issue #166 - repeated <main> element
 1973|       |                 *  How to efficiently search for a previous main element?
 1974|       |                \*/
 1975|    453|                if ( findNodeById(doc, TidyTag_MAIN) )
  ------------------
  |  Branch (1975:22): [True: 386, False: 67]
  ------------------
 1976|    386|                {
 1977|    386|                    doc->badForm |= flg_BadMain; /* this is an ERROR in format */
  ------------------
  |  |   35|    386|#define flg_BadMain     0x00000002
  ------------------
 1978|    386|                    TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    386|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    386|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1979|    386|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    386|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    386|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1980|    386|                    continue;
 1981|    386|                }
 1982|    453|            }
 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|   157k|            if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|   157k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   157k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if ( TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|   157k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1986:18): [True: 25.9k, False: 131k]
  ------------------
 1987|  25.9k|            {
 1988|       |                /* HTML4 strict doesn't allow inline content here */
 1989|       |                /* but HTML2 does allow img elements as children of body */
 1990|  25.9k|                if ( nodeIsIMG(node) )
  ------------------
  |  |  412|  25.9k|#define nodeIsIMG( node )        TagIsId( node, TidyTag_IMG )
  |  |  ------------------
  |  |  |  |  275|  25.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 25.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 25.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.82k, False: 24.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1991|  1.82k|                    TY_(ConstrainVersion)(doc, ~VERS_HTML40_STRICT);
  ------------------
  |  |   23|  1.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~VERS_HTML40_STRICT);
  ------------------
  |  |  207|  1.82k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  1.82k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  1.82k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  1.82k|#define X10S                 256u
  |  |  ------------------
  ------------------
 1992|  24.1k|                else
 1993|  24.1k|                    TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT|VERS_HTML20));
  ------------------
  |  |   23|  24.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT|VERS_HTML20));
  ------------------
  |  |  207|  24.1k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  179|  24.1k|#define H40S                   4u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  182|  24.1k|#define H41S                  32u
  |  |  ------------------
  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  ------------------
  |  |  |  |  185|  24.1k|#define X10S                 256u
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~(VERS_HTML40_STRICT|VERS_HTML20));
  ------------------
  |  |  205|  24.1k|#define VERS_HTML20        (HT20)
  |  |  ------------------
  |  |  |  |  177|  24.1k|#define HT20                   1u
  |  |  ------------------
  ------------------
 1994|       |
 1995|  25.9k|                if (checkstack && !node->implicit)
  ------------------
  |  Branch (1995:21): [True: 7.26k, False: 18.6k]
  |  Branch (1995:35): [True: 6.99k, False: 269]
  ------------------
 1996|  6.99k|                {
 1997|  6.99k|                    checkstack = no;
 1998|       |
 1999|  6.99k|                    if ( TY_(InlineDup)(doc, node) > 0 )
  ------------------
  |  |   23|  6.99k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.99k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1999:26): [True: 774, False: 6.21k]
  ------------------
 2000|    774|                        continue;
 2001|  6.99k|                }
 2002|       |                
 2003|  25.1k|                DEBUG_LOG_GET_OLD_MODE;
 2004|  25.1k|                mode = MixedContent;
 2005|  25.1k|                DEBUG_LOG_CHANGE_MODE;
 2006|  25.1k|            }
 2007|   131k|            else
 2008|   131k|            {
 2009|   131k|                checkstack = yes;
 2010|   131k|                DEBUG_LOG_GET_OLD_MODE;
 2011|   131k|                mode = IgnoreWhitespace;
 2012|   131k|                DEBUG_LOG_CHANGE_MODE;
 2013|   131k|            }
 2014|       |
 2015|   157k|            if (node->implicit)
  ------------------
  |  Branch (2015:17): [True: 6.44k, False: 150k]
  ------------------
 2016|  6.44k|            {
 2017|  6.44k|                TY_(Report)(doc, body, node, INSERTING_TAG);
  ------------------
  |  |   23|  6.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2018|  6.44k|            }
 2019|       |
 2020|   157k|            TY_(InsertNodeAtEnd)(body, node);
  ------------------
  |  |   23|   157k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   157k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2021|       |            
 2022|   157k|            {
 2023|   157k|                TidyParserMemory memory = {0};
 2024|   157k|                memory.identity = TY_(ParseBody);
  ------------------
  |  |   23|   157k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   157k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2025|   157k|                memory.original_node = body;
 2026|   157k|                memory.reentry_node = node;
 2027|   157k|                memory.register_1 = checkstack;
 2028|   157k|                memory.register_2 = iswhitenode;
 2029|   157k|                memory.mode = mode;
 2030|   157k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|   157k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   157k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2031|   157k|            }
 2032|   157k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2033|   157k|            return node;
 2034|   157k|        }
 2035|       |
 2036|       |        /* discard unexpected tags */
 2037|  4.53k|        TY_(Report)(doc, body, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  4.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2038|  4.53k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  4.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2039|  4.53k|    }
 2040|  33.9k|    DEBUG_LOG_EXIT;
 2041|       |    return NULL;
 2042|   199k|}
prvTidyParseColGroup:
 2054|  10.3k|{
 2055|  10.3k|    Node *node, *parent;
 2056|  10.3k|    DEBUG_LOG_COUNTERS;
 2057|       |
 2058|       |    /*
 2059|       |     If we're re-entering, then we need to setup from a previous state,
 2060|       |     instead of starting fresh. We can pull what we need from the document's
 2061|       |     stack.
 2062|       |     */
 2063|  10.3k|    if ( colgroup == NULL )
  ------------------
  |  Branch (2063:10): [True: 4.96k, False: 5.40k]
  ------------------
 2064|  4.96k|    {
 2065|  4.96k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  4.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2066|  4.96k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2067|  4.96k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2068|  4.96k|        colgroup = memory.original_node;
 2069|  4.96k|        DEBUG_LOG_GET_OLD_MODE;
 2070|  4.96k|        mode = memory.mode;
 2071|  4.96k|        DEBUG_LOG_CHANGE_MODE;
 2072|  4.96k|    }
 2073|  5.40k|    else
 2074|  5.40k|    {
 2075|  5.40k|        DEBUG_LOG_ENTER_WITH_NODE(colgroup);
 2076|  5.40k|        if (colgroup->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  5.40k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (2076:13): [True: 0, False: 5.40k]
  ------------------
 2077|      0|            return NULL;
 2078|  5.40k|    }
 2079|       |
 2080|  14.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 (2080:12): [True: 14.0k, False: 331]
  ------------------
 2081|  14.0k|    {
 2082|  14.0k|        DEBUG_LOG_GOT_TOKEN(node);
 2083|       |
 2084|  14.0k|        if (node->tag == colgroup->tag && node->type == EndTag)
  ------------------
  |  Branch (2084:13): [True: 3.57k, False: 10.5k]
  |  Branch (2084:43): [True: 66, False: 3.51k]
  ------------------
 2085|     66|        {
 2086|     66|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|     66|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     66|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2087|     66|            colgroup->closed = yes;
 2088|     66|            return NULL;
 2089|     66|        }
 2090|       |
 2091|       |        /*
 2092|       |          if this is the end tag for an ancestor element
 2093|       |          then infer end tag for this element
 2094|       |        */
 2095|  14.0k|        if (node->type == EndTag)
  ------------------
  |  Branch (2095:13): [True: 928, False: 13.1k]
  ------------------
 2096|    928|        {
 2097|    928|            if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    928|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    928|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 928, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 684, False: 244]
  |  |  |  |  |  Branch (275:54): [True: 220, False: 464]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2098|    220|            {
 2099|    220|                BadForm( doc );
 2100|    220|                TY_(Report)(doc, colgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    220|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    220|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2101|    220|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    220|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    220|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2102|    220|                continue;
 2103|    220|            }
 2104|       |
 2105|    708|            for ( parent = colgroup->parent;
 2106|  5.81k|                  parent != NULL;
  ------------------
  |  Branch (2106:19): [True: 5.34k, False: 464]
  ------------------
 2107|  5.10k|                  parent = parent->parent )
 2108|  5.34k|            {
 2109|  5.34k|                if (node->tag == parent->tag)
  ------------------
  |  Branch (2109:21): [True: 244, False: 5.10k]
  ------------------
 2110|    244|                {
 2111|    244|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    244|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    244|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2112|    244|                    DEBUG_LOG_EXIT;
 2113|    244|                    return NULL;
 2114|    244|                }
 2115|  5.34k|            }
 2116|    708|        }
 2117|       |
 2118|  13.5k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  13.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2118:13): [True: 663, False: 12.9k]
  ------------------
 2119|    663|        {
 2120|    663|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    663|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    663|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2121|    663|            DEBUG_LOG_EXIT;
 2122|    663|            return NULL;
 2123|    663|        }
 2124|       |
 2125|       |        /* deal with comments etc. */
 2126|  12.9k|        if (InsertMisc(colgroup, node))
  ------------------
  |  Branch (2126:13): [True: 561, False: 12.3k]
  ------------------
 2127|    561|            continue;
 2128|       |
 2129|       |        /* discard unknown tags */
 2130|  12.3k|        if (node->tag == NULL)
  ------------------
  |  Branch (2130:13): [True: 2.81k, False: 9.52k]
  ------------------
 2131|  2.81k|        {
 2132|  2.81k|            TY_(Report)(doc, colgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2133|  2.81k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2134|  2.81k|            continue;
 2135|  2.81k|        }
 2136|       |
 2137|  9.52k|        if ( !nodeIsCOL(node) )
  ------------------
  |  |  398|  9.52k|#define nodeIsCOL( node )        TagIsId( node, TidyTag_COL )
  |  |  ------------------
  |  |  |  |  275|  9.52k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 9.52k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 9.52k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.42k, False: 4.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2138|  4.10k|        {
 2139|  4.10k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  4.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2140|  4.10k|            DEBUG_LOG_EXIT;
 2141|  4.10k|            return NULL;
 2142|  4.10k|        }
 2143|       |
 2144|  5.42k|        if (node->type == EndTag)
  ------------------
  |  Branch (2144:13): [True: 462, False: 4.96k]
  ------------------
 2145|    462|        {
 2146|    462|            TY_(Report)(doc, colgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    462|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    462|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2147|    462|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    462|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    462|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2148|    462|            continue;
 2149|    462|        }
 2150|       |
 2151|       |        /* node should be <COL> */
 2152|  4.96k|        TY_(InsertNodeAtEnd)(colgroup, node);
  ------------------
  |  |   23|  4.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2153|       |        
 2154|  4.96k|        {
 2155|  4.96k|            TidyParserMemory memory = {0};
 2156|  4.96k|            memory.identity = TY_(ParseColGroup);
  ------------------
  |  |   23|  4.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2157|  4.96k|            memory.original_node = colgroup;
 2158|  4.96k|            memory.reentry_node = node;
 2159|  4.96k|            memory.mode = mode;
 2160|  4.96k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  4.96k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.96k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2161|  4.96k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2162|  4.96k|        }
 2163|  4.96k|        DEBUG_LOG_EXIT;
 2164|  4.96k|        return node;
 2165|  5.42k|    }
 2166|    331|    DEBUG_LOG_EXIT;
 2167|       |    return NULL;
 2168|  10.3k|}
prvTidyParseDatalist:
 2180|  33.6k|{
 2181|  33.6k|    Lexer* lexer = doc->lexer;
 2182|  33.6k|    Node *node;
 2183|  33.6k|    DEBUG_LOG_COUNTERS;
 2184|       |
 2185|  33.6k|    if ( field == NULL )
  ------------------
  |  Branch (2185:10): [True: 16.9k, False: 16.6k]
  ------------------
 2186|  16.9k|    {
 2187|  16.9k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  16.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2188|  16.9k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2189|  16.9k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2190|  16.9k|        field = memory.original_node;
 2191|  16.9k|        DEBUG_LOG_GET_OLD_MODE;
 2192|  16.9k|        mode = memory.mode;
 2193|  16.9k|        DEBUG_LOG_CHANGE_MODE;
 2194|  16.9k|    }
 2195|  16.6k|    else
 2196|  16.6k|    {
 2197|  16.6k|        DEBUG_LOG_ENTER_WITH_NODE(field);
 2198|  16.6k|    }
 2199|       |    
 2200|  33.6k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 2201|       |
 2202|  36.2k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  36.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2202:12): [True: 19.7k, False: 16.4k]
  ------------------
 2203|  19.7k|    {
 2204|  19.7k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (2204:13): [True: 16.3k, False: 3.41k]
  |  Branch (2204:40): [True: 199, False: 16.1k]
  ------------------
 2205|    199|        {
 2206|    199|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    199|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    199|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2207|    199|            field->closed = yes;
 2208|    199|            TrimSpaces(doc, field);
 2209|       |
 2210|    199|            DEBUG_LOG_EXIT;
 2211|    199|            return NULL;
 2212|    199|        }
 2213|       |
 2214|       |        /* deal with comments etc. */
 2215|  19.5k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (2215:13): [True: 427, False: 19.1k]
  ------------------
 2216|    427|            continue;
 2217|       |
 2218|  19.1k|        if ( node->type == StartTag &&
  ------------------
  |  Branch (2218:14): [True: 18.4k, False: 705]
  ------------------
 2219|  18.4k|             ( nodeIsOPTION(node)   ||
  ------------------
  |  |  410|  18.4k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  36.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 18.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.3k, False: 1.12k]
  |  |  |  |  |  Branch (275:54): [True: 391, False: 16.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2220|  18.4k|               nodeIsOPTGROUP(node) ||
  ------------------
  |  |  411|  18.0k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  36.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 18.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 16.9k, False: 1.12k]
  |  |  |  |  |  Branch (275:54): [True: 230, False: 16.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2221|  18.4k|               nodeIsDATALIST(node) ||
  ------------------
  |  |  463|  17.8k|#define nodeIsDATALIST( node )   TagIsId( node, TidyTag_DATALIST )
  |  |  ------------------
  |  |  |  |  275|  36.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 17.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 16.6k, False: 1.12k]
  |  |  |  |  |  Branch (275:54): [True: 16.1k, False: 530]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2222|  18.4k|               nodeIsSCRIPT(node))
  ------------------
  |  |  422|  1.65k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  1.65k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.65k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 530, False: 1.12k]
  |  |  |  |  |  Branch (275:54): [True: 215, False: 315]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2223|  19.1k|           )
 2224|  16.9k|        {
 2225|  16.9k|            TidyParserMemory memory = {0};
 2226|  16.9k|            memory.identity = TY_(ParseDatalist);
  ------------------
  |  |   23|  16.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2227|  16.9k|            memory.original_node = field;
 2228|  16.9k|            memory.reentry_node = node;
 2229|  16.9k|            memory.reentry_mode = IgnoreWhitespace;
 2230|       |
 2231|  16.9k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  16.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2232|  16.9k|            TY_(pushMemory)(doc, memory);
  ------------------
  |  |   23|  16.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2233|  16.9k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2234|  16.9k|            return node;
 2235|  16.9k|        }
 2236|       |
 2237|       |        /* discard unexpected tags */
 2238|  2.14k|        TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2239|  2.14k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2240|  2.14k|    }
 2241|       |
 2242|  16.4k|    TY_(Report)(doc, field, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  16.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2243|       |
 2244|  16.4k|    DEBUG_LOG_EXIT;
 2245|       |    return NULL;
 2246|  33.6k|}
prvTidyParseDefList:
 2258|  30.0k|{
 2259|  30.0k|    Lexer* lexer = doc->lexer;
 2260|  30.0k|    Node *node = NULL;
 2261|  30.0k|    Node *parent = NULL;
 2262|  30.0k|    DEBUG_LOG_COUNTERS;
 2263|       |
 2264|  30.0k|    enum parserState {
 2265|  30.0k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 2266|  30.0k|        STATE_POST_NODEISCENTER,      /* To-do after re-entering after checks. */
 2267|  30.0k|        STATE_COMPLETE,               /* Done with the switch. */
 2268|  30.0k|    } state = STATE_INITIAL;
 2269|       |
 2270|  30.0k|    if ( list == NULL )
  ------------------
  |  Branch (2270:10): [True: 13.5k, False: 16.4k]
  ------------------
 2271|  13.5k|    {
 2272|  13.5k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  13.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2273|  13.5k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2274|  13.5k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2275|  13.5k|        list = memory.original_node;
 2276|  13.5k|        state = memory.reentry_state;
 2277|  13.5k|        DEBUG_LOG_GET_OLD_MODE;
 2278|  13.5k|        mode = memory.mode;
 2279|  13.5k|        DEBUG_LOG_CHANGE_MODE;
 2280|  13.5k|    }
 2281|  16.4k|    else
 2282|  16.4k|    {
 2283|  16.4k|        DEBUG_LOG_ENTER_WITH_NODE(list);
 2284|  16.4k|    }
 2285|       |
 2286|  30.0k|    if (list->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  30.0k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (2286:9): [True: 0, False: 30.0k]
  ------------------
 2287|      0|        return NULL;
 2288|       |
 2289|  30.0k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 2290|       |
 2291|  40.9k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (2291:13): [True: 36.0k, False: 4.94k]
  ------------------
 2292|  36.0k|    {
 2293|  36.0k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (2293:14): [True: 34.6k, False: 1.33k]
  ------------------
 2294|  34.6k|            node = TY_(GetToken)( doc, IgnoreWhitespace);
  ------------------
  |  |   23|  34.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  34.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2295|       |        
 2296|  36.0k|        switch ( state)
 2297|  36.0k|        {
 2298|  34.6k|            case STATE_INITIAL:
  ------------------
  |  Branch (2298:13): [True: 34.6k, False: 1.33k]
  ------------------
 2299|  34.6k|            {
 2300|  34.6k|                if ( node == NULL)
  ------------------
  |  Branch (2300:22): [True: 4.94k, False: 29.7k]
  ------------------
 2301|  4.94k|                {
 2302|  4.94k|                    state = STATE_COMPLETE;
 2303|  4.94k|                    continue;
 2304|  4.94k|                }
 2305|       |
 2306|  29.7k|                if (node->tag == list->tag && node->type == EndTag)
  ------------------
  |  Branch (2306:21): [True: 4.73k, False: 25.0k]
  |  Branch (2306:47): [True: 641, False: 4.09k]
  ------------------
 2307|    641|                {
 2308|    641|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    641|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    641|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2309|    641|                    list->closed = yes;
 2310|    641|                    DEBUG_LOG_EXIT;
 2311|    641|                    return NULL;
 2312|    641|                }
 2313|       |
 2314|       |                /* deal with comments etc. */
 2315|  29.1k|                if (InsertMisc(list, node))
  ------------------
  |  Branch (2315:21): [True: 218, False: 28.8k]
  ------------------
 2316|    218|                    continue;
 2317|       |
 2318|  28.8k|                if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  28.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  28.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2318:21): [True: 3.06k, False: 25.8k]
  ------------------
 2319|  3.06k|                {
 2320|  3.06k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  3.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2321|  3.06k|                    node = TY_(InferredTag)(doc, TidyTag_DT);
  ------------------
  |  |   23|  3.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2322|  3.06k|                    TY_(Report)(doc, list, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  3.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2323|  3.06k|                }
 2324|       |
 2325|  28.8k|                if (node->tag == NULL)
  ------------------
  |  Branch (2325:21): [True: 990, False: 27.8k]
  ------------------
 2326|    990|                {
 2327|    990|                    TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    990|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    990|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2328|    990|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    990|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    990|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2329|    990|                    continue;
 2330|    990|                }
 2331|       |
 2332|       |                /*
 2333|       |                  if this is the end tag for an ancestor element
 2334|       |                  then infer end tag for this element
 2335|       |                */
 2336|  27.8k|                if (node->type == EndTag)
  ------------------
  |  Branch (2336:21): [True: 4.69k, False: 23.1k]
  ------------------
 2337|  4.69k|                {
 2338|  4.69k|                    Bool discardIt = no;
 2339|  4.69k|                    if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  4.69k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  4.69k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.69k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.69k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.99k, False: 2.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2340|  1.99k|                    {
 2341|  1.99k|                        BadForm( doc );
 2342|  1.99k|                        TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.99k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.99k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2343|  1.99k|                        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  1.99k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.99k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2344|  1.99k|                        continue;
 2345|  1.99k|                    }
 2346|       |
 2347|  2.70k|                    for (parent = list->parent;
 2348|   217k|                            parent != NULL; parent = parent->parent)
  ------------------
  |  Branch (2348:29): [True: 216k, False: 745]
  ------------------
 2349|   216k|                    {
 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|   216k|                        if (nodeIsBODY(parent))
  ------------------
  |  |  375|   216k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   216k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 216k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 216k, False: 743]
  |  |  |  |  |  Branch (275:54): [True: 1.18k, False: 215k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2354|  1.18k|                        {
 2355|  1.18k|                            discardIt = yes;
 2356|  1.18k|                            break;
 2357|  1.18k|                        }
 2358|   215k|                        if (node->tag == parent->tag)
  ------------------
  |  Branch (2358:29): [True: 781, False: 215k]
  ------------------
 2359|    781|                        {
 2360|    781|                            TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|    781|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    781|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2361|    781|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    781|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    781|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2362|       |
 2363|    781|                            DEBUG_LOG_EXIT;
 2364|    781|                            return NULL;
 2365|    781|                        }
 2366|   215k|                    }
 2367|  1.92k|                    if (discardIt)
  ------------------
  |  Branch (2367:25): [True: 1.18k, False: 745]
  ------------------
 2368|  1.18k|                    {
 2369|  1.18k|                        TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2370|  1.18k|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2371|  1.18k|                        continue;
 2372|  1.18k|                    }
 2373|  1.92k|                }
 2374|       |
 2375|       |                /* center in a dt or a dl breaks the dl list in two */
 2376|  23.9k|                if ( nodeIsCENTER(node) )
  ------------------
  |  |  420|  23.9k|#define nodeIsCENTER( node )     TagIsId( node, TidyTag_CENTER )
  |  |  ------------------
  |  |  |  |  275|  23.9k|#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: 1.33k, False: 22.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2377|  1.33k|                {
 2378|  1.33k|                    if (list->content)
  ------------------
  |  Branch (2378:25): [True: 1.02k, False: 311]
  ------------------
 2379|  1.02k|                        TY_(InsertNodeAfterElement)(list, node);
  ------------------
  |  |   23|  1.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2380|    311|                    else /* trim empty dl list */
 2381|    311|                    {
 2382|    311|                        TY_(InsertNodeBeforeElement)(list, node);
  ------------------
  |  |   23|    311|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    311|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2383|    311|                    }
 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.33k|                    parent = node->parent;
 2393|       |
 2394|       |                    /* and parse contents of center */
 2395|  1.33k|                    lexer->excludeBlocks = no;
 2396|       |
 2397|  1.33k|                    {
 2398|  1.33k|                        TidyParserMemory memory = {0};
 2399|  1.33k|                        memory.identity = TY_(ParseDefList);
  ------------------
  |  |   23|  1.33k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.33k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2400|  1.33k|                        memory.original_node = list;
 2401|  1.33k|                        memory.reentry_node = node;
 2402|  1.33k|                        memory.reentry_state = STATE_POST_NODEISCENTER;
 2403|  1.33k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.33k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.33k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2404|  1.33k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 2405|  1.33k|                        return node;
 2406|  1.33k|                    }
 2407|  1.33k|                }
 2408|       |
 2409|  22.6k|                if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |  391|  22.6k|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  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: 22.6k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.17k, False: 18.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |  392|  18.4k|#define nodeIsDD( node )         TagIsId( node, TidyTag_DD )
  |  |  ------------------
  |  |  |  |  275|  41.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 18.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 18.4k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 10.0k, False: 8.41k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |  429|  8.41k|#define nodeIsDIV( node )        TagIsId( node, TidyTag_DIV )
  |  |  ------------------
  |  |  |  |  275|  16.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.41k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.41k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 678, False: 7.73k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !( nodeIsDT(node) || nodeIsDD(node) || ( nodeIsDIV(node) && TY_(IsHTML5Mode)(doc) ) ) )
  ------------------
  |  |   23|    678|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    678|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2409:82): [True: 413, False: 265]
  ------------------
 2410|  8.00k|                {
 2411|  8.00k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  8.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2412|       |
 2413|  8.00k|                    if (!(node->tag->model & (CM_BLOCK | CM_INLINE)))
  ------------------
  |  |  142|  8.00k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                  if (!(node->tag->model & (CM_BLOCK | CM_INLINE)))
  ------------------
  |  |  143|  8.00k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2413:25): [True: 2.02k, False: 5.97k]
  ------------------
 2414|  2.02k|                    {
 2415|  2.02k|                        TY_(Report)(doc, list, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  2.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2416|  2.02k|                        DEBUG_LOG_EXIT;
 2417|  2.02k|                        return NULL;
 2418|  2.02k|                    }
 2419|       |
 2420|       |                    /* if DD appeared directly in BODY then exclude blocks */
 2421|  5.97k|                    if (!(node->tag->model & CM_INLINE) && lexer->excludeBlocks)
  ------------------
  |  |  143|  5.97k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2421:25): [True: 4.74k, False: 1.22k]
  |  Branch (2421:60): [True: 1.31k, False: 3.43k]
  ------------------
 2422|  1.31k|                    {
 2423|  1.31k|                        DEBUG_LOG_EXIT;
 2424|  1.31k|                        return NULL;
 2425|  1.31k|                    }
 2426|       |
 2427|  4.66k|                    node = TY_(InferredTag)(doc, TidyTag_DD);
  ------------------
  |  |   23|  4.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2428|  4.66k|                    TY_(Report)(doc, list, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  4.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2429|  4.66k|                }
 2430|       |
 2431|  19.2k|                if (node->type == EndTag)
  ------------------
  |  Branch (2431:21): [True: 249, False: 19.0k]
  ------------------
 2432|    249|                {
 2433|    249|                    TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    249|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    249|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2434|    249|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    249|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    249|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2435|    249|                    continue;
 2436|    249|                }
 2437|       |
 2438|       |                /* node should be <DT> or <DD> or <DIV>*/
 2439|  19.0k|                TY_(InsertNodeAtEnd)(list, node);
  ------------------
  |  |   23|  19.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2440|  19.0k|                {
 2441|  19.0k|                    TidyParserMemory memory = {0};
 2442|  19.0k|                    memory.identity = TY_(ParseDefList);
  ------------------
  |  |   23|  19.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2443|  19.0k|                    memory.original_node = list;
 2444|  19.0k|                    memory.reentry_node = node;
 2445|  19.0k|                    memory.reentry_state = STATE_INITIAL;
 2446|  19.0k|                    TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  19.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2447|  19.0k|                    DEBUG_LOG_EXIT;
 2448|  19.0k|                    return node;
 2449|  19.2k|                }
 2450|  19.2k|            } break;
 2451|       |
 2452|       |
 2453|  1.33k|            case STATE_POST_NODEISCENTER:
  ------------------
  |  Branch (2453:13): [True: 1.33k, False: 34.6k]
  ------------------
 2454|  1.33k|            {
 2455|  1.33k|                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.33k|                if (parent && parent->last == node)
  ------------------
  |  Branch (2461:21): [True: 0, False: 1.33k]
  |  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.33k|                state = STATE_INITIAL;
 2467|  1.33k|                continue;
 2468|  19.2k|            } break;
 2469|       |
 2470|       |
 2471|      0|            default:
  ------------------
  |  Branch (2471:13): [True: 0, False: 36.0k]
  ------------------
 2472|      0|                break;
 2473|  36.0k|        } /* switch */
 2474|  36.0k|    } /* while */
 2475|       |
 2476|  4.94k|    TY_(Report)(doc, list, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  4.94k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.94k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2477|  4.94k|    DEBUG_LOG_EXIT;
 2478|       |    return NULL;
 2479|  30.0k|}
prvTidyParseEmpty:
 2491|  31.1k|{
 2492|  31.1k|    Lexer* lexer = doc->lexer;
 2493|  31.1k|    if ( lexer->isvoyager )
  ------------------
  |  Branch (2493:10): [True: 1.49k, False: 29.6k]
  ------------------
 2494|  1.49k|    {
 2495|  1.49k|        Node *node = TY_(GetToken)( doc, mode);
  ------------------
  |  |   23|  1.49k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.49k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2496|  1.49k|        if ( node )
  ------------------
  |  Branch (2496:14): [True: 1.24k, False: 251]
  ------------------
 2497|  1.24k|        {
 2498|  1.24k|            if ( !(node->type == EndTag && node->tag == element->tag) )
  ------------------
  |  Branch (2498:20): [True: 724, False: 518]
  |  Branch (2498:44): [True: 240, False: 484]
  ------------------
 2499|  1.00k|            {
 2500|       |                /* TY_(Report)(doc, element, node, ELEMENT_NOT_EMPTY); */
 2501|  1.00k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2502|  1.00k|            }
 2503|    240|            else
 2504|    240|            {
 2505|    240|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    240|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    240|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2506|    240|            }
 2507|  1.24k|        }
 2508|  1.49k|    }
 2509|       |    return NULL;
 2510|  31.1k|}
prvTidyParseFrameSet:
 2522|  47.4k|{
 2523|  47.4k|    Lexer* lexer = doc->lexer;
 2524|  47.4k|    Node *node;
 2525|  47.4k|    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|  47.4k|    if ( frameset == NULL )
  ------------------
  |  Branch (2532:10): [True: 20.9k, False: 26.4k]
  ------------------
 2533|  20.9k|    {
 2534|  20.9k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  20.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2535|  20.9k|        node = memory.reentry_node; /* Throwaway, because we replace it entering the loop. */
 2536|  20.9k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2537|  20.9k|        frameset = memory.original_node;
 2538|  20.9k|        DEBUG_LOG_GET_OLD_MODE;
 2539|  20.9k|        mode = memory.mode;
 2540|  20.9k|        DEBUG_LOG_CHANGE_MODE;
 2541|  20.9k|    }
 2542|  26.4k|    else
 2543|  26.4k|    {
 2544|  26.4k|        DEBUG_LOG_ENTER_WITH_NODE(frameset);
 2545|  26.4k|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  26.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (2545:14): [True: 26.4k, False: 0]
  ------------------
 2546|  26.4k|        {
 2547|  26.4k|            doc->badAccess |= BA_USING_FRAMES;
  ------------------
  |  |  284|  26.4k|#define BA_USING_FRAMES            16
  ------------------
 2548|  26.4k|        }
 2549|  26.4k|    }
 2550|       |
 2551|  55.4k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  55.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  55.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2551:12): [True: 29.2k, False: 26.1k]
  ------------------
 2552|  29.2k|    {
 2553|  29.2k|        if (node->tag == frameset->tag && node->type == EndTag)
  ------------------
  |  Branch (2553:13): [True: 19.5k, False: 9.72k]
  |  Branch (2553:43): [True: 248, False: 19.3k]
  ------------------
 2554|    248|        {
 2555|    248|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    248|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    248|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2556|    248|            frameset->closed = yes;
 2557|    248|            TrimSpaces(doc, frameset);
 2558|    248|            DEBUG_LOG_EXIT;
 2559|    248|            return NULL;
 2560|    248|        }
 2561|       |
 2562|       |        /* deal with comments etc. */
 2563|  29.0k|        if (InsertMisc(frameset, node))
  ------------------
  |  Branch (2563:13): [True: 523, False: 28.5k]
  ------------------
 2564|    523|            continue;
 2565|       |
 2566|  28.5k|        if (node->tag == NULL)
  ------------------
  |  Branch (2566:13): [True: 4.31k, False: 24.2k]
  ------------------
 2567|  4.31k|        {
 2568|  4.31k|            TY_(Report)(doc, frameset, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  4.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2569|  4.31k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  4.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2570|  4.31k|            continue;
 2571|  4.31k|        }
 2572|       |
 2573|  24.2k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  24.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2573:13): [True: 23.9k, False: 222]
  ------------------
 2574|  23.9k|        {
 2575|  23.9k|            if (node->tag && node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  23.9k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (2575:17): [True: 23.9k, False: 0]
  |  Branch (2575:30): [True: 326, False: 23.6k]
  ------------------
 2576|    326|            {
 2577|    326|                MoveToHead(doc, frameset, node);
 2578|    326|                continue;
 2579|    326|            }
 2580|  23.9k|        }
 2581|       |
 2582|  23.8k|        if ( nodeIsBODY(node) )
  ------------------
  |  |  375|  23.8k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  23.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 23.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 23.8k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 924, False: 22.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2583|    924|        {
 2584|    924|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    924|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    924|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2585|    924|            node = TY_(InferredTag)(doc, TidyTag_NOFRAMES);
  ------------------
  |  |   23|    924|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    924|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2586|    924|            TY_(Report)(doc, frameset, node, INSERTING_TAG);
  ------------------
  |  |   23|    924|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    924|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2587|    924|        }
 2588|       |
 2589|  23.8k|        if (node->type == StartTag && (node->tag && node->tag->model & CM_FRAMES))
  ------------------
  |  |  152|  22.1k|#define CM_FRAMES       (1 << 13)  /**< "FRAME", "FRAMESET", "NOFRAMES". Used in ParseFrameSet. */
  ------------------
  |  Branch (2589:13): [True: 22.1k, False: 1.67k]
  |  Branch (2589:40): [True: 22.1k, False: 0]
  |  Branch (2589:53): [True: 21.0k, False: 1.19k]
  ------------------
 2590|  21.0k|        {
 2591|  21.0k|            TY_(InsertNodeAtEnd)(frameset, node);
  ------------------
  |  |   23|  21.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2592|  21.0k|            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|  21.0k|            TidyParserMemory memory = {0};
 2600|  21.0k|            memory.identity = TY_(ParseFrameSet);
  ------------------
  |  |   23|  21.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2601|  21.0k|            memory.original_node = frameset;
 2602|  21.0k|            memory.reentry_node = node;
 2603|  21.0k|            memory.mode = MixedContent;
 2604|  21.0k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  21.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2605|  21.0k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 2606|  21.0k|            return node;
 2607|  21.0k|        }
 2608|  2.87k|        else if (node->type == StartEndTag && (node->tag && node->tag->model & CM_FRAMES))
  ------------------
  |  |  152|  1.46k|#define CM_FRAMES       (1 << 13)  /**< "FRAME", "FRAMESET", "NOFRAMES". Used in ParseFrameSet. */
  ------------------
  |  Branch (2608:18): [True: 1.46k, False: 1.40k]
  |  Branch (2608:48): [True: 1.46k, False: 0]
  |  Branch (2608:61): [True: 1.24k, False: 218]
  ------------------
 2609|  1.24k|        {
 2610|  1.24k|            TY_(InsertNodeAtEnd)(frameset, node);
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2611|  1.24k|            continue;
 2612|  1.24k|        }
 2613|       |
 2614|       |        /* discard unexpected tags */
 2615|       |        /* WAI [6.5.1.4] link is being discarded outside of NOFRAME */
 2616|  1.62k|        if ( nodeIsA(node) )
  ------------------
  |  |  401|  1.62k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  1.62k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.62k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.62k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 202, False: 1.42k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2617|    202|           doc->badAccess |= BA_INVALID_LINK_NOFRAMES;
  ------------------
  |  |  286|    202|#define BA_INVALID_LINK_NOFRAMES   64  /* WAI [6.5.1.4] */  
  ------------------
 2618|       |
 2619|  1.62k|        TY_(Report)(doc, frameset, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.62k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.62k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2620|  1.62k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.62k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.62k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2621|  1.62k|    }
 2622|       |
 2623|  26.1k|    TY_(Report)(doc, frameset, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  26.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2624|  26.1k|    DEBUG_LOG_EXIT;
 2625|       |    return NULL;
 2626|  47.4k|}
prvTidyParseHead:
 2638|  59.1k|{
 2639|  59.1k|    Lexer* lexer = doc->lexer;
 2640|  59.1k|    Node *node;
 2641|  59.1k|    int HasTitle = 0;
 2642|  59.1k|    int HasBase = 0;
 2643|  59.1k|    DEBUG_LOG_COUNTERS;
 2644|       |
 2645|  59.1k|    if ( head == NULL )
  ------------------
  |  Branch (2645:10): [True: 8.19k, False: 50.9k]
  ------------------
 2646|  8.19k|    {
 2647|  8.19k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  8.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2648|  8.19k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 2649|  8.19k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2650|  8.19k|        head = memory.original_node;
 2651|  8.19k|        HasTitle = memory.register_1;
 2652|  8.19k|        HasBase = memory.register_2;
 2653|  8.19k|        DEBUG_LOG_GET_OLD_MODE;
 2654|  8.19k|        mode = memory.mode;
 2655|  8.19k|        DEBUG_LOG_CHANGE_MODE;
 2656|  8.19k|    }
 2657|  50.9k|    else
 2658|  50.9k|    {
 2659|  50.9k|        DEBUG_LOG_ENTER_WITH_NODE(head);
 2660|  50.9k|    }
 2661|       |    
 2662|  73.4k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  73.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  73.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2662:12): [True: 66.5k, False: 6.92k]
  ------------------
 2663|  66.5k|    {
 2664|  66.5k|        if (node->tag == head->tag && node->type == EndTag)
  ------------------
  |  Branch (2664:13): [True: 1.03k, False: 65.4k]
  |  Branch (2664:39): [True: 222, False: 814]
  ------------------
 2665|    222|        {
 2666|    222|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    222|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    222|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2667|    222|            head->closed = yes;
 2668|    222|            break;
 2669|    222|        }
 2670|       |
 2671|       |        /* find and discard multiple <head> elements */
 2672|       |        /* find and discard <html> in <head> elements */
 2673|  66.2k|        if ((node->tag == head->tag || nodeIsHTML(node)) && node->type == StartTag)
  ------------------
  |  |  370|  65.4k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  65.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 65.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 45.2k, False: 20.1k]
  |  |  |  |  |  Branch (275:54): [True: 978, False: 44.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2673:14): [True: 814, False: 65.4k]
  |  Branch (2673:61): [True: 1.53k, False: 262]
  ------------------
 2674|  1.53k|        {
 2675|  1.53k|            TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2676|  1.53k|            TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  1.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2677|  1.53k|            continue;
 2678|  1.53k|        }
 2679|       |
 2680|  64.7k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  64.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  64.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2680:13): [True: 8.20k, False: 56.5k]
  ------------------
 2681|  8.20k|        {
 2682|       |            /*\ Issue #132 - avoid warning for missing body tag,
 2683|       |             *  if configured to --omit-otpional-tags yes
 2684|       |             *  Issue #314 - and if --show-body-only
 2685|       |            \*/
 2686|  8.20k|            if (!cfgBool( doc, TidyOmitOptionalTags ) &&
  ------------------
  |  |  418|  16.4k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  8.20k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2686:17): [True: 8.20k, False: 0]
  |  Branch (2686:17): [True: 8.20k, False: 0]
  ------------------
 2687|  8.20k|                !showingBodyOnly(doc) )
  ------------------
  |  |   28|  8.20k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  8.20k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  8.20k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2687:17): [True: 8.20k, False: 0]
  ------------------
 2688|  8.20k|            {
 2689|  8.20k|                TY_(Report)(doc, head, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  8.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.20k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2690|  8.20k|            }
 2691|  8.20k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  8.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.20k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2692|  8.20k|            break;
 2693|  8.20k|        }
 2694|       |
 2695|  56.5k|        if (node->type == ProcInsTag && node->element &&
  ------------------
  |  Branch (2695:13): [True: 1.55k, False: 54.9k]
  |  Branch (2695:41): [True: 1.10k, False: 446]
  ------------------
 2696|  1.10k|            TY_(tmbstrcmp)(node->element, "xml-stylesheet") == 0)
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2696:13): [True: 564, False: 544]
  ------------------
 2697|    564|        {
 2698|    564|            TY_(Report)(doc, head, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|    564|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    564|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2699|    564|            TY_(InsertNodeBeforeElement)(TY_(FindHTML)(doc), node);
  ------------------
  |  |   23|    564|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    564|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(InsertNodeBeforeElement)(TY_(FindHTML)(doc), node);
  ------------------
  |  |   23|    564|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    564|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2700|    564|            continue;
 2701|    564|        }
 2702|       |
 2703|       |        /* deal with comments etc. */
 2704|  55.9k|        if (InsertMisc(head, node))
  ------------------
  |  Branch (2704:13): [True: 1.12k, False: 54.8k]
  ------------------
 2705|  1.12k|            continue;
 2706|       |
 2707|  54.8k|        if (node->type == DocTypeTag)
  ------------------
  |  Branch (2707:13): [True: 1.05k, False: 53.8k]
  ------------------
 2708|  1.05k|        {
 2709|  1.05k|            InsertDocType(doc, head, node);
 2710|  1.05k|            continue;
 2711|  1.05k|        }
 2712|       |
 2713|       |        /* discard unknown tags */
 2714|  53.8k|        if (node->tag == NULL)
  ------------------
  |  Branch (2714:13): [True: 9.24k, False: 44.5k]
  ------------------
 2715|  9.24k|        {
 2716|  9.24k|            TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  9.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2717|  9.24k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  9.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2718|  9.24k|            continue;
 2719|  9.24k|        }
 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|  44.5k|        if (!(node->tag->model & CM_HEAD))
  ------------------
  |  |  141|  44.5k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (2726:13): [True: 35.6k, False: 8.92k]
  ------------------
 2727|  35.6k|        {
 2728|       |            /* #545067 Implicit closing of head broken - warn only for XHTML input */
 2729|  35.6k|            if ( lexer->isvoyager )
  ------------------
  |  Branch (2729:18): [True: 368, False: 35.2k]
  ------------------
 2730|    368|                TY_(Report)(doc, head, node, TAG_NOT_ALLOWED_IN );
  ------------------
  |  |   23|    368|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    368|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2731|  35.6k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  35.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2732|  35.6k|            break;
 2733|  35.6k|        }
 2734|       |
 2735|  8.92k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  8.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2735:13): [True: 8.19k, False: 731]
  ------------------
 2736|  8.19k|        {
 2737|  8.19k|            if ( nodeIsTITLE(node) )
  ------------------
  |  |  372|  8.19k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  8.19k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.19k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.19k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.07k, False: 5.12k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2738|  3.07k|            {
 2739|  3.07k|                ++HasTitle;
 2740|       |
 2741|  3.07k|                if (HasTitle > 1)
  ------------------
  |  Branch (2741:21): [True: 2.76k, False: 306]
  ------------------
 2742|  2.76k|                    TY_(Report)(doc, head, node,
  ------------------
  |  |   23|  2.76k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.76k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2743|  2.76k|                                     head ?
  ------------------
  |  Branch (2743:38): [True: 2.76k, False: 0]
  ------------------
 2744|  2.76k|                                     TOO_MANY_ELEMENTS_IN : TOO_MANY_ELEMENTS);
 2745|  3.07k|            }
 2746|  5.12k|            else if ( nodeIsBASE(node) )
  ------------------
  |  |  373|  5.12k|#define nodeIsBASE( node )       TagIsId( node, TidyTag_BASE )
  |  |  ------------------
  |  |  |  |  275|  5.12k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.12k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.12k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.45k, False: 3.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2747|  1.45k|            {
 2748|  1.45k|                ++HasBase;
 2749|       |
 2750|  1.45k|                if (HasBase > 1)
  ------------------
  |  Branch (2750:21): [True: 421, False: 1.03k]
  ------------------
 2751|    421|                    TY_(Report)(doc, head, node,
  ------------------
  |  |   23|    421|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    421|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2752|    421|                                     head ?
  ------------------
  |  Branch (2752:38): [True: 421, False: 0]
  ------------------
 2753|    421|                                     TOO_MANY_ELEMENTS_IN : TOO_MANY_ELEMENTS);
 2754|  1.45k|            }
 2755|       |
 2756|  8.19k|            TY_(InsertNodeAtEnd)(head, node);
  ------------------
  |  |   23|  8.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2757|       |
 2758|  8.19k|            {
 2759|  8.19k|                TidyParserMemory memory = {0};
 2760|  8.19k|                memory.identity = TY_(ParseHead);
  ------------------
  |  |   23|  8.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2761|  8.19k|                memory.original_node = head;
 2762|  8.19k|                memory.reentry_node = node;
 2763|  8.19k|                memory.register_1 = HasTitle;
 2764|  8.19k|                memory.register_2 = HasBase;
 2765|  8.19k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  8.19k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.19k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2766|  8.19k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 2767|  8.19k|                return node;
 2768|  8.19k|            }
 2769|  8.19k|        }
 2770|       |
 2771|       |        /* discard unexpected text nodes and end tags */
 2772|    731|        TY_(Report)(doc, head, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    731|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    731|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2773|    731|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    731|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    731|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2774|    731|    }
 2775|  50.9k|    DEBUG_LOG_EXIT;
 2776|       |    return NULL;
 2777|  59.1k|}
prvTidyParseHTML:
 2791|   110k|{
 2792|   110k|    Node *node = NULL;
 2793|   110k|    Node *head = NULL;
 2794|   110k|    Node *frameset = NULL;
 2795|   110k|    Node *noframes = NULL;
 2796|   110k|    DEBUG_LOG_COUNTERS;
 2797|       |
 2798|   110k|    enum parserState {
 2799|   110k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 2800|   110k|        STATE_COMPLETE,               /* Complete! */
 2801|   110k|        STATE_PRE_BODY,               /* In this state, we'll consider frames vs. body. */
 2802|   110k|        STATE_PARSE_BODY,             /* In this state, we can parse the body. */
 2803|   110k|        STATE_PARSE_HEAD,             /* In this state, we will setup head for parsing. */
 2804|   110k|        STATE_PARSE_HEAD_REENTER,     /* Resume here after parsing head. */
 2805|   110k|        STATE_PARSE_NOFRAMES,         /* In this state, we can parse noframes content. */
 2806|   110k|        STATE_PARSE_NOFRAMES_REENTER, /* In this state, we can restore more state. */
 2807|   110k|        STATE_PARSE_FRAMESET,         /* In this state, we will parse frameset content. */
 2808|   110k|        STATE_PARSE_FRAMESET_REENTER, /* We need to cleanup some things after parsing frameset. */
 2809|   110k|    } state = STATE_INITIAL;
 2810|       |
 2811|   110k|    TY_(SetOptionBool)( doc, TidyXmlTags, no );
  ------------------
  |  |   23|   110k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   110k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2812|       |
 2813|   110k|    if ( html == NULL )
  ------------------
  |  Branch (2813:10): [True: 60.5k, False: 49.7k]
  ------------------
 2814|  60.5k|    {
 2815|  60.5k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  60.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2816|  60.5k|        node = memory.reentry_node;
 2817|  60.5k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 2818|  60.5k|        html = memory.original_node;
 2819|  60.5k|        state = memory.reentry_state;
 2820|  60.5k|        DEBUG_LOG_GET_OLD_MODE;
 2821|  60.5k|        mode = memory.reentry_mode;
 2822|  60.5k|        DEBUG_LOG_CHANGE_MODE;
 2823|  60.5k|    }
 2824|  49.7k|    else
 2825|  49.7k|    {
 2826|  49.7k|        DEBUG_LOG_ENTER_WITH_NODE(html);
 2827|  49.7k|    }
 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|   287k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (2833:13): [True: 286k, False: 1.63k]
  ------------------
 2834|   286k|    {
 2835|   286k|        if ( state == STATE_INITIAL || state == STATE_PRE_BODY )
  ------------------
  |  Branch (2835:14): [True: 52.5k, False: 233k]
  |  Branch (2835:40): [True: 64.1k, False: 169k]
  ------------------
 2836|   116k|        {
 2837|   116k|            node = TY_(GetToken)( doc, IgnoreWhitespace );
  ------------------
  |  |   23|   116k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   116k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2838|   116k|            DEBUG_LOG_GOT_TOKEN(node);
 2839|   116k|        }
 2840|       |
 2841|   286k|        switch ( state )
 2842|   286k|        {
 2843|       |            /**************************************************************
 2844|       |             This case is all about finding a head tag and dealing with
 2845|       |             cases were we don't, so that we can move on to parsing a head
 2846|       |             tag.
 2847|       |             **************************************************************/
 2848|  52.5k|            case STATE_INITIAL:
  ------------------
  |  Branch (2848:13): [True: 52.5k, False: 233k]
  ------------------
 2849|  52.5k|            {
 2850|       |                /*
 2851|       |                 The only way we can possibly be here is if the lexer
 2852|       |                 had nothing to give us. Thus we'll create our own
 2853|       |                 head, and set the signal to start parsing it.
 2854|       |                 */
 2855|  52.5k|                if (node == NULL)
  ------------------
  |  Branch (2855:21): [True: 3.74k, False: 48.8k]
  ------------------
 2856|  3.74k|                {
 2857|  3.74k|                    node = TY_(InferredTag)(doc, TidyTag_HEAD);
  ------------------
  |  |   23|  3.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2858|  3.74k|                    state = STATE_PARSE_HEAD;
 2859|  3.74k|                    continue;
 2860|  3.74k|                }
 2861|       |
 2862|       |                /* We found exactly what we expected: head. */
 2863|  48.8k|                if ( nodeIsHEAD(node) )
  ------------------
  |  |  371|  48.8k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|  48.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 48.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 37.5k, False: 11.3k]
  |  |  |  |  |  Branch (275:54): [True: 297, False: 37.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2864|    297|                {
 2865|    297|                    state = STATE_PARSE_HEAD;
 2866|    297|                    continue;
 2867|    297|                }
 2868|       |
 2869|       |                /* We did not expect to find an html closing tag here! */
 2870|  48.5k|                if (html && (node->tag == html->tag) && (node->type == EndTag))
  ------------------
  |  Branch (2870:21): [True: 48.5k, False: 0]
  |  Branch (2870:29): [True: 2.40k, False: 46.1k]
  |  Branch (2870:57): [True: 248, False: 2.16k]
  ------------------
 2871|    248|                {
 2872|    248|                    TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    248|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    248|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2873|    248|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    248|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    248|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2874|    248|                    continue;
 2875|    248|                }
 2876|       |
 2877|       |                /* Find and discard multiple <html> elements. */
 2878|  48.2k|                if (html && (node->tag == html->tag) && (node->type == StartTag))
  ------------------
  |  Branch (2878:21): [True: 48.2k, False: 0]
  |  Branch (2878:29): [True: 2.16k, False: 46.1k]
  |  Branch (2878:57): [True: 1.91k, False: 246]
  ------------------
 2879|  1.91k|                {
 2880|  1.91k|                    TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2881|  1.91k|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  1.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2882|  1.91k|                    continue;
 2883|  1.91k|                }
 2884|       |
 2885|       |                /* Deal with comments, etc. */
 2886|  46.3k|                if (InsertMisc(html, node))
  ------------------
  |  Branch (2886:21): [True: 674, False: 45.6k]
  ------------------
 2887|    674|                    continue;
 2888|       |
 2889|       |                /*
 2890|       |                 At this point, we didn't find a head tag, so put the
 2891|       |                 token back and create our own head tag, so we can
 2892|       |                 move on.
 2893|       |                 */
 2894|  45.6k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  45.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2895|  45.6k|                node = TY_(InferredTag)(doc, TidyTag_HEAD);
  ------------------
  |  |   23|  45.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2896|  45.6k|                state = STATE_PARSE_HEAD;
 2897|  45.6k|                continue;
 2898|  46.3k|            } 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|  64.1k|            case STATE_PRE_BODY:
  ------------------
  |  Branch (2905:13): [True: 64.1k, False: 221k]
  ------------------
 2906|  64.1k|            {
 2907|  64.1k|                if (node == NULL )
  ------------------
  |  Branch (2907:21): [True: 6.57k, False: 57.5k]
  ------------------
 2908|  6.57k|                {
 2909|  6.57k|                    if (frameset == NULL) /* Implied body. */
  ------------------
  |  Branch (2909:25): [True: 4.93k, False: 1.63k]
  ------------------
 2910|  4.93k|                    {
 2911|  4.93k|                        node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|  4.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2912|  4.93k|                        state = STATE_PARSE_BODY;
 2913|  4.93k|                    } else {
 2914|  1.63k|                        state = STATE_COMPLETE;
 2915|  1.63k|                    }
 2916|       |
 2917|  6.57k|                    continue;
 2918|  6.57k|                }
 2919|       |
 2920|       |                /* Robustly handle html tags. */
 2921|  57.5k|                if (node->tag == html->tag)
  ------------------
  |  Branch (2921:21): [True: 1.53k, False: 56.0k]
  ------------------
 2922|  1.53k|                {
 2923|  1.53k|                    if (node->type != StartTag && frameset == NULL)
  ------------------
  |  Branch (2923:25): [True: 860, False: 674]
  |  Branch (2923:51): [True: 598, False: 262]
  ------------------
 2924|    598|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    598|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    598|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2925|       |
 2926|  1.53k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2927|  1.53k|                    continue;
 2928|  1.53k|                }
 2929|       |
 2930|       |                /* Deal with comments, etc. */
 2931|  56.0k|                if (InsertMisc(html, node))
  ------------------
  |  Branch (2931:21): [True: 459, False: 55.5k]
  ------------------
 2932|    459|                    continue;
 2933|       |
 2934|       |                /* If frameset document, coerce <body> to <noframes> */
 2935|  55.5k|                if ( nodeIsBODY(node) )
  ------------------
  |  |  375|  55.5k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  55.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 55.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 44.1k, False: 11.4k]
  |  |  |  |  |  Branch (275:54): [True: 3.71k, False: 40.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2936|  3.71k|                {
 2937|  3.71k|                    if (node->type != StartTag)
  ------------------
  |  Branch (2937:25): [True: 244, False: 3.47k]
  ------------------
 2938|    244|                    {
 2939|    244|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    244|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    244|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2940|    244|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    244|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    244|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2941|    244|                        continue;
 2942|    244|                    }
 2943|       |
 2944|  3.47k|                    if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  3.47k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (2944:26): [True: 3.47k, False: 0]
  ------------------
 2945|  3.47k|                    {
 2946|  3.47k|                        if (frameset != NULL)
  ------------------
  |  Branch (2946:29): [True: 1.98k, False: 1.48k]
  ------------------
 2947|  1.98k|                        {
 2948|  1.98k|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2949|       |
 2950|  1.98k|                            if (noframes == NULL)
  ------------------
  |  Branch (2950:33): [True: 1.56k, False: 424]
  ------------------
 2951|  1.56k|                            {
 2952|  1.56k|                                noframes = TY_(InferredTag)(doc, TidyTag_NOFRAMES);
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2953|  1.56k|                                TY_(InsertNodeAtEnd)(frameset, noframes);
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2954|  1.56k|                                TY_(Report)(doc, html, noframes, INSERTING_TAG);
  ------------------
  |  |   23|  1.56k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.56k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2955|  1.56k|                            }
 2956|    424|                            else
 2957|    424|                            {
 2958|    424|                                if (noframes->type == StartEndTag)
  ------------------
  |  Branch (2958:37): [True: 194, False: 230]
  ------------------
 2959|    194|                                    noframes->type = StartTag;
 2960|    424|                            }
 2961|       |
 2962|  1.98k|                            state = STATE_PARSE_NOFRAMES;
 2963|  1.98k|                            continue;
 2964|  1.98k|                        }
 2965|  3.47k|                    }
 2966|       |
 2967|  1.48k|                    TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |   23|  1.48k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.48k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |  209|  1.48k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|  1.48k|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|  1.48k|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|  1.48k|#define X10F                1024u
  |  |  ------------------
  ------------------
 2968|  1.48k|                    state = STATE_PARSE_BODY;
 2969|  1.48k|                    continue;
 2970|  3.47k|                }
 2971|       |
 2972|       |                /* Flag an error if we see more than one frameset. */
 2973|  51.8k|                if ( nodeIsFRAMESET(node) )
  ------------------
  |  |  376|  51.8k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  51.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 51.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 40.4k, False: 11.4k]
  |  |  |  |  |  Branch (275:54): [True: 6.79k, False: 33.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2974|  6.79k|                {
 2975|  6.79k|                    if (node->type != StartTag)
  ------------------
  |  Branch (2975:25): [True: 212, False: 6.58k]
  ------------------
 2976|    212|                    {
 2977|    212|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    212|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    212|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2978|    212|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    212|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    212|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2979|    212|                        continue;
 2980|    212|                    }
 2981|       |
 2982|  6.58k|                    if (frameset != NULL)
  ------------------
  |  Branch (2982:25): [True: 1.47k, False: 5.11k]
  ------------------
 2983|  1.47k|                        TY_(Report)(doc, html, node, DUPLICATE_FRAMESET);
  ------------------
  |  |   23|  1.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2984|  5.11k|                    else
 2985|  5.11k|                        frameset = node;
 2986|       |
 2987|  6.58k|                    state = STATE_PARSE_FRAMESET;
 2988|  6.58k|                    continue;
 2989|  6.79k|                }
 2990|       |
 2991|       |                /* If not a frameset document coerce <noframes> to <body>. */
 2992|  45.0k|                if ( nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|  45.0k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  45.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 45.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 33.6k, False: 11.4k]
  |  |  |  |  |  Branch (275:54): [True: 2.27k, False: 31.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2993|  2.27k|                {
 2994|  2.27k|                    if (node->type != StartTag)
  ------------------
  |  Branch (2994:25): [True: 94, False: 2.17k]
  ------------------
 2995|     94|                    {
 2996|     94|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|     94|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     94|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2997|     94|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|     94|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     94|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2998|     94|                        continue;
 2999|     94|                    }
 3000|       |
 3001|  2.17k|                    if (frameset == NULL)
  ------------------
  |  Branch (3001:25): [True: 345, False: 1.83k]
  ------------------
 3002|    345|                    {
 3003|    345|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    345|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    345|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3004|    345|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    345|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    345|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3005|    345|                        node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|    345|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    345|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3006|    345|                        state = STATE_PARSE_BODY;
 3007|    345|                        continue;
 3008|    345|                    }
 3009|       |
 3010|  1.83k|                    if (noframes == NULL)
  ------------------
  |  Branch (3010:25): [True: 1.53k, False: 297]
  ------------------
 3011|  1.53k|                    {
 3012|  1.53k|                        noframes = node;
 3013|  1.53k|                        TY_(InsertNodeAtEnd)(frameset, noframes);
  ------------------
  |  |   23|  1.53k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.53k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3014|  1.53k|                        state = STATE_PARSE_NOFRAMES;
 3015|  1.53k|                    }
 3016|    297|                    else
 3017|    297|                    {
 3018|    297|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    297|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    297|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3019|    297|                    }
 3020|       |
 3021|  1.83k|                    continue;
 3022|  2.17k|                }
 3023|       |
 3024|       |                /* Deal with some other element that we're not expecting. */
 3025|  42.7k|                if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  42.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3025:21): [True: 33.2k, False: 9.54k]
  ------------------
 3026|  33.2k|                {
 3027|  33.2k|                    if (node->tag && node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  30.8k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (3027:25): [True: 30.8k, False: 2.36k]
  |  Branch (3027:38): [True: 295, False: 30.5k]
  ------------------
 3028|    295|                    {
 3029|    295|                        MoveToHead(doc, html, node);
 3030|    295|                        continue;
 3031|    295|                    }
 3032|       |
 3033|       |                    /* Discard illegal frame element following a frameset. */
 3034|  32.9k|                    if ( frameset != NULL && nodeIsFRAME(node) )
  ------------------
  |  |  377|  2.89k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  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: 555, False: 2.33k]
  |  |  |  |  |  Branch (275:54): [True: 390, False: 165]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3034:26): [True: 2.89k, False: 30.0k]
  ------------------
 3035|    390|                    {
 3036|    390|                        TY_(Report)(doc, html, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    390|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    390|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3037|    390|                        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    390|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    390|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3038|    390|                        continue;
 3039|    390|                    }
 3040|  32.9k|                }
 3041|       |
 3042|  42.0k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  42.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3043|       |
 3044|       |                /* Insert other content into noframes element. */
 3045|  42.0k|                if (frameset)
  ------------------
  |  Branch (3045:21): [True: 4.23k, False: 37.8k]
  ------------------
 3046|  4.23k|                {
 3047|  4.23k|                    if (noframes == NULL)
  ------------------
  |  Branch (3047:25): [True: 3.36k, False: 868]
  ------------------
 3048|  3.36k|                    {
 3049|  3.36k|                        noframes = TY_(InferredTag)(doc, TidyTag_NOFRAMES);
  ------------------
  |  |   23|  3.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3050|  3.36k|                        TY_(InsertNodeAtEnd)(frameset, noframes);
  ------------------
  |  |   23|  3.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3051|  3.36k|                    }
 3052|    868|                    else
 3053|    868|                    {
 3054|    868|                        TY_(Report)(doc, html, node, NOFRAMES_CONTENT);
  ------------------
  |  |   23|    868|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    868|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3055|    868|                        if (noframes->type == StartEndTag)
  ------------------
  |  Branch (3055:29): [True: 216, False: 652]
  ------------------
 3056|    216|                            noframes->type = StartTag;
 3057|    868|                    }
 3058|       |
 3059|  4.23k|                    TY_(ConstrainVersion)(doc, VERS_FRAMESET);
  ------------------
  |  |   23|  4.23k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.23k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  TY_(ConstrainVersion)(doc, VERS_FRAMESET);
  ------------------
  |  |  209|  4.23k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|  4.23k|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|  4.23k|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|  4.23k|#define X10F                1024u
  |  |  ------------------
  ------------------
 3060|  4.23k|                    state = STATE_PARSE_NOFRAMES;
 3061|  4.23k|                    continue;
 3062|  4.23k|                }
 3063|       |
 3064|  37.8k|                node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|  37.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3065|       |
 3066|       |                /* Issue #132 - disable inserting BODY tag warning
 3067|       |                 BUT only if NOT --show-body-only yes */
 3068|  75.7k|                if (!showingBodyOnly(doc))
  ------------------
  |  |   28|  37.8k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  37.8k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  37.8k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3068:21): [True: 37.8k, False: 0]
  |  Branch (3068:21): [True: 37.8k, False: 0]
  ------------------
 3069|  37.8k|                    TY_(Report)(doc, html, node, INSERTING_TAG );
  ------------------
  |  |   23|  37.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3070|       |
 3071|  37.8k|                TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |   23|  37.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  37.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ConstrainVersion)(doc, ~VERS_FRAMESET);
  ------------------
  |  |  209|  37.8k|#define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  181|  37.8k|#define H40F                  16u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  184|  37.8k|#define H41F                 128u
  |  |  ------------------
  |  |               #define VERS_FRAMESET      (H40F|H41F|X10F)
  |  |  ------------------
  |  |  |  |  187|  37.8k|#define X10F                1024u
  |  |  ------------------
  ------------------
 3072|  37.8k|                state = STATE_PARSE_BODY;
 3073|  37.8k|                continue;
 3074|  42.0k|            } break;
 3075|       |
 3076|       |
 3077|       |            /**************************************************************
 3078|       |             In this case, we're ready to parse the head, and move on to
 3079|       |             look for the body or body alternative.
 3080|       |             **************************************************************/
 3081|  49.7k|            case STATE_PARSE_HEAD:
  ------------------
  |  Branch (3081:13): [True: 49.7k, False: 236k]
  ------------------
 3082|  49.7k|            {
 3083|  49.7k|                TidyParserMemory memory = {0};
 3084|  49.7k|                memory.identity = TY_(ParseHTML);
  ------------------
  |  |   23|  49.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3085|  49.7k|                memory.mode = mode;
 3086|  49.7k|                memory.original_node = html;
 3087|  49.7k|                memory.reentry_node = node;
 3088|  49.7k|                memory.reentry_mode = mode;
 3089|  49.7k|                memory.reentry_state = STATE_PARSE_HEAD_REENTER;
 3090|  49.7k|                TY_(InsertNodeAtEnd)(html, node);
  ------------------
  |  |   23|  49.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3091|  49.7k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  49.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3092|  49.7k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3093|  49.7k|                return node;
 3094|  42.0k|            } break;
 3095|       |
 3096|  49.7k|            case STATE_PARSE_HEAD_REENTER:
  ------------------
  |  Branch (3096:13): [True: 49.7k, False: 236k]
  ------------------
 3097|  49.7k|            {
 3098|  49.7k|                head = node;
 3099|  49.7k|                state = STATE_PRE_BODY;
 3100|  49.7k|            } break;
 3101|       |
 3102|       |
 3103|       |            /**************************************************************
 3104|       |             In this case, we can finally parse a body.
 3105|       |             **************************************************************/
 3106|  44.6k|            case STATE_PARSE_BODY:
  ------------------
  |  Branch (3106:13): [True: 44.6k, False: 241k]
  ------------------
 3107|  44.6k|            {
 3108|  44.6k|                TidyParserMemory memory = {0};
 3109|  44.6k|                memory.identity = NULL; /* we don't need to reenter */
 3110|  44.6k|                memory.mode = mode;
 3111|  44.6k|                memory.original_node = html;
 3112|  44.6k|                memory.reentry_node = NULL;
 3113|  44.6k|                memory.reentry_mode = mode;
 3114|  44.6k|                memory.reentry_state = STATE_COMPLETE;
 3115|  44.6k|                TY_(InsertNodeAtEnd)(html, node);
  ------------------
  |  |   23|  44.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3116|  44.6k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  44.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3117|  44.6k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3118|  44.6k|                return node;
 3119|  42.0k|            } break;
 3120|       |
 3121|       |
 3122|       |            /**************************************************************
 3123|       |             In this case, we will parse noframes. If necessary, the
 3124|       |             node is already inserted in the proper spot.
 3125|       |             **************************************************************/
 3126|  7.75k|            case STATE_PARSE_NOFRAMES:
  ------------------
  |  Branch (3126:13): [True: 7.75k, False: 278k]
  ------------------
 3127|  7.75k|            {
 3128|  7.75k|                TidyParserMemory memory = {0};
 3129|  7.75k|                memory.identity = TY_(ParseHTML);
  ------------------
  |  |   23|  7.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3130|  7.75k|                memory.mode = mode;
 3131|  7.75k|                memory.original_node = html;
 3132|  7.75k|                memory.reentry_node = frameset;
 3133|  7.75k|                memory.reentry_mode = mode;
 3134|  7.75k|                memory.reentry_state = STATE_PARSE_NOFRAMES_REENTER;
 3135|  7.75k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  7.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3136|  7.75k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3137|  7.75k|                return noframes;
 3138|  42.0k|            } break;
 3139|       |
 3140|  4.29k|            case STATE_PARSE_NOFRAMES_REENTER:
  ------------------
  |  Branch (3140:13): [True: 4.29k, False: 281k]
  ------------------
 3141|  4.29k|            {
 3142|  4.29k|                frameset = node;
 3143|  4.29k|                state = STATE_PRE_BODY;
 3144|  4.29k|            } break;
 3145|       |
 3146|       |
 3147|       |            /**************************************************************
 3148|       |             In this case, we parse the frameset, and look for noframes
 3149|       |             content to merge later if necessary.
 3150|       |             **************************************************************/
 3151|  6.58k|            case STATE_PARSE_FRAMESET:
  ------------------
  |  Branch (3151:13): [True: 6.58k, False: 279k]
  ------------------
 3152|  6.58k|            {
 3153|  6.58k|                TidyParserMemory memory = {0};
 3154|  6.58k|                memory.identity = TY_(ParseHTML);
  ------------------
  |  |   23|  6.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3155|  6.58k|                memory.mode = mode;
 3156|  6.58k|                memory.original_node = html;
 3157|  6.58k|                memory.reentry_node = frameset;
 3158|  6.58k|                memory.reentry_mode = mode;
 3159|  6.58k|                memory.reentry_state = STATE_PARSE_FRAMESET_REENTER;
 3160|  6.58k|                TY_(InsertNodeAtEnd)(html, node);
  ------------------
  |  |   23|  6.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3161|  6.58k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  6.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3162|  6.58k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3163|  6.58k|                return node;
 3164|  42.0k|            } break;
 3165|       |
 3166|  6.56k|            case (STATE_PARSE_FRAMESET_REENTER):
  ------------------
  |  Branch (3166:13): [True: 6.56k, False: 279k]
  ------------------
 3167|  6.56k|            {
 3168|  6.56k|                frameset = node;
 3169|       |                /*
 3170|       |                 See if it includes a noframes element so that
 3171|       |                 we can merge subsequent noframes elements.
 3172|       |                 */
 3173|  10.7k|                for (node = frameset->content; node; node = node->next)
  ------------------
  |  Branch (3173:48): [True: 4.22k, False: 6.56k]
  ------------------
 3174|  4.22k|                {
 3175|  4.22k|                    if ( nodeIsNOFRAMES(node) )
  ------------------
  |  |  379|  4.22k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  4.22k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.22k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.81k, False: 409]
  |  |  |  |  |  Branch (275:54): [True: 2.84k, False: 966]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3176|  2.84k|                        noframes = node;
 3177|  4.22k|                }
 3178|  6.56k|                state = STATE_PRE_BODY;
 3179|  6.56k|            } 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: 286k]
  ------------------
 3186|      0|            {
 3187|      0|                state = STATE_COMPLETE;
 3188|      0|            }
 3189|   286k|        } /* switch */
 3190|   286k|    } /* while */
 3191|       |
 3192|  1.63k|    DEBUG_LOG_EXIT;
 3193|       |    return NULL;
 3194|   110k|}
prvTidyParseInline:
 3206|  3.97M|{
 3207|  3.97M|    Lexer* lexer = doc->lexer;
 3208|  3.97M|    Node *node = NULL;
 3209|  3.97M|    Node *parent = NULL;
 3210|  3.97M|    DEBUG_LOG_COUNTERS;
 3211|       |    
 3212|  3.97M|    if ( element == NULL )
  ------------------
  |  Branch (3212:10): [True: 1.90M, False: 2.07M]
  ------------------
 3213|  1.90M|    {
 3214|  1.90M|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  1.90M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.90M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3215|  1.90M|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 3216|  1.90M|        DEBUG_LOG_REENTER_WITH_NODE(node);
 3217|  1.90M|        element = memory.original_node;
 3218|  1.90M|        DEBUG_LOG_GET_OLD_MODE;
 3219|  1.90M|        mode = memory.reentry_mode;
 3220|  1.90M|        DEBUG_LOG_CHANGE_MODE;
 3221|  1.90M|    }
 3222|  2.07M|    else
 3223|  2.07M|    {
 3224|  2.07M|        DEBUG_LOG_ENTER_WITH_NODE(element);
 3225|       |
 3226|  2.07M|        if (element->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  2.07M|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (3226:13): [True: 0, False: 2.07M]
  ------------------
 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.07M|        if ((TY_(nodeHasCM)(element, CM_BLOCK) || nodeIsDT(element)) &&
  ------------------
  |  |   23|  2.07M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.07M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ((TY_(nodeHasCM)(element, CM_BLOCK) || nodeIsDT(element)) &&
  ------------------
  |  |  142|  2.07M|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                      if ((TY_(nodeHasCM)(element, CM_BLOCK) || nodeIsDT(element)) &&
  ------------------
  |  |  391|  1.97M|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  275|  1.97M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.97M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.97M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.72k, False: 1.97M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3248:14): [True: 97.4k, False: 1.97M]
  ------------------
 3249|   102k|            !TY_(nodeHasCM)(element, CM_MIXED))
  ------------------
  |  |   23|   102k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   102k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          !TY_(nodeHasCM)(element, CM_MIXED))
  ------------------
  |  |  156|   102k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (3249:13): [True: 100k, False: 1.19k]
  ------------------
 3250|   100k|            TY_(InlineDup)(doc, NULL);
  ------------------
  |  |   23|   100k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   100k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3251|  1.97M|        else if (TY_(nodeHasCM)(element, CM_INLINE))
  ------------------
  |  |   23|  1.97M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.97M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      else if (TY_(nodeHasCM)(element, CM_INLINE))
  ------------------
  |  |  143|  1.97M|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3251:18): [True: 1.97M, False: 234]
  ------------------
 3252|  1.97M|            TY_(PushInline)(doc, element);
  ------------------
  |  |   23|  1.97M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.97M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3253|       |
 3254|  2.07M|        if ( nodeIsNOBR(element) )
  ------------------
  |  |  415|  2.07M|#define nodeIsNOBR( node )       TagIsId( node, TidyTag_NOBR )
  |  |  ------------------
  |  |  |  |  275|  2.07M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.07M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.07M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.06k, False: 2.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3255|  1.06k|            doc->badLayout |= USING_NOBR;
  ------------------
  |  |  293|  1.06k|#define USING_NOBR              4
  ------------------
 3256|  2.07M|        else if ( nodeIsFONT(element) )
  ------------------
  |  |  417|  2.07M|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  2.07M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.07M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.07M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.72M, False: 342k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3257|  1.72M|            doc->badLayout |= USING_FONT;
  ------------------
  |  |  294|  1.72M|#define USING_FONT              8
  ------------------
 3258|       |
 3259|       |        /* Inline elements may or may not be within a preformatted element */
 3260|  2.07M|        if (mode != Preformatted)
  ------------------
  |  Branch (3260:13): [True: 2.07M, False: 0]
  ------------------
 3261|  2.07M|        {
 3262|  2.07M|            DEBUG_LOG_GET_OLD_MODE;
 3263|  2.07M|            mode = MixedContent;
 3264|  2.07M|            DEBUG_LOG_CHANGE_MODE;
 3265|  2.07M|        }
 3266|  2.07M|    }
 3267|       |    
 3268|  4.15M|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|  4.15M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.15M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3268:12): [True: 2.84M, False: 1.31M]
  ------------------
 3269|  2.84M|    {
 3270|       |        /* end tag for current element */
 3271|  2.84M|        if (node->tag == element->tag && node->type == EndTag)
  ------------------
  |  Branch (3271:13): [True: 1.82M, False: 1.01M]
  |  Branch (3271:42): [True: 19.0k, False: 1.81M]
  ------------------
 3272|  19.0k|        {
 3273|  19.0k|            if (element->tag->model & CM_INLINE)
  ------------------
  |  |  143|  19.0k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3273:17): [True: 17.2k, False: 1.85k]
  ------------------
 3274|  17.2k|                TY_(PopInline)( doc, node );
  ------------------
  |  |   23|  17.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3275|       |
 3276|  19.0k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  19.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3277|       |
 3278|  19.0k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3278:17): [True: 19.0k, False: 0]
  ------------------
 3279|  19.0k|                TrimSpaces(doc, element);
 3280|       |
 3281|       |            /*
 3282|       |             if a font element wraps an anchor and nothing else
 3283|       |             then move the font element inside the anchor since
 3284|       |             otherwise it won't alter the anchor text color
 3285|       |            */
 3286|  19.0k|            if ( nodeIsFONT(element) &&
  ------------------
  |  |  417|  19.0k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  38.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 19.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 19.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 13.1k, False: 5.88k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3287|  13.1k|                 element->content && element->content == element->last )
  ------------------
  |  Branch (3287:18): [True: 12.9k, False: 222]
  |  Branch (3287:38): [True: 2.43k, False: 10.5k]
  ------------------
 3288|  2.43k|            {
 3289|  2.43k|                Node *child = element->content;
 3290|       |
 3291|  2.43k|                if ( nodeIsA(child) )
  ------------------
  |  |  401|  2.43k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  2.43k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.43k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.22k, False: 207]
  |  |  |  |  |  Branch (275:54): [True: 1.03k, False: 1.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|  2.43k|            }
 3309|       |
 3310|  19.0k|            element->closed = yes;
 3311|  19.0k|            TrimSpaces( doc, element );
 3312|       |
 3313|  19.0k|            DEBUG_LOG_EXIT;
 3314|  19.0k|            return NULL;
 3315|  19.0k|        }
 3316|       |
 3317|       |        /* <u>...<u>  map 2nd <u> to </u> if 1st is explicit */
 3318|       |        /* (see additional conditions below) */
 3319|       |        /* otherwise emphasis nesting is probably unintentional */
 3320|       |        /* big, small, sub, sup have cumulative effect to leave them alone */
 3321|  2.82M|        if ( node->type == StartTag
  ------------------
  |  Branch (3321:14): [True: 2.56M, False: 257k]
  ------------------
 3322|  2.56M|             && node->tag == element->tag
  ------------------
  |  Branch (3322:17): [True: 1.81M, False: 756k]
  ------------------
 3323|  1.81M|             && TY_(IsPushed)( doc, node )
  ------------------
  |  |   23|  1.81M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.81M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3323:17): [True: 1.72M, False: 87.8k]
  ------------------
 3324|  1.72M|             && !node->implicit
  ------------------
  |  Branch (3324:17): [True: 160k, False: 1.56M]
  ------------------
 3325|   160k|             && !element->implicit
  ------------------
  |  Branch (3325:17): [True: 154k, False: 5.37k]
  ------------------
 3326|   154k|             && node->tag && (node->tag->model & CM_INLINE)
  ------------------
  |  |  143|   154k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3326:17): [True: 154k, False: 0]
  |  Branch (3326:30): [True: 154k, False: 0]
  ------------------
 3327|  2.82M|             && !nodeIsA(node)
  ------------------
  |  |  401|   154k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  2.97M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 154k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 154k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.10k, False: 153k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3328|  2.82M|             && !nodeIsFONT(node)
  ------------------
  |  |  417|   153k|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  275|  2.97M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 153k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 153k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 131k, False: 22.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3329|  2.82M|             && !nodeIsBIG(node)
  ------------------
  |  |  407|  22.3k|#define nodeIsBIG( node )        TagIsId( node, TidyTag_BIG )
  |  |  ------------------
  |  |  |  |  275|  2.84M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 22.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 22.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 403, False: 21.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3330|  2.82M|             && !nodeIsSMALL(node)
  ------------------
  |  |  408|  21.9k|#define nodeIsSMALL( node )      TagIsId( node, TidyTag_SMALL )
  |  |  ------------------
  |  |  |  |  275|  2.84M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 21.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 21.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 9.87k, False: 12.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3331|  2.82M|             && !nodeIsSUB(node)
  ------------------
  |  |  448|  12.0k|#define nodeIsSUB( node )        TagIsId( node, TidyTag_SUB )
  |  |  ------------------
  |  |  |  |  275|  2.83M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 12.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 12.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 297, False: 11.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3332|  2.82M|             && !nodeIsSUP(node)
  ------------------
  |  |  449|  11.7k|#define nodeIsSUP( node )        TagIsId( node, TidyTag_SUP )
  |  |  ------------------
  |  |  |  |  275|  2.83M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 11.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 202, False: 11.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3333|  2.82M|             && !nodeIsQ(node)
  ------------------
  |  |  432|  11.5k|#define nodeIsQ( node )          TagIsId( node, TidyTag_Q )
  |  |  ------------------
  |  |  |  |  275|  2.83M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 11.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.95k, False: 8.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3334|  2.82M|             && !nodeIsSPAN(node)
  ------------------
  |  |  430|  8.60k|#define nodeIsSPAN( node )       TagIsId( node, TidyTag_SPAN )
  |  |  ------------------
  |  |  |  |  275|  2.83M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.60k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.60k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 263, False: 8.34k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3335|  8.34k|             && cfgBool(doc, TidyCoerceEndTags)
  ------------------
  |  |  418|  8.34k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  8.34k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 8.34k, False: 0]
  |  |  ------------------
  ------------------
 3336|  2.82M|           )
 3337|  8.34k|        {
 3338|       |            /* proceeds only if "node" does not have any attribute and
 3339|       |               follows a text node not finishing with a space */
 3340|  8.34k|            if (element->content != NULL && node->attributes == NULL
  ------------------
  |  Branch (3340:17): [True: 3.50k, False: 4.84k]
  |  Branch (3340:45): [True: 2.92k, False: 573]
  ------------------
 3341|  2.92k|                && TY_(nodeIsText)(element->last)
  ------------------
  |  |   23|  2.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3341:20): [True: 2.15k, False: 774]
  ------------------
 3342|  2.15k|                && !TY_(TextNodeEndWithSpace)(doc->lexer, element->last) )
  ------------------
  |  |   23|  2.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3342:20): [True: 1.68k, False: 466]
  ------------------
 3343|  1.68k|            {
 3344|  1.68k|                TY_(Report)(doc, element, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|  1.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3345|  1.68k|                node->type = EndTag;
 3346|  1.68k|                TY_(UngetToken)(doc);
  ------------------
  |  |   23|  1.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3347|  1.68k|                continue;
 3348|  1.68k|            }
 3349|       |
 3350|  6.65k|            if (node->attributes == NULL || element->attributes == NULL)
  ------------------
  |  Branch (3350:17): [True: 4.97k, False: 1.67k]
  |  Branch (3350:45): [True: 322, False: 1.35k]
  ------------------
 3351|  5.30k|                TY_(Report)(doc, element, node, NESTED_EMPHASIS);
  ------------------
  |  |   23|  5.30k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.30k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3352|  6.65k|        }
 3353|  2.81M|        else if ( TY_(IsPushed)(doc, node) && node->type == StartTag &&
  ------------------
  |  |   23|  2.81M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.81M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3353:19): [True: 1.88M, False: 935k]
  |  Branch (3353:47): [True: 1.86M, False: 13.3k]
  ------------------
 3354|  1.86M|                  nodeIsQ(node) )
  ------------------
  |  |  432|  1.86M|#define nodeIsQ( node )          TagIsId( node, TidyTag_Q )
  |  |  ------------------
  |  |  |  |  275|  1.86M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.86M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.86M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 24.1k, False: 1.84M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3355|  24.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|  24.1k|            if (TY_(HTMLVersion)(doc) != HT50)
  ------------------
  |  |   23|  24.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(HTMLVersion)(doc) != HT50)
  ------------------
  |  |  200|  24.1k|#define HT50              131072u
  ------------------
  |  Branch (3360:17): [True: 24.1k, False: 0]
  ------------------
 3361|  24.1k|            {
 3362|  24.1k|                TY_(Report)(doc, element, node, NESTED_QUOTATION);
  ------------------
  |  |   23|  24.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3363|  24.1k|            }
 3364|  24.1k|        }
 3365|       |
 3366|  2.82M|        if ( TY_(nodeIsText)(node) )
  ------------------
  |  |   23|  2.82M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.82M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3366:14): [True: 72.3k, False: 2.75M]
  ------------------
 3367|  72.3k|        {
 3368|       |            /* only called for 1st child */
 3369|  72.3k|            if ( element->content == NULL && !(mode & Preformatted) )
  ------------------
  |  Branch (3369:18): [True: 50.7k, False: 21.5k]
  |  Branch (3369:46): [True: 50.7k, False: 0]
  ------------------
 3370|  50.7k|                TrimSpaces( doc, element );
 3371|       |
 3372|  72.3k|            if ( node->start >= node->end )
  ------------------
  |  Branch (3372:18): [True: 391, False: 72.0k]
  ------------------
 3373|    391|            {
 3374|    391|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    391|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    391|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3375|    391|                continue;
 3376|    391|            }
 3377|       |
 3378|  72.0k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  72.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  72.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3379|  72.0k|            continue;
 3380|  72.3k|        }
 3381|       |
 3382|       |        /* mixed content model so allow text */
 3383|  2.75M|        if (InsertMisc(element, node))
  ------------------
  |  Branch (3383:13): [True: 37.2k, False: 2.71M]
  ------------------
 3384|  37.2k|            continue;
 3385|       |
 3386|       |        /* deal with HTML tags */
 3387|  2.71M|        if ( nodeIsHTML(node) )
  ------------------
  |  |  370|  2.71M|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  2.71M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.71M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.66M, False: 50.9k]
  |  |  |  |  |  Branch (275:54): [True: 460, False: 2.66M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3388|    460|        {
 3389|    460|            if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|    460|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    460|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3389:18): [True: 259, False: 201]
  ------------------
 3390|    259|            {
 3391|    259|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|    259|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    259|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3392|    259|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    259|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    259|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3393|    259|                continue;
 3394|    259|            }
 3395|       |
 3396|       |            /* otherwise infer end of inline element */
 3397|    201|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    201|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    201|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3398|       |
 3399|    201|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3399:17): [True: 201, False: 0]
  ------------------
 3400|    201|                TrimSpaces(doc, element);
 3401|       |
 3402|    201|            DEBUG_LOG_EXIT;
 3403|    201|            return NULL;
 3404|    460|        }
 3405|       |
 3406|       |        /* within <dt> or <pre> map <p> to <br> */
 3407|  2.71M|        if ( nodeIsP(node) &&
  ------------------
  |  |  385|  2.71M|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  5.42M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.71M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.66M, False: 50.9k]
  |  |  |  |  |  Branch (275:54): [True: 298k, False: 2.36M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3408|   298k|             node->type == StartTag &&
  ------------------
  |  Branch (3408:14): [True: 287k, False: 10.0k]
  ------------------
 3409|   287k|             ( (mode & Preformatted) ||
  ------------------
  |  Branch (3409:16): [True: 0, False: 287k]
  ------------------
 3410|   287k|               nodeIsDT(element) ||
  ------------------
  |  |  391|   287k|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  275|   575k|#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: 1.57k, False: 286k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3411|   286k|               DescendantOf(element, TidyTag_DT )
  ------------------
  |  Branch (3411:16): [True: 1.70k, False: 284k]
  ------------------
 3412|   287k|             )
 3413|  2.71M|           )
 3414|  3.27k|        {
 3415|  3.27k|            node->tag = TY_(LookupTagDef)( TidyTag_BR );
  ------------------
  |  |   23|  3.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3416|  3.27k|            TidyDocFree(doc, node->element);
  ------------------
  |  |  159|  3.27k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  3.27k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 3417|  3.27k|            node->element = TY_(tmbstrdup)(doc->allocator, "br");
  ------------------
  |  |   23|  3.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3418|  3.27k|            TrimSpaces(doc, element);
 3419|  3.27k|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  3.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3420|  3.27k|            continue;
 3421|  3.27k|        }
 3422|       |
 3423|       |        /* <p> allowed within <address> in HTML 4.01 Transitional */
 3424|  2.70M|        if ( nodeIsP(node) &&
  ------------------
  |  |  385|  2.70M|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  5.41M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.70M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.65M, False: 50.9k]
  |  |  |  |  |  Branch (275:54): [True: 294k, False: 2.36M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3425|   294k|             node->type == StartTag &&
  ------------------
  |  Branch (3425:14): [True: 284k, False: 10.0k]
  ------------------
 3426|   284k|             nodeIsADDRESS(element) )
  ------------------
  |  |  438|   284k|#define nodeIsADDRESS( node )    TagIsId( node, TidyTag_ADDRESS )
  |  |  ------------------
  |  |  |  |  275|   284k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 284k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 284k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 284k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.70M|        if ( node->tag == NULL || nodeIsPARAM(node) )
  ------------------
  |  |  409|  2.65M|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|  2.65M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.65M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.65M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 198, False: 2.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3435:14): [True: 50.9k, False: 2.65M]
  ------------------
 3436|  51.1k|        {
 3437|  51.1k|            TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  51.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3438|  51.1k|            TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  51.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  51.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3439|  51.1k|            continue;
 3440|  51.1k|        }
 3441|       |
 3442|  2.65M|        if ( nodeIsBR(node) && node->type == EndTag )
  ------------------
  |  |  400|  2.65M|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  5.31M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.65M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.65M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.74k, False: 2.65M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3442:32): [True: 209, False: 3.54k]
  ------------------
 3443|    209|            node->type = StartTag;
 3444|       |
 3445|  2.65M|        if ( node->type == EndTag )
  ------------------
  |  Branch (3445:14): [True: 63.5k, False: 2.59M]
  ------------------
 3446|  63.5k|        {
 3447|       |           /* coerce </br> to <br> */
 3448|  63.5k|           if ( nodeIsBR(node) )
  ------------------
  |  |  400|  63.5k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  63.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 63.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 63.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 63.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3449|      0|                node->type = StartTag;
 3450|  63.5k|           else if ( nodeIsP(node) )
  ------------------
  |  |  385|  63.5k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  63.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 63.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 63.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 9.99k, False: 53.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3451|  9.99k|           {
 3452|       |               /* coerce unmatched </p> to <br><br> */
 3453|  9.99k|                if ( !DescendantOf(element, TidyTag_P) )
  ------------------
  |  Branch (3453:22): [True: 1.69k, False: 8.30k]
  ------------------
 3454|  1.69k|                {
 3455|  1.69k|                    TY_(CoerceNode)(doc, node, TidyTag_BR, no, no);
  ------------------
  |  |   23|  1.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3456|  1.69k|                    TrimSpaces( doc, element );
 3457|  1.69k|                    TY_(InsertNodeAtEnd)( element, node );
  ------------------
  |  |   23|  1.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3458|  1.69k|                    node = TY_(InferredTag)(doc, TidyTag_BR);
  ------------------
  |  |   23|  1.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3459|  1.69k|                    TY_(InsertNodeAtEnd)( element, node ); /* todo: check this */
  ------------------
  |  |   23|  1.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3460|  1.69k|                    continue;
 3461|  1.69k|                }
 3462|  9.99k|           }
 3463|  53.5k|           else if ( TY_(nodeHasCM)(node, CM_INLINE)
  ------------------
  |  |   23|  53.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  53.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                         else if ( TY_(nodeHasCM)(node, CM_INLINE)
  ------------------
  |  |  143|  53.5k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3463:22): [True: 46.3k, False: 7.18k]
  ------------------
 3464|  53.5k|                     && !nodeIsA(node)
  ------------------
  |  |  401|  46.3k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  99.9k|#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: 13.3k, False: 33.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3465|  33.0k|                     && !TY_(nodeHasCM)(node, CM_OBJECT)
  ------------------
  |  |   23|  33.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  33.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && !TY_(nodeHasCM)(node, CM_OBJECT)
  ------------------
  |  |  150|  33.0k|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (3465:25): [True: 14.6k, False: 18.3k]
  ------------------
 3466|  14.6k|                     && TY_(nodeHasCM)(element, CM_INLINE) )
  ------------------
  |  |   23|  14.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && TY_(nodeHasCM)(element, CM_INLINE) )
  ------------------
  |  |  143|  14.6k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3466:25): [True: 14.0k, False: 684]
  ------------------
 3467|  14.0k|            {
 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|  14.0k|                if ( !nodeIsA(element)
  ------------------
  |  |  401|  14.0k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  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: 200, False: 13.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3476|  13.8k|                     && (node->tag != element->tag)
  ------------------
  |  Branch (3476:25): [True: 13.8k, False: 0]
  ------------------
 3477|  13.8k|                     && TY_(IsPushed)( doc, node )
  ------------------
  |  |   23|  13.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3477:25): [True: 13.2k, False: 516]
  ------------------
 3478|  13.2k|                     && TY_(IsPushed)( doc, element ) )
  ------------------
  |  |   23|  13.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3478:25): [True: 13.0k, False: 199]
  ------------------
 3479|  13.0k|                {
 3480|       |                    /* we have something like
 3481|       |                       <b>bold <i>bold and italic</b> italics</i> */
 3482|  13.0k|                    if ( TY_(SwitchInline)( doc, element, node ) )
  ------------------
  |  |   23|  13.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3482:26): [True: 11.7k, False: 1.34k]
  ------------------
 3483|  11.7k|                    {
 3484|  11.7k|                        TY_(Report)(doc, element, node, NON_MATCHING_ENDTAG);
  ------------------
  |  |   23|  11.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3485|  11.7k|                        TY_(UngetToken)( doc ); /* put this back */
  ------------------
  |  |   23|  11.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3486|  11.7k|                        TY_(InlineDup1)( doc, NULL, element ); /* dupe the <i>, after </b> */
  ------------------
  |  |   23|  11.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  11.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3487|  11.7k|                        if (!(mode & Preformatted))
  ------------------
  |  Branch (3487:29): [True: 11.7k, False: 0]
  ------------------
 3488|  11.7k|                            TrimSpaces( doc, element );
 3489|       |
 3490|  11.7k|                        DEBUG_LOG_EXIT;
 3491|  11.7k|                        return NULL; /* close <i>, but will re-open it, after </b> */
 3492|  11.7k|                    }
 3493|  13.0k|                }
 3494|  2.26k|                TY_(PopInline)( doc, element );
  ------------------
  |  |   23|  2.26k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.26k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3495|       |
 3496|  2.26k|                if ( !nodeIsA(element) )
  ------------------
  |  |  401|  2.26k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  2.26k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.26k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.26k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 200, False: 2.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3497|  2.06k|                {
 3498|  2.06k|                    if ( nodeIsA(node) && node->tag != element->tag )
  ------------------
  |  |  401|  2.06k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  4.12k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.06k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.06k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 2.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3498:43): [True: 0, False: 0]
  ------------------
 3499|      0|                    {
 3500|      0|                       TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3501|      0|                       TY_(UngetToken)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3502|      0|                    }
 3503|  2.06k|                    else
 3504|  2.06k|                    {
 3505|  2.06k|                        TY_(Report)(doc, element, node, NON_MATCHING_ENDTAG);
  ------------------
  |  |   23|  2.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3506|  2.06k|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.06k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.06k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3507|  2.06k|                    }
 3508|       |
 3509|  2.06k|                    if (!(mode & Preformatted))
  ------------------
  |  Branch (3509:25): [True: 2.06k, False: 0]
  ------------------
 3510|  2.06k|                        TrimSpaces(doc, element);
 3511|       |
 3512|  2.06k|                    DEBUG_LOG_EXIT;
 3513|  2.06k|                    return NULL;
 3514|  2.06k|                }
 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.26k|            }  /* special case </tr> etc. for stuff moved in front of table */
 3521|  39.5k|            else if ( lexer->exiled
  ------------------
  |  Branch (3521:23): [True: 3.94k, False: 35.5k]
  ------------------
 3522|  3.94k|                     && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |   23|  3.94k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.94k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  146|  3.94k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                   && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  393|  3.70k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  3.70k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.70k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.70k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 439, False: 3.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3522:26): [True: 245, False: 3.70k]
  ------------------
 3523|    684|            {
 3524|    684|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    684|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    684|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3525|    684|                TrimSpaces(doc, element);
 3526|       |
 3527|    684|                DEBUG_LOG_EXIT;
 3528|    684|                return NULL;
 3529|    684|            }
 3530|  63.5k|        }
 3531|       |
 3532|       |        /* allow any header tag to end current header */
 3533|  2.64M|        if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |   23|  2.64M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.64M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |  153|  2.64M|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
                      if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |   23|  13.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( TY_(nodeHasCM)(node, CM_HEADING) && TY_(nodeHasCM)(element, CM_HEADING) )
  ------------------
  |  |  153|  13.6k|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
  |  Branch (3533:14): [True: 13.6k, False: 2.62M]
  |  Branch (3533:50): [True: 1.81k, False: 11.8k]
  ------------------
 3534|  1.81k|        {
 3535|       |
 3536|  1.81k|            if ( node->tag == element->tag )
  ------------------
  |  Branch (3536:18): [True: 511, False: 1.29k]
  ------------------
 3537|    511|            {
 3538|    511|                TY_(Report)(doc, element, node, NON_MATCHING_ENDTAG );
  ------------------
  |  |   23|    511|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    511|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3539|    511|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    511|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    511|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3540|    511|            }
 3541|  1.29k|            else
 3542|  1.29k|            {
 3543|  1.29k|                TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|  1.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3544|  1.29k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3545|  1.29k|            }
 3546|       |
 3547|  1.81k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3547:17): [True: 1.81k, False: 0]
  ------------------
 3548|  1.81k|                TrimSpaces(doc, element);
 3549|       |
 3550|  1.81k|            DEBUG_LOG_EXIT;
 3551|  1.81k|            return NULL;
 3552|  1.81k|        }
 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.64M|        if ( nodeIsA(node) && !node->implicit &&
  ------------------
  |  |  401|  2.64M|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  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.64M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 17.9k, False: 2.62M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3560:31): [True: 17.1k, False: 802]
  ------------------
 3561|  17.1k|             (nodeIsA(element) || DescendantOf(element, TidyTag_A)) )
  ------------------
  |  |  401|  17.1k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  34.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 17.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 17.1k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.17k, False: 15.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3561:35): [True: 13.1k, False: 2.78k]
  ------------------
 3562|  14.3k|        {
 3563|       |            /* coerce <a> to </a> unless it has some attributes */
 3564|       |            /* #427827 - fix by Randy Waki and Bjoern Hoehrmann 23 Aug 00 */
 3565|       |            /* other fixes by Dave Raggett */
 3566|       |            /* if (node->attributes == NULL) */
 3567|  14.3k|            if (node->type != EndTag && node->attributes == NULL
  ------------------
  |  Branch (3567:17): [True: 1.64k, False: 12.6k]
  |  Branch (3567:41): [True: 859, False: 786]
  ------------------
 3568|    859|                && cfgBool(doc, TidyCoerceEndTags) )
  ------------------
  |  |  418|    859|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    859|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 859, False: 0]
  |  |  ------------------
  ------------------
 3569|    859|            {
 3570|    859|                node->type = EndTag;
 3571|    859|                TY_(Report)(doc, element, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|    859|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    859|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3572|       |                /* TY_(PopInline)( doc, node ); */
 3573|    859|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|    859|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    859|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3574|    859|                continue;
 3575|    859|            }
 3576|       |
 3577|  13.4k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  13.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3578|  13.4k|            TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  13.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  13.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3579|       |            /* TY_(PopInline)( doc, element ); */
 3580|       |
 3581|  13.4k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3581:17): [True: 13.4k, False: 0]
  ------------------
 3582|  13.4k|                TrimSpaces(doc, element);
 3583|       |
 3584|  13.4k|            DEBUG_LOG_EXIT;
 3585|  13.4k|            return NULL;
 3586|  14.3k|        }
 3587|       |
 3588|  2.62M|        if (element->tag->model & CM_HEADING)
  ------------------
  |  |  153|  2.62M|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
  |  Branch (3588:13): [True: 5.71k, False: 2.62M]
  ------------------
 3589|  5.71k|        {
 3590|  5.71k|            if ( nodeIsCENTER(node) || nodeIsDIV(node) )
  ------------------
  |  |  420|  5.71k|#define nodeIsCENTER( node )     TagIsId( node, TidyTag_CENTER )
  |  |  ------------------
  |  |  |  |  275|  11.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.71k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.71k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 382, False: 5.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsCENTER(node) || nodeIsDIV(node) )
  ------------------
  |  |  429|  5.33k|#define nodeIsDIV( node )        TagIsId( node, TidyTag_DIV )
  |  |  ------------------
  |  |  |  |  275|  5.33k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.33k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.33k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.00k, False: 3.32k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3591|  2.38k|            {
 3592|  2.38k|                if (!TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  2.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3592:21): [True: 223, False: 2.16k]
  ------------------
 3593|    223|                {
 3594|    223|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    223|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    223|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3595|    223|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    223|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    223|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3596|    223|                    continue;
 3597|    223|                }
 3598|       |
 3599|  2.16k|                TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  2.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3600|       |
 3601|       |                /* insert center as parent if heading is empty */
 3602|  2.16k|                if (element->content == NULL)
  ------------------
  |  Branch (3602:21): [True: 1.39k, False: 770]
  ------------------
 3603|  1.39k|                {
 3604|  1.39k|                    InsertNodeAsParent(element, node);
 3605|  1.39k|                    continue;
 3606|  1.39k|                }
 3607|       |
 3608|       |                /* split heading and make center parent of 2nd part */
 3609|    770|                TY_(InsertNodeAfterElement)(element, node);
  ------------------
  |  |   23|    770|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    770|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3610|       |
 3611|    770|                if (!(mode & Preformatted))
  ------------------
  |  Branch (3611:21): [True: 770, False: 0]
  ------------------
 3612|    770|                    TrimSpaces(doc, element);
 3613|       |
 3614|    770|                element = TY_(CloneNode)( doc, element );
  ------------------
  |  |   23|    770|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    770|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3615|    770|                TY_(InsertNodeAtEnd)(node, element);
  ------------------
  |  |   23|    770|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    770|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3616|    770|                continue;
 3617|  2.16k|            }
 3618|       |
 3619|  3.32k|            if ( nodeIsHR(node) )
  ------------------
  |  |  380|  3.32k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  3.32k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.32k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.32k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.68k, False: 1.64k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3620|  1.68k|            {
 3621|  1.68k|                if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3621:22): [True: 263, False: 1.42k]
  ------------------
 3622|    263|                {
 3623|    263|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    263|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    263|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3624|    263|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    263|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    263|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3625|    263|                    continue;
 3626|    263|                }
 3627|       |
 3628|  1.42k|                TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3629|       |
 3630|       |                /* insert hr before heading if heading is empty */
 3631|  1.42k|                if (element->content == NULL)
  ------------------
  |  Branch (3631:21): [True: 418, False: 1.00k]
  ------------------
 3632|    418|                {
 3633|    418|                    TY_(InsertNodeBeforeElement)(element, node);
  ------------------
  |  |   23|    418|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    418|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3634|    418|                    continue;
 3635|    418|                }
 3636|       |
 3637|       |                /* split heading and insert hr before 2nd part */
 3638|  1.00k|                TY_(InsertNodeAfterElement)(element, node);
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3639|       |
 3640|  1.00k|                if (!(mode & Preformatted))
  ------------------
  |  Branch (3640:21): [True: 1.00k, False: 0]
  ------------------
 3641|  1.00k|                    TrimSpaces(doc, element);
 3642|       |
 3643|  1.00k|                element = TY_(CloneNode)( doc, element );
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3644|  1.00k|                TY_(InsertNodeAfterElement)(node, element);
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3645|  1.00k|                continue;
 3646|  1.42k|            }
 3647|  3.32k|        }
 3648|       |
 3649|  2.62M|        if ( nodeIsDT(element) )
  ------------------
  |  |  391|  2.62M|#define nodeIsDT( node )         TagIsId( node, TidyTag_DT )
  |  |  ------------------
  |  |  |  |  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.62M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 7.82k, False: 2.61M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3650|  7.82k|        {
 3651|  7.82k|            if ( nodeIsHR(node) )
  ------------------
  |  |  380|  7.82k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  7.82k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 7.82k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 7.82k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.83k, False: 5.98k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3652|  1.83k|            {
 3653|  1.83k|                Node *dd;
 3654|  1.83k|                if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  1.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3654:22): [True: 227, False: 1.60k]
  ------------------
 3655|    227|                {
 3656|    227|                    TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    227|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    227|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3657|    227|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    227|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    227|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3658|    227|                    continue;
 3659|    227|                }
 3660|       |
 3661|  1.60k|                TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.60k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.60k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3662|  1.60k|                dd = TY_(InferredTag)(doc, TidyTag_DD);
  ------------------
  |  |   23|  1.60k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.60k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3663|       |
 3664|       |                /* insert hr within dd before dt if dt is empty */
 3665|  1.60k|                if (element->content == NULL)
  ------------------
  |  Branch (3665:21): [True: 956, False: 649]
  ------------------
 3666|    956|                {
 3667|    956|                    TY_(InsertNodeBeforeElement)(element, dd);
  ------------------
  |  |   23|    956|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    956|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3668|    956|                    TY_(InsertNodeAtEnd)(dd, node);
  ------------------
  |  |   23|    956|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    956|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3669|    956|                    continue;
 3670|    956|                }
 3671|       |
 3672|       |                /* split dt and insert hr within dd before 2nd part */
 3673|    649|                TY_(InsertNodeAfterElement)(element, dd);
  ------------------
  |  |   23|    649|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    649|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3674|    649|                TY_(InsertNodeAtEnd)(dd, node);
  ------------------
  |  |   23|    649|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    649|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3675|       |
 3676|    649|                if (!(mode & Preformatted))
  ------------------
  |  Branch (3676:21): [True: 649, False: 0]
  ------------------
 3677|    649|                    TrimSpaces(doc, element);
 3678|       |
 3679|    649|                element = TY_(CloneNode)( doc, element );
  ------------------
  |  |   23|    649|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    649|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3680|    649|                TY_(InsertNodeAfterElement)(dd, element);
  ------------------
  |  |   23|    649|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    649|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3681|    649|                continue;
 3682|  1.60k|            }
 3683|  7.82k|        }
 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.62M|        if (node->type == EndTag)
  ------------------
  |  Branch (3690:13): [True: 33.7k, False: 2.58M]
  ------------------
 3691|  33.7k|        {
 3692|  33.7k|            for (parent = element->parent;
 3693|  29.0M|                    parent != NULL; parent = parent->parent)
  ------------------
  |  Branch (3693:21): [True: 29.0M, False: 4.20k]
  ------------------
 3694|  29.0M|            {
 3695|  29.0M|                if (node->tag == parent->tag)
  ------------------
  |  Branch (3695:21): [True: 29.5k, False: 29.0M]
  ------------------
 3696|  29.5k|                {
 3697|  29.5k|                    if (!(element->tag->model & CM_OPT) && !element->implicit)
  ------------------
  |  |  154|  29.5k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (3697:25): [True: 29.2k, False: 312]
  |  Branch (3697:60): [True: 19.3k, False: 9.88k]
  ------------------
 3698|  19.3k|                        TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  19.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3699|       |
 3700|  29.5k|                    if( TY_(IsPushedLast)( doc, element, node ) )
  ------------------
  |  |   23|  29.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3700:25): [True: 0, False: 29.5k]
  ------------------
 3701|      0|                        TY_(PopInline)( doc, element );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3702|  29.5k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  29.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3703|       |
 3704|  29.5k|                    if (!(mode & Preformatted))
  ------------------
  |  Branch (3704:25): [True: 29.5k, False: 0]
  ------------------
 3705|  29.5k|                        TrimSpaces(doc, element);
 3706|       |
 3707|  29.5k|                    DEBUG_LOG_EXIT;
 3708|  29.5k|                    return NULL;
 3709|  29.5k|                }
 3710|  29.0M|            }
 3711|  33.7k|        }
 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.59M|        if (!(node->tag->model & CM_INLINE) &&
  ------------------
  |  |  143|  2.59M|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3721:13): [True: 627k, False: 1.96M]
  ------------------
 3722|   627k|            !(element->tag->model & CM_MIXED) &&
  ------------------
  |  |  156|   627k|#define CM_MIXED        (1 << 17)  /**< Elements with inline and block model. Used to avoid calling InlineDup. */
  ------------------
  |  Branch (3722:13): [True: 627k, False: 556]
  ------------------
 3723|   627k|            !(nodeIsSPAN(element) && nodeIsMETA(node)) )
  ------------------
  |  |  430|   627k|#define nodeIsSPAN( node )       TagIsId( node, TidyTag_SPAN )
  |  |  ------------------
  |  |  |  |  275|  1.25M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 627k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 627k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 876, False: 626k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          !(nodeIsSPAN(element) && nodeIsMETA(node)) )
  ------------------
  |  |  374|    876|#define nodeIsMETA( node )       TagIsId( node, TidyTag_META )
  |  |  ------------------
  |  |  |  |  275|    876|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 876, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 876, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 261, False: 615]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3724|   627k|        {
 3725|   627k|            if ( !TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|   627k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   627k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3725:18): [True: 2.81k, False: 624k]
  ------------------
 3726|  2.81k|            {
 3727|  2.81k|                TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3728|  2.81k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3729|  2.81k|                continue;
 3730|  2.81k|            }
 3731|       |            /* HTML5 */
 3732|   624k|            if (nodeIsDATALIST(element)) {
  ------------------
  |  |  463|   624k|#define nodeIsDATALIST( node )   TagIsId( node, TidyTag_DATALIST )
  |  |  ------------------
  |  |  |  |  275|   624k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 624k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 624k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 624k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|   624k|            if (!(element->tag->model & CM_OPT))
  ------------------
  |  |  154|   624k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (3735:17): [True: 533k, False: 91.1k]
  ------------------
 3736|   533k|                TY_(Report)(doc, element, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|   533k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   533k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3737|       |
 3738|   624k|            if (node->tag->model & CM_HEAD && !(node->tag->model & CM_BLOCK))
  ------------------
  |  |  141|  1.24M|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
                          if (node->tag->model & CM_HEAD && !(node->tag->model & CM_BLOCK))
  ------------------
  |  |  142|  3.03k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (3738:17): [True: 3.03k, False: 621k]
  |  Branch (3738:47): [True: 1.52k, False: 1.50k]
  ------------------
 3739|  1.52k|            {
 3740|  1.52k|                MoveToHead(doc, element, node);
 3741|  1.52k|                continue;
 3742|  1.52k|            }
 3743|       |
 3744|       |            /*
 3745|       |               prevent anchors from propagating into block tags
 3746|       |               except for headings h1 to h6
 3747|       |            */
 3748|   622k|            if ( nodeIsA(element) )
  ------------------
  |  |  401|   622k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  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.31k, False: 621k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3749|  1.31k|            {
 3750|  1.31k|                if (node->tag && !(node->tag->model & CM_HEADING))
  ------------------
  |  |  153|  1.31k|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
  |  Branch (3750:21): [True: 1.31k, False: 0]
  |  Branch (3750:34): [True: 414, False: 900]
  ------------------
 3751|    414|                    TY_(PopInline)( doc, element );
  ------------------
  |  |   23|    414|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    414|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3752|    900|                else if (!(element->content))
  ------------------
  |  Branch (3752:26): [True: 551, False: 349]
  ------------------
 3753|    551|                {
 3754|    551|                    TY_(DiscardElement)( doc, element );
  ------------------
  |  |   23|    551|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    551|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3755|    551|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    551|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    551|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3756|       |
 3757|    551|                    DEBUG_LOG_EXIT;
 3758|    551|                    return NULL;
 3759|    551|                }
 3760|  1.31k|            }
 3761|       |
 3762|   622k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|   622k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   622k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3763|       |
 3764|   622k|            if (!(mode & Preformatted))
  ------------------
  |  Branch (3764:17): [True: 622k, False: 0]
  ------------------
 3765|   622k|                TrimSpaces(doc, element);
 3766|       |
 3767|   622k|            DEBUG_LOG_EXIT;
 3768|   622k|            return NULL;
 3769|   622k|        }
 3770|       |
 3771|       |        /* parse inline element */
 3772|  1.96M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  1.96M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.96M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3772:13): [True: 1.96M, False: 1.39k]
  ------------------
 3773|  1.96M|        {
 3774|  1.96M|            if (node->implicit)
  ------------------
  |  Branch (3774:17): [True: 1.71M, False: 249k]
  ------------------
 3775|  1.71M|                TY_(Report)(doc, element, node, INSERTING_TAG);
  ------------------
  |  |   23|  1.71M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.71M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3776|       |
 3777|       |            /* trim white space before <br> */
 3778|  1.96M|            if ( nodeIsBR(node) )
  ------------------
  |  |  400|  1.96M|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  1.96M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.96M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.96M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.74k, False: 1.95M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3779|  3.74k|                TrimSpaces(doc, element);
 3780|       |
 3781|  1.96M|            TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|  1.96M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.96M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3782|       |            
 3783|  1.96M|            {
 3784|  1.96M|                TidyParserMemory memory = {0};
 3785|  1.96M|                memory.identity = TY_(ParseInline);
  ------------------
  |  |   23|  1.96M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.96M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3786|  1.96M|                memory.original_node = element;
 3787|  1.96M|                memory.reentry_node = node;
 3788|  1.96M|                memory.mode = mode;
 3789|  1.96M|                memory.reentry_mode = mode;
 3790|  1.96M|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.96M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.96M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3791|  1.96M|                DEBUG_LOG_EXIT_WITH_NODE(node);
 3792|  1.96M|                return node;
 3793|  1.96M|            }
 3794|  1.96M|        }
 3795|       |
 3796|       |        /* discard unexpected tags */
 3797|  1.39k|        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3798|  1.39k|        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|  1.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3799|  1.39k|        continue;
 3800|  1.96M|    }
 3801|       |
 3802|  1.31M|    if (!(element->tag->model & CM_OPT))
  ------------------
  |  |  154|  1.31M|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (3802:9): [True: 1.31M, False: 5.75k]
  ------------------
 3803|  1.31M|        TY_(Report)(doc, element, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  1.31M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.31M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3804|       |
 3805|  1.31M|    DEBUG_LOG_EXIT;
 3806|       |    return NULL;
 3807|  3.97M|}
prvTidyParseList:
 3819|   116k|{
 3820|   116k|    Lexer* lexer = doc->lexer;
 3821|   116k|    Node *node = NULL;
 3822|   116k|    Node *parent = NULL;
 3823|   116k|    Node *lastli = NULL;;
 3824|   116k|    Bool wasblock = no;
 3825|   116k|    Bool nodeisOL = nodeIsOL(list);
  ------------------
  |  |  387|   116k|#define nodeIsOL( node )         TagIsId( node, TidyTag_OL )
  |  |  ------------------
  |  |  |  |  275|   116k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 53.8k, False: 62.6k]
  |  |  |  |  |  Branch (275:39): [True: 53.8k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 46.9k, False: 6.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3826|   116k|    DEBUG_LOG_COUNTERS;
 3827|       |
 3828|   116k|    if ( list == NULL )
  ------------------
  |  Branch (3828:10): [True: 62.6k, False: 53.8k]
  ------------------
 3829|  62.6k|    {
 3830|  62.6k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  62.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  62.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3831|  62.6k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 3832|  62.6k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 3833|  62.6k|        list = memory.original_node;
 3834|  62.6k|        DEBUG_LOG_GET_OLD_MODE;
 3835|  62.6k|        mode = memory.mode;
 3836|  62.6k|        DEBUG_LOG_CHANGE_MODE;
 3837|  62.6k|    }
 3838|  53.8k|    else
 3839|  53.8k|    {
 3840|  53.8k|        DEBUG_LOG_ENTER_WITH_NODE(list);
 3841|       |
 3842|  53.8k|        if (list->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  53.8k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (3842:13): [True: 0, False: 53.8k]
  ------------------
 3843|      0|        {
 3844|      0|            DEBUG_LOG_EXIT;
 3845|      0|            return NULL;
 3846|      0|        }
 3847|  53.8k|    }
 3848|       |    
 3849|   116k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 3850|       |
 3851|   126k|    while ((node = TY_(GetToken)( doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|   126k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   126k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3851:12): [True: 77.2k, False: 49.6k]
  ------------------
 3852|  77.2k|    {
 3853|  77.2k|        Bool foundLI = no;
 3854|  77.2k|        if (node->tag == list->tag && node->type == EndTag)
  ------------------
  |  Branch (3854:13): [True: 42.8k, False: 34.4k]
  |  Branch (3854:39): [True: 222, False: 42.5k]
  ------------------
 3855|    222|        {
 3856|    222|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    222|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    222|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3857|    222|            list->closed = yes;
 3858|    222|            DEBUG_LOG_EXIT;
 3859|    222|            return NULL;
 3860|    222|        }
 3861|       |
 3862|       |        /* deal with comments etc. */
 3863|  77.0k|        if (InsertMisc(list, node))
  ------------------
  |  Branch (3863:13): [True: 2.70k, False: 74.3k]
  ------------------
 3864|  2.70k|            continue;
 3865|       |
 3866|  74.3k|        if (node->type != TextNode && node->tag == NULL)
  ------------------
  |  Branch (3866:13): [True: 65.8k, False: 8.55k]
  |  Branch (3866:39): [True: 5.83k, False: 59.9k]
  ------------------
 3867|  5.83k|        {
 3868|  5.83k|            TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  5.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3869|  5.83k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  5.83k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.83k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3870|  5.83k|            continue;
 3871|  5.83k|        }
 3872|  68.5k|        if (lexer && (node->type == TextNode))
  ------------------
  |  Branch (3872:13): [True: 68.5k, False: 0]
  |  Branch (3872:22): [True: 8.55k, False: 59.9k]
  ------------------
 3873|  8.55k|        {
 3874|  8.55k|            uint ch, ix = node->start;
 3875|       |            /* Issue #572 - Skip whitespace. */
 3876|  9.84k|            while (ix < node->end && (ch = (lexer->lexbuf[ix] & 0xff))
  ------------------
  |  Branch (3876:20): [True: 9.57k, False: 270]
  |  Branch (3876:38): [True: 9.50k, False: 74]
  ------------------
 3877|  9.50k|                && (ch == ' ' || ch == '\t' || ch == '\r' || ch == '\n'))
  ------------------
  |  Branch (3877:21): [True: 408, False: 9.09k]
  |  Branch (3877:34): [True: 486, False: 8.60k]
  |  Branch (3877:48): [True: 206, False: 8.40k]
  |  Branch (3877:62): [True: 191, False: 8.21k]
  ------------------
 3878|  1.29k|                ++ix;
 3879|  8.55k|            if (ix >= node->end)
  ------------------
  |  Branch (3879:17): [True: 270, False: 8.28k]
  ------------------
 3880|    270|            {
 3881|       |                /* Issue #572 - Discard if ALL whitespace. */
 3882|    270|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    270|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    270|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3883|    270|                continue;
 3884|    270|            }
 3885|  8.55k|        }
 3886|       |
 3887|       |
 3888|       |        /*
 3889|       |          if this is the end tag for an ancestor element
 3890|       |          then infer end tag for this element
 3891|       |        */
 3892|  68.2k|        if (node->type == EndTag)
  ------------------
  |  Branch (3892:13): [True: 1.91k, False: 66.3k]
  ------------------
 3893|  1.91k|        {
 3894|  1.91k|            if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  1.91k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  1.91k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.91k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.91k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 215, False: 1.69k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3895|    215|            {
 3896|    215|                BadForm( doc );
 3897|    215|                TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    215|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    215|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3898|    215|                TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    215|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    215|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3899|    215|                continue;
 3900|    215|            }
 3901|       |
 3902|  1.69k|            if (TY_(nodeHasCM)(node,CM_INLINE))
  ------------------
  |  |   23|  1.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(nodeHasCM)(node,CM_INLINE))
  ------------------
  |  |  143|  1.69k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (3902:17): [True: 1.00k, False: 694]
  ------------------
 3903|  1.00k|            {
 3904|  1.00k|                TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3905|  1.00k|                TY_(PopInline)( doc, node );
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3906|  1.00k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.00k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.00k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3907|  1.00k|                continue;
 3908|  1.00k|            }
 3909|       |
 3910|    694|            for ( parent = list->parent;
 3911|  10.5k|                  parent != NULL; parent = parent->parent )
  ------------------
  |  Branch (3911:19): [True: 10.3k, False: 208]
  ------------------
 3912|  10.3k|            {
 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|  10.3k|                if (nodeIsBODY(parent))
  ------------------
  |  |  375|  10.3k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  10.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 10.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.1k, False: 208]
  |  |  |  |  |  Branch (275:54): [True: 237, False: 9.90k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3917|    237|                    break;
 3918|  10.1k|                if (node->tag == parent->tag)
  ------------------
  |  Branch (3918:21): [True: 249, False: 9.86k]
  ------------------
 3919|    249|                {
 3920|    249|                    TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|    249|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    249|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3921|    249|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    249|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    249|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3922|    249|                    DEBUG_LOG_EXIT;
 3923|    249|                    return NULL;
 3924|    249|                }
 3925|  10.1k|            }
 3926|       |
 3927|    445|            TY_(Report)(doc, list, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    445|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    445|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3928|    445|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    445|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    445|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3929|    445|            continue;
 3930|    694|        }
 3931|       |
 3932|  66.3k|        if ( !nodeIsLI(node) && nodeisOL )
  ------------------
  |  |  390|  66.3k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|   132k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 66.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 58.0k, False: 8.28k]
  |  |  |  |  |  Branch (275:54): [True: 4.68k, False: 53.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3932:33): [True: 46.3k, False: 15.3k]
  ------------------
 3933|  46.3k|        {
 3934|       |            /* Issue #572 - A <ol><li> can have nested <ol> elements */
 3935|  46.3k|            foundLI = FindLastLI(list, &lastli); /* find last <li> */
 3936|  46.3k|        }
 3937|       |
 3938|  66.3k|        if ( nodeIsLI(node) || (TY_(IsHTML5Mode)(doc) && !foundLI) )
  ------------------
  |  |  390|  66.3k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|   132k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 66.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 58.0k, False: 8.28k]
  |  |  |  |  |  Branch (275:54): [True: 4.68k, False: 53.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsLI(node) || (TY_(IsHTML5Mode)(doc) && !foundLI) )
  ------------------
  |  |   23|  61.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  61.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (3938:33): [True: 19.8k, False: 41.8k]
  |  Branch (3938:58): [True: 19.8k, False: 0]
  ------------------
 3939|  24.5k|        {
 3940|       |            /* node is <LI> OR
 3941|       |               Issue #396 - A <ul> can have Zero or more <li> elements
 3942|       |             */
 3943|  24.5k|            TY_(InsertNodeAtEnd)(list,node);
  ------------------
  |  |   23|  24.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3944|  24.5k|        }
 3945|  41.8k|        else
 3946|  41.8k|        {
 3947|  41.8k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  41.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3948|       |
 3949|  41.8k|            if (TY_(nodeHasCM)(node,CM_BLOCK) && lexer->excludeBlocks)
  ------------------
  |  |   23|  41.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if (TY_(nodeHasCM)(node,CM_BLOCK) && lexer->excludeBlocks)
  ------------------
  |  |  142|  41.8k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (3949:17): [True: 35.0k, False: 6.77k]
  |  Branch (3949:50): [True: 1.02k, False: 34.0k]
  ------------------
 3950|  1.02k|            {
 3951|  1.02k|                TY_(Report)(doc, list, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3952|  1.02k|                DEBUG_LOG_EXIT;
 3953|  1.02k|                return NULL;
 3954|  1.02k|            }
 3955|       |            /* http://tidy.sf.net/issue/1316307 */
 3956|       |            /* In exiled mode, return so table processing can continue. */
 3957|  40.8k|            else if ( lexer->exiled
  ------------------
  |  Branch (3957:23): [True: 33.0k, False: 7.76k]
  ------------------
 3958|  33.0k|                      && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |   23|  33.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  33.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                    && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |  146|  33.0k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                    && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |  147|  33.0k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
                                    && (TY_(nodeHasCM)(node, CM_TABLE|CM_ROWGRP|CM_ROW)
  ------------------
  |  |  148|  33.0k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (3958:27): [True: 1.03k, False: 32.0k]
  ------------------
 3959|  33.0k|                          || nodeIsTABLE(node)) )
  ------------------
  |  |  393|  32.0k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  32.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 32.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 29.5k, False: 2.49k]
  |  |  |  |  |  Branch (275:54): [True: 68, False: 29.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3960|  1.10k|            {
 3961|  1.10k|                DEBUG_LOG_EXIT;
 3962|  1.10k|                return NULL;
 3963|  1.10k|            }
 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|  39.7k|            if ( nodeIsOL(list) && FindLastLI(list, &lastli) )
  ------------------
  |  |  387|  39.7k|#define nodeIsOL( node )         TagIsId( node, TidyTag_OL )
  |  |  ------------------
  |  |  |  |  275|  79.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 39.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 39.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 37.0k, False: 2.66k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (3968:36): [True: 996, False: 36.0k]
  ------------------
 3969|    996|            {
 3970|       |                /* Create a node for error reporting */
 3971|    996|                node = TY_(InferredTag)(doc, TidyTag_LI);
  ------------------
  |  |   23|    996|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    996|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3972|    996|                TY_(Report)(doc, list, node, MISSING_STARTTAG );
  ------------------
  |  |   23|    996|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    996|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3973|    996|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    996|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    996|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3974|    996|                node = lastli;
 3975|    996|            }
 3976|  38.7k|            else
 3977|  38.7k|            {
 3978|       |                /* Add an inferred <li> */
 3979|  38.7k|                wasblock = TY_(nodeHasCM)(node,CM_BLOCK);
  ------------------
  |  |   23|  38.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              wasblock = TY_(nodeHasCM)(node,CM_BLOCK);
  ------------------
  |  |  142|  38.7k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
 3980|  38.7k|                node = TY_(InferredTag)(doc, TidyTag_LI);
  ------------------
  |  |   23|  38.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3981|       |                /* Add "display: inline" to avoid a blank line after <li> with
 3982|       |                   Internet Explorer. See http://tidy.sf.net/issue/836462 */
 3983|  38.7k|                TY_(AddStyleProperty)( doc, node,
  ------------------
  |  |   23|  38.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3984|  38.7k|                                       wasblock
  ------------------
  |  Branch (3984:40): [True: 33.9k, False: 4.78k]
  ------------------
 3985|  38.7k|                                       ? "list-style: none; display: inline"
 3986|  38.7k|                                       : "list-style: none"
 3987|  38.7k|                                       );
 3988|  38.7k|                TY_(Report)(doc, list, node, MISSING_STARTTAG );
  ------------------
  |  |   23|  38.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3989|  38.7k|                TY_(InsertNodeAtEnd)(list,node);
  ------------------
  |  |   23|  38.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3990|  38.7k|            }
 3991|  39.7k|        }
 3992|       |
 3993|  64.2k|        {
 3994|  64.2k|            TidyParserMemory memory = {0};
 3995|  64.2k|            memory.identity = TY_(ParseList);
  ------------------
  |  |   23|  64.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  64.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 3996|  64.2k|            memory.original_node = list;
 3997|  64.2k|            memory.reentry_node = node;
 3998|  64.2k|            memory.mode = IgnoreWhitespace;
 3999|  64.2k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  64.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  64.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4000|  64.2k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 4001|  64.2k|            return node;
 4002|  66.3k|        }
 4003|  66.3k|    }
 4004|       |
 4005|  49.6k|    TY_(Report)(doc, list, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  49.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4006|  49.6k|    DEBUG_LOG_EXIT;
 4007|       |    return NULL;
 4008|   116k|}
prvTidyParseNamespace:
 4028|  7.18k|{
 4029|  7.18k|    Lexer* lexer = doc->lexer;
 4030|  7.18k|    Node *node;
 4031|  7.18k|    Node *parent = basenode;
 4032|  7.18k|    uint istackbase;
 4033|  7.18k|    AttVal* av; /* #130 MathML attr and entity fix! */
 4034|       |
 4035|       |    /* a la <table>: defer popping elements off the inline stack */
 4036|  7.18k|    TY_(DeferDup)( doc );
  ------------------
  |  |   23|  7.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4037|  7.18k|    istackbase = lexer->istackbase;
 4038|  7.18k|    lexer->istackbase = lexer->istacksize;
 4039|       |
 4040|  7.18k|    mode = OtherNamespace; /* Preformatted; IgnoreWhitespace; */
 4041|       |
 4042|  86.7k|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|  86.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  86.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4042:12): [True: 79.9k, False: 6.79k]
  ------------------
 4043|  79.9k|    {
 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|  79.9k|        if (node->type == EndTag)
  ------------------
  |  Branch (4053:13): [True: 5.15k, False: 74.8k]
  ------------------
 4054|  5.15k|        {
 4055|       |            /*
 4056|       |            to prevent end tags flowing from one 'alternate namespace' we
 4057|       |            check this in two phases: first we check if the tag is a
 4058|       |            descendant of the current node, and when it is, we check whether
 4059|       |            it is the end tag for a node /within/ or /outside/ the basenode.
 4060|       |            */
 4061|  5.15k|            Bool outside;
 4062|  5.15k|            Node *mp = FindMatchingDescendant(parent, node, basenode, &outside);
 4063|       |
 4064|  5.15k|            if (mp != NULL)
  ------------------
  |  Branch (4064:17): [True: 3.22k, False: 1.92k]
  ------------------
 4065|  3.22k|            {
 4066|       |                /*
 4067|       |                when mp != parent as we might expect,
 4068|       |                infer end tags until we 'hit' the matched
 4069|       |                parent or the basenode
 4070|       |                */
 4071|  3.22k|                Node *n;
 4072|       |
 4073|  3.22k|                for (n = parent;
 4074|  4.87k|                     n != NULL && n != basenode->parent && n != mp;
  ------------------
  |  Branch (4074:22): [True: 4.87k, False: 0]
  |  Branch (4074:35): [True: 4.47k, False: 392]
  |  Branch (4074:60): [True: 1.64k, False: 2.83k]
  ------------------
 4075|  3.22k|                     n = n->parent)
 4076|  1.64k|                {
 4077|       |                    /* n->implicit = yes; */
 4078|  1.64k|                    n->closed = yes;
 4079|  1.64k|                    TY_(Report)(doc, n->parent, n, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4080|  1.64k|                }
 4081|       |
 4082|       |                /* Issue #369 - Since 'assert' is DEBUG only, and there are
 4083|       |                   simple cases where these can be fired, removing them
 4084|       |                   pending feedback from the original author!
 4085|       |                   assert(outside == no ? n == mp : 1);
 4086|       |                   assert(outside == yes ? n == basenode->parent : 1);
 4087|       |                   =================================================== */
 4088|       |
 4089|  3.22k|                if (outside == no)
  ------------------
  |  Branch (4089:21): [True: 3.22k, False: 0]
  ------------------
 4090|  3.22k|                {
 4091|       |                    /* EndTag for a node within the basenode subtree. Roll on... */
 4092|  3.22k|                    if (n)
  ------------------
  |  Branch (4092:25): [True: 3.22k, False: 0]
  ------------------
 4093|  3.22k|                        n->closed = yes;
 4094|  3.22k|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  3.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4095|       |
 4096|  3.22k|                    node = n;
 4097|  3.22k|                    parent = node ? node->parent : NULL;
  ------------------
  |  Branch (4097:30): [True: 3.22k, False: 0]
  ------------------
 4098|  3.22k|                }
 4099|      0|                else
 4100|      0|                {
 4101|       |                    /* EndTag for a node outside the basenode subtree: let the caller handle that. */
 4102|      0|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4103|      0|                    node = basenode;
 4104|      0|                    parent = node->parent;
 4105|      0|                }
 4106|       |
 4107|       |                /* when we've arrived at the end-node for the base node, it's quitting time */
 4108|  3.22k|                if (node == basenode)
  ------------------
  |  Branch (4108:21): [True: 396, False: 2.83k]
  ------------------
 4109|    396|                {
 4110|    396|                    lexer->istackbase = istackbase;
 4111|    396|                    assert(basenode && basenode->closed == yes);
  ------------------
  |  Branch (4111:21): [True: 0, False: 396]
  |  Branch (4111:21): [True: 0, False: 0]
  |  Branch (4111:21): [True: 396, False: 0]
  |  Branch (4111:21): [True: 396, False: 0]
  ------------------
 4112|    396|                    return NULL;
 4113|    396|                }
 4114|  3.22k|            }
 4115|  1.92k|            else
 4116|  1.92k|            {
 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.92k|                TY_(Report)(doc, parent, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4120|  1.92k|                assert(parent);
  ------------------
  |  Branch (4120:17): [True: 0, False: 1.92k]
  |  Branch (4120:17): [True: 1.92k, False: 0]
  ------------------
 4121|       |                /* assert(parent->tag != node->tag); Issue #308 - Seems would always be true! */
 4122|  1.92k|                TY_(FreeNode)( doc, node); /* Issue #308 - Discard unexpected end tag memory */
  ------------------
  |  |   23|  1.92k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.92k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4123|  1.92k|            }
 4124|  5.15k|        }
 4125|  74.8k|        else if (node->type == StartTag)
  ------------------
  |  Branch (4125:18): [True: 30.5k, False: 44.3k]
  ------------------
 4126|  30.5k|        {
 4127|       |            /* #130 MathML attr and entity fix!
 4128|       |               care if it has attributes, and 'accidently' any of those attributes match known */
 4129|  58.6k|            for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (4129:42): [True: 28.1k, False: 30.5k]
  ------------------
 4130|  28.1k|            {
 4131|  28.1k|                av->dict = 0; /* does something need to be freed? */
 4132|  28.1k|            }
 4133|       |            /* add another child to the current parent */
 4134|  30.5k|            TY_(InsertNodeAtEnd)(parent, node);
  ------------------
  |  |   23|  30.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  30.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4135|  30.5k|            parent = node;
 4136|  30.5k|        }
 4137|  44.3k|        else
 4138|  44.3k|        {
 4139|       |            /* #130 MathML attr and entity fix!
 4140|       |               care if it has attributes, and 'accidently' any of those attributes match known */
 4141|  66.3k|            for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (4141:42): [True: 22.0k, False: 44.3k]
  ------------------
 4142|  22.0k|            {
 4143|  22.0k|                av->dict = 0; /* does something need to be freed? */
 4144|  22.0k|            }
 4145|  44.3k|            TY_(InsertNodeAtEnd)(parent, node);
  ------------------
  |  |   23|  44.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  44.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4146|  44.3k|        }
 4147|  79.9k|    }
 4148|       |
 4149|  6.79k|    TY_(Report)(doc, basenode->parent, basenode, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  6.79k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.79k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4150|       |    return NULL;
 4151|  7.18k|}
prvTidyParseNoFrames:
 4163|  43.0k|{
 4164|  43.0k|    Lexer* lexer = doc->lexer;
 4165|  43.0k|    Node *node = NULL;
 4166|  43.0k|    Bool body_seen = no;
 4167|  43.0k|    DEBUG_LOG_COUNTERS;
 4168|       |
 4169|  43.0k|    enum parserState {
 4170|  43.0k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4171|  43.0k|        STATE_POST_NODEISBODY,        /* To-do after re-entering after checks. */
 4172|  43.0k|        STATE_COMPLETE,               /* Done with the switch. */
 4173|  43.0k|    } 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|  43.0k|    if ( noframes == NULL )
  ------------------
  |  Branch (4180:10): [True: 21.3k, False: 21.6k]
  ------------------
 4181|  21.3k|    {
 4182|  21.3k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  21.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  21.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4183|  21.3k|        node = memory.reentry_node; /* Throwaway, because we replace it entering the loop anyway.*/
 4184|  21.3k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4185|  21.3k|        noframes = memory.original_node;
 4186|  21.3k|        state = memory.reentry_state;
 4187|  21.3k|        body_seen = memory.register_1;
 4188|  21.3k|        DEBUG_LOG_GET_OLD_MODE;
 4189|  21.3k|        mode = memory.mode;
 4190|  21.3k|        DEBUG_LOG_CHANGE_MODE;
 4191|  21.3k|    }
 4192|  21.6k|    else
 4193|  21.6k|    {
 4194|  21.6k|        DEBUG_LOG_ENTER_WITH_NODE(noframes);
 4195|  21.6k|        if ( cfg(doc, TidyAccessibilityCheckLevel) == 0 )
  ------------------
  |  |  415|  21.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (4195:14): [True: 21.6k, False: 0]
  ------------------
 4196|  21.6k|        {
 4197|  21.6k|            doc->badAccess |=  BA_USING_NOFRAMES;
  ------------------
  |  |  285|  21.6k|#define BA_USING_NOFRAMES          32
  ------------------
 4198|  21.6k|        }
 4199|  21.6k|    }
 4200|       |
 4201|  43.0k|    mode = IgnoreWhitespace;
 4202|       |
 4203|  67.4k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4203:13): [True: 51.9k, False: 15.5k]
  ------------------
 4204|  51.9k|    {
 4205|  51.9k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4205:14): [True: 48.8k, False: 3.01k]
  ------------------
 4206|  48.8k|        {
 4207|  48.8k|            node = TY_(GetToken)(doc, mode);
  ------------------
  |  |   23|  48.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  48.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4208|  48.8k|            DEBUG_LOG_GOT_TOKEN(node);
 4209|  48.8k|        }
 4210|       |        
 4211|  51.9k|        switch ( state )
 4212|  51.9k|        {
 4213|  48.8k|            case STATE_INITIAL:
  ------------------
  |  Branch (4213:13): [True: 48.8k, False: 3.01k]
  ------------------
 4214|  48.8k|            {
 4215|  48.8k|                if ( node == NULL )
  ------------------
  |  Branch (4215:22): [True: 15.5k, False: 33.3k]
  ------------------
 4216|  15.5k|                {
 4217|  15.5k|                    state = STATE_COMPLETE;
 4218|  15.5k|                    continue;
 4219|  15.5k|                }
 4220|       |                
 4221|  33.3k|                if ( node->tag == noframes->tag && node->type == EndTag )
  ------------------
  |  Branch (4221:22): [True: 12.3k, False: 21.0k]
  |  Branch (4221:52): [True: 265, False: 12.0k]
  ------------------
 4222|    265|                {
 4223|    265|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    265|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    265|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4224|    265|                    noframes->closed = yes;
 4225|    265|                    TrimSpaces(doc, noframes);
 4226|    265|                    DEBUG_LOG_EXIT;
 4227|    265|                    return NULL;
 4228|    265|                }
 4229|       |
 4230|  33.0k|                if ( nodeIsFRAME(node) || nodeIsFRAMESET(node) )
  ------------------
  |  |  377|  33.0k|#define nodeIsFRAME( node )      TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|  66.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 33.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 24.9k, False: 8.17k]
  |  |  |  |  |  Branch (275:54): [True: 923, False: 23.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( nodeIsFRAME(node) || nodeIsFRAMESET(node) )
  ------------------
  |  |  376|  32.1k|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  32.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 32.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 23.9k, False: 8.17k]
  |  |  |  |  |  Branch (275:54): [True: 1.46k, False: 22.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4231|  2.38k|                {
 4232|  2.38k|                    TrimSpaces(doc, noframes);
 4233|  2.38k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4233:25): [True: 472, False: 1.91k]
  ------------------
 4234|    472|                    {
 4235|    472|                        TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    472|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    472|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4236|    472|                        TY_(FreeNode)( doc, node);       /* Throw it away */
  ------------------
  |  |   23|    472|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    472|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4237|    472|                    }
 4238|  1.91k|                    else
 4239|  1.91k|                    {
 4240|  1.91k|                        TY_(Report)(doc, noframes, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4241|  1.91k|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.91k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.91k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4242|  1.91k|                    }
 4243|  2.38k|                    DEBUG_LOG_EXIT;
 4244|  2.38k|                    return NULL;
 4245|  2.38k|                }
 4246|       |
 4247|  30.7k|                if ( nodeIsHTML(node) )
  ------------------
  |  |  370|  30.7k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  30.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 30.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 22.5k, False: 8.17k]
  |  |  |  |  |  Branch (275:54): [True: 451, False: 22.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4248|    451|                {
 4249|    451|                    if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|    451|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    451|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4249:25): [True: 243, False: 208]
  ------------------
 4250|    243|                        TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    243|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    243|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4251|       |
 4252|    451|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    451|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    451|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4253|    451|                    continue;
 4254|    451|                }
 4255|       |
 4256|       |                /* deal with comments etc. */
 4257|  30.2k|                if (InsertMisc(noframes, node))
  ------------------
  |  Branch (4257:21): [True: 425, False: 29.8k]
  ------------------
 4258|    425|                    continue;
 4259|       |
 4260|  29.8k|                if ( nodeIsBODY(node) && node->type == StartTag )
  ------------------
  |  |  375|  29.8k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  59.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 29.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 22.0k, False: 7.75k]
  |  |  |  |  |  Branch (275:54): [True: 4.74k, False: 17.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4260:42): [True: 4.52k, False: 226]
  ------------------
 4261|  4.52k|                {
 4262|  4.52k|                    TidyParserMemory memory = {0};
 4263|  4.52k|                    memory.identity = TY_(ParseNoFrames);
  ------------------
  |  |   23|  4.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4264|  4.52k|                    memory.original_node = noframes;
 4265|  4.52k|                    memory.reentry_node = node;
 4266|  4.52k|                    memory.reentry_state = STATE_POST_NODEISBODY;
 4267|  4.52k|                    memory.register_1 = lexer->seenEndBody;
 4268|  4.52k|                    memory.mode = IgnoreWhitespace;
 4269|       |
 4270|  4.52k|                    TY_(InsertNodeAtEnd)(noframes, node);
  ------------------
  |  |   23|  4.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4271|  4.52k|                    TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  4.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4272|  4.52k|                    DEBUG_LOG_EXIT_WITH_NODE(node);
 4273|  4.52k|                    return node;
 4274|  4.52k|                }
 4275|       |
 4276|       |                /* implicit body element inferred */
 4277|  25.3k|                if (TY_(nodeIsText)(node) || (node->tag && node->type != EndTag))
  ------------------
  |  |   23|  25.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  25.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4277:21): [True: 3.35k, False: 21.9k]
  |  Branch (4277:47): [True: 17.5k, False: 4.39k]
  |  Branch (4277:60): [True: 17.2k, False: 329]
  ------------------
 4278|  20.5k|                {
 4279|  20.5k|                    Node *body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  20.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4280|  20.5k|                    if ( body || lexer->seenEndBody )
  ------------------
  |  Branch (4280:26): [True: 10.3k, False: 10.2k]
  |  Branch (4280:34): [True: 219, False: 10.0k]
  ------------------
 4281|  10.5k|                    {
 4282|  10.5k|                        if ( body == NULL )
  ------------------
  |  Branch (4282:30): [True: 219, False: 10.3k]
  ------------------
 4283|    219|                        {
 4284|    219|                            TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    219|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    219|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4285|    219|                            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    219|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    219|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4286|    219|                            continue;
 4287|    219|                        }
 4288|  10.3k|                        if ( TY_(nodeIsText)(node) )
  ------------------
  |  |   23|  10.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4288:30): [True: 2.54k, False: 7.81k]
  ------------------
 4289|  2.54k|                        {
 4290|  2.54k|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4291|  2.54k|                            node = TY_(InferredTag)(doc, TidyTag_P);
  ------------------
  |  |   23|  2.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4292|  2.54k|                            TY_(Report)(doc, noframes, node, CONTENT_AFTER_BODY );
  ------------------
  |  |   23|  2.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4293|  2.54k|                        }
 4294|  10.3k|                        TY_(InsertNodeAtEnd)( body, node );
  ------------------
  |  |   23|  10.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4295|  10.3k|                    }
 4296|  10.0k|                    else
 4297|  10.0k|                    {
 4298|  10.0k|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  10.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4299|  10.0k|                        node = TY_(InferredTag)(doc, TidyTag_BODY);
  ------------------
  |  |   23|  10.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4300|  10.0k|                        if ( cfgBool(doc, TidyXmlOut) )
  ------------------
  |  |  418|  10.0k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  10.0k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 10.0k, False: 0]
  |  |  ------------------
  ------------------
 4301|  10.0k|                            TY_(Report)(doc, noframes, node, INSERTING_TAG);
  ------------------
  |  |   23|  10.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4302|  10.0k|                        TY_(InsertNodeAtEnd)( noframes, node );
  ------------------
  |  |   23|  10.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4303|  10.0k|                    }
 4304|       |
 4305|  20.3k|                    {
 4306|  20.3k|                        TidyParserMemory memory = {0};
 4307|  20.3k|                        memory.identity = TY_(ParseNoFrames);
  ------------------
  |  |   23|  20.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4308|  20.3k|                        memory.original_node = noframes;
 4309|  20.3k|                        memory.reentry_node = node;
 4310|  20.3k|                        memory.mode = IgnoreWhitespace; /*MixedContent*/
 4311|  20.3k|                        memory.reentry_state = STATE_INITIAL;
 4312|  20.3k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  20.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4313|  20.3k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 4314|  20.3k|                        return node;
 4315|  20.5k|                    }
 4316|  20.5k|                }
 4317|       |
 4318|       |                /* discard unexpected end tags */
 4319|  4.72k|                TY_(Report)(doc, noframes, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  4.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4320|  4.72k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  4.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4321|  4.72k|            } break;
 4322|       |                
 4323|       |                
 4324|  3.01k|            case STATE_POST_NODEISBODY:
  ------------------
  |  Branch (4324:13): [True: 3.01k, False: 48.8k]
  ------------------
 4325|  3.01k|            {
 4326|       |                /* fix for bug http://tidy.sf.net/bug/887259 */
 4327|  3.01k|                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.77k]
  |  Branch (4327:34): [True: 1.24k, False: 1]
  ------------------
 4328|  1.24k|                {
 4329|  1.24k|                    TY_(CoerceNode)(doc, node, TidyTag_DIV, no, no);
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4330|  1.24k|                    MoveNodeToBody(doc, node);
 4331|  1.24k|                }
 4332|  3.01k|                state = STATE_INITIAL;
 4333|  3.01k|                continue;
 4334|       |
 4335|  25.3k|            } break;
 4336|       |                
 4337|       |                
 4338|      0|            default:
  ------------------
  |  Branch (4338:13): [True: 0, False: 51.9k]
  ------------------
 4339|      0|                break;
 4340|  51.9k|        } /* switch */
 4341|  51.9k|    } /* while */
 4342|       |
 4343|  15.5k|    TY_(Report)(doc, noframes, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  15.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4344|  15.5k|    DEBUG_LOG_EXIT;
 4345|       |    return NULL;
 4346|  43.0k|}
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.73k, False: 6.19k]
  ------------------
 4364|  5.73k|    {
 4365|  5.73k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  5.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4366|  5.73k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4367|  5.73k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4368|  5.73k|        field = memory.original_node;
 4369|  5.73k|        DEBUG_LOG_GET_OLD_MODE;
 4370|  5.73k|        mode = memory.mode;
 4371|  5.73k|        DEBUG_LOG_CHANGE_MODE;
 4372|  5.73k|    }
 4373|  6.19k|    else
 4374|  6.19k|    {
 4375|  6.19k|        DEBUG_LOG_ENTER_WITH_NODE(field);
 4376|  6.19k|    }
 4377|       |    
 4378|  11.9k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 4379|       |
 4380|  15.3k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  15.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  15.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4380:12): [True: 9.56k, False: 5.79k]
  ------------------
 4381|  9.56k|    {
 4382|  9.56k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (4382:13): [True: 5.75k, False: 3.81k]
  |  Branch (4382:40): [True: 405, False: 5.35k]
  ------------------
 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|  9.16k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (4392:13): [True: 1.26k, False: 7.89k]
  ------------------
 4393|  1.26k|            continue;
 4394|       |
 4395|  7.89k|        if ( node->type == StartTag &&
  ------------------
  |  Branch (4395:14): [True: 6.78k, False: 1.11k]
  ------------------
 4396|  6.78k|             (nodeIsOPTION(node) || nodeIsOPTGROUP(node)) )
  ------------------
  |  |  410|  6.78k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  13.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.78k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 6.32k, False: 468]
  |  |  |  |  |  Branch (275:54): [True: 387, False: 5.93k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                           (nodeIsOPTION(node) || nodeIsOPTGROUP(node)) )
  ------------------
  |  |  411|  6.40k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  6.40k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 6.40k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.93k, False: 468]
  |  |  |  |  |  Branch (275:54): [True: 5.35k, False: 584]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4397|  5.73k|        {
 4398|  5.73k|            TidyParserMemory memory = {0};
 4399|       |
 4400|  5.73k|            if ( nodeIsOPTGROUP(node) )
  ------------------
  |  |  411|  5.73k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  5.73k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 5.73k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 5.73k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.35k, False: 387]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4401|  5.35k|                TY_(Report)(doc, field, node, CANT_BE_NESTED);
  ------------------
  |  |   23|  5.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4402|       |
 4403|  5.73k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  5.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4404|       |
 4405|  5.73k|            memory.identity = TY_(ParseOptGroup);
  ------------------
  |  |   23|  5.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4406|  5.73k|            memory.original_node = field;
 4407|  5.73k|            memory.reentry_node = node;
 4408|  5.73k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  5.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4409|  5.73k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 4410|  5.73k|            return node;
 4411|  5.73k|        }
 4412|       |
 4413|       |        /* discard unexpected tags */
 4414|  2.16k|        TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  2.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4415|  2.16k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4416|  2.16k|    }
 4417|  5.79k|    DEBUG_LOG_EXIT;
 4418|       |    return NULL;
 4419|  11.9k|}
prvTidyParsePre:
 4431|  48.7k|{
 4432|  48.7k|    Node *node = NULL;
 4433|  48.7k|    DEBUG_LOG_COUNTERS;
 4434|       |
 4435|  48.7k|    enum parserState {
 4436|  48.7k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4437|  48.7k|        STATE_RENTRY_ACTION,          /* To-do after re-entering after checks. */
 4438|  48.7k|        STATE_COMPLETE,               /* Done with the switch. */
 4439|  48.7k|    } state = STATE_INITIAL;
 4440|       |
 4441|       |
 4442|  48.7k|    if ( pre == NULL )
  ------------------
  |  Branch (4442:10): [True: 12.5k, False: 36.2k]
  ------------------
 4443|  12.5k|    {
 4444|  12.5k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  12.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4445|  12.5k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4446|  12.5k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4447|  12.5k|        pre = memory.original_node;
 4448|  12.5k|        state = memory.reentry_state;
 4449|  12.5k|        DEBUG_LOG_GET_OLD_MODE;
 4450|  12.5k|        mode = memory.mode;
 4451|  12.5k|        DEBUG_LOG_CHANGE_MODE;
 4452|  12.5k|    }
 4453|  36.2k|    else
 4454|  36.2k|    {
 4455|  36.2k|        DEBUG_LOG_ENTER_WITH_NODE(pre);
 4456|  36.2k|        if (pre->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  36.2k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (4456:13): [True: 0, False: 36.2k]
  ------------------
 4457|      0|        {
 4458|      0|            DEBUG_LOG_EXIT;
 4459|      0|            return NULL;
 4460|      0|        }
 4461|  36.2k|    }
 4462|       |
 4463|  48.7k|    TY_(InlineDup)( doc, NULL ); /* tell lexer to insert inlines if needed */
  ------------------
  |  |   23|  48.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  48.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4464|       |
 4465|  97.2k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4465:13): [True: 91.5k, False: 5.64k]
  ------------------
 4466|  91.5k|    {
 4467|  91.5k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4467:14): [True: 82.4k, False: 9.16k]
  ------------------
 4468|  82.4k|            node = TY_(GetToken)(doc, Preformatted);
  ------------------
  |  |   23|  82.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  82.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4469|       |        
 4470|  91.5k|        switch ( state )
 4471|  91.5k|        {
 4472|  82.4k|            case STATE_INITIAL:
  ------------------
  |  Branch (4472:13): [True: 82.4k, False: 9.16k]
  ------------------
 4473|  82.4k|            {
 4474|  82.4k|                if ( node == NULL )
  ------------------
  |  Branch (4474:22): [True: 5.64k, False: 76.7k]
  ------------------
 4475|  5.64k|                {
 4476|  5.64k|                    state = STATE_COMPLETE;
 4477|  5.64k|                    continue;
 4478|  5.64k|                }
 4479|       |                
 4480|  76.7k|                if ( node->type == EndTag &&
  ------------------
  |  Branch (4480:22): [True: 3.70k, False: 73.0k]
  ------------------
 4481|  3.70k|                     (node->tag == pre->tag || DescendantOf(pre, TagId(node))) )
  ------------------
  |  |  270|  3.26k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 3.26k, False: 0]
  |  |  |  Branch (270:39): [True: 2.90k, False: 366]
  |  |  ------------------
  ------------------
  |  Branch (4481:23): [True: 442, False: 3.26k]
  |  Branch (4481:48): [True: 1.31k, False: 1.95k]
  ------------------
 4482|  1.75k|                {
 4483|  1.75k|                    if (nodeIsBODY(node) || nodeIsHTML(node))
  ------------------
  |  |  375|  1.75k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|  3.51k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.75k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.75k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 204, False: 1.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if (nodeIsBODY(node) || nodeIsHTML(node))
  ------------------
  |  |  370|  1.55k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  1.55k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.55k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.55k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 293, False: 1.26k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4484|    497|                    {
 4485|    497|                        TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    497|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    497|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4486|    497|                        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    497|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    497|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4487|    497|                        continue;
 4488|    497|                    }
 4489|  1.26k|                    if (node->tag == pre->tag)
  ------------------
  |  Branch (4489:25): [True: 442, False: 820]
  ------------------
 4490|    442|                    {
 4491|    442|                        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    442|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    442|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4492|    442|                    }
 4493|    820|                    else
 4494|    820|                    {
 4495|    820|                        TY_(Report)(doc, pre, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|    820|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    820|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4496|    820|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    820|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    820|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4497|    820|                    }
 4498|  1.26k|                    pre->closed = yes;
 4499|  1.26k|                    TrimSpaces(doc, pre);
 4500|  1.26k|                    DEBUG_LOG_EXIT;
 4501|  1.26k|                    return NULL;
 4502|  1.75k|                }
 4503|       |
 4504|  75.0k|                if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  75.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  75.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4504:21): [True: 12.3k, False: 62.6k]
  ------------------
 4505|  12.3k|                {
 4506|  12.3k|                    TY_(InsertNodeAtEnd)(pre, node);
  ------------------
  |  |   23|  12.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  12.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4507|  12.3k|                    continue;
 4508|  12.3k|                }
 4509|       |
 4510|       |                /* deal with comments etc. */
 4511|  62.6k|                if (InsertMisc(pre, node))
  ------------------
  |  Branch (4511:21): [True: 362, False: 62.3k]
  ------------------
 4512|    362|                    continue;
 4513|       |
 4514|  62.3k|                if (node->tag == NULL)
  ------------------
  |  Branch (4514:21): [True: 14.2k, False: 48.0k]
  ------------------
 4515|  14.2k|                {
 4516|  14.2k|                    TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  14.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4517|  14.2k|                    TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  14.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  14.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4518|  14.2k|                    continue;
 4519|  14.2k|                }
 4520|       |
 4521|       |                /* strip unexpected tags */
 4522|  48.0k|                if ( !PreContent(doc, node) )
  ------------------
  |  Branch (4522:22): [True: 39.1k, False: 8.89k]
  ------------------
 4523|  39.1k|                {
 4524|       |                    /* fix for http://tidy.sf.net/bug/772205 */
 4525|  39.1k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4525:25): [True: 1.12k, False: 38.0k]
  ------------------
 4526|  1.12k|                    {
 4527|       |                        /* http://tidy.sf.net/issue/1590220 */
 4528|  1.12k|                       if ( doc->lexer->exiled
  ------------------
  |  Branch (4528:29): [True: 777, False: 351]
  ------------------
 4529|    777|                           && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |   23|    777|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    777|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                         && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  146|    777|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                         && (TY_(nodeHasCM)(node, CM_TABLE) || nodeIsTABLE(node)) )
  ------------------
  |  |  393|    535|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|    535|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 535, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 535, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 205, False: 330]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4529:32): [True: 242, False: 535]
  ------------------
 4530|    447|                       {
 4531|    447|                          TY_(UngetToken)(doc);
  ------------------
  |  |   23|    447|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    447|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4532|    447|                          TrimSpaces(doc, pre);
 4533|    447|                           DEBUG_LOG_EXIT;
 4534|    447|                          return NULL;
 4535|    447|                       }
 4536|       |
 4537|    681|                       TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    681|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    681|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4538|    681|                       TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    681|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    681|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4539|    681|                       continue;
 4540|  1.12k|                    }
 4541|       |                    /* http://tidy.sf.net/issue/1590220 */
 4542|  38.0k|                    else if (TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)
  ------------------
  |  |   23|  38.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  38.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  else if (TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)
  ------------------
  |  |  146|  38.0k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                  else if (TY_(nodeHasCM)(node, CM_TABLE|CM_ROW)
  ------------------
  |  |  148|  38.0k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (4542:30): [True: 1.55k, False: 36.4k]
  ------------------
 4543|  36.4k|                             || nodeIsTABLE(node) )
  ------------------
  |  |  393|  36.4k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  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: 335, False: 36.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4544|  1.88k|                    {
 4545|  1.88k|                        if (!doc->lexer->exiled)
  ------------------
  |  Branch (4545:29): [True: 632, False: 1.25k]
  ------------------
 4546|       |                            /* No missing close warning if exiled. */
 4547|    632|                            TY_(Report)(doc, pre, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|    632|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    632|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4548|       |
 4549|  1.88k|                        TY_(UngetToken)(doc);
  ------------------
  |  |   23|  1.88k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.88k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4550|  1.88k|                        DEBUG_LOG_EXIT;
 4551|  1.88k|                        return NULL;
 4552|  1.88k|                    }
 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|  36.1k|                    TY_(InsertNodeAfterElement)(pre, node);
  ------------------
  |  |   23|  36.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4592|  36.1k|                    TY_(Report)(doc, pre, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  36.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4593|       |                    
 4594|  36.1k|                    {
 4595|  36.1k|                        TidyParserMemory memory = {0};
 4596|  36.1k|                        memory.identity = TY_(ParsePre);
  ------------------
  |  |   23|  36.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4597|  36.1k|                        memory.original_node = pre;
 4598|  36.1k|                        memory.reentry_node = node;
 4599|  36.1k|                        memory.reentry_state = STATE_RENTRY_ACTION;
 4600|  36.1k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  36.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  36.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4601|  36.1k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 4602|  36.1k|                        return node;
 4603|  39.1k|                    }
 4604|  39.1k|                }
 4605|       |
 4606|  8.89k|                if ( nodeIsP(node) )
  ------------------
  |  |  385|  8.89k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  8.89k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 8.89k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 8.89k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.28k, False: 3.60k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4607|  5.28k|                {
 4608|  5.28k|                    if (node->type == StartTag)
  ------------------
  |  Branch (4608:25): [True: 5.09k, False: 194]
  ------------------
 4609|  5.09k|                    {
 4610|  5.09k|                        TY_(Report)(doc, pre, node, USING_BR_INPLACE_OF);
  ------------------
  |  |   23|  5.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4611|       |
 4612|       |                        /* trim white space before <p> in <pre>*/
 4613|  5.09k|                        TrimSpaces(doc, pre);
 4614|       |
 4615|       |                        /* coerce both <p> and </p> to <br> */
 4616|  5.09k|                        TY_(CoerceNode)(doc, node, TidyTag_BR, no, no);
  ------------------
  |  |   23|  5.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4617|  5.09k|                        TY_(FreeAttrs)( doc, node ); /* discard align attribute etc. */
  ------------------
  |  |   23|  5.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4618|  5.09k|                        TY_(InsertNodeAtEnd)( pre, node );
  ------------------
  |  |   23|  5.09k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.09k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4619|  5.09k|                    }
 4620|    194|                    else
 4621|    194|                    {
 4622|    194|                        TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4623|    194|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    194|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    194|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4624|    194|                    }
 4625|  5.28k|                    continue;
 4626|  5.28k|                }
 4627|       |
 4628|  3.60k|                if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  3.60k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.60k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4628:22): [True: 3.34k, False: 262]
  ------------------
 4629|  3.34k|                {
 4630|       |                    /* trim white space before <br> */
 4631|  3.34k|                    if ( nodeIsBR(node) )
  ------------------
  |  |  400|  3.34k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  3.34k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.34k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 3.34k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 234, False: 3.11k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4632|    234|                        TrimSpaces(doc, pre);
 4633|       |
 4634|  3.34k|                    TY_(InsertNodeAtEnd)(pre, node);
  ------------------
  |  |   23|  3.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4635|       |                    
 4636|  3.34k|                    {
 4637|  3.34k|                        TidyParserMemory memory = {0};
 4638|  3.34k|                        memory.identity = TY_(ParsePre);
  ------------------
  |  |   23|  3.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4639|  3.34k|                        memory.original_node = pre;
 4640|  3.34k|                        memory.reentry_node = node;
 4641|  3.34k|                        memory.reentry_state = STATE_INITIAL;
 4642|  3.34k|                        TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  3.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4643|  3.34k|                        DEBUG_LOG_EXIT_WITH_NODE(node);
 4644|  3.34k|                        return node;
 4645|  3.34k|                    }
 4646|  3.34k|                }
 4647|       |
 4648|       |                /* discard unexpected tags */
 4649|    262|                TY_(Report)(doc, pre, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    262|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    262|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4650|    262|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    262|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    262|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4651|    262|            } break;
 4652|       |                
 4653|  9.16k|            case STATE_RENTRY_ACTION:
  ------------------
  |  Branch (4653:13): [True: 9.16k, False: 82.4k]
  ------------------
 4654|  9.16k|            {
 4655|  9.16k|                Node* newnode = TY_(InferredTag)(doc, TidyTag_PRE);
  ------------------
  |  |   23|  9.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4656|  9.16k|                TY_(Report)(doc, pre, newnode, INSERTING_TAG);
  ------------------
  |  |   23|  9.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4657|  9.16k|                pre = newnode;
 4658|  9.16k|                TY_(InsertNodeAfterElement)(node, pre);
  ------------------
  |  |   23|  9.16k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.16k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4659|  9.16k|                state = STATE_INITIAL;
 4660|  9.16k|                continue;
 4661|  3.60k|            } break;
 4662|       |            
 4663|      0|            default:
  ------------------
  |  Branch (4663:13): [True: 0, False: 91.5k]
  ------------------
 4664|      0|                break;
 4665|       |
 4666|  91.5k|        } /* switch */
 4667|  91.5k|    } /* while */
 4668|       |
 4669|  5.64k|    TY_(Report)(doc, pre, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  5.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4670|  5.64k|    DEBUG_LOG_EXIT;
 4671|       |    return NULL;
 4672|  48.7k|}
prvTidyParseRow:
 4684|  39.2k|{
 4685|  39.2k|    Lexer* lexer = doc->lexer;
 4686|  39.2k|    Node *node = NULL;
 4687|  39.2k|    Bool exclude_state = no;
 4688|  39.2k|    DEBUG_LOG_COUNTERS;
 4689|       |
 4690|  39.2k|    enum parserState {
 4691|  39.2k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4692|  39.2k|        STATE_POST_NOT_ENDTAG,        /* To-do after re-entering after !EndTag checks. */
 4693|  39.2k|        STATE_POST_TD_TH,             /* To-do after re-entering after TD/TH checks. */
 4694|  39.2k|        STATE_COMPLETE,               /* Done with the switch. */
 4695|  39.2k|    } state = STATE_INITIAL;
 4696|       |
 4697|  39.2k|    if ( row == NULL )
  ------------------
  |  Branch (4697:10): [True: 18.1k, False: 21.1k]
  ------------------
 4698|  18.1k|    {
 4699|  18.1k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  18.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4700|  18.1k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4701|  18.1k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4702|  18.1k|        row = memory.original_node;
 4703|  18.1k|        state = memory.reentry_state;
 4704|  18.1k|        exclude_state = memory.register_1;
 4705|  18.1k|        DEBUG_LOG_GET_OLD_MODE;
 4706|  18.1k|        mode = memory.mode;
 4707|  18.1k|        DEBUG_LOG_CHANGE_MODE;
 4708|  18.1k|    }
 4709|  21.1k|    else
 4710|  21.1k|    {
 4711|  21.1k|        DEBUG_LOG_ENTER_WITH_NODE(row);
 4712|       |
 4713|  21.1k|        if (row->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  21.1k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (4713:13): [True: 0, False: 21.1k]
  ------------------
 4714|      0|            return NULL;
 4715|  21.1k|    }
 4716|       |
 4717|  78.5k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4717:13): [True: 68.6k, False: 9.94k]
  ------------------
 4718|  68.6k|    {
 4719|  68.6k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4719:14): [True: 50.4k, False: 18.1k]
  ------------------
 4720|  50.4k|        {
 4721|  50.4k|            node = TY_(GetToken)( doc, IgnoreWhitespace );
  ------------------
  |  |   23|  50.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  50.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4722|  50.4k|            DEBUG_LOG_GOT_TOKEN(node);
 4723|  50.4k|        }
 4724|       |    
 4725|  68.6k|        switch (state)
 4726|  68.6k|        {
 4727|  50.4k|            case STATE_INITIAL:
  ------------------
  |  Branch (4727:13): [True: 50.4k, False: 18.1k]
  ------------------
 4728|  50.4k|            {
 4729|  50.4k|                if ( node == NULL)
  ------------------
  |  Branch (4729:22): [True: 9.94k, False: 40.5k]
  ------------------
 4730|  9.94k|                {
 4731|  9.94k|                    state = STATE_COMPLETE;
 4732|  9.94k|                    continue;
 4733|  9.94k|                }
 4734|       |                
 4735|  40.5k|                if (node->tag == row->tag)
  ------------------
  |  Branch (4735:21): [True: 3.01k, False: 37.5k]
  ------------------
 4736|  3.01k|                {
 4737|  3.01k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4737:25): [True: 455, False: 2.55k]
  ------------------
 4738|    455|                    {
 4739|    455|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    455|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    455|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4740|    455|                        row->closed = yes;
 4741|    455|                        FixEmptyRow( doc, row);
 4742|    455|                        DEBUG_LOG_EXIT;
 4743|    455|                        return NULL;
 4744|    455|                    }
 4745|       |
 4746|       |                    /* New row start implies end of current row */
 4747|  2.55k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  2.55k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.55k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4748|  2.55k|                    FixEmptyRow( doc, row);
 4749|  2.55k|                    DEBUG_LOG_EXIT;
 4750|  2.55k|                    return NULL;
 4751|  3.01k|                }
 4752|       |
 4753|       |                /*
 4754|       |                  if this is the end tag for an ancestor element
 4755|       |                  then infer end tag for this element
 4756|       |                */
 4757|  37.5k|                if ( node->type == EndTag )
  ------------------
  |  Branch (4757:22): [True: 3.15k, False: 34.3k]
  ------------------
 4758|  3.15k|                {
 4759|  3.15k|                    if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |   23|  3.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |  140|  3.15k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
                                  if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |  146|  3.15k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                                  if ( (TY_(nodeHasCM)(node, CM_HTML|CM_TABLE) || nodeIsTABLE(node))
  ------------------
  |  |  393|  2.37k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  2.37k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.37k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.91k, False: 468]
  |  |  |  |  |  Branch (275:54): [True: 184, False: 1.72k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4759:27): [True: 778, False: 2.37k]
  ------------------
 4760|    962|                         && DescendantOf(row, TagId(node)) )
  ------------------
  |  |  270|    962|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 962, False: 0]
  |  |  |  Branch (270:39): [True: 962, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (4760:29): [True: 414, False: 548]
  ------------------
 4761|    414|                    {
 4762|    414|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    414|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    414|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4763|    414|                        DEBUG_LOG_EXIT;
 4764|    414|                        return NULL;
 4765|    414|                    }
 4766|       |
 4767|  2.74k|                    if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  424|  2.74k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  5.48k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.74k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.27k, False: 468]
  |  |  |  |  |  Branch (275:54): [True: 203, False: 2.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  2.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  2.54k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  2.54k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (4767:46): [True: 535, False: 2.00k]
  ------------------
 4768|    738|                    {
 4769|    738|                        if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    738|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    738|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 738, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 738, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 203, False: 535]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4770|    203|                            BadForm( doc );
 4771|       |
 4772|    738|                        TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    738|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    738|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4773|    738|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    738|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    738|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4774|    738|                        continue;
 4775|    738|                    }
 4776|       |
 4777|  2.00k|                    if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  395|  2.00k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  4.01k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.00k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.53k, False: 468]
  |  |  |  |  |  Branch (275:54): [True: 448, False: 1.08k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  396|  1.55k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  1.55k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.55k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.08k, False: 468]
  |  |  |  |  |  Branch (275:54): [True: 198, False: 891]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4778|    646|                    {
 4779|    646|                        TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    646|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    646|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4780|    646|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    646|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    646|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4781|    646|                        continue;
 4782|    646|                    }
 4783|  2.00k|                }
 4784|       |
 4785|       |                /* deal with comments etc. */
 4786|  35.7k|                if (InsertMisc(row, node))
  ------------------
  |  Branch (4786:21): [True: 740, False: 34.9k]
  ------------------
 4787|    740|                    continue;
 4788|       |
 4789|       |                /* discard unknown tags */
 4790|  34.9k|                if (node->tag == NULL && node->type != TextNode)
  ------------------
  |  Branch (4790:21): [True: 3.77k, False: 31.2k]
  |  Branch (4790:42): [True: 1.93k, False: 1.84k]
  ------------------
 4791|  1.93k|                {
 4792|  1.93k|                    TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4793|  1.93k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4794|  1.93k|                    continue;
 4795|  1.93k|                }
 4796|       |
 4797|       |                /* discard unexpected <table> element */
 4798|  33.0k|                if ( nodeIsTABLE(node) )
  ------------------
  |  |  393|  33.0k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  33.0k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 33.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 31.2k, False: 1.84k]
  |  |  |  |  |  Branch (275:54): [True: 232, False: 30.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|  32.8k|                if ( TY_(nodeHasCM)(node, CM_ROWGRP) )
  ------------------
  |  |   23|  32.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_ROWGRP) )
  ------------------
  |  |  147|  32.8k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
  |  Branch (4806:22): [True: 991, False: 31.8k]
  ------------------
 4807|    991|                {
 4808|    991|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    991|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    991|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4809|    991|                    DEBUG_LOG_EXIT;
 4810|    991|                    return NULL;
 4811|    991|                }
 4812|       |
 4813|  31.8k|                if (node->type == EndTag)
  ------------------
  |  Branch (4813:21): [True: 891, False: 30.9k]
  ------------------
 4814|    891|                {
 4815|    891|                    TY_(Report)(doc, row, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    891|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    891|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4816|    891|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    891|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    891|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4817|    891|                    continue;
 4818|    891|                }
 4819|       |
 4820|       |                /*
 4821|       |                  if text or inline or block move before table
 4822|       |                  if head content move to head
 4823|       |                */
 4824|       |
 4825|  30.9k|                if (node->type != EndTag)
  ------------------
  |  Branch (4825:21): [True: 30.9k, False: 0]
  ------------------
 4826|  30.9k|                {
 4827|  30.9k|                    if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  30.9k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  30.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 30.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 29.0k, False: 1.84k]
  |  |  |  |  |  Branch (275:54): [True: 6.10k, False: 22.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4828|  6.10k|                    {
 4829|  6.10k|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  6.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4830|  6.10k|                        node = TY_(InferredTag)(doc, TidyTag_TD);
  ------------------
  |  |   23|  6.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4831|  6.10k|                        TY_(Report)(doc, row, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  6.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4832|  6.10k|                    }
 4833|  24.8k|                    else if ( TY_(nodeIsText)(node)
  ------------------
  |  |   23|  24.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  24.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (4833:31): [True: 1.84k, False: 22.9k]
  ------------------
 4834|  22.9k|                              || TY_(nodeHasCM)(node, CM_BLOCK | CM_INLINE) )
  ------------------
  |  |   23|  22.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK | CM_INLINE) )
  ------------------
  |  |  142|  22.9k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK | CM_INLINE) )
  ------------------
  |  |  143|  22.9k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (4834:34): [True: 8.08k, False: 14.9k]
  ------------------
 4835|  9.93k|                    {
 4836|  9.93k|                        MoveBeforeTable( doc, row, node );
 4837|  9.93k|                        TY_(Report)(doc, row, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  9.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4838|  9.93k|                        lexer->exiled = yes;
 4839|  9.93k|                        exclude_state = lexer->excludeBlocks;
 4840|  9.93k|                        lexer->excludeBlocks = no;
 4841|       |
 4842|  9.93k|                        if (node->type != TextNode)
  ------------------
  |  Branch (4842:29): [True: 8.08k, False: 1.84k]
  ------------------
 4843|  8.08k|                        {
 4844|  8.08k|                            TidyParserMemory memory = {0};
 4845|  8.08k|                            memory.identity = TY_(ParseRow);
  ------------------
  |  |   23|  8.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4846|  8.08k|                            memory.original_node = row;
 4847|  8.08k|                            memory.reentry_node = node;
 4848|  8.08k|                            memory.reentry_state = STATE_POST_NOT_ENDTAG;
 4849|  8.08k|                            memory.register_1 = exclude_state;
 4850|  8.08k|                            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  8.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4851|  8.08k|                            DEBUG_LOG_EXIT_WITH_NODE(node);
 4852|  8.08k|                            return node;
 4853|  8.08k|                        }
 4854|       |                        
 4855|  1.84k|                        lexer->exiled = no;
 4856|  1.84k|                        lexer->excludeBlocks = exclude_state;
 4857|  1.84k|                        continue;
 4858|  9.93k|                    }
 4859|  14.9k|                    else if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  14.9k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (4859:30): [True: 238, False: 14.6k]
  ------------------
 4860|    238|                    {
 4861|    238|                        TY_(Report)(doc, row, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|    238|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    238|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4862|    238|                        MoveToHead( doc, row, node);
 4863|    238|                        continue;
 4864|    238|                    }
 4865|  30.9k|                }
 4866|       |
 4867|  20.7k|                if ( !(nodeIsTD(node) || nodeIsTH(node)) )
  ------------------
  |  |  395|  20.7k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  41.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 20.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 20.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 8.01k, False: 12.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                              if ( !(nodeIsTD(node) || nodeIsTH(node)) )
  ------------------
  |  |  396|  12.7k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  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: 8.79k, False: 3.95k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 4868|  3.95k|                {
 4869|  3.95k|                    TY_(Report)(doc, row, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  3.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4870|  3.95k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  3.95k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.95k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4871|  3.95k|                    continue;
 4872|  3.95k|                }
 4873|       |
 4874|       |                /* node should be <TD> or <TH> */
 4875|  16.8k|                TY_(InsertNodeAtEnd)(row, node);
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4876|  16.8k|                exclude_state = lexer->excludeBlocks;
 4877|  16.8k|                lexer->excludeBlocks = no;
 4878|  16.8k|                {
 4879|  16.8k|                    TidyParserMemory memory = {0};
 4880|  16.8k|                    memory.identity = TY_(ParseRow);
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4881|  16.8k|                    memory.original_node = row;
 4882|  16.8k|                    memory.reentry_node = node;
 4883|  16.8k|                    memory.reentry_state = STATE_POST_TD_TH;
 4884|  16.8k|                    memory.register_1 = exclude_state;
 4885|  16.8k|                    TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  16.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4886|  16.8k|                    DEBUG_LOG_EXIT_WITH_NODE(node);
 4887|  16.8k|                    return node;
 4888|  20.7k|                }
 4889|  20.7k|            } break;
 4890|       |                
 4891|       |                
 4892|  8.06k|            case STATE_POST_NOT_ENDTAG:
  ------------------
  |  Branch (4892:13): [True: 8.06k, False: 60.5k]
  ------------------
 4893|  8.06k|            {
 4894|  8.06k|                lexer->exiled = no;
 4895|  8.06k|                lexer->excludeBlocks = exclude_state; /* capture this in stack. */
 4896|  8.06k|                state = STATE_INITIAL;
 4897|  8.06k|                continue;
 4898|  20.7k|            } break;
 4899|       |                
 4900|       |                
 4901|  10.0k|            case STATE_POST_TD_TH:
  ------------------
  |  Branch (4901:13): [True: 10.0k, False: 58.5k]
  ------------------
 4902|  10.0k|            {
 4903|  10.0k|                lexer->excludeBlocks = exclude_state; /* capture this in stack. */
 4904|       |
 4905|       |                /* pop inline stack */
 4906|  16.3k|                while ( lexer->istacksize > lexer->istackbase )
  ------------------
  |  Branch (4906:25): [True: 6.27k, False: 10.0k]
  ------------------
 4907|  6.27k|                    TY_(PopInline)( doc, NULL );
  ------------------
  |  |   23|  6.27k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.27k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4908|       |                
 4909|  10.0k|                state = STATE_INITIAL;
 4910|  10.0k|                continue;
 4911|  20.7k|            } break;
 4912|       |                
 4913|       |                
 4914|      0|            default:
  ------------------
  |  Branch (4914:13): [True: 0, False: 68.6k]
  ------------------
 4915|      0|                break;
 4916|       |                
 4917|  68.6k|        } /* switch */
 4918|  68.6k|    } /* while */
 4919|  9.94k|    DEBUG_LOG_EXIT;
 4920|       |    return NULL;
 4921|  39.2k|}
prvTidyParseRowGroup:
 4933|  18.9k|{
 4934|  18.9k|    Lexer* lexer = doc->lexer;
 4935|  18.9k|    Node *node = NULL;
 4936|  18.9k|    Node *parent = NULL;
 4937|  18.9k|    DEBUG_LOG_COUNTERS;
 4938|       |
 4939|  18.9k|    enum parserState {
 4940|  18.9k|        STATE_INITIAL,                /* This is the initial state for every parser. */
 4941|  18.9k|        STATE_POST_NOT_TEXTNODE,      /* To-do after re-entering after checks. */
 4942|  18.9k|        STATE_COMPLETE,               /* Done with the switch. */
 4943|  18.9k|    } state = STATE_INITIAL;
 4944|       |
 4945|  18.9k|    if ( rowgroup == NULL )
  ------------------
  |  Branch (4945:10): [True: 6.73k, False: 12.2k]
  ------------------
 4946|  6.73k|    {
 4947|  6.73k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  6.73k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.73k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4948|  6.73k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 4949|  6.73k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 4950|  6.73k|        rowgroup = memory.original_node;
 4951|  6.73k|        state = memory.reentry_state;
 4952|  6.73k|        DEBUG_LOG_GET_OLD_MODE;
 4953|  6.73k|        mode = memory.mode;
 4954|  6.73k|        DEBUG_LOG_CHANGE_MODE;
 4955|  6.73k|    }
 4956|  12.2k|    else
 4957|  12.2k|    {
 4958|  12.2k|        DEBUG_LOG_ENTER_WITH_NODE(rowgroup);
 4959|  12.2k|        if (rowgroup->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  12.2k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (4959:13): [True: 0, False: 12.2k]
  ------------------
 4960|      0|        {
 4961|      0|            DEBUG_LOG_EXIT;
 4962|      0|            return NULL;
 4963|      0|        }
 4964|  12.2k|    }
 4965|       |
 4966|   250k|    while ( state != STATE_COMPLETE )
  ------------------
  |  Branch (4966:13): [True: 247k, False: 2.87k]
  ------------------
 4967|   247k|    {
 4968|   247k|        if ( state == STATE_INITIAL )
  ------------------
  |  Branch (4968:14): [True: 167k, False: 79.7k]
  ------------------
 4969|   167k|            node = TY_(GetToken)(doc, IgnoreWhitespace);
  ------------------
  |  |   23|   167k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   167k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4970|       |        
 4971|   247k|        switch (state)
 4972|   247k|        {
 4973|   167k|            case STATE_INITIAL:
  ------------------
  |  Branch (4973:13): [True: 167k, False: 79.7k]
  ------------------
 4974|   167k|            {
 4975|   167k|                TidyParserMemory memory = {0};
 4976|       |
 4977|   167k|                if (node == NULL)
  ------------------
  |  Branch (4977:21): [True: 2.87k, False: 164k]
  ------------------
 4978|  2.87k|                {
 4979|  2.87k|                    state = STATE_COMPLETE;
 4980|  2.87k|                    continue;
 4981|  2.87k|                }
 4982|       |                
 4983|   164k|                if (node->tag == rowgroup->tag)
  ------------------
  |  Branch (4983:21): [True: 8.24k, False: 156k]
  ------------------
 4984|  8.24k|                {
 4985|  8.24k|                    if (node->type == EndTag)
  ------------------
  |  Branch (4985:25): [True: 398, False: 7.84k]
  ------------------
 4986|    398|                    {
 4987|    398|                        rowgroup->closed = yes;
 4988|    398|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    398|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    398|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4989|    398|                        DEBUG_LOG_EXIT;
 4990|    398|                        return NULL;
 4991|    398|                    }
 4992|       |
 4993|  7.84k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  7.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 4994|  7.84k|                    DEBUG_LOG_EXIT;
 4995|  7.84k|                    return NULL;
 4996|  8.24k|                }
 4997|       |
 4998|       |                /* if </table> infer end tag */
 4999|   156k|                if ( nodeIsTABLE(node) && node->type == EndTag )
  ------------------
  |  |  393|   156k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|   313k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 156k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.6k, False: 145k]
  |  |  |  |  |  Branch (275:54): [True: 355, False: 10.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (4999:43): [True: 72, False: 283]
  ------------------
 5000|     72|                {
 5001|     72|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|     72|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     72|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5002|     72|                    DEBUG_LOG_EXIT;
 5003|     72|                    return NULL;
 5004|     72|                }
 5005|       |
 5006|       |                /* deal with comments etc. */
 5007|   156k|                if (InsertMisc(rowgroup, node))
  ------------------
  |  Branch (5007:21): [True: 68.2k, False: 88.2k]
  ------------------
 5008|  68.2k|                    continue;
 5009|       |
 5010|       |                /* discard unknown tags */
 5011|  88.2k|                if (node->tag == NULL && node->type != TextNode)
  ------------------
  |  Branch (5011:21): [True: 77.5k, False: 10.6k]
  |  Branch (5011:42): [True: 2.52k, False: 75.0k]
  ------------------
 5012|  2.52k|                {
 5013|  2.52k|                    TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5014|  2.52k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.52k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.52k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5015|  2.52k|                    continue;
 5016|  2.52k|                }
 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|  85.6k|                if (node->type != EndTag)
  ------------------
  |  Branch (5024:21): [True: 82.8k, False: 2.85k]
  ------------------
 5025|  82.8k|                {
 5026|  82.8k|                    if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  395|  82.8k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|   165k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 82.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 7.76k, False: 75.0k]
  |  |  |  |  |  Branch (275:54): [True: 316, False: 7.45k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  396|  82.5k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  82.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 82.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 7.45k, False: 75.0k]
  |  |  |  |  |  Branch (275:54): [True: 97, False: 7.35k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5027|    413|                    {
 5028|    413|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    413|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    413|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5029|    413|                        node = TY_(InferredTag)(doc, TidyTag_TR);
  ------------------
  |  |   23|    413|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    413|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5030|    413|                        TY_(Report)(doc, rowgroup, node, MISSING_STARTTAG);
  ------------------
  |  |   23|    413|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    413|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5031|    413|                    }
 5032|  82.4k|                    else if ( TY_(nodeIsText)(node)
  ------------------
  |  |   23|  82.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  82.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5032:31): [True: 75.0k, False: 7.35k]
  ------------------
 5033|  7.35k|                              || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  7.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  7.35k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                            || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  7.35k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5033:34): [True: 4.65k, False: 2.69k]
  ------------------
 5034|  79.7k|                    {
 5035|  79.7k|                        MoveBeforeTable( doc, rowgroup, node );
 5036|  79.7k|                        TY_(Report)(doc, rowgroup, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  79.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  79.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5037|  79.7k|                        lexer->exiled = yes;
 5038|       |
 5039|  79.7k|                        if (node->type != TextNode)
  ------------------
  |  Branch (5039:29): [True: 4.65k, False: 75.0k]
  ------------------
 5040|  4.65k|                        {
 5041|  4.65k|                            memory.identity = TY_(ParseRowGroup);
  ------------------
  |  |   23|  4.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5042|  4.65k|                            memory.original_node = rowgroup;
 5043|  4.65k|                            memory.reentry_node = node;
 5044|  4.65k|                            memory.reentry_state = STATE_POST_NOT_TEXTNODE;
 5045|  4.65k|                            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  4.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5046|  4.65k|                            DEBUG_LOG_EXIT_WITH_NODE(node);
 5047|  4.65k|                            return node;
 5048|  4.65k|                        }
 5049|       |                        
 5050|  75.0k|                        state = STATE_POST_NOT_TEXTNODE;
 5051|  75.0k|                        continue;
 5052|  79.7k|                    }
 5053|  2.69k|                    else if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  2.69k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (5053:30): [True: 221, False: 2.47k]
  ------------------
 5054|    221|                    {
 5055|    221|                        TY_(Report)(doc, rowgroup, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|    221|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    221|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5056|    221|                        MoveToHead(doc, rowgroup, node);
 5057|    221|                        continue;
 5058|    221|                    }
 5059|  82.8k|                }
 5060|       |
 5061|       |                /*
 5062|       |                  if this is the end tag for ancestor element
 5063|       |                  then infer end tag for this element
 5064|       |                */
 5065|  5.74k|                if (node->type == EndTag)
  ------------------
  |  Branch (5065:21): [True: 2.85k, False: 2.89k]
  ------------------
 5066|  2.85k|                {
 5067|  2.85k|                    if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  424|  2.85k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  5.70k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.85k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.85k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 195, False: 2.65k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  2.65k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.65k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  2.65k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                                  if ( nodeIsFORM(node) || TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  2.65k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5067:46): [True: 290, False: 2.36k]
  ------------------
 5068|    485|                    {
 5069|    485|                        if ( nodeIsFORM(node) )
  ------------------
  |  |  424|    485|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|    485|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 485, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 485, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 195, False: 290]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5070|    195|                            BadForm( doc );
 5071|       |
 5072|    485|                        TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    485|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    485|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5073|    485|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    485|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    485|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5074|    485|                        continue;
 5075|    485|                    }
 5076|       |
 5077|  2.36k|                    if ( nodeIsTR(node) || nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  397|  2.36k|#define nodeIsTR( node )         TagIsId( node, TidyTag_TR )
  |  |  ------------------
  |  |  |  |  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: 475, False: 1.89k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTR(node) || nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  395|  1.89k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  4.25k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.89k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.89k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 354, False: 1.53k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                                  if ( nodeIsTR(node) || nodeIsTD(node) || nodeIsTH(node) )
  ------------------
  |  |  396|  1.53k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  1.53k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.53k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.53k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 198, False: 1.33k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5078|  1.02k|                    {
 5079|  1.02k|                        TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5080|  1.02k|                        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5081|  1.02k|                        continue;
 5082|  1.02k|                    }
 5083|       |
 5084|  1.33k|                    for ( parent = rowgroup->parent;
 5085|  5.02k|                          parent != NULL;
  ------------------
  |  Branch (5085:27): [True: 3.89k, False: 1.12k]
  ------------------
 5086|  3.68k|                          parent = parent->parent )
 5087|  3.89k|                    {
 5088|  3.89k|                        if (node->tag == parent->tag)
  ------------------
  |  Branch (5088:29): [True: 210, False: 3.68k]
  ------------------
 5089|    210|                        {
 5090|    210|                            TY_(UngetToken)( doc );
  ------------------
  |  |   23|    210|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    210|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5091|    210|                            DEBUG_LOG_EXIT;
 5092|    210|                            return NULL;
 5093|    210|                        }
 5094|  3.89k|                    }
 5095|  1.33k|                }
 5096|       |
 5097|       |                /*
 5098|       |                  if THEAD, TFOOT or TBODY then implied end tag
 5099|       |
 5100|       |                */
 5101|  4.01k|                if (node->tag->model & CM_ROWGRP)
  ------------------
  |  |  147|  4.01k|#define CM_ROWGRP       (1 << 8)   /**< Used for "THEAD", "TFOOT" or "TBODY". */
  ------------------
  |  Branch (5101:21): [True: 1.69k, False: 2.32k]
  ------------------
 5102|  1.69k|                {
 5103|  1.69k|                    if (node->type != EndTag)
  ------------------
  |  Branch (5103:25): [True: 808, False: 885]
  ------------------
 5104|    808|                    {
 5105|    808|                        TY_(UngetToken)( doc );
  ------------------
  |  |   23|    808|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    808|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5106|    808|                        DEBUG_LOG_EXIT;
 5107|    808|                        return NULL;
 5108|    808|                    }
 5109|  1.69k|                }
 5110|       |
 5111|  3.21k|                if (node->type == EndTag)
  ------------------
  |  Branch (5111:21): [True: 1.12k, False: 2.08k]
  ------------------
 5112|  1.12k|                {
 5113|  1.12k|                    TY_(Report)(doc, rowgroup, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5114|  1.12k|                    TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.12k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.12k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5115|  1.12k|                    continue;
 5116|  1.12k|                }
 5117|       |
 5118|  2.08k|                if ( !nodeIsTR(node) )
  ------------------
  |  |  397|  2.08k|#define nodeIsTR( node )         TagIsId( node, TidyTag_TR )
  |  |  ------------------
  |  |  |  |  275|  2.08k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.08k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.08k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.00k, False: 1.07k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5119|  1.07k|                {
 5120|  1.07k|                    node = TY_(InferredTag)(doc, TidyTag_TR);
  ------------------
  |  |   23|  1.07k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.07k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5121|  1.07k|                    TY_(Report)(doc, rowgroup, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  1.07k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.07k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5122|  1.07k|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.07k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.07k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5123|  1.07k|                }
 5124|       |
 5125|       |               /* node should be <TR> */
 5126|  2.08k|                TY_(InsertNodeAtEnd)(rowgroup, node);
  ------------------
  |  |   23|  2.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5127|  2.08k|                memory.identity = TY_(ParseRowGroup);
  ------------------
  |  |   23|  2.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5128|  2.08k|                memory.original_node = rowgroup;
 5129|  2.08k|                memory.reentry_node = node;
 5130|  2.08k|                memory.reentry_state = STATE_INITIAL;
 5131|  2.08k|                TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  2.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5132|  2.08k|                DEBUG_LOG_EXIT_WITH_NODE(node);
 5133|  2.08k|                return node;
 5134|  3.21k|            } break;
 5135|       |                
 5136|       |                
 5137|  79.7k|            case STATE_POST_NOT_TEXTNODE:
  ------------------
  |  Branch (5137:13): [True: 79.7k, False: 167k]
  ------------------
 5138|  79.7k|            {
 5139|  79.7k|                lexer->exiled = no;
 5140|  79.7k|                state = STATE_INITIAL;
 5141|  79.7k|                continue;
 5142|  3.21k|            } break;
 5143|       |
 5144|       |                
 5145|      0|            default:
  ------------------
  |  Branch (5145:13): [True: 0, False: 247k]
  ------------------
 5146|      0|                break;
 5147|   247k|        } /* switch */
 5148|   247k|    } /* while */
 5149|  2.87k|    DEBUG_LOG_EXIT;
 5150|       |    return NULL;
 5151|  18.9k|}
prvTidyParseScript:
 5171|  4.39k|{
 5172|  4.39k|    Node *node = NULL;
 5173|       |#if defined(ENABLE_DEBUG_LOG)
 5174|       |    static int depth_parser = 0;
 5175|       |    static int count_parser = 0;
 5176|       |#endif
 5177|       |    
 5178|  4.39k|    DEBUG_LOG_ENTER_WITH_NODE(script);
 5179|       |    
 5180|  4.39k|    doc->lexer->parent = script;
 5181|  4.39k|    node = TY_(GetToken)(doc, CdataContent);
  ------------------
  |  |   23|  4.39k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.39k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5182|  4.39k|    doc->lexer->parent = NULL;
 5183|       |
 5184|  4.39k|    if (node)
  ------------------
  |  Branch (5184:9): [True: 3.28k, False: 1.10k]
  ------------------
 5185|  3.28k|    {
 5186|  3.28k|        TY_(InsertNodeAtEnd)(script, node);
  ------------------
  |  |   23|  3.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5187|  3.28k|    }
 5188|  1.10k|    else
 5189|  1.10k|    {
 5190|       |        /* handle e.g. a document like "<script>" */
 5191|  1.10k|        TY_(Report)(doc, script, NULL, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  1.10k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.10k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5192|  1.10k|        DEBUG_LOG_EXIT;
 5193|  1.10k|        return NULL;
 5194|  1.10k|    }
 5195|       |
 5196|  3.28k|    node = TY_(GetToken)(doc, IgnoreWhitespace);
  ------------------
  |  |   23|  3.28k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.28k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5197|  3.28k|    DEBUG_LOG_GOT_TOKEN(node);
 5198|       |
 5199|  3.28k|    if (!(node && node->type == EndTag && node->tag &&
  ------------------
  |  Branch (5199:11): [True: 2.62k, False: 664]
  |  Branch (5199:19): [True: 2.25k, False: 366]
  |  Branch (5199:43): [True: 1.67k, False: 583]
  ------------------
 5200|  1.67k|        node->tag->id == script->tag->id))
  ------------------
  |  Branch (5200:9): [True: 1.47k, False: 200]
  ------------------
 5201|  1.81k|    {
 5202|  1.81k|        TY_(Report)(doc, script, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  1.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5203|       |
 5204|  1.81k|        if (node)
  ------------------
  |  Branch (5204:13): [True: 1.14k, False: 664]
  ------------------
 5205|  1.14k|            TY_(UngetToken)(doc);
  ------------------
  |  |   23|  1.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5206|  1.81k|    }
 5207|  1.47k|    else
 5208|  1.47k|    {
 5209|  1.47k|        TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  1.47k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.47k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5210|  1.47k|    }
 5211|  3.28k|    DEBUG_LOG_EXIT;
 5212|       |    return NULL;
 5213|  4.39k|}
prvTidyParseSelect:
 5225|  1.93k|{
 5226|  1.93k|    Lexer* lexer = doc->lexer;
 5227|  1.93k|    Node *node;
 5228|  1.93k|    DEBUG_LOG_COUNTERS;
 5229|       |
 5230|  1.93k|    if ( field == NULL )
  ------------------
  |  Branch (5230:10): [True: 1.24k, False: 692]
  ------------------
 5231|  1.24k|    {
 5232|  1.24k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5233|  1.24k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 5234|  1.24k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 5235|  1.24k|        field = memory.original_node;
 5236|  1.24k|        DEBUG_LOG_GET_OLD_MODE;
 5237|  1.24k|        mode = memory.mode;
 5238|  1.24k|        DEBUG_LOG_CHANGE_MODE;
 5239|  1.24k|    }
 5240|    692|    else
 5241|    692|    {
 5242|    692|        DEBUG_LOG_ENTER_WITH_NODE(field);
 5243|    692|    }
 5244|       |    
 5245|  1.93k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 5246|       |
 5247|  4.84k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  4.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5247:12): [True: 4.22k, False: 626]
  ------------------
 5248|  4.22k|    {
 5249|  4.22k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (5249:13): [True: 484, False: 3.73k]
  |  Branch (5249:40): [True: 66, False: 418]
  ------------------
 5250|     66|        {
 5251|     66|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|     66|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     66|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5252|     66|            field->closed = yes;
 5253|     66|            TrimSpaces(doc, field);
 5254|       |
 5255|     66|            DEBUG_LOG_EXIT;
 5256|     66|            return NULL;
 5257|     66|        }
 5258|       |
 5259|       |        /* deal with comments etc. */
 5260|  4.15k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (5260:13): [True: 225, False: 3.93k]
  ------------------
 5261|    225|            continue;
 5262|       |
 5263|  3.93k|        if ( node->type == StartTag &&
  ------------------
  |  Branch (5263:14): [True: 3.00k, False: 932]
  ------------------
 5264|  3.00k|             ( nodeIsOPTION(node)   ||
  ------------------
  |  |  410|  3.00k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|  6.00k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.00k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.33k, False: 668]
  |  |  |  |  |  Branch (275:54): [True: 303, False: 2.02k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5265|  3.00k|               nodeIsOPTGROUP(node) ||
  ------------------
  |  |  411|  2.69k|#define nodeIsOPTGROUP( node )   TagIsId( node, TidyTag_OPTGROUP )
  |  |  ------------------
  |  |  |  |  275|  5.69k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.69k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.02k, False: 668]
  |  |  |  |  |  Branch (275:54): [True: 475, False: 1.55k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5266|  3.00k|               nodeIsDATALIST(node) ||
  ------------------
  |  |  463|  2.22k|#define nodeIsDATALIST( node )   TagIsId( node, TidyTag_DATALIST )
  |  |  ------------------
  |  |  |  |  275|  5.22k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.22k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.55k, False: 668]
  |  |  |  |  |  Branch (275:54): [True: 262, False: 1.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5267|  3.00k|               nodeIsSCRIPT(node))
  ------------------
  |  |  422|  1.96k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  1.96k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.96k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.29k, False: 668]
  |  |  |  |  |  Branch (275:54): [True: 202, False: 1.09k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5268|  3.93k|           )
 5269|  1.24k|        {
 5270|  1.24k|            TidyParserMemory memory = {0};
 5271|  1.24k|            memory.identity = TY_(ParseSelect);
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5272|  1.24k|            memory.original_node = field;
 5273|  1.24k|            memory.reentry_node = node;
 5274|       |
 5275|  1.24k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5276|  1.24k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5277|  1.24k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 5278|  1.24k|            return node;
 5279|  1.24k|        }
 5280|       |
 5281|       |        /* discard unexpected tags */
 5282|  2.69k|        TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  2.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5283|  2.69k|        TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  2.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5284|  2.69k|    }
 5285|       |
 5286|    626|    TY_(Report)(doc, field, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|    626|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    626|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5287|       |
 5288|    626|    DEBUG_LOG_EXIT;
 5289|       |    return NULL;
 5290|  1.93k|}
prvTidyParseTableTag:
 5302|  56.1k|{
 5303|  56.1k|    Lexer* lexer = doc->lexer;
 5304|  56.1k|    Node *node, *parent;
 5305|  56.1k|    uint istackbase;
 5306|  56.1k|    DEBUG_LOG_COUNTERS;
 5307|       |
 5308|  56.1k|    if ( table == NULL )
  ------------------
  |  Branch (5308:10): [True: 26.9k, False: 29.1k]
  ------------------
 5309|  26.9k|    {
 5310|  26.9k|        TidyParserMemory memory = TY_(popMemory)( doc );
  ------------------
  |  |   23|  26.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5311|  26.9k|        node = memory.reentry_node; /* Throwaway, as main loop overrwrites anyway. */
 5312|  26.9k|        DEBUG_LOG_REENTER_WITH_NODE(node);
 5313|  26.9k|        table = memory.original_node;
 5314|  26.9k|        lexer->exiled = memory.register_1;
 5315|  26.9k|        DEBUG_LOG_GET_OLD_MODE;
 5316|  26.9k|        mode = memory.mode;
 5317|  26.9k|        DEBUG_LOG_CHANGE_MODE;
 5318|  26.9k|    }
 5319|  29.1k|    else
 5320|  29.1k|    {
 5321|  29.1k|        DEBUG_LOG_ENTER_WITH_NODE(table);
 5322|  29.1k|        TY_(DeferDup)( doc );
  ------------------
  |  |   23|  29.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5323|  29.1k|    }
 5324|       |
 5325|  56.1k|    istackbase = lexer->istackbase;
 5326|  56.1k|    lexer->istackbase = lexer->istacksize;
 5327|       |
 5328|  60.6k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  60.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5328:12): [True: 41.6k, False: 19.0k]
  ------------------
 5329|  41.6k|    {
 5330|  41.6k|        DEBUG_LOG_GOT_TOKEN(node);
 5331|  41.6k|        if (node->tag == table->tag )
  ------------------
  |  Branch (5331:13): [True: 1.97k, False: 39.6k]
  ------------------
 5332|  1.97k|        {
 5333|  1.97k|            if (node->type == EndTag)
  ------------------
  |  Branch (5333:17): [True: 249, False: 1.72k]
  ------------------
 5334|    249|            {
 5335|    249|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    249|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    249|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5336|    249|            }
 5337|  1.72k|            else
 5338|  1.72k|            {
 5339|       |                /* Issue #498 - If a <table> in a <table>
 5340|       |                 * just close the current table, and issue a
 5341|       |                 * warning. The previous action was to discard
 5342|       |                 * this second <table>
 5343|       |                 */
 5344|  1.72k|                TY_(UngetToken)(doc);
  ------------------
  |  |   23|  1.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5345|  1.72k|                TY_(Report)(doc, table, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.72k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.72k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5346|  1.72k|            }
 5347|  1.97k|            lexer->istackbase = istackbase;
 5348|  1.97k|            table->closed = yes;
 5349|       |
 5350|  1.97k|            DEBUG_LOG_EXIT;
 5351|  1.97k|            return NULL;
 5352|  1.97k|        }
 5353|       |
 5354|       |        /* deal with comments etc. */
 5355|  39.6k|        if (InsertMisc(table, node))
  ------------------
  |  Branch (5355:13): [True: 527, False: 39.1k]
  ------------------
 5356|    527|            continue;
 5357|       |
 5358|       |        /* discard unknown tags */
 5359|  39.1k|        if (node->tag == NULL && node->type != TextNode)
  ------------------
  |  Branch (5359:13): [True: 3.02k, False: 36.0k]
  |  Branch (5359:34): [True: 1.04k, False: 1.97k]
  ------------------
 5360|  1.04k|        {
 5361|  1.04k|            TY_(Report)(doc, table, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5362|  1.04k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5363|  1.04k|            continue;
 5364|  1.04k|        }
 5365|       |
 5366|       |        /* if TD or TH or text or inline or block then infer <TR> */
 5367|       |
 5368|  38.0k|        if (node->type != EndTag)
  ------------------
  |  Branch (5368:13): [True: 36.1k, False: 1.89k]
  ------------------
 5369|  36.1k|        {
 5370|  36.1k|            if ( nodeIsTD(node) || nodeIsTH(node) || nodeIsTABLE(node) )
  ------------------
  |  |  395|  36.1k|#define nodeIsTD( node )         TagIsId( node, TidyTag_TD )
  |  |  ------------------
  |  |  |  |  275|  72.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 36.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 34.1k, False: 1.97k]
  |  |  |  |  |  Branch (275:54): [True: 471, False: 33.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsTD(node) || nodeIsTH(node) || nodeIsTABLE(node) )
  ------------------
  |  |  396|  35.7k|#define nodeIsTH( node )         TagIsId( node, TidyTag_TH )
  |  |  ------------------
  |  |  |  |  275|  71.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 35.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 33.7k, False: 1.97k]
  |  |  |  |  |  Branch (275:54): [True: 8.21k, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                          if ( nodeIsTD(node) || nodeIsTH(node) || nodeIsTABLE(node) )
  ------------------
  |  |  393|  27.4k|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  27.4k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 27.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 25.5k, False: 1.97k]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 25.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5371|  8.68k|            {
 5372|  8.68k|                TY_(UngetToken)( doc );
  ------------------
  |  |   23|  8.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5373|  8.68k|                node = TY_(InferredTag)(doc, TidyTag_TR);
  ------------------
  |  |   23|  8.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5374|  8.68k|                TY_(Report)(doc, table, node, MISSING_STARTTAG);
  ------------------
  |  |   23|  8.68k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.68k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5375|  8.68k|            }
 5376|  27.4k|            else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  27.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  27.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  25.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  25.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  25.5k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                          else if ( TY_(nodeIsText)(node) ||TY_(nodeHasCM)(node,CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  25.5k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5376:23): [True: 1.97k, False: 25.5k]
  |  Branch (5376:47): [True: 1.60k, False: 23.9k]
  ------------------
 5377|  3.58k|            {
 5378|  3.58k|                TY_(InsertNodeBeforeElement)(table, node);
  ------------------
  |  |   23|  3.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5379|  3.58k|                TY_(Report)(doc, table, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  3.58k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.58k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5380|  3.58k|                lexer->exiled = yes;
 5381|       |
 5382|  3.58k|                if (node->type != TextNode)
  ------------------
  |  Branch (5382:21): [True: 1.60k, False: 1.97k]
  ------------------
 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.97k|                lexer->exiled = no;
 5396|  1.97k|                continue;
 5397|  3.58k|            }
 5398|  23.9k|            else if (node->tag->model & CM_HEAD)
  ------------------
  |  |  141|  23.9k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
  |  Branch (5398:22): [True: 316, False: 23.5k]
  ------------------
 5399|    316|            {
 5400|    316|                MoveToHead(doc, table, node);
 5401|    316|                continue;
 5402|    316|            }
 5403|  36.1k|        }
 5404|       |
 5405|       |        /*
 5406|       |          if this is the end tag for an ancestor element
 5407|       |          then infer end tag for this element
 5408|       |        */
 5409|  34.1k|        if (node->type == EndTag)
  ------------------
  |  Branch (5409:13): [True: 1.89k, False: 32.2k]
  ------------------
 5410|  1.89k|        {
 5411|  1.89k|            if ( nodeIsFORM(node) )
  ------------------
  |  |  424|  1.89k|#define nodeIsFORM( node )       TagIsId( node, TidyTag_FORM )
  |  |  ------------------
  |  |  |  |  275|  1.89k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.89k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.89k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 253, False: 1.64k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5412|    253|            {
 5413|    253|                BadForm( doc );
 5414|    253|                TY_(Report)(doc, table, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    253|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    253|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5415|    253|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    253|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    253|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5416|    253|                continue;
 5417|    253|            }
 5418|       |
 5419|       |            /* best to discard unexpected block/inline end tags */
 5420|  1.64k|            if ( TY_(nodeHasCM)(node, CM_TABLE|CM_ROW) ||
  ------------------
  |  |   23|  1.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          if ( TY_(nodeHasCM)(node, CM_TABLE|CM_ROW) ||
  ------------------
  |  |  146|  1.64k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
                          if ( TY_(nodeHasCM)(node, CM_TABLE|CM_ROW) ||
  ------------------
  |  |  148|  1.64k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (5420:18): [True: 216, False: 1.42k]
  ------------------
 5421|  1.42k|                 TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |   23|  1.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                               TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  142|  1.42k|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
                               TY_(nodeHasCM)(node, CM_BLOCK|CM_INLINE) )
  ------------------
  |  |  143|  1.42k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5421:18): [True: 221, False: 1.20k]
  ------------------
 5422|    437|            {
 5423|    437|                TY_(Report)(doc, table, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    437|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    437|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5424|    437|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    437|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    437|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5425|    437|                continue;
 5426|    437|            }
 5427|       |
 5428|  1.20k|            for ( parent = table->parent;
 5429|  24.9k|                  parent != NULL;
  ------------------
  |  Branch (5429:19): [True: 24.0k, False: 948]
  ------------------
 5430|  23.7k|                  parent = parent->parent )
 5431|  24.0k|            {
 5432|  24.0k|                if (node->tag == parent->tag)
  ------------------
  |  Branch (5432:21): [True: 258, False: 23.7k]
  ------------------
 5433|    258|                {
 5434|    258|                    TY_(Report)(doc, table, node, MISSING_ENDTAG_BEFORE );
  ------------------
  |  |   23|    258|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    258|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5435|    258|                    TY_(UngetToken)( doc );
  ------------------
  |  |   23|    258|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    258|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5436|    258|                    lexer->istackbase = istackbase;
 5437|       |
 5438|    258|                    DEBUG_LOG_EXIT;
 5439|    258|                    return NULL;
 5440|    258|                }
 5441|  24.0k|            }
 5442|  1.20k|        }
 5443|       |
 5444|  33.2k|        if (!(node->tag->model & CM_TABLE))
  ------------------
  |  |  146|  33.2k|#define CM_TABLE        (1 << 7)   /**< Elements that can appear inside TABLE. */
  ------------------
  |  Branch (5444:13): [True: 1.11k, False: 32.1k]
  ------------------
 5445|  1.11k|        {
 5446|  1.11k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5447|  1.11k|            TY_(Report)(doc, table, node, TAG_NOT_ALLOWED_IN);
  ------------------
  |  |   23|  1.11k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.11k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5448|  1.11k|            lexer->istackbase = istackbase;
 5449|       |
 5450|  1.11k|            DEBUG_LOG_EXIT;
 5451|  1.11k|            return NULL;
 5452|  1.11k|        }
 5453|       |
 5454|  32.1k|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  32.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5454:13): [True: 32.1k, False: 0]
  ------------------
 5455|  32.1k|        {
 5456|  32.1k|            TidyParserMemory memory = {0};
 5457|  32.1k|            TY_(InsertNodeAtEnd)(table, node);
  ------------------
  |  |   23|  32.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5458|  32.1k|            memory.identity = TY_(ParseTableTag);
  ------------------
  |  |   23|  32.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5459|  32.1k|            memory.original_node = table;
 5460|  32.1k|            memory.reentry_node = node;
 5461|  32.1k|            memory.register_1 = lexer->exiled;
 5462|  32.1k|            TY_(pushMemory)( doc, memory );
  ------------------
  |  |   23|  32.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5463|  32.1k|            DEBUG_LOG_EXIT_WITH_NODE(node);
 5464|  32.1k|            return node;
 5465|  32.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|  19.0k|    TY_(Report)(doc, table, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|  19.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5473|  19.0k|    lexer->istackbase = istackbase;
 5474|       |
 5475|  19.0k|    DEBUG_LOG_EXIT;
 5476|       |    return NULL;
 5477|  56.1k|}
prvTidyParseText:
 5489|  4.42k|{
 5490|  4.42k|    Lexer* lexer = doc->lexer;
 5491|  4.42k|    Node *node;
 5492|  4.42k|    DEBUG_LOG_COUNTERS;
 5493|       |    
 5494|  4.42k|    DEBUG_LOG_ENTER_WITH_NODE(field);
 5495|       |
 5496|  4.42k|    lexer->insert = NULL;  /* defer implicit inline start tags */
 5497|       |
 5498|  4.42k|    DEBUG_LOG_GET_OLD_MODE;
 5499|  4.42k|    if ( nodeIsTEXTAREA(field) )
  ------------------
  |  |  425|  4.42k|#define nodeIsTEXTAREA( node )   TagIsId( node, TidyTag_TEXTAREA )
  |  |  ------------------
  |  |  |  |  275|  4.42k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.42k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.42k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.71k, False: 2.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5500|  1.71k|        mode = Preformatted;
 5501|  2.70k|    else
 5502|  2.70k|        mode = MixedContent;  /* kludge for font tags */
 5503|  4.42k|    DEBUG_LOG_CHANGE_MODE;
 5504|       |
 5505|  8.29k|    while ((node = TY_(GetToken)(doc, mode)) != NULL)
  ------------------
  |  |   23|  8.29k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.29k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5505:12): [True: 7.41k, False: 881]
  ------------------
 5506|  7.41k|    {
 5507|  7.41k|        if (node->tag == field->tag && node->type == EndTag)
  ------------------
  |  Branch (5507:13): [True: 3.07k, False: 4.33k]
  |  Branch (5507:40): [True: 199, False: 2.87k]
  ------------------
 5508|    199|        {
 5509|    199|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    199|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    199|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5510|    199|            field->closed = yes;
 5511|    199|            TrimSpaces(doc, field);
 5512|    199|            DEBUG_LOG_EXIT;
 5513|    199|            return NULL;
 5514|    199|        }
 5515|       |
 5516|       |        /* deal with comments etc. */
 5517|  7.21k|        if (InsertMisc(field, node))
  ------------------
  |  Branch (5517:13): [True: 1.55k, False: 5.66k]
  ------------------
 5518|  1.55k|            continue;
 5519|       |
 5520|  5.66k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  5.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5520:13): [True: 1.93k, False: 3.73k]
  ------------------
 5521|  1.93k|        {
 5522|       |            /* only called for 1st child */
 5523|  1.93k|            if (field->content == NULL && !(mode & Preformatted))
  ------------------
  |  Branch (5523:17): [True: 1.14k, False: 789]
  |  Branch (5523:43): [True: 534, False: 611]
  ------------------
 5524|    534|                TrimSpaces(doc, field);
 5525|       |
 5526|  1.93k|            if (node->start >= node->end)
  ------------------
  |  Branch (5526:17): [True: 1, False: 1.93k]
  ------------------
 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.93k|            TY_(InsertNodeAtEnd)(field, node);
  ------------------
  |  |   23|  1.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5533|  1.93k|            continue;
 5534|  1.93k|        }
 5535|       |
 5536|       |        /* for textarea should all cases of < and & be escaped? */
 5537|       |
 5538|       |        /* discard inline tags e.g. font */
 5539|  3.73k|        if (   node->tag
  ------------------
  |  Branch (5539:16): [True: 3.31k, False: 414]
  ------------------
 5540|  3.31k|            && node->tag->model & CM_INLINE
  ------------------
  |  |  143|  7.04k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (5540:16): [True: 1.46k, False: 1.85k]
  ------------------
 5541|  1.46k|            && !(node->tag->model & CM_FIELD)) /* #487283 - fix by Lee Passey 25 Jan 02 */
  ------------------
  |  |  149|  1.46k|#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: 386, False: 1.07k]
  ------------------
 5542|    386|        {
 5543|    386|            TY_(Report)(doc, field, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    386|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    386|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5544|    386|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    386|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    386|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5545|    386|            continue;
 5546|    386|        }
 5547|       |
 5548|       |        /* terminate element on other tags */
 5549|  3.34k|        if (!(field->tag->model & CM_OPT))
  ------------------
  |  |  154|  3.34k|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (5549:13): [True: 1.44k, False: 1.90k]
  ------------------
 5550|  1.44k|            TY_(Report)(doc, field, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5551|       |
 5552|  3.34k|        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  3.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5553|  3.34k|        TrimSpaces(doc, field);
 5554|  3.34k|        DEBUG_LOG_EXIT;
 5555|  3.34k|        return NULL;
 5556|  3.73k|    }
 5557|       |
 5558|    881|    if (!(field->tag->model & CM_OPT))
  ------------------
  |  |  154|    881|#define CM_OPT          (1 << 15)  /**< Elements with an optional end tag. */
  ------------------
  |  Branch (5558:9): [True: 277, False: 604]
  ------------------
 5559|    277|        TY_(Report)(doc, field, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|    277|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    277|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5560|    881|    DEBUG_LOG_EXIT;
 5561|       |    return NULL;
 5562|  4.42k|}
prvTidyParseTitle:
 5574|  3.12k|{
 5575|  3.12k|    Node *node;
 5576|  6.97k|    while ((node = TY_(GetToken)(doc, MixedContent)) != NULL)
  ------------------
  |  |   23|  6.97k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.97k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5576:12): [True: 6.47k, False: 496]
  ------------------
 5577|  6.47k|    {
 5578|  6.47k|        if (node->tag == title->tag && node->type == StartTag
  ------------------
  |  Branch (5578:13): [True: 3.32k, False: 3.15k]
  |  Branch (5578:40): [True: 1.15k, False: 2.16k]
  ------------------
 5579|  1.15k|            && cfgBool(doc, TidyCoerceEndTags) )
  ------------------
  |  |  418|  1.15k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.15k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 1.15k, False: 0]
  |  |  ------------------
  ------------------
 5580|  1.15k|        {
 5581|  1.15k|            TY_(Report)(doc, title, node, COERCE_TO_ENDTAG);
  ------------------
  |  |   23|  1.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5582|  1.15k|            node->type = EndTag;
 5583|  1.15k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5584|  1.15k|            continue;
 5585|  1.15k|        }
 5586|  5.32k|        else if (node->tag == title->tag && node->type == EndTag)
  ------------------
  |  Branch (5586:18): [True: 2.16k, False: 3.15k]
  |  Branch (5586:45): [True: 1.18k, False: 981]
  ------------------
 5587|  1.18k|        {
 5588|  1.18k|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.18k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.18k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5589|  1.18k|            title->closed = yes;
 5590|  1.18k|            TrimSpaces(doc, title);
 5591|  1.18k|            return NULL;
 5592|  1.18k|        }
 5593|       |
 5594|  4.14k|        if (TY_(nodeIsText)(node))
  ------------------
  |  |   23|  4.14k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.14k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5594:13): [True: 1.44k, False: 2.69k]
  ------------------
 5595|  1.44k|        {
 5596|       |            /* only called for 1st child */
 5597|  1.44k|            if (title->content == NULL)
  ------------------
  |  Branch (5597:17): [True: 989, False: 460]
  ------------------
 5598|    989|                TrimInitialSpace(doc, title, node);
 5599|       |
 5600|  1.44k|            if (node->start >= node->end)
  ------------------
  |  Branch (5600:17): [True: 93, False: 1.35k]
  ------------------
 5601|     93|            {
 5602|     93|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|     93|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     93|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5603|     93|                continue;
 5604|     93|            }
 5605|       |
 5606|  1.35k|            TY_(InsertNodeAtEnd)(title, node);
  ------------------
  |  |   23|  1.35k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.35k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5607|  1.35k|            continue;
 5608|  1.44k|        }
 5609|       |
 5610|       |        /* deal with comments etc. */
 5611|  2.69k|        if (InsertMisc(title, node))
  ------------------
  |  Branch (5611:13): [True: 272, False: 2.41k]
  ------------------
 5612|    272|            continue;
 5613|       |
 5614|       |        /* discard unknown tags */
 5615|  2.41k|        if (node->tag == NULL)
  ------------------
  |  Branch (5615:13): [True: 976, False: 1.44k]
  ------------------
 5616|    976|        {
 5617|    976|            TY_(Report)(doc, title, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    976|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    976|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5618|    976|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    976|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    976|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5619|    976|            continue;
 5620|    976|        }
 5621|       |
 5622|       |        /* pushback unexpected tokens */
 5623|  1.44k|        TY_(Report)(doc, title, node, MISSING_ENDTAG_BEFORE);
  ------------------
  |  |   23|  1.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5624|  1.44k|        TY_(UngetToken)( doc );
  ------------------
  |  |   23|  1.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5625|  1.44k|        TrimSpaces(doc, title);
 5626|  1.44k|        return NULL;
 5627|  2.41k|    }
 5628|       |
 5629|    496|    TY_(Report)(doc, title, node, MISSING_ENDTAG_FOR);
  ------------------
  |  |   23|    496|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    496|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5630|       |    return NULL;
 5631|  3.12k|}
prvTidyCheckNodeIntegrity:
 5902|  5.44M|{
 5903|  5.44M|#ifndef NO_NODE_INTEGRITY_CHECK
 5904|  5.44M|    Node *child;
 5905|       |
 5906|  5.44M|    if (node->prev)
  ------------------
  |  Branch (5906:9): [True: 1.20M, False: 4.24M]
  ------------------
 5907|  1.20M|    {
 5908|  1.20M|        if (node->prev->next != node)
  ------------------
  |  Branch (5908:13): [True: 0, False: 1.20M]
  ------------------
 5909|      0|            return no;
 5910|  1.20M|    }
 5911|       |
 5912|  5.44M|    if (node->next)
  ------------------
  |  Branch (5912:9): [True: 1.20M, False: 4.24M]
  ------------------
 5913|  1.20M|    {
 5914|  1.20M|        if (node->next == node || node->next->prev != node)
  ------------------
  |  Branch (5914:13): [True: 0, False: 1.20M]
  |  Branch (5914:35): [True: 0, False: 1.20M]
  ------------------
 5915|      0|            return no;
 5916|  1.20M|    }
 5917|       |
 5918|  5.44M|    if (node->parent)
  ------------------
  |  Branch (5918:9): [True: 5.40M, False: 41.2k]
  ------------------
 5919|  5.40M|    {
 5920|  5.40M|        if (node->prev == NULL && node->parent->content != node)
  ------------------
  |  Branch (5920:13): [True: 4.19M, False: 1.20M]
  |  Branch (5920:35): [True: 0, False: 4.19M]
  ------------------
 5921|      0|            return no;
 5922|       |
 5923|  5.40M|        if (node->next == NULL && node->parent->last != node)
  ------------------
  |  Branch (5923:13): [True: 4.19M, False: 1.20M]
  |  Branch (5923:35): [True: 0, False: 4.19M]
  ------------------
 5924|      0|            return no;
 5925|  5.40M|    }
 5926|       |
 5927|  10.8M|    for (child = node->content; child; child = child->next)
  ------------------
  |  Branch (5927:33): [True: 5.40M, False: 5.44M]
  ------------------
 5928|  5.40M|        if ( child->parent != node || !TY_(CheckNodeIntegrity)(child) )
  ------------------
  |  |   23|  5.40M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.40M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5928:14): [True: 0, False: 5.40M]
  |  Branch (5928:39): [True: 0, False: 5.40M]
  ------------------
 5929|      0|            return no;
 5930|       |
 5931|  5.44M|#endif
 5932|  5.44M|    return yes;
 5933|  5.44M|}
prvTidyCoerceNode:
 5941|  9.84k|{
 5942|  9.84k|    const Dict* tag = TY_(LookupTagDef)(tid);
  ------------------
  |  |   23|  9.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5943|  9.84k|    Node* tmp = TY_(InferredTag)(doc, tag->id);
  ------------------
  |  |   23|  9.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5944|       |
 5945|  9.84k|    if (obsolete)
  ------------------
  |  Branch (5945:9): [True: 1.81k, False: 8.02k]
  ------------------
 5946|  1.81k|        TY_(Report)(doc, node, tmp, OBSOLETE_ELEMENT);
  ------------------
  |  |   23|  1.81k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.81k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5947|  8.02k|    else if (unexpected)
  ------------------
  |  Branch (5947:14): [True: 0, False: 8.02k]
  ------------------
 5948|      0|        TY_(Report)(doc, node, tmp, REPLACING_UNEX_ELEMENT);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5949|  8.02k|    else
 5950|  8.02k|        TY_(Report)(doc, node, tmp, REPLACING_ELEMENT);
  ------------------
  |  |   23|  8.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5951|       |
 5952|  9.84k|    TidyDocFree(doc, tmp->element);
  ------------------
  |  |  159|  9.84k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  9.84k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 5953|  9.84k|    TidyDocFree(doc, tmp);
  ------------------
  |  |  159|  9.84k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  9.84k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 5954|       |
 5955|  9.84k|    node->was = node->tag;
 5956|  9.84k|    node->tag = tag;
 5957|  9.84k|    node->type = StartTag;
 5958|  9.84k|    node->implicit = yes;
 5959|  9.84k|    TidyDocFree(doc, node->element);
  ------------------
  |  |  159|  9.84k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  9.84k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 5960|  9.84k|    node->element = TY_(tmbstrdup)(doc->allocator, tag->name);
  ------------------
  |  |   23|  9.84k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.84k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5961|  9.84k|}
prvTidyDiscardElement:
 5968|   431k|{
 5969|   431k|    Node *next = NULL;
 5970|       |
 5971|   431k|    if (element)
  ------------------
  |  Branch (5971:9): [True: 431k, False: 0]
  ------------------
 5972|   431k|    {
 5973|   431k|        next = element->next;
 5974|   431k|        TY_(RemoveNode)(element);
  ------------------
  |  |   23|   431k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   431k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5975|   431k|        TY_(FreeNode)( doc, element);
  ------------------
  |  |   23|   431k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   431k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5976|   431k|    }
 5977|       |
 5978|   431k|    return next;
 5979|   431k|}
prvTidyDropEmptyElements:
 5986|  2.43M|{
 5987|  2.43M|    Node* next;
 5988|       |
 5989|  5.62M|    while (node)
  ------------------
  |  Branch (5989:12): [True: 3.18M, False: 2.43M]
  ------------------
 5990|  3.18M|    {
 5991|  3.18M|        next = node->next;
 5992|       |
 5993|  3.18M|        if (node->content)
  ------------------
  |  Branch (5993:13): [True: 2.41M, False: 775k]
  ------------------
 5994|  2.41M|            TY_(DropEmptyElements)(doc, node->content);
  ------------------
  |  |   23|  2.41M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.41M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5995|       |
 5996|  3.18M|        if (!TY_(nodeIsElement)(node) &&
  ------------------
  |  |   23|  3.18M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.18M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5996:13): [True: 496k, False: 2.69M]
  ------------------
 5997|   496k|            !(TY_(nodeIsText)(node) && !(node->start < node->end)))
  ------------------
  |  |   23|   496k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   496k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5997:15): [True: 251k, False: 244k]
  |  Branch (5997:40): [True: 12.8k, False: 238k]
  ------------------
 5998|   483k|        {
 5999|   483k|            node = next;
 6000|   483k|            continue;
 6001|   483k|        }
 6002|       |
 6003|  2.70M|        next = TY_(TrimEmptyElement)(doc, node);
  ------------------
  |  |   23|  2.70M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.70M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6004|  2.70M|        node = next;
 6005|  2.70M|    }
 6006|       |
 6007|  2.43M|    return node;
 6008|  2.43M|}
prvTidyInsertNodeAtStart:
 6015|  22.2k|{
 6016|  22.2k|    node->parent = element;
 6017|       |
 6018|  22.2k|    if (element->content == NULL)
  ------------------
  |  Branch (6018:9): [True: 801, False: 21.4k]
  ------------------
 6019|    801|        element->last = node;
 6020|  21.4k|    else
 6021|  21.4k|        element->content->prev = node;
 6022|       |
 6023|  22.2k|    node->next = element->content;
 6024|       |    node->prev = NULL;
 6025|  22.2k|    element->content = node;
 6026|  22.2k|}
prvTidyInsertNodeAtEnd:
 6033|  3.13M|{
 6034|  3.13M|    node->parent = element;
 6035|  3.13M|    node->prev = element ? element->last : NULL;
  ------------------
  |  Branch (6035:18): [True: 3.13M, False: 324]
  ------------------
 6036|       |
 6037|  3.13M|    if (element && element->last != NULL)
  ------------------
  |  Branch (6037:9): [True: 3.13M, False: 324]
  |  Branch (6037:20): [True: 619k, False: 2.51M]
  ------------------
 6038|   619k|        element->last->next = node;
 6039|  2.51M|    else
 6040|  2.51M|        if (element)
  ------------------
  |  Branch (6040:13): [True: 2.51M, False: 324]
  ------------------
 6041|  2.51M|            element->content = node;
 6042|       |
 6043|  3.13M|    if (element)
  ------------------
  |  Branch (6043:9): [True: 3.13M, False: 324]
  ------------------
 6044|  3.13M|        element->last = node;
 6045|  3.13M|}
prvTidyInsertNodeBeforeElement:
 6052|   123k|{
 6053|   123k|    Node *parent;
 6054|       |
 6055|   123k|    parent = element ? element->parent : NULL;
  ------------------
  |  Branch (6055:14): [True: 122k, False: 832]
  ------------------
 6056|   123k|    node->parent = parent;
 6057|   123k|    node->next = element;
 6058|   123k|    node->prev = element ? element->prev : NULL;
  ------------------
  |  Branch (6058:18): [True: 122k, False: 832]
  ------------------
 6059|   123k|    if (element)
  ------------------
  |  Branch (6059:9): [True: 122k, False: 832]
  ------------------
 6060|   122k|        element->prev = node;
 6061|       |
 6062|   123k|    if (node->prev)
  ------------------
  |  Branch (6062:9): [True: 93.2k, False: 30.3k]
  ------------------
 6063|  93.2k|        node->prev->next = node;
 6064|       |
 6065|   123k|    if (parent && parent->content == element)
  ------------------
  |  Branch (6065:9): [True: 120k, False: 3.00k]
  |  Branch (6065:19): [True: 29.0k, False: 91.5k]
  ------------------
 6066|  29.0k|        parent->content = node;
 6067|   123k|}
prvTidyInsertNodeAfterElement:
 6074|  50.4k|{
 6075|  50.4k|    Node *parent;
 6076|       |
 6077|  50.4k|    parent = element->parent;
 6078|  50.4k|    node->parent = parent;
 6079|       |
 6080|       |    /* AQ - 13 Jan 2000 fix for parent == NULL */
 6081|  50.4k|    if (parent != NULL && parent->last == element)
  ------------------
  |  Branch (6081:9): [True: 48.1k, False: 2.22k]
  |  Branch (6081:27): [True: 37.1k, False: 11.0k]
  ------------------
 6082|  37.1k|        parent->last = node;
 6083|  13.3k|    else
 6084|  13.3k|    {
 6085|  13.3k|        node->next = element->next;
 6086|       |        /* AQ - 13 Jan 2000 fix for node->next == NULL */
 6087|  13.3k|        if (node->next != NULL)
  ------------------
  |  Branch (6087:13): [True: 11.2k, False: 2.01k]
  ------------------
 6088|  11.2k|            node->next->prev = node;
 6089|  13.3k|    }
 6090|       |
 6091|  50.4k|    element->next = node;
 6092|  50.4k|    node->prev = element;
 6093|  50.4k|}
prvTidyIsBlank:
 6101|    469|{
 6102|    469|    Bool isBlank = TY_(nodeIsText)(node);
  ------------------
  |  |   23|    469|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    469|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6103|    469|    if ( isBlank )
  ------------------
  |  Branch (6103:10): [True: 0, False: 469]
  ------------------
 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|    469|    return isBlank;
 6109|    469|}
prvTidyIsJavaScript:
 6117|  3.03k|{
 6118|  3.03k|    Bool result = no;
 6119|  3.03k|    AttVal *attr;
 6120|       |
 6121|  3.03k|    if (node->attributes == NULL)
  ------------------
  |  Branch (6121:9): [True: 1.17k, False: 1.85k]
  ------------------
 6122|  1.17k|        return yes;
 6123|       |
 6124|  4.96k|    for (attr = node->attributes; attr; attr = attr->next)
  ------------------
  |  Branch (6124:35): [True: 3.37k, False: 1.58k]
  ------------------
 6125|  3.37k|    {
 6126|  3.37k|        if ( (attrIsLANGUAGE(attr) || attrIsTYPE(attr))
  ------------------
  |  |  252|  3.37k|#define attrIsLANGUAGE(av)          AttrIsId( av, TidyAttr_LANGUAGE  )
  |  |  ------------------
  |  |  |  |  169|  6.75k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 3.37k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 2.24k, False: 1.13k]
  |  |  |  |  |  Branch (169:51): [True: 735, False: 1.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( (attrIsLANGUAGE(attr) || attrIsTYPE(attr))
  ------------------
  |  |  330|  2.64k|#define attrIsTYPE(av)              AttrIsId( av, TidyAttr_TYPE  )
  |  |  ------------------
  |  |  |  |  169|  2.64k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 2.64k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 1.50k, False: 1.13k]
  |  |  |  |  |  Branch (169:51): [True: 893, False: 613]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 6127|  1.62k|             && AttrContains(attr, "javascript") )
  ------------------
  |  |  174|  1.62k|#define AttrContains(attr, val) (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  3.25k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 1.62k, False: 0]
  |  |  |  |  |  Branch (171:44): [True: 1.36k, False: 267]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  175|  1.62k|                                 TY_(tmbsubstr)((attr)->value, val) != NULL)
  |  |  ------------------
  |  |  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (175:34): [True: 277, False: 1.08k]
  |  |  ------------------
  ------------------
 6128|    277|        {
 6129|    277|            result = yes;
 6130|    277|            break;
 6131|    277|        }
 6132|  3.37k|    }
 6133|       |
 6134|  1.85k|    return result;
 6135|  3.03k|}
prvTidyRemoveNode:
 6157|   440k|{
 6158|   440k|    if (node->prev)
  ------------------
  |  Branch (6158:9): [True: 73.2k, False: 367k]
  ------------------
 6159|  73.2k|        node->prev->next = node->next;
 6160|       |
 6161|   440k|    if (node->next)
  ------------------
  |  Branch (6161:9): [True: 149k, False: 291k]
  ------------------
 6162|   149k|        node->next->prev = node->prev;
 6163|       |
 6164|   440k|    if (node->parent)
  ------------------
  |  Branch (6164:9): [True: 436k, False: 4.03k]
  ------------------
 6165|   436k|    {
 6166|   436k|        if (node->parent->content == node)
  ------------------
  |  Branch (6166:13): [True: 363k, False: 73.2k]
  ------------------
 6167|   363k|            node->parent->content = node->next;
 6168|       |
 6169|   436k|        if (node->parent->last == node)
  ------------------
  |  Branch (6169:13): [True: 287k, False: 149k]
  ------------------
 6170|   287k|            node->parent->last = node->prev;
 6171|   436k|    }
 6172|       |
 6173|       |    node->parent = node->prev = node->next = NULL;
 6174|   440k|    return node;
 6175|   440k|}
prvTidyTrimEmptyElement:
 6182|  2.70M|{
 6183|  2.70M|    if ( CanPrune(doc, element) )
  ------------------
  |  Branch (6183:10): [True: 427k, False: 2.27M]
  ------------------
 6184|   427k|    {
 6185|   427k|        if (element->type != TextNode)
  ------------------
  |  Branch (6185:13): [True: 414k, False: 12.8k]
  ------------------
 6186|   414k|        {
 6187|   414k|            doc->footnotes |= FN_TRIM_EMPTY_ELEMENT;
  ------------------
  |  |  309|   414k|#define FN_TRIM_EMPTY_ELEMENT     1
  ------------------
 6188|   414k|            TY_(Report)(doc, element, NULL, TRIM_EMPTY_ELEMENT);
  ------------------
  |  |   23|   414k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   414k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6189|   414k|        }
 6190|       |
 6191|   427k|        return TY_(DiscardElement)(doc, element);
  ------------------
  |  |   23|   427k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   427k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6192|   427k|    }
 6193|  2.27M|    return element->next;
 6194|  2.70M|}
prvTidyParseDocument:
 6246|  20.6k|{
 6247|  20.6k|    Node *node, *html, *doctype = NULL;
 6248|       |
 6249|  29.3k|    while ((node = TY_(GetToken)(doc, IgnoreWhitespace)) != NULL)
  ------------------
  |  |   23|  29.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  29.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6249:12): [True: 25.9k, False: 3.38k]
  ------------------
 6250|  25.9k|    {
 6251|  25.9k|        if (node->type == XmlDecl)
  ------------------
  |  Branch (6251:13): [True: 869, False: 25.1k]
  ------------------
 6252|    869|        {
 6253|    869|            doc->xmlDetected = yes;
 6254|       |
 6255|    869|            if (TY_(FindXmlDecl)(doc) && doc->root.content)
  ------------------
  |  |   23|    869|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    869|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6255:17): [True: 735, False: 134]
  |  Branch (6255:42): [True: 735, False: 0]
  ------------------
 6256|    735|            {
 6257|    735|                TY_(Report)(doc, &doc->root, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    735|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    735|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6258|    735|                TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|    735|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    735|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6259|    735|                continue;
 6260|    735|            }
 6261|    134|            if (node->line > 1 || node->column != 1)
  ------------------
  |  Branch (6261:17): [True: 8, False: 126]
  |  Branch (6261:35): [True: 55, False: 71]
  ------------------
 6262|     63|            {
 6263|     63|                TY_(Report)(doc, &doc->root, node, SPACE_PRECEDING_XMLDECL);
  ------------------
  |  |   23|     63|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     63|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6264|     63|            }
 6265|    134|        }
 6266|       |
 6267|       |        /* deal with comments etc. */
 6268|  25.2k|        if (InsertMisc( &doc->root, node ))
  ------------------
  |  Branch (6268:13): [True: 4.08k, False: 21.1k]
  ------------------
 6269|  4.08k|            continue;
 6270|       |
 6271|  21.1k|        if (node->type == DocTypeTag)
  ------------------
  |  Branch (6271:13): [True: 3.64k, False: 17.5k]
  ------------------
 6272|  3.64k|        {
 6273|  3.64k|            if (doctype == NULL)
  ------------------
  |  Branch (6273:17): [True: 1.70k, False: 1.93k]
  ------------------
 6274|  1.70k|            {
 6275|  1.70k|                TY_(InsertNodeAtEnd)( &doc->root, node);
  ------------------
  |  |   23|  1.70k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.70k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6276|  1.70k|                doctype = node;
 6277|  1.70k|            }
 6278|  1.93k|            else
 6279|  1.93k|            {
 6280|  1.93k|                TY_(Report)(doc, &doc->root, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|  1.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6281|  1.93k|                TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|  1.93k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.93k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6282|  1.93k|            }
 6283|  3.64k|            continue;
 6284|  3.64k|        }
 6285|       |
 6286|  17.5k|        if (node->type == EndTag)
  ------------------
  |  Branch (6286:13): [True: 315, False: 17.2k]
  ------------------
 6287|    315|        {
 6288|    315|            TY_(Report)(doc, &doc->root, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    315|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    315|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6289|    315|            TY_(FreeNode)( doc, node);
  ------------------
  |  |   23|    315|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    315|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6290|    315|            continue;
 6291|    315|        }
 6292|       |
 6293|  17.2k|        if (node->type == StartTag && nodeIsHTML(node))
  ------------------
  |  |  370|  11.8k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  11.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.2k, False: 1.65k]
  |  |  |  |  |  Branch (275:54): [True: 52, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6293:13): [True: 11.8k, False: 5.32k]
  ------------------
 6294|     52|        {
 6295|     52|            AttVal *xmlns = TY_(AttrGetById)(node, TidyAttr_XMLNS);
  ------------------
  |  |   23|     52|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     52|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6296|       |
 6297|     52|            if (AttrValueIs(xmlns, XHTML_NAMESPACE))
  ------------------
  |  |  172|     52|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|    104|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 0, False: 52]
  |  |  |  |  |  Branch (171:44): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|     52|                                 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|     52|        }
 6312|       |
 6313|  17.2k|        if ( node->type != StartTag || !nodeIsHTML(node) )
  ------------------
  |  |  370|  11.8k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  11.8k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 11.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.2k, False: 1.65k]
  |  |  |  |  |  Branch (275:54): [True: 52, False: 10.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6313:14): [True: 5.32k, False: 11.8k]
  ------------------
 6314|  17.1k|        {
 6315|  17.1k|            TY_(UngetToken)( doc );
  ------------------
  |  |   23|  17.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6316|  17.1k|            html = TY_(InferredTag)(doc, TidyTag_HTML);
  ------------------
  |  |   23|  17.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6317|  17.1k|        }
 6318|     52|        else
 6319|     52|            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.2k|        if (!TY_(FindDocType)(doc))
  ------------------
  |  |   23|  17.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6326:13): [True: 16.7k, False: 479]
  ------------------
 6327|  16.7k|        {
 6328|  16.7k|            ulong dtmode = cfg( doc, TidyDoctypeMode );
  ------------------
  |  |  415|  16.7k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 6329|  16.7k|            if ((dtmode != TidyDoctypeOmit) && !showingBodyOnly(doc))
  ------------------
  |  |   28|  16.7k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  16.7k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  16.7k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6329:17): [True: 16.7k, False: 0]
  |  Branch (6329:17): [True: 16.7k, False: 0]
  |  Branch (6329:48): [True: 16.7k, False: 0]
  ------------------
 6330|  16.7k|                TY_(Report)(doc, NULL, NULL, MISSING_DOCTYPE);
  ------------------
  |  |   23|  16.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  16.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6331|  16.7k|            if ((dtmode != TidyDoctypeAuto) && (dtmode != TidyDoctypeHtml5))
  ------------------
  |  Branch (6331:17): [True: 0, False: 16.7k]
  |  Branch (6331:48): [True: 0, False: 0]
  ------------------
 6332|      0|            {
 6333|       |                /*\
 6334|       |                 *  Issue #342 - if not doctype 'auto', or 'html5'
 6335|       |                 *  then reset mode htm4-- parsing
 6336|       |                \*/
 6337|      0|                TY_(AdjustTags)(doc); /* Dynamically modify the tags table to html4-- mode */
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6338|      0|            }
 6339|  16.7k|        }
 6340|  17.2k|        TY_(InsertNodeAtEnd)( &doc->root, html);
  ------------------
  |  |   23|  17.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  17.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6341|  17.2k|        ParseHTMLWithNode( doc, html );
 6342|  17.2k|        break;
 6343|  17.5k|    }
 6344|       |
 6345|       |    /* do this before any more document fixes */
 6346|  20.6k|    if ( cfg( doc, TidyAccessibilityCheckLevel ) > 0 )
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (6346:10): [True: 0, False: 20.6k]
  ------------------
 6347|      0|        TY_(AccessibilityChecks)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6348|       |
 6349|  20.6k|    if (!TY_(FindHTML)(doc))
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6349:9): [True: 3.38k, False: 17.2k]
  ------------------
 6350|  3.38k|    {
 6351|       |        /* a later check should complain if <body> is empty */
 6352|  3.38k|        html = TY_(InferredTag)(doc, TidyTag_HTML);
  ------------------
  |  |   23|  3.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6353|  3.38k|        TY_(InsertNodeAtEnd)( &doc->root, html);
  ------------------
  |  |   23|  3.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6354|  3.38k|        ParseHTMLWithNode( doc, html );
 6355|  3.38k|    }
 6356|       |
 6357|  20.6k|    node = TY_(FindTITLE)(doc);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6358|  20.6k|    if (!node)
  ------------------
  |  Branch (6358:9): [True: 20.4k, False: 122]
  ------------------
 6359|  20.4k|    {
 6360|  20.4k|        Node* head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  20.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6361|       |        /* #72, avoid MISSING_TITLE_ELEMENT if show-body-only (but allow InsertNodeAtEnd to avoid new warning) */
 6362|  40.9k|        if (!showingBodyOnly(doc))
  ------------------
  |  |   28|  20.4k|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|  20.4k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  20.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6362:13): [True: 20.4k, False: 0]
  |  Branch (6362:13): [True: 20.4k, False: 0]
  ------------------
 6363|  20.4k|        {
 6364|  20.4k|            TY_(Report)(doc, head, NULL, MISSING_TITLE_ELEMENT);
  ------------------
  |  |   23|  20.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6365|  20.4k|        }
 6366|  20.4k|        TY_(InsertNodeAtEnd)(head, TY_(InferredTag)(doc, TidyTag_TITLE));
  ------------------
  |  |   23|  20.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      TY_(InsertNodeAtEnd)(head, TY_(InferredTag)(doc, TidyTag_TITLE));
  ------------------
  |  |   23|  20.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6367|  20.4k|    }
 6368|    122|    else if (!node->content && !showingBodyOnly(doc))
  ------------------
  |  |   28|     77|#define showingBodyOnly(doc) (cfgAutoBool(doc,TidyBodyOnly) == TidyYesState) ? yes : no
  |  |  ------------------
  |  |  |  |  421|     77|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|     77|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (6368:14): [True: 77, False: 45]
  |  Branch (6368:14): [True: 77, False: 45]
  |  Branch (6368:32): [True: 77, False: 0]
  ------------------
 6369|     77|    {
 6370|       |        /* Is #839 - warn node is blank in HTML5 */
 6371|     77|        if (TY_(IsHTML5Mode)(doc))
  ------------------
  |  |   23|     77|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     77|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (6371:13): [True: 73, False: 4]
  ------------------
 6372|     73|        {
 6373|     73|            TY_(Report)(doc, node, NULL, BLANK_TITLE_ELEMENT);
  ------------------
  |  |   23|     73|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|     73|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6374|     73|        }
 6375|     77|    }
 6376|       |
 6377|  20.6k|    AttributeChecks(doc, &doc->root);
 6378|  20.6k|    ReplaceObsoleteElements(doc, &doc->root);
 6379|  20.6k|    TY_(DropEmptyElements)(doc, &doc->root);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 6380|  20.6k|    CleanSpaces(doc, &doc->root);
 6381|       |
 6382|  20.6k|    if (cfgBool(doc, TidyEncloseBodyText))
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.6k]
  |  |  ------------------
  ------------------
 6383|      0|        EncloseBodyText(doc);
 6384|  20.6k|    if (cfgBool(doc, TidyEncloseBlockText))
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.6k]
  |  |  ------------------
  ------------------
 6385|      0|        EncloseBlockText(doc, &doc->root);
 6386|  20.6k|}
parser.c:growParserStack:
  870|  4.24k|{
  871|  4.24k|    TidyParserMemory *content;
  872|  4.24k|    content = (TidyParserMemory *) TidyAlloc( doc->allocator, sizeof(TidyParserMemory) * doc->stack.size * 2 );
  ------------------
  |  |   66|  4.24k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  873|       |
  874|  4.24k|    memcpy( content, doc->stack.content, sizeof(TidyParserMemory) * (doc->stack.top + 1) );
  875|  4.24k|    TidyFree(doc->allocator, doc->stack.content);
  ------------------
  |  |   68|  4.24k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  ------------------
  876|       |
  877|  4.24k|    doc->stack.content = content;
  878|  4.24k|    doc->stack.size = doc->stack.size * 2;
  879|  4.24k|}
parser.c:GetParserForNode:
 1017|  2.72M|{
 1018|  2.72M|    Lexer* lexer = doc->lexer;
 1019|       |
 1020|  2.72M|    if ( cfgBool( doc, TidyXmlTags ) )
  ------------------
  |  |  418|  2.72M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.72M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 2.72M]
  |  |  ------------------
  ------------------
 1021|      0|        return ParseXMLElement;
 1022|       |    
 1023|       |    /* [i_a]2 prevent crash for active content (php, asp) docs */
 1024|  2.72M|    if (!node || node->tag == NULL)
  ------------------
  |  Branch (1024:9): [True: 0, False: 2.72M]
  |  Branch (1024:18): [True: 6.17k, False: 2.72M]
  ------------------
 1025|  6.17k|        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.72M|    if (node->tag->model & CM_EMPTY)
  ------------------
  |  |  139|  2.72M|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (1031:9): [True: 29.5k, False: 2.69M]
  ------------------
 1032|  29.5k|    {
 1033|  29.5k|        lexer->waswhite = no;
 1034|  29.5k|        if (node->tag->parser == NULL)
  ------------------
  |  Branch (1034:13): [True: 0, False: 29.5k]
  ------------------
 1035|      0|            return NULL;
 1036|  29.5k|    }
 1037|  2.69M|    else if (!(node->tag->model & CM_INLINE))
  ------------------
  |  |  143|  2.69M|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1037:14): [True: 604k, False: 2.08M]
  ------------------
 1038|   604k|        lexer->insertspace = no;
 1039|       |
 1040|  2.72M|    if (node->tag->parser == NULL)
  ------------------
  |  Branch (1040:9): [True: 0, False: 2.72M]
  ------------------
 1041|      0|        return NULL;
 1042|       |
 1043|  2.72M|    if (node->type == StartEndTag)
  ------------------
  |  Branch (1043:9): [True: 9.88k, False: 2.71M]
  ------------------
 1044|  9.88k|        return NULL;
 1045|       |
 1046|       |    /* [i_a]2 added this - not sure why - CHECKME: */
 1047|  2.71M|    lexer->parent = node;
 1048|       |
 1049|  2.71M|    return (node->tag->parser);
 1050|  2.72M|}
parser.c:DescendantOf:
  339|   337k|{
  340|   337k|    Node *parent;
  341|   337k|    for ( parent = element->parent;
  342|   178M|         parent != NULL;
  ------------------
  |  Branch (342:10): [True: 177M, False: 298k]
  ------------------
  343|   177M|         parent = parent->parent )
  344|   177M|    {
  345|   177M|        if ( TagIsId(parent, tid) )
  ------------------
  |  |  275|   177M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  ------------------
  |  |  |  Branch (275:29): [True: 177M, False: 0]
  |  |  |  Branch (275:39): [True: 177M, False: 292k]
  |  |  |  Branch (275:54): [True: 38.9k, False: 177M]
  |  |  ------------------
  ------------------
  346|  38.9k|            return yes;
  347|   177M|    }
  348|   298k|    return no;
  349|   337k|}
parser.c:TrimSpaces:
  725|   968k|{
  726|   968k|    Node* text = element->content;
  727|       |
  728|   968k|    if (nodeIsPRE(element) || IsPreDescendant(element))
  ------------------
  |  |  383|   968k|#define nodeIsPRE( node )        TagIsId( node, TidyTag_PRE )
  |  |  ------------------
  |  |  |  |  275|  1.93M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 968k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 968k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 6.88k, False: 961k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (728:31): [True: 15.2k, False: 946k]
  ------------------
  729|  22.1k|        return;
  730|       |
  731|   946k|    if (TY_(nodeIsText)(text))
  ------------------
  |  |   23|   946k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   946k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (731:9): [True: 59.1k, False: 887k]
  ------------------
  732|  59.1k|        TrimInitialSpace(doc, element, text);
  733|       |
  734|   946k|    text = element->last;
  735|       |
  736|   946k|    if (TY_(nodeIsText)(text))
  ------------------
  |  |   23|   946k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   946k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (736:9): [True: 41.3k, False: 905k]
  ------------------
  737|  41.3k|        TrimTrailingSpace(doc, element, text);
  738|   946k|}
parser.c:IsPreDescendant:
  356|  1.43M|{
  357|  1.43M|    Node *parent = node->parent;
  358|       |
  359|  2.91G|    while (parent)
  ------------------
  |  Branch (359:12): [True: 2.90G, False: 1.39M]
  ------------------
  360|  2.90G|    {
  361|  2.90G|        if (parent->tag && parent->tag->parser == TY_(ParsePre))
  ------------------
  |  |   23|  2.90G|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.90G|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (361:13): [True: 2.90G, False: 3.78M]
  |  Branch (361:28): [True: 42.8k, False: 2.90G]
  ------------------
  362|  42.8k|            return yes;
  363|       |
  364|  2.90G|        parent = parent->parent;
  365|  2.90G|    }
  366|       |
  367|  1.39M|    return no;
  368|  1.43M|}
parser.c:TrimTrailingSpace:
  691|  41.3k|{
  692|  41.3k|    Lexer* lexer = doc->lexer;
  693|  41.3k|    byte c;
  694|       |
  695|  41.3k|    if (TY_(nodeIsText)(last))
  ------------------
  |  |   23|  41.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (695:9): [True: 41.3k, False: 0]
  ------------------
  696|  41.3k|    {
  697|  41.3k|        if (last->end > last->start)
  ------------------
  |  Branch (697:13): [True: 39.1k, False: 2.20k]
  ------------------
  698|  39.1k|        {
  699|  39.1k|            c = (byte) lexer->lexbuf[ last->end - 1 ];
  700|       |
  701|  39.1k|            if ( c == ' ' )
  ------------------
  |  Branch (701:18): [True: 4.35k, False: 34.8k]
  ------------------
  702|  4.35k|            {
  703|  4.35k|                last->end -= 1;
  704|  4.35k|                if ( (element->tag->model & CM_INLINE) &&
  ------------------
  |  |  143|  4.35k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (704:22): [True: 3.54k, False: 808]
  ------------------
  705|  3.54k|                     !(element->tag->model & CM_FIELD) )
  ------------------
  |  |  149|  3.54k|#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: 3.12k, False: 421]
  ------------------
  706|  3.12k|                    lexer->insertspace = yes;
  707|  4.35k|            }
  708|  39.1k|        }
  709|  41.3k|    }
  710|  41.3k|}
parser.c:InsertMisc:
   90|  4.04M|{
   91|  4.04M|    if (node->type == CommentTag ||
  ------------------
  |  Branch (91:9): [True: 87.3k, False: 3.95M]
  ------------------
   92|  3.95M|        node->type == ProcInsTag ||
  ------------------
  |  Branch (92:9): [True: 89.7k, False: 3.86M]
  ------------------
   93|  3.86M|        node->type == CDATATag ||
  ------------------
  |  Branch (93:9): [True: 1.81k, False: 3.86M]
  ------------------
   94|  3.86M|        node->type == SectionTag ||
  ------------------
  |  Branch (94:9): [True: 16.8k, False: 3.84M]
  ------------------
   95|  3.84M|        node->type == AspTag ||
  ------------------
  |  Branch (95:9): [True: 2.39k, False: 3.84M]
  ------------------
   96|  3.84M|        node->type == JsteTag ||
  ------------------
  |  Branch (96:9): [True: 3.94k, False: 3.83M]
  ------------------
   97|  3.83M|        node->type == PhpTag )
  ------------------
  |  Branch (97:9): [True: 367, False: 3.83M]
  ------------------
   98|   202k|    {
   99|   202k|        TY_(InsertNodeAtEnd)(element, node);
  ------------------
  |  |   23|   202k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   202k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  100|   202k|        return yes;
  101|   202k|    }
  102|       |
  103|  3.83M|    if ( node->type == XmlDecl )
  ------------------
  |  Branch (103:10): [True: 17.0k, False: 3.82M]
  ------------------
  104|  17.0k|    {
  105|  17.0k|        Node* root = element;
  106|  3.96M|        while ( root && root->parent )
  ------------------
  |  Branch (106:17): [True: 3.96M, False: 0]
  |  Branch (106:25): [True: 3.94M, False: 17.0k]
  ------------------
  107|  3.94M|            root = root->parent;
  108|  17.0k|        if ( root && !(root->content && root->content->type == XmlDecl))
  ------------------
  |  Branch (108:14): [True: 17.0k, False: 0]
  |  Branch (108:24): [True: 16.7k, False: 319]
  |  Branch (108:41): [True: 16.4k, False: 299]
  ------------------
  109|    618|        {
  110|    618|          TY_(InsertNodeAtStart)( root, node );
  ------------------
  |  |   23|    618|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    618|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  111|    618|          return yes;
  112|    618|        }
  113|  17.0k|    }
  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.83M|    if ( node->tag &&
  ------------------
  |  Branch (119:10): [True: 3.47M, False: 360k]
  ------------------
  120|  3.47M|         TY_(nodeIsElement)(node) &&
  ------------------
  |  |   23|  3.47M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.47M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (120:10): [True: 3.38M, False: 90.6k]
  ------------------
  121|  3.38M|         TY_(nodeCMIsEmpty)(node) && TagId(node) == TidyTag_UNKNOWN &&
  ------------------
  |  |   23|  3.38M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.38M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                       TY_(nodeCMIsEmpty)(node) && TagId(node) == TidyTag_UNKNOWN &&
  ------------------
  |  |  270|   104k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 104k, False: 0]
  |  |  |  Branch (270:39): [True: 104k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (121:10): [True: 104k, False: 3.28M]
  |  Branch (121:38): [True: 0, False: 104k]
  ------------------
  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.83M|    return no;
  129|  3.83M|}
parser.c:BadForm:
  521|  3.27k|{
  522|  3.27k|    doc->badForm |= flg_BadForm;
  ------------------
  |  |   34|  3.27k|#define flg_BadForm     0x00000001
  ------------------
  523|  3.27k|}
parser.c:MoveToHead:
  206|  3.97k|{
  207|  3.97k|    Node *head = NULL;
  208|       |
  209|  3.97k|    TY_(RemoveNode)( node );  /* make sure that node is isolated */
  ------------------
  |  |   23|  3.97k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.97k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  210|       |
  211|  3.97k|    if ( TY_(nodeIsElement)(node) )
  ------------------
  |  |   23|  3.97k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.97k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (211:10): [True: 3.74k, False: 223]
  ------------------
  212|  3.74k|    {
  213|  3.74k|        TY_(Report)(doc, element, node, TAG_NOT_ALLOWED_IN );
  ------------------
  |  |   23|  3.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  214|       |
  215|  3.74k|        head = TY_(FindHEAD)(doc);
  ------------------
  |  |   23|  3.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  216|  3.74k|        assert(head != NULL);
  ------------------
  |  Branch (216:9): [True: 0, False: 3.74k]
  |  Branch (216:9): [True: 3.74k, False: 0]
  ------------------
  217|       |
  218|  3.74k|        TY_(InsertNodeAtEnd)(head, node);
  ------------------
  |  |   23|  3.74k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.74k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  219|       |
  220|  3.74k|        if ( node->tag->parser )
  ------------------
  |  Branch (220:14): [True: 3.74k, False: 0]
  ------------------
  221|  3.74k|        {
  222|       |            /* Only one of the existing test cases as of 2021-08-14 invoke
  223|       |               MoveToHead, and it doesn't go deeper than one level. The
  224|       |               parser() call is supposed to return a node if additional
  225|       |               parsing is needed. Keep this in mind if we start to get bug
  226|       |               reports.
  227|       |             */
  228|  3.74k|            Parser* parser = node->tag->parser;
  229|  3.74k|            parser( doc, node, IgnoreWhitespace );
  230|  3.74k|        }
  231|  3.74k|    }
  232|    223|    else
  233|    223|    {
  234|    223|        TY_(Report)(doc, element, node, DISCARDING_UNEXPECTED);
  ------------------
  |  |   23|    223|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    223|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  235|    223|        TY_(FreeNode)( doc, node );
  ------------------
  |  |   23|    223|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    223|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  236|    223|    }
  237|  3.97k|}
parser.c:AddClassNoIndent:
  536|  2.23k|{
  537|  2.23k|    ctmbstr sprop =
  538|  2.23k|    "padding-left: 2ex; margin-left: 0ex"
  539|  2.23k|    "; margin-top: 0ex; margin-bottom: 0ex";
  540|  2.23k|    if ( !cfgBool(doc, TidyDecorateInferredUL) )
  ------------------
  |  |  418|  2.23k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.23k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (540:10): [True: 2.23k, False: 0]
  ------------------
  541|  2.23k|        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.64k|{
  615|  4.64k|    Node* existing = TY_(FindDocType)( doc );
  ------------------
  |  |   23|  4.64k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.64k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  616|  4.64k|    if ( existing )
  ------------------
  |  Branch (616:10): [True: 2.61k, False: 2.02k]
  ------------------
  617|  2.61k|    {
  618|  2.61k|        TY_(Report)(doc, element, doctype, DISCARDING_UNEXPECTED );
  ------------------
  |  |   23|  2.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  619|  2.61k|        TY_(FreeNode)( doc, doctype );
  ------------------
  |  |   23|  2.61k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.61k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  620|  2.61k|    }
  621|  2.02k|    else
  622|  2.02k|    {
  623|  2.02k|        TY_(Report)(doc, element, doctype, DOCTYPE_AFTER_TAGS );
  ------------------
  |  |   23|  2.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  624|  4.28k|        while ( !nodeIsHTML(element) )
  ------------------
  |  |  370|  4.28k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|  4.28k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.28k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 4.28k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.02k, False: 2.25k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  625|  2.25k|            element = element->parent;
  626|  2.02k|        TY_(InsertNodeBeforeElement)( element, doctype );
  ------------------
  |  |   23|  2.02k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.02k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  627|  2.02k|    }
  628|  4.64k|}
parser.c:findNodeById:
   79|    453|{
   80|    453|    Node *node = (doc ? doc->root.content : NULL);
  ------------------
  |  Branch (80:19): [True: 453, False: 0]
  ------------------
   81|    453|    return findNodeWithId( node,tid );
   82|    453|}
parser.c:findNodeWithId:
   49|  2.46k|{
   50|  2.46k|    Node *content;
   51|  4.99k|    while (node)
  ------------------
  |  Branch (51:12): [True: 3.79k, False: 1.20k]
  ------------------
   52|  3.79k|    {
   53|  3.79k|        if (TagIsId(node,tid))
  ------------------
  |  |  275|  3.79k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  ------------------
  |  |  |  Branch (275:29): [True: 3.79k, False: 0]
  |  |  |  Branch (275:39): [True: 3.25k, False: 533]
  |  |  |  Branch (275:54): [True: 386, False: 2.87k]
  |  |  ------------------
  ------------------
   54|    386|            return yes;
   55|       |        /*\
   56|       |         *   Issue #459 - Under certain circumstances, with many node this use of
   57|       |         *   'for (content = node->content; content; content = content->content)'
   58|       |         *   would produce a **forever** circle, or at least a very extended loop...
   59|       |         *   It is sufficient to test the content, if it exists,
   60|       |         *   to quickly iterate all nodes. Now all nodes are tested only once.
   61|       |        \*/
   62|  3.40k|        content = node->content;
   63|  3.40k|        if (content)
  ------------------
  |  Branch (63:13): [True: 2.01k, False: 1.39k]
  ------------------
   64|  2.01k|        {
   65|  2.01k|            if ( findNodeWithId(content,tid) )
  ------------------
  |  Branch (65:18): [True: 879, False: 1.13k]
  ------------------
   66|    879|                return yes;
   67|  2.01k|        }
   68|  2.52k|        node = node->next;
   69|  2.52k|    }
   70|  1.20k|    return no;
   71|  2.46k|}
parser.c:InsertNodeAsParent:
  137|  1.39k|{
  138|  1.39k|    node->content = element;
  139|  1.39k|    node->last = element;
  140|  1.39k|    node->parent = element->parent;
  141|  1.39k|    element->parent = node;
  142|       |
  143|  1.39k|    if (node->parent->content == element)
  ------------------
  |  Branch (143:9): [True: 1.11k, False: 273]
  ------------------
  144|  1.11k|        node->parent->content = node;
  145|       |
  146|  1.39k|    if (node->parent->last == element)
  ------------------
  |  Branch (146:9): [True: 1.32k, False: 68]
  ------------------
  147|  1.32k|        node->parent->last = node;
  148|       |
  149|  1.39k|    node->prev = element->prev;
  150|  1.39k|    element->prev = NULL;
  151|       |
  152|  1.39k|    if (node->prev)
  ------------------
  |  Branch (152:9): [True: 273, False: 1.11k]
  ------------------
  153|    273|        node->prev->next = node;
  154|       |
  155|  1.39k|    node->next = element->next;
  156|  1.39k|    element->next = NULL;
  157|       |
  158|  1.39k|    if (node->next)
  ------------------
  |  Branch (158:9): [True: 68, False: 1.32k]
  ------------------
  159|     68|        node->next->prev = node;
  160|  1.39k|}
parser.c:FindLastLI:
  823|  83.3k|{
  824|  83.3k|    Node *node;
  825|       |
  826|  83.3k|    *lastli = NULL;
  827|  87.6k|    for ( node = list->content; node ; node = node->next )
  ------------------
  |  Branch (827:33): [True: 4.30k, False: 83.3k]
  ------------------
  828|  4.30k|        if ( nodeIsLI(node) && node->type == StartTag )
  ------------------
  |  |  390|  4.30k|#define nodeIsLI( node )         TagIsId( node, TidyTag_LI )
  |  |  ------------------
  |  |  |  |  275|  8.61k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 4.30k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.88k, False: 2.42k]
  |  |  |  |  |  Branch (275:54): [True: 1.21k, False: 668]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (828:32): [True: 1.00k, False: 207]
  ------------------
  829|  1.00k|            *lastli=node;
  830|  83.3k|    return *lastli ? yes:no;
  ------------------
  |  Branch (830:12): [True: 996, False: 82.3k]
  ------------------
  831|  83.3k|}
parser.c:FindMatchingDescendant:
  801|  5.15k|{
  802|  5.15k|    struct MatchingDescendantData cb_data = { 0 };
  803|  5.15k|    cb_data.matching_tagId = TagId(node);
  ------------------
  |  |  270|  5.15k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 5.15k, False: 0]
  |  |  |  Branch (270:39): [True: 3.23k, False: 1.92k]
  |  |  ------------------
  ------------------
  804|  5.15k|    cb_data.node_to_find = node;
  805|  5.15k|    cb_data.marker_node = marker_node;
  806|       |
  807|  5.15k|    assert(node);
  ------------------
  |  Branch (807:5): [True: 0, False: 5.15k]
  |  Branch (807:5): [True: 5.15k, False: 0]
  ------------------
  808|       |
  809|  5.15k|    if (is_parent_of_marker)
  ------------------
  |  Branch (809:9): [True: 5.15k, False: 0]
  ------------------
  810|  5.15k|        *is_parent_of_marker = no;
  811|       |
  812|  5.15k|    TY_(TraverseNodeTree)(NULL, parent, FindDescendant_cb, &cb_data);
  ------------------
  |  |   23|  5.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  813|  5.15k|    return cb_data.found_node;
  814|  5.15k|}
parser.c:FindDescendant_cb:
  765|  35.5k|{
  766|  35.5k|    struct MatchingDescendantData *cb_data = (struct MatchingDescendantData *)propagate;
  767|       |
  768|  35.5k|    if (TagId(node) == cb_data->matching_tagId)
  ------------------
  |  |  270|  35.5k|#define TagId(node)        ((node) && (node)->tag ? (node)->tag->id : TidyTag_UNKNOWN)
  |  |  ------------------
  |  |  |  Branch (270:29): [True: 35.5k, False: 0]
  |  |  |  Branch (270:39): [True: 28.6k, False: 6.88k]
  |  |  ------------------
  ------------------
  |  Branch (768:9): [True: 7.18k, False: 28.3k]
  ------------------
  769|  7.18k|    {
  770|       |        /* make sure we match up 'unknown' tags exactly! */
  771|  7.18k|        if (cb_data->matching_tagId != TidyTag_UNKNOWN ||
  ------------------
  |  Branch (771:13): [True: 2.67k, False: 4.50k]
  ------------------
  772|  4.50k|            (node->element != NULL &&
  ------------------
  |  Branch (772:14): [True: 3.15k, False: 1.35k]
  ------------------
  773|  3.15k|            cb_data->node_to_find != NULL &&
  ------------------
  |  Branch (773:13): [True: 3.15k, False: 0]
  ------------------
  774|  3.15k|            cb_data->node_to_find->element != NULL &&
  ------------------
  |  Branch (774:13): [True: 3.15k, False: 0]
  ------------------
  775|  3.15k|            0 == TY_(tmbstrcmp)(cb_data->node_to_find->element, node->element)))
  ------------------
  |  |   23|  3.15k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.15k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (775:13): [True: 555, False: 2.60k]
  ------------------
  776|  3.22k|        {
  777|  3.22k|            cb_data->found_node = node;
  778|  3.22k|            return ExitTraversal;
  779|  3.22k|        }
  780|  7.18k|    }
  781|       |
  782|  32.2k|    if (cb_data->passed_marker_node && node == cb_data->marker_node)
  ------------------
  |  Branch (782:9): [True: 0, False: 32.2k]
  |  Branch (782:40): [True: 0, False: 0]
  ------------------
  783|      0|        *cb_data->passed_marker_node = yes;
  784|       |
  785|  32.2k|    return VisitParent;
  786|  35.5k|}
parser.c:MoveNodeToBody:
  191|  1.24k|{
  192|  1.24k|    Node* body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  1.24k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.24k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  193|  1.24k|    if ( body )
  ------------------
  |  Branch (193:10): [True: 1.04k, False: 199]
  ------------------
  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.24k|}
parser.c:PreContent:
  386|  48.0k|{
  387|       |    /* p is coerced to br's, Text OK too */
  388|  48.0k|    if ( nodeIsP(node) || TY_(nodeIsText)(node) )
  ------------------
  |  |  385|  48.0k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  96.1k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 48.0k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 48.0k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.28k, False: 42.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( nodeIsP(node) || TY_(nodeIsText)(node) )
  ------------------
  |  |   23|  42.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (388:27): [True: 0, False: 42.7k]
  ------------------
  389|  5.28k|        return yes;
  390|       |
  391|  42.7k|    if ( node->tag == NULL ||
  ------------------
  |  Branch (391:10): [True: 0, False: 42.7k]
  ------------------
  392|  42.7k|         nodeIsPARAM(node) ||
  ------------------
  |  |  409|  42.7k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|  85.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 42.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 42.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 242, False: 42.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  393|  42.5k|         !TY_(nodeHasCM)(node, CM_INLINE|CM_NEW) )
  ------------------
  |  |   23|  42.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  42.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                       !TY_(nodeHasCM)(node, CM_INLINE|CM_NEW) )
  ------------------
  |  |  143|  42.5k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                       !TY_(nodeHasCM)(node, CM_INLINE|CM_NEW) )
  ------------------
  |  |  159|  42.5k|#define CM_NEW          (1 << 20)  /**< User defined elements. Used to determine how attributes without value should be printed. */
  ------------------
  |  Branch (393:10): [True: 38.9k, False: 3.60k]
  ------------------
  394|  39.1k|        return no;
  395|       |
  396|  3.60k|    return yes;
  397|  42.7k|}
parser.c:FixEmptyRow:
  597|  3.01k|{
  598|  3.01k|    Node *cell;
  599|       |
  600|  3.01k|    if (row->content == NULL)
  ------------------
  |  Branch (600:9): [True: 2.54k, False: 468]
  ------------------
  601|  2.54k|    {
  602|  2.54k|        cell = TY_(InferredTag)(doc, TidyTag_TD);
  ------------------
  |  |   23|  2.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  603|  2.54k|        TY_(InsertNodeAtEnd)(row, cell);
  ------------------
  |  |   23|  2.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  604|  2.54k|        TY_(Report)(doc, row, cell, MISSING_STARTTAG);
  ------------------
  |  |   23|  2.54k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.54k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  605|  2.54k|    }
  606|  3.01k|}
parser.c:MoveBeforeTable:
  170|  89.6k|{
  171|  89.6k|    Node *table;
  172|       |
  173|       |    /* first find the table element */
  174|  1.24M|    for (table = row->parent; table; table = table->parent)
  ------------------
  |  Branch (174:31): [True: 1.16M, False: 85.3k]
  ------------------
  175|  1.16M|    {
  176|  1.16M|        if ( nodeIsTABLE(table) )
  ------------------
  |  |  393|  1.16M|#define nodeIsTABLE( node )      TagIsId( node, TidyTag_TABLE )
  |  |  ------------------
  |  |  |  |  275|  1.16M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.16M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.07M, False: 84.4k]
  |  |  |  |  |  Branch (275:54): [True: 4.33k, False: 1.07M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  177|  4.33k|        {
  178|  4.33k|            TY_(InsertNodeBeforeElement)( table, node );
  ------------------
  |  |   23|  4.33k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  4.33k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  179|  4.33k|            return;
  180|  4.33k|        }
  181|  1.16M|    }
  182|       |    /* No table element */
  183|  85.3k|    TY_(InsertNodeBeforeElement)( row->parent, node );
  ------------------
  |  |   23|  85.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  85.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  184|  85.3k|}
parser.c:TrimInitialSpace:
  642|  60.1k|{
  643|  60.1k|    Lexer* lexer = doc->lexer;
  644|  60.1k|    Node *prev, *node;
  645|       |
  646|  60.1k|    if ( TY_(nodeIsText)(text) &&
  ------------------
  |  |   23|  60.1k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  60.1k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (646:10): [True: 60.1k, False: 0]
  ------------------
  647|  60.1k|         lexer->lexbuf[text->start] == ' ' &&
  ------------------
  |  Branch (647:10): [True: 11.9k, False: 48.2k]
  ------------------
  648|  11.9k|         text->start < text->end )
  ------------------
  |  Branch (648:10): [True: 11.0k, False: 851]
  ------------------
  649|  11.0k|    {
  650|  11.0k|        if ( (element->tag->model & CM_INLINE) &&
  ------------------
  |  |  143|  11.0k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (650:14): [True: 8.79k, False: 2.26k]
  ------------------
  651|  8.79k|             !(element->tag->model & CM_FIELD) )
  ------------------
  |  |  149|  8.79k|#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: 8.34k, False: 454]
  ------------------
  652|  8.34k|        {
  653|  8.34k|            prev = element->prev;
  654|       |
  655|  8.34k|            if (TY_(nodeIsText)(prev))
  ------------------
  |  |   23|  8.34k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.34k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (655:17): [True: 647, False: 7.69k]
  ------------------
  656|    647|            {
  657|    647|                if (prev->end == 0 || lexer->lexbuf[prev->end - 1] != ' ')
  ------------------
  |  Branch (657:21): [True: 0, False: 647]
  |  Branch (657:39): [True: 338, False: 309]
  ------------------
  658|    338|                    lexer->lexbuf[(prev->end)++] = ' ';
  659|       |
  660|    647|                ++(element->start);
  661|    647|            }
  662|  7.69k|            else /* create new node */
  663|  7.69k|            {
  664|  7.69k|                node = TY_(NewNode)(lexer->allocator, lexer);
  ------------------
  |  |   23|  7.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  665|  7.69k|                node->start = (element->start)++;
  666|  7.69k|                node->end = element->start;
  667|  7.69k|                lexer->lexbuf[node->start] = ' ';
  668|  7.69k|                TY_(InsertNodeBeforeElement)(element ,node);
  ------------------
  |  |   23|  7.69k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.69k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  669|  7.69k|                DEBUG_LOG(SPRTF("TrimInitialSpace: Created text node, inserted before <%s>\n",
  670|  7.69k|                    (element->element ? element->element : "unknown")));
  671|  7.69k|            }
  672|  8.34k|        }
  673|       |
  674|       |        /* discard the space in current node */
  675|  11.0k|        ++(text->start);
  676|  11.0k|    }
  677|  60.1k|}
parser.c:CanPrune:
  250|  2.70M|{
  251|  2.70M|    if ( !cfgBool(doc, TidyDropEmptyElems) )
  ------------------
  |  |  418|  2.70M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.70M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (251:10): [True: 0, False: 2.70M]
  ------------------
  252|      0|        return no;
  253|       |
  254|  2.70M|    if ( TY_(nodeIsText)(element) )
  ------------------
  |  |   23|  2.70M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.70M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (254:10): [True: 12.8k, False: 2.69M]
  ------------------
  255|  12.8k|        return yes;
  256|       |
  257|  2.69M|    if ( element->content )
  ------------------
  |  Branch (257:10): [True: 2.11M, False: 575k]
  ------------------
  258|  2.11M|        return no;
  259|       |
  260|   575k|    if ( element->tag == NULL )
  ------------------
  |  Branch (260:10): [True: 957, False: 574k]
  ------------------
  261|    957|        return no;
  262|       |
  263|   574k|    if ( element->tag->model & CM_BLOCK && element->attributes != NULL )
  ------------------
  |  |  142|  1.14M|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (263:10): [True: 118k, False: 456k]
  |  Branch (263:44): [True: 14.2k, False: 104k]
  ------------------
  264|  14.2k|        return no;
  265|       |
  266|   560k|    if ( nodeIsA(element) && element->attributes != NULL )
  ------------------
  |  |  401|   560k|#define nodeIsA( node )          TagIsId( node, TidyTag_A )
  |  |  ------------------
  |  |  |  |  275|  1.12M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 560k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 560k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 3.64k, False: 556k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (266:30): [True: 1.12k, False: 2.51k]
  ------------------
  267|  1.12k|        return no;
  268|       |
  269|   559k|    if ( nodeIsP(element) && !cfgBool(doc, TidyDropEmptyParas) )
  ------------------
  |  |  385|   559k|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|  1.11M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 559k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 559k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 34.3k, False: 525k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( nodeIsP(element) && !cfgBool(doc, TidyDropEmptyParas) )
  ------------------
  |  |  418|  34.3k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  34.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (269:30): [True: 0, False: 34.3k]
  ------------------
  270|      0|        return no;
  271|       |
  272|   559k|    if ( element->tag->model & CM_ROW )
  ------------------
  |  |  148|   559k|#define CM_ROW          (1 << 9)   /**< Used for "TD", "TH" */
  ------------------
  |  Branch (272:10): [True: 5.44k, False: 553k]
  ------------------
  273|  5.44k|        return no;
  274|       |
  275|   553k|    if ( element->tag->model & CM_EMPTY )
  ------------------
  |  |  139|   553k|#define CM_EMPTY        (1 << 0)   /**< Elements with no content. Map to HTML specification. */
  ------------------
  |  Branch (275:10): [True: 43.6k, False: 510k]
  ------------------
  276|  43.6k|        return no;
  277|       |
  278|   510k|    if ( nodeIsAPPLET(element) )
  ------------------
  |  |  427|   510k|#define nodeIsAPPLET( node )     TagIsId( node, TidyTag_APPLET )
  |  |  ------------------
  |  |  |  |  275|   510k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 510k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 510k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 325, False: 510k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  279|    325|        return no;
  280|       |
  281|   510k|    if ( nodeIsOBJECT(element) )
  ------------------
  |  |  428|   510k|#define nodeIsOBJECT( node )     TagIsId( node, TidyTag_OBJECT )
  |  |  ------------------
  |  |  |  |  275|   510k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 510k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 510k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 838, False: 509k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  282|    838|        return no;
  283|       |
  284|   509k|    if ( nodeIsSCRIPT(element) && attrGetSRC(element) )
  ------------------
  |  |  422|   509k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  1.01M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 509k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 509k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 359, False: 508k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( nodeIsSCRIPT(element) && attrGetSRC(element) )
  ------------------
  |  |  396|    359|#define attrGetSRC( nod )         TY_(AttrGetById)( nod, TidyAttr_SRC  )
  |  |  ------------------
  |  |  |  |   23|    359|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|    359|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (396:35): [True: 0, False: 359]
  |  |  ------------------
  ------------------
  285|      0|        return no;
  286|       |
  287|   509k|    if ( nodeIsTITLE(element) )
  ------------------
  |  |  372|   509k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|   509k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 509k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 509k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 24.6k, False: 484k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  288|  24.6k|        return no;
  289|       |
  290|       |    /* #433359 - fix by Randy Waki 12 Mar 01 */
  291|   484k|    if ( nodeIsIFRAME(element) )
  ------------------
  |  |  378|   484k|#define nodeIsIFRAME( node )     TagIsId( node, TidyTag_IFRAME )
  |  |  ------------------
  |  |  |  |  275|   484k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 484k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 484k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 554, False: 483k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  292|    554|        return no;
  293|       |
  294|       |    /* fix for bug 770297 */
  295|   483k|    if (nodeIsTEXTAREA(element))
  ------------------
  |  |  425|   483k|#define nodeIsTEXTAREA( node )   TagIsId( node, TidyTag_TEXTAREA )
  |  |  ------------------
  |  |  |  |  275|   483k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 483k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 483k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.09k, False: 482k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  296|  1.09k|        return no;
  297|       |
  298|       |    /* fix for ISSUE #7 https://github.com/w3c/tidy-html5/issues/7 */
  299|   482k|    if (nodeIsCANVAS(element))
  ------------------
  |  |  454|   482k|#define nodeIsCANVAS( node )     TagIsId( node, TidyTag_CANVAS )
  |  |  ------------------
  |  |  |  |  275|   482k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 482k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 482k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 208, False: 482k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  300|    208|        return no;
  301|       |    
  302|   482k|    if (nodeIsPROGRESS(element))
  ------------------
  |  |  455|   482k|#define nodeIsPROGRESS( node )   TagIsId( node, TidyTag_PROGRESS )
  |  |  ------------------
  |  |  |  |  275|   482k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 482k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 482k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 250, False: 482k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  303|    250|        return no;
  304|       |
  305|   482k|    if ( attrGetID(element) || attrGetNAME(element) )
  ------------------
  |  |  397|   964k|#define attrGetID( nod )          TY_(AttrGetById)( nod, TidyAttr_ID  )
  |  |  ------------------
  |  |  |  |   23|   482k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   482k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (397:35): [True: 53.0k, False: 429k]
  |  |  ------------------
  ------------------
                  if ( attrGetID(element) || attrGetNAME(element) )
  ------------------
  |  |  398|   429k|#define attrGetNAME( nod )        TY_(AttrGetById)( nod, TidyAttr_NAME  )
  |  |  ------------------
  |  |  |  |   23|   429k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   429k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (398:35): [True: 467, False: 428k]
  |  |  ------------------
  ------------------
  306|  53.5k|        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|   428k|    if (attrGetDATAFLD(element))
  ------------------
  |  |  410|   428k|#define attrGetDATAFLD( nod )     TY_(AttrGetById)( nod, TidyAttr_DATAFLD  )
  |  |  ------------------
  |  |  |  |   23|   428k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|   428k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (410:35): [True: 0, False: 428k]
  |  |  ------------------
  ------------------
  311|      0|        return no;
  312|       |
  313|       |    /* fix for bug 723772, don't trim new-...-tags */
  314|   428k|    if (element->tag->id == TidyTag_UNKNOWN)
  ------------------
  |  Branch (314:9): [True: 0, False: 428k]
  ------------------
  315|      0|        return no;
  316|       |
  317|   428k|    if (nodeIsBODY(element))
  ------------------
  |  |  375|   428k|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|   428k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 428k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 428k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 11.6k, False: 417k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  318|  11.6k|        return no;
  319|       |
  320|   417k|    if (nodeIsCOLGROUP(element))
  ------------------
  |  |  399|   417k|#define nodeIsCOLGROUP( node )   TagIsId( node, TidyTag_COLGROUP )
  |  |  ------------------
  |  |  |  |  275|   417k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 417k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 417k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.42k, False: 415k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  321|  1.42k|        return no;
  322|       |
  323|       |    /* HTML5 - do NOT drop empty option if it has attributes */
  324|   415k|    if ( nodeIsOPTION(element) && element->attributes != NULL )
  ------------------
  |  |  410|   415k|#define nodeIsOPTION( node )     TagIsId( node, TidyTag_OPTION )
  |  |  ------------------
  |  |  |  |  275|   831k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 415k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 415k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 2.14k, False: 413k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (324:35): [True: 339, False: 1.80k]
  ------------------
  325|    339|        return no;
  326|       |
  327|       |    /* fix for #103 - don't drop empty dd tags lest document not validate */
  328|   415k|    if (nodeIsDD(element))
  ------------------
  |  |  392|   415k|#define nodeIsDD( node )         TagIsId( node, TidyTag_DD )
  |  |  ------------------
  |  |  |  |  275|   415k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 415k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 415k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.23k, False: 414k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  329|  1.23k|        return no;
  330|       |
  331|   414k|    return yes;
  332|   415k|}
parser.c:AttributeChecks:
 5753|  2.43M|{
 5754|  2.43M|    Node *next;
 5755|       |
 5756|  5.62M|    while (node)
  ------------------
  |  Branch (5756:12): [True: 3.18M, False: 2.43M]
  ------------------
 5757|  3.18M|    {
 5758|  3.18M|        next = node->next;
 5759|       |
 5760|  3.18M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  3.18M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.18M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (5760:13): [True: 2.69M, False: 496k]
  ------------------
 5761|  2.69M|        {
 5762|  2.69M|            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.68M, False: 5.35k]
  |  Branch (5762:30): [True: 88.5k, False: 2.59M]
  ------------------
 5763|  88.5k|                node->tag->chkattrs(doc, node);
 5764|  2.60M|            else
 5765|  2.60M|                TY_(CheckAttributes)(doc, node);
  ------------------
  |  |   23|  2.60M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.60M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5766|  2.69M|        }
 5767|       |
 5768|  3.18M|        if (node->content)
  ------------------
  |  Branch (5768:13): [True: 2.41M, False: 775k]
  ------------------
 5769|  2.41M|            AttributeChecks(doc, node->content);
 5770|       |
 5771|  3.18M|        assert( next != node ); /* http://tidy.sf.net/issue/1603538 */
  ------------------
  |  Branch (5771:9): [True: 0, False: 3.18M]
  |  Branch (5771:9): [True: 3.18M, False: 0]
  ------------------
 5772|  3.18M|        node = next;
 5773|  3.18M|    }
 5774|  2.43M|}
parser.c:ReplaceObsoleteElements:
 5866|  2.43M|{
 5867|  2.43M|    Node *next;
 5868|       |
 5869|  5.62M|    while (node)
  ------------------
  |  Branch (5869:12): [True: 3.18M, False: 2.43M]
  ------------------
 5870|  3.18M|    {
 5871|  3.18M|        next = node->next;
 5872|       |
 5873|       |        /* if (nodeIsDIR(node) || nodeIsMENU(node)) */
 5874|       |        /* HTML5 - <menu ... > is no longer obsolete */
 5875|  3.18M|        if (nodeIsDIR(node))
  ------------------
  |  |  389|  3.18M|#define nodeIsDIR( node )        TagIsId( node, TidyTag_DIR )
  |  |  ------------------
  |  |  |  |  275|  3.18M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.18M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.68M, False: 501k]
  |  |  |  |  |  Branch (275:54): [True: 999, False: 2.68M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5876|    999|            TY_(CoerceNode)(doc, node, TidyTag_UL, yes, yes);
  ------------------
  |  |   23|    999|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    999|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5877|       |
 5878|  3.18M|        if (nodeIsXMP(node) || nodeIsLISTING(node) ||
  ------------------
  |  |  439|  3.18M|#define nodeIsXMP( node )        TagIsId( node, TidyTag_XMP )
  |  |  ------------------
  |  |  |  |  275|  6.37M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.18M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.68M, False: 501k]
  |  |  |  |  |  Branch (275:54): [True: 240, False: 2.68M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (nodeIsXMP(node) || nodeIsLISTING(node) ||
  ------------------
  |  |  384|  3.18M|#define nodeIsLISTING( node )    TagIsId( node, TidyTag_LISTING )
  |  |  ------------------
  |  |  |  |  275|  6.37M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 3.18M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.68M, False: 501k]
  |  |  |  |  |  Branch (275:54): [True: 205, False: 2.68M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 5879|  3.18M|            (node->tag && node->tag->id == TidyTag_PLAINTEXT))
  ------------------
  |  Branch (5879:14): [True: 2.68M, False: 501k]
  |  Branch (5879:27): [True: 375, False: 2.68M]
  ------------------
 5880|    820|            TY_(CoerceNode)(doc, node, TidyTag_PRE, yes, yes);
  ------------------
  |  |   23|    820|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    820|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 5881|       |
 5882|  3.18M|        if (node->content)
  ------------------
  |  Branch (5882:13): [True: 2.41M, False: 775k]
  ------------------
 5883|  2.41M|            ReplaceObsoleteElements(doc, node->content);
 5884|       |
 5885|  3.18M|        node = next;
 5886|  3.18M|    }
 5887|  2.43M|}
parser.c:CleanSpaces:
  554|  20.6k|{
  555|  20.6k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  556|  20.6k|    Node *next;
  557|       |    
  558|  2.78M|    while (node)
  ------------------
  |  Branch (558:12): [True: 2.76M, False: 20.6k]
  ------------------
  559|  2.76M|    {
  560|  2.76M|        next = node->next;
  561|       |
  562|  2.76M|        if (TY_(nodeIsText)(node) && CleanLeadingWhitespace(doc, node))
  ------------------
  |  |   23|  2.76M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.76M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (562:13): [True: 238k, False: 2.52M]
  |  Branch (562:38): [True: 46.0k, False: 192k]
  ------------------
  563|  48.3k|            while (node->start < node->end && TY_(IsWhite)(doc->lexer->lexbuf[node->start]))
  ------------------
  |  |   23|  47.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  47.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (563:20): [True: 47.0k, False: 1.22k]
  |  Branch (563:47): [True: 2.26k, False: 44.8k]
  ------------------
  564|  2.26k|                ++(node->start);
  565|       |
  566|  2.76M|        if (TY_(nodeIsText)(node) && CleanTrailingWhitespace(doc, node))
  ------------------
  |  |   23|  2.76M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.76M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (566:13): [True: 238k, False: 2.52M]
  |  Branch (566:38): [True: 42.9k, False: 195k]
  ------------------
  567|  79.7k|            while (node->end > node->start && TY_(IsWhite)(doc->lexer->lexbuf[node->end - 1]))
  ------------------
  |  |   23|  77.3k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  77.3k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (567:20): [True: 77.3k, False: 2.44k]
  |  Branch (567:47): [True: 36.7k, False: 40.5k]
  ------------------
  568|  36.7k|                --(node->end);
  569|       |
  570|  2.76M|        if (TY_(nodeIsText)(node) && !(node->start < node->end))
  ------------------
  |  |   23|  2.76M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.76M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (570:13): [True: 238k, False: 2.52M]
  |  Branch (570:38): [True: 2.85k, False: 235k]
  ------------------
  571|  2.85k|        {
  572|  2.85k|            TY_(RemoveNode)(node);
  ------------------
  |  |   23|  2.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  573|  2.85k|            TY_(FreeNode)(doc, node);
  ------------------
  |  |   23|  2.85k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.85k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  574|  2.85k|            node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|    544|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    544|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (574:20): [True: 2.31k, False: 544]
  ------------------
  575|  2.85k|            continue;
  576|  2.85k|        }
  577|       |
  578|  2.75M|        if (node->content)
  ------------------
  |  Branch (578:13): [True: 2.13M, False: 621k]
  ------------------
  579|  2.13M|        {
  580|  2.13M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.13M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.13M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  581|  2.13M|            node = node->content;
  582|  2.13M|            continue;
  583|  2.13M|        }
  584|       |
  585|   621k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   152k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   152k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (585:16): [True: 468k, False: 152k]
  ------------------
  586|   621k|    }
  587|  20.6k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  588|  20.6k|}
parser.c:CleanLeadingWhitespace:
  404|   238k|{
  405|   238k|    if (!TY_(nodeIsText)(node))
  ------------------
  |  |   23|   238k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   238k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (405:9): [True: 0, False: 238k]
  ------------------
  406|      0|        return no;
  407|       |
  408|   238k|    if (node->parent->type == DocTypeTag)
  ------------------
  |  Branch (408:9): [True: 706, False: 238k]
  ------------------
  409|    706|        return no;
  410|       |
  411|   238k|    if (IsPreDescendant(node))
  ------------------
  |  Branch (411:9): [True: 13.7k, False: 224k]
  ------------------
  412|  13.7k|        return no;
  413|       |
  414|   224k|    if (node->parent->tag && node->parent->tag->parser == TY_(ParseScript))
  ------------------
  |  |   23|   221k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   221k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (414:9): [True: 221k, False: 3.01k]
  |  Branch (414:30): [True: 2.92k, False: 218k]
  ------------------
  415|  2.92k|        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|   221k|    if ( node->prev && nodeIsSCRIPT(node->prev) && nodeIsBODY(node->prev->parent) )
  ------------------
  |  |  422|   140k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|   362k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 140k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 12.0k, False: 128k]
  |  |  |  |  |  Branch (275:54): [True: 614, False: 11.4k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( node->prev && nodeIsSCRIPT(node->prev) && nodeIsBODY(node->prev->parent) )
  ------------------
  |  |  375|    614|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|    614|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 614, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 419, False: 195]
  |  |  |  |  |  Branch (275:54): [True: 211, False: 208]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (422:10): [True: 140k, False: 80.7k]
  ------------------
  423|    211|        return yes;
  424|       |
  425|       |    /* <p>...<br> <em>...</em>...</p> */
  426|   221k|    if (nodeIsBR(node->prev))
  ------------------
  |  |  400|   221k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   221k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 140k, False: 80.7k]
  |  |  |  |  |  Branch (275:39): [True: 11.8k, False: 128k]
  |  |  |  |  |  Branch (275:54): [True: 2.60k, False: 9.23k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  427|  2.60k|        return yes;
  428|       |
  429|       |    /* <p> ...</p> */
  430|   218k|    if (node->prev == NULL && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |   23|  80.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  80.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (node->prev == NULL && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |  143|  80.7k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (430:9): [True: 80.7k, False: 137k]
  |  Branch (430:31): [True: 29.7k, False: 51.0k]
  ------------------
  431|  29.7k|        return yes;
  432|       |
  433|       |    /* <h4>...</h4> <em>...</em> */
  434|   188k|    if (node->prev && !TY_(nodeHasCM)(node->prev, CM_INLINE) &&
  ------------------
  |  |   23|   137k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   137k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (node->prev && !TY_(nodeHasCM)(node->prev, CM_INLINE) &&
  ------------------
  |  |  143|   137k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (434:9): [True: 137k, False: 51.0k]
  |  Branch (434:23): [True: 133k, False: 4.62k]
  ------------------
  435|   133k|        TY_(nodeIsElement)(node->prev))
  ------------------
  |  |   23|   133k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   133k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (435:9): [True: 4.63k, False: 128k]
  ------------------
  436|  4.63k|        return yes;
  437|       |
  438|       |    /* <p><span> ...</span></p> */
  439|   184k|    if (!node->prev && !node->parent->prev && !TY_(nodeHasCM)(node->parent->parent, CM_INLINE))
  ------------------
  |  |   23|  31.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  31.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (!node->prev && !node->parent->prev && !TY_(nodeHasCM)(node->parent->parent, CM_INLINE))
  ------------------
  |  |  143|  31.7k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (439:9): [True: 51.0k, False: 133k]
  |  Branch (439:24): [True: 31.7k, False: 19.3k]
  |  Branch (439:47): [True: 8.85k, False: 22.8k]
  ------------------
  440|  8.85k|        return yes;
  441|       |
  442|   175k|    return no;
  443|   184k|}
parser.c:CleanTrailingWhitespace:
  450|   238k|{
  451|   238k|    Node* next;
  452|       |
  453|   238k|    if (!TY_(nodeIsText)(node))
  ------------------
  |  |   23|   238k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   238k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (453:9): [True: 0, False: 238k]
  ------------------
  454|      0|        return no;
  455|       |
  456|   238k|    if (node->parent->type == DocTypeTag)
  ------------------
  |  Branch (456:9): [True: 706, False: 238k]
  ------------------
  457|    706|        return no;
  458|       |
  459|   238k|    if (IsPreDescendant(node))
  ------------------
  |  Branch (459:9): [True: 13.7k, False: 224k]
  ------------------
  460|  13.7k|        return no;
  461|       |
  462|   224k|    if (node->parent->tag && node->parent->tag->parser == TY_(ParseScript))
  ------------------
  |  |   23|   221k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   221k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (462:9): [True: 221k, False: 3.01k]
  |  Branch (462:30): [True: 2.92k, False: 218k]
  ------------------
  463|  2.92k|        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|   221k|    if ( node->next && nodeIsSCRIPT(node->next) && nodeIsBODY(node->next->parent) )
  ------------------
  |  |  422|   179k|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|   401k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 179k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 49.1k, False: 130k]
  |  |  |  |  |  Branch (275:54): [True: 907, False: 48.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                  if ( node->next && nodeIsSCRIPT(node->next) && nodeIsBODY(node->next->parent) )
  ------------------
  |  |  375|    907|#define nodeIsBODY( node )       TagIsId( node, TidyTag_BODY )
  |  |  ------------------
  |  |  |  |  275|    907|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 907, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 483, False: 424]
  |  |  |  |  |  Branch (275:54): [True: 244, False: 239]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (470:10): [True: 179k, False: 41.5k]
  ------------------
  471|    244|        return yes;
  472|       |
  473|   221k|    next = node->next;
  474|       |
  475|       |    /* <p>... </p> */
  476|   221k|    if (!next && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |   23|  41.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (!next && !TY_(nodeHasCM)(node->parent, CM_INLINE))
  ------------------
  |  |  143|  41.5k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (476:9): [True: 41.5k, False: 179k]
  |  Branch (476:18): [True: 17.8k, False: 23.7k]
  ------------------
  477|  17.8k|        return yes;
  478|       |
  479|       |    /* <div><small>... </small><h3>...</h3></div> */
  480|   203k|    if (!next && node->parent->next && !TY_(nodeHasCM)(node->parent->next, CM_INLINE))
  ------------------
  |  |   23|  7.82k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.82k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (!next && node->parent->next && !TY_(nodeHasCM)(node->parent->next, CM_INLINE))
  ------------------
  |  |  143|  7.82k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (480:9): [True: 23.7k, False: 179k]
  |  Branch (480:18): [True: 7.82k, False: 15.9k]
  |  Branch (480:40): [True: 4.93k, False: 2.89k]
  ------------------
  481|  4.93k|        return yes;
  482|       |
  483|   198k|    if (!next)
  ------------------
  |  Branch (483:9): [True: 18.8k, False: 179k]
  ------------------
  484|  18.8k|        return no;
  485|       |
  486|   179k|    if (nodeIsBR(next))
  ------------------
  |  |  400|   179k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   179k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 179k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 48.8k, False: 130k]
  |  |  |  |  |  Branch (275:54): [True: 3.03k, False: 45.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  487|  3.03k|        return yes;
  488|       |
  489|   176k|    if (TY_(nodeHasCM)(next, CM_INLINE))
  ------------------
  |  |   23|   176k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   176k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if (TY_(nodeHasCM)(next, CM_INLINE))
  ------------------
  |  |  143|   176k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (489:9): [True: 32.6k, False: 143k]
  ------------------
  490|  32.6k|        return no;
  491|       |
  492|       |    /* <a href='/'>...</a> <p>...</p> */
  493|   143k|    if (next->type == StartTag)
  ------------------
  |  Branch (493:9): [True: 13.9k, False: 129k]
  ------------------
  494|  13.9k|        return yes;
  495|       |
  496|       |    /* <strong>...</strong> <hr /> */
  497|   129k|    if (next->type == StartEndTag)
  ------------------
  |  Branch (497:9): [True: 279, False: 129k]
  ------------------
  498|    279|        return yes;
  499|       |
  500|       |    /* evil adjacent text nodes, Tidy should not generate these :-( */
  501|   129k|    if (TY_(nodeIsText)(next) && next->start < next->end
  ------------------
  |  |   23|   129k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   129k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (501:9): [True: 92.4k, False: 37.2k]
  |  Branch (501:34): [True: 92.4k, False: 0]
  ------------------
  502|  92.4k|        && TY_(IsWhite)(doc->lexer->lexbuf[next->start]))
  ------------------
  |  |   23|  92.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  92.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (502:12): [True: 2.67k, False: 89.7k]
  ------------------
  503|  2.67k|        return yes;
  504|       |
  505|   127k|    return no;
  506|   129k|}

prvTidyInitPrintBuf:
  286|  41.2k|{
  287|  41.2k|    TidyClearMemory( &doc->pprint, sizeof(TidyPrintImpl) );
  ------------------
  |  |   70|  41.2k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  288|  41.2k|    InitIndent( &doc->pprint.indent[0] );
  289|  41.2k|    InitIndent( &doc->pprint.indent[1] );
  290|  41.2k|    doc->pprint.allocator = doc->allocator;
  291|  41.2k|    doc->pprint.line = 0;
  292|  41.2k|}
prvTidyFreePrintBuf:
  299|  20.6k|{
  300|  20.6k|    TidyDocFree( doc, doc->pprint.linebuf );
  ------------------
  |  |  159|  20.6k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.6k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  301|  20.6k|    TY_(InitPrintBuf)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  302|  20.6k|}
prvTidyPFlushLine:
  847|  33.5k|{
  848|  33.5k|    TidyPrintImpl* pprint = &doc->pprint;
  849|       |
  850|  33.5k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (850:10): [True: 31.4k, False: 2.07k]
  ------------------
  851|  31.4k|        PFlushLineImpl( doc );
  852|       |
  853|  33.5k|    TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|  33.5k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  33.5k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  854|  33.5k|    pprint->line++;
  855|       |
  856|  33.5k|    if (pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (856:9): [True: 10, False: 33.5k]
  ------------------
  857|     10|    {
  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|     10|        pprint->indent[ 0 ].spaces = indent;
  862|     10|    }
  863|  33.5k|}
prvTidyTextNodeEndWithSpace:
 1667|   978k|{
 1668|   978k|    if (TY_(nodeIsText)(node) && node->end > node->start)
  ------------------
  |  |   23|   978k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   978k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1668:9): [True: 978k, False: 0]
  |  Branch (1668:34): [True: 978k, False: 0]
  ------------------
 1669|   978k|    {
 1670|   978k|        uint i, c = '\0'; /* initialised to avoid warnings */
 1671|  6.45M|        for (i = node->start; i < node->end; ++i)
  ------------------
  |  Branch (1671:31): [True: 5.47M, False: 978k]
  ------------------
 1672|  5.47M|        {
 1673|  5.47M|            c = (byte) lexer->lexbuf[i];
 1674|  5.47M|            if ( c > 0x7F )
  ------------------
  |  Branch (1674:18): [True: 762k, False: 4.71M]
  ------------------
 1675|   762k|                i += TY_(GetUTF8)( lexer->lexbuf + i, &c );
  ------------------
  |  |   23|   762k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   762k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1676|  5.47M|        }
 1677|       |
 1678|   978k|        if ( c == ' ' || c == '\n' )
  ------------------
  |  Branch (1678:14): [True: 10.1k, False: 968k]
  |  Branch (1678:26): [True: 475, False: 967k]
  ------------------
 1679|  10.6k|            return yes;
 1680|   978k|    }
 1681|   967k|    return no;
 1682|   978k|}
prvTidyPPrintTree:
 2275|  2.71M|{
 2276|  2.71M|    Node *content, *last;
 2277|  2.71M|    uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|  2.71M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 2278|  2.71M|    Bool xhtml = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  2.71M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.71M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2279|       |
 2280|  2.71M|    if ( node == NULL )
  ------------------
  |  Branch (2280:10): [True: 0, False: 2.71M]
  ------------------
 2281|      0|        return;
 2282|       |
 2283|  2.71M|    if (doc->progressCallback)
  ------------------
  |  Branch (2283:9): [True: 0, False: 2.71M]
  ------------------
 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.71M|    if (node->type == TextNode)
  ------------------
  |  Branch (2292:9): [True: 233k, False: 2.48M]
  ------------------
 2293|   233k|    {
 2294|   233k|        PPrintText( doc, mode, indent, node );
 2295|   233k|    }
 2296|  2.48M|    else if ( node->type == CommentTag )
  ------------------
  |  Branch (2296:15): [True: 87.5k, False: 2.39M]
  ------------------
 2297|  87.5k|    {
 2298|  87.5k|        PPrintComment( doc, indent, node );
 2299|  87.5k|    }
 2300|  2.39M|    else if ( node->type == RootNode )
  ------------------
  |  Branch (2300:15): [True: 20.6k, False: 2.37M]
  ------------------
 2301|  20.6k|    {
 2302|  66.4k|        for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2302:40): [True: 45.8k, False: 20.6k]
  ------------------
 2303|  45.8k|           TY_(PPrintTree)( doc, mode, indent, content );
  ------------------
  |  |   23|  45.8k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  45.8k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2304|  20.6k|    }
 2305|  2.37M|    else if ( node->type == DocTypeTag )
  ------------------
  |  Branch (2305:15): [True: 32.0k, False: 2.34M]
  ------------------
 2306|  32.0k|        PPrintDocType( doc, indent, node );
 2307|  2.34M|    else if ( node->type == ProcInsTag)
  ------------------
  |  Branch (2307:15): [True: 92.4k, False: 2.24M]
  ------------------
 2308|  92.4k|        PPrintPI( doc, indent, node );
 2309|  2.24M|    else if ( node->type == XmlDecl)
  ------------------
  |  Branch (2309:15): [True: 2.75k, False: 2.24M]
  ------------------
 2310|  2.75k|        PPrintXmlDecl( doc, indent, node );
 2311|  2.24M|    else if ( node->type == CDATATag)
  ------------------
  |  Branch (2311:15): [True: 1.81k, False: 2.24M]
  ------------------
 2312|  1.81k|        PPrintCDATA( doc, indent, node );
 2313|  2.24M|    else if ( node->type == SectionTag)
  ------------------
  |  Branch (2313:15): [True: 16.8k, False: 2.22M]
  ------------------
 2314|  16.8k|        PPrintSection( doc, indent, node );
 2315|  2.22M|    else if ( node->type == AspTag)
  ------------------
  |  Branch (2315:15): [True: 2.39k, False: 2.22M]
  ------------------
 2316|  2.39k|        PPrintAsp( doc, indent, node );
 2317|  2.22M|    else if ( node->type == JsteTag)
  ------------------
  |  Branch (2317:15): [True: 3.89k, False: 2.22M]
  ------------------
 2318|  3.89k|        PPrintJste( doc, indent, node );
 2319|  2.22M|    else if ( node->type == PhpTag)
  ------------------
  |  Branch (2319:15): [True: 367, False: 2.22M]
  ------------------
 2320|    367|        PPrintPhp( doc, indent, node );
 2321|  2.22M|    else if ( nodeIsMATHML(node) )
  ------------------
  |  |  465|  2.22M|#define nodeIsMATHML( node )     TagIsId( node, TidyTag_MATHML ) /* #130 MathML attr and entity fix! */
  |  |  ------------------
  |  |  |  |  275|  2.22M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.22M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.21M, False: 5.24k]
  |  |  |  |  |  Branch (275:54): [True: 264, False: 2.21M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2322|    264|        PPrintMathML( doc, indent, node ); /* #130 MathML attr and entity fix! */
 2323|  2.22M|    else if ( TY_(nodeCMIsEmpty)(node) ||
  ------------------
  |  |   23|  2.22M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.22M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2323:15): [True: 65.9k, False: 2.15M]
  ------------------
 2324|  2.15M|              (node->type == StartEndTag && !xhtml) )
  ------------------
  |  Branch (2324:16): [True: 5.18k, False: 2.14M]
  |  Branch (2324:45): [True: 0, False: 5.18k]
  ------------------
 2325|  65.9k|    {
 2326|       |        /* Issue #8 - flush to new line? 
 2327|       |           maybe use if ( TY_(nodeHasCM)(node, CM_BLOCK) ) instead
 2328|       |           or remove the CM_INLINE from the tag
 2329|       |         */
 2330|  65.9k|        if ( ! TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |   23|  65.9k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  65.9k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( ! TY_(nodeHasCM)(node, CM_INLINE) )
  ------------------
  |  |  143|  65.9k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2330:14): [True: 42.9k, False: 22.9k]
  ------------------
 2331|  42.9k|            PCondFlushLineSmart( doc, indent );
 2332|       |
 2333|  65.9k|        if ( nodeIsBR(node) && node->prev &&
  ------------------
  |  |  400|  65.9k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   131k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 65.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 65.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 16.6k, False: 49.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2333:32): [True: 14.1k, False: 2.50k]
  ------------------
 2334|  14.1k|             !(nodeIsBR(node->prev) || (mode & PREFORMATTED)) &&
  ------------------
  |  |  400|  14.1k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  28.2k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 14.1k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 10.2k, False: 3.82k]
  |  |  |  |  |  Branch (275:54): [True: 9.76k, False: 518]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2334:40): [True: 1.24k, False: 3.09k]
  ------------------
 2335|  3.09k|             cfgBool(doc, TidyBreakBeforeBR) )
  ------------------
  |  |  418|  3.09k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.09k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 3.09k]
  |  |  ------------------
  ------------------
 2336|      0|            PFlushLineSmart( doc, indent );
 2337|       |
 2338|  65.9k|        if ( nodeIsHR(node) )
  ------------------
  |  |  380|  65.9k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  65.9k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 65.9k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 65.9k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 5.64k, False: 60.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2339|  5.64k|        {
 2340|       |            /* insert extra newline for classic formatting */
 2341|  5.64k|            Bool classic = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
  ------------------
  |  |   51|  5.64k|#define TidyClassicVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyYesState) ? yes : no)
  |  |  ------------------
  |  |  |  |  421|  5.64k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  5.64k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (51:24): [True: 0, False: 5.64k]
  |  |  ------------------
  ------------------
 2342|  5.64k|            if (classic && node->parent && node->parent->content != node)
  ------------------
  |  Branch (2342:17): [True: 0, False: 5.64k]
  |  Branch (2342:28): [True: 0, False: 0]
  |  Branch (2342:44): [True: 0, False: 0]
  ------------------
 2343|      0|            {
 2344|      0|                PFlushLineSmart( doc, indent );
 2345|      0|            }
 2346|  5.64k|        }
 2347|       |
 2348|  65.9k|        PPrintTag( doc, mode, indent, node );
 2349|       |
 2350|  65.9k|        if (node->next)
  ------------------
  |  Branch (2350:13): [True: 56.4k, False: 9.46k]
  ------------------
 2351|  56.4k|        {
 2352|  56.4k|          if (nodeIsPARAM(node) || nodeIsAREA(node))
  ------------------
  |  |  409|  56.4k|#define nodeIsPARAM( node )      TagIsId( node, TidyTag_PARAM )
  |  |  ------------------
  |  |  |  |  275|   112k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 56.4k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 56.4k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.12k, False: 55.3k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                        if (nodeIsPARAM(node) || nodeIsAREA(node))
  ------------------
  |  |  414|  55.3k|#define nodeIsAREA( node )       TagIsId( node, TidyTag_AREA )
  |  |  ------------------
  |  |  |  |  275|  55.3k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 55.3k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 55.3k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.46k, False: 53.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2353|  2.58k|              PCondFlushLineSmart(doc, indent);
 2354|  53.8k|          else if ((nodeIsBR(node) && !(mode & PREFORMATTED))
  ------------------
  |  |  400|  53.8k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   107k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 53.8k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 53.8k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 15.0k, False: 38.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2354:39): [True: 10.2k, False: 4.75k]
  ------------------
 2355|  43.5k|                   || nodeIsHR(node))
  ------------------
  |  |  380|  43.5k|#define nodeIsHR( node )         TagIsId( node, TidyTag_HR )
  |  |  ------------------
  |  |  |  |  275|  43.5k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 43.5k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 43.5k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 4.58k, False: 39.0k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2356|  14.8k|              PFlushLineSmart(doc, indent);
 2357|  56.4k|        }
 2358|  65.9k|    }
 2359|  2.15M|    else /* some kind of container element */
 2360|  2.15M|    {
 2361|  2.15M|        if ( node->type == StartEndTag )
  ------------------
  |  Branch (2361:14): [True: 5.18k, False: 2.14M]
  ------------------
 2362|  5.18k|            node->type = StartTag;
 2363|       |
 2364|  2.15M|        if ( node->tag && 
  ------------------
  |  Branch (2364:14): [True: 2.14M, False: 5.24k]
  ------------------
 2365|  2.14M|             (node->tag->parser == TY_(ParsePre) || nodeIsTEXTAREA(node)) )
  ------------------
  |  |   23|  2.14M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.14M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                           (node->tag->parser == TY_(ParsePre) || nodeIsTEXTAREA(node)) )
  ------------------
  |  |  425|  2.14M|#define nodeIsTEXTAREA( node )   TagIsId( node, TidyTag_TEXTAREA )
  |  |  ------------------
  |  |  |  |  275|  2.14M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.14M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.14M, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.70k, False: 2.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2365:15): [True: 6.00k, False: 2.14M]
  ------------------
 2366|  7.71k|        {
 2367|  7.71k|            Bool classic  = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
  ------------------
  |  |   51|  7.71k|#define TidyClassicVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyYesState) ? yes : no)
  |  |  ------------------
  |  |  |  |  421|  7.71k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|  7.71k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (51:24): [True: 0, False: 7.71k]
  |  |  ------------------
  ------------------
 2368|  7.71k|            uint indprev = indent;
 2369|       |
 2370|  7.71k|            PCondFlushLineSmart( doc, indent ); /* about to add <pre> tag - clear any previous */
 2371|       |
 2372|       |            /* insert extra newline for classic formatting */
 2373|  7.71k|            if (classic && node->parent && node->parent->content != node)
  ------------------
  |  Branch (2373:17): [True: 0, False: 7.71k]
  |  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|  7.71k|            PPrintTag( doc, (mode | NOWRAP), indent, node );   /* add <pre> or <textarea> tag */
 2380|       |
 2381|  7.71k|            indent = 0;
 2382|       |            /* @camoy Fix #158 - remove inserted newlines in pre - PFlushLineSmart( doc, indent ); */
 2383|       |
 2384|  30.3k|            for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2384:44): [True: 22.6k, False: 7.71k]
  ------------------
 2385|  22.6k|            {
 2386|  22.6k|                TY_(PPrintTree)( doc, (mode | PREFORMATTED | NOWRAP),
  ------------------
  |  |   23|  22.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2387|  22.6k|                                 indent, content );
 2388|  22.6k|            }
 2389|       |
 2390|       |            /* @camoy Fix #158 - remove inserted newlines in pre - PCondFlushLineSmart( doc, indent ); */
 2391|  7.71k|            indent = indprev;
 2392|  7.71k|            PPrintEndTag( doc, mode, indent, node );
 2393|       |
 2394|  7.71k|            if ( cfgAutoBool(doc, TidyIndentContent) == TidyNoState
  ------------------
  |  |  421|  7.71k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  7.71k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2394:18): [True: 7.71k, False: 0]
  ------------------
 2395|  7.71k|                 && node->next != NULL )
  ------------------
  |  Branch (2395:21): [True: 6.98k, False: 728]
  ------------------
 2396|  6.98k|                PFlushLineSmart( doc, indent );
 2397|  7.71k|        }
 2398|  2.14M|        else if ( nodeIsSTYLE(node) || nodeIsSCRIPT(node) )
  ------------------
  |  |  421|  2.14M|#define nodeIsSTYLE( node )      TagIsId( node, TidyTag_STYLE )
  |  |  ------------------
  |  |  |  |  275|  4.29M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.14M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.14M, False: 5.24k]
  |  |  |  |  |  Branch (275:54): [True: 1.40k, False: 2.14M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      else if ( nodeIsSTYLE(node) || nodeIsSCRIPT(node) )
  ------------------
  |  |  422|  2.14M|#define nodeIsSCRIPT( node )     TagIsId( node, TidyTag_SCRIPT )
  |  |  ------------------
  |  |  |  |  275|  2.14M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 2.14M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 2.14M, False: 5.24k]
  |  |  |  |  |  Branch (275:54): [True: 2.38k, False: 2.13M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2399|  3.79k|        {
 2400|  3.79k|            PPrintScriptStyle( doc, (mode | PREFORMATTED | NOWRAP | CDATA),
 2401|  3.79k|                               indent, node );
 2402|  3.79k|        }
 2403|  2.14M|        else if ( TY_(nodeCMIsInline)(node) )
  ------------------
  |  |   23|  2.14M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.14M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2403:19): [True: 1.77M, False: 364k]
  ------------------
 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.61M|                      content != NULL;
  ------------------
  |  Branch (2439:23): [True: 1.84M, False: 1.77M]
  ------------------
 2440|  1.84M|                      content = content->next )
 2441|  1.84M|                    TY_(PPrintTree)( doc, mode, indent, content );
  ------------------
  |  |   23|  1.84M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.84M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2442|  1.77M|            }
 2443|  1.77M|            PPrintEndTag( doc, mode, indent, node );
 2444|  1.77M|        }
 2445|   364k|        else /* other tags */
 2446|   364k|        {
 2447|   364k|            Bool indcont  = ( cfgAutoBool(doc, TidyIndentContent) != TidyNoState );
  ------------------
  |  |  421|   364k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   364k|#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|   364k|            Bool hideend  = cfgBool( doc, TidyOmitOptionalTags );
  ------------------
  |  |  418|   364k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   364k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2451|   364k|            Bool classic  = TidyClassicVS; /* #228 - cfgBool( doc, TidyVertSpace ); */
  ------------------
  |  |   51|   364k|#define TidyClassicVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyYesState) ? yes : no)
  |  |  ------------------
  |  |  |  |  421|   364k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|   364k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (51:24): [True: 0, False: 364k]
  |  |  ------------------
  ------------------
 2452|   364k|            uint contentIndent = indent;
 2453|       |
 2454|       |            /* insert extra newline for classic formatting */
 2455|   364k|            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: 364k]
  |  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|   364k|            if ( ShouldIndent(doc, node) )
  ------------------
  |  Branch (2460:18): [True: 0, False: 364k]
  ------------------
 2461|      0|                contentIndent += spaces;
 2462|       |
 2463|   364k|            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|   364k|            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: 364k, False: 0]
  |  Branch (2476:30): [True: 0, False: 0]
  ------------------
 2477|      0|                 node->attributes != NULL )
  ------------------
  |  Branch (2477:18): [True: 0, False: 0]
  ------------------
 2478|   364k|            {
 2479|   364k|                PPrintTag( doc, mode, indent, node );
 2480|       |
 2481|   364k|                if ( ShouldIndent(doc, node) )
  ------------------
  |  Branch (2481:22): [True: 0, False: 364k]
  ------------------
 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|   364k|                else if ( TY_(nodeHasCM)(node, CM_HTML) || nodeIsNOFRAMES(node) ||
  ------------------
  |  |   23|   364k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   364k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_HTML) || nodeIsNOFRAMES(node) ||
  ------------------
  |  |  140|   364k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
                              else if ( TY_(nodeHasCM)(node, CM_HTML) || nodeIsNOFRAMES(node) ||
  ------------------
  |  |  379|   227k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|   591k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 227k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 221k, False: 5.24k]
  |  |  |  |  |  Branch (275:54): [True: 10.7k, False: 210k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2488:27): [True: 137k, False: 227k]
  ------------------
 2489|   216k|                          (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node)) )
  ------------------
  |  |   23|   216k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   216k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                        (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node)) )
  ------------------
  |  |  141|   216k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
                                        (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node)) )
  ------------------
  |  |  372|  23.7k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  23.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 23.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 23.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 23.4k, False: 275]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2489:28): [True: 23.7k, False: 192k]
  ------------------
 2490|   148k|                    PFlushLineSmart( doc, contentIndent );
 2491|   364k|            }
 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|   364k|            last = NULL;
 2503|  1.14M|            for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2503:44): [True: 777k, False: 364k]
  ------------------
 2504|   777k|            {
 2505|       |                /* kludge for naked text before block level tag */
 2506|   777k|                if ( last && !indcont && TY_(nodeIsText)(last) &&
  ------------------
  |  |   23|   460k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   460k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2506:22): [True: 460k, False: 317k]
  |  Branch (2506:30): [True: 460k, False: 0]
  |  Branch (2506:42): [True: 127k, False: 333k]
  ------------------
 2507|   127k|                     content->tag && !TY_(nodeHasCM)(content, CM_INLINE) )
  ------------------
  |  |   23|  18.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  18.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   content->tag && !TY_(nodeHasCM)(content, CM_INLINE) )
  ------------------
  |  |  143|  18.6k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (2507:22): [True: 18.6k, False: 108k]
  |  Branch (2507:38): [True: 12.5k, False: 6.10k]
  ------------------
 2508|  12.5k|                {
 2509|       |                    /* TY_(PFlushLine)(fout, indent); */
 2510|  12.5k|                    PFlushLineSmart( doc, contentIndent );
 2511|  12.5k|                }
 2512|       |
 2513|   777k|                TY_(PPrintTree)( doc, mode, contentIndent, content );
  ------------------
  |  |   23|   777k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   777k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2514|   777k|                last = content;
 2515|   777k|            }
 2516|       |
 2517|       |            /* don't flush line for td and th */
 2518|   364k|            if ( ShouldIndent(doc, node) ||
  ------------------
  |  Branch (2518:18): [True: 0, False: 364k]
  ------------------
 2519|   364k|                 ( !hideend &&
  ------------------
  |  Branch (2519:20): [True: 364k, False: 0]
  ------------------
 2520|   364k|                   ( TY_(nodeHasCM)(node, CM_HTML) || 
  ------------------
  |  |   23|   364k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   364k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                 ( TY_(nodeHasCM)(node, CM_HTML) || 
  ------------------
  |  |  140|   364k|#define CM_HTML         (1 << 1)   /**< Elements that appear outside of "BODY". */
  ------------------
  |  Branch (2520:22): [True: 137k, False: 227k]
  ------------------
 2521|   364k|                     nodeIsNOFRAMES(node) ||
  ------------------
  |  |  379|   227k|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|   591k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 227k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 221k, False: 5.24k]
  |  |  |  |  |  Branch (275:54): [True: 10.7k, False: 210k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2522|   216k|                     (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node))
  ------------------
  |  |   23|   216k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   216k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                                   (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node))
  ------------------
  |  |  141|   216k|#define CM_HEAD         (1 << 2)   /**< Elements that can appear within HEAD. */
  ------------------
                                   (TY_(nodeHasCM)(node, CM_HEAD) && !nodeIsTITLE(node))
  ------------------
  |  |  372|  23.7k|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|  23.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 23.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 23.7k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 23.4k, False: 275]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2522:23): [True: 23.7k, False: 192k]
  ------------------
 2523|   364k|                   )
 2524|   364k|                 )
 2525|   364k|               )
 2526|   148k|            {
 2527|   148k|                PCondFlushLineSmart( doc, indent );
 2528|   148k|                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: 148k, False: 0]
  |  Branch (2528:34): [True: 0, False: 0]
  ------------------
 2529|   148k|                {
 2530|   148k|                    PPrintEndTag( doc, mode, indent, node );
 2531|       |                    /* TY_(PFlushLine)( doc, indent ); */
 2532|   148k|                }
 2533|   148k|            }
 2534|   215k|            else
 2535|   215k|            {
 2536|   215k|                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: 215k, False: 0]
  |  Branch (2536:34): [True: 0, False: 0]
  ------------------
 2537|   215k|                {
 2538|       |                    /* newline before endtag for classic formatting */
 2539|   215k|                    if ( classic && !HasMixedContent(node) )
  ------------------
  |  Branch (2539:26): [True: 0, False: 215k]
  |  Branch (2539:37): [True: 0, False: 0]
  ------------------
 2540|      0|                        PFlushLineSmart( doc, indent );
 2541|   215k|                    PPrintEndTag( doc, mode, indent, node );
 2542|   215k|                }
 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|   215k|            }
 2556|       |
 2557|   364k|            if (!indcont && !hideend && !nodeIsHTML(node) && !classic)
  ------------------
  |  |  370|   364k|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|   729k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 364k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 359k, False: 5.24k]
  |  |  |  |  |  Branch (275:54): [True: 45.1k, False: 314k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (2557:17): [True: 364k, False: 0]
  |  Branch (2557:29): [True: 364k, False: 0]
  |  Branch (2557:62): [True: 319k, False: 0]
  ------------------
 2558|   319k|                PFlushLineSmart( doc, indent );
 2559|  45.1k|            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: 45.1k]
  |  Branch (2559:33): [True: 0, False: 0]
  |  Branch (2559:55): [True: 0, False: 0]
  ------------------
 2560|      0|                PFlushLineSmart( doc, indent );
 2561|   364k|        }
 2562|  2.15M|    }
 2563|  2.71M|}
pprint.c:InitIndent:
  275|  88.4k|{
  276|  88.4k|    ind->spaces = -1;
  277|  88.4k|    ind->attrValStart = -1;
  278|  88.4k|    ind->attrStringStart = -1;
  279|  88.4k|}
pprint.c:PFlushLineImpl:
  821|   907k|{
  822|   907k|    TidyPrintImpl* pprint = &doc->pprint;
  823|       |
  824|   907k|    uint i;
  825|       |
  826|   907k|    CheckWrapLine( doc );
  827|       |
  828|   907k|    if ( WantIndent(doc) )
  ------------------
  |  Branch (828:10): [True: 290, False: 906k]
  ------------------
  829|    290|        WriteIndentChar(doc);
  830|       |
  831|   308M|    for ( i = 0; i < pprint->linelen; ++i )
  ------------------
  |  Branch (831:18): [True: 307M, False: 907k]
  ------------------
  832|   307M|        TY_(WriteChar)( pprint->linebuf[i], doc->docOut );
  ------------------
  |  |   23|   307M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   307M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  833|       |
  834|   907k|    if ( IsInString(pprint) )
  ------------------
  |  Branch (834:10): [True: 0, False: 907k]
  ------------------
  835|      0|        TY_(WriteChar)( '\\', doc->docOut );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  836|   907k|    ResetLine( pprint );
  837|   907k|    pprint->linelen = 0;
  838|   907k|}
pprint.c:CheckWrapLine:
  680|   907k|{
  681|   907k|    TidyPrintImpl* pprint = &doc->pprint;
  682|   907k|    if ( GetSpaces(pprint) + pprint->linelen >= cfg(doc, TidyWrapLen) )
  ------------------
  |  |  415|   907k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (682:10): [True: 68.9k, False: 838k]
  ------------------
  683|  68.9k|    {
  684|  68.9k|        WrapLine( doc );
  685|  68.9k|        return yes;
  686|  68.9k|    }
  687|   838k|    return no;
  688|   907k|}
pprint.c:GetSpaces:
  343|   276M|{
  344|   276M|    int spaces = pprint->indent[ 0 ].spaces;
  345|   276M|    return ( spaces < 0 ? 0U : (uint) spaces );
  ------------------
  |  Branch (345:14): [True: 2.19k, False: 276M]
  ------------------
  346|   276M|}
pprint.c:WrapLine:
  652|   269M|{
  653|   269M|    TidyPrintImpl* pprint = &doc->pprint;
  654|   269M|    uint i;
  655|       |
  656|   269M|    if ( pprint->wraphere == 0 )
  ------------------
  |  Branch (656:10): [True: 269M, False: 88.0k]
  ------------------
  657|   269M|        return;
  658|       |
  659|  88.0k|    if ( WantIndent(doc) )
  ------------------
  |  Branch (659:10): [True: 0, False: 88.0k]
  ------------------
  660|      0|        WriteIndentChar(doc);
  661|       |
  662|  22.7M|    for ( i = 0; i < pprint->wraphere; ++i )
  ------------------
  |  Branch (662:18): [True: 22.6M, False: 88.0k]
  ------------------
  663|  22.6M|        TY_(WriteChar)( pprint->linebuf[i], doc->docOut );
  ------------------
  |  |   23|  22.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  22.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  664|       |
  665|  88.0k|    if ( IsWrapInString(pprint) )
  ------------------
  |  Branch (665:10): [True: 0, False: 88.0k]
  ------------------
  666|      0|        TY_(WriteChar)( '\\', doc->docOut );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  667|       |
  668|  88.0k|    TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|  88.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  88.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  669|  88.0k|    pprint->line++;
  670|  88.0k|    ResetLineAfterWrap( pprint );
  671|  88.0k|}
pprint.c:IsWrapInString:
  392|  88.3k|{
  393|  88.3k|    TidyIndent *ind = pprint->indent + 0; /* Always 1st */
  394|  88.3k|    int wrap = (int) pprint->wraphere;
  395|  88.3k|    return ( ind->attrStringStart == 0 ||
  ------------------
  |  Branch (395:14): [True: 0, False: 88.3k]
  ------------------
  396|  88.3k|             (ind->attrStringStart > 0 && ind->attrStringStart < wrap) );
  ------------------
  |  Branch (396:15): [True: 0, False: 88.3k]
  |  Branch (396:43): [True: 0, False: 0]
  ------------------
  397|  88.3k|}
pprint.c:ResetLineAfterWrap:
  595|  88.0k|{
  596|  88.0k|    if ( pprint->linelen > pprint->wraphere )
  ------------------
  |  Branch (596:10): [True: 88.0k, False: 0]
  ------------------
  597|  88.0k|    {
  598|  88.0k|        uint *p = pprint->linebuf;
  599|  88.0k|        uint *q = p + pprint->wraphere;
  600|  88.0k|        uint *end = p + pprint->linelen;
  601|       |
  602|  88.0k|        if ( ! IsWrapInAttrVal(pprint) )
  ------------------
  |  Branch (602:14): [True: 88.0k, False: 0]
  ------------------
  603|  88.0k|        {
  604|   123k|            while ( q < end && *q == ' ' )
  ------------------
  |  Branch (604:21): [True: 100k, False: 22.8k]
  |  Branch (604:32): [True: 34.9k, False: 65.2k]
  ------------------
  605|  34.9k|                ++q, ++pprint->wraphere;
  606|  88.0k|        }
  607|       |
  608|  9.80M|        while ( q < end )
  ------------------
  |  Branch (608:17): [True: 9.71M, False: 88.0k]
  ------------------
  609|  9.71M|            *p++ = *q++;
  610|       |
  611|  88.0k|        pprint->linelen -= pprint->wraphere;
  612|  88.0k|    }
  613|      0|    else
  614|      0|    {
  615|      0|        pprint->linelen = 0;
  616|      0|    }
  617|       |
  618|  88.0k|    ResetLine( pprint );
  619|  88.0k|}
pprint.c:IsWrapInAttrVal:
  430|  88.3k|{
  431|  88.3k|    TidyIndent *ind = pprint->indent + 0; /* Always 1st */
  432|  88.3k|    int wrap = (int) pprint->wraphere;
  433|  88.3k|    return ( ind->attrValStart == 0 ||
  ------------------
  |  Branch (433:14): [True: 0, False: 88.3k]
  ------------------
  434|  88.3k|             (ind->attrValStart > 0 && ind->attrValStart < wrap) );
  ------------------
  |  Branch (434:15): [True: 281, False: 88.0k]
  |  Branch (434:40): [True: 0, False: 281]
  ------------------
  435|  88.3k|}
pprint.c:WantIndent:
  489|   995k|{
  490|   995k|    TidyPrintImpl* pprint = &doc->pprint;
  491|   995k|    Bool wantIt = GetSpaces(pprint) > 0;
  492|   995k|    if ( wantIt )
  ------------------
  |  Branch (492:10): [True: 290, False: 994k]
  ------------------
  493|    290|    {
  494|    290|        Bool indentAttrs = cfgBool( doc, TidyIndentAttributes );
  ------------------
  |  |  418|    290|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|    290|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  495|    290|        wantIt = ( ( !IsWrapInAttrVal(pprint) || indentAttrs ) &&
  ------------------
  |  Branch (495:22): [True: 290, False: 0]
  |  Branch (495:50): [True: 0, False: 0]
  ------------------
  496|    290|                   !IsWrapInString(pprint) );
  ------------------
  |  Branch (496:20): [True: 290, False: 0]
  ------------------
  497|    290|    }
  498|   995k|    return wantIt;
  499|   995k|}
pprint.c:WriteIndentChar:
  630|    290|{
  631|    290|    TidyPrintImpl* pprint = &doc->pprint;
  632|    290|    uint i;
  633|    290|    uint spaces = GetSpaces(pprint);
  634|    290|    uint tabsize = cfg(doc, TidyTabSize);
  ------------------
  |  |  415|    290|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  635|    290|    if (spaces && (doc->indent_char == '\t') && tabsize)
  ------------------
  |  Branch (635:9): [True: 290, False: 0]
  |  Branch (635:19): [True: 0, False: 290]
  |  Branch (635:49): [True: 0, False: 0]
  ------------------
  636|      0|    {
  637|      0|        spaces /= tabsize;  /* set number of tabs to output */
  638|      0|        if (spaces == 0)    /* with a minimum of one */
  ------------------
  |  Branch (638:13): [True: 0, False: 0]
  ------------------
  639|      0|            spaces = 1;
  640|      0|    }
  641|  1.26k|    for (i = 0; i < spaces; i++)
  ------------------
  |  Branch (641:17): [True: 973, False: 290]
  ------------------
  642|    973|        TY_(WriteChar)(doc->indent_char, doc->docOut); /* 20150515 - Issue #108 */
  ------------------
  |  |   23|    973|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    973|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  643|       |
  644|    290|}
pprint.c:IsInString:
  380|   907k|{
  381|   907k|    TidyIndent *ind = pprint->indent + 0; /* Always 1st */
  382|   907k|    return ( ind->attrStringStart >= 0 && 
  ------------------
  |  Branch (382:14): [True: 0, False: 907k]
  ------------------
  383|      0|             ind->attrStringStart < (int) pprint->linelen );
  ------------------
  |  Branch (383:14): [True: 0, False: 0]
  ------------------
  384|   907k|}
pprint.c:ResetLine:
  564|   995k|{
  565|   995k|    TidyIndent* ind = pprint->indent + 0;
  566|   995k|    if ( pprint->ixInd > 0 )
  ------------------
  |  Branch (566:10): [True: 6.00k, False: 989k]
  ------------------
  567|  6.00k|    {
  568|  6.00k|        ind[0] = ind[1];
  569|  6.00k|        InitIndent( &ind[1] );
  570|  6.00k|    }
  571|       |
  572|   995k|    if ( pprint->wraphere > 0 )
  ------------------
  |  Branch (572:10): [True: 546k, False: 448k]
  ------------------
  573|   546k|    {
  574|   546k|        int wrap = (int) pprint->wraphere;
  575|   546k|        if ( ind[0].attrStringStart > wrap )
  ------------------
  |  Branch (575:14): [True: 0, False: 546k]
  ------------------
  576|      0|            ind[0].attrStringStart -= wrap;
  577|   546k|        if ( ind[0].attrValStart > wrap )
  ------------------
  |  Branch (577:14): [True: 1.25k, False: 544k]
  ------------------
  578|  1.25k|            ind[0].attrValStart -= wrap;
  579|   546k|    }
  580|   448k|    else
  581|   448k|    {
  582|   448k|        if ( ind[0].attrStringStart > 0 )
  ------------------
  |  Branch (582:14): [True: 0, False: 448k]
  ------------------
  583|      0|            ind[0].attrStringStart = 0;
  584|   448k|        if ( ind[0].attrValStart > 0 )
  ------------------
  |  Branch (584:14): [True: 362, False: 448k]
  ------------------
  585|    362|            ind[0].attrValStart = 0;
  586|   448k|    }
  587|   995k|    pprint->wraphere = pprint->ixInd = 0;
  588|   995k|}
pprint.c:PPrintText:
 1359|   460k|{
 1360|   460k|    uint start = node->start;
 1361|   460k|    uint end = node->end;
 1362|   460k|    uint ix, c = 0;
 1363|   460k|    int  ixNL = TextEndsWithNewline( doc->lexer, node, mode );
 1364|   460k|    int  ixWS = TextStartsWithWhitespace( doc->lexer, node, start, mode );
 1365|   460k|    if ( ixNL > 0 )
  ------------------
  |  Branch (1365:10): [True: 59, False: 460k]
  ------------------
 1366|     59|      end -= ixNL;
 1367|   460k|    start = IncrWS( start, end, indent, ixWS );
 1368|       |
 1369|   271M|    for ( ix = start; ix < end; ++ix )
  ------------------
  |  Branch (1369:23): [True: 271M, False: 460k]
  ------------------
 1370|   271M|    {
 1371|   271M|        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|   271M|        c = (byte) doc->lexer->lexbuf[ix];
 1380|       |
 1381|       |        /* look for UTF-8 multibyte character */
 1382|   271M|        if ( c > 0x7F )
  ------------------
  |  Branch (1382:14): [True: 1.57M, False: 269M]
  ------------------
 1383|  1.57M|             ix += TY_(GetUTF8)( doc->lexer->lexbuf + ix, &c );
  ------------------
  |  |   23|  1.57M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.57M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1384|       |
 1385|   271M|        if ( c == '\n' )
  ------------------
  |  Branch (1385:14): [True: 9.45k, False: 271M]
  ------------------
 1386|  9.45k|        {
 1387|  9.45k|            TY_(PFlushLine)( doc, indent );
  ------------------
  |  |   23|  9.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1388|  9.45k|            ixWS = TextStartsWithWhitespace( doc->lexer, node, ix+1, mode );
 1389|  9.45k|            ix = IncrWS( ix, end, indent, ixWS );
 1390|  9.45k|        }
 1391|   271M|        else if (( c == '&' ) && (TY_(HTMLVersion)(doc) == HT50) &&
  ------------------
  |  |   23|   172k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   172k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      else if (( c == '&' ) && (TY_(HTMLVersion)(doc) == HT50) &&
  ------------------
  |  |  200|   172k|#define HT50              131072u
  ------------------
  |  Branch (1391:18): [True: 172k, False: 270M]
  |  Branch (1391:34): [True: 0, False: 172k]
  ------------------
 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|   271M|        else
 1401|   271M|        {
 1402|   271M|            PPrintChar( doc, c, mode );
 1403|   271M|        }
 1404|   271M|    }
 1405|   460k|}
pprint.c:TextEndsWithNewline:
  999|   462k|{
 1000|   462k|    if ( (mode & (CDATA|COMMENT)) && TY_(nodeIsText)(node) && node->end > node->start )
  ------------------
  |  |   23|   242k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   242k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1000:10): [True: 242k, False: 220k]
  |  Branch (1000:38): [True: 14.7k, False: 227k]
  |  Branch (1000:63): [True: 14.7k, False: 0]
  ------------------
 1001|  14.7k|    {
 1002|  14.7k|        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|  78.6k|        while ( ix > node->start && (ch = (lexer->lexbuf[ix] & 0xff))
  ------------------
  |  Branch (1007:17): [True: 68.3k, False: 10.2k]
  |  Branch (1007:37): [True: 68.3k, False: 26]
  ------------------
 1008|  68.3k|                 && ( ch == ' ' || ch == '\t' || ch == '\r' ) )
  ------------------
  |  Branch (1008:23): [True: 63.5k, False: 4.80k]
  |  Branch (1008:36): [True: 378, False: 4.43k]
  |  Branch (1008:50): [True: 6, False: 4.42k]
  ------------------
 1009|  63.9k|            --ix;
 1010|       |
 1011|  14.7k|        if ( lexer->lexbuf[ ix ] == '\n' )
  ------------------
  |  Branch (1011:14): [True: 136, False: 14.6k]
  ------------------
 1012|    136|          return node->end - ix - 1; /* #543262 tidy eats all memory */
 1013|  14.7k|    }
 1014|   462k|    return -1;
 1015|   462k|}
pprint.c:TextStartsWithWhitespace:
 1044|   469k|{
 1045|   469k|    assert( node != NULL );
  ------------------
  |  Branch (1045:5): [True: 0, False: 469k]
  |  Branch (1045:5): [True: 469k, False: 0]
  ------------------
 1046|   469k|    if ( (mode & (CDATA|COMMENT)) && TY_(nodeIsTextLike)(node) && node->end > node->start && start >= node->start )
  ------------------
  |  |   23|   246k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   246k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1046:10): [True: 246k, False: 223k]
  |  Branch (1046:38): [True: 41.8k, False: 204k]
  |  Branch (1046:67): [True: 22.3k, False: 19.4k]
  |  Branch (1046:94): [True: 22.3k, False: 0]
  ------------------
 1047|  22.3k|    {
 1048|  22.3k|        uint ch, ix = start;
 1049|       |        /* Skip whitespace. */
 1050|  1.51M|        while ( ix < node->end && (ch = (lexer->lexbuf[ix] & 0xff))
  ------------------
  |  Branch (1050:17): [True: 1.51M, False: 1.50k]
  |  Branch (1050:35): [True: 1.51M, False: 387]
  ------------------
 1051|  1.51M|                && ( ch==' ' || ch=='\t' || ch=='\r' ) )
  ------------------
  |  Branch (1051:22): [True: 1.49M, False: 21.8k]
  |  Branch (1051:33): [True: 1.00k, False: 20.7k]
  |  Branch (1051:45): [True: 327, False: 20.4k]
  ------------------
 1052|  1.49M|            ++ix;
 1053|       |
 1054|  22.3k|        if ( ix > start )
  ------------------
  |  Branch (1054:14): [True: 2.54k, False: 19.8k]
  ------------------
 1055|  2.54k|          return ix - start;
 1056|  22.3k|    }
 1057|   467k|    return -1;
 1058|   469k|}
pprint.c:prvTidynodeIsTextLike:
 1028|   246k|{
 1029|   246k|    if ( TY_(nodeIsText)(node) )
  ------------------
  |  |   23|   246k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   246k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1029:10): [True: 15.4k, False: 230k]
  ------------------
 1030|  15.4k|        return yes;
 1031|   230k|    if ( node->type == AspTag )
  ------------------
  |  Branch (1031:10): [True: 6.89k, False: 223k]
  ------------------
 1032|  6.89k|        return yes;
 1033|   223k|    if (node->type == PhpTag)
  ------------------
  |  Branch (1033:9): [True: 19.4k, False: 204k]
  ------------------
 1034|  19.4k|        return yes; /* Issue #392 */
 1035|       |    /* add other text like nodes... */
 1036|   204k|    return no;
 1037|   223k|}
pprint.c:IncrWS:
 1341|   469k|{
 1342|   469k|  if ( ixWS > 0 )
  ------------------
  |  Branch (1342:8): [True: 2.54k, False: 467k]
  ------------------
 1343|  2.54k|  {
 1344|  2.54k|    uint st = start + MIN( (uint)ixWS, indent );
  ------------------
  |  |   25|  2.54k|#define MIN(a,b) (((a) < (b))?(a):(b))
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 0, False: 2.54k]
  |  |  ------------------
  ------------------
 1345|  2.54k|    start = MIN( st, end );
  ------------------
  |  |   25|  2.54k|#define MIN(a,b) (((a) < (b))?(a):(b))
  |  |  ------------------
  |  |  |  Branch (25:19): [True: 2.54k, False: 0]
  |  |  ------------------
  ------------------
 1346|  2.54k|  }
 1347|   469k|  return start;
 1348|   469k|}
pprint.c:CheckWrapIndent:
  696|   274M|{
  697|   274M|    TidyPrintImpl* pprint = &doc->pprint;
  698|   274M|    if ( GetSpaces(pprint) + pprint->linelen >= cfg(doc, TidyWrapLen) )
  ------------------
  |  |  415|   274M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  |  Branch (698:10): [True: 269M, False: 4.53M]
  ------------------
  699|   269M|    {
  700|   269M|        WrapLine( doc );
  701|   269M|        if ( pprint->indent[ 0 ].spaces < 0 )
  ------------------
  |  Branch (701:14): [True: 30, False: 269M]
  ------------------
  702|     30|        {
  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|     30|            pprint->indent[ 0 ].spaces = indent;
  707|     30|        }
  708|   269M|        return yes;
  709|   269M|    }
  710|  4.53M|    return no;
  711|   274M|}
pprint.c:PPrintChar:
 1138|   294M|{
 1139|   294M|    tmbchar entity[128];
 1140|   294M|    ctmbstr p;
 1141|   294M|    TidyPrintImpl* pprint  = &doc->pprint;
 1142|   294M|    uint outenc = cfg( doc, TidyOutCharEncoding );
  ------------------
  |  |  415|   294M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1143|   294M|    Bool qmark = cfgBool( doc, TidyQuoteMarks );
  ------------------
  |  |  418|   294M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   294M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1144|       |
 1145|   294M|    if ( c == ' ' && !(mode & (PREFORMATTED | COMMENT | ATTRIBVALUE | CDATA)))
  ------------------
  |  Branch (1145:10): [True: 255M, False: 38.8M]
  |  Branch (1145:22): [True: 93.7k, False: 255M]
  ------------------
 1146|  93.7k|    {
 1147|       |        /* coerce a space character to a non-breaking space */
 1148|  93.7k|        if (mode & NOWRAP)
  ------------------
  |  Branch (1148:13): [True: 0, False: 93.7k]
  ------------------
 1149|      0|        {
 1150|      0|            ctmbstr ent = "&nbsp;";
 1151|       |            /* by default XML doesn't define &nbsp; */
 1152|      0|            if ( cfgBool(doc, TidyNumEntities) || cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
                          if ( cfgBool(doc, TidyNumEntities) || cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|      0|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|      0|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 0]
  |  |  ------------------
  ------------------
 1153|      0|                ent = "&#160;";
 1154|      0|            AddString( pprint, ent );
 1155|      0|            return;
 1156|      0|        }
 1157|  93.7k|        else
 1158|  93.7k|            pprint->wraphere = pprint->linelen;
 1159|  93.7k|    }
 1160|       |
 1161|       |    /* comment characters are passed raw */
 1162|   294M|    if ( mode & (COMMENT | CDATA) )
  ------------------
  |  Branch (1162:10): [True: 116M, False: 177M]
  ------------------
 1163|   116M|    {
 1164|   116M|        AddChar( pprint, c );
 1165|   116M|        return;
 1166|   116M|    }
 1167|       |
 1168|       |    /* except in CDATA map < to &lt; etc. */
 1169|   177M|    if ( !(mode & CDATA) )
  ------------------
  |  Branch (1169:10): [True: 177M, False: 0]
  ------------------
 1170|   177M|    {
 1171|   177M|        if ( c == '<')
  ------------------
  |  Branch (1171:14): [True: 457k, False: 177M]
  ------------------
 1172|   457k|        {
 1173|   457k|            AddString( pprint, "&lt;" );
 1174|   457k|            return;
 1175|   457k|        }
 1176|       |            
 1177|   177M|        if ( c == '>')
  ------------------
  |  Branch (1177:14): [True: 160k, False: 177M]
  ------------------
 1178|   160k|        {
 1179|   160k|            AddString( pprint, "&gt;" );
 1180|   160k|            return;
 1181|   160k|        }
 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|   177M|        if ( c == '&' && cfgBool(doc, TidyQuoteAmpersand)
  ------------------
  |  |  418|   177M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   195k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 195k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1188:14): [True: 195k, False: 177M]
  ------------------
 1189|   195k|             && !cfgBool(doc, TidyPreserveEntities)
  ------------------
  |  |  418|   177M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   195k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1189:17): [True: 195k, False: 0]
  ------------------
 1190|   195k|             && ( mode != OtherNamespace) ) /* #130 MathML attr and entity fix! */
  ------------------
  |  Branch (1190:17): [True: 195k, False: 219]
  ------------------
 1191|   195k|        {
 1192|   195k|            AddString( pprint, "&amp;" );
 1193|   195k|            return;
 1194|   195k|        }
 1195|       |
 1196|   177M|        if ( c == '"' && qmark )
  ------------------
  |  Branch (1196:14): [True: 2.83k, False: 177M]
  |  Branch (1196:26): [True: 0, False: 2.83k]
  ------------------
 1197|      0|        {
 1198|      0|            AddString( pprint, "&quot;" );
 1199|      0|            return;
 1200|      0|        }
 1201|       |
 1202|   177M|        if ( c == '\'' && qmark )
  ------------------
  |  Branch (1202:14): [True: 6.40k, False: 177M]
  |  Branch (1202:27): [True: 0, False: 6.40k]
  ------------------
 1203|      0|        {
 1204|      0|            AddString( pprint, "&#39;" );
 1205|      0|            return;
 1206|      0|        }
 1207|       |
 1208|   177M|        if ( c == 160 && outenc != RAW )
  ------------------
  |  |  133|  2.70k|#define RAW         0
  ------------------
  |  Branch (1208:14): [True: 2.70k, False: 177M]
  |  Branch (1208:26): [True: 2.70k, False: 0]
  ------------------
 1209|  2.70k|        {
 1210|  2.70k|            if ( cfgBool(doc, TidyQuoteNbsp) )
  ------------------
  |  |  418|  2.70k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.70k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 2.70k, False: 0]
  |  |  ------------------
  ------------------
 1211|  2.70k|            {
 1212|  2.70k|                if ( cfgBool(doc, TidyNumEntities) ||
  ------------------
  |  |  418|  5.41k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.70k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 2.70k]
  |  |  ------------------
  ------------------
 1213|  2.70k|                     cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  2.70k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.70k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 2.70k]
  |  |  ------------------
  ------------------
 1214|      0|                    AddString( pprint, "&#160;" );
 1215|  2.70k|                else
 1216|  2.70k|                    AddString( pprint, "&nbsp;" );
 1217|  2.70k|            }
 1218|      0|            else
 1219|      0|                AddChar( pprint, c );
 1220|  2.70k|            return;
 1221|  2.70k|        }
 1222|   177M|    }
 1223|       |
 1224|       |    /* Handle encoding-specific issues */
 1225|   177M|    switch ( outenc )
  ------------------
  |  Branch (1225:14): [True: 177M, False: 0]
  ------------------
 1226|   177M|    {
 1227|   177M|    case UTF8:
  ------------------
  |  |  137|   177M|#define UTF8        4
  ------------------
  |  Branch (1227:5): [True: 177M, False: 0]
  ------------------
 1228|   177M|    case UTF16:
  ------------------
  |  |  144|   177M|#define UTF16       11
  ------------------
  |  Branch (1228:5): [True: 0, False: 177M]
  ------------------
 1229|   177M|    case UTF16LE:
  ------------------
  |  |  142|   177M|#define UTF16LE     9
  ------------------
  |  Branch (1229:5): [True: 0, False: 177M]
  ------------------
 1230|   177M|    case UTF16BE:
  ------------------
  |  |  143|   177M|#define UTF16BE     10
  ------------------
  |  Branch (1230:5): [True: 0, False: 177M]
  ------------------
 1231|   177M|        if (!(mode & PREFORMATTED) && cfg(doc, TidyPunctWrap))
  ------------------
  |  |  415|  13.9M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (415:33): [True: 0, False: 13.9M]
  |  |  ------------------
  ------------------
  |  Branch (1231:13): [True: 13.9M, False: 163M]
  ------------------
 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|   177M|        break;
 1240|       |
 1241|      0|    case BIG5:
  ------------------
  |  |  145|      0|#define BIG5        12
  ------------------
  |  Branch (1241:5): [True: 0, False: 177M]
  ------------------
 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: 177M]
  ------------------
 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: 177M]
  ------------------
 1258|      0|#endif
 1259|      0|    case RAW:
  ------------------
  |  |  133|      0|#define RAW         0
  ------------------
  |  Branch (1259:5): [True: 0, False: 177M]
  ------------------
 1260|      0|        AddChar( pprint, c );
 1261|      0|        return;
 1262|   177M|    }
 1263|       |
 1264|       |    /* don't map latin-1 chars to entities */
 1265|   177M|    if ( outenc == LATIN1 )
  ------------------
  |  |  136|   177M|#define LATIN1      3
  ------------------
  |  Branch (1265:10): [True: 0, False: 177M]
  ------------------
 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|   177M|    if ( outenc == UTF8 )
  ------------------
  |  |  137|   177M|#define UTF8        4
  ------------------
  |  Branch (1291:10): [True: 177M, False: 0]
  ------------------
 1292|   177M|    {
 1293|   177M|        AddChar( pprint, c );
 1294|   177M|        return;
 1295|   177M|    }
 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.43M|{
  808|  3.43M|   return pprint->linelen = AddAsciiString( pprint, str, pprint->linelen );
  809|  3.43M|}
pprint.c:AddAsciiString:
  792|  3.43M|{
  793|  3.43M|    uint ix, len = TY_(tmbstrlen)( str );
  ------------------
  |  |   23|  3.43M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.43M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  794|  3.43M|    if ( string_index + len >= pprint->lbufsize )
  ------------------
  |  Branch (794:10): [True: 21.5k, False: 3.41M]
  ------------------
  795|  21.5k|        expand( pprint, string_index + len );
  796|       |
  797|  13.5M|    for ( ix=0; ix<len; ++ix )
  ------------------
  |  Branch (797:17): [True: 10.0M, False: 3.43M]
  ------------------
  798|  10.0M|        pprint->linebuf[string_index + ix] = str[ ix ];
  799|  3.43M|    return string_index + len;
  800|  3.43M|}
pprint.c:expand:
  314|  26.9k|{
  315|  26.9k|    uint* ip;
  316|  26.9k|    uint buflen = pprint->lbufsize;
  317|       |
  318|  26.9k|    if ( buflen == 0 )
  ------------------
  |  Branch (318:10): [True: 20.6k, False: 6.32k]
  ------------------
  319|  20.6k|        buflen = 256;
  320|  33.3k|    while ( len >= buflen )
  ------------------
  |  Branch (320:13): [True: 6.46k, False: 26.9k]
  ------------------
  321|  6.46k|        buflen *= 2;
  322|       |
  323|  26.9k|    ip = (uint*) TidyRealloc( pprint->allocator, pprint->linebuf, buflen*sizeof(uint) );
  ------------------
  |  |   67|  26.9k|#define TidyRealloc(allocator, block, size) ((allocator)->vtbl->realloc((allocator), (block), (size)))
  ------------------
  324|  26.9k|    if ( ip )
  ------------------
  |  Branch (324:10): [True: 26.9k, False: 0]
  ------------------
  325|  26.9k|    {
  326|  26.9k|      TidyClearMemory( ip+pprint->lbufsize, 
  ------------------
  |  |   70|  26.9k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  327|  26.9k|                       (buflen-pprint->lbufsize)*sizeof(uint) );
  328|  26.9k|      pprint->lbufsize = buflen;
  329|  26.9k|      pprint->linebuf = ip;
  330|  26.9k|    }
  331|  26.9k|}
pprint.c:AddChar:
  782|   319M|{
  783|   319M|    AddC( pprint, c, pprint->linelen );
  784|   319M|    return ++pprint->linelen;
  785|   319M|}
pprint.c:AddC:
  771|   319M|{
  772|   319M|    if ( string_index + 1 >= pprint->lbufsize )
  ------------------
  |  Branch (772:10): [True: 5.41k, False: 319M]
  ------------------
  773|  5.41k|        expand( pprint, string_index + 1 );
  774|   319M|    pprint->linebuf[string_index] = c;
  775|   319M|}
pprint.c:PPrintComment:
 1859|  87.5k|{
 1860|  87.5k|    TidyPrintImpl* pprint = &doc->pprint;
 1861|       |
 1862|  87.5k|    SetWrap( doc, indent );
 1863|  87.5k|    AddString( pprint, "<!--" );
 1864|       |
 1865|  87.5k|    PPrintText(doc, COMMENT, 0, node);
 1866|       |
 1867|  87.5k|    AddString(pprint, "--");
 1868|  87.5k|    AddChar( pprint, '>' );
 1869|  87.5k|    if ( node->linebreak && node->next )
  ------------------
  |  Branch (1869:10): [True: 1.90k, False: 85.6k]
  |  Branch (1869:29): [True: 1.82k, False: 81]
  ------------------
 1870|  1.82k|        PFlushLineSmart( doc, indent );
 1871|  87.5k|}
pprint.c:SetWrap:
  541|   774k|{
  542|   774k|    TidyPrintImpl* pprint = &doc->pprint;
  543|   774k|    Bool wrap = ( indent + pprint->linelen < cfg(doc, TidyWrapLen) );
  ------------------
  |  |  415|   774k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  544|   774k|    if ( wrap )
  ------------------
  |  Branch (544:10): [True: 619k, False: 154k]
  ------------------
  545|   619k|    {
  546|   619k|        if ( pprint->indent[0].spaces < 0 )
  ------------------
  |  Branch (546:14): [True: 20.5k, False: 598k]
  ------------------
  547|  20.5k|            pprint->indent[0].spaces = indent;
  548|   619k|        pprint->wraphere = pprint->linelen;
  549|   619k|    }
  550|   154k|    else if ( pprint->ixInd == 0 )
  ------------------
  |  Branch (550:15): [True: 6.00k, False: 148k]
  ------------------
  551|  6.00k|    {
  552|       |        /* Save indent 1st time we pass the the wrap line */
  553|  6.00k|        pprint->indent[ 1 ].spaces = indent;
  554|  6.00k|        pprint->ixInd = 1;
  555|  6.00k|    }
  556|   774k|    return wrap;
  557|   774k|}
pprint.c:PPrintDocType:
 1878|  32.0k|{
 1879|  32.0k|    TidyPrintImpl* pprint = &doc->pprint;
 1880|  32.0k|    uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  32.0k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1881|  32.0k|    uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|  32.0k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1882|  32.0k|    AttVal* fpi = TY_(GetAttrByName)(node, "PUBLIC");
  ------------------
  |  |   23|  32.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1883|  32.0k|    AttVal* sys = TY_(GetAttrByName)(node, "SYSTEM");
  ------------------
  |  |   23|  32.0k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  32.0k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1884|       |
 1885|       |    /* todo: handle non-ASCII characters in FPI / SI / node->element */
 1886|       |
 1887|  32.0k|    SetWrap( doc, indent );
 1888|  32.0k|    PCondFlushLineSmart( doc, indent );
 1889|       |
 1890|  32.0k|    AddString( pprint, "<!DOCTYPE " );
 1891|  32.0k|    SetWrap( doc, indent );
 1892|  32.0k|    if (node->element)
  ------------------
  |  Branch (1892:9): [True: 32.0k, False: 0]
  ------------------
 1893|  32.0k|    {
 1894|  32.0k|        AddString(pprint, node->element);
 1895|  32.0k|    }
 1896|       |
 1897|  32.0k|    if (fpi && fpi->value)
  ------------------
  |  Branch (1897:9): [True: 9.59k, False: 22.4k]
  |  Branch (1897:16): [True: 5.71k, False: 3.88k]
  ------------------
 1898|  5.71k|    {
 1899|  5.71k|        AddString(pprint, " PUBLIC ");
 1900|  5.71k|        AddChar(pprint, fpi->delim);
 1901|  5.71k|        AddString(pprint, fpi->value);
 1902|  5.71k|        AddChar(pprint, fpi->delim);
 1903|  5.71k|    }
 1904|       |
 1905|  32.0k|    if (fpi && fpi->value && sys && sys->value)
  ------------------
  |  Branch (1905:9): [True: 9.59k, False: 22.4k]
  |  Branch (1905:16): [True: 5.71k, False: 3.88k]
  |  Branch (1905:30): [True: 1.69k, False: 4.02k]
  |  Branch (1905:37): [True: 1.66k, False: 34]
  ------------------
 1906|  1.66k|    {
 1907|  1.66k|        uint i = pprint->linelen - (TY_(tmbstrlen)(sys->value) + 2) - 1;
  ------------------
  |  |   23|  1.66k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.66k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1908|  1.66k|        if (!(i>0&&TY_(tmbstrlen)(sys->value)+2+i<wraplen&&i<=(spaces?spaces:2)*2))
  ------------------
  |  |   23|  1.63k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.63k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1908:15): [True: 1.63k, False: 27]
  |  Branch (1908:20): [True: 1.61k, False: 20]
  |  Branch (1908:60): [True: 290, False: 1.32k]
  |  Branch (1908:64): [True: 0, False: 1.61k]
  ------------------
 1909|  1.37k|            i = 0;
 1910|       |
 1911|  1.66k|        PCondFlushLineSmart(doc, i);
 1912|  1.66k|        if (pprint->linelen)
  ------------------
  |  Branch (1912:13): [True: 0, False: 1.66k]
  ------------------
 1913|      0|            AddChar(pprint, ' ');
 1914|  1.66k|    }
 1915|  30.4k|    else if (sys && sys->value)
  ------------------
  |  Branch (1915:14): [True: 3.56k, False: 26.8k]
  |  Branch (1915:21): [True: 3.23k, False: 328]
  ------------------
 1916|  3.23k|    {
 1917|  3.23k|        AddString(pprint, " SYSTEM ");
 1918|  3.23k|    }
 1919|       |
 1920|  32.0k|    if (sys && sys->value)
  ------------------
  |  Branch (1920:9): [True: 5.22k, False: 26.8k]
  |  Branch (1920:16): [True: 4.90k, False: 328]
  ------------------
 1921|  4.90k|    {
 1922|  4.90k|        AddChar(pprint, sys->delim);
 1923|  4.90k|        AddString(pprint, sys->value);
 1924|  4.90k|        AddChar(pprint, sys->delim);
 1925|  4.90k|    }
 1926|       |
 1927|  32.0k|    if (node->content)
  ------------------
  |  Branch (1927:9): [True: 520, False: 31.5k]
  ------------------
 1928|    520|    {
 1929|    520|        PCondFlushLineSmart(doc, indent);
 1930|    520|        AddChar(pprint, '[');
 1931|    520|        PPrintText(doc, CDATA, 0, node->content);
 1932|    520|        AddChar(pprint, ']');
 1933|    520|    }
 1934|       |
 1935|  32.0k|    SetWrap( doc, 0 );
 1936|  32.0k|    AddChar( pprint, '>' );
 1937|  32.0k|    PCondFlushLineSmart( doc, indent );
 1938|  32.0k|}
pprint.c:PPrintPI:
 1945|  92.4k|{
 1946|  92.4k|    TidyPrintImpl* pprint = &doc->pprint;
 1947|  92.4k|    tchar c;
 1948|  92.4k|    tmbstr s;
 1949|       |
 1950|  92.4k|    SetWrap( doc, indent );
 1951|  92.4k|    AddString( pprint, "<?" );
 1952|       |
 1953|  92.4k|    s = node->element;
 1954|       |
 1955|   161k|    while (s && *s)
  ------------------
  |  Branch (1955:12): [True: 74.5k, False: 86.6k]
  |  Branch (1955:17): [True: 68.8k, False: 5.71k]
  ------------------
 1956|  68.8k|    {
 1957|  68.8k|        c = (unsigned char)*s;
 1958|  68.8k|        if (c > 0x7F)
  ------------------
  |  Branch (1958:13): [True: 6.88k, False: 61.9k]
  ------------------
 1959|  6.88k|            s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|  6.88k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.88k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1960|  68.8k|        AddChar(pprint, c);
 1961|  68.8k|        ++s;
 1962|  68.8k|    }
 1963|       |
 1964|       |    /* set CDATA to pass < and > unescaped */
 1965|  92.4k|    PPrintText( doc, CDATA, indent, node );
 1966|       |
 1967|  92.4k|    if (cfgBool(doc, TidyXmlOut) ||
  ------------------
  |  |  418|   184k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  92.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 92.4k, False: 0]
  |  |  ------------------
  ------------------
 1968|      0|        cfgBool(doc, TidyXhtmlOut) || node->closed)
  ------------------
  |  |  418|  92.4k|#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|  92.4k|        AddChar( pprint, '?' );
 1970|       |
 1971|  92.4k|    AddChar( pprint, '>' );
 1972|  92.4k|    PCondFlushLine( doc, indent );
 1973|  92.4k|}
pprint.c:PCondFlushLine:
  873|  92.4k|{
  874|  92.4k|    TidyPrintImpl* pprint = &doc->pprint;
  875|       |
  876|  92.4k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (876:10): [True: 92.4k, False: 0]
  ------------------
  877|  92.4k|    {
  878|  92.4k|         PFlushLineImpl( doc );
  879|       |
  880|  92.4k|         TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|  92.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  92.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  881|  92.4k|         pprint->line++;
  882|  92.4k|    }
  883|       |
  884|       |    /* Issue #390 - Whether chars to flush or not, set new indent */
  885|  92.4k|    if ( pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (885:10): [True: 0, False: 92.4k]
  ------------------
  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|  92.4k|}
pprint.c:PPrintXmlDecl:
 1980|  2.75k|{
 1981|  2.75k|    AttVal* att;
 1982|  2.75k|    uint saveWrap;
 1983|  2.75k|    TidyPrintImpl* pprint = &doc->pprint;
 1984|  2.75k|    Bool ucAttrs;
 1985|  2.75k|    SetWrap( doc, indent );
 1986|  2.75k|    saveWrap = WrapOff( doc );
 1987|       |
 1988|       |    /* no case translation for XML declaration pseudo attributes */
 1989|  2.75k|    ucAttrs = cfg(doc, TidyUpperCaseAttrs);
  ------------------
  |  |  415|  2.75k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1990|  2.75k|    TY_(SetOptionInt)(doc, TidyUpperCaseAttrs, no);
  ------------------
  |  |   23|  2.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1991|       |
 1992|  2.75k|    AddString( pprint, "<?xml" );
 1993|       |
 1994|       |    /* Force order of XML declaration attributes */
 1995|       |    /* PPrintAttrs( doc, indent, node ); */
 1996|  2.75k|    if ( NULL != (att = TY_(AttrGetById)(node, TidyAttr_VERSION)) )
  ------------------
  |  |   23|  2.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1996:10): [True: 15, False: 2.73k]
  ------------------
 1997|     15|      PPrintAttribute( doc, indent, node, att );
 1998|  2.75k|    if ( NULL != (att = TY_(AttrGetById)(node, TidyAttr_ENCODING)) )
  ------------------
  |  |   23|  2.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1998:10): [True: 12, False: 2.73k]
  ------------------
 1999|     12|      PPrintAttribute( doc, indent, node, att );
 2000|  2.75k|    if ( NULL != (att = TY_(GetAttrByName)(node, "standalone")) )
  ------------------
  |  |   23|  2.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2000:10): [True: 0, False: 2.75k]
  ------------------
 2001|      0|      PPrintAttribute( doc, indent, node, att );
 2002|       |
 2003|       |    /* restore old config value */
 2004|  2.75k|    TY_(SetOptionInt)(doc, TidyUpperCaseAttrs, ucAttrs);
  ------------------
  |  |   23|  2.75k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.75k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2005|       |
 2006|  2.75k|    if ( node->end <= 0 || doc->lexer->lexbuf[node->end - 1] != '?' )
  ------------------
  |  Branch (2006:10): [True: 78, False: 2.67k]
  |  Branch (2006:28): [True: 1.91k, False: 755]
  ------------------
 2007|  1.99k|        AddChar( pprint, '?' );
 2008|  2.75k|    AddChar( pprint, '>' );
 2009|  2.75k|    WrapOn( doc, saveWrap );
 2010|  2.75k|    PFlushLineSmart( doc, indent );
 2011|  2.75k|}
pprint.c:WrapOff:
  508|  9.31k|{
  509|  9.31k|    uint saveWrap = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  9.31k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  510|  9.31k|    TY_(SetOptionInt)( doc, TidyWrapLen, 0xFFFFFFFF );  /* very large number */
  ------------------
  |  |   23|  9.31k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.31k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  511|  9.31k|    return saveWrap;
  512|  9.31k|}
pprint.c:PPrintAttribute:
 1546|   374k|{
 1547|   374k|    TidyPrintImpl* pprint = &doc->pprint;
 1548|   374k|    Bool xmlOut    = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|   374k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   374k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1549|   374k|    Bool xhtmlOut  = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|   374k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   374k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1550|   374k|    Bool wrapAttrs = cfgBool( doc, TidyWrapAttVals );
  ------------------
  |  |  418|   374k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   374k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1551|   374k|    uint ucAttrs   = cfg( doc, TidyUpperCaseAttrs );
  ------------------
  |  |  415|   374k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1552|   374k|    Bool indAttrs  = cfgBool( doc, TidyIndentAttributes );
  ------------------
  |  |  418|   374k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   374k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1553|   374k|    uint xtra      = AttrIndent( doc, node, attr );
 1554|   374k|    Bool first     = (attr == node->attributes);
 1555|   374k|    tmbstr name    = attr->attribute;
 1556|   374k|    Bool wrappable = no;
 1557|   374k|    tchar c;
 1558|       |
 1559|       |    /* fix for odd attribute indentation bug triggered by long values */
 1560|   374k|    if (!indAttrs)
  ------------------
  |  Branch (1560:9): [True: 374k, False: 0]
  ------------------
 1561|   374k|      xtra = 0;
 1562|       |
 1563|   374k|    if ( indAttrs )
  ------------------
  |  Branch (1563:10): [True: 0, False: 374k]
  ------------------
 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|   374k|    CheckWrapIndent( doc, indent );
 1573|       |
 1574|   374k|    if ( !xmlOut && !xhtmlOut && attr->dict )
  ------------------
  |  Branch (1574:10): [True: 0, False: 374k]
  |  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|   374k|    if ( !first && !SetWrap(doc, indent) )
  ------------------
  |  Branch (1582:10): [True: 120k, False: 254k]
  |  Branch (1582:20): [True: 1.88k, False: 118k]
  ------------------
 1583|  1.88k|    {
 1584|  1.88k|        TY_(PFlushLine)( doc, indent+xtra );  /* Put it on next line */
  ------------------
  |  |   23|  1.88k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.88k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1585|  1.88k|    }
 1586|   373k|    else if ( pprint->linelen > 0 )
  ------------------
  |  Branch (1586:15): [True: 373k, False: 0]
  ------------------
 1587|   373k|    {
 1588|   373k|        AddChar( pprint, ' ' );
 1589|   373k|    }
 1590|       |
 1591|       |    /* Attribute name */
 1592|  1.99M|    while (*name)
  ------------------
  |  Branch (1592:12): [True: 1.62M, False: 374k]
  ------------------
 1593|  1.62M|    {
 1594|  1.62M|        c = (unsigned char)*name;
 1595|       |
 1596|  1.62M|        if (c > 0x7F)
  ------------------
  |  Branch (1596:13): [True: 0, False: 1.62M]
  ------------------
 1597|      0|            name += TY_(GetUTF8)(name, &c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1598|  1.62M|        else if (ucAttrs == TidyUppercaseYes)
  ------------------
  |  Branch (1598:18): [True: 0, False: 1.62M]
  ------------------
 1599|      0|            c = TY_(ToUpper)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1600|       |
 1601|  1.62M|        AddChar(pprint, c);
 1602|  1.62M|        ++name;
 1603|  1.62M|    }
 1604|       |
 1605|   374k|    CheckWrapIndent( doc, indent );
 1606|       | 
 1607|   374k|    if ( attr->value == NULL )
  ------------------
  |  Branch (1607:10): [True: 144k, False: 230k]
  ------------------
 1608|   144k|    {
 1609|   144k|        Bool isB = TY_(IsBoolAttribute)(attr);
  ------------------
  |  |   23|   144k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   144k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1610|   144k|        Bool scriptAttr = TY_(attrIsEvent)(attr);
  ------------------
  |  |   23|   144k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   144k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1611|       |
 1612|   144k|        if ( xmlOut )
  ------------------
  |  Branch (1612:14): [True: 144k, False: 0]
  ------------------
 1613|   144k|            PPrintAttrValue( doc, indent, isB ? attr->attribute : NULLSTR,
  ------------------
  |  |  625|   288k|#  define NULLSTR (tmbstr)""
  ------------------
  |  Branch (1613:43): [True: 750, False: 143k]
  ------------------
 1614|   144k|                             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|   144k|    }
 1622|   230k|    else
 1623|   230k|        PPrintAttrValue( doc, indent, attr->value, attr->delim, wrappable, no );
 1624|   374k|}
pprint.c:AttrIndent:
 1525|   374k|{
 1526|   374k|  uint spaces = cfg( doc, TidyIndentSpaces );
  ------------------
  |  |  415|   374k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1527|   374k|  uint xtra = 2;  /* 1 for the '<', another for the ' ' */
 1528|   374k|  if ( node->element == NULL )
  ------------------
  |  Branch (1528:8): [True: 27, False: 374k]
  ------------------
 1529|     27|    return spaces;
 1530|       |
 1531|   374k|  if ( !TY_(nodeHasCM)(node, CM_INLINE) ||
  ------------------
  |  |   23|   374k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   374k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                if ( !TY_(nodeHasCM)(node, CM_INLINE) ||
  ------------------
  |  |  143|   374k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1531:8): [True: 102k, False: 272k]
  ------------------
 1532|   272k|       !ShouldIndent(doc, node->parent ? node->parent: node) )
  ------------------
  |  Branch (1532:8): [True: 272k, False: 0]
  |  Branch (1532:27): [True: 272k, False: 0]
  ------------------
 1533|   374k|    return xtra + TY_(tmbstrlen)( node->element );
  ------------------
  |  |   23|   374k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   374k|#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|   374k|{
 1414|   374k|    TidyPrintImpl* pprint = &doc->pprint;
 1415|   374k|    Bool scriptlets = cfgBool(doc, TidyWrapScriptlets);
  ------------------
  |  |  418|   374k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   374k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1416|       |
 1417|   374k|    uint mode = PREFORMATTED | ATTRIBVALUE;
 1418|   374k|    if ( wrappable )
  ------------------
  |  Branch (1418:10): [True: 0, False: 374k]
  ------------------
 1419|      0|        mode = NORMAL | ATTRIBVALUE;
 1420|       |
 1421|       |    /* look for ASP, Tango or PHP instructions for computed attribute value */
 1422|   374k|    if ( value && value[0] == '<' )
  ------------------
  |  Branch (1422:10): [True: 374k, False: 0]
  |  Branch (1422:19): [True: 7.30k, False: 367k]
  ------------------
 1423|  7.30k|    {
 1424|  7.30k|        if ( value[1] == '%' || value[1] == '@'||
  ------------------
  |  Branch (1424:14): [True: 1.77k, False: 5.53k]
  |  Branch (1424:33): [True: 316, False: 5.22k]
  ------------------
 1425|  5.22k|             TY_(tmbstrncmp)(value, "<?php", 5) == 0 )
  ------------------
  |  |   23|  5.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1425:14): [True: 2.54k, False: 2.67k]
  ------------------
 1426|  4.63k|            mode |= CDATA;
 1427|  7.30k|    }
 1428|       |
 1429|   374k|    if ( delim == 0 )
  ------------------
  |  Branch (1429:10): [True: 15, False: 374k]
  ------------------
 1430|     15|        delim = '"';
 1431|       |
 1432|   374k|    AddChar( pprint, '=' );
 1433|       |
 1434|       |    /* don't wrap after "=" for xml documents */
 1435|   374k|    if ( !cfgBool(doc, TidyXmlOut) || cfgBool(doc, TidyXhtmlOut) )
  ------------------
  |  |  418|   749k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   374k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
                  if ( !cfgBool(doc, TidyXmlOut) || cfgBool(doc, TidyXhtmlOut) )
  ------------------
  |  |  418|   374k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   374k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 374k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (1435:10): [True: 0, False: 374k]
  ------------------
 1436|   374k|    {
 1437|   374k|        SetWrap( doc, indent );
 1438|   374k|        CheckWrapIndent( doc, indent );
 1439|       |        /*
 1440|       |        if ( !SetWrap(doc, indent) )
 1441|       |            PCondFlushLine( doc, indent );
 1442|       |        */
 1443|   374k|    }
 1444|       |
 1445|   374k|    AddChar( pprint, delim );
 1446|       |
 1447|   374k|    if ( value )
  ------------------
  |  Branch (1447:10): [True: 374k, False: 0]
  ------------------
 1448|   374k|    {
 1449|   374k|        uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|   374k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1450|   374k|        int attrStart = SetInAttrVal( pprint );
 1451|   374k|        int strStart = ClearInString( pprint );
 1452|       |
 1453|  23.5M|        while (*value != '\0')
  ------------------
  |  Branch (1453:16): [True: 23.2M, False: 374k]
  ------------------
 1454|  23.2M|        {
 1455|  23.2M|            uint c = *value;
 1456|       |
 1457|  23.2M|            if ( wrappable && c == ' ' )
  ------------------
  |  Branch (1457:18): [True: 0, False: 23.2M]
  |  Branch (1457:31): [True: 0, False: 0]
  ------------------
 1458|      0|                SetWrapAttr( doc, indent, attrStart, strStart );
 1459|       |
 1460|  23.2M|            if ( wrappable && pprint->wraphere > 0 &&
  ------------------
  |  Branch (1460:18): [True: 0, False: 23.2M]
  |  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|  23.2M|            if ( c == delim )
  ------------------
  |  Branch (1464:18): [True: 5.19k, False: 23.2M]
  ------------------
 1465|  5.19k|            {
 1466|  5.19k|                ctmbstr entity = (c == '"' ? "&quot;" : "&#39;");
  ------------------
  |  Branch (1466:35): [True: 4.97k, False: 223]
  ------------------
 1467|  5.19k|                AddString( pprint, entity );
 1468|  5.19k|                ++value;
 1469|  5.19k|                continue;
 1470|  5.19k|            }
 1471|  23.2M|            else if (c == '"')
  ------------------
  |  Branch (1471:22): [True: 1.64k, False: 23.2M]
  ------------------
 1472|  1.64k|            {
 1473|  1.64k|                if ( cfgBool(doc, TidyQuoteMarks) )
  ------------------
  |  |  418|  1.64k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.64k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 1.64k]
  |  |  ------------------
  ------------------
 1474|      0|                    AddString( pprint, "&quot;" );
 1475|  1.64k|                else
 1476|  1.64k|                    AddChar( pprint, c );
 1477|       |
 1478|  1.64k|                if ( delim == '\'' && scriptAttr && scriptlets )
  ------------------
  |  Branch (1478:22): [True: 1.64k, False: 0]
  |  Branch (1478:39): [True: 0, False: 1.64k]
  |  Branch (1478:53): [True: 0, False: 0]
  ------------------
 1479|      0|                    strStart = ToggleInString( pprint );
 1480|       |
 1481|  1.64k|                ++value;
 1482|  1.64k|                continue;
 1483|  1.64k|            }
 1484|  23.2M|            else if ( c == '\'' )
  ------------------
  |  Branch (1484:23): [True: 11.2k, False: 23.2M]
  ------------------
 1485|  11.2k|            {
 1486|  11.2k|                if ( cfgBool(doc, TidyQuoteMarks) )
  ------------------
  |  |  418|  11.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  11.2k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 11.2k]
  |  |  ------------------
  ------------------
 1487|      0|                    AddString( pprint, "&#39;" );
 1488|  11.2k|                else
 1489|  11.2k|                    AddChar( pprint, c );
 1490|       |
 1491|  11.2k|                if ( delim == '"' && scriptAttr && scriptlets )
  ------------------
  |  Branch (1491:22): [True: 11.2k, False: 0]
  |  Branch (1491:38): [True: 0, False: 11.2k]
  |  Branch (1491:52): [True: 0, False: 0]
  ------------------
 1492|      0|                    strStart = ToggleInString( pprint );
 1493|       |
 1494|  11.2k|                ++value;
 1495|  11.2k|                continue;
 1496|  11.2k|            }
 1497|       |
 1498|       |            /* look for UTF-8 multibyte character */
 1499|  23.2M|            if ( c > 0x7F )
  ------------------
  |  Branch (1499:18): [True: 733k, False: 22.4M]
  ------------------
 1500|   733k|                 value += TY_(GetUTF8)( value, &c );
  ------------------
  |  |   23|   733k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   733k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1501|  23.2M|            ++value;
 1502|       |
 1503|  23.2M|            if ( c == '\n' )
  ------------------
  |  Branch (1503:18): [True: 1.57k, False: 23.1M]
  ------------------
 1504|  1.57k|            {
 1505|       |                /* No indent inside Javascript literals */
 1506|  1.57k|                TY_(PFlushLine)( doc, (strStart < 0
  ------------------
  |  |   23|  1.57k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.57k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1506:40): [True: 1.57k, False: 0]
  ------------------
 1507|  1.57k|                                       && !cfgBool(doc, TidyLiteralAttribs) ?
  ------------------
  |  |  418|  1.57k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.57k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1507:43): [True: 1.57k, False: 0]
  ------------------
 1508|  1.57k|                                       indent : 0) );
 1509|  1.57k|                continue;
 1510|  1.57k|            }
 1511|  23.1M|            PPrintChar( doc, c, mode );
 1512|  23.1M|        }
 1513|   374k|        ClearInAttrVal( pprint );
 1514|   374k|        ClearInString( pprint );
 1515|   374k|    }
 1516|   374k|    AddChar( pprint, delim );
 1517|   374k|}
pprint.c:SetInAttrVal:
  419|   374k|{
  420|   374k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  421|   374k|    return ind->attrValStart = (int) pprint->linelen;
  422|   374k|}
pprint.c:ClearInString:
  355|   749k|{
  356|   749k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  357|   749k|    return ind->attrStringStart = -1;
  358|   749k|}
pprint.c:ClearInAttrVal:
  406|   374k|{
  407|   374k|    TidyIndent *ind = pprint->indent + pprint->ixInd;
  408|   374k|    ind->attrValStart = -1;
  409|   374k|}
pprint.c:WrapOn:
  520|  35.6k|{
  521|  35.6k|    TY_(SetOptionInt)( doc, TidyWrapLen, saveWrap );
  ------------------
  |  |   23|  35.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  35.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  522|  35.6k|}
pprint.c:PPrintCDATA:
 2080|  1.81k|{
 2081|  1.81k|    uint saveWrap;
 2082|  1.81k|    TidyPrintImpl* pprint = &doc->pprint;
 2083|  1.81k|    Bool indentCData = cfgBool( doc, TidyIndentCdata );
  ------------------
  |  |  418|  1.81k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.81k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2084|  1.81k|    if ( !indentCData )
  ------------------
  |  Branch (2084:10): [True: 1.81k, False: 0]
  ------------------
 2085|  1.81k|        indent = 0;
 2086|       |
 2087|  1.81k|    PCondFlushLineSmart( doc, indent );
 2088|  1.81k|    saveWrap = WrapOff( doc );        /* disable wrapping */
 2089|       |
 2090|  1.81k|    AddString( pprint, "<![CDATA[" );
 2091|  1.81k|    PPrintText( doc, COMMENT, indent, node );
 2092|  1.81k|    AddString( pprint, "]]>" );
 2093|       |
 2094|  1.81k|    PCondFlushLineSmart( doc, indent );
 2095|  1.81k|    WrapOn( doc, saveWrap );          /* restore wrapping */
 2096|  1.81k|}
pprint.c:PPrintSection:
 2103|  16.8k|{
 2104|  16.8k|    TidyPrintImpl* pprint = &doc->pprint;
 2105|  16.8k|    Bool wrapSect = cfgBool( doc, TidyWrapSection );
  ------------------
  |  |  418|  16.8k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  16.8k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2106|  16.8k|    uint saveWrap = WrapOffCond( doc, !wrapSect  );
 2107|       |
 2108|  16.8k|    AddString( pprint, "<![" );
 2109|  16.8k|    PPrintText( doc, (wrapSect ? CDATA : COMMENT),
  ------------------
  |  Branch (2109:23): [True: 16.8k, False: 0]
  ------------------
 2110|  16.8k|                indent, node );
 2111|  16.8k|    AddString( pprint, "]>" );
 2112|       |
 2113|       |    /* PCondFlushLine( doc, indent ); */
 2114|  16.8k|    WrapOn( doc, saveWrap );
 2115|  16.8k|}
pprint.c:WrapOffCond:
  529|  26.3k|{
  530|  26.3k|    if ( onoff )
  ------------------
  |  Branch (530:10): [True: 0, False: 26.3k]
  ------------------
  531|      0|        return WrapOff( doc );
  532|  26.3k|    return cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  26.3k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  533|  26.3k|}
pprint.c:PPrintAsp:
 2019|  5.58k|{
 2020|  5.58k|    TidyPrintImpl* pprint = &doc->pprint;
 2021|  5.58k|    Bool wrapAsp  = cfgBool( doc, TidyWrapAsp );
  ------------------
  |  |  418|  5.58k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.58k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2022|  5.58k|    Bool wrapJste = cfgBool( doc, TidyWrapJste );
  ------------------
  |  |  418|  5.58k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.58k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2023|  5.58k|    uint saveWrap = WrapOffCond( doc, !wrapAsp || !wrapJste );
  ------------------
  |  Branch (2023:39): [True: 0, False: 5.58k]
  |  Branch (2023:51): [True: 0, False: 5.58k]
  ------------------
 2024|       |
 2025|  5.58k|    AddString( pprint, "<%" );
 2026|  5.58k|    PPrintText( doc, (wrapAsp ? CDATA : COMMENT), indent, node );
  ------------------
  |  Branch (2026:23): [True: 5.58k, False: 0]
  ------------------
 2027|  5.58k|    AddString( pprint, "%>" );
 2028|       |
 2029|       |    /* PCondFlushLine( doc, indent ); */
 2030|  5.58k|    WrapOn( doc, saveWrap );
 2031|  5.58k|}
pprint.c:PPrintJste:
 2039|  3.89k|{
 2040|  3.89k|    TidyPrintImpl* pprint = &doc->pprint;
 2041|  3.89k|    Bool wrapAsp = cfgBool( doc, TidyWrapAsp );
  ------------------
  |  |  418|  3.89k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.89k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2042|  3.89k|    uint saveWrap = WrapOffCond( doc, !wrapAsp  );
 2043|       |
 2044|  3.89k|    AddString( pprint, "<#" );
 2045|  3.89k|    PPrintText( doc, (cfgBool(doc, TidyWrapJste) ? CDATA : COMMENT),
  ------------------
  |  |  418|  3.89k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.89k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 3.89k, False: 0]
  |  |  ------------------
  ------------------
 2046|  3.89k|                indent, node );
 2047|  3.89k|    AddString( pprint, "#>" );
 2048|       |
 2049|       |    /* PCondFlushLine( doc, indent ); */
 2050|  3.89k|    WrapOn( doc, saveWrap );
 2051|  3.89k|}
pprint.c:PPrintPhp:
 2059|  18.5k|{
 2060|  18.5k|    TidyPrintImpl* pprint = &doc->pprint;
 2061|  18.5k|    Bool wrapPhp = cfgBool( doc, TidyWrapPhp );
  ------------------
  |  |  418|  18.5k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  18.5k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2062|       |    /* uint saveWrap = WrapOffCond( doc, !wrapPhp  ); */
 2063|       |
 2064|  18.5k|    AddString( pprint, "<?" );
 2065|  18.5k|    PPrintText( doc, CDATA, indent, node );
 2066|  18.5k|    AddString( pprint, "?>" );
 2067|       |
 2068|       |    /* Issue #437 - add a new line if 'wrap-php' is on */
 2069|  18.5k|    if (wrapPhp)
  ------------------
  |  Branch (2069:9): [True: 0, False: 18.5k]
  ------------------
 2070|      0|        PCondFlushLine( doc, indent ); 
 2071|       |       
 2072|       |    /* WrapOn( doc, saveWrap ); */
 2073|  18.5k|}
pprint.c:PPrintMathML:
 2239|    264|{
 2240|    264|    Node *content;
 2241|    264|    uint mode = OtherNamespace;
 2242|       |
 2243|    264|    PPrintTag( doc, mode, indent, node );
 2244|       |
 2245|    743|    for ( content = node->content; content; content = content->next )
  ------------------
  |  Branch (2245:36): [True: 479, False: 264]
  ------------------
 2246|    479|           TY_(PPrintTree)( doc, mode, indent, content );
  ------------------
  |  |   23|    479|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    479|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2247|       |
 2248|    264|    PPrintEndTag( doc, mode, indent, node );
 2249|    264|}
pprint.c:PCondFlushLineSmart:
  930|   698k|{
  931|   698k|    TidyPrintImpl* pprint = &doc->pprint;
  932|       |
  933|   698k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (933:10): [True: 272k, False: 426k]
  ------------------
  934|   272k|    {
  935|   272k|         PFlushLineImpl( doc );
  936|       |
  937|       |         /* Issue #228 - cfgBool( doc, TidyVertSpace ); */
  938|   272k|         if(TidyAddVS) {
  ------------------
  |  |   52|   272k|#define TidyAddVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyAutoState) ? no : yes )
  |  |  ------------------
  |  |  |  |  421|   272k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|   272k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (52:19): [True: 272k, False: 0]
  |  |  |  Branch (52:20): [True: 0, False: 272k]
  |  |  ------------------
  ------------------
  939|   272k|            TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|   272k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   272k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  940|   272k|            pprint->line++;
  941|   272k|         }
  942|   272k|    }
  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|   698k|    if (pprint->indent[ 0 ].spaces != (int)indent)
  ------------------
  |  Branch (949:9): [True: 628, False: 697k]
  ------------------
  950|    628|    {
  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|    628|        pprint->indent[ 0 ].spaces = indent;
  955|    628|    }
  956|   698k|}
pprint.c:PFlushLineSmart:
  901|   512k|{
  902|   512k|    TidyPrintImpl* pprint = &doc->pprint;
  903|       |
  904|   512k|    if ( pprint->linelen > 0 )
  ------------------
  |  Branch (904:10): [True: 511k, False: 1.45k]
  ------------------
  905|   511k|        PFlushLineImpl( doc );
  906|       |
  907|       |    /* Issue #228 - cfgBool( doc, TidyVertSpace ); */
  908|   512k|    if(TidyAddVS) {
  ------------------
  |  |   52|   512k|#define TidyAddVS ((cfgAutoBool( doc, TidyVertSpace ) == TidyAutoState) ? no : yes )
  |  |  ------------------
  |  |  |  |  421|   512k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  |  |  ------------------
  |  |  |  |  |  |  415|   512k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (52:19): [True: 512k, False: 0]
  |  |  |  Branch (52:20): [True: 0, False: 512k]
  |  |  ------------------
  ------------------
  909|   512k|        TY_(WriteChar)( '\n', doc->docOut );
  ------------------
  |  |   23|   512k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   512k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  910|   512k|        pprint->line++;
  911|   512k|    }
  912|       |
  913|   512k|    if ( pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (913:10): [True: 0, False: 512k]
  ------------------
  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|   512k|}
pprint.c:PPrintTag:
 1772|  2.22M|{
 1773|  2.22M|    TidyPrintImpl* pprint = &doc->pprint;
 1774|  2.22M|    Bool uc = cfgBool( doc, TidyUpperCaseTags );
  ------------------
  |  |  418|  2.22M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.22M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1775|  2.22M|    Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  2.22M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.22M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1776|  2.22M|    Bool xmlOut = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|  2.22M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.22M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1777|  2.22M|    tchar c;
 1778|  2.22M|    tmbstr s = node->element;
 1779|       |
 1780|  2.22M|    AddChar( pprint, '<' );
 1781|       |
 1782|  2.22M|    if ( node->type == EndTag )
  ------------------
  |  Branch (1782:10): [True: 262, False: 2.22M]
  ------------------
 1783|    262|        AddChar( pprint, '/' );
 1784|       |
 1785|  2.22M|    if (s)
  ------------------
  |  Branch (1785:9): [True: 2.22M, False: 21]
  ------------------
 1786|  2.22M|    {
 1787|  10.3M|        while (*s)
  ------------------
  |  Branch (1787:16): [True: 8.17M, False: 2.22M]
  ------------------
 1788|  8.17M|        {
 1789|  8.17M|            c = (unsigned char)*s;
 1790|       |
 1791|  8.17M|            if (c > 0x7F)
  ------------------
  |  Branch (1791:17): [True: 0, False: 8.17M]
  ------------------
 1792|      0|                s += TY_(GetUTF8)(s, &c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1793|  8.17M|            else if (uc)
  ------------------
  |  Branch (1793:22): [True: 0, False: 8.17M]
  ------------------
 1794|      0|                c = TY_(ToUpper)(c);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1795|       |
 1796|  8.17M|            AddChar(pprint, c);
 1797|  8.17M|            ++s;
 1798|  8.17M|        }
 1799|  2.22M|    }
 1800|       |
 1801|  2.22M|    PPrintAttrs( doc, indent, node );
 1802|       |
 1803|  2.22M|    if ( (xmlOut || xhtmlOut) &&
  ------------------
  |  Branch (1803:11): [True: 2.22M, False: 0]
  |  Branch (1803:21): [True: 0, False: 0]
  ------------------
 1804|  2.22M|         (node->type == StartEndTag || TY_(nodeCMIsEmpty)(node)) )
  ------------------
  |  |   23|  2.22M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.22M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1804:11): [True: 637, False: 2.22M]
  |  Branch (1804:40): [True: 65.2k, False: 2.15M]
  ------------------
 1805|  65.9k|    {
 1806|  65.9k|        AddChar( pprint, ' ' );   /* Space is NS compatibility hack <br /> */
 1807|  65.9k|        AddChar( pprint, '/' );   /* Required end tag marker */
 1808|  65.9k|    }
 1809|       |
 1810|  2.22M|    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.22M|    if ((node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50) && !TY_(nodeHasCM)(node, CM_VOID ) )
  ------------------
  |  |   23|    637|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    637|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if ((node->type == StartEndTag && TY_(HTMLVersion)(doc) == HT50) && !TY_(nodeHasCM)(node, CM_VOID ) )
  ------------------
  |  |  200|    637|#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: 637, False: 2.22M]
  |  Branch (1820:39): [True: 0, False: 637]
  |  Branch (1820:73): [True: 0, False: 0]
  ------------------
 1821|      0|    {
 1822|      0|        PPrintEndTag( doc, mode, indent, node );
 1823|      0|    }
 1824|       |
 1825|  2.22M|    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.22M, False: 637]
  |  Branch (1825:40): [True: 637, False: 0]
  |  Branch (1825:53): [True: 0, False: 0]
  |  Branch (1825:82): [True: 0, False: 0]
  |  Branch (1825:117): [True: 2.18M, False: 33.6k]
  ------------------
 1826|  2.18M|    {
 1827|  2.18M|        uint wraplen = cfg( doc, TidyWrapLen );
  ------------------
  |  |  415|  2.18M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1828|  2.18M|        CheckWrapIndent( doc, indent );
 1829|       |
 1830|  2.18M|        if ( indent + pprint->linelen < wraplen )
  ------------------
  |  Branch (1830:14): [True: 1.10M, False: 1.08M]
  ------------------
 1831|  1.10M|        {
 1832|       |            /* wrap after start tag if is <br/> or if it's not inline.
 1833|       |               Technically, it would be safe to call only AfterSpace.
 1834|       |               However, it would disrupt the existing algorithm. So let's
 1835|       |               leave as is. Note that AfterSpace returns true for non inline
 1836|       |               elements but can still be false for some <br>. So it has to
 1837|       |               stay as well. */
 1838|  1.10M|            if (!(mode & NOWRAP)
  ------------------
  |  Branch (1838:17): [True: 1.09M, False: 7.37k]
  ------------------
 1839|  1.09M|                && (!TY_(nodeCMIsInline)(node) || nodeIsBR(node))
  ------------------
  |  |   23|  1.09M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.09M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              && (!TY_(nodeCMIsInline)(node) || nodeIsBR(node))
  ------------------
  |  |  400|   692k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|   692k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 692k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 692k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 10.9k, False: 681k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1839:21): [True: 401k, False: 692k]
  ------------------
 1840|   412k|                && AfterSpace(doc->lexer, node))
  ------------------
  |  Branch (1840:20): [True: 407k, False: 4.62k]
  ------------------
 1841|   407k|            {
 1842|   407k|                pprint->wraphere = pprint->linelen;
 1843|   407k|            }
 1844|  1.10M|        }
 1845|       |        /* flush the current buffer only if it is known to be safe,
 1846|       |           i.e. it will not introduce some spurious white spaces.
 1847|       |           See bug #996484 */
 1848|  1.08M|        else if ( mode & NOWRAP ||
  ------------------
  |  Branch (1848:19): [True: 67, False: 1.08M]
  ------------------
 1849|  1.08M|                  nodeIsBR(node) || AfterSpace(doc->lexer, node))
  ------------------
  |  |  400|  1.08M|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  2.17M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.08M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.08M, False: 226]
  |  |  |  |  |  Branch (275:54): [True: 333, False: 1.08M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1849:37): [True: 50.2k, False: 1.03M]
  ------------------
 1850|  50.6k|            PCondFlushLineSmart( doc, indent );
 1851|  2.18M|    }
 1852|  2.22M|}
pprint.c:PPrintAttrs:
 1631|  2.22M|{
 1632|  2.22M|    TidyPrintImpl* pprint = &doc->pprint;
 1633|  2.22M|    AttVal* av;
 1634|       |
 1635|       |    /* add xml:space attribute to pre and other elements */
 1636|  2.22M|    if ( cfgBool(doc, TidyXmlOut) && cfgBool(doc, TidyXmlSpace) &&
  ------------------
  |  |  418|  4.44M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.22M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 2.22M, False: 0]
  |  |  ------------------
  ------------------
                  if ( cfgBool(doc, TidyXmlOut) && cfgBool(doc, TidyXmlSpace) &&
  ------------------
  |  |  418|  4.44M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.22M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 2.22M]
  |  |  ------------------
  ------------------
 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.61M|    for ( av = node->attributes; av; av = av->next )
  ------------------
  |  Branch (1643:34): [True: 396k, False: 2.22M]
  ------------------
 1644|   396k|    {
 1645|   396k|        if ( av->attribute != NULL )
  ------------------
  |  Branch (1645:14): [True: 374k, False: 21.4k]
  ------------------
 1646|   374k|        {
 1647|   374k|            PPrintAttribute( doc, indent, node, av );
 1648|   374k|        }
 1649|  21.4k|        else if ( av->asp != NULL )
  ------------------
  |  Branch (1649:19): [True: 3.18k, False: 18.2k]
  ------------------
 1650|  3.18k|        {
 1651|  3.18k|            AddChar( pprint, ' ' );
 1652|  3.18k|            PPrintAsp( doc, indent, av->asp );
 1653|  3.18k|        }
 1654|  18.2k|        else if ( av->php != NULL )
  ------------------
  |  Branch (1654:19): [True: 18.2k, False: 0]
  ------------------
 1655|  18.2k|        {
 1656|  18.2k|            AddChar( pprint, ' ' );
 1657|  18.2k|            PPrintPhp( doc, indent, av->php );
 1658|  18.2k|        }
 1659|   396k|    }
 1660|  2.22M|}
pprint.c:AfterSpace:
 1729|  1.49M|{
 1730|  1.49M|    return AfterSpaceImp(lexer, node, TY_(nodeCMIsEmpty)(node));
  ------------------
  |  |   23|  1.49M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.49M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1731|  1.49M|}
pprint.c:AfterSpaceImp:
 1689|  1.64G|{
 1690|  1.64G|    Node *prev;
 1691|       |
 1692|  1.64G|    if ( !TY_(nodeCMIsInline)(node) )
  ------------------
  |  |   23|  1.64G|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.64G|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1692:10): [True: 441k, False: 1.64G]
  ------------------
 1693|   441k|        return yes;
 1694|       |
 1695|  1.64G|    prev = node->prev;
 1696|  1.64G|    if (prev)
  ------------------
  |  Branch (1696:9): [True: 1.05M, False: 1.64G]
  ------------------
 1697|  1.05M|    {
 1698|  1.05M|        if (TY_(nodeIsText)(prev))
  ------------------
  |  |   23|  1.05M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.05M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1698:13): [True: 976k, False: 78.7k]
  ------------------
 1699|   976k|            return TY_(TextNodeEndWithSpace)( lexer, prev );
  ------------------
  |  |   23|   976k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   976k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1700|  78.7k|        else if (nodeIsBR(prev))
  ------------------
  |  |  400|  78.7k|#define nodeIsBR( node )         TagIsId( node, TidyTag_BR )
  |  |  ------------------
  |  |  |  |  275|  78.7k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 78.7k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 72.0k, False: 6.68k]
  |  |  |  |  |  Branch (275:54): [True: 6.28k, False: 65.8k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1701|  6.28k|            return yes;
 1702|       |
 1703|  72.4k|        return no;
 1704|  1.05M|    }
 1705|       |
 1706|  1.64G|    if ( isEmpty && !TY_(nodeCMIsInline)(node->parent) )
  ------------------
  |  |   23|  6.55k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.55k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1706:10): [True: 6.55k, False: 1.64G]
  |  Branch (1706:21): [True: 1.36k, False: 5.18k]
  ------------------
 1707|  1.36k|        return no;
 1708|       |
 1709|  1.64G|    return AfterSpaceImp(lexer, node->parent, isEmpty);
 1710|  1.64G|}
pprint.c:PPrintEndTag:
 1739|  2.15M|{
 1740|  2.15M|    TidyPrintImpl* pprint = &doc->pprint;
 1741|  2.15M|    Bool uc = cfgBool( doc, TidyUpperCaseTags );
  ------------------
  |  |  418|  2.15M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.15M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1742|  2.15M|    tmbstr s = node->element;
 1743|  2.15M|    tchar c;
 1744|       |
 1745|  2.15M|    AddString( pprint, "</" );
 1746|       |
 1747|  2.15M|    if (s)
  ------------------
  |  Branch (1747:9): [True: 2.15M, False: 21]
  ------------------
 1748|  2.15M|    {
 1749|  10.1M|        while (*s)
  ------------------
  |  Branch (1749:16): [True: 7.95M, False: 2.15M]
  ------------------
 1750|  7.95M|        {
 1751|  7.95M|             c = (unsigned char)*s;
 1752|       |
 1753|  7.95M|             if (c > 0x7F)
  ------------------
  |  Branch (1753:18): [True: 0, False: 7.95M]
  ------------------
 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.95M|             else if (uc)
  ------------------
  |  Branch (1755:23): [True: 0, False: 7.95M]
  ------------------
 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.95M|             AddChar(pprint, c);
 1759|  7.95M|             ++s;
 1760|  7.95M|        }
 1761|  2.15M|    }
 1762|       |
 1763|  2.15M|    AddChar( pprint, '>' );
 1764|  2.15M|}
pprint.c:PPrintScriptStyle:
 2122|  3.79k|{
 2123|  3.79k|    TidyPrintImpl* pprint = &doc->pprint;
 2124|  3.79k|    Node*   content;
 2125|  3.79k|    ctmbstr commentStart = DEFAULT_COMMENT_START;
 2126|  3.79k|    ctmbstr commentEnd = DEFAULT_COMMENT_END;
 2127|  3.79k|    Bool    hasCData = no;
 2128|  3.79k|    int     contentIndent = -1;
 2129|  3.79k|    Bool    xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  3.79k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.79k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2130|       |
 2131|  3.79k|    if ( InsideHead(doc, node) )
  ------------------
  |  Branch (2131:10): [True: 1.65k, False: 2.13k]
  ------------------
 2132|  1.65k|      PFlushLineSmart( doc, indent );
 2133|       |
 2134|  3.79k|    PCondFlushLineSmart( doc, indent );  /* Issue #56 - long outstanding bug - flush any existing closing tag */
 2135|       |
 2136|  3.79k|    PPrintTag( doc, mode, indent, node );
 2137|       |
 2138|       |    /* SCRIPT may have no content such as when loading code via its SRC attribute.
 2139|       |       In this case we don't want to flush the line, preferring to keep the required
 2140|       |       closing SCRIPT tag on the same line. */
 2141|  3.79k|    if ( node->content != NULL )
  ------------------
  |  Branch (2141:10): [True: 2.44k, False: 1.34k]
  ------------------
 2142|  2.44k|        PFlushLineSmart(doc, indent);
 2143|       |
 2144|  3.79k|    if ( xhtmlOut && node->content != NULL )
  ------------------
  |  Branch (2144:10): [True: 3.79k, False: 0]
  |  Branch (2144:22): [True: 2.44k, False: 1.34k]
  ------------------
 2145|  2.44k|    {
 2146|  2.44k|        AttVal* type = attrGetTYPE(node);
  ------------------
  |  |  405|  2.44k|#define attrGetTYPE( nod )        TY_(AttrGetById)( nod, TidyAttr_TYPE  )
  |  |  ------------------
  |  |  |  |   23|  2.44k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|  2.44k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 2147|       |
 2148|  2.44k|        if (AttrValueIs(type, "text/javascript"))
  ------------------
  |  |  172|  2.44k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  4.89k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 109, False: 2.33k]
  |  |  |  |  |  Branch (171:44): [True: 97, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  2.44k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|     97|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     97|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 97]
  |  |  ------------------
  ------------------
 2149|      0|        {
 2150|      0|            commentStart = JS_COMMENT_START;
 2151|      0|            commentEnd = JS_COMMENT_END;
 2152|      0|        }
 2153|  2.44k|        else if (AttrValueIs(type, "text/css"))
  ------------------
  |  |  172|  2.44k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  4.89k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 109, False: 2.33k]
  |  |  |  |  |  Branch (171:44): [True: 97, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  2.44k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|     97|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     97|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 38, False: 59]
  |  |  ------------------
  ------------------
 2154|     38|        {
 2155|     38|            commentStart = CSS_COMMENT_START;
 2156|     38|            commentEnd = CSS_COMMENT_END;
 2157|     38|        }
 2158|  2.40k|        else if (AttrValueIs(type, "text/vbscript"))
  ------------------
  |  |  172|  2.40k|#define AttrValueIs(attr, val)  (AttrHasValue(attr) && \
  |  |  ------------------
  |  |  |  |  171|  4.81k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (171:34): [True: 71, False: 2.33k]
  |  |  |  |  |  Branch (171:44): [True: 59, False: 12]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  173|  2.40k|                                 TY_(tmbstrcasecmp)((attr)->value, val) == 0)
  |  |  ------------------
  |  |  |  |   23|     59|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  |  |  ------------------
  |  |  |  |  |  |   22|     59|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (173:34): [True: 0, False: 59]
  |  |  ------------------
  ------------------
 2159|      0|        {
 2160|      0|            commentStart = VB_COMMENT_START;
 2161|      0|            commentEnd = VB_COMMENT_END;
 2162|      0|        }
 2163|       |
 2164|  2.44k|        hasCData = HasCDATA(doc->lexer, node->content);
 2165|       |
 2166|  2.44k|        if (!hasCData)
  ------------------
  |  Branch (2166:13): [True: 2.37k, False: 71]
  ------------------
 2167|  2.37k|        {
 2168|  2.37k|            uint saveWrap = WrapOff( doc );
 2169|       |
 2170|  2.37k|            AddString( pprint, commentStart );
 2171|  2.37k|            AddString( pprint, CDATA_START );
 2172|  2.37k|            AddString( pprint, commentEnd );
 2173|  2.37k|            PCondFlushLineSmart( doc, indent );
 2174|       |
 2175|  2.37k|            WrapOn( doc, saveWrap );
 2176|  2.37k|        }
 2177|  2.44k|    }
 2178|       |
 2179|  3.79k|    for ( content = node->content;
 2180|  9.34k|          content != NULL;
  ------------------
  |  Branch (2180:11): [True: 5.55k, False: 3.79k]
  ------------------
 2181|  5.55k|          content = content->next )
 2182|  5.55k|    {
 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|  5.55k|        TY_(PPrintTree)( doc, (mode | PREFORMATTED | NOWRAP | CDATA),
  ------------------
  |  |   23|  5.55k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.55k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2189|  5.55k|                         indent, content );
 2190|       |
 2191|  5.55k|        if ( content == node->last )
  ------------------
  |  Branch (2191:14): [True: 2.44k, False: 3.11k]
  ------------------
 2192|  2.44k|            contentIndent = TextEndsWithNewline( doc->lexer, content, CDATA );
 2193|  5.55k|    }
 2194|       |
 2195|       |    /* Only flush the line if these was content present so that the closing
 2196|       |       SCRIPT tag will stay on the same line. */
 2197|  3.79k|    if ( contentIndent < 0 && node->content != NULL )
  ------------------
  |  Branch (2197:10): [True: 3.72k, False: 68]
  |  Branch (2197:31): [True: 2.37k, False: 1.34k]
  ------------------
 2198|  2.37k|    {
 2199|  2.37k|        PCondFlushLineSmart( doc, indent );
 2200|  2.37k|        contentIndent = 0;
 2201|  2.37k|    }
 2202|       |
 2203|  3.79k|    if ( xhtmlOut && node->content != NULL )
  ------------------
  |  Branch (2203:10): [True: 3.79k, False: 0]
  |  Branch (2203:22): [True: 2.44k, False: 1.34k]
  ------------------
 2204|  2.44k|    {
 2205|  2.44k|        if ( ! hasCData )
  ------------------
  |  Branch (2205:14): [True: 2.37k, False: 71]
  ------------------
 2206|  2.37k|        {
 2207|  2.37k|            uint saveWrap = WrapOff( doc );
 2208|       |
 2209|  2.37k|            AddString( pprint, commentStart );
 2210|  2.37k|            AddString( pprint, CDATA_END );
 2211|  2.37k|            AddString( pprint, commentEnd );
 2212|       |
 2213|  2.37k|            WrapOn( doc, saveWrap );
 2214|  2.37k|            PCondFlushLineSmart( doc, indent );
 2215|  2.37k|        }
 2216|  2.44k|    }
 2217|       |
 2218|  3.79k|    if ( node->content && pprint->indent[ 0 ].spaces != (int)indent )
  ------------------
  |  Branch (2218:10): [True: 2.44k, False: 1.34k]
  |  Branch (2218:27): [True: 0, False: 2.44k]
  ------------------
 2219|      0|    {
 2220|       |#if defined(ENABLE_DEBUG_LOG) && defined(DEBUG_INDENT)
 2221|       |        SPRTF("%s Indent from %d to %d\n", __FUNCTION__, pprint->indent[ 0 ].spaces, indent );
 2222|       |#endif
 2223|      0|        pprint->indent[ 0 ].spaces = indent;
 2224|      0|    }
 2225|  3.79k|    PPrintEndTag( doc, mode, indent, node );
 2226|  3.79k|    if ( cfgAutoBool(doc, TidyIndentContent) == TidyNoState
  ------------------
  |  |  421|  3.79k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.79k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (2226:10): [True: 3.79k, False: 0]
  ------------------
 2227|  3.79k|         && node->next != NULL &&
  ------------------
  |  Branch (2227:13): [True: 2.45k, False: 1.33k]
  ------------------
 2228|  2.45k|         !( TY_(nodeHasCM)(node, CM_INLINE) || TY_(nodeIsText)(node) ) )
  ------------------
  |  |   23|  2.45k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.45k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                       !( TY_(nodeHasCM)(node, CM_INLINE) || TY_(nodeIsText)(node) ) )
  ------------------
  |  |  143|  2.45k|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
                       !( TY_(nodeHasCM)(node, CM_INLINE) || TY_(nodeIsText)(node) ) )
  ------------------
  |  |   23|  1.08k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.08k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2228:13): [True: 1.37k, False: 1.08k]
  |  Branch (2228:48): [True: 0, False: 1.08k]
  ------------------
 2229|  1.08k|        PFlushLineSmart( doc, indent );
 2230|  3.79k|}
pprint.c:InsideHead:
  981|  82.6k|{
  982|  82.6k|  if ( nodeIsHEAD(node) )
  ------------------
  |  |  371|  82.6k|#define nodeIsHEAD( node )       TagIsId( node, TidyTag_HEAD )
  |  |  ------------------
  |  |  |  |  275|  82.6k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 82.6k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 63.1k, False: 19.4k]
  |  |  |  |  |  Branch (275:54): [True: 1.65k, False: 61.5k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  983|  1.65k|    return yes;
  984|       |
  985|  80.9k|  if ( node->parent != NULL )
  ------------------
  |  Branch (985:8): [True: 78.8k, False: 2.13k]
  ------------------
  986|  78.8k|    return InsideHead( doc, node->parent );
  987|       |
  988|  2.13k|  return no;
  989|  80.9k|}
pprint.c:HasCDATA:
 1065|  2.44k|{
 1066|       |    /* Scan forward through the textarray. Since the characters we're
 1067|       |    ** looking for are < 0x7f, we don't have to do any UTF-8 decoding.
 1068|       |    */
 1069|  2.44k|    ctmbstr start = lexer->lexbuf + node->start;
 1070|  2.44k|    int len = node->end - node->start + 1;
 1071|       |
 1072|  2.44k|    if ( node->type != TextNode )
  ------------------
  |  Branch (1072:10): [True: 1.08k, False: 1.36k]
  ------------------
 1073|  1.08k|        return no;
 1074|       |
 1075|  1.36k|    return ( NULL != TY_(tmbsubstrn)( start, len, CDATA_START ));
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1076|  2.44k|}
pprint.c:ShouldIndent:
 1083|  3.14M|{
 1084|  3.14M|    TidyTriState indentContent = cfgAutoBool( doc, TidyIndentContent );
  ------------------
  |  |  421|  3.14M|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  3.14M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1085|  3.14M|    if ( indentContent == TidyNoState )
  ------------------
  |  Branch (1085:10): [True: 3.14M, False: 0]
  ------------------
 1086|  3.14M|        return no;
 1087|       |
 1088|      0|    if ( nodeIsTEXTAREA(node) )
  ------------------
  |  |  425|      0|#define nodeIsTEXTAREA( node )   TagIsId( node, TidyTag_TEXTAREA )
  |  |  ------------------
  |  |  |  |  275|      0|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1089|      0|        return no;
 1090|       |
 1091|      0|    if ( indentContent == TidyAutoState )
  ------------------
  |  Branch (1091:10): [True: 0, False: 0]
  ------------------
 1092|      0|    {
 1093|      0|        if ( node->content && TY_(nodeHasCM)(node, CM_NO_INDENT) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( node->content && TY_(nodeHasCM)(node, CM_NO_INDENT) )
  ------------------
  |  |  157|      0|#define CM_NO_INDENT    (1 << 18)  /**< Elements whose content needs to be indented only if containing one CM_BLOCK element. */
  ------------------
  |  Branch (1093:14): [True: 0, False: 0]
  |  Branch (1093:31): [True: 0, False: 0]
  ------------------
 1094|      0|        {
 1095|      0|            for ( node = node->content; node; node = node->next )
  ------------------
  |  Branch (1095:41): [True: 0, False: 0]
  ------------------
 1096|      0|                if ( TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              if ( TY_(nodeHasCM)(node, CM_BLOCK) )
  ------------------
  |  |  142|      0|#define CM_BLOCK        (1 << 3)   /**< HTML "block" elements. */
  ------------------
  |  Branch (1096:22): [True: 0, False: 0]
  ------------------
 1097|      0|                    return yes;
 1098|      0|            return no;
 1099|      0|        }
 1100|       |
 1101|      0|        if ( TY_(nodeHasCM)(node, CM_HEADING) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      if ( TY_(nodeHasCM)(node, CM_HEADING) )
  ------------------
  |  |  153|      0|#define CM_HEADING      (1 << 14)  /**< Heading elements (h1, h2, ...). */
  ------------------
  |  Branch (1101:14): [True: 0, False: 0]
  ------------------
 1102|      0|            return no;
 1103|       |
 1104|      0|        if ( nodeIsHTML(node) )
  ------------------
  |  |  370|      0|#define nodeIsHTML( node )       TagIsId( node, TidyTag_HTML )
  |  |  ------------------
  |  |  |  |  275|      0|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1105|      0|            return no;
 1106|       |
 1107|      0|        if ( nodeIsP(node) )
  ------------------
  |  |  385|      0|#define nodeIsP( node )          TagIsId( node, TidyTag_P )
  |  |  ------------------
  |  |  |  |  275|      0|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1108|      0|            return no;
 1109|       |
 1110|      0|        if ( nodeIsTITLE(node) )
  ------------------
  |  |  372|      0|#define nodeIsTITLE( node )      TagIsId( node, TidyTag_TITLE )
  |  |  ------------------
  |  |  |  |  275|      0|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1111|      0|            return no;
 1112|       |
 1113|       |        /* http://tidy.sf.net/issue/1610888
 1114|       |           Indenting <div><img /></div> produces spurious lines with IE 6.x */
 1115|      0|        if ( nodeIsDIV(node) && node->last && nodeIsIMG(node->last) )
  ------------------
  |  |  429|      0|#define nodeIsDIV( node )        TagIsId( node, TidyTag_DIV )
  |  |  ------------------
  |  |  |  |  275|      0|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if ( nodeIsDIV(node) && node->last && nodeIsIMG(node->last) )
  ------------------
  |  |  412|      0|#define nodeIsIMG( node )        TagIsId( node, TidyTag_IMG )
  |  |  ------------------
  |  |  |  |  275|      0|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1115:33): [True: 0, False: 0]
  ------------------
 1116|      0|            return no;
 1117|      0|    }
 1118|       |
 1119|      0|    if ( TY_(nodeHasCM)(node, CM_FIELD | CM_OBJECT) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  if ( TY_(nodeHasCM)(node, CM_FIELD | CM_OBJECT) )
  ------------------
  |  |  149|      0|#define CM_FIELD        (1 << 10)  /**< Elements whose content must be protected against white space movement. Includes some elements that can found in forms. */
  ------------------
                  if ( TY_(nodeHasCM)(node, CM_FIELD | CM_OBJECT) )
  ------------------
  |  |  150|      0|#define CM_OBJECT       (1 << 11)  /**< Used to avoid propagating inline emphasis inside some elements such as OBJECT or APPLET. */
  ------------------
  |  Branch (1119:10): [True: 0, False: 0]
  ------------------
 1120|      0|        return yes;
 1121|       |
 1122|      0|    if ( nodeIsMAP(node) )
  ------------------
  |  |  413|      0|#define nodeIsMAP( node )        TagIsId( node, TidyTag_MAP )
  |  |  ------------------
  |  |  |  |  275|      0|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 0, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1123|      0|        return yes;
 1124|       |
 1125|      0|    return ( !TY_(nodeHasCM)( node, CM_INLINE ) && node->content );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  return ( !TY_(nodeHasCM)( node, CM_INLINE ) && node->content );
  ------------------
  |  |  143|      0|#define CM_INLINE       (1 << 4)   /**< HTML "inline" elements. */
  ------------------
  |  Branch (1125:14): [True: 0, False: 0]
  |  Branch (1125:52): [True: 0, False: 0]
  ------------------
 1126|      0|}

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

tidyCreate:
   87|  20.6k|{
   88|  20.6k|  TidyDocImpl* impl = tidyDocCreate( &TY_(g_default_allocator) );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   89|  20.6k|  return tidyImplToDoc( impl );
  ------------------
  |  |  141|  20.6k|#define tidyImplToDoc( doc )            ((TidyDoc)(doc))
  ------------------
   90|  20.6k|}
tidyRelease:
   99|  20.6k|{
  100|  20.6k|  TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.6k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  101|  20.6k|  tidyDocRelease( impl );
  102|  20.6k|}
tidyLibraryVersion:
  204|  20.6k|{
  205|  20.6k|    return TY_(tidyLibraryVersion)();
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  206|  20.6k|}
tidyOptSetBool:
  530|  41.2k|{
  531|  41.2k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  41.2k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  532|  41.2k|    if ( impl )
  ------------------
  |  Branch (532:10): [True: 41.2k, False: 0]
  ------------------
  533|  41.2k|        return TY_(SetOptionBool)( impl, optId, val );
  ------------------
  |  |   23|  41.2k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.2k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  534|      0|    return no;
  535|  41.2k|}
tidySetErrorBuffer:
  974|  20.6k|{
  975|  20.6k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.6k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
  976|  20.6k|    if ( impl )
  ------------------
  |  Branch (976:10): [True: 20.6k, False: 0]
  ------------------
  977|  20.6k|    {
  978|  20.6k|        uint outenc = cfg( impl, TidyOutCharEncoding );
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  979|  20.6k|        uint nl = cfg( impl, TidyNewline );
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
  980|  20.6k|        TY_(ReleaseStreamOut)( impl, impl->errout );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  981|  20.6k|        impl->errout = TY_(BufferOutput)( impl, errbuf, outenc, nl );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  982|  20.6k|        return ( impl->errout ? 0 : -ENOMEM );
  ------------------
  |  Branch (982:18): [True: 20.6k, False: 0]
  ------------------
  983|  20.6k|    }
  984|      0|    return -EINVAL;
  985|  20.6k|}
tidyParseFile:
 1105|  20.6k|{
 1106|  20.6k|    TidyDocImpl* doc = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.6k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1107|  20.6k|    return tidyDocParseFile( doc, filnam );
 1108|  20.6k|}
tidySaveBuffer:
 1255|  20.6k|{
 1256|  20.6k|    TidyDocImpl* doc = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.6k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1257|  20.6k|    return tidyDocSaveBuffer( doc, outbuf );
 1258|  20.6k|}
tidyCleanAndRepair:
 1419|  20.6k|{
 1420|  20.6k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.6k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1421|  20.6k|    if ( impl )
  ------------------
  |  Branch (1421:10): [True: 20.6k, False: 0]
  ------------------
 1422|  20.6k|      return tidyDocCleanAndRepair( impl );
 1423|      0|    return -EINVAL;
 1424|  20.6k|}
tidyRunDiagnostics:
 1427|  20.6k|{
 1428|  20.6k|    TidyDocImpl* impl = tidyDocToImpl( tdoc );
  ------------------
  |  |  140|  20.6k|#define tidyDocToImpl( tdoc )           ((TidyDocImpl*)(tdoc))
  ------------------
 1429|  20.6k|    if ( impl )
  ------------------
  |  Branch (1429:10): [True: 20.6k, False: 0]
  ------------------
 1430|  20.6k|      return tidyDocRunDiagnostics( impl );
 1431|      0|    return -EINVAL;
 1432|  20.6k|}
prvTidyDocParseStream:
 1456|  20.6k|{
 1457|  20.6k|    Bool xmlIn = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1458|  20.6k|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 1459|       |    
 1460|  20.6k|    int bomEnc;
 1461|  20.6k|    doc->pConfigChangeCallback = NULL;
 1462|       |
 1463|  20.6k|    assert( doc != NULL && in != NULL );
  ------------------
  |  Branch (1463:5): [True: 0, False: 20.6k]
  |  Branch (1463:5): [True: 0, False: 0]
  |  Branch (1463:5): [True: 20.6k, False: 0]
  |  Branch (1463:5): [True: 20.6k, False: 0]
  ------------------
 1464|  20.6k|    assert( doc->docIn == NULL );
  ------------------
  |  Branch (1464:5): [True: 0, False: 20.6k]
  |  Branch (1464:5): [True: 20.6k, False: 0]
  ------------------
 1465|  20.6k|    doc->docIn = in;
 1466|       |
 1467|  20.6k|    TY_(ResetTags)(doc);             /* Reset table to html5 mode */
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1468|  20.6k|    TY_(TakeConfigSnapshot)( doc );  /* Save config state */
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1469|  20.6k|    TY_(AdjustConfig)( doc );        /* Ensure config internal consistency */
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1470|  20.6k|    TY_(FreeAnchors)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1471|       |
 1472|  20.6k|    TY_(FreeNode)(doc, &doc->root);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1473|  20.6k|    TidyClearMemory(&doc->root, sizeof(Node));
  ------------------
  |  |   70|  20.6k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1474|       |
 1475|  20.6k|    if (doc->givenDoctype)
  ------------------
  |  Branch (1475:9): [True: 0, False: 20.6k]
  ------------------
 1476|  20.6k|        TidyDocFree(doc, doc->givenDoctype);
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1477|       |    /*\ 
 1478|       |     *  Issue #186 - Now FreeNode depend on the doctype, so the lexer is needed
 1479|       |     *  to determine which hash is to be used, so free it last.
 1480|       |    \*/
 1481|  20.6k|    TY_(FreeLexer)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1482|  20.6k|    doc->givenDoctype = NULL;
 1483|       |
 1484|  20.6k|    doc->lexer = TY_(NewLexer)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1485|       |    /* doc->lexer->root = &doc->root; */
 1486|  20.6k|    doc->root.line = doc->lexer->lines;
 1487|  20.6k|    doc->root.column = doc->lexer->columns;
 1488|  20.6k|    doc->inputHadBOM = no;
 1489|  20.6k|    doc->xmlDetected = no;
 1490|       |
 1491|  20.6k|    bomEnc = TY_(ReadBOMEncoding)(in);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1492|       |
 1493|  20.6k|    if (bomEnc != -1)
  ------------------
  |  Branch (1493:9): [True: 187, False: 20.4k]
  ------------------
 1494|    187|    {
 1495|    187|        in->encoding = bomEnc;
 1496|    187|        TY_(SetOptionInt)(doc, TidyInCharEncoding, bomEnc);
  ------------------
  |  |   23|    187|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    187|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1497|    187|    }
 1498|       |
 1499|       |    /* Tidy doesn't alter the doctype for generic XML docs */
 1500|  20.6k|    if ( xmlIn )
  ------------------
  |  Branch (1500:10): [True: 0, False: 20.6k]
  ------------------
 1501|      0|    {
 1502|      0|        TY_(ParseXMLDocument)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1503|      0|        if ( !TY_(CheckNodeIntegrity)( &doc->root ) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1503:14): [True: 0, False: 0]
  ------------------
 1504|      0|            TidyPanic( doc->allocator, integrity );
  ------------------
  |  |   69|      0|#define TidyPanic(allocator, msg) ((allocator)->vtbl->panic((allocator), (msg)))
  ------------------
 1505|      0|    }
 1506|  20.6k|    else
 1507|  20.6k|    {
 1508|  20.6k|        doc->warnings = 0;
 1509|  20.6k|        TY_(ParseDocument)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1510|  20.6k|        if ( !TY_(CheckNodeIntegrity)( &doc->root ) )
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1510:14): [True: 0, False: 20.6k]
  ------------------
 1511|      0|            TidyPanic( doc->allocator, integrity );
  ------------------
  |  |   69|      0|#define TidyPanic(allocator, msg) ((allocator)->vtbl->panic((allocator), (msg)))
  ------------------
 1512|  20.6k|    }
 1513|       |
 1514|  20.6k|    doc->docIn = NULL;
 1515|  20.6k|    doc->pConfigChangeCallback = callback;
 1516|       |
 1517|  20.6k|    return tidyDocStatus( doc );
 1518|  20.6k|}
tidyLocalizedStringN:
 2686|  19.2M|{
 2687|  19.2M|    return TY_(tidyLocalizedStringN)( messageType, quantity);
  ------------------
  |  |   23|  19.2M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.2M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2688|  19.2M|}
tidyLocalizedString:
 2691|  49.5M|{
 2692|  49.5M|    return TY_(tidyLocalizedString)( messageType );
  ------------------
  |  |   23|  49.5M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  49.5M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2693|  49.5M|}
tidyDefaultStringN:
 2696|  19.2M|{
 2697|  19.2M|    return TY_(tidyDefaultStringN)( messageType, quantity);
  ------------------
  |  |   23|  19.2M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  19.2M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2698|  19.2M|}
tidyDefaultString:
 2701|  57.6M|{
 2702|  57.6M|    return TY_(tidyDefaultString)( messageType );
  ------------------
  |  |   23|  57.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  57.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2703|  57.6M|}
tidylib.c:tidyDocCreate:
  105|  20.6k|{
  106|  20.6k|    TidyDocImpl* doc = (TidyDocImpl*)TidyAlloc( allocator, sizeof(TidyDocImpl) );
  ------------------
  |  |   66|  20.6k|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
  107|  20.6k|    TidyClearMemory( doc, sizeof(*doc) );
  ------------------
  |  |   70|  20.6k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  108|  20.6k|    doc->allocator = allocator;
  109|       |
  110|  20.6k|    TY_(InitMap)();
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  111|  20.6k|    TY_(InitTags)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  112|  20.6k|    TY_(InitAttrs)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  113|  20.6k|    TY_(InitConfig)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  114|  20.6k|    TY_(InitPrintBuf)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  115|  20.6k|    TY_(InitParserStack)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  116|       |
  117|       |    /* Set the locale for tidy's output. This both configures
  118|       |    ** LibTidy to use the environment's locale as well as the
  119|       |    ** standard library.
  120|       |    */
  121|  20.6k|#if SUPPORT_LOCALIZATIONS
  122|  20.6k|    if ( TY_(tidyGetLanguageSetByUser)() == no )
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (122:10): [True: 20.6k, False: 0]
  ------------------
  123|  20.6k|    {
  124|  20.6k|        if( ! TY_(tidySetLanguage)( getenv( "LC_MESSAGES" ) ) )
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (124:13): [True: 20.6k, False: 0]
  ------------------
  125|  20.6k|        {
  126|  20.6k|            if( ! TY_(tidySetLanguage)( getenv( "LANG" ) ) )
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (126:17): [True: 20.6k, False: 0]
  ------------------
  127|  20.6k|            {
  128|       |                /*\
  129|       |                *  Is. #770 #783 #780 #790 and maybe others -
  130|       |                *  TY_(tidySetLanguage)( setlocale( LC_ALL, "" ) );
  131|       |                *  this seems a 'bad' choice!
  132|       |               \*/
  133|  20.6k|            }
  134|  20.6k|        }
  135|  20.6k|    }
  136|  20.6k|#endif
  137|       |
  138|       |    /* By default, wire tidy messages to standard error.
  139|       |    ** Document input will be set by parsing routines.
  140|       |    ** Document output will be set by pretty print routines.
  141|       |    ** Config input will be set by config parsing routines.
  142|       |    ** But we need to start off with a way to report errors.
  143|       |    */
  144|  20.6k|    doc->errout = TY_(StdErrOutput)();
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  145|  20.6k|    return doc;
  146|  20.6k|}
tidylib.c:tidyDocRelease:
  149|  20.6k|{
  150|       |    /* doc in/out opened and closed by parse/print routines */
  151|  20.6k|    if ( doc )
  ------------------
  |  Branch (151:10): [True: 20.6k, False: 0]
  ------------------
  152|  20.6k|    {
  153|  20.6k|        assert( doc->docIn == NULL );
  ------------------
  |  Branch (153:9): [True: 0, False: 20.6k]
  |  Branch (153:9): [True: 20.6k, False: 0]
  ------------------
  154|  20.6k|        assert( doc->docOut == NULL );
  ------------------
  |  Branch (154:9): [True: 0, False: 20.6k]
  |  Branch (154:9): [True: 20.6k, False: 0]
  ------------------
  155|       |
  156|  20.6k|        TY_(ReleaseStreamOut)( doc, doc->errout );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  157|  20.6k|        doc->errout = NULL;
  158|       |
  159|  20.6k|        TY_(FreePrintBuf)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  160|  20.6k|        TY_(FreeNode)(doc, &doc->root);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  161|  20.6k|        TidyClearMemory(&doc->root, sizeof(Node));
  ------------------
  |  |   70|  20.6k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
  162|       |
  163|  20.6k|        if (doc->givenDoctype)
  ------------------
  |  Branch (163:13): [True: 134, False: 20.4k]
  ------------------
  164|  20.6k|            TidyDocFree(doc, doc->givenDoctype);
  ------------------
  |  |  159|    134|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|    134|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  165|       |
  166|  20.6k|        TY_(FreeConfig)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  167|  20.6k|        TY_(FreeAttrTable)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  168|  20.6k|        TY_(FreeAttrPriorityList)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  169|  20.6k|        TY_(FreeMutedMessageList( doc ));
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  170|  20.6k|        TY_(FreeTags)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  171|       |        /*\ 
  172|       |         *  Issue #186 - Now FreeNode depend on the doctype, so the lexer is needed
  173|       |         *  to determine which hash is to be used, so free it last.
  174|       |        \*/
  175|  20.6k|        TY_(FreeLexer)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  176|  20.6k|        TY_(FreeParserStack)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  177|  20.6k|        TidyDocFree( doc, doc );
  ------------------
  |  |  159|  20.6k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.6k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
  178|  20.6k|    }
  179|  20.6k|}
tidylib.c:tidyDocParseFile:
 1136|  20.6k|{
 1137|  20.6k|    int status = -ENOENT;
 1138|  20.6k|    FILE* fin = 0;
 1139|  20.6k|    struct stat sbuf = { 0 }; /* Is. #681 - read-only files */
 1140|  20.6k|    if ( stat(filnam,&sbuf) != 0 )
  ------------------
  |  Branch (1140:10): [True: 0, False: 20.6k]
  ------------------
 1141|      0|    {
 1142|      0|        TY_(ReportFileError)( doc, filnam, FILE_NOT_FILE );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1143|      0|        return status;
 1144|      0|    }
 1145|  20.6k|    if (sbuf.st_mode & M_IS_DIR) /* and /NOT/ if a DIRECTORY */
  ------------------
  |  | 1133|  20.6k|#define M_IS_DIR S_IFDIR
  ------------------
  |  Branch (1145:9): [True: 0, False: 20.6k]
  ------------------
 1146|      0|    {
 1147|      0|        TY_(ReportFileError)(doc, filnam, FILE_NOT_FILE);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1148|      0|        return status;
 1149|      0|    }
 1150|       |
 1151|       |#ifdef _WIN32
 1152|       |    return TY_(DocParseFileWithMappedFile)( doc, filnam );
 1153|       |#else
 1154|       |
 1155|  20.6k|    fin = fopen( filnam, "rb" );
 1156|       |
 1157|  20.6k|#if PRESERVE_FILE_TIMES
 1158|  20.6k|    {
 1159|       |        /* get last modified time */
 1160|  20.6k|        TidyClearMemory(&doc->filetimes, sizeof(doc->filetimes));
  ------------------
  |  |   70|  20.6k|#define TidyClearMemory(block, size) memset((block), 0, (size))
  ------------------
 1161|  20.6k|        if (fin && cfgBool(doc, TidyKeepFileTimes) &&
  ------------------
  |  |  418|  41.2k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 20.6k]
  |  |  ------------------
  ------------------
  |  Branch (1161:13): [True: 20.6k, False: 0]
  ------------------
 1162|      0|            fstat(fileno(fin), &sbuf) != -1)
  ------------------
  |  Branch (1162:13): [True: 0, False: 0]
  ------------------
 1163|      0|        {
 1164|      0|            doc->filetimes.actime = sbuf.st_atime;
 1165|      0|            doc->filetimes.modtime = sbuf.st_mtime;
 1166|      0|        }
 1167|  20.6k|    }
 1168|  20.6k|#endif
 1169|       |
 1170|  20.6k|    if ( fin )
  ------------------
  |  Branch (1170:10): [True: 20.6k, False: 0]
  ------------------
 1171|  20.6k|    {
 1172|  20.6k|        StreamIn* in = TY_(FileInput)( doc, fin, cfg( doc, TidyInCharEncoding ));
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                      StreamIn* in = TY_(FileInput)( doc, fin, cfg( doc, TidyInCharEncoding ));
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1173|  20.6k|        if ( !in )
  ------------------
  |  Branch (1173:14): [True: 0, False: 20.6k]
  ------------------
 1174|      0|        {
 1175|      0|            fclose( fin );
 1176|      0|            return status;
 1177|      0|        }
 1178|  20.6k|        status = TY_(DocParseStream)( doc, in );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1179|  20.6k|        TY_(freeFileSource)(&in->source, yes);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1180|  20.6k|        TY_(freeStreamIn)(in);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1181|  20.6k|    }
 1182|      0|    else /* Error message! */
 1183|      0|        TY_(ReportFileError)( doc, filnam, FILE_CANT_OPEN );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1184|  20.6k|    return status;
 1185|  20.6k|#endif
 1186|  20.6k|}
tidylib.c:tidyDocSaveStream:
 2270|  20.6k|{
 2271|  20.6k|    Bool showMarkup  = cfgBool( doc, TidyShowMarkup );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2272|  20.6k|    Bool forceOutput = cfgBool( doc, TidyForceOutput );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2273|  20.6k|    Bool outputBOM   = ( cfgAutoBool(doc, TidyOutputBOM) == TidyYesState );
  ------------------
  |  |  421|  20.6k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2274|  20.6k|    Bool smartBOM    = ( cfgAutoBool(doc, TidyOutputBOM) == TidyAutoState );
  ------------------
  |  |  421|  20.6k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2275|  20.6k|    Bool xmlOut      = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2276|  20.6k|    Bool xhtmlOut    = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2277|  20.6k|    TidyTriState bodyOnly    = cfgAutoBool( doc, TidyBodyOnly );
  ------------------
  |  |  421|  20.6k|#define cfgAutoBool(doc, id)    ((TidyTriState) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2278|       |
 2279|  20.6k|    Bool dropComments = cfgBool(doc, TidyHideComments);
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2280|  20.6k|    Bool makeClean    = cfgBool(doc, TidyMakeClean);
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2281|  20.6k|    Bool asciiChars   = cfgBool(doc, TidyAsciiChars);
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2282|  20.6k|    Bool makeBare     = cfgBool(doc, TidyMakeBare);
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2283|  20.6k|    Bool escapeCDATA  = cfgBool(doc, TidyEscapeCdata);
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2284|  20.6k|    TidyAttrSortStrategy sortAttrStrat = cfg(doc, TidySortAttributes);
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 2285|  20.6k|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 2286|  20.6k|    doc->pConfigChangeCallback = NULL;
 2287|       |
 2288|       |    
 2289|  20.6k|    if (escapeCDATA)
  ------------------
  |  Branch (2289:9): [True: 0, False: 20.6k]
  ------------------
 2290|      0|        TY_(ConvertCDATANodes)(doc, &doc->root);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2291|       |
 2292|  20.6k|    if (dropComments)
  ------------------
  |  Branch (2292:9): [True: 0, False: 20.6k]
  ------------------
 2293|      0|        TY_(DropComments)(doc, &doc->root);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2294|       |
 2295|  20.6k|    if (makeClean)
  ------------------
  |  Branch (2295:9): [True: 0, False: 20.6k]
  ------------------
 2296|      0|    {
 2297|       |        /* noop */
 2298|      0|        TY_(DropFontElements)(doc, &doc->root, NULL);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2299|      0|    }
 2300|       |
 2301|  20.6k|    if ((makeClean && asciiChars) || makeBare)
  ------------------
  |  Branch (2301:10): [True: 0, False: 20.6k]
  |  Branch (2301:23): [True: 0, False: 0]
  |  Branch (2301:38): [True: 0, False: 20.6k]
  ------------------
 2302|      0|        TY_(DowngradeTypography)(doc, &doc->root);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2303|       |
 2304|  20.6k|    if (makeBare)
  ------------------
  |  Branch (2304:9): [True: 0, False: 20.6k]
  ------------------
 2305|       |        /* Note: no longer replaces &nbsp; in */
 2306|       |        /* attribute values / non-text tokens */
 2307|      0|        TY_(NormalizeSpaces)(doc->lexer, &doc->root);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2308|  20.6k|    else
 2309|  20.6k|        TY_(ReplacePreformattedSpaces)(doc, &doc->root);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2310|       |
 2311|  20.6k|    TY_(SortAttributes)(doc, &doc->root, sortAttrStrat);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2312|       |
 2313|  20.6k|    if ( showMarkup && (doc->errors == 0 || forceOutput) )
  ------------------
  |  Branch (2313:10): [True: 20.6k, False: 0]
  |  Branch (2313:25): [True: 15.2k, False: 5.38k]
  |  Branch (2313:45): [True: 5.38k, False: 0]
  ------------------
 2314|  20.6k|    {
 2315|       |        /* Output a Byte Order Mark if required */
 2316|  20.6k|        if ( outputBOM || (doc->inputHadBOM && smartBOM) )
  ------------------
  |  Branch (2316:14): [True: 0, False: 20.6k]
  |  Branch (2316:28): [True: 0, False: 20.6k]
  |  Branch (2316:48): [True: 0, False: 0]
  ------------------
 2317|      0|            TY_(outBOM)( out );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2318|       |
 2319|       |        /* No longer necessary. No DOCTYPE == HTML 3.2,
 2320|       |        ** which gives you only the basic character entities,
 2321|       |        ** which are safe in any browser.
 2322|       |        ** if ( !TY_(FindDocType)(doc) )
 2323|       |        **    TY_(SetOptionBool)( doc, TidyNumEntities, yes );
 2324|       |        */
 2325|       |
 2326|  20.6k|        doc->docOut = out;
 2327|  20.6k|        if ( xmlOut && !xhtmlOut )
  ------------------
  |  Branch (2327:14): [True: 20.6k, False: 0]
  |  Branch (2327:24): [True: 0, False: 20.6k]
  ------------------
 2328|      0|            TY_(PPrintXMLTree)( doc, NORMAL, 0, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2329|  20.6k|        else if ( showBodyOnly( doc, bodyOnly ) )
  ------------------
  |  Branch (2329:19): [True: 0, False: 20.6k]
  ------------------
 2330|      0|            TY_(PrintBody)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2331|  20.6k|        else
 2332|  20.6k|            TY_(PPrintTree)( doc, NORMAL, 0, &doc->root );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2333|       |
 2334|  20.6k|        TY_(PFlushLine)( doc, 0 );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2335|  20.6k|        doc->docOut = NULL;
 2336|  20.6k|    }
 2337|       |
 2338|       |    /* @jsd: removing this should solve #673, and allow saving of the buffer multiple times. */
 2339|       |//    TY_(ResetConfigToSnapshot)( doc );
 2340|  20.6k|    doc->pConfigChangeCallback = callback;
 2341|       |    
 2342|  20.6k|    return tidyDocStatus( doc );
 2343|  20.6k|}
tidylib.c:showBodyOnly:
 2251|  20.6k|{
 2252|  20.6k|    Node* node;
 2253|       |
 2254|  20.6k|    switch( bodyOnly )
 2255|  20.6k|    {
 2256|  20.6k|    case TidyNoState:
  ------------------
  |  Branch (2256:5): [True: 20.6k, False: 0]
  ------------------
 2257|  20.6k|        return no;
 2258|      0|    case TidyYesState:
  ------------------
  |  Branch (2258:5): [True: 0, False: 20.6k]
  ------------------
 2259|      0|        return yes;
 2260|      0|    default:
  ------------------
  |  Branch (2260:5): [True: 0, False: 20.6k]
  ------------------
 2261|      0|        node = TY_(FindBody)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2262|      0|        if (node && node->implicit )
  ------------------
  |  Branch (2262:13): [True: 0, False: 0]
  |  Branch (2262:21): [True: 0, False: 0]
  ------------------
 2263|      0|            return yes;
 2264|  20.6k|    }
 2265|      0|    return no;
 2266|  20.6k|}
tidylib.c:tidyDocSaveBuffer:
 1383|  20.6k|{
 1384|  20.6k|    int status = -EINVAL;
 1385|  20.6k|    if ( outbuf )
  ------------------
  |  Branch (1385:10): [True: 20.6k, False: 0]
  ------------------
 1386|  20.6k|    {
 1387|  20.6k|        uint outenc = cfg( doc, TidyOutCharEncoding );
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1388|  20.6k|        uint nl = cfg( doc, TidyNewline );
  ------------------
  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  ------------------
 1389|  20.6k|        StreamOut* out = TY_(BufferOutput)( doc, outbuf, outenc, nl );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1390|       |
 1391|  20.6k|        status = tidyDocSaveStream( doc, out );
 1392|  20.6k|        TidyDocFree( doc, out );
  ------------------
  |  |  159|  20.6k|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|  20.6k|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 1393|  20.6k|    }
 1394|  20.6k|    return status;
 1395|  20.6k|}
tidylib.c:tidyDocStatus:
 1408|  82.4k|{
 1409|  82.4k|    if ( doc->errors > 0 )
  ------------------
  |  Branch (1409:10): [True: 21.5k, False: 60.9k]
  ------------------
 1410|  21.5k|        return 2;
 1411|  60.9k|    if ( doc->warnings > 0 || doc->accessErrors > 0 )
  ------------------
  |  Branch (1411:10): [True: 60.8k, False: 4]
  |  Branch (1411:31): [True: 0, False: 4]
  ------------------
 1412|  60.8k|        return 1;
 1413|      4|    return 0;
 1414|  60.9k|}
tidylib.c:tidyDocRunDiagnostics:
 1521|  20.6k|{
 1522|  20.6k|    TY_(ReportMarkupVersion)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1523|  20.6k|    TY_(ReportNumWarnings)( doc );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1524|       |
 1525|  20.6k|    if ( doc->errors > 0 && !cfgBool( doc, TidyForceOutput ) )
  ------------------
  |  |  418|  5.38k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  5.38k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1525:10): [True: 5.38k, False: 15.2k]
  |  Branch (1525:29): [True: 5.38k, False: 0]
  ------------------
 1526|  5.38k|        TY_(Dialogue)(doc, STRING_NEEDS_INTERVENTION );
  ------------------
  |  |   23|  5.38k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  5.38k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1527|       |
 1528|  20.6k|     return tidyDocStatus( doc );
 1529|  20.6k|}
tidylib.c:tidyDocCleanAndRepair:
 2100|  20.6k|{
 2101|  20.6k|    Bool word2K   = cfgBool( doc, TidyWord2000 );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2102|  20.6k|    Bool logical  = cfgBool( doc, TidyLogicalEmphasis );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2103|  20.6k|    Bool clean    = cfgBool( doc, TidyMakeClean );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2104|  20.6k|    Bool gdoc     = cfgBool( doc, TidyGDocClean );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2105|  20.6k|    Bool htmlOut  = cfgBool( doc, TidyHtmlOut );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2106|  20.6k|    Bool xmlOut   = cfgBool( doc, TidyXmlOut );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2107|  20.6k|    Bool xhtmlOut = cfgBool( doc, TidyXhtmlOut );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2108|  20.6k|    Bool xmlDecl  = cfgBool( doc, TidyXmlDecl );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2109|  20.6k|    Bool tidyMark = cfgBool( doc, TidyMark );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2110|  20.6k|    Bool tidyXmlTags = cfgBool( doc, TidyXmlTags );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2111|  20.6k|    Bool wantNameAttr = cfgBool( doc, TidyAnchorAsName );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2112|  20.6k|    Bool mergeEmphasis = cfgBool( doc, TidyMergeEmphasis );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 2113|  20.6k|    Node* node;
 2114|  20.6k|    TidyConfigChangeCallback callback = doc->pConfigChangeCallback;
 2115|  20.6k|    doc->pConfigChangeCallback = NULL;
 2116|       |
 2117|       |#if defined(ENABLE_DEBUG_LOG)
 2118|       |    SPRTF("All nodes BEFORE clean and repair\n");
 2119|       |    dbg_show_all_nodes( doc, &doc->root, 0  );
 2120|       |#endif
 2121|  20.6k|    if (tidyXmlTags)
  ------------------
  |  Branch (2121:9): [True: 0, False: 20.6k]
  ------------------
 2122|      0|    {
 2123|      0|        doc->pConfigChangeCallback = callback;
 2124|      0|        return tidyDocStatus( doc );
 2125|      0|    }
 2126|       |
 2127|       |    /* Issue #567 - move style elements from body to head */
 2128|  20.6k|    TY_(CleanStyle)(doc, &doc->root);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2129|       |
 2130|       |    /* simplifies <b><b> ... </b> ...</b> etc. */
 2131|  20.6k|    if ( mergeEmphasis )
  ------------------
  |  Branch (2131:10): [True: 20.6k, False: 0]
  ------------------
 2132|  20.6k|        TY_(NestedEmphasis)( doc, &doc->root );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2133|       |
 2134|       |    /* cleans up <dir>indented text</dir> etc. */
 2135|  20.6k|    TY_(List2BQ)( doc, &doc->root );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2136|  20.6k|    TY_(BQ2Div)( doc, &doc->root );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2137|       |
 2138|       |    /* replaces i by em and b by strong */
 2139|  20.6k|    if ( logical )
  ------------------
  |  Branch (2139:10): [True: 0, False: 20.6k]
  ------------------
 2140|      0|        TY_(EmFromI)( doc, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2141|       |
 2142|  20.6k|    if ( word2K && TY_(IsWord2000)(doc) )
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2142:10): [True: 0, False: 20.6k]
  |  Branch (2142:20): [True: 0, False: 0]
  ------------------
 2143|      0|    {
 2144|       |        /* prune Word2000's <![if ...]> ... <![endif]> */
 2145|      0|        TY_(DropSections)( doc, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2146|       |
 2147|       |        /* drop style & class attributes and empty p, span elements */
 2148|      0|        TY_(CleanWord2000)( doc, &doc->root );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2149|      0|        TY_(DropEmptyElements)(doc, &doc->root);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2150|      0|    }
 2151|       |
 2152|       |    /* replaces presentational markup by style rules */
 2153|  20.6k|    if ( clean )
  ------------------
  |  Branch (2153:10): [True: 0, False: 20.6k]
  ------------------
 2154|      0|        TY_(CleanDocument)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2155|       |
 2156|       |    /* clean up html exported by Google Docs */
 2157|  20.6k|    if ( gdoc )
  ------------------
  |  Branch (2157:10): [True: 0, False: 20.6k]
  ------------------
 2158|      0|        TY_(CleanGoogleDocument)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2159|       |
 2160|       |    /*  Reconcile http-equiv meta element with output encoding  */
 2161|  20.6k|    TY_(TidyMetaCharset)(doc);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2162|       |
 2163|  20.6k|    if ( !TY_(CheckNodeIntegrity)( &doc->root ) )
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (2163:10): [True: 0, False: 20.6k]
  ------------------
 2164|      0|        TidyPanic( doc->allocator, integrity );
  ------------------
  |  |   69|      0|#define TidyPanic(allocator, msg) ((allocator)->vtbl->panic((allocator), (msg)))
  ------------------
 2165|       |
 2166|       |    /* remember given doctype for reporting */
 2167|  20.6k|    node = TY_(FindDocType)(doc);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2168|       |
 2169|  20.6k|    if (node)
  ------------------
  |  Branch (2169:9): [True: 2.22k, False: 18.3k]
  ------------------
 2170|  2.22k|    {
 2171|  2.22k|        AttVal* fpi = TY_(GetAttrByName)(node, "PUBLIC");
  ------------------
  |  |   23|  2.22k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.22k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2172|  2.22k|        if (AttrHasValue(fpi))
  ------------------
  |  |  171|  2.22k|#define AttrHasValue(attr)      ((attr) && (attr)->value)
  |  |  ------------------
  |  |  |  Branch (171:34): [True: 230, False: 1.99k]
  |  |  |  Branch (171:44): [True: 134, False: 96]
  |  |  ------------------
  ------------------
 2173|    134|        {
 2174|    134|            if (doc->givenDoctype)
  ------------------
  |  Branch (2174:17): [True: 0, False: 134]
  ------------------
 2175|    134|                TidyDocFree(doc, doc->givenDoctype);
  ------------------
  |  |  159|      0|#define TidyDocFree(doc, block) TidyFree((doc)->allocator, block)
  |  |  ------------------
  |  |  |  |   68|      0|#define TidyFree(allocator, block) ((allocator)->vtbl->free((allocator), (block)))
  |  |  ------------------
  ------------------
 2176|    134|            doc->givenDoctype = TY_(tmbstrdup)(doc->allocator,fpi->value);
  ------------------
  |  |   23|    134|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    134|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2177|    134|        }
 2178|  2.22k|    }
 2179|       |
 2180|  20.6k|    if ( doc->root.content )
  ------------------
  |  Branch (2180:10): [True: 20.6k, False: 0]
  ------------------
 2181|  20.6k|    {
 2182|       |        /* If we had XHTML input but want HTML output */
 2183|  20.6k|        if ( htmlOut && doc->lexer->isvoyager )
  ------------------
  |  Branch (2183:14): [True: 0, False: 20.6k]
  |  Branch (2183:25): [True: 0, False: 0]
  ------------------
 2184|      0|        {
 2185|      0|            Node* node = TY_(FindDocType)(doc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2186|       |            /* Remove reference, but do not free */
 2187|      0|            if (node)
  ------------------
  |  Branch (2187:17): [True: 0, False: 0]
  ------------------
 2188|      0|              TY_(RemoveNode)(node);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2189|      0|        }
 2190|       |
 2191|  20.6k|        if (xhtmlOut && !htmlOut)
  ------------------
  |  Branch (2191:13): [True: 20.6k, False: 0]
  |  Branch (2191:25): [True: 20.6k, False: 0]
  ------------------
 2192|  20.6k|        {
 2193|  20.6k|            TY_(SetXHTMLDocType)(doc);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2194|  20.6k|            TY_(FixAnchors)(doc, &doc->root, wantNameAttr, yes);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2195|  20.6k|            TY_(FixXhtmlNamespace)(doc, yes);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2196|  20.6k|            TY_(FixLanguageInformation)(doc, &doc->root, yes, yes);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2197|  20.6k|        }
 2198|      0|        else
 2199|      0|        {
 2200|      0|            TY_(FixDocType)(doc);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2201|      0|            TY_(FixAnchors)(doc, &doc->root, wantNameAttr, yes);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2202|      0|            TY_(FixXhtmlNamespace)(doc, no);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2203|      0|            TY_(FixLanguageInformation)(doc, &doc->root, no, yes);
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2204|      0|        }
 2205|       |
 2206|  20.6k|        if (tidyMark )
  ------------------
  |  Branch (2206:13): [True: 20.6k, False: 0]
  ------------------
 2207|  20.6k|            TY_(AddGenerator)(doc);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2208|       |
 2209|  20.6k|    }
 2210|       |
 2211|       |    /* ensure presence of initial <?xml version="1.0"?> */
 2212|  20.6k|    if ( xmlOut && xmlDecl )
  ------------------
  |  Branch (2212:10): [True: 20.6k, False: 0]
  |  Branch (2212:20): [True: 0, False: 20.6k]
  ------------------
 2213|      0|        TY_(FixXmlDecl)( doc );
  ------------------
  |  |   23|      0|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      0|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2214|       |
 2215|       |    /* At this point the apparent doctype is going to be as stable as
 2216|       |       it can ever be, so we can start detecting things that shouldn't
 2217|       |       be in this version of HTML
 2218|       |     */
 2219|  20.6k|    if (doc->lexer) 
  ------------------
  |  Branch (2219:9): [True: 20.6k, False: 0]
  ------------------
 2220|  20.6k|    {
 2221|       |        /*\ 
 2222|       |         *  Issue #429 #426 - These services can only be used
 2223|       |         *  when there is a document loaded, ie a lexer created.
 2224|       |         *  But really should not be calling a Clean and Repair
 2225|       |         *  service with no doc!
 2226|       |        \*/
 2227|  20.6k|        if (doc->lexer->versionEmitted & VERS_HTML5)
  ------------------
  |  |  213|  20.6k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  20.6k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  20.6k|#define XH50              262144u
  |  |  ------------------
  ------------------
  |  Branch (2227:13): [True: 20.4k, False: 170]
  ------------------
 2228|  20.4k|            TY_(CheckHTML5)( doc, &doc->root );
  ------------------
  |  |   23|  20.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2229|  20.6k|        TY_(CheckHTMLTagsAttribsVersions)( doc, &doc->root );
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2230|       |
 2231|  20.6k|        if ( !doc->lexer->isvoyager && doc->xmlDetected )
  ------------------
  |  Branch (2231:14): [True: 19.1k, False: 1.45k]
  |  Branch (2231:40): [True: 133, False: 19.0k]
  ------------------
 2232|    133|        {
 2233|    133|            TY_(Report)(doc, NULL, TY_(FindXmlDecl)(doc), XML_DECLARATION_DETECTED );
  ------------------
  |  |   23|    133|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    133|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                          TY_(Report)(doc, NULL, TY_(FindXmlDecl)(doc), XML_DECLARATION_DETECTED );
  ------------------
  |  |   23|    133|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    133|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2234|       |
 2235|    133|        }
 2236|  20.6k|    }
 2237|       |
 2238|  20.6k|    TY_(CleanHead)(doc); /* Is #692 - discard multiple <title> tags */
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 2239|       |
 2240|       |#if defined(ENABLE_DEBUG_LOG)
 2241|       |    SPRTF("All nodes AFTER clean and repair\n");
 2242|       |    dbg_show_all_nodes( doc, &doc->root, 0  );
 2243|       |#endif
 2244|       |
 2245|  20.6k|    doc->pConfigChangeCallback = callback;
 2246|  20.6k|    return tidyDocStatus( doc );
 2247|  20.6k|}
tidylib.c:prvTidyCheckHTML5:
 1632|  20.4k|{
 1633|  20.4k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1634|  20.4k|    Bool clean = cfgBool( doc, TidyMakeClean );
  ------------------
  |  |  418|  20.4k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1635|  20.4k|    Bool already_strict = cfgBool( doc, TidyStrictTagsAttr );
  ------------------
  |  |  418|  20.4k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.4k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1636|  20.4k|    Node* body = TY_(FindBody)( doc );
  ------------------
  |  |   23|  20.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1637|  20.4k|    Node* next;
 1638|  20.4k|    Bool warn = yes;    /* should this be a warning, error, or report??? */
 1639|  20.4k|    AttVal* attr = NULL;
 1640|  20.4k|    int i = 0;
 1641|       |
 1642|  2.72M|    while (node)
  ------------------
  |  Branch (1642:12): [True: 2.69M, False: 20.4k]
  ------------------
 1643|  2.69M|    {
 1644|  2.69M|        next = node->next;
 1645|       |        
 1646|  2.69M|        if ( nodeHasAlignAttr( node ) ) {
  ------------------
  |  Branch (1646:14): [True: 10.7k, False: 2.68M]
  ------------------
 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|  10.7k|            if ( !already_strict )
  ------------------
  |  Branch (1655:18): [True: 10.7k, False: 0]
  ------------------
 1656|  10.7k|                TY_(ReportAttrError)(doc, node, TY_(AttrGetById)(node, TidyAttr_ALIGN), MISMATCHED_ATTRIBUTE_WARN);
  ------------------
  |  |   23|  10.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                              TY_(ReportAttrError)(doc, node, TY_(AttrGetById)(node, TidyAttr_ALIGN), MISMATCHED_ATTRIBUTE_WARN);
  ------------------
  |  |   23|  10.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  10.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1657|  10.7k|        }
 1658|  2.69M|        if ( node == body ) {
  ------------------
  |  Branch (1658:14): [True: 20.2k, False: 2.67M]
  ------------------
 1659|  20.2k|            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.2k|            if ( !already_strict ) {
  ------------------
  |  Branch (1664:18): [True: 20.2k, False: 0]
  ------------------
 1665|   141k|                while ( BadBody5Attribs[i] != TidyAttr_UNKNOWN ) {
  ------------------
  |  Branch (1665:25): [True: 121k, False: 20.2k]
  ------------------
 1666|   121k|                    attr = TY_(AttrGetById)(node, BadBody5Attribs[i]);
  ------------------
  |  |   23|   121k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   121k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1667|   121k|                    if ( attr )
  ------------------
  |  Branch (1667:26): [True: 2, False: 121k]
  ------------------
 1668|      2|                        TY_(ReportAttrError)(doc, node, attr , MISMATCHED_ATTRIBUTE_WARN);
  ------------------
  |  |   23|      2|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|      2|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1669|   121k|                    i++;
 1670|   121k|                }
 1671|  20.2k|            }
 1672|  20.2k|        } else
 1673|  2.67M|        if ( nodeIsACRONYM(node) ) {
  ------------------
  |  |  469|  2.67M|#define nodeIsACRONYM( node )    TagIsId( node, TidyTag_ACRONYM )
  |  |  ------------------
  |  |  |  |  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: 485k]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 2.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.67M|        if ( nodeIsAPPLET(node) ) {
  ------------------
  |  |  427|  2.67M|#define nodeIsAPPLET( node )     TagIsId( node, TidyTag_APPLET )
  |  |  ------------------
  |  |  |  |  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: 485k]
  |  |  |  |  |  Branch (275:54): [True: 651, False: 2.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1685|    651|            if (clean) {
  ------------------
  |  Branch (1685:17): [True: 0, False: 651]
  ------------------
 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|    651|            } else {
 1691|    651|                if ( !already_strict )
  ------------------
  |  Branch (1691:22): [True: 651, False: 0]
  ------------------
 1692|    651|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    651|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    651|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1693|    651|            }
 1694|    651|        } else
 1695|  2.67M|        if ( nodeIsBASEFONT(node) ) {
  ------------------
  |  |  444|  2.67M|#define nodeIsBASEFONT( node )   TagIsId( node, TidyTag_BASEFONT )
  |  |  ------------------
  |  |  |  |  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: 485k]
  |  |  |  |  |  Branch (275:54): [True: 207, False: 2.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    207|            if ( !already_strict )
  ------------------
  |  Branch (1704:18): [True: 207, False: 0]
  ------------------
 1705|    207|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    207|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    207|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1706|    207|        } else
 1707|  2.67M|        if ( nodeIsBIG(node) ) {
  ------------------
  |  |  407|  2.67M|#define nodeIsBIG( node )        TagIsId( node, TidyTag_BIG )
  |  |  ------------------
  |  |  |  |  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: 485k]
  |  |  |  |  |  Branch (275:54): [True: 367, False: 2.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    367|            if (clean) {
  ------------------
  |  Branch (1722:17): [True: 0, False: 367]
  ------------------
 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|    367|            } else {
 1726|    367|                if ( !already_strict )
  ------------------
  |  Branch (1726:22): [True: 367, False: 0]
  ------------------
 1727|    367|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    367|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    367|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1728|    367|            }
 1729|    367|        } else
 1730|  2.67M|        if ( nodeIsCENTER(node) ) {
  ------------------
  |  |  420|  2.67M|#define nodeIsCENTER( node )     TagIsId( node, TidyTag_CENTER )
  |  |  ------------------
  |  |  |  |  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: 485k]
  |  |  |  |  |  Branch (275:54): [True: 620, False: 2.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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|    620|            if ( !already_strict )
  ------------------
  |  Branch (1737:18): [True: 620, False: 0]
  ------------------
 1738|    620|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    620|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    620|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1739|    620|        } else
 1740|  2.67M|        if ( nodeIsDIR(node) ) {
  ------------------
  |  |  389|  2.67M|#define nodeIsDIR( node )        TagIsId( node, TidyTag_DIR )
  |  |  ------------------
  |  |  |  |  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: 485k]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 2.19M]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.67M|        if ( nodeIsFONT(node) ) {
  ------------------
  |  |  417|  2.67M|#define nodeIsFONT( node )       TagIsId( node, TidyTag_FONT )
  |  |  ------------------
  |  |  |  |  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: 485k]
  |  |  |  |  |  Branch (275:54): [True: 1.50M, False: 683k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.50M|            if ( !already_strict )
  ------------------
  |  Branch (1754:18): [True: 1.50M, False: 0]
  ------------------
 1755|  1.50M|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|  1.50M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.50M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1756|  1.50M|        } else
 1757|  1.16M|        if (( nodesIsFRAME(node) ) || ( nodeIsFRAMESET(node) ) || ( nodeIsNOFRAMES(node) )) {
  ------------------
  |  |  470|  1.16M|#define nodesIsFRAME( node )     TagIsId( node, TidyTag_FRAME )
  |  |  ------------------
  |  |  |  |  275|  1.16M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.16M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 683k, False: 485k]
  |  |  |  |  |  Branch (275:54): [True: 2.23k, False: 681k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (( nodesIsFRAME(node) ) || ( nodeIsFRAMESET(node) ) || ( nodeIsNOFRAMES(node) )) {
  ------------------
  |  |  376|  1.16M|#define nodeIsFRAMESET( node )   TagIsId( node, TidyTag_FRAMESET )
  |  |  ------------------
  |  |  |  |  275|  1.16M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.16M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 681k, False: 485k]
  |  |  |  |  |  Branch (275:54): [True: 13.4k, False: 667k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
                      if (( nodesIsFRAME(node) ) || ( nodeIsFRAMESET(node) ) || ( nodeIsNOFRAMES(node) )) {
  ------------------
  |  |  379|  1.15M|#define nodeIsNOFRAMES( node )   TagIsId( node, TidyTag_NOFRAMES )
  |  |  ------------------
  |  |  |  |  275|  1.15M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.15M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 667k, False: 485k]
  |  |  |  |  |  Branch (275:54): [True: 10.7k, False: 657k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1758|       |            /* YOW: What to do here?????? Maybe <iframe>????
 1759|       |             */
 1760|  26.4k|            if ( !already_strict )
  ------------------
  |  Branch (1760:18): [True: 26.4k, False: 0]
  ------------------
 1761|  26.4k|                TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|  26.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  26.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1762|  26.4k|        } else
 1763|  1.14M|        if ( nodeIsSTRIKE(node) ) {
  ------------------
  |  |  447|  1.14M|#define nodeIsSTRIKE( node )     TagIsId( node, TidyTag_STRIKE )
  |  |  ------------------
  |  |  |  |  275|  1.14M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.14M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 657k, False: 485k]
  |  |  |  |  |  Branch (275:54): [True: 683, False: 656k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1764|       |            /* strike: CSS equivalent 'text-decoration:line-through'
 1765|       |             * maybe should use static void RenameElem( TidyDocImpl* doc, Node* node, TidyTagId tid )
 1766|       |             */
 1767|    683|            if (clean) {
  ------------------
  |  Branch (1767:17): [True: 0, False: 683]
  ------------------
 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|    683|            } else {
 1771|    683|                if ( !already_strict )
  ------------------
  |  Branch (1771:22): [True: 683, False: 0]
  ------------------
 1772|    683|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    683|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    683|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1773|    683|            }
 1774|    683|        } else
 1775|  1.14M|        if ( nodeIsTT(node) ) {
  ------------------
  |  |  471|  1.14M|#define nodeIsTT( node )         TagIsId( node, TidyTag_TT )
  |  |  ------------------
  |  |  |  |  275|  1.14M|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.14M, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 656k, False: 485k]
  |  |  |  |  |  Branch (275:54): [True: 2.04k, False: 654k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 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.04k|            if (clean) {
  ------------------
  |  Branch (1781:17): [True: 0, False: 2.04k]
  ------------------
 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.04k|            } else {
 1785|  2.04k|                if ( !already_strict )
  ------------------
  |  Branch (1785:22): [True: 2.04k, False: 0]
  ------------------
 1786|  2.04k|                    TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|  2.04k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.04k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1787|  2.04k|            }
 1788|  2.04k|        } else
 1789|  1.13M|            if (TY_(nodeIsElement)(node)) {
  ------------------
  |  |   23|  1.13M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.13M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1789:17): [True: 658k, False: 481k]
  ------------------
 1790|   658k|                if (node->tag) {
  ------------------
  |  Branch (1790:21): [True: 654k, False: 4.68k]
  ------------------
 1791|   654k|                    if ( (!(node->tag->versions & VERS_HTML5) && !(node->tag->versions & VERS_PROPRIETARY)) || (inRemovedInfo(node->tag->id)) ) {
  ------------------
  |  |  213|   654k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|   654k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|   654k|#define XH50              262144u
  |  |  ------------------
  ------------------
                                  if ( (!(node->tag->versions & VERS_HTML5) && !(node->tag->versions & VERS_PROPRIETARY)) || (inRemovedInfo(node->tag->id)) ) {
  ------------------
  |  |  231|  1.41k|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  1.41k|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  1.41k|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  1.41k|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  |  Branch (1791:27): [True: 1.41k, False: 652k]
  |  Branch (1791:66): [True: 210, False: 1.20k]
  |  Branch (1791:112): [True: 0, False: 653k]
  ------------------
 1792|    210|                        if ( !already_strict )
  ------------------
  |  Branch (1792:30): [True: 210, False: 0]
  ------------------
 1793|    210|                            TY_(Report)(doc, node, node, REMOVED_HTML5);
  ------------------
  |  |   23|    210|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    210|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1794|    210|                    }
 1795|   654k|                }
 1796|   658k|            }
 1797|       |
 1798|  2.69M|        if (node->content)
  ------------------
  |  Branch (1798:13): [True: 2.05M, False: 640k]
  ------------------
 1799|  2.05M|        {
 1800|  2.05M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.05M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.05M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1801|  2.05M|            node = node->content;
 1802|  2.05M|            continue;
 1803|  2.05M|        }
 1804|       |
 1805|   640k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   151k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   151k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1805:16): [True: 489k, False: 151k]
  ------------------
 1806|   640k|    }
 1807|  20.4k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.4k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.4k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1808|  20.4k|}
tidylib.c:nodeHasAlignAttr:
 1610|  2.69M|{
 1611|       |    /* #define attrIsALIGN(av) AttrIsId( av, TidyAttr_ALIGN  ) */
 1612|  2.69M|    AttVal* av;
 1613|  3.09M|    for ( av = node->attributes; av != NULL; av = av->next ) {
  ------------------
  |  Branch (1613:34): [True: 406k, False: 2.68M]
  ------------------
 1614|   406k|        if (attrIsALIGN(av))
  ------------------
  |  |  187|   406k|#define attrIsALIGN(av)             AttrIsId( av, TidyAttr_ALIGN  )
  |  |  ------------------
  |  |  |  |  169|   406k|#define AttrIsId(av, atid) ((av) && (av)->dict && ((av)->dict->id == atid))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (169:29): [True: 406k, False: 0]
  |  |  |  |  |  Branch (169:37): [True: 293k, False: 112k]
  |  |  |  |  |  Branch (169:51): [True: 10.7k, False: 282k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1615|  10.7k|            return yes;
 1616|   406k|    }
 1617|  2.68M|    return no;
 1618|  2.69M|}
tidylib.c:inRemovedInfo:
 1584|   653k|{
 1585|   653k|    int i;
 1586|  8.50M|    for (i = 0; ; i++) {
 1587|  8.50M|        if (html5Info[i].tag == 0)
  ------------------
  |  Branch (1587:13): [True: 653k, False: 7.84M]
  ------------------
 1588|   653k|            break;
 1589|  7.84M|        if (html5Info[i].id == tid)
  ------------------
  |  Branch (1589:13): [True: 0, False: 7.84M]
  ------------------
 1590|      0|            return yes;
 1591|  7.84M|    }
 1592|   653k|    return no;
 1593|   653k|}
tidylib.c:prvTidyCheckHTMLTagsAttribsVersions:
 1827|  20.6k|{
 1828|  20.6k|    Stack *stack = TY_(newStack)(doc, 16);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1829|  20.6k|    Node *next;
 1830|  20.6k|    uint versionEmitted = doc->lexer->versionEmitted;
 1831|  20.6k|    uint declared = doc->lexer->doctype;
 1832|  20.6k|    uint version = versionEmitted == 0 ? declared : versionEmitted;
  ------------------
  |  Branch (1832:20): [True: 24, False: 20.5k]
  ------------------
 1833|  20.6k|    int tagReportType = VERS_STRICT & version ? ELEMENT_VERS_MISMATCH_ERROR : ELEMENT_VERS_MISMATCH_WARN;
  ------------------
  |  |  225|  20.6k|#define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  213|  20.6k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  200|  20.6k|#define HT50              131072u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  201|  20.6k|#define XH50              262144u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  207|  20.6k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  20.6k|#define H40S                   4u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  20.6k|#define H41S                  32u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  185|  20.6k|#define X10S                 256u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1833:25): [True: 20.4k, False: 145]
  ------------------
 1834|  20.6k|    int attrReportType = VERS_STRICT & version ? MISMATCHED_ATTRIBUTE_ERROR : MISMATCHED_ATTRIBUTE_WARN;
  ------------------
  |  |  225|  20.6k|#define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  213|  20.6k|#define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  200|  20.6k|#define HT50              131072u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  |  |  ------------------
  |  |  |  |  |  |  201|  20.6k|#define XH50              262144u
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define VERS_STRICT        (VERS_HTML5|VERS_HTML40_STRICT)
  |  |  ------------------
  |  |  |  |  207|  20.6k|#define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  179|  20.6k|#define H40S                   4u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  182|  20.6k|#define H41S                  32u
  |  |  |  |  ------------------
  |  |  |  |               #define VERS_HTML40_STRICT (H40S|H41S|X10S)
  |  |  |  |  ------------------
  |  |  |  |  |  |  185|  20.6k|#define X10S                 256u
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1834:26): [True: 20.4k, False: 145]
  ------------------
 1835|  20.6k|    Bool check_versions = cfgBool( doc, TidyStrictTagsAttr );
  ------------------
  |  |  418|  20.6k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  20.6k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
 1836|  20.6k|    AttVal *next_attr, *attval;
 1837|  20.6k|    Bool attrIsProprietary = no;
 1838|  20.6k|    Bool attrIsMismatched = yes;
 1839|  20.6k|    Bool tagLooksCustom = no;
 1840|  20.6k|    Bool htmlIs5 = (doc->lexer->doctype & VERS_HTML5) > 0;
  ------------------
  |  |  213|  20.6k|#define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  200|  20.6k|#define HT50              131072u
  |  |  ------------------
  |  |               #define VERS_HTML5         (HT50|XH50)
  |  |  ------------------
  |  |  |  |  201|  20.6k|#define XH50              262144u
  |  |  ------------------
  ------------------
 1841|       |
 1842|  2.74M|    while (node)
  ------------------
  |  Branch (1842:12): [True: 2.72M, False: 20.6k]
  ------------------
 1843|  2.72M|    {
 1844|  2.72M|        next = node->next;
 1845|       |
 1846|       |        /* This bit here handles our HTML tags */
 1847|  2.72M|        if ( TY_(nodeIsElement)(node) && node->tag ) {
  ------------------
  |  |   23|  2.72M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.72M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1847:14): [True: 2.22M, False: 498k]
  |  Branch (1847:42): [True: 2.21M, False: 5.35k]
  ------------------
 1848|       |
 1849|       |            /* Leave XML stuff alone. */
 1850|  2.21M|            if ( !cfgBool(doc, TidyXmlTags) )
  ------------------
  |  |  418|  2.21M|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  2.21M|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1850:18): [True: 2.21M, False: 0]
  ------------------
 1851|  2.21M|            {
 1852|       |                /* Version mismatches take priority. */
 1853|  2.21M|                if ( check_versions && !(node->tag->versions & version) )
  ------------------
  |  Branch (1853:22): [True: 0, False: 2.21M]
  |  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.21M|                else if ( node->tag->versions & VERS_PROPRIETARY )
  ------------------
  |  |  231|  2.21M|#define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  193|  2.21M|#define VERS_NETSCAPE      16384u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  194|  2.21M|#define VERS_MICROSOFT     32768u
  |  |  ------------------
  |  |               #define VERS_PROPRIETARY   (VERS_NETSCAPE|VERS_MICROSOFT|VERS_SUN)
  |  |  ------------------
  |  |  |  |  192|  2.21M|#define VERS_SUN            8192u
  |  |  ------------------
  ------------------
  |  Branch (1858:27): [True: 1.20k, False: 2.21M]
  ------------------
 1859|  1.20k|                {
 1860|  1.20k|                    if ( !cfgBool(doc, TidyMakeClean) ||
  ------------------
  |  |  418|  2.40k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|  1.20k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  ------------------
  |  Branch (1860:26): [True: 1.20k, 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.20k|                    {
 1863|       |                        /* It looks custom, despite whether it's a known tag. */
 1864|  1.20k|                        tagLooksCustom = TY_(nodeIsAutonomousCustomFormat)( node );
  ------------------
  |  |   23|  1.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.20k|#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.20k|                        if ( (htmlIs5 && !tagLooksCustom) || !htmlIs5 )
  ------------------
  |  Branch (1873:31): [True: 262, False: 939]
  |  Branch (1873:42): [True: 262, False: 0]
  |  Branch (1873:62): [True: 939, False: 0]
  ------------------
 1874|  1.20k|                        {
 1875|  1.20k|                            TY_(Report)(doc, NULL, node, PROPRIETARY_ELEMENT );
  ------------------
  |  |   23|  1.20k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.20k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1876|  1.20k|                        }
 1877|       |
 1878|  1.20k|                        if ( nodeIsLAYER(node) )
  ------------------
  |  |  418|  1.20k|#define nodeIsLAYER( node )      TagIsId( node, TidyTag_LAYER )
  |  |  ------------------
  |  |  |  |  275|  1.20k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.20k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.20k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 21, False: 1.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1879|     21|                            doc->badLayout |= USING_LAYER;
  ------------------
  |  |  292|     21|#define USING_LAYER             2
  ------------------
 1880|  1.18k|                        else if ( nodeIsSPACER(node) )
  ------------------
  |  |  419|  1.18k|#define nodeIsSPACER( node )     TagIsId( node, TidyTag_SPACER )
  |  |  ------------------
  |  |  |  |  275|  1.18k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.18k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.18k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 0, False: 1.18k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1881|      0|                            doc->badLayout |= USING_SPACER;
  ------------------
  |  |  291|      0|#define USING_SPACER            1
  ------------------
 1882|  1.18k|                        else if ( nodeIsNOBR(node) )
  ------------------
  |  |  415|  1.18k|#define nodeIsNOBR( node )       TagIsId( node, TidyTag_NOBR )
  |  |  ------------------
  |  |  |  |  275|  1.18k|#define TagIsId(node, tid) ((node) && (node)->tag && (node)->tag->id == tid)
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (275:29): [True: 1.18k, False: 0]
  |  |  |  |  |  Branch (275:39): [True: 1.18k, False: 0]
  |  |  |  |  |  Branch (275:54): [True: 1.03k, False: 141]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1883|  1.03k|                            doc->badLayout |= USING_NOBR;
  ------------------
  |  |  293|  1.03k|#define USING_NOBR              4
  ------------------
 1884|  1.20k|                    }
 1885|  1.20k|                }
 1886|  2.21M|            }
 1887|  2.21M|        }
 1888|       |
 1889|       |        /* And this bit here handles our attributes */
 1890|  2.72M|        if (TY_(nodeIsElement)(node))
  ------------------
  |  |   23|  2.72M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.72M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1890:13): [True: 2.22M, False: 498k]
  ------------------
 1891|  2.22M|        {
 1892|  2.22M|            attval = node->attributes;
 1893|       |
 1894|  2.62M|            while (attval)
  ------------------
  |  Branch (1894:20): [True: 396k, False: 2.22M]
  ------------------
 1895|   396k|            {
 1896|   396k|                next_attr = attval->next;
 1897|       |
 1898|   396k|                attrIsProprietary = TY_(AttributeIsProprietary)(node, attval);
  ------------------
  |  |   23|   396k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   396k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1899|       |                /* Is. #729 - always check version match if HTML5 */
 1900|   396k|                attrIsMismatched = (check_versions | htmlIs5) ? TY_(AttributeIsMismatched)(node, attval, doc) : no;
  ------------------
  |  |   23|  6.33k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  6.33k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1900:36): [True: 6.33k, False: 390k]
  ------------------
 1901|       |                /* Let the PROPRIETARY_ATTRIBUTE warning have precedence. */
 1902|   396k|                if ( attrIsProprietary )
  ------------------
  |  Branch (1902:22): [True: 154k, False: 242k]
  ------------------
 1903|   154k|                {
 1904|   154k|                    if ( cfgBool(doc, TidyWarnPropAttrs) )
  ------------------
  |  |  418|   154k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   154k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 154k, False: 0]
  |  |  ------------------
  ------------------
 1905|   154k|                        TY_(ReportAttrError)(doc, node, attval, PROPRIETARY_ATTRIBUTE);
  ------------------
  |  |   23|   154k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   154k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1906|   154k|                }
 1907|   242k|                else if ( attrIsMismatched )
  ------------------
  |  Branch (1907:27): [True: 533, False: 241k]
  ------------------
 1908|    533|                {
 1909|    533|                    if (htmlIs5) 
  ------------------
  |  Branch (1909:25): [True: 533, False: 0]
  ------------------
 1910|    533|                    { 
 1911|       |                        /* Is. #729 - In html5 TidyStrictTagsAttr controls error or warn */
 1912|    533|                        TY_(ReportAttrError)(doc, node, attval,
  ------------------
  |  |   23|    533|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|    533|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1913|    533|                            check_versions ? MISMATCHED_ATTRIBUTE_ERROR : MISMATCHED_ATTRIBUTE_WARN);
  ------------------
  |  Branch (1913:29): [True: 0, False: 533]
  ------------------
 1914|    533|                    }
 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|    533|                }
 1919|       |
 1920|       |                /* @todo: do we need a new option to drop mismatches? Or should we
 1921|       |                 simply drop them? */
 1922|   396k|                if ( ( attrIsProprietary || attrIsMismatched ) && cfgBool(doc, TidyDropPropAttrs) )
  ------------------
  |  |  418|   154k|#define cfgBool(doc, id)        ((Bool) cfg(doc, id))
  |  |  ------------------
  |  |  |  |  415|   154k|#define cfg(doc, id)            ((doc)->config.value[ (id) ].v)
  |  |  ------------------
  |  |  |  Branch (418:33): [True: 0, False: 154k]
  |  |  ------------------
  ------------------
  |  Branch (1922:24): [True: 154k, False: 242k]
  |  Branch (1922:45): [True: 533, False: 241k]
  ------------------
 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|   396k|                attval = next_attr;
 1926|   396k|            }
 1927|  2.22M|        }
 1928|       |
 1929|  2.72M|        if (node->content)
  ------------------
  |  Branch (1929:13): [True: 2.06M, False: 660k]
  ------------------
 1930|  2.06M|        {
 1931|  2.06M|            TY_(push)(stack, next);
  ------------------
  |  |   23|  2.06M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.06M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1932|  2.06M|            node = node->content;
 1933|  2.06M|            continue;
 1934|  2.06M|        }
 1935|       |
 1936|   660k|        node = next ? next : TY_(pop)(stack);
  ------------------
  |  |   23|   152k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|   152k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (1936:16): [True: 507k, False: 152k]
  ------------------
 1937|   660k|    }
 1938|  20.6k|    TY_(freeStack)(stack);
  ------------------
  |  |   23|  20.6k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  20.6k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
 1939|  20.6k|}

prvTidytmbstrdup:
   14|  3.27M|{
   15|  3.27M|    tmbstr s = NULL;
   16|  3.27M|    if ( str )
  ------------------
  |  Branch (16:10): [True: 3.12M, False: 148k]
  ------------------
   17|  3.12M|    {
   18|  3.12M|        uint len = TY_(tmbstrlen)( str );
  ------------------
  |  |   23|  3.12M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  3.12M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
   19|  3.12M|        tmbstr cp = s = (tmbstr) TidyAlloc( allocator, 1+len );
  ------------------
  |  |   66|  3.12M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
   20|  31.5M|        while ( 0 != (*cp++ = *str++) )
  ------------------
  |  Branch (20:17): [True: 28.4M, False: 3.12M]
  ------------------
   21|  28.4M|            /**/;
   22|  3.12M|    }
   23|  3.27M|    return s;
   24|  3.27M|}
prvTidytmbstrndup:
   28|  1.43M|{
   29|  1.43M|    tmbstr s = NULL;
   30|  1.43M|    if ( str && len > 0 )
  ------------------
  |  Branch (30:10): [True: 1.43M, False: 0]
  |  Branch (30:17): [True: 1.32M, False: 116k]
  ------------------
   31|  1.32M|    {
   32|  1.32M|        tmbstr cp = s = (tmbstr) TidyAlloc( allocator, 1+len );
  ------------------
  |  |   66|  1.32M|#define TidyAlloc(allocator, size) ((allocator)->vtbl->alloc((allocator), (size)))
  ------------------
   33|  18.5M|        while ( len-- > 0 &&  (*cp++ = *str++) )
  ------------------
  |  Branch (33:17): [True: 17.2M, False: 1.31M]
  |  Branch (33:31): [True: 17.2M, False: 1.99k]
  ------------------
   34|  17.2M|          /**/;
   35|  1.32M|        *cp = 0;
   36|  1.32M|    }
   37|  1.43M|    return s;
   38|  1.43M|}
prvTidytmbstrcpy:
   56|  1.47k|{
   57|  1.47k|    uint ncpy = 0;
   58|   662k|    while (0 != (*s1++ = *s2++) )
  ------------------
  |  Branch (58:12): [True: 661k, False: 1.47k]
  ------------------
   59|   661k|        ++ncpy;
   60|  1.47k|    return ncpy;
   61|  1.47k|}
prvTidytmbstrcat:
   66|  2.56k|{
   67|  2.56k|    uint ncpy = 0;
   68|  1.00M|    while ( *s1 )
  ------------------
  |  Branch (68:13): [True: 1.00M, False: 2.56k]
  ------------------
   69|  1.00M|        ++s1;
   70|       |
   71|  13.3k|    while (0 != (*s1++ = *s2++) )
  ------------------
  |  Branch (71:12): [True: 10.7k, False: 2.56k]
  ------------------
   72|  10.7k|        ++ncpy;
   73|  2.56k|    return ncpy;
   74|  2.56k|}
prvTidytmbstrcmp:
   78|  45.4M|{
   79|  45.4M|    int c;
   80|   601M|    while ((c = *s1) == *s2)
  ------------------
  |  Branch (80:12): [True: 557M, False: 44.5M]
  ------------------
   81|   557M|    {
   82|   557M|        if (c == '\0')
  ------------------
  |  Branch (82:13): [True: 897k, False: 556M]
  ------------------
   83|   897k|            return 0;
   84|       |
   85|   556M|        ++s1;
   86|   556M|        ++s2;
   87|   556M|    }
   88|       |
   89|  44.5M|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (89:13): [True: 12.4M, False: 32.1M]
  ------------------
   90|  45.4M|}
prvTidytmbstrlen:
   94|  22.5M|{
   95|  22.5M|    uint len = 0;
   96|  22.5M|    if ( str ) 
  ------------------
  |  Branch (96:10): [True: 22.5M, False: 0]
  ------------------
   97|  22.5M|    {
   98|  39.4G|        while ( *str++ )
  ------------------
  |  Branch (98:17): [True: 39.4G, False: 22.5M]
  ------------------
   99|  39.4G|            ++len;
  100|  22.5M|    }
  101|  22.5M|    return len;
  102|  22.5M|}
prvTidytmbstrcasecmp:
  112|  66.5M|{
  113|  66.5M|    uint c;
  114|       |
  115|  72.6M|    while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  72.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  72.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  72.6M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  72.6M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (115:12): [True: 6.56M, False: 66.1M]
  ------------------
  116|  6.56M|    {
  117|  6.56M|        if (c == '\0')
  ------------------
  |  Branch (117:13): [True: 414k, False: 6.14M]
  ------------------
  118|   414k|            return 0;
  119|       |
  120|  6.14M|        ++s1;
  121|  6.14M|        ++s2;
  122|  6.14M|    }
  123|       |
  124|  66.1M|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (124:13): [True: 29.8M, False: 36.2M]
  ------------------
  125|  66.5M|}
prvTidytmbstrncmp:
  128|  10.3M|{
  129|  10.3M|    uint c;
  130|       |
  131|  10.3M|	if (s1 == NULL || s2 == NULL)
  ------------------
  |  Branch (131:6): [True: 0, False: 10.3M]
  |  Branch (131:20): [True: 0, False: 10.3M]
  ------------------
  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|  10.5M|    while ((c = (byte)*s1) == (byte)*s2)
  ------------------
  |  Branch (138:12): [True: 173k, False: 10.3M]
  ------------------
  139|   173k|    {
  140|   173k|        if (c == '\0')
  ------------------
  |  Branch (140:13): [True: 2.76k, False: 170k]
  ------------------
  141|  2.76k|            return 0;
  142|       |
  143|   170k|        if (n == 0)
  ------------------
  |  Branch (143:13): [True: 0, False: 170k]
  ------------------
  144|      0|            return 0;
  145|       |
  146|   170k|        ++s1;
  147|   170k|        ++s2;
  148|   170k|        --n;
  149|   170k|    }
  150|       |
  151|  10.3M|    if (n == 0)
  ------------------
  |  Branch (151:9): [True: 25.4k, False: 10.3M]
  ------------------
  152|  25.4k|        return 0;
  153|       |
  154|  10.3M|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (154:13): [True: 812k, False: 9.54M]
  ------------------
  155|  10.3M|}
prvTidytmbstrncasecmp:
  158|  15.1k|{
  159|  15.1k|    uint c;
  160|       |
  161|  41.7k|    while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  41.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  while (c = (uint)(*s1), TY_(ToLower)(c) == TY_(ToLower)((uint)(*s2)))
  ------------------
  |  |   23|  41.7k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  41.7k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (161:12): [True: 26.8k, False: 14.9k]
  ------------------
  162|  26.8k|    {
  163|  26.8k|        if (c == '\0')
  ------------------
  |  Branch (163:13): [True: 208, False: 26.6k]
  ------------------
  164|    208|            return 0;
  165|       |
  166|  26.6k|        if (n == 0)
  ------------------
  |  Branch (166:13): [True: 0, False: 26.6k]
  ------------------
  167|      0|            return 0;
  168|       |
  169|  26.6k|        ++s1;
  170|  26.6k|        ++s2;
  171|  26.6k|        --n;
  172|  26.6k|    }
  173|       |
  174|  14.9k|    if (n == 0)
  ------------------
  |  Branch (174:9): [True: 3.87k, False: 11.0k]
  ------------------
  175|  3.87k|        return 0;
  176|       |
  177|  11.0k|    return (*s1 > *s2 ? 1 : -1);
  ------------------
  |  Branch (177:13): [True: 8.26k, False: 2.79k]
  ------------------
  178|  14.9k|}
prvTidytmbsubstrn:
  181|  1.36k|{
  182|  1.36k|    uint len2 = TY_(tmbstrlen)(s2);
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  183|  1.36k|    int ix, diff = len1 - len2;
  184|       |
  185|  9.61M|    for ( ix = 0; ix <= diff; ++ix )
  ------------------
  |  Branch (185:19): [True: 9.61M, False: 1.29k]
  ------------------
  186|  9.61M|    {
  187|  9.61M|        if ( TY_(tmbstrncmp)(s1+ix, s2, len2) == 0 )
  ------------------
  |  |   23|  9.61M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  9.61M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (187:14): [True: 71, False: 9.61M]
  ------------------
  188|     71|            return (ctmbstr) s1+ix;
  189|  9.61M|    }
  190|  1.29k|    return NULL;
  191|  1.36k|}
prvTidytmbsubstr:
  194|  1.36k|{
  195|  1.36k|    uint len1 = TY_(tmbstrlen)(s1), len2 = TY_(tmbstrlen)(s2);
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
                  uint len1 = TY_(tmbstrlen)(s1), len2 = TY_(tmbstrlen)(s2);
  ------------------
  |  |   23|  1.36k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.36k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  196|  1.36k|    int ix, diff = len1 - len2;
  197|       |
  198|  3.06k|    for ( ix = 0; ix <= diff; ++ix )
  ------------------
  |  Branch (198:19): [True: 1.98k, False: 1.08k]
  ------------------
  199|  1.98k|    {
  200|  1.98k|        if ( TY_(tmbstrncasecmp)(s1+ix, s2, len2) == 0 )
  ------------------
  |  |   23|  1.98k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  1.98k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  |  Branch (200:14): [True: 277, False: 1.70k]
  ------------------
  201|    277|            return (ctmbstr) s1+ix;
  202|  1.98k|    }
  203|  1.08k|    return NULL;
  204|  1.36k|}
prvTidytmbstrtolower:
  208|  87.2k|{
  209|  87.2k|    tmbstr cp;
  210|  2.86M|    for ( cp=s; *cp; ++cp )
  ------------------
  |  Branch (210:17): [True: 2.77M, False: 87.2k]
  ------------------
  211|  2.77M|        *cp = (tmbchar) TY_(ToLower)( *cp );
  ------------------
  |  |   23|  2.77M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  2.77M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  212|  87.2k|    return s;
  213|  87.2k|}
prvTidytmbstrtoupper:
  217|  1.20k|{
  218|  1.20k|    tmbstr cp;
  219|       |
  220|  9.62k|    for (cp = s; *cp; ++cp)
  ------------------
  |  Branch (220:18): [True: 8.42k, False: 1.20k]
  ------------------
  221|  8.42k|        *cp = (tmbchar)TY_(ToUpper)(*cp);
  ------------------
  |  |   23|  8.42k|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  8.42k|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  222|       |
  223|  1.20k|    return s;
  224|  1.20k|}
prvTidytmbvsnprintf:
  227|  71.4M|{
  228|  71.4M|    int retval;
  229|       |
  230|  71.4M|#if HAS_VSNPRINTF
  231|  71.4M|    retval = vsnprintf(buffer, count - 1, format, args);
  232|       |    /* todo: conditionally null-terminate the string? */
  233|  71.4M|    buffer[count - 1] = 0;
  234|       |#else
  235|       |    retval = vsprintf(buffer, format, args);
  236|       |#endif /* HAS_VSNPRINTF */
  237|  71.4M|    return retval;
  238|  71.4M|}
prvTidytmbsnprintf:
  241|  52.2M|{
  242|  52.2M|    int retval;
  243|  52.2M|    va_list args;
  244|  52.2M|    va_start(args, format);
  245|  52.2M|    retval = TY_(tmbvsnprintf)(buffer, count, format, args);
  ------------------
  |  |   23|  52.2M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  52.2M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  246|       |    va_end(args);
  247|  52.2M|    return retval;
  248|  52.2M|}
prvTidystrrep:
  251|  76.8M|{
  252|  76.8M|    char *p = strstr(buffer, str);
  253|  76.8M|    do
  254|  76.8M|    {
  255|  76.8M|        if(p)
  ------------------
  |  Branch (255:12): [True: 301k, False: 76.5M]
  ------------------
  256|   301k|        {
  257|   301k|            char buf[1024];
  258|   301k|            memset(buf,'\0',strlen(buf));
  259|       |
  260|   301k|            if(buffer == p)
  ------------------
  |  Branch (260:16): [True: 175k, False: 126k]
  ------------------
  261|   175k|            {
  262|   175k|                strcpy(buf,rep);
  263|   175k|                strcat(buf,p+strlen(str));
  264|   175k|            }
  265|   126k|            else
  266|   126k|            {
  267|   126k|                strncpy(buf,buffer,strlen(buffer) - strlen(p));
  268|   126k|                strcat(buf,rep);
  269|   126k|                strcat(buf,p+strlen(str));
  270|   126k|            }
  271|       |
  272|   301k|            memset(buffer,'\0',strlen(buffer));
  273|   301k|            strcpy(buffer,buf);
  274|   301k|        }
  275|       |
  276|  76.8M|    } while(p && (p = strstr(buffer, str)));
  ------------------
  |  Branch (276:13): [True: 301k, False: 76.5M]
  |  Branch (276:18): [True: 278, False: 301k]
  ------------------
  277|  76.8M|}

prvTidyDecodeUTF8BytesToChar:
  166|  81.3M|{
  167|  81.3M|    byte tempbuf[10];
  168|  81.3M|    byte *buf = &tempbuf[0];
  169|  81.3M|    uint ch = 0, n = 0;
  170|  81.3M|    int i, bytes = 0;
  171|  81.3M|    Bool hasError = no;
  172|       |    
  173|  81.3M|    if ( successorBytes )
  ------------------
  |  Branch (173:10): [True: 7.63M, False: 73.6M]
  ------------------
  174|  7.63M|        buf = (byte*) successorBytes;
  175|       |        
  176|       |    /* special check if we have been passed an EOF char */
  177|  81.3M|    if ( firstByte == EndOfStream )
  ------------------
  |  | 1064|  81.3M|#define EndOfStream (~0u)
  ------------------
  |  Branch (177:10): [True: 0, False: 81.3M]
  ------------------
  178|      0|    {
  179|       |        /* at present */
  180|      0|        *c = firstByte;
  181|      0|        *count = 1;
  182|      0|        return 0;
  183|      0|    }
  184|       |
  185|  81.3M|    ch = firstByte; /* first byte is passed in separately */
  186|       |    
  187|  81.3M|    if (ch <= 0x7F) /* 0XXX XXXX one byte */
  ------------------
  |  Branch (187:9): [True: 74.5M, False: 6.77M]
  ------------------
  188|  74.5M|    {
  189|  74.5M|        n = ch;
  190|  74.5M|        bytes = 1;
  191|  74.5M|    }
  192|  6.77M|    else if ((ch & 0xE0) == 0xC0)  /* 110X XXXX  two bytes */
  ------------------
  |  Branch (192:14): [True: 330k, False: 6.44M]
  ------------------
  193|   330k|    {
  194|   330k|        n = ch & 31;
  195|   330k|        bytes = 2;
  196|   330k|    }
  197|  6.44M|    else if ((ch & 0xF0) == 0xE0)  /* 1110 XXXX  three bytes */
  ------------------
  |  Branch (197:14): [True: 4.99M, False: 1.45M]
  ------------------
  198|  4.99M|    {
  199|  4.99M|        n = ch & 15;
  200|  4.99M|        bytes = 3;
  201|  4.99M|    }
  202|  1.45M|    else if ((ch & 0xF8) == 0xF0)  /* 1111 0XXX  four bytes */
  ------------------
  |  Branch (202:14): [True: 319k, False: 1.13M]
  ------------------
  203|   319k|    {
  204|   319k|        n = ch & 7;
  205|   319k|        bytes = 4;
  206|   319k|    }
  207|  1.13M|    else if ((ch & 0xFC) == 0xF8)  /* 1111 10XX  five bytes */
  ------------------
  |  Branch (207:14): [True: 21.0k, False: 1.11M]
  ------------------
  208|  21.0k|    {
  209|  21.0k|        n = ch & 3;
  210|  21.0k|        bytes = 5;
  211|  21.0k|        hasError = yes;
  212|  21.0k|    }
  213|  1.11M|    else if ((ch & 0xFE) == 0xFC)  /* 1111 110X  six bytes */
  ------------------
  |  Branch (213:14): [True: 7.32k, False: 1.10M]
  ------------------
  214|  7.32k|    {
  215|  7.32k|        n = ch & 1;
  216|  7.32k|        bytes = 6;
  217|  7.32k|        hasError = yes;
  218|  7.32k|    }
  219|  1.10M|    else
  220|  1.10M|    {
  221|       |        /* not a valid first byte of a UTF-8 sequence */
  222|  1.10M|        n = ch;
  223|  1.10M|        bytes = 1;
  224|  1.10M|        hasError = yes;
  225|  1.10M|    }
  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|  81.3M|    if ( successorBytes )
  ------------------
  |  Branch (232:10): [True: 7.63M, False: 73.6M]
  ------------------
  233|  7.63M|    {
  234|  17.5M|        for ( i=0; i < bytes-1; ++i )
  ------------------
  |  Branch (234:20): [True: 10.0M, False: 7.55M]
  ------------------
  235|  10.0M|        {
  236|  10.0M|            if ( !buf[i] || (buf[i] & 0xC0) != 0x80 )
  ------------------
  |  Branch (236:18): [True: 0, False: 10.0M]
  |  Branch (236:29): [True: 85.0k, False: 9.95M]
  ------------------
  237|  85.0k|            {
  238|  85.0k|                hasError = yes;
  239|  85.0k|                bytes = i+1;
  240|  85.0k|                break;
  241|  85.0k|            }
  242|  9.95M|            n = (n << 6) | (buf[i] & 0x3F);
  243|  9.95M|        }
  244|  7.63M|    }
  245|  73.6M|    else if ( inp )
  ------------------
  |  Branch (245:15): [True: 73.6M, False: 0]
  ------------------
  246|  73.6M|    {
  247|  74.2M|        for ( i=0; i < bytes-1 && !inp->eof(inp->sourceData); ++i )
  ------------------
  |  Branch (247:20): [True: 958k, False: 73.2M]
  |  Branch (247:35): [True: 957k, False: 634]
  ------------------
  248|   957k|        {
  249|   957k|            int b = inp->getByte( inp->sourceData );
  250|   957k|            buf[i] = (tmbchar) b;
  251|       |
  252|       |            /* End of data or illegal successor byte value */
  253|   957k|            if ( b == EOF || (buf[i] & 0xC0) != 0x80 )
  ------------------
  |  Branch (253:18): [True: 0, False: 957k]
  |  Branch (253:30): [True: 378k, False: 579k]
  ------------------
  254|   378k|            {
  255|   378k|                hasError = yes;
  256|   378k|                bytes = i+1;
  257|   378k|                if ( b != EOF )
  ------------------
  |  Branch (257:22): [True: 378k, False: 0]
  ------------------
  258|   378k|                    inp->ungetByte( inp->sourceData, buf[i] );
  259|   378k|                break;
  260|   378k|            }
  261|   579k|            n = (n << 6) | (buf[i] & 0x3F);
  262|   579k|        }
  263|  73.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|  81.3M|    if (!hasError && ((n == kUTF8ByteSwapNotAChar) || (n == kUTF8NotAChar)))
  ------------------
  |  |  121|  79.7M|#define kUTF8ByteSwapNotAChar    0xFFFE
  ------------------
                  if (!hasError && ((n == kUTF8ByteSwapNotAChar) || (n == kUTF8NotAChar)))
  ------------------
  |  |  122|  79.7M|#define kUTF8NotAChar            0xFFFF
  ------------------
  |  Branch (270:9): [True: 79.7M, False: 1.57M]
  |  Branch (270:23): [True: 241, False: 79.7M]
  |  Branch (270:55): [True: 272, False: 79.7M]
  ------------------
  271|    513|        hasError = yes;
  272|       |        
  273|  81.3M|    if (!hasError && (n > kMaxUTF8FromUCS4))
  ------------------
  |  |  124|  79.7M|#define kMaxUTF8FromUCS4         0x10FFFF
  ------------------
  |  Branch (273:9): [True: 79.7M, False: 1.57M]
  |  Branch (273:22): [True: 298, False: 79.7M]
  ------------------
  274|    298|        hasError = yes;
  275|       |
  276|  81.3M|    if (!hasError)
  ------------------
  |  Branch (276:9): [True: 79.7M, False: 1.57M]
  ------------------
  277|  79.7M|    {
  278|  79.7M|        int lo, hi;
  279|       |        
  280|  79.7M|        lo = offsetUTF8Sequences[bytes - 1];
  281|  79.7M|        hi = offsetUTF8Sequences[bytes] - 1;
  282|       |        
  283|       |        /* check for overlong sequences */
  284|  79.7M|        if ((n < validUTF8[lo].lowChar) || (n > validUTF8[hi].highChar))
  ------------------
  |  Branch (284:13): [True: 4.08k, False: 79.7M]
  |  Branch (284:44): [True: 0, False: 79.7M]
  ------------------
  285|  4.08k|            hasError = yes;
  286|  79.7M|        else
  287|  79.7M|        {
  288|  79.7M|            hasError = yes; /* assume error until proven otherwise */
  289|       |        
  290|   164M|            for (i = lo; i <= hi; i++)
  ------------------
  |  Branch (290:26): [True: 84.9M, False: 79.7M]
  ------------------
  291|  84.9M|            {
  292|  84.9M|                int tempCount;
  293|  84.9M|                byte theByte;
  294|       |                
  295|   177M|                for (tempCount = 0; tempCount < bytes; tempCount++)
  ------------------
  |  Branch (295:37): [True: 96.7M, False: 80.3M]
  ------------------
  296|  96.7M|                {
  297|  96.7M|                    if (!tempCount)
  ------------------
  |  Branch (297:25): [True: 84.9M, False: 11.8M]
  ------------------
  298|  84.9M|                        theByte = (tmbchar) firstByte;
  299|  11.8M|                    else
  300|  11.8M|                        theByte = buf[tempCount - 1];
  301|       |                        
  302|  96.7M|                    if ( theByte >= validUTF8[i].validBytes[(tempCount * 2)] &&
  ------------------
  |  Branch (302:26): [True: 96.1M, False: 591k]
  ------------------
  303|  96.1M|                         theByte <= validUTF8[i].validBytes[(tempCount * 2) + 1] )
  ------------------
  |  Branch (303:26): [True: 91.3M, False: 4.84M]
  ------------------
  304|  91.3M|                        hasError = no;
  305|  96.7M|                    if (hasError)
  ------------------
  |  Branch (305:25): [True: 4.63M, False: 92.1M]
  ------------------
  306|  4.63M|                        break;
  307|  96.7M|                }
  308|  84.9M|            }
  309|  79.7M|        }
  310|  79.7M|    }
  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|  81.3M|    *count = bytes;
  325|  81.3M|    *c = n;
  326|  81.3M|    if ( hasError )
  ------------------
  |  Branch (326:10): [True: 1.57M, False: 79.7M]
  ------------------
  327|  1.57M|        return -1;
  328|  79.7M|    return 0;
  329|  81.3M|}
prvTidyEncodeCharToUTF8Bytes:
  333|   659M|{
  334|   659M|    byte tempbuf[10] = {0};
  335|   659M|    byte* buf = &tempbuf[0];
  336|   659M|    int bytes = 0;
  337|   659M|    Bool hasError = no;
  338|       |    
  339|   659M|    if ( encodebuf )
  ------------------
  |  Branch (339:10): [True: 323M, False: 335M]
  ------------------
  340|   323M|        buf = (byte*) encodebuf;
  341|       |        
  342|   659M|    if (c <= 0x7F)  /* 0XXX XXXX one byte */
  ------------------
  |  Branch (342:9): [True: 654M, False: 4.43M]
  ------------------
  343|   654M|    {
  344|   654M|        buf[0] = (tmbchar) c;
  345|   654M|        bytes = 1;
  346|   654M|    }
  347|  4.43M|    else if (c <= 0x7FF)  /* 110X XXXX  two bytes */
  ------------------
  |  Branch (347:14): [True: 144k, False: 4.29M]
  ------------------
  348|   144k|    {
  349|   144k|        buf[0] = (tmbchar) ( 0xC0 | (c >> 6) );
  350|   144k|        buf[1] = (tmbchar) ( 0x80 | (c & 0x3F) );
  351|   144k|        bytes = 2;
  352|   144k|    }
  353|  4.29M|    else if (c <= 0xFFFF)  /* 1110 XXXX  three bytes */
  ------------------
  |  Branch (353:14): [True: 4.08M, False: 211k]
  ------------------
  354|  4.08M|    {
  355|  4.08M|        buf[0] = (tmbchar) (0xE0 | (c >> 12));
  356|  4.08M|        buf[1] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  357|  4.08M|        buf[2] = (tmbchar) (0x80 | (c & 0x3F));
  358|  4.08M|        bytes = 3;
  359|  4.08M|        if ( c == kUTF8ByteSwapNotAChar || c == kUTF8NotAChar )
  ------------------
  |  |  121|  8.16M|#define kUTF8ByteSwapNotAChar    0xFFFE
  ------------------
                      if ( c == kUTF8ByteSwapNotAChar || c == kUTF8NotAChar )
  ------------------
  |  |  122|  4.07M|#define kUTF8NotAChar            0xFFFF
  ------------------
  |  Branch (359:14): [True: 210, False: 4.07M]
  |  Branch (359:44): [True: 801, False: 4.07M]
  ------------------
  360|  1.01k|            hasError = yes;
  361|  4.08M|    }
  362|   211k|    else if (c <= 0x1FFFFF)  /* 1111 0XXX  four bytes */
  ------------------
  |  Branch (362:14): [True: 184k, False: 26.4k]
  ------------------
  363|   184k|    {
  364|   184k|        buf[0] = (tmbchar) (0xF0 | (c >> 18));
  365|   184k|        buf[1] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  366|   184k|        buf[2] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  367|   184k|        buf[3] = (tmbchar) (0x80 | (c & 0x3F));
  368|   184k|        bytes = 4;
  369|   184k|        if (c > kMaxUTF8FromUCS4)
  ------------------
  |  |  124|   184k|#define kMaxUTF8FromUCS4         0x10FFFF
  ------------------
  |  Branch (369:13): [True: 201, False: 184k]
  ------------------
  370|    201|            hasError = yes;
  371|   184k|    }
  372|  26.4k|    else if (c <= 0x3FFFFFF)  /* 1111 10XX  five bytes */
  ------------------
  |  Branch (372:14): [True: 1.80k, False: 24.6k]
  ------------------
  373|  1.80k|    {
  374|  1.80k|        buf[0] = (tmbchar) (0xF8 | (c >> 24));
  375|  1.80k|        buf[1] = (tmbchar) (0x80 | (c >> 18));
  376|  1.80k|        buf[2] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  377|  1.80k|        buf[3] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  378|  1.80k|        buf[4] = (tmbchar) (0x80 | (c & 0x3F));
  379|  1.80k|        bytes = 5;
  380|  1.80k|        hasError = yes;
  381|  1.80k|    }
  382|  24.6k|    else if (c <= 0x7FFFFFFF)  /* 1111 110X  six bytes */
  ------------------
  |  Branch (382:14): [True: 400, False: 24.2k]
  ------------------
  383|    400|    {
  384|    400|        buf[0] = (tmbchar) (0xFC | (c >> 30));
  385|    400|        buf[1] = (tmbchar) (0x80 | ((c >> 24) & 0x3F));
  386|    400|        buf[2] = (tmbchar) (0x80 | ((c >> 18) & 0x3F));
  387|    400|        buf[3] = (tmbchar) (0x80 | ((c >> 12) & 0x3F));
  388|    400|        buf[4] = (tmbchar) (0x80 | ((c >> 6) & 0x3F));
  389|    400|        buf[5] = (tmbchar) (0x80 | (c & 0x3F));
  390|    400|        bytes = 6;
  391|    400|        hasError = yes;
  392|    400|    }
  393|  24.2k|    else
  394|  24.2k|        hasError = yes;
  395|       |        
  396|       |    /* don't output invalid UTF-8 byte sequence to a stream */
  397|   659M|    if ( !hasError && outp != NULL )
  ------------------
  |  Branch (397:10): [True: 659M, False: 27.6k]
  |  Branch (397:23): [True: 335M, False: 323M]
  ------------------
  398|   335M|    {
  399|   335M|        int ix;
  400|   675M|        for ( ix=0; ix < bytes; ++ix )
  ------------------
  |  Branch (400:21): [True: 339M, False: 335M]
  ------------------
  401|   339M|          outp->putByte( outp->sinkData, buf[ix] );
  402|   335M|    }
  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|   659M|    *count = bytes;
  416|   659M|    if (hasError)
  ------------------
  |  Branch (416:9): [True: 27.6k, False: 659M]
  ------------------
  417|  27.6k|        return -1;
  418|   659M|    return 0;
  419|   659M|}
prvTidyGetUTF8:
  426|  7.63M|{
  427|  7.63M|    uint n;
  428|  7.63M|    int bytes;
  429|       |
  430|  7.63M|    int err;
  431|       |    
  432|  7.63M|    bytes = 0;
  433|       |    
  434|       |    /* first byte "str[0]" is passed in separately from the */
  435|       |    /* rest of the UTF-8 byte sequence starting at "str[1]" */
  436|  7.63M|    err = TY_(DecodeUTF8BytesToChar)( &n, str[0], str+1, NULL, &bytes );
  ------------------
  |  |   23|  7.63M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.63M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  437|  7.63M|    if (err)
  ------------------
  |  Branch (437:9): [True: 96.6k, False: 7.54M]
  ------------------
  438|  96.6k|    {
  439|       |#if 1 && defined(_DEBUG)
  440|       |        fprintf(stderr, "pprint UTF-8 decoding error for U+%x : ", n);
  441|       |#endif
  442|  96.6k|        n = 0xFFFD; /* replacement char */
  443|  96.6k|    }
  444|       |
  445|  7.63M|    *ch = n;
  446|  7.63M|    return bytes - 1;
  447|  7.63M|}
prvTidyPutUTF8:
  451|  7.98M|{
  452|  7.98M|    int err, count = 0;
  453|       |        
  454|  7.98M|    err = TY_(EncodeCharToUTF8Bytes)( c, buf, NULL, &count );
  ------------------
  |  |   23|  7.98M|#define TY_(str) TYDYAPPEND(prvTidy,str)
  |  |  ------------------
  |  |  |  |   22|  7.98M|#define TYDYAPPEND(str1,str2) str1##str2
  |  |  ------------------
  ------------------
  455|  7.98M|    if (err)
  ------------------
  |  Branch (455:9): [True: 0, False: 7.98M]
  ------------------
  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.98M|    buf += count;
  468|  7.98M|    return buf;
  469|  7.98M|}
prvTidyIsValidUTF16FromUCS4:
  472|   399k|{
  473|   399k|  return ( ucs4 <= kMaxUTF16FromUCS4 );
  ------------------
  |  |  127|   399k|#define kMaxUTF16FromUCS4        0x10FFFF
  ------------------
  474|   399k|}
prvTidyIsHighSurrogate:
  477|  25.8k|{
  478|  25.8k|    return ( ch >= kUTF16HighSurrogateBegin && ch <= kUTF16HighSurrogateEnd );
  ------------------
  |  |  132|  51.7k|#define kUTF16HighSurrogateBegin 0xDC00
  ------------------
                  return ( ch >= kUTF16HighSurrogateBegin && ch <= kUTF16HighSurrogateEnd );
  ------------------
  |  |  133|  7.52k|#define kUTF16HighSurrogateEnd   0xDFFF
  ------------------
  |  Branch (478:14): [True: 7.52k, False: 18.3k]
  |  Branch (478:48): [True: 3.04k, False: 4.48k]
  ------------------
  479|  25.8k|}
prvTidyIsLowSurrogate:
  481|   454k|{
  482|   454k|    return ( ch >= kUTF16LowSurrogateBegin && ch <= kUTF16LowSurrogateEnd );
  ------------------
  |  |  130|   909k|#define kUTF16LowSurrogateBegin  0xD800
  ------------------
                  return ( ch >= kUTF16LowSurrogateBegin && ch <= kUTF16LowSurrogateEnd );
  ------------------
  |  |  131|   109k|#define kUTF16LowSurrogateEnd    0xDBFF
  ------------------
  |  Branch (482:14): [True: 109k, False: 345k]
  |  Branch (482:47): [True: 46.5k, False: 62.7k]
  ------------------
  483|   454k|}
prvTidyCombineSurrogatePair:
  486|  1.28k|{
  487|  1.28k|    assert( TY_(IsHighSurrogate)(high) && TY_(IsLowSurrogate)(low) );
  ------------------
  |  Branch (487:5): [True: 0, False: 1.28k]
  |  Branch (487:5): [True: 0, False: 0]
  |  Branch (487:5): [True: 1.28k, False: 0]
  |  Branch (487:5): [True: 1.28k, False: 0]
  ------------------
  488|  1.28k|    return ( ((low - kUTF16LowSurrogateBegin) * 0x400) + 
  ------------------
  |  |  130|  1.28k|#define kUTF16LowSurrogateBegin  0xD800
  ------------------
  489|  1.28k|             high - kUTF16HighSurrogateBegin + 0x10000 );
  ------------------
  |  |  132|  1.28k|#define kUTF16HighSurrogateBegin 0xDC00
  ------------------
  490|  1.28k|}
prvTidyIsValidCombinedChar:
  504|  1.28k|{
  505|  1.28k|    return ( ch >= kUTF16SurrogatesBegin &&
  ------------------
  |  |  126|  2.57k|#define kUTF16SurrogatesBegin    0x10000
  ------------------
  |  Branch (505:14): [True: 1.28k, False: 0]
  ------------------
  506|  1.28k|             (ch & 0x0000FFFE) != 0x0000FFFE &&
  ------------------
  |  Branch (506:14): [True: 681, False: 605]
  ------------------
  507|    681|             (ch & 0x0000FFFF) != 0x0000FFFF );
  ------------------
  |  Branch (507:14): [True: 681, False: 0]
  ------------------
  508|  1.28k|}

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

