hoedown_autolink_is_safe:
   16|  58.0k|{
   17|  58.0k|	static const size_t valid_uris_count = 6;
   18|  58.0k|	static const char *valid_uris[] = {
   19|  58.0k|		"http://", "https://", "/", "#", "ftp://", "mailto:"
   20|  58.0k|	};
   21|  58.0k|	static const size_t valid_uris_size[] = { 7, 8, 1, 1, 6, 7 };
   22|  58.0k|	size_t i;
   23|       |
   24|   362k|	for (i = 0; i < valid_uris_count; ++i) {
  ------------------
  |  Branch (24:14): [True: 326k, False: 36.9k]
  ------------------
   25|   326k|		size_t len = valid_uris_size[i];
   26|       |
   27|   326k|		if (size > len &&
  ------------------
  |  Branch (27:7): [True: 323k, False: 2.87k]
  ------------------
   28|   323k|			strncasecmp((char *)data, valid_uris[i], len) == 0 &&
  ------------------
  |  Branch (28:4): [True: 25.5k, False: 297k]
  ------------------
   29|   326k|			isalnum(data[len]))
  ------------------
  |  Branch (29:4): [True: 21.1k, False: 4.35k]
  ------------------
   30|  21.1k|			return 1;
   31|   326k|	}
   32|       |
   33|  36.9k|	return 0;
   34|  58.0k|}
hoedown_autolink__www:
  154|   666k|{
  155|   666k|	size_t link_end;
  156|       |
  157|   666k|	if (max_rewind > 0 && !ispunct(data[-1]) && !isspace(data[-1]))
  ------------------
  |  Branch (157:6): [True: 624k, False: 41.7k]
  |  Branch (157:24): [True: 564k, False: 60.1k]
  |  Branch (157:46): [True: 551k, False: 13.1k]
  ------------------
  158|   551k|		return 0;
  159|       |
  160|   115k|	if (size < 4 || memcmp(data, "www.", strlen("www.")) != 0)
  ------------------
  |  Branch (160:6): [True: 8.14k, False: 106k]
  |  Branch (160:18): [True: 56.2k, False: 50.7k]
  ------------------
  161|  64.3k|		return 0;
  162|       |
  163|  50.7k|	link_end = check_domain(data, size, 0);
  164|       |
  165|  50.7k|	if (link_end == 0)
  ------------------
  |  Branch (165:6): [True: 27.7k, False: 22.9k]
  ------------------
  166|  27.7k|		return 0;
  167|       |
  168|  6.76M|	while (link_end < size && !isspace(data[link_end]))
  ------------------
  |  Branch (168:9): [True: 6.76M, False: 8.11k]
  |  Branch (168:28): [True: 6.74M, False: 14.8k]
  ------------------
  169|  6.74M|		link_end++;
  170|       |
  171|  22.9k|	link_end = autolink_delim(data, link_end, max_rewind, size);
  172|       |
  173|  22.9k|	if (link_end == 0)
  ------------------
  |  Branch (173:6): [True: 0, False: 22.9k]
  ------------------
  174|      0|		return 0;
  175|       |
  176|  22.9k|	hoedown_buffer_put(link, data, link_end);
  177|  22.9k|	*rewind_p = 0;
  178|       |
  179|  22.9k|	return (int)link_end;
  180|  22.9k|}
hoedown_autolink__email:
  190|   382k|{
  191|   382k|	size_t link_end, rewind;
  192|   382k|	int nb = 0, np = 0;
  193|       |
  194|  2.01M|	for (rewind = 0; rewind < max_rewind; ++rewind) {
  ------------------
  |  Branch (194:19): [True: 2.00M, False: 10.2k]
  ------------------
  195|  2.00M|		uint8_t c = *(data - rewind - 1);
  196|       |
  197|  2.00M|		if (isalnum(c))
  ------------------
  |  Branch (197:7): [True: 579k, False: 1.42M]
  ------------------
  198|   579k|			continue;
  199|       |
  200|  1.42M|		if (strchr(".+-_", c) != NULL)
  ------------------
  |  Branch (200:7): [True: 1.05M, False: 372k]
  ------------------
  201|  1.05M|			continue;
  202|       |
  203|   372k|		break;
  204|  1.42M|	}
  205|       |
  206|   382k|	if (rewind == 0)
  ------------------
  |  Branch (206:6): [True: 264k, False: 118k]
  ------------------
  207|   264k|		return 0;
  208|       |
  209|   145M|	for (link_end = 0; link_end < size; ++link_end) {
  ------------------
  |  Branch (209:21): [True: 145M, False: 3.83k]
  ------------------
  210|   145M|		uint8_t c = data[link_end];
  211|       |
  212|   145M|		if (isalnum(c))
  ------------------
  |  Branch (212:7): [True: 51.9M, False: 93.8M]
  ------------------
  213|  51.9M|			continue;
  214|       |
  215|  93.8M|		if (c == '@')
  ------------------
  |  Branch (215:7): [True: 52.5M, False: 41.3M]
  ------------------
  216|  52.5M|			nb++;
  217|  41.3M|		else if (c == '.' && link_end < size - 1)
  ------------------
  |  Branch (217:12): [True: 41.2M, False: 119k]
  |  Branch (217:24): [True: 41.1M, False: 5.67k]
  ------------------
  218|  41.1M|			np++;
  219|   124k|		else if (c != '-' && c != '_')
  ------------------
  |  Branch (219:12): [True: 116k, False: 8.25k]
  |  Branch (219:24): [True: 114k, False: 2.07k]
  ------------------
  220|   114k|			break;
  221|  93.8M|	}
  222|       |
  223|   118k|	if (link_end < 2 || nb != 1 || np == 0 ||
  ------------------
  |  Branch (223:6): [True: 24.3k, False: 93.8k]
  |  Branch (223:22): [True: 85.1k, False: 8.75k]
  |  Branch (223:33): [True: 4.92k, False: 3.82k]
  ------------------
  224|  3.82k|		!isalpha(data[link_end - 1]))
  ------------------
  |  Branch (224:3): [True: 1.24k, False: 2.58k]
  ------------------
  225|   115k|		return 0;
  226|       |
  227|  2.58k|	link_end = autolink_delim(data, link_end, max_rewind, size);
  228|       |
  229|  2.58k|	if (link_end == 0)
  ------------------
  |  Branch (229:6): [True: 0, False: 2.58k]
  ------------------
  230|      0|		return 0;
  231|       |
  232|  2.58k|	hoedown_buffer_put(link, data - rewind, link_end + rewind);
  233|  2.58k|	*rewind_p = rewind;
  234|       |
  235|  2.58k|	return link_end;
  236|  2.58k|}
hoedown_autolink__url:
  246|  2.22M|{
  247|  2.22M|	size_t link_end, rewind = 0, domain_len;
  248|       |
  249|  2.22M|	if (size < 4 || data[1] != '/' || data[2] != '/')
  ------------------
  |  Branch (249:6): [True: 136k, False: 2.08M]
  |  Branch (249:18): [True: 2.02M, False: 64.2k]
  |  Branch (249:36): [True: 6.12k, False: 58.0k]
  ------------------
  250|  2.16M|		return 0;
  251|       |
  252|   210k|	while (rewind < max_rewind && isalpha(*(data - rewind - 1)))
  ------------------
  |  Branch (252:9): [True: 206k, False: 3.45k]
  |  Branch (252:32): [True: 152k, False: 54.6k]
  ------------------
  253|   152k|		rewind++;
  254|       |
  255|  58.0k|	if (!hoedown_autolink_is_safe(data - rewind, size + rewind))
  ------------------
  |  Branch (255:6): [True: 36.9k, False: 21.1k]
  ------------------
  256|  36.9k|		return 0;
  257|       |
  258|  21.1k|	link_end = strlen("://");
  259|       |
  260|  21.1k|	domain_len = check_domain(
  261|  21.1k|		data + link_end,
  262|  21.1k|		size - link_end,
  263|  21.1k|		flags & HOEDOWN_AUTOLINK_SHORT_DOMAINS);
  264|       |
  265|  21.1k|	if (domain_len == 0)
  ------------------
  |  Branch (265:6): [True: 16.2k, False: 4.89k]
  ------------------
  266|  16.2k|		return 0;
  267|       |
  268|  4.89k|	link_end += domain_len;
  269|  15.0M|	while (link_end < size && !isspace(data[link_end]))
  ------------------
  |  Branch (269:9): [True: 15.0M, False: 1.39k]
  |  Branch (269:28): [True: 15.0M, False: 3.50k]
  ------------------
  270|  15.0M|		link_end++;
  271|       |
  272|  4.89k|	link_end = autolink_delim(data, link_end, max_rewind, size);
  273|       |
  274|  4.89k|	if (link_end == 0)
  ------------------
  |  Branch (274:6): [True: 0, False: 4.89k]
  ------------------
  275|      0|		return 0;
  276|       |
  277|  4.89k|	hoedown_buffer_put(link, data - rewind, link_end + rewind);
  278|  4.89k|	*rewind_p = rewind;
  279|       |
  280|  4.89k|	return link_end;
  281|  4.89k|}
autolink.c:check_domain:
  122|  71.8k|{
  123|  71.8k|	size_t i, np = 0;
  124|       |
  125|  71.8k|	if (!isalnum(data[0]))
  ------------------
  |  Branch (125:6): [True: 0, False: 71.8k]
  ------------------
  126|      0|		return 0;
  127|       |
  128|   851k|	for (i = 1; i < size - 1; ++i) {
  ------------------
  |  Branch (128:14): [True: 821k, False: 29.4k]
  ------------------
  129|   821k|		if (strchr(".:", data[i]) != NULL) np++;
  ------------------
  |  Branch (129:7): [True: 60.9k, False: 760k]
  ------------------
  130|   760k|		else if (!isalnum(data[i]) && data[i] != '-') break;
  ------------------
  |  Branch (130:12): [True: 46.2k, False: 714k]
  |  Branch (130:33): [True: 42.3k, False: 3.86k]
  ------------------
  131|   821k|	}
  132|       |
  133|  71.8k|	if (allow_short) {
  ------------------
  |  Branch (133:6): [True: 0, False: 71.8k]
  ------------------
  134|       |		/* We don't need a valid domain in the strict sense (with
  135|       |		 * least one dot; so just make sure it's composed of valid
  136|       |		 * domain characters and return the length of the the valid
  137|       |		 * sequence. */
  138|      0|		return i;
  139|  71.8k|	} else {
  140|       |		/* a valid domain needs to have at least a dot.
  141|       |		 * that's as far as we get */
  142|  71.8k|		return np ? i : 0;
  ------------------
  |  Branch (142:10): [True: 27.8k, False: 44.0k]
  ------------------
  143|  71.8k|	}
  144|  71.8k|}
autolink.c:autolink_delim:
   38|  30.4k|{
   39|  30.4k|	uint8_t cclose, copen = 0;
   40|  30.4k|	size_t i;
   41|       |
   42|  7.56M|	for (i = 0; i < link_end; ++i)
  ------------------
  |  Branch (42:14): [True: 7.54M, False: 12.9k]
  ------------------
   43|  7.54M|		if (data[i] == '<') {
  ------------------
  |  Branch (43:7): [True: 17.4k, False: 7.53M]
  ------------------
   44|  17.4k|			link_end = i;
   45|  17.4k|			break;
   46|  17.4k|		}
   47|       |
   48|  70.2k|	while (link_end > 0) {
  ------------------
  |  Branch (48:9): [True: 70.2k, False: 0]
  ------------------
   49|  70.2k|		if (strchr("?!.,:", data[link_end - 1]) != NULL)
  ------------------
  |  Branch (49:7): [True: 37.7k, False: 32.4k]
  ------------------
   50|  37.7k|			link_end--;
   51|       |
   52|  32.4k|		else if (data[link_end - 1] == ';') {
  ------------------
  |  Branch (52:12): [True: 2.01k, False: 30.4k]
  ------------------
   53|  2.01k|			size_t new_end = link_end - 2;
   54|       |
   55|  5.14k|			while (new_end > 0 && isalpha(data[new_end]))
  ------------------
  |  Branch (55:11): [True: 5.14k, False: 0]
  |  Branch (55:26): [True: 3.12k, False: 2.01k]
  ------------------
   56|  3.12k|				new_end--;
   57|       |
   58|  2.01k|			if (new_end < link_end - 2 && data[new_end] == '&')
  ------------------
  |  Branch (58:8): [True: 1.28k, False: 733]
  |  Branch (58:34): [True: 69, False: 1.21k]
  ------------------
   59|     69|				link_end = new_end;
   60|  1.95k|			else
   61|  1.95k|				link_end--;
   62|  2.01k|		}
   63|  30.4k|		else break;
   64|  70.2k|	}
   65|       |
   66|  30.4k|	if (link_end == 0)
  ------------------
  |  Branch (66:6): [True: 0, False: 30.4k]
  ------------------
   67|      0|		return 0;
   68|       |
   69|  30.4k|	cclose = data[link_end - 1];
   70|       |
   71|  30.4k|	switch (cclose) {
  ------------------
  |  Branch (71:10): [True: 16.9k, False: 13.4k]
  ------------------
   72|    980|	case '"':	copen = '"'; break;
  ------------------
  |  Branch (72:2): [True: 980, False: 29.4k]
  ------------------
   73|  13.4k|	case '\'':	copen = '\''; break;
  ------------------
  |  Branch (73:2): [True: 13.4k, False: 16.9k]
  ------------------
   74|    567|	case ')':	copen = '('; break;
  ------------------
  |  Branch (74:2): [True: 567, False: 29.8k]
  ------------------
   75|    931|	case ']':	copen = '['; break;
  ------------------
  |  Branch (75:2): [True: 931, False: 29.4k]
  ------------------
   76|    980|	case '}':	copen = '{'; break;
  ------------------
  |  Branch (76:2): [True: 980, False: 29.4k]
  ------------------
   77|  30.4k|	}
   78|       |
   79|  30.4k|	if (copen != 0) {
  ------------------
  |  Branch (79:6): [True: 16.9k, False: 13.4k]
  ------------------
   80|  16.9k|		size_t closing = 0;
   81|  16.9k|		size_t opening = 0;
   82|  16.9k|		size_t i = 0;
   83|       |
   84|       |		/* Try to close the final punctuation sign in this same line;
   85|       |		 * if we managed to close it outside of the URL, that means that it's
   86|       |		 * not part of the URL. If it closes inside the URL, that means it
   87|       |		 * is part of the URL.
   88|       |		 *
   89|       |		 * Examples:
   90|       |		 *
   91|       |		 *	foo http://www.pokemon.com/Pikachu_(Electric) bar
   92|       |		 *		=> http://www.pokemon.com/Pikachu_(Electric)
   93|       |		 *
   94|       |		 *	foo (http://www.pokemon.com/Pikachu_(Electric)) bar
   95|       |		 *		=> http://www.pokemon.com/Pikachu_(Electric)
   96|       |		 *
   97|       |		 *	foo http://www.pokemon.com/Pikachu_(Electric)) bar
   98|       |		 *		=> http://www.pokemon.com/Pikachu_(Electric))
   99|       |		 *
  100|       |		 *	(foo http://www.pokemon.com/Pikachu_(Electric)) bar
  101|       |		 *		=> foo http://www.pokemon.com/Pikachu_(Electric)
  102|       |		 */
  103|       |
  104|  5.15M|		while (i < link_end) {
  ------------------
  |  Branch (104:10): [True: 5.14M, False: 16.9k]
  ------------------
  105|  5.14M|			if (data[i] == copen)
  ------------------
  |  Branch (105:8): [True: 17.9k, False: 5.12M]
  ------------------
  106|  17.9k|				opening++;
  107|  5.12M|			else if (data[i] == cclose)
  ------------------
  |  Branch (107:13): [True: 3.15M, False: 1.96M]
  ------------------
  108|  3.15M|				closing++;
  109|       |
  110|  5.14M|			i++;
  111|  5.14M|		}
  112|       |
  113|  16.9k|		if (closing != opening)
  ------------------
  |  Branch (113:7): [True: 16.0k, False: 911]
  ------------------
  114|  16.0k|			link_end--;
  115|  16.9k|	}
  116|       |
  117|  30.4k|	return link_end;
  118|  30.4k|}

hoedown_malloc:
   10|  1.03M|{
   11|  1.03M|	void *ret = malloc(size);
   12|       |
   13|  1.03M|	if (!ret) {
  ------------------
  |  Branch (13:6): [True: 0, False: 1.03M]
  ------------------
   14|      0|		fprintf(stderr, "Allocation failed.\n");
   15|      0|		abort();
   16|      0|	}
   17|       |
   18|  1.03M|	return ret;
   19|  1.03M|}
hoedown_calloc:
   23|   894k|{
   24|   894k|	void *ret = calloc(nmemb, size);
   25|       |
   26|   894k|	if (!ret) {
  ------------------
  |  Branch (26:6): [True: 0, False: 894k]
  ------------------
   27|      0|		fprintf(stderr, "Allocation failed.\n");
   28|      0|		abort();
   29|      0|	}
   30|       |
   31|   894k|	return ret;
   32|   894k|}
hoedown_realloc:
   36|  3.69M|{
   37|  3.69M|	void *ret = realloc(ptr, size);
   38|       |
   39|  3.69M|	if (!ret) {
  ------------------
  |  Branch (39:6): [True: 0, False: 3.69M]
  ------------------
   40|      0|		fprintf(stderr, "Allocation failed.\n");
   41|      0|		abort();
   42|      0|	}
   43|       |
   44|  3.69M|	return ret;
   45|  3.69M|}
hoedown_buffer_init:
   54|  1.00M|{
   55|  1.00M|	assert(buf);
  ------------------
  |  Branch (55:2): [True: 0, False: 1.00M]
  |  Branch (55:2): [True: 1.00M, False: 0]
  ------------------
   56|       |
   57|  1.00M|	buf->data = NULL;
   58|  1.00M|	buf->size = buf->asize = 0;
   59|  1.00M|	buf->unit = unit;
   60|  1.00M|	buf->data_realloc = data_realloc;
   61|  1.00M|	buf->data_free = data_free;
   62|  1.00M|	buf->buffer_free = buffer_free;
   63|  1.00M|}
hoedown_buffer_new:
   74|  1.00M|{
   75|  1.00M|	hoedown_buffer *ret = hoedown_malloc(sizeof (hoedown_buffer));
   76|  1.00M|	hoedown_buffer_init(ret, unit, hoedown_realloc, free, free);
   77|  1.00M|	return ret;
   78|  1.00M|}
hoedown_buffer_free:
   82|  1.27M|{
   83|  1.27M|	if (!buf) return;
  ------------------
  |  Branch (83:6): [True: 275k, False: 1.00M]
  ------------------
   84|  1.27M|	assert(buf && buf->unit);
  ------------------
  |  Branch (84:2): [True: 0, False: 1.00M]
  |  Branch (84:2): [True: 0, False: 0]
  |  Branch (84:2): [True: 1.00M, False: 0]
  |  Branch (84:2): [True: 1.00M, False: 0]
  ------------------
   85|       |
   86|  1.00M|	buf->data_free(buf->data);
   87|       |
   88|  1.00M|	if (buf->buffer_free)
  ------------------
  |  Branch (88:6): [True: 1.00M, False: 0]
  ------------------
   89|  1.00M|		buf->buffer_free(buf);
   90|  1.00M|}
hoedown_buffer_reset:
   94|  3.25k|{
   95|  3.25k|	assert(buf && buf->unit);
  ------------------
  |  Branch (95:2): [True: 0, False: 3.25k]
  |  Branch (95:2): [True: 0, False: 0]
  |  Branch (95:2): [True: 3.25k, False: 0]
  |  Branch (95:2): [True: 3.25k, False: 0]
  ------------------
   96|       |
   97|  3.25k|	buf->data_free(buf->data);
   98|       |	buf->data = NULL;
   99|  3.25k|	buf->size = buf->asize = 0;
  100|  3.25k|}
hoedown_buffer_grow:
  104|  4.54M|{
  105|  4.54M|	size_t neoasz;
  106|  4.54M|	assert(buf && buf->unit);
  ------------------
  |  Branch (106:2): [True: 0, False: 4.54M]
  |  Branch (106:2): [True: 0, False: 0]
  |  Branch (106:2): [True: 4.54M, False: 0]
  |  Branch (106:2): [True: 4.54M, False: 0]
  ------------------
  107|       |
  108|  4.54M|	if (buf->asize >= neosz)
  ------------------
  |  Branch (108:6): [True: 888k, False: 3.66M]
  ------------------
  109|   888k|		return;
  110|       |
  111|  3.66M|	neoasz = buf->asize + buf->unit;
  112|   115M|	while (neoasz < neosz)
  ------------------
  |  Branch (112:9): [True: 111M, False: 3.66M]
  ------------------
  113|   111M|		neoasz += buf->unit;
  114|       |
  115|  3.66M|	buf->data = buf->data_realloc(buf->data, neoasz);
  116|  3.66M|	buf->asize = neoasz;
  117|  3.66M|}
hoedown_buffer_put:
  121|  78.3M|{
  122|  78.3M|	assert(buf && buf->unit);
  ------------------
  |  Branch (122:2): [True: 0, False: 78.3M]
  |  Branch (122:2): [True: 0, False: 0]
  |  Branch (122:2): [True: 78.3M, False: 0]
  |  Branch (122:2): [True: 78.3M, False: 0]
  ------------------
  123|       |
  124|  78.3M|	if (buf->size + size > buf->asize)
  ------------------
  |  Branch (124:6): [True: 1.45M, False: 76.8M]
  ------------------
  125|  1.45M|		hoedown_buffer_grow(buf, buf->size + size);
  126|       |
  127|  78.3M|	memcpy(buf->data + buf->size, data, size);
  128|  78.3M|	buf->size += size;
  129|  78.3M|}
hoedown_buffer_puts:
  133|  28.0M|{
  134|  28.0M|	hoedown_buffer_put(buf, (const uint8_t *)str, strlen(str));
  135|  28.0M|}
hoedown_buffer_putc:
  139|   204M|{
  140|   204M|	assert(buf && buf->unit);
  ------------------
  |  Branch (140:2): [True: 0, False: 204M]
  |  Branch (140:2): [True: 0, False: 0]
  |  Branch (140:2): [True: 204M, False: 0]
  |  Branch (140:2): [True: 204M, False: 0]
  ------------------
  141|       |
  142|   204M|	if (buf->size >= buf->asize)
  ------------------
  |  Branch (142:6): [True: 2.17M, False: 202M]
  ------------------
  143|  2.17M|		hoedown_buffer_grow(buf, buf->size + 1);
  144|       |
  145|   204M|	buf->data[buf->size] = c;
  146|   204M|	buf->size += 1;
  147|   204M|}
hoedown_buffer_prefix:
  195|  13.2k|{
  196|  13.2k|	size_t i;
  197|       |
  198|  43.2k|	for (i = 0; i < buf->size; ++i) {
  ------------------
  |  Branch (198:14): [True: 43.2k, False: 0]
  ------------------
  199|  43.2k|		if (prefix[i] == 0)
  ------------------
  |  Branch (199:7): [True: 4.23k, False: 39.0k]
  ------------------
  200|  4.23k|			return 0;
  201|       |
  202|  39.0k|		if (buf->data[i] != prefix[i])
  ------------------
  |  Branch (202:7): [True: 8.97k, False: 30.0k]
  ------------------
  203|  8.97k|			return buf->data[i] - prefix[i];
  204|  39.0k|	}
  205|       |
  206|      0|	return 0;
  207|  13.2k|}
hoedown_buffer_slurp:
  211|    802|{
  212|    802|	assert(buf && buf->unit);
  ------------------
  |  Branch (212:2): [True: 0, False: 802]
  |  Branch (212:2): [True: 0, False: 0]
  |  Branch (212:2): [True: 802, False: 0]
  |  Branch (212:2): [True: 802, False: 0]
  ------------------
  213|       |
  214|    802|	if (size >= buf->size) {
  ------------------
  |  Branch (214:6): [True: 0, False: 802]
  ------------------
  215|      0|		buf->size = 0;
  216|      0|		return;
  217|      0|	}
  218|       |
  219|    802|	buf->size -= size;
  220|    802|	memmove(buf->data, buf->data + size, buf->size);
  221|    802|}
hoedown_buffer_printf:
  239|   219k|{
  240|   219k|	va_list ap;
  241|   219k|	int n;
  242|       |
  243|   219k|	assert(buf && buf->unit);
  ------------------
  |  Branch (243:2): [True: 0, False: 219k]
  |  Branch (243:2): [True: 0, False: 0]
  |  Branch (243:2): [True: 219k, False: 0]
  |  Branch (243:2): [True: 219k, False: 0]
  ------------------
  244|       |
  245|   219k|	if (buf->size >= buf->asize)
  ------------------
  |  Branch (245:6): [True: 995, False: 218k]
  ------------------
  246|    995|		hoedown_buffer_grow(buf, buf->size + 1);
  247|       |
  248|   219k|	va_start(ap, fmt);
  249|   219k|	n = vsnprintf((char *)buf->data + buf->size, buf->asize - buf->size, fmt, ap);
  250|   219k|	va_end(ap);
  251|       |
  252|   219k|	if (n < 0) {
  ------------------
  |  Branch (252:6): [True: 0, False: 219k]
  ------------------
  253|      0|#ifndef _MSC_VER
  254|      0|		return;
  255|       |#else
  256|       |		va_start(ap, fmt);
  257|       |		n = _vscprintf(fmt, ap);
  258|       |		va_end(ap);
  259|       |#endif
  260|      0|	}
  261|       |
  262|   219k|	if ((size_t)n >= buf->asize - buf->size) {
  ------------------
  |  Branch (262:6): [True: 2.22k, False: 217k]
  ------------------
  263|  2.22k|		hoedown_buffer_grow(buf, buf->size + n + 1);
  264|       |
  265|  2.22k|		va_start(ap, fmt);
  266|  2.22k|		n = vsnprintf((char *)buf->data + buf->size, buf->asize - buf->size, fmt, ap);
  267|  2.22k|		va_end(ap);
  268|  2.22k|	}
  269|       |
  270|   219k|	if (n < 0)
  ------------------
  |  Branch (270:6): [True: 0, False: 219k]
  ------------------
  271|      0|		return;
  272|       |
  273|   219k|	buf->size += n;
  274|   219k|}

hoedown_document_new:
 3993|  11.8k|{
 3994|  11.8k|	hoedown_document *doc = NULL;
 3995|       |
 3996|  11.8k|	assert(max_nesting > 0 && renderer);
  ------------------
  |  Branch (3996:2): [True: 0, False: 11.8k]
  |  Branch (3996:2): [True: 0, False: 0]
  |  Branch (3996:2): [True: 11.8k, False: 0]
  |  Branch (3996:2): [True: 11.8k, False: 0]
  ------------------
 3997|       |
 3998|  11.8k|	doc = hoedown_malloc(sizeof(hoedown_document));
 3999|  11.8k|	memcpy(&doc->md, renderer, sizeof(hoedown_renderer));
 4000|       |
 4001|  11.8k|	doc->data.opaque = renderer->opaque;
 4002|       |
 4003|  11.8k|	hoedown_stack_init(&doc->work_bufs[BUFFER_BLOCK], 4);
  ------------------
  |  |   18|  11.8k|#define BUFFER_BLOCK 0
  ------------------
 4004|  11.8k|	hoedown_stack_init(&doc->work_bufs[BUFFER_SPAN], 8);
  ------------------
  |  |   19|  11.8k|#define BUFFER_SPAN 1
  ------------------
 4005|  11.8k|	hoedown_stack_init(&doc->work_bufs[BUFFER_ATTRIBUTE], 8);
  ------------------
  |  |   20|  11.8k|#define BUFFER_ATTRIBUTE 2
  ------------------
 4006|       |
 4007|  11.8k|	memset(doc->active_char, 0x0, 256);
 4008|       |
 4009|  11.8k|	if (extensions & HOEDOWN_EXT_UNDERLINE && doc->md.underline) {
  ------------------
  |  Branch (4009:6): [True: 11.8k, False: 0]
  |  Branch (4009:44): [True: 11.8k, False: 0]
  ------------------
 4010|  11.8k|		doc->active_char['_'] = MD_CHAR_EMPHASIS;
 4011|  11.8k|	}
 4012|       |
 4013|  11.8k|	if (doc->md.emphasis || doc->md.double_emphasis || doc->md.triple_emphasis) {
  ------------------
  |  Branch (4013:6): [True: 11.8k, False: 0]
  |  Branch (4013:26): [True: 0, False: 0]
  |  Branch (4013:53): [True: 0, False: 0]
  ------------------
 4014|  11.8k|		doc->active_char['*'] = MD_CHAR_EMPHASIS;
 4015|  11.8k|		doc->active_char['_'] = MD_CHAR_EMPHASIS;
 4016|  11.8k|		if (extensions & HOEDOWN_EXT_STRIKETHROUGH)
  ------------------
  |  Branch (4016:7): [True: 11.8k, False: 0]
  ------------------
 4017|  11.8k|			doc->active_char['~'] = MD_CHAR_EMPHASIS;
 4018|  11.8k|		if (extensions & HOEDOWN_EXT_HIGHLIGHT)
  ------------------
  |  Branch (4018:7): [True: 11.8k, False: 0]
  ------------------
 4019|  11.8k|			doc->active_char['='] = MD_CHAR_EMPHASIS;
 4020|  11.8k|	}
 4021|       |
 4022|  11.8k|	if (doc->md.codespan)
  ------------------
  |  Branch (4022:6): [True: 11.8k, False: 0]
  ------------------
 4023|  11.8k|		doc->active_char['`'] = MD_CHAR_CODESPAN;
 4024|       |
 4025|  11.8k|	if (doc->md.linebreak)
  ------------------
  |  Branch (4025:6): [True: 11.8k, False: 0]
  ------------------
 4026|  11.8k|		doc->active_char['\n'] = MD_CHAR_LINEBREAK;
 4027|       |
 4028|  11.8k|	if (doc->md.image || doc->md.link || doc->md.footnotes || doc->md.footnote_ref) {
  ------------------
  |  Branch (4028:6): [True: 11.8k, False: 0]
  |  Branch (4028:23): [True: 0, False: 0]
  |  Branch (4028:39): [True: 0, False: 0]
  |  Branch (4028:60): [True: 0, False: 0]
  ------------------
 4029|  11.8k|		doc->active_char['['] = MD_CHAR_LINK;
 4030|  11.8k|		doc->active_char['!'] = MD_CHAR_IMAGE;
 4031|  11.8k|	}
 4032|       |
 4033|  11.8k|	doc->active_char['<'] = MD_CHAR_LANGLE;
 4034|  11.8k|	doc->active_char['\\'] = MD_CHAR_ESCAPE;
 4035|  11.8k|	doc->active_char['&'] = MD_CHAR_ENTITY;
 4036|       |
 4037|  11.8k|	if (extensions & HOEDOWN_EXT_AUTOLINK) {
  ------------------
  |  Branch (4037:6): [True: 11.8k, False: 0]
  ------------------
 4038|  11.8k|		doc->active_char[':'] = MD_CHAR_AUTOLINK_URL;
 4039|  11.8k|		doc->active_char['@'] = MD_CHAR_AUTOLINK_EMAIL;
 4040|  11.8k|		doc->active_char['w'] = MD_CHAR_AUTOLINK_WWW;
 4041|  11.8k|	}
 4042|       |
 4043|  11.8k|	if (extensions & HOEDOWN_EXT_SUPERSCRIPT)
  ------------------
  |  Branch (4043:6): [True: 11.8k, False: 0]
  ------------------
 4044|  11.8k|		doc->active_char['^'] = MD_CHAR_SUPERSCRIPT;
 4045|       |
 4046|  11.8k|	if (extensions & HOEDOWN_EXT_QUOTE)
  ------------------
  |  Branch (4046:6): [True: 11.8k, False: 0]
  ------------------
 4047|  11.8k|		doc->active_char['"'] = MD_CHAR_QUOTE;
 4048|       |
 4049|  11.8k|	if (extensions & HOEDOWN_EXT_MATH)
  ------------------
  |  Branch (4049:6): [True: 11.8k, False: 0]
  ------------------
 4050|  11.8k|		doc->active_char['$'] = MD_CHAR_MATH;
 4051|       |
 4052|       |	/* Extension data */
 4053|  11.8k|	doc->ext_flags = extensions;
 4054|  11.8k|	doc->max_nesting = max_nesting;
 4055|  11.8k|	doc->attr_activation = attr_activation;
 4056|  11.8k|	doc->in_link_body = 0;
 4057|  11.8k|	doc->link_id = NULL;
 4058|  11.8k|	doc->link_ref_attr = NULL;
 4059|  11.8k|	doc->link_inline_attr = NULL;
 4060|  11.8k|	doc->is_escape_char = 0;
 4061|  11.8k|	doc->header_type = HOEDOWN_HEADER_NONE;
 4062|  11.8k|	doc->link_type = HOEDOWN_LINK_NONE;
 4063|  11.8k|	doc->footnote_id = NULL;
 4064|  11.8k|	doc->list_depth = 0;
 4065|  11.8k|	doc->blockquote_depth = 0;
 4066|  11.8k|	doc->ul_item_char = 0;
 4067|  11.8k|	doc->hrule_char = 0;
 4068|  11.8k|	doc->fencedcode_char = 0;
 4069|  11.8k|	doc->ol_numeral = NULL;
 4070|  11.8k|	doc->user_block = user_block;
 4071|  11.8k|	doc->meta = meta;
 4072|       |
 4073|  11.8k|	return doc;
 4074|  11.8k|}
hoedown_document_render:
 4078|  11.8k|{
 4079|  11.8k|	static const uint8_t UTF8_BOM[] = {0xEF, 0xBB, 0xBF};
 4080|       |
 4081|  11.8k|	hoedown_buffer *text;
 4082|  11.8k|	size_t beg, end;
 4083|       |
 4084|  11.8k|	int footnotes_enabled;
 4085|       |
 4086|  11.8k|	text = hoedown_buffer_new(64);
 4087|       |
 4088|       |	/* Preallocate enough space for our buffer to avoid expanding while copying */
 4089|  11.8k|	hoedown_buffer_grow(text, size);
 4090|       |
 4091|       |	/* reset the references table */
 4092|  11.8k|	memset(&doc->refs, 0x0, REF_TABLE_SIZE * sizeof(void *));
  ------------------
  |  |   16|  11.8k|#define REF_TABLE_SIZE 8
  ------------------
 4093|       |
 4094|  11.8k|	footnotes_enabled = doc->ext_flags & HOEDOWN_EXT_FOOTNOTES;
 4095|       |
 4096|       |	/* reset the footnotes lists */
 4097|  11.8k|	if (footnotes_enabled) {
  ------------------
  |  Branch (4097:6): [True: 11.8k, False: 0]
  ------------------
 4098|  11.8k|		memset(&doc->footnotes_found, 0x0, sizeof(doc->footnotes_found));
 4099|  11.8k|		memset(&doc->footnotes_used, 0x0, sizeof(doc->footnotes_used));
 4100|  11.8k|	}
 4101|       |
 4102|       |	/* first pass: looking for references, copying everything else */
 4103|  11.8k|	beg = 0;
 4104|       |
 4105|       |	/* Skip a possible UTF-8 BOM, even though the Unicode standard
 4106|       |	 * discourages having these in UTF-8 documents */
 4107|  11.8k|	if (size >= 3 && memcmp(data, UTF8_BOM, 3) == 0)
  ------------------
  |  Branch (4107:6): [True: 11.4k, False: 366]
  |  Branch (4107:19): [True: 46, False: 11.4k]
  ------------------
 4108|     46|		beg += 3;
 4109|       |
 4110|  1.77M|	while (beg < size) /* iterating over lines */
  ------------------
  |  Branch (4110:9): [True: 1.76M, False: 11.8k]
  ------------------
 4111|  1.76M|		if (footnotes_enabled && is_footnote(data, beg, size, &end, &doc->footnotes_found)) {
  ------------------
  |  Branch (4111:7): [True: 1.76M, False: 0]
  |  Branch (4111:28): [True: 308k, False: 1.45M]
  ------------------
 4112|   308k|			if (doc->md.footnote_ref_def) {
  ------------------
  |  Branch (4112:8): [True: 0, False: 308k]
  ------------------
 4113|      0|				hoedown_buffer original = { NULL, 0, 0, 0, NULL, NULL, NULL };
 4114|      0|				original.data = (uint8_t*) (data + beg);
 4115|      0|				original.size = end - beg;
 4116|      0|				doc->md.footnote_ref_def(&original, &doc->data);
 4117|      0|			}
 4118|   308k|			beg = end;
 4119|  1.45M|		} else if (is_html_comment(data, beg, size, &end)) {
  ------------------
  |  Branch (4119:14): [True: 17.1k, False: 1.43M]
  ------------------
 4120|  17.1k|			size_t  i = 0;
 4121|  7.39M|			while (i < (end - beg) && beg + i < size) {
  ------------------
  |  Branch (4121:11): [True: 7.38M, False: 17.1k]
  |  Branch (4121:30): [True: 7.38M, False: 0]
  ------------------
 4122|  7.38M|				if (data[beg + i] == '\t' && (data[beg + i] & 0xc0) != 0x80) {
  ------------------
  |  Branch (4122:9): [True: 1.94M, False: 5.43M]
  |  Branch (4122:34): [True: 1.94M, False: 0]
  ------------------
 4123|  1.94M|					hoedown_buffer_put(text, (uint8_t*)"    ", 4);
 4124|  5.43M|				} else {
 4125|  5.43M|					hoedown_buffer_putc(text, data[beg + i]);
 4126|  5.43M|				}
 4127|  7.38M|				i++;
 4128|  7.38M|			}
 4129|  17.1k|			beg = end;
 4130|  1.43M|		} else if (is_ref(data, beg, size, &end, doc->refs)) {
  ------------------
  |  Branch (4130:14): [True: 87.1k, False: 1.34M]
  ------------------
 4131|  87.1k|			if (doc->md.ref) {
  ------------------
  |  Branch (4131:8): [True: 0, False: 87.1k]
  ------------------
 4132|      0|				hoedown_buffer original = { NULL, 0, 0, 0, NULL, NULL, NULL };
 4133|      0|				original.data = (uint8_t*) (data + beg);
 4134|      0|				original.size = end - beg;
 4135|      0|				doc->md.ref(&original, &doc->data);
 4136|      0|			}
 4137|  87.1k|			beg = end;
 4138|  1.34M|		} else { /* skipping to the next line */
 4139|  1.34M|			end = beg;
 4140|   137M|			while (end < size && data[end] != '\n' && data[end] != '\r')
  ------------------
  |  Branch (4140:11): [True: 137M, False: 10.3k]
  |  Branch (4140:25): [True: 136M, False: 781k]
  |  Branch (4140:46): [True: 135M, False: 557k]
  ------------------
 4141|   135M|				end++;
 4142|       |
 4143|       |			/* adding the line body if present */
 4144|  1.34M|			if (end > beg)
  ------------------
  |  Branch (4144:8): [True: 1.25M, False: 89.4k]
  ------------------
 4145|  1.25M|				expand_tabs(text, data + beg, end - beg);
 4146|       |
 4147|  2.84M|			while (end < size && (data[end] == '\n' || data[end] == '\r')) {
  ------------------
  |  Branch (4147:11): [True: 2.82M, False: 10.8k]
  |  Branch (4147:26): [True: 855k, False: 1.97M]
  |  Branch (4147:47): [True: 634k, False: 1.33M]
  ------------------
 4148|       |				/* add one \n per newline */
 4149|  1.49M|				if (data[end] == '\n' || (end + 1 < size && data[end + 1] != '\n'))
  ------------------
  |  Branch (4149:9): [True: 855k, False: 634k]
  |  Branch (4149:31): [True: 634k, False: 178]
  |  Branch (4149:49): [True: 625k, False: 8.71k]
  ------------------
 4150|  1.48M|					hoedown_buffer_putc(text, '\n');
 4151|  1.49M|				end++;
 4152|  1.49M|			}
 4153|       |
 4154|  1.34M|			beg = end;
 4155|  1.34M|		}
 4156|       |
 4157|       |	/* pre-grow the output buffer to minimize allocations */
 4158|  11.8k|	hoedown_buffer_grow(ob, text->size + (text->size >> 1));
 4159|       |
 4160|       |	/* second pass: actual rendering */
 4161|  11.8k|	if (doc->md.doc_header)
  ------------------
  |  Branch (4161:6): [True: 0, False: 11.8k]
  ------------------
 4162|      0|		doc->md.doc_header(ob, 0, &doc->data);
 4163|       |
 4164|  11.8k|	if (text->size) {
  ------------------
  |  Branch (4164:6): [True: 11.6k, False: 218]
  ------------------
 4165|       |		/* adding a final newline if not already present */
 4166|  11.6k|		if (text->data[text->size - 1] != '\n')
  ------------------
  |  Branch (4166:7): [True: 10.5k, False: 1.06k]
  ------------------
 4167|  10.5k|			hoedown_buffer_putc(text, '\n');
 4168|       |
 4169|  11.6k|		parse_block(ob, doc, text->data, text->size);
 4170|  11.6k|	}
 4171|       |
 4172|       |	/* footnotes */
 4173|  11.8k|	if (footnotes_enabled)
  ------------------
  |  Branch (4173:6): [True: 11.8k, False: 0]
  ------------------
 4174|  11.8k|		parse_footnote_list(ob, doc, &doc->footnotes_used);
 4175|       |
 4176|  11.8k|	if (doc->md.doc_footer)
  ------------------
  |  Branch (4176:6): [True: 0, False: 11.8k]
  ------------------
 4177|      0|		doc->md.doc_footer(ob, 0, &doc->data);
 4178|       |
 4179|       |	/* clean-up */
 4180|  11.8k|	hoedown_buffer_free(text);
 4181|  11.8k|	free_link_refs(doc->refs);
 4182|  11.8k|	if (footnotes_enabled) {
  ------------------
  |  Branch (4182:6): [True: 11.8k, False: 0]
  ------------------
 4183|  11.8k|		free_footnote_list(&doc->footnotes_found, 1);
 4184|  11.8k|		free_footnote_list(&doc->footnotes_used, 0);
 4185|  11.8k|	}
 4186|       |
 4187|  11.8k|	assert(doc->work_bufs[BUFFER_SPAN].size == 0);
  ------------------
  |  Branch (4187:2): [True: 0, False: 11.8k]
  |  Branch (4187:2): [True: 11.8k, False: 0]
  ------------------
 4188|  11.8k|	assert(doc->work_bufs[BUFFER_BLOCK].size == 0);
  ------------------
  |  Branch (4188:2): [True: 0, False: 11.8k]
  |  Branch (4188:2): [True: 11.8k, False: 0]
  ------------------
 4189|  11.8k|	assert(doc->work_bufs[BUFFER_ATTRIBUTE].size == 0);
  ------------------
  |  Branch (4189:2): [True: 0, False: 11.8k]
  |  Branch (4189:2): [True: 11.8k, False: 0]
  ------------------
 4190|  11.8k|}
hoedown_document_free:
 4254|  11.8k|{
 4255|  11.8k|	size_t i;
 4256|       |
 4257|   112k|	for (i = 0; i < (size_t)doc->work_bufs[BUFFER_SPAN].asize; ++i)
  ------------------
  |  |   19|   112k|#define BUFFER_SPAN 1
  ------------------
  |  Branch (4257:14): [True: 100k, False: 11.8k]
  ------------------
 4258|   100k|		hoedown_buffer_free(doc->work_bufs[BUFFER_SPAN].item[i]);
  ------------------
  |  |   19|   100k|#define BUFFER_SPAN 1
  ------------------
 4259|       |
 4260|  65.3k|	for (i = 0; i < (size_t)doc->work_bufs[BUFFER_BLOCK].asize; ++i)
  ------------------
  |  |   18|  65.3k|#define BUFFER_BLOCK 0
  ------------------
  |  Branch (4260:14): [True: 53.5k, False: 11.8k]
  ------------------
 4261|  53.5k|		hoedown_buffer_free(doc->work_bufs[BUFFER_BLOCK].item[i]);
  ------------------
  |  |   18|  53.5k|#define BUFFER_BLOCK 0
  ------------------
 4262|       |
 4263|   107k|	for (i = 0; i < (size_t)doc->work_bufs[BUFFER_ATTRIBUTE].asize; ++i)
  ------------------
  |  |   20|   107k|#define BUFFER_ATTRIBUTE 2
  ------------------
  |  Branch (4263:14): [True: 95.2k, False: 11.8k]
  ------------------
 4264|  95.2k|		hoedown_buffer_free(doc->work_bufs[BUFFER_ATTRIBUTE].item[i]);
  ------------------
  |  |   20|  95.2k|#define BUFFER_ATTRIBUTE 2
  ------------------
 4265|       |
 4266|  11.8k|	hoedown_stack_uninit(&doc->work_bufs[BUFFER_SPAN]);
  ------------------
  |  |   19|  11.8k|#define BUFFER_SPAN 1
  ------------------
 4267|  11.8k|	hoedown_stack_uninit(&doc->work_bufs[BUFFER_BLOCK]);
  ------------------
  |  |   18|  11.8k|#define BUFFER_BLOCK 0
  ------------------
 4268|  11.8k|	hoedown_stack_uninit(&doc->work_bufs[BUFFER_ATTRIBUTE]);
  ------------------
  |  |   20|  11.8k|#define BUFFER_ATTRIBUTE 2
  ------------------
 4269|       |
 4270|  11.8k|	free(doc);
 4271|  11.8k|}
document.c:is_footnote:
 3628|  1.76M|{
 3629|  1.76M|	size_t i = 0;
 3630|  1.76M|	hoedown_buffer *contents = NULL;
 3631|  1.76M|	hoedown_buffer *name = NULL;
 3632|  1.76M|	size_t ind = 0;
 3633|  1.76M|	int in_empty = 0;
 3634|  1.76M|	size_t start = 0;
 3635|       |
 3636|  1.76M|	size_t id_offset, id_end;
 3637|  1.76M|	size_t id_indent = 0, content_line = 0, content_indent = 0;
 3638|       |
 3639|       |	/* up to 3 optional leading spaces */
 3640|  1.76M|	if (beg + 3 >= end) return 0;
  ------------------
  |  Branch (3640:6): [True: 4.39k, False: 1.75M]
  ------------------
 3641|  1.75M|	if (data[beg] == ' ') { i = 1;
  ------------------
  |  Branch (3641:6): [True: 250k, False: 1.50M]
  ------------------
 3642|   250k|	if (data[beg + 1] == ' ') { i = 2;
  ------------------
  |  Branch (3642:6): [True: 23.6k, False: 226k]
  ------------------
 3643|  23.6k|	if (data[beg + 2] == ' ') { i = 3;
  ------------------
  |  Branch (3643:6): [True: 12.6k, False: 10.9k]
  ------------------
 3644|  12.6k|	if (data[beg + 3] == ' ') return 0; } } }
  ------------------
  |  Branch (3644:6): [True: 7.17k, False: 5.48k]
  ------------------
 3645|  1.75M|	i += beg;
 3646|       |
 3647|       |	/* id part: caret followed by anything between brackets */
 3648|  1.75M|	if (data[i] != '[') return 0;
  ------------------
  |  Branch (3648:6): [True: 1.28M, False: 467k]
  ------------------
 3649|   467k|	i++;
 3650|   467k|	if (i >= end || data[i] != '^') return 0;
  ------------------
  |  Branch (3650:6): [True: 1, False: 467k]
  |  Branch (3650:18): [True: 144k, False: 323k]
  ------------------
 3651|   323k|	i++;
 3652|   323k|	id_offset = i;
 3653|  2.15M|	while (i < end && data[i] != '\n' && data[i] != '\r' && data[i] != ']')
  ------------------
  |  Branch (3653:9): [True: 2.15M, False: 39]
  |  Branch (3653:20): [True: 2.15M, False: 2.67k]
  |  Branch (3653:39): [True: 2.15M, False: 3.82k]
  |  Branch (3653:58): [True: 1.83M, False: 316k]
  ------------------
 3654|  1.83M|		i++;
 3655|   323k|	if (i >= end || data[i] != ']') return 0;
  ------------------
  |  Branch (3655:6): [True: 39, False: 323k]
  |  Branch (3655:18): [True: 6.50k, False: 316k]
  ------------------
 3656|   316k|	id_end = i;
 3657|       |
 3658|       |	/* spacer: colon (space | tab)* newline? (space | tab)* */
 3659|   316k|	i++;
 3660|   316k|	if (i >= end || data[i] != ':') return 0;
  ------------------
  |  Branch (3660:6): [True: 15, False: 316k]
  |  Branch (3660:18): [True: 8.27k, False: 308k]
  ------------------
 3661|   308k|	i++;
 3662|   308k|	if (i >= end) return 0;
  ------------------
  |  Branch (3662:6): [True: 15, False: 308k]
  ------------------
 3663|       |
 3664|       |	/* getting content and name buffers */
 3665|   308k|	contents = hoedown_buffer_new(64);
 3666|   308k|	name = hoedown_buffer_new(64);
 3667|       |
 3668|   308k|	start = i;
 3669|       |
 3670|       |	/* getting item indent size */
 3671|  2.07M|	while (id_indent != start && data[start - id_indent] != '\n' && data[start - id_indent] != '\r') {
  ------------------
  |  Branch (3671:9): [True: 2.07M, False: 750]
  |  Branch (3671:31): [True: 2.02M, False: 54.2k]
  |  Branch (3671:66): [True: 1.76M, False: 253k]
  ------------------
 3672|  1.76M|		id_indent++;
 3673|  1.76M|	}
 3674|       |
 3675|       |	/* process lines similar to a list item */
 3676|   692k|	while (i < end) {
  ------------------
  |  Branch (3676:9): [True: 692k, False: 501]
  ------------------
 3677|  10.6M|		while (i < end && data[i] != '\n' && data[i] != '\r') i++;
  ------------------
  |  Branch (3677:10): [True: 10.6M, False: 1.35k]
  |  Branch (3677:21): [True: 10.5M, False: 172k]
  |  Branch (3677:40): [True: 9.98M, False: 518k]
  ------------------
 3678|       |
 3679|       |		/* process an empty line */
 3680|   692k|		if (is_empty(data + start, i - start)) {
  ------------------
  |  Branch (3680:7): [True: 253k, False: 439k]
  ------------------
 3681|   253k|			in_empty = 1;
 3682|   253k|			if (i < end && (data[i] == '\n' || data[i] == '\r')) {
  ------------------
  |  Branch (3682:8): [True: 253k, False: 27]
  |  Branch (3682:20): [True: 5.09k, False: 248k]
  |  Branch (3682:39): [True: 248k, False: 0]
  ------------------
 3683|   253k|				i++;
 3684|   253k|				if (i < end && data[i] == '\n' && data[i - 1] == '\r') i++;
  ------------------
  |  Branch (3684:9): [True: 253k, False: 45]
  |  Branch (3684:20): [True: 951, False: 252k]
  |  Branch (3684:39): [True: 354, False: 597]
  ------------------
 3685|   253k|			}
 3686|   253k|			start = i;
 3687|   253k|			continue;
 3688|   253k|		}
 3689|       |
 3690|       |		/* calculating the indentation */
 3691|   439k|		ind = 0;
 3692|   671k|		while (ind < 4 && start + ind < end && data[start + ind] == ' ')
  ------------------
  |  Branch (3692:10): [True: 626k, False: 45.0k]
  |  Branch (3692:21): [True: 626k, False: 0]
  |  Branch (3692:42): [True: 231k, False: 394k]
  ------------------
 3693|   231k|			ind++;
 3694|       |
 3695|   439k|		content_line++;
 3696|       |
 3697|       |		/* joining only indented stuff after empty lines;
 3698|       |		 * note that now we only require 1 space of indentation
 3699|       |		 * to continue, just like lists */
 3700|   439k|		if (ind == 0) {
  ------------------
  |  Branch (3700:7): [True: 349k, False: 90.0k]
  ------------------
 3701|   349k|			if (start == id_end + 2 && data[start] == '\t') {}
  ------------------
  |  Branch (3701:8): [True: 49.8k, False: 299k]
  |  Branch (3701:31): [True: 40.9k, False: 8.88k]
  ------------------
 3702|   308k|			else break;
 3703|   349k|		}
 3704|  90.0k|		else if (in_empty) {
  ------------------
  |  Branch (3704:12): [True: 2.14k, False: 87.9k]
  ------------------
 3705|  2.14k|			hoedown_buffer_putc(contents, '\n');
 3706|  2.14k|		}
 3707|       |
 3708|   131k|		in_empty = 0;
 3709|       |
 3710|       |		/* re-calculating the indentation */
 3711|   131k|		if (content_line == 2 && data[start + ind] == ' ') {
  ------------------
  |  Branch (3711:7): [True: 42.0k, False: 88.9k]
  |  Branch (3711:28): [True: 30.9k, False: 11.1k]
  ------------------
 3712|  62.4k|			while (ind < id_indent && data[start + ind] == ' ') {
  ------------------
  |  Branch (3712:11): [True: 31.8k, False: 30.6k]
  |  Branch (3712:30): [True: 31.5k, False: 283]
  ------------------
 3713|  31.5k|				ind++;
 3714|  31.5k|			}
 3715|  30.9k|			content_indent = ind;
 3716|  30.9k|		}
 3717|   131k|		if (content_indent > ind) {
  ------------------
  |  Branch (3717:7): [True: 17.1k, False: 113k]
  ------------------
 3718|  28.5k|			while (ind < content_indent && data[start + ind] == ' ') {
  ------------------
  |  Branch (3718:11): [True: 18.1k, False: 10.3k]
  |  Branch (3718:35): [True: 11.3k, False: 6.79k]
  ------------------
 3719|  11.3k|				ind++;
 3720|  11.3k|			}
 3721|  17.1k|		}
 3722|       |
 3723|       |		/* adding the line into the content buffer */
 3724|   131k|		hoedown_buffer_put(contents, data + start + ind, i - start - ind);
 3725|       |		/* add carriage return */
 3726|   131k|		if (i < end) {
  ------------------
  |  Branch (3726:7): [True: 130k, False: 398]
  ------------------
 3727|   130k|			hoedown_buffer_putc(contents, '\n');
 3728|   130k|			if (i < end && (data[i] == '\n' || data[i] == '\r')) {
  ------------------
  |  Branch (3728:8): [True: 130k, False: 0]
  |  Branch (3728:20): [True: 119k, False: 11.3k]
  |  Branch (3728:39): [True: 11.3k, False: 0]
  ------------------
 3729|   130k|				i++;
 3730|   130k|				if (i < end && data[i] == '\n' && data[i - 1] == '\r') i++;
  ------------------
  |  Branch (3730:9): [True: 130k, False: 14]
  |  Branch (3730:20): [True: 6.63k, False: 123k]
  |  Branch (3730:39): [True: 5.89k, False: 748]
  ------------------
 3731|   130k|			}
 3732|   130k|		}
 3733|   131k|		start = i;
 3734|   131k|	}
 3735|       |
 3736|   308k|	if (last)
  ------------------
  |  Branch (3736:6): [True: 308k, False: 0]
  ------------------
 3737|   308k|		*last = start;
 3738|       |
 3739|   308k|	if (list) {
  ------------------
  |  Branch (3739:6): [True: 308k, False: 0]
  ------------------
 3740|   308k|		struct footnote_ref *ref;
 3741|   308k|		ref = create_footnote_ref(list, data + id_offset, id_end - id_offset);
 3742|   308k|		if (!ref)
  ------------------
  |  Branch (3742:7): [True: 0, False: 308k]
  ------------------
 3743|      0|			return 0;
 3744|   308k|		if (!add_footnote_ref(list, ref)) {
  ------------------
  |  Branch (3744:7): [True: 0, False: 308k]
  ------------------
 3745|      0|			free_footnote_ref(ref);
 3746|      0|			return 0;
 3747|      0|		}
 3748|   308k|		ref->contents = contents;
 3749|   308k|		hoedown_buffer_put(name, data + id_offset, id_end - id_offset);
 3750|   308k|		ref->name = name;
 3751|   308k|	}
 3752|       |
 3753|   308k|	return 1;
 3754|   308k|}
document.c:is_empty:
 1736|  8.61M|{
 1737|  8.61M|	size_t i;
 1738|       |
 1739|   124M|	for (i = 0; i < size && data[i] != '\n'; i++)
  ------------------
  |  Branch (1739:14): [True: 124M, False: 259k]
  |  Branch (1739:26): [True: 123M, False: 1.28M]
  ------------------
 1740|   123M|		if (data[i] != ' ')
  ------------------
  |  Branch (1740:7): [True: 7.06M, False: 116M]
  ------------------
 1741|  7.06M|			return 0;
 1742|       |
 1743|  1.54M|	return i + 1;
 1744|  8.61M|}
document.c:create_footnote_ref:
  273|   308k|{
  274|   308k|	struct footnote_ref *ref = hoedown_calloc(1, sizeof(struct footnote_ref));
  275|       |
  276|   308k|	ref->id = hash_link_ref(name, name_size);
  277|       |
  278|   308k|	return ref;
  279|   308k|}
document.c:hash_link_ref:
  209|  1.33M|{
  210|  1.33M|	size_t i;
  211|  1.33M|	unsigned int hash = 0;
  212|       |
  213|   104M|	for (i = 0; i < length; ++i)
  ------------------
  |  Branch (213:14): [True: 103M, False: 1.33M]
  ------------------
  214|   103M|		hash = tolower(link_ref[i]) + (hash << 6) + (hash << 16) - hash;
  ------------------
  |  Branch (214:10): [True: 0, False: 0]
  |  Branch (214:10): [True: 0, False: 0]
  |  Branch (214:10): [Folded, False: 103M]
  ------------------
  215|       |
  216|  1.33M|	return hash;
  217|  1.33M|}
document.c:add_footnote_ref:
  283|   309k|{
  284|   309k|	struct footnote_item *item = hoedown_calloc(1, sizeof(struct footnote_item));
  285|   309k|	if (!item)
  ------------------
  |  Branch (285:6): [True: 0, False: 309k]
  ------------------
  286|      0|		return 0;
  287|   309k|	item->ref = ref;
  288|       |
  289|   309k|	if (list->head == NULL) {
  ------------------
  |  Branch (289:6): [True: 1.68k, False: 308k]
  ------------------
  290|  1.68k|		list->head = list->tail = item;
  291|   308k|	} else {
  292|   308k|		list->tail->next = item;
  293|   308k|		list->tail = item;
  294|   308k|	}
  295|   309k|	list->count++;
  296|       |
  297|   309k|	return 1;
  298|   309k|}
document.c:free_footnote_ref:
  319|   308k|{
  320|   308k|	hoedown_buffer_free(ref->contents);
  321|   308k|	hoedown_buffer_free(ref->name);
  322|   308k|	free(ref);
  323|   308k|}
document.c:is_html_comment:
 3759|  1.45M|{
 3760|  1.45M|	size_t i = 0;
 3761|       |
 3762|  1.45M|	if (beg + 5 >= end) return 0;
  ------------------
  |  Branch (3762:6): [True: 7.65k, False: 1.44M]
  ------------------
 3763|  1.44M|	if (!(data[beg] == '<'  && data[beg + 1] == '!' && data[beg + 2] == '-' && data[beg + 3] == '-')) return 0;
  ------------------
  |  Branch (3763:8): [True: 79.9k, False: 1.36M]
  |  Branch (3763:29): [True: 27.8k, False: 52.1k]
  |  Branch (3763:53): [True: 19.1k, False: 8.70k]
  |  Branch (3763:77): [True: 18.2k, False: 891]
  ------------------
 3764|       |
 3765|  18.2k|	i = 5;
 3766|  23.2M|	while (beg + i < end && !(data[beg + i - 2] == '-' && data[beg + i - 1] == '-' && data[beg + i] == '>')) i++;
  ------------------
  |  Branch (3766:9): [True: 23.2M, False: 1.11k]
  |  Branch (3766:28): [True: 463k, False: 22.7M]
  |  Branch (3766:56): [True: 181k, False: 281k]
  |  Branch (3766:84): [True: 17.1k, False: 164k]
  ------------------
 3767|       |	/* i can only ever be beyond the end if the ending --> is not found */
 3768|  18.2k|	if (beg + i >= end) return 0;
  ------------------
  |  Branch (3768:6): [True: 1.11k, False: 17.1k]
  ------------------
 3769|  17.1k|	i++;
 3770|       |
 3771|  17.1k|	if (beg + i < end && (data[beg + i] == '\n' || data[beg + i] == '\r')) {
  ------------------
  |  Branch (3771:6): [True: 17.1k, False: 24]
  |  Branch (3771:24): [True: 5.43k, False: 11.7k]
  |  Branch (3771:49): [True: 10.1k, False: 1.52k]
  ------------------
 3772|  15.6k|		i++;
 3773|  15.6k|		if (beg + i < end && data[beg + i] == '\r' && data[beg + i - 1] == '\n') i++;
  ------------------
  |  Branch (3773:7): [True: 15.5k, False: 17]
  |  Branch (3773:24): [True: 3.88k, False: 11.7k]
  |  Branch (3773:49): [True: 1.50k, False: 2.38k]
  ------------------
 3774|  15.6k|	}
 3775|       |
 3776|  17.1k|	if (last)
  ------------------
  |  Branch (3776:6): [True: 17.1k, False: 0]
  ------------------
 3777|  17.1k|		*last = beg + i;
 3778|       |
 3779|  17.1k|	return 1;
 3780|  18.2k|}
document.c:is_ref:
 3785|  1.43M|{
 3786|       |/*	int n; */
 3787|  1.43M|	size_t i = 0;
 3788|  1.43M|	size_t id_offset, id_end;
 3789|  1.43M|	size_t link_offset, link_end;
 3790|  1.43M|	size_t title_offset, title_end;
 3791|  1.43M|	size_t line_end;
 3792|  1.43M|	size_t attr_offset = 0, attr_end = 0;
 3793|       |
 3794|       |	/* up to 3 optional leading spaces */
 3795|  1.43M|	if (beg + 3 >= end) return 0;
  ------------------
  |  Branch (3795:6): [True: 4.39k, False: 1.43M]
  ------------------
 3796|  1.43M|	if (data[beg] == ' ') { i = 1;
  ------------------
  |  Branch (3796:6): [True: 250k, False: 1.18M]
  ------------------
 3797|   250k|	if (data[beg + 1] == ' ') { i = 2;
  ------------------
  |  Branch (3797:6): [True: 23.6k, False: 226k]
  ------------------
 3798|  23.6k|	if (data[beg + 2] == ' ') { i = 3;
  ------------------
  |  Branch (3798:6): [True: 12.6k, False: 10.9k]
  ------------------
 3799|  12.6k|	if (data[beg + 3] == ' ') return 0; } } }
  ------------------
  |  Branch (3799:6): [True: 7.17k, False: 5.48k]
  ------------------
 3800|  1.42M|	i += beg;
 3801|       |
 3802|       |	/* id part: anything but a newline between brackets */
 3803|  1.42M|	if (data[i] != '[') return 0;
  ------------------
  |  Branch (3803:6): [True: 1.26M, False: 159k]
  ------------------
 3804|   159k|	i++;
 3805|   159k|	id_offset = i;
 3806|  1.58M|	while (i < end && data[i] != '\n' && data[i] != '\r' && data[i] != ']')
  ------------------
  |  Branch (3806:9): [True: 1.58M, False: 95]
  |  Branch (3806:20): [True: 1.57M, False: 9.86k]
  |  Branch (3806:39): [True: 1.57M, False: 7.59k]
  |  Branch (3806:58): [True: 1.42M, False: 141k]
  ------------------
 3807|  1.42M|		i++;
 3808|   159k|	if (i >= end || data[i] != ']') return 0;
  ------------------
  |  Branch (3808:6): [True: 95, False: 159k]
  |  Branch (3808:18): [True: 17.4k, False: 141k]
  ------------------
 3809|   141k|	id_end = i;
 3810|       |
 3811|       |	/* spacer: colon (space | tab)* newline? (space | tab)* */
 3812|   141k|	i++;
 3813|   141k|	if (i >= end || data[i] != ':') return 0;
  ------------------
  |  Branch (3813:6): [True: 27, False: 141k]
  |  Branch (3813:18): [True: 19.7k, False: 121k]
  ------------------
 3814|   121k|	i++;
 3815|   124k|	while (i < end && data[i] == ' ') i++;
  ------------------
  |  Branch (3815:9): [True: 124k, False: 30]
  |  Branch (3815:20): [True: 2.52k, False: 121k]
  ------------------
 3816|   121k|	if (i < end && (data[i] == '\n' || data[i] == '\r')) {
  ------------------
  |  Branch (3816:6): [True: 121k, False: 30]
  |  Branch (3816:18): [True: 3.76k, False: 118k]
  |  Branch (3816:37): [True: 30.0k, False: 88.0k]
  ------------------
 3817|  33.8k|		i++;
 3818|  33.8k|		if (i < end && data[i] == '\r' && data[i - 1] == '\n') i++; }
  ------------------
  |  Branch (3818:7): [True: 33.7k, False: 10]
  |  Branch (3818:18): [True: 18.4k, False: 15.3k]
  |  Branch (3818:37): [True: 897, False: 17.5k]
  ------------------
 3819|   122k|	while (i < end && data[i] == ' ') i++;
  ------------------
  |  Branch (3819:9): [True: 122k, False: 57]
  |  Branch (3819:20): [True: 662, False: 121k]
  ------------------
 3820|   121k|	if (i >= end) return 0;
  ------------------
  |  Branch (3820:6): [True: 57, False: 121k]
  ------------------
 3821|       |
 3822|       |	/* link: spacing-free sequence, optionally between angle brackets */
 3823|   121k|	if (data[i] == '<')
  ------------------
  |  Branch (3823:6): [True: 688, False: 121k]
  ------------------
 3824|    688|		i++;
 3825|       |
 3826|   121k|	link_offset = i;
 3827|       |
 3828|  2.13M|	while (i < end && data[i] != ' ' && data[i] != '\n' && data[i] != '\r')
  ------------------
  |  Branch (3828:9): [True: 2.13M, False: 214]
  |  Branch (3828:20): [True: 2.08M, False: 54.1k]
  |  Branch (3828:38): [True: 2.04M, False: 37.2k]
  |  Branch (3828:57): [True: 2.01M, False: 30.1k]
  ------------------
 3829|  2.01M|		i++;
 3830|       |
 3831|   121k|	if (data[i - 1] == '>') link_end = i - 1;
  ------------------
  |  Branch (3831:6): [True: 622, False: 121k]
  ------------------
 3832|   121k|	else link_end = i;
 3833|       |
 3834|       |	/* optional spacer: (space | tab)* (newline | '\'' | '"' | '(' ) */
 3835|   176k|	while (i < end && data[i] == ' ') i++;
  ------------------
  |  Branch (3835:9): [True: 176k, False: 233]
  |  Branch (3835:20): [True: 54.6k, False: 121k]
  ------------------
 3836|   121k|	if (i < end && data[i] != '\n' && data[i] != '\r'
  ------------------
  |  Branch (3836:6): [True: 121k, False: 233]
  |  Branch (3836:17): [True: 84.1k, False: 37.5k]
  |  Branch (3836:36): [True: 53.8k, False: 30.2k]
  ------------------
 3837|  53.8k|			&& data[i] != '\'' && data[i] != '"' && data[i] != '(')
  ------------------
  |  Branch (3837:7): [True: 43.4k, False: 10.3k]
  |  Branch (3837:26): [True: 41.4k, False: 1.99k]
  |  Branch (3837:44): [True: 13.1k, False: 28.3k]
  ------------------
 3838|  13.1k|		return 0;
 3839|   108k|	line_end = 0;
 3840|       |	/* computing end-of-line */
 3841|   108k|	if (i >= end || data[i] == '\r' || data[i] == '\n') line_end = i;
  ------------------
  |  Branch (3841:6): [True: 233, False: 108k]
  |  Branch (3841:18): [True: 30.2k, False: 78.2k]
  |  Branch (3841:37): [True: 37.5k, False: 40.7k]
  ------------------
 3842|   108k|	if (i + 1 < end && data[i] == '\n' && data[i + 1] == '\r')
  ------------------
  |  Branch (3842:6): [True: 108k, False: 287]
  |  Branch (3842:21): [True: 37.4k, False: 70.9k]
  |  Branch (3842:40): [True: 493, False: 36.9k]
  ------------------
 3843|    493|		line_end = i + 1;
 3844|       |
 3845|       |	/* optional (space|tab)* spacer after a newline */
 3846|   108k|	if (line_end) {
  ------------------
  |  Branch (3846:6): [True: 68.0k, False: 40.7k]
  ------------------
 3847|  68.0k|		i = line_end + 1;
 3848|  74.8k|		while (i < end && data[i] == ' ') i++; }
  ------------------
  |  Branch (3848:10): [True: 74.5k, False: 285]
  |  Branch (3848:21): [True: 6.85k, False: 67.7k]
  ------------------
 3849|       |
 3850|       |	/* optional title: any non-newline sequence enclosed in '"()
 3851|       |					alone on its line */
 3852|   108k|	title_offset = title_end = 0;
 3853|   108k|	if (i + 1 < end
  ------------------
  |  Branch (3853:6): [True: 108k, False: 323]
  ------------------
 3854|   108k|	&& (data[i] == '\'' || data[i] == '"' || data[i] == '(')) {
  ------------------
  |  Branch (3854:6): [True: 11.1k, False: 97.2k]
  |  Branch (3854:25): [True: 4.00k, False: 93.2k]
  |  Branch (3854:43): [True: 51.2k, False: 41.9k]
  ------------------
 3855|  66.4k|		char d = data[i++];
 3856|  66.4k|		title_offset = i;
 3857|       |
 3858|       |		/* looking for end of tile */
 3859|  5.31M|		while (i < end && data[i] != d && data[i] != '\n' && data[i] != '\r') {
  ------------------
  |  Branch (3859:10): [True: 5.31M, False: 228]
  |  Branch (3859:21): [True: 5.27M, False: 38.2k]
  |  Branch (3859:37): [True: 5.25M, False: 24.8k]
  |  Branch (3859:56): [True: 5.24M, False: 3.10k]
  ------------------
 3860|  5.24M|			++i;
 3861|  5.24M|		}
 3862|       |
 3863|  66.4k|		if (i + 1 < end && data[i] == d) {
  ------------------
  |  Branch (3863:7): [True: 66.1k, False: 267]
  |  Branch (3863:22): [True: 38.2k, False: 27.9k]
  ------------------
 3864|  38.2k|			title_end = i++;
 3865|  38.2k|			attr_offset = i;
 3866|       |
 3867|       |			/* looking for EOL */
 3868|  5.80M|			while (i < end && data[i] != '\n' && data[i] != '\r') {
  ------------------
  |  Branch (3868:11): [True: 5.80M, False: 188]
  |  Branch (3868:22): [True: 5.77M, False: 36.2k]
  |  Branch (3868:41): [True: 5.76M, False: 1.77k]
  ------------------
 3869|  5.76M|				i++;
 3870|  5.76M|			}
 3871|       |
 3872|       |			/* looking for attribute */
 3873|  38.2k|			if (data[i-1] == '}' &&
  ------------------
  |  Branch (3873:8): [True: 32.8k, False: 5.33k]
  ------------------
 3874|  32.8k|				memchr(&data[attr_offset], '{', i - attr_offset)) {
  ------------------
  |  Branch (3874:5): [True: 32.2k, False: 686]
  ------------------
 3875|   143k|				while (attr_offset < i && data[attr_offset] != '{') {
  ------------------
  |  Branch (3875:12): [True: 143k, False: 0]
  |  Branch (3875:31): [True: 111k, False: 32.2k]
  ------------------
 3876|   111k|					++attr_offset;
 3877|   111k|				}
 3878|  32.2k|				++attr_offset;
 3879|  32.2k|				attr_end = i - 1;
 3880|  32.2k|			} else {
 3881|  6.02k|				if (data[i-1] == d) {
  ------------------
  |  Branch (3881:9): [True: 2.42k, False: 3.60k]
  ------------------
 3882|  2.42k|					title_end = i - 1;
 3883|  3.60k|				} else {
 3884|  3.60k|					title_end = i;
 3885|  3.60k|				}
 3886|  6.02k|				attr_offset = 0;
 3887|  6.02k|				attr_end = 0;
 3888|  6.02k|			}
 3889|  38.2k|			if (i + 1 < end && data[i] == '\r' && data[i + 1] == '\n') {
  ------------------
  |  Branch (3889:8): [True: 38.0k, False: 198]
  |  Branch (3889:23): [True: 1.77k, False: 36.2k]
  |  Branch (3889:42): [True: 218, False: 1.55k]
  ------------------
 3890|    218|				++i;
 3891|    218|			}
 3892|       |
 3893|  38.2k|			line_end = i;
 3894|  38.2k|		} else {
 3895|       |			/* looking for EOL */
 3896|  28.2k|			while (i < end && data[i] != '\n' && data[i] != '\r') {
  ------------------
  |  Branch (3896:11): [True: 27.9k, False: 236]
  |  Branch (3896:22): [True: 3.11k, False: 24.8k]
  |  Branch (3896:41): [True: 8, False: 3.10k]
  ------------------
 3897|      8|				i++;
 3898|      8|			}
 3899|  28.1k|			if (i + 1 < end && data[i] == '\n' && data[i + 1] == '\r') {
  ------------------
  |  Branch (3899:8): [True: 27.9k, False: 267]
  |  Branch (3899:23): [True: 24.8k, False: 3.09k]
  |  Branch (3899:42): [True: 732, False: 24.1k]
  ------------------
 3900|    732|				title_end = i + 1;
 3901|  27.4k|			} else {
 3902|  27.4k|				title_end = i;
 3903|  27.4k|			}
 3904|       |			/* stepping back */
 3905|  28.1k|			i -= 1;
 3906|  28.9k|			while (i > title_offset && data[i] == ' ') {
  ------------------
  |  Branch (3906:11): [True: 27.3k, False: 1.55k]
  |  Branch (3906:31): [True: 744, False: 26.6k]
  ------------------
 3907|    744|				i -= 1;
 3908|    744|			}
 3909|  28.1k|			if (i > title_offset &&
  ------------------
  |  Branch (3909:8): [True: 26.6k, False: 1.55k]
  ------------------
 3910|  26.6k|				(data[i] == '\'' || data[i] == '"' || data[i] == ')')) {
  ------------------
  |  Branch (3910:6): [True: 18.9k, False: 7.71k]
  |  Branch (3910:25): [True: 575, False: 7.14k]
  |  Branch (3910:43): [True: 1.66k, False: 5.47k]
  ------------------
 3911|  21.1k|				line_end = title_end;
 3912|  21.1k|				title_end = i;
 3913|  21.1k|			}
 3914|  28.1k|		}
 3915|  66.4k|	}
 3916|       |
 3917|   108k|	if (!line_end || link_end == link_offset)
  ------------------
  |  Branch (3917:6): [True: 3.05k, False: 105k]
  |  Branch (3917:19): [True: 18.5k, False: 87.1k]
  ------------------
 3918|  21.5k|		return 0; /* garbage after the link empty link */
 3919|       |
 3920|       |	/* a valid ref has been found, filling-in return structures */
 3921|  87.1k|	if (last)
  ------------------
  |  Branch (3921:6): [True: 87.1k, False: 0]
  ------------------
 3922|  87.1k|		*last = line_end;
 3923|       |
 3924|  87.1k|	if (refs) {
  ------------------
  |  Branch (3924:6): [True: 87.1k, False: 0]
  ------------------
 3925|  87.1k|		struct link_ref *ref;
 3926|       |
 3927|  87.1k|		ref = add_link_ref(refs, data + id_offset, id_end - id_offset);
 3928|  87.1k|		if (!ref)
  ------------------
  |  Branch (3928:7): [True: 0, False: 87.1k]
  ------------------
 3929|      0|			return 0;
 3930|       |
 3931|  87.1k|		ref->link = hoedown_buffer_new(link_end - link_offset);
 3932|  87.1k|		hoedown_buffer_put(ref->link, data + link_offset, link_end - link_offset);
 3933|       |
 3934|  87.1k|		if (title_end > title_offset) {
  ------------------
  |  Branch (3934:7): [True: 28.8k, False: 58.2k]
  ------------------
 3935|  28.8k|			ref->title = hoedown_buffer_new(title_end - title_offset);
 3936|  28.8k|			hoedown_buffer_put(ref->title, data + title_offset, title_end - title_offset);
 3937|  28.8k|		}
 3938|  87.1k|		if (attr_end > attr_offset) {
  ------------------
  |  Branch (3938:7): [True: 32.1k, False: 54.9k]
  ------------------
 3939|  32.1k|			ref->attr = hoedown_buffer_new(attr_end - attr_offset);
 3940|  32.1k|			hoedown_buffer_put(ref->attr, data + attr_offset, attr_end - attr_offset);
 3941|  32.1k|		}
 3942|  87.1k|	}
 3943|       |
 3944|  87.1k|	return 1;
 3945|  87.1k|}
document.c:add_link_ref:
  223|  87.1k|{
  224|  87.1k|	struct link_ref *ref = hoedown_calloc(1, sizeof(struct link_ref));
  225|       |
  226|  87.1k|	ref->id = hash_link_ref(name, name_size);
  227|  87.1k|	ref->next = references[ref->id % REF_TABLE_SIZE];
  ------------------
  |  |   16|  87.1k|#define REF_TABLE_SIZE 8
  ------------------
  228|       |
  229|  87.1k|	references[ref->id % REF_TABLE_SIZE] = ref;
  ------------------
  |  |   16|  87.1k|#define REF_TABLE_SIZE 8
  ------------------
  230|  87.1k|	return ref;
  231|  87.1k|}
document.c:expand_tabs:
 3948|  1.25M|{
 3949|       |	/* This code makes two assumptions:
 3950|       |	 * - Input is valid UTF-8.  (Any byte with top two bits 10 is skipped,
 3951|       |	 *   whether or not it is a valid UTF-8 continuation byte.)
 3952|       |	 * - Input contains no combining characters.  (Combining characters
 3953|       |	 *   should be skipped but are not.)
 3954|       |	 */
 3955|  1.25M|	size_t  i = 0, tab = 0;
 3956|       |
 3957|  46.9M|	while (i < size) {
  ------------------
  |  Branch (3957:9): [True: 46.8M, False: 107k]
  ------------------
 3958|  46.8M|		size_t org = i;
 3959|       |
 3960|   136M|		while (i < size && line[i] != '\t') {
  ------------------
  |  Branch (3960:10): [True: 135M, False: 1.15M]
  |  Branch (3960:22): [True: 90.0M, False: 45.6M]
  ------------------
 3961|       |			/* ignore UTF-8 continuation bytes */
 3962|  90.0M|			if ((line[i] & 0xc0) != 0x80)
  ------------------
  |  Branch (3962:8): [True: 84.6M, False: 5.34M]
  ------------------
 3963|  84.6M|				tab++;
 3964|  90.0M|			i++;
 3965|  90.0M|		}
 3966|       |
 3967|  46.8M|		if (i > org)
  ------------------
  |  Branch (3967:7): [True: 1.92M, False: 44.8M]
  ------------------
 3968|  1.92M|			hoedown_buffer_put(ob, line + org, i - org);
 3969|       |
 3970|  46.8M|		if (i >= size)
  ------------------
  |  Branch (3970:7): [True: 1.15M, False: 45.6M]
  ------------------
 3971|  1.15M|			break;
 3972|       |
 3973|   181M|		do {
 3974|   181M|			hoedown_buffer_putc(ob, ' '); tab++;
 3975|   181M|		} while (tab % 4);
  ------------------
  |  Branch (3975:12): [True: 135M, False: 45.6M]
  ------------------
 3976|       |
 3977|  45.6M|		i++;
 3978|  45.6M|	}
 3979|  1.25M|}
document.c:parse_block:
 3551|   136k|{
 3552|   136k|	size_t beg, end, i;
 3553|   136k|	uint8_t *txt_data;
 3554|   136k|	beg = 0;
 3555|       |
 3556|   136k|	if (doc->work_bufs[BUFFER_SPAN].size +
  ------------------
  |  |   19|   136k|#define BUFFER_SPAN 1
  ------------------
  |  Branch (3556:6): [True: 413, False: 136k]
  ------------------
 3557|   136k|		doc->work_bufs[BUFFER_BLOCK].size > doc->max_nesting)
  ------------------
  |  |   18|   136k|#define BUFFER_BLOCK 0
  ------------------
 3558|    413|		return;
 3559|       |
 3560|   662k|	while (beg < size) {
  ------------------
  |  Branch (3560:9): [True: 526k, False: 136k]
  ------------------
 3561|   526k|		txt_data = data + beg;
 3562|   526k|		end = size - beg;
 3563|       |
 3564|   526k|		if (is_atxheader(doc, txt_data, end))
  ------------------
  |  Branch (3564:7): [True: 11.8k, False: 514k]
  ------------------
 3565|  11.8k|			beg += parse_atxheader(ob, doc, txt_data, end);
 3566|       |
 3567|   514k|		else if (doc->user_block &&
  ------------------
  |  Branch (3567:12): [True: 0, False: 514k]
  ------------------
 3568|      0|				(i = parse_userblock(ob, doc, txt_data, end)) != 0)
  ------------------
  |  Branch (3568:5): [True: 0, False: 0]
  ------------------
 3569|      0|			beg += i;
 3570|       |
 3571|   514k|		else if (data[beg] == '<' && doc->md.blockhtml &&
  ------------------
  |  Branch (3571:12): [True: 24.3k, False: 490k]
  |  Branch (3571:32): [True: 0, False: 24.3k]
  ------------------
 3572|      0|				(i = parse_htmlblock(ob, doc, txt_data, end, 1)) != 0)
  ------------------
  |  Branch (3572:5): [True: 0, False: 0]
  ------------------
 3573|      0|			beg += i;
 3574|       |
 3575|   514k|		else if ((i = is_empty(txt_data, end)) != 0)
  ------------------
  |  Branch (3575:12): [True: 127k, False: 387k]
  ------------------
 3576|   127k|			beg += i;
 3577|       |
 3578|   387k|		else if (is_hrule(txt_data, end)) {
  ------------------
  |  Branch (3578:12): [True: 16.9k, False: 370k]
  ------------------
 3579|  95.8k|			while (beg < size && data[beg] != '\n')
  ------------------
  |  Branch (3579:11): [True: 90.9k, False: 4.86k]
  |  Branch (3579:25): [True: 78.9k, False: 12.0k]
  ------------------
 3580|  78.9k|				beg++;
 3581|       |
 3582|  16.9k|			if (doc->md.hrule) {
  ------------------
  |  Branch (3582:8): [True: 16.9k, False: 0]
  ------------------
 3583|  16.9k|				doc->hrule_char = data[beg - 1];
 3584|  16.9k|				doc->md.hrule(ob, &doc->data);
 3585|  16.9k|				doc->hrule_char = 0;
 3586|  16.9k|			}
 3587|       |
 3588|  16.9k|			beg++;
 3589|  16.9k|		}
 3590|       |
 3591|   370k|		else if ((doc->ext_flags & HOEDOWN_EXT_FENCED_CODE) != 0 &&
  ------------------
  |  Branch (3591:12): [True: 370k, False: 0]
  ------------------
 3592|   370k|			(i = parse_fencedcode(ob, doc, txt_data, end, doc->ext_flags)) != 0)
  ------------------
  |  Branch (3592:4): [True: 7.50k, False: 362k]
  ------------------
 3593|  7.50k|			beg += i;
 3594|       |
 3595|   362k|		else if ((doc->ext_flags & HOEDOWN_EXT_TABLES) != 0 &&
  ------------------
  |  Branch (3595:12): [True: 362k, False: 0]
  ------------------
 3596|   362k|			(i = parse_table(ob, doc, txt_data, end)) != 0)
  ------------------
  |  Branch (3596:4): [True: 11.1k, False: 351k]
  ------------------
 3597|  11.1k|			beg += i;
 3598|       |
 3599|   351k|		else if (prefix_quote(txt_data, end))
  ------------------
  |  Branch (3599:12): [True: 22.7k, False: 328k]
  ------------------
 3600|  22.7k|			beg += parse_blockquote(ob, doc, txt_data, end);
 3601|       |
 3602|   328k|		else if (!(doc->ext_flags & HOEDOWN_EXT_DISABLE_INDENTED_CODE) && prefix_code(txt_data, end))
  ------------------
  |  Branch (3602:12): [True: 0, False: 328k]
  |  Branch (3602:69): [True: 0, False: 0]
  ------------------
 3603|      0|			beg += parse_blockcode(ob, doc, txt_data, end);
 3604|       |
 3605|   328k|		else if (prefix_uli(txt_data, end))
  ------------------
  |  Branch (3605:12): [True: 20.5k, False: 308k]
  ------------------
 3606|  20.5k|			beg += parse_list(ob, doc, txt_data, end, 0);
 3607|       |
 3608|   308k|		else if (prefix_oli(txt_data, end))
  ------------------
  |  Branch (3608:12): [True: 14.0k, False: 294k]
  ------------------
 3609|  14.0k|			beg += parse_list(ob, doc, txt_data, end, HOEDOWN_LIST_ORDERED);
 3610|       |
 3611|   294k|		else if ((doc->ext_flags & HOEDOWN_EXT_DEFINITION_LISTS) && prefix_dli(doc, txt_data, end))
  ------------------
  |  Branch (3611:12): [True: 294k, False: 0]
  |  Branch (3611:63): [True: 19.0k, False: 275k]
  ------------------
 3612|  19.0k|			beg += parse_list(ob, doc, txt_data, end, HOEDOWN_LIST_DEFINITION);
 3613|       |
 3614|   275k|		else
 3615|   275k|			beg += parse_paragraph(ob, doc, txt_data, end);
 3616|   526k|	}
 3617|   136k|}
document.c:is_atxheader:
 1857|  5.01M|{
 1858|  5.01M|	size_t level = 0, begin = 0, len;
 1859|  5.01M|	uint8_t *p;
 1860|       |
 1861|  5.01M|	if (data[0] != '#')
  ------------------
  |  Branch (1861:6): [True: 4.96M, False: 49.8k]
  ------------------
 1862|  4.96M|		return 0;
 1863|       |
 1864|   107k|	while (level < size && level < 6 && data[level] == '#')
  ------------------
  |  Branch (1864:9): [True: 106k, False: 960]
  |  Branch (1864:25): [True: 105k, False: 1.10k]
  |  Branch (1864:38): [True: 57.3k, False: 47.7k]
  ------------------
 1865|  57.3k|		level++;
 1866|       |
 1867|  49.8k|	if (level >= size || data[level] == '\n') {
  ------------------
  |  Branch (1867:6): [True: 960, False: 48.8k]
  |  Branch (1867:23): [True: 12.1k, False: 36.7k]
  ------------------
 1868|  13.0k|			return 0;
 1869|  13.0k|	}
 1870|       |
 1871|  36.7k|	len = size - level;
 1872|  36.7k|	p = memchr(data + level, '\n', len);
 1873|  36.7k|	if (p) {
  ------------------
  |  Branch (1873:6): [True: 33.9k, False: 2.76k]
  ------------------
 1874|  33.9k|		len = p - (data + level) + 1;
 1875|  33.9k|	}
 1876|       |
 1877|       |	/* if the header is only whitespace, it is not a header */
 1878|  36.7k|	if (len && is_empty_all(data + level, len)) {
  ------------------
  |  Branch (1878:6): [True: 36.7k, False: 0]
  |  Branch (1878:13): [True: 752, False: 35.9k]
  ------------------
 1879|    752|		return 0;
 1880|    752|	}
 1881|       |
 1882|  35.9k|	if ((doc->ext_flags & HOEDOWN_EXT_SPACE_HEADERS) && level < size && data[level] != ' ') {
  ------------------
  |  Branch (1882:6): [True: 35.9k, False: 0]
  |  Branch (1882:54): [True: 35.9k, False: 0]
  |  Branch (1882:70): [True: 15.8k, False: 20.1k]
  ------------------
 1883|  15.8k|		return 0;
 1884|  15.8k|	}
 1885|       |
 1886|       |	/* if the header is only special attribute, it is not a header */
 1887|  20.1k|	if (len && (doc->ext_flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE)) {
  ------------------
  |  Branch (1887:6): [True: 20.1k, False: 0]
  |  Branch (1887:13): [True: 20.1k, False: 0]
  ------------------
 1888|  20.1k|		p = memchr(data + level, '{', len);
 1889|  20.1k|		if (p) {
  ------------------
  |  Branch (1889:7): [True: 2.76k, False: 17.4k]
  ------------------
 1890|       |			/* get number of characters from # to { */
 1891|  2.76k|			begin = p - (data + level);
 1892|  2.76k|			if (begin > 0 && !is_empty_all(data + level, begin)) {
  ------------------
  |  Branch (1892:8): [True: 2.76k, False: 0]
  |  Branch (1892:21): [True: 1.81k, False: 947]
  ------------------
 1893|  1.81k|				return 1;
 1894|  1.81k|			}
 1895|       |			/* check for special attributes after the # */
 1896|    947|			return !parse_inline_attributes(data + level + begin, len - begin, NULL, doc->attr_activation);
 1897|  2.76k|		}
 1898|  20.1k|	}
 1899|       |
 1900|  17.4k|	return 1;
 1901|  20.1k|}
document.c:is_empty_all:
  361|  39.4k|{
  362|  39.4k|	size_t i = 0;
  363|   285k|	while (i < size && _isspace(data[i])) i++;
  ------------------
  |  Branch (363:9): [True: 283k, False: 1.69k]
  |  Branch (363:21): [True: 246k, False: 37.7k]
  ------------------
  364|  39.4k|	return i == size;
  365|  39.4k|}
document.c:_isspace:
  354|   107M|{
  355|   107M|	return c == ' ' || c == '\n';
  ------------------
  |  Branch (355:9): [True: 67.2M, False: 40.4M]
  |  Branch (355:21): [True: 624k, False: 39.8M]
  ------------------
  356|   107M|}
document.c:parse_inline_attributes:
  614|   334k|{
  615|   334k|	size_t attr_start, i = 0;
  616|       |
  617|   334k|	if (size < 1)
  ------------------
  |  Branch (617:6): [True: 72.5k, False: 261k]
  ------------------
  618|  72.5k|		return 0;
  619|       |
  620|   261k|	if (data[i] == '{' && (!attr_activation || (i + 1 < size && data[i + 1] == attr_activation))) {
  ------------------
  |  Branch (620:6): [True: 4.40k, False: 257k]
  |  Branch (620:25): [True: 4.40k, False: 0]
  |  Branch (620:46): [True: 0, False: 0]
  |  Branch (620:62): [True: 0, False: 0]
  ------------------
  621|  4.40k|		attr_start = i + 1;
  622|       |		/* skip an extra character to skip over the activation character if any */
  623|  4.40k|		if (attr_activation) attr_start++;
  ------------------
  |  Branch (623:7): [True: 0, False: 4.40k]
  ------------------
  624|   257k|	} else {
  625|   257k|		return 0;
  626|   257k|	}
  627|       |
  628|  6.66M|	while (i < size) {
  ------------------
  |  Branch (628:9): [True: 6.65M, False: 1.44k]
  ------------------
  629|       |		/* ignore escaped characters */
  630|  6.65M|		if (data[i] == '\\') {
  ------------------
  |  Branch (630:7): [True: 1.88k, False: 6.65M]
  ------------------
  631|  1.88k|			i += 2;
  632|  6.65M|		} else if (data[i] == '}') {
  ------------------
  |  Branch (632:14): [True: 2.95k, False: 6.65M]
  ------------------
  633|  2.95k|			if (attr != NULL) {
  ------------------
  |  Branch (633:8): [True: 2.45k, False: 508]
  ------------------
  634|  2.45k|				hoedown_buffer_put(attr, data + attr_start, i - attr_start);
  635|  2.45k|			}
  636|  2.95k|			return i + 1;
  637|  6.65M|		} else {
  638|  6.65M|			i++;
  639|  6.65M|		}
  640|  6.65M|	}
  641|  1.44k|	return 0;
  642|  4.40k|}
document.c:parse_atxheader:
 2701|  11.8k|{
 2702|  11.8k|	size_t level = 0;
 2703|  11.8k|	size_t i, end, skip;
 2704|       |
 2705|  26.8k|	while (level < size && level < 6 && data[level] == '#')
  ------------------
  |  Branch (2705:9): [True: 26.8k, False: 0]
  |  Branch (2705:25): [True: 26.3k, False: 571]
  |  Branch (2705:38): [True: 15.0k, False: 11.2k]
  ------------------
 2706|  15.0k|		level++;
 2707|       |
 2708|   120k|	for (i = level; i < size && data[i] == ' '; i++);
  ------------------
  |  Branch (2708:18): [True: 120k, False: 0]
  |  Branch (2708:30): [True: 108k, False: 11.8k]
  ------------------
 2709|       |
 2710|  12.0M|	for (end = i; end < size && data[end] != '\n'; end++);
  ------------------
  |  Branch (2710:16): [True: 12.0M, False: 2.49k]
  |  Branch (2710:30): [True: 12.0M, False: 9.34k]
  ------------------
 2711|  11.8k|	skip = end;
 2712|       |
 2713|  13.3k|	while (end && data[end - 1] == '#')
  ------------------
  |  Branch (2713:9): [True: 13.3k, False: 0]
  |  Branch (2713:16): [True: 1.52k, False: 11.8k]
  ------------------
 2714|  1.52k|		end--;
 2715|       |
 2716|  42.8k|	while (end && data[end - 1] == ' ')
  ------------------
  |  Branch (2716:9): [True: 42.8k, False: 0]
  |  Branch (2716:16): [True: 31.0k, False: 11.8k]
  ------------------
 2717|  31.0k|		end--;
 2718|       |
 2719|  11.8k|	if (end > i) {
  ------------------
  |  Branch (2719:6): [True: 10.5k, False: 1.28k]
  ------------------
 2720|  10.5k|		hoedown_buffer *work = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  10.5k|#define BUFFER_SPAN 1
  ------------------
 2721|  10.5k|		hoedown_buffer *attr = newbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  10.5k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2722|  10.5k|		size_t len;
 2723|       |
 2724|  10.5k|		len = end - i;
 2725|  10.5k|		if (doc->ext_flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE) {
  ------------------
  |  Branch (2725:7): [True: 10.5k, False: 0]
  ------------------
 2726|  10.5k|			len = parse_attributes(data + i, end - i, attr, NULL, "", 1, doc->attr_activation);
 2727|  10.5k|		}
 2728|       |
 2729|  10.5k|		parse_inline(work, doc, data + i, len);
 2730|       |
 2731|  10.5k|		if (doc->md.header) {
  ------------------
  |  Branch (2731:7): [True: 10.5k, False: 0]
  ------------------
 2732|  10.5k|			doc->header_type = HOEDOWN_HEADER_ATX;
 2733|  10.5k|			doc->md.header(ob, work, attr, (int)level, &doc->data);
 2734|  10.5k|			doc->header_type = HOEDOWN_HEADER_NONE;
 2735|  10.5k|		}
 2736|       |
 2737|  10.5k|		popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  10.5k|#define BUFFER_SPAN 1
  ------------------
 2738|  10.5k|		popbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  10.5k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2739|  10.5k|	} else {
 2740|  1.28k|		doc->md.header(ob, NULL, NULL, (int)level, &doc->data);
 2741|  1.28k|	}
 2742|       |
 2743|  11.8k|	return skip;
 2744|  11.8k|}
document.c:newbuf:
  164|  30.8M|{
  165|  30.8M|	static const size_t buf_size[3] = {256, 64, 64};
  166|  30.8M|	hoedown_buffer *work = NULL;
  167|  30.8M|	hoedown_stack *pool = &doc->work_bufs[type];
  168|       |
  169|  30.8M|	if (pool->size < pool->asize &&
  ------------------
  |  Branch (169:6): [True: 30.8M, False: 1.84k]
  ------------------
  170|  30.8M|		pool->item[pool->size] != NULL) {
  ------------------
  |  Branch (170:3): [True: 30.7M, False: 84.9k]
  ------------------
  171|  30.7M|		work = pool->item[pool->size++];
  172|  30.7M|		work->size = 0;
  173|  30.7M|	} else {
  174|  86.7k|		work = hoedown_buffer_new(buf_size[type]);
  175|  86.7k|		hoedown_stack_push(pool, work);
  176|  86.7k|	}
  177|       |
  178|  30.8M|	return work;
  179|  30.8M|}
document.c:parse_attributes:
  647|   799k|{
  648|   799k|	size_t i, len, begin = 0, end = 0;
  649|       |
  650|   799k|	if (size < 1)
  ------------------
  |  Branch (650:6): [True: 29.3k, False: 770k]
  ------------------
  651|  29.3k|		return 0;
  652|       |
  653|   770k|	i = size;
  654|   967k|	while (i && data[i-1] == '\n') {
  ------------------
  |  Branch (654:9): [True: 934k, False: 33.5k]
  |  Branch (654:14): [True: 197k, False: 736k]
  ------------------
  655|   197k|		i--;
  656|   197k|	}
  657|   770k|	len = i;
  658|       |
  659|   770k|	if (i && data[i-1] == '}') {
  ------------------
  |  Branch (659:6): [True: 736k, False: 33.5k]
  |  Branch (659:11): [True: 88.2k, False: 648k]
  ------------------
  660|  63.5M|		do {
  661|  63.5M|			i--;
  662|  63.5M|		} while (i && data[i] != '{');
  ------------------
  |  Branch (662:12): [True: 63.5M, False: 35.2k]
  |  Branch (662:17): [True: 63.4M, False: 53.0k]
  ------------------
  663|       |
  664|  88.2k|		begin = i + 1;
  665|  88.2k|		end = len - 1;
  666|   116k|		while (i && data[i-1] == ' ') {
  ------------------
  |  Branch (666:10): [True: 81.2k, False: 35.3k]
  |  Branch (666:15): [True: 28.3k, False: 52.9k]
  ------------------
  667|  28.3k|			i--;
  668|  28.3k|		}
  669|  88.2k|	}
  670|       |
  671|   770k|	if (is_header && i && data[i-1] == '#') {
  ------------------
  |  Branch (671:6): [True: 603k, False: 167k]
  |  Branch (671:19): [True: 582k, False: 21.2k]
  |  Branch (671:24): [True: 7.79k, False: 574k]
  ------------------
  672|  16.0k|		while (i && data[i-1] == '#') {
  ------------------
  |  Branch (672:10): [True: 12.2k, False: 3.79k]
  |  Branch (672:15): [True: 8.22k, False: 3.99k]
  ------------------
  673|  8.22k|			i--;
  674|  8.22k|		}
  675|  37.9k|		while (i && data[i-1] == ' ') {
  ------------------
  |  Branch (675:10): [True: 33.6k, False: 4.26k]
  |  Branch (675:15): [True: 30.1k, False: 3.52k]
  ------------------
  676|  30.1k|			i--;
  677|  30.1k|		}
  678|  7.79k|	}
  679|       |
  680|   770k|	if (begin && end && data[begin-1] == '{' && data[end] == '}') {
  ------------------
  |  Branch (680:6): [True: 88.2k, False: 682k]
  |  Branch (680:15): [True: 84.5k, False: 3.75k]
  |  Branch (680:22): [True: 76.1k, False: 8.41k]
  |  Branch (680:46): [True: 76.1k, False: 0]
  ------------------
  681|  76.1k|		if (begin >=2 && data[begin-2] == '\\' && data[end-1] == '\\') {
  ------------------
  |  Branch (681:7): [True: 53.0k, False: 23.0k]
  |  Branch (681:20): [True: 1.00k, False: 52.0k]
  |  Branch (681:45): [True: 230, False: 779]
  ------------------
  682|    230|			return len;
  683|    230|		}
  684|       |
  685|  75.8k|		if (block_attr && data[begin] == '@') {
  ------------------
  |  Branch (685:7): [True: 57.3k, False: 18.5k]
  |  Branch (685:21): [True: 8.88k, False: 48.4k]
  ------------------
  686|       |			/* skip the @ by incrementing past it */
  687|  8.88k|			begin++;
  688|  8.88k|			if (*block_id) {
  ------------------
  |  Branch (688:8): [True: 8.88k, False: 0]
  ------------------
  689|       |				/* if a block_id was fed in, check to make sure the string until the
  690|       |				 * space is identical */
  691|  35.7k|				while (begin < end && *block_id) {
  ------------------
  |  Branch (691:12): [True: 34.2k, False: 1.47k]
  |  Branch (691:27): [True: 28.8k, False: 5.47k]
  ------------------
  692|  28.8k|					if (data[begin] != (uint8_t)(*block_id)) {
  ------------------
  |  Branch (692:10): [True: 1.92k, False: 26.8k]
  ------------------
  693|  1.92k|						return len;
  694|  1.92k|					}
  695|  26.8k|					begin++;
  696|  26.8k|					block_id++;
  697|  26.8k|				}
  698|       |				/* it might have matched only the first portion of block_id; make sure
  699|       |				 * there's no more to it here */
  700|  6.95k|				if (*block_id) {
  ------------------
  |  Branch (700:9): [True: 731, False: 6.22k]
  ------------------
  701|    731|					return len;
  702|    731|				}
  703|  6.95k|			}
  704|  6.22k|			if (begin < end && data[begin] != ' ') {
  ------------------
  |  Branch (704:8): [True: 5.47k, False: 747]
  |  Branch (704:23): [True: 1.21k, False: 4.26k]
  ------------------
  705|  1.21k|				return len;
  706|  1.21k|			}
  707|  5.00k|			if (block_attr) {
  ------------------
  |  Branch (707:8): [True: 5.00k, False: 0]
  ------------------
  708|  5.00k|				if (block_attr->size) {
  ------------------
  |  Branch (708:9): [True: 3.25k, False: 1.75k]
  ------------------
  709|  3.25k|					hoedown_buffer_reset(block_attr);
  710|  3.25k|				}
  711|  5.00k|				hoedown_buffer_put(block_attr, data + begin, end - begin);
  712|  5.00k|			}
  713|  5.00k|			len = i;
  714|  5.00k|			if (attr) {
  ------------------
  |  Branch (714:8): [True: 5.00k, False: 0]
  ------------------
  715|  5.00k|				len = parse_attributes(data, len, attr, NULL, "", is_header, attr_activation);
  716|  5.00k|			}
  717|  66.9k|		} else if (attr && (!attr_activation || attr_activation == data[begin])) {
  ------------------
  |  Branch (717:14): [True: 54.0k, False: 12.9k]
  |  Branch (717:23): [True: 54.0k, False: 0]
  |  Branch (717:43): [True: 0, False: 0]
  ------------------
  718|  54.0k|			if (attr->size) {
  ------------------
  |  Branch (718:8): [True: 0, False: 54.0k]
  ------------------
  719|      0|				hoedown_buffer_reset(attr);
  720|      0|			}
  721|  54.0k|			if (attr_activation) {
  ------------------
  |  Branch (721:8): [True: 0, False: 54.0k]
  ------------------
  722|      0|				begin++;
  723|      0|			}
  724|  54.0k|			hoedown_buffer_put(attr, data + begin, end - begin);
  725|  54.0k|			len = i;
  726|  54.0k|		}
  727|  75.8k|	}
  728|       |
  729|   766k|	return len;
  730|   770k|}
document.c:popbuf:
  183|  29.2M|{
  184|  29.2M|	doc->work_bufs[type].size--;
  185|  29.2M|}
document.c:parse_htmlblock:
 2867|   263k|{
 2868|   263k|	hoedown_buffer work = { NULL, 0, 0, 0, NULL, NULL, NULL };
 2869|   263k|	size_t i, j = 0, tag_len, tag_end;
 2870|   263k|	const char *curtag = NULL;
 2871|   263k|	int meta = 0;
 2872|       |
 2873|   263k|	work.data = data;
 2874|       |
 2875|       |	/* identification of the opening tag */
 2876|   263k|	if (size < 2 || data[0] != '<')
  ------------------
  |  Branch (2876:6): [True: 221, False: 262k]
  |  Branch (2876:18): [True: 0, False: 262k]
  ------------------
 2877|    221|		return 0;
 2878|       |
 2879|   262k|	i = 1;
 2880|  14.9M|	while (i < size && data[i] != '>' && data[i] != ' ')
  ------------------
  |  Branch (2880:9): [True: 14.9M, False: 17.9k]
  |  Branch (2880:21): [True: 14.8M, False: 29.5k]
  |  Branch (2880:39): [True: 14.6M, False: 215k]
  ------------------
 2881|  14.6M|		i++;
 2882|       |
 2883|   262k|	if (i < size) {
  ------------------
  |  Branch (2883:6): [True: 244k, False: 17.9k]
  ------------------
 2884|   244k|		if (doc->ext_flags & HOEDOWN_EXT_HTML5_BLOCKS)
  ------------------
  |  Branch (2884:7): [True: 244k, False: 0]
  ------------------
 2885|   244k|			curtag = hoedown_find_html5_block_tag((char *)data + 1, (int)i - 1);
 2886|      0|		else
 2887|      0|			curtag = hoedown_find_block_tag((char *)data + 1, (int)i - 1);
 2888|   244k|	}	
 2889|       |
 2890|       |	/* handling of special cases */
 2891|   262k|	if (!curtag) {
  ------------------
  |  Branch (2891:6): [True: 255k, False: 7.53k]
  ------------------
 2892|       |
 2893|       |		/* HTML comment, laxist form */
 2894|   255k|		if (size > 5 && data[1] == '!' && data[2] == '-' && data[3] == '-') {
  ------------------
  |  Branch (2894:7): [True: 251k, False: 3.76k]
  |  Branch (2894:19): [True: 43.4k, False: 208k]
  |  Branch (2894:37): [True: 31.8k, False: 11.5k]
  |  Branch (2894:55): [True: 28.8k, False: 2.99k]
  ------------------
 2895|  28.8k|			i = 5;
 2896|       |
 2897|  28.8k|			if (data[4] == '*') {
  ------------------
  |  Branch (2897:8): [True: 394, False: 28.4k]
  ------------------
 2898|    394|				meta++;
 2899|    394|			}
 2900|       |
 2901|   134M|			while (i < size && !(data[i - 2] == '-' && data[i - 1] == '-' && data[i] == '>'))
  ------------------
  |  Branch (2901:11): [True: 134M, False: 2.78k]
  |  Branch (2901:25): [True: 4.22M, False: 130M]
  |  Branch (2901:47): [True: 951k, False: 3.27M]
  |  Branch (2901:69): [True: 26.0k, False: 925k]
  ------------------
 2902|   134M|				i++;
 2903|       |
 2904|  28.8k|			if (data[i - 3] == '*') {
  ------------------
  |  Branch (2904:8): [True: 226, False: 28.6k]
  ------------------
 2905|    226|				meta++;
 2906|    226|			}
 2907|       |
 2908|  28.8k|			i++;
 2909|       |
 2910|  28.8k|			if (i < size)
  ------------------
  |  Branch (2910:8): [True: 26.0k, False: 2.78k]
  ------------------
 2911|  26.0k|				j = is_empty(data + i, size - i);
 2912|       |
 2913|  28.8k|			if (j) {
  ------------------
  |  Branch (2913:8): [True: 998, False: 27.8k]
  ------------------
 2914|    998|				work.size = i + j;
 2915|       |
 2916|    998|				if (do_render && doc->ext_flags & HOEDOWN_EXT_META_BLOCK &&
  ------------------
  |  Branch (2916:9): [True: 0, False: 998]
  |  Branch (2916:22): [True: 0, False: 0]
  ------------------
 2917|      0|					meta == 2 && doc->meta) {
  ------------------
  |  Branch (2917:6): [True: 0, False: 0]
  |  Branch (2917:19): [True: 0, False: 0]
  ------------------
 2918|      0|					size_t org, sz;
 2919|       |
 2920|      0|					sz = work.size - 5;
 2921|      0|					while (sz > 0 && work.data[sz - 1] == '\n') {
  ------------------
  |  Branch (2921:13): [True: 0, False: 0]
  |  Branch (2921:23): [True: 0, False: 0]
  ------------------
 2922|      0|						sz--;
 2923|      0|					}
 2924|       |
 2925|      0|					org = 5;
 2926|      0|					while (org < sz && work.data[org] == '\n') {
  ------------------
  |  Branch (2926:13): [True: 0, False: 0]
  |  Branch (2926:25): [True: 0, False: 0]
  ------------------
 2927|      0|						org++;
 2928|      0|					}
 2929|       |
 2930|      0|					if (org < sz) {
  ------------------
  |  Branch (2930:10): [True: 0, False: 0]
  ------------------
 2931|      0|						hoedown_buffer_put(doc->meta, work.data + org, sz - org);
 2932|      0|						hoedown_buffer_putc(doc->meta, '\n');
 2933|      0|					}
 2934|    998|				} else if (do_render && doc->md.blockhtml) {
  ------------------
  |  Branch (2934:16): [True: 0, False: 998]
  |  Branch (2934:29): [True: 0, False: 0]
  ------------------
 2935|      0|					doc->md.blockhtml(ob, &work, &doc->data);
 2936|      0|				}
 2937|    998|				return work.size;
 2938|    998|			}
 2939|  28.8k|		}
 2940|       |
 2941|       |		/* HR, which is the only self-closing block tag considered */
 2942|   254k|		if (size > 4 && (data[1] == 'h' || data[1] == 'H') && (data[2] == 'r' || data[2] == 'R')) {
  ------------------
  |  Branch (2942:7): [True: 251k, False: 2.80k]
  |  Branch (2942:20): [True: 2.86k, False: 248k]
  |  Branch (2942:38): [True: 29.2k, False: 219k]
  |  Branch (2942:58): [True: 9.19k, False: 22.9k]
  |  Branch (2942:76): [True: 5.67k, False: 17.2k]
  ------------------
 2943|  14.8k|			i = 3;
 2944|   141M|			while (i < size && data[i] != '>')
  ------------------
  |  Branch (2944:11): [True: 141M, False: 3.77k]
  |  Branch (2944:23): [True: 141M, False: 11.0k]
  ------------------
 2945|   141M|				i++;
 2946|       |
 2947|  14.8k|			if (i + 1 < size) {
  ------------------
  |  Branch (2947:8): [True: 11.0k, False: 3.77k]
  ------------------
 2948|  11.0k|				i++;
 2949|  11.0k|				j = is_empty(data + i, size - i);
 2950|  11.0k|				if (j) {
  ------------------
  |  Branch (2950:9): [True: 1.21k, False: 9.87k]
  ------------------
 2951|  1.21k|					work.size = i + j;
 2952|  1.21k|					if (do_render && doc->md.blockhtml)
  ------------------
  |  Branch (2952:10): [True: 0, False: 1.21k]
  |  Branch (2952:23): [True: 0, False: 0]
  ------------------
 2953|      0|						doc->md.blockhtml(ob, &work, &doc->data);
 2954|  1.21k|					return work.size;
 2955|  1.21k|				}
 2956|  11.0k|			}
 2957|  14.8k|		}
 2958|       |
 2959|       |		/* Extension script tags */
 2960|   253k|		if (doc->ext_flags & HOEDOWN_EXT_SCRIPT_TAGS) {
  ------------------
  |  Branch (2960:7): [True: 253k, False: 0]
  ------------------
 2961|   253k|			i = script_tag_length(data, size);
 2962|   253k|			if (i) {
  ------------------
  |  Branch (2962:8): [True: 10.0k, False: 243k]
  ------------------
 2963|  10.0k|				if (i < size) {
  ------------------
  |  Branch (2963:9): [True: 4.70k, False: 5.30k]
  ------------------
 2964|  4.70k|					j = is_empty(data + i, size - i);
 2965|  4.70k|				}
 2966|       |
 2967|  10.0k|				if (j) {
  ------------------
  |  Branch (2967:9): [True: 655, False: 9.36k]
  ------------------
 2968|    655|					work.size = i + j;
 2969|    655|					if (do_render && doc->md.blockhtml) {
  ------------------
  |  Branch (2969:10): [True: 0, False: 655]
  |  Branch (2969:23): [True: 0, False: 0]
  ------------------
 2970|      0|						doc->md.blockhtml(ob, &work, &doc->data);
 2971|      0|					}
 2972|    655|					return work.size;
 2973|    655|				}
 2974|  10.0k|			}
 2975|       |
 2976|   253k|		}
 2977|       |
 2978|       |		/* no special case recognised */
 2979|   252k|		return 0;
 2980|   253k|	}
 2981|       |
 2982|       |	/* looking for a matching closing tag in strict mode */
 2983|  7.53k|	tag_len = strlen(curtag);
 2984|  7.53k|	tag_end = htmlblock_find_end_strict(curtag, tag_len, doc, data, size);
 2985|       |
 2986|       |	/* if not found, trying a second pass looking for indented match */
 2987|       |	/* but not if tag is "ins" or "del" (following original Markdown.pl) */
 2988|  7.53k|	if (!tag_end && strcmp(curtag, "ins") != 0 && strcmp(curtag, "del") != 0)
  ------------------
  |  Branch (2988:6): [True: 6.35k, False: 1.18k]
  |  Branch (2988:18): [True: 5.80k, False: 548]
  |  Branch (2988:48): [True: 5.52k, False: 283]
  ------------------
 2989|  5.52k|		tag_end = htmlblock_find_end(curtag, tag_len, doc, data, size);
 2990|       |
 2991|  7.53k|	if (!tag_end)
  ------------------
  |  Branch (2991:6): [True: 5.17k, False: 2.35k]
  ------------------
 2992|  5.17k|		return 0;
 2993|       |
 2994|       |	/* the end of the block has been found */
 2995|  2.35k|	work.size = tag_end;
 2996|  2.35k|	if (do_render && doc->md.blockhtml)
  ------------------
  |  Branch (2996:6): [True: 0, False: 2.35k]
  |  Branch (2996:19): [True: 0, False: 0]
  ------------------
 2997|      0|		doc->md.blockhtml(ob, &work, &doc->data);
 2998|       |
 2999|  2.35k|	return tag_end;
 3000|  7.53k|}
document.c:script_tag_length:
  427|   392k|{
  428|   392k|	size_t i = 2;
  429|   392k|	char comment = 0;
  430|       |
  431|   392k|	if (size < 3 || data[0] != '<' || data[1] != '?') {
  ------------------
  |  Branch (431:6): [True: 1.02k, False: 391k]
  |  Branch (431:18): [True: 0, False: 391k]
  |  Branch (431:36): [True: 378k, False: 12.6k]
  ------------------
  432|   380k|		return 0;
  433|   380k|	}
  434|       |
  435|  12.6k|	i = 2;
  436|       |
  437|   361M|	while (i < size) {
  ------------------
  |  Branch (437:9): [True: 361M, False: 7.50k]
  ------------------
  438|   361M|		if (data[i - 1] == '?' && data[i] == '>' && comment == 0) {
  ------------------
  |  Branch (438:7): [True: 281k, False: 360M]
  |  Branch (438:29): [True: 9.02k, False: 272k]
  |  Branch (438:47): [True: 5.16k, False: 3.85k]
  ------------------
  439|  5.16k|			break;
  440|  5.16k|		}
  441|       |
  442|   361M|		if (data[i] == '\'' || data[i] == '"') {
  ------------------
  |  Branch (442:7): [True: 382k, False: 360M]
  |  Branch (442:26): [True: 3.72M, False: 357M]
  ------------------
  443|  4.10M|			if (comment != 0) {
  ------------------
  |  Branch (443:8): [True: 2.51M, False: 1.59M]
  ------------------
  444|  2.51M|				if (data[i] == comment && data[i - 1] != '\\') {
  ------------------
  |  Branch (444:9): [True: 1.59M, False: 921k]
  |  Branch (444:31): [True: 1.58M, False: 5.71k]
  ------------------
  445|  1.58M|					comment = 0;
  446|  1.58M|				}
  447|  2.51M|			} else {
  448|  1.59M|				comment = data[i];
  449|  1.59M|			}
  450|  4.10M|		}
  451|       |
  452|   361M|		++i;
  453|   361M|	}
  454|       |
  455|  12.6k|	if (i >= size) return i;
  ------------------
  |  Branch (455:6): [True: 7.50k, False: 5.16k]
  ------------------
  456|       |
  457|  5.16k|	return i + 1;
  458|  12.6k|}
document.c:htmlblock_find_end_strict:
 2848|  7.53k|{
 2849|  7.53k|	size_t i = 0, mark;
 2850|       |
 2851|  6.20M|	while (1) {
  ------------------
  |  Branch (2851:9): [True: 6.20M, Folded]
  ------------------
 2852|  6.20M|		mark = i;
 2853|   456M|		while (i < size && data[i] != '\n') i++;
  ------------------
  |  Branch (2853:10): [True: 456M, False: 6.97k]
  |  Branch (2853:22): [True: 450M, False: 6.19M]
  ------------------
 2854|  6.20M|		if (i < size) i++;
  ------------------
  |  Branch (2854:7): [True: 6.19M, False: 6.97k]
  ------------------
 2855|  6.20M|		if (i == mark) return 0;
  ------------------
  |  Branch (2855:7): [True: 6.35k, False: 6.19M]
  ------------------
 2856|       |
 2857|  6.19M|		mark += htmlblock_find_end(tag, tag_len, doc, data + mark, i - mark);
 2858|  6.19M|		if (mark == i && (is_empty(data + i, size - i) || (i + 1 < size && data[i] == '<' && data[i + 1] != '/') || i >= size)) break;
  ------------------
  |  Branch (2858:7): [True: 724k, False: 5.47M]
  |  Branch (2858:21): [True: 760, False: 723k]
  |  Branch (2858:54): [True: 723k, False: 194]
  |  Branch (2858:70): [True: 611k, False: 111k]
  |  Branch (2858:88): [True: 423, False: 610k]
  |  Branch (2858:111): [True: 0, False: 723k]
  ------------------
 2859|  6.19M|	}
 2860|       |
 2861|  1.18k|	return i;
 2862|  7.53k|}
document.c:htmlblock_find_end:
 2825|  6.20M|{
 2826|  6.20M|	size_t i = 0, w;
 2827|       |
 2828|  8.04M|	while (1) {
  ------------------
  |  Branch (2828:9): [True: 8.04M, Folded]
  ------------------
 2829|   659M|		while (i < size && data[i] != '<') i++;
  ------------------
  |  Branch (2829:10): [True: 654M, False: 5.47M]
  |  Branch (2829:22): [True: 651M, False: 2.56M]
  ------------------
 2830|  8.04M|		if (i >= size) return 0;
  ------------------
  |  Branch (2830:7): [True: 5.47M, False: 2.56M]
  ------------------
 2831|       |
 2832|  2.56M|		w = htmlblock_is_end(tag, tag_len, doc, data + i, size - i);
 2833|  2.56M|		if (w) return i + w;
  ------------------
  |  Branch (2833:7): [True: 725k, False: 1.83M]
  ------------------
 2834|  1.83M|		i++;
 2835|  1.83M|	}
 2836|  6.20M|}
document.c:htmlblock_is_end:
 2798|  2.56M|{
 2799|  2.56M|	size_t i = tag_len + 3, w;
 2800|       |
 2801|       |	/* try to match the end tag */
 2802|       |	/* note: we're not considering tags like "</tag >" which are still valid */
 2803|  2.56M|	if (i > size ||
  ------------------
  |  Branch (2803:6): [True: 187k, False: 2.37M]
  ------------------
 2804|  2.37M|		data[1] != '/' ||
  ------------------
  |  Branch (2804:3): [True: 1.52M, False: 854k]
  ------------------
 2805|   854k|		strncasecmp((char *)data + 2, tag, tag_len) != 0 ||
  ------------------
  |  Branch (2805:3): [True: 83.0k, False: 771k]
  ------------------
 2806|   771k|		data[tag_len + 2] != '>')
  ------------------
  |  Branch (2806:3): [True: 7.64k, False: 763k]
  ------------------
 2807|  1.80M|		return 0;
 2808|       |
 2809|       |	/* rest of the line must be empty */
 2810|   763k|	if ((w = is_empty(data + i, size - i)) == 0 && i < size)
  ------------------
  |  Branch (2810:6): [True: 37.7k, False: 725k]
  |  Branch (2810:49): [True: 37.7k, False: 0]
  ------------------
 2811|  37.7k|		return 0;
 2812|       |
 2813|   725k|	return i + w;
 2814|   763k|}
document.c:is_hrule:
 1749|  4.93M|{
 1750|  4.93M|	size_t i = 0, n = 0;
 1751|  4.93M|	uint8_t c;
 1752|       |
 1753|       |	/* skipping initial spaces */
 1754|  4.93M|	if (size < 3) return 0;
  ------------------
  |  Branch (1754:6): [True: 38.9k, False: 4.89M]
  ------------------
 1755|  4.89M|	if (data[0] == ' ') { i++;
  ------------------
  |  Branch (1755:6): [True: 328k, False: 4.56M]
  ------------------
 1756|   328k|	if (data[1] == ' ') { i++;
  ------------------
  |  Branch (1756:6): [True: 81.0k, False: 247k]
  ------------------
 1757|  81.0k|	if (data[2] == ' ') { i++; } } }
  ------------------
  |  Branch (1757:6): [True: 68.7k, False: 12.2k]
  ------------------
 1758|       |
 1759|       |	/* looking at the hrule uint8_t */
 1760|  4.89M|	if (i + 2 >= size
  ------------------
  |  Branch (1760:6): [True: 2.65k, False: 4.89M]
  ------------------
 1761|  4.89M|	|| (data[i] != '*' && data[i] != '-' && data[i] != '_'))
  ------------------
  |  Branch (1761:6): [True: 4.81M, False: 77.9k]
  |  Branch (1761:24): [True: 2.86M, False: 1.94M]
  |  Branch (1761:42): [True: 2.79M, False: 73.1k]
  ------------------
 1762|  2.79M|		return 0;
 1763|  2.10M|	c = data[i];
 1764|       |
 1765|       |	/* the whole line must be the char or space */
 1766|  6.12M|	while (i < size && data[i] != '\n') {
  ------------------
  |  Branch (1766:9): [True: 6.11M, False: 6.66k]
  |  Branch (1766:21): [True: 4.37M, False: 1.74M]
  ------------------
 1767|  4.37M|		if (data[i] == c) n++;
  ------------------
  |  Branch (1767:7): [True: 2.43M, False: 1.94M]
  ------------------
 1768|  1.94M|		else if (data[i] != ' ')
  ------------------
  |  Branch (1768:12): [True: 351k, False: 1.58M]
  ------------------
 1769|   351k|			return 0;
 1770|       |
 1771|  4.02M|		i++;
 1772|  4.02M|	}
 1773|       |
 1774|  1.74M|	return n >= 3;
 1775|  2.10M|}
document.c:parse_fencedcode:
 2273|  4.02M|{
 2274|  4.02M|	hoedown_buffer text = { 0, 0, 0, 0, NULL, NULL, NULL };
 2275|  4.02M|	hoedown_buffer lang = { 0, 0, 0, 0, NULL, NULL, NULL };
 2276|  4.02M|	size_t i = 0, text_start, line_start;
 2277|  4.02M|	size_t w, w2;
 2278|  4.02M|	size_t width, width2;
 2279|  4.02M|	uint8_t chr, chr2;
 2280|       |	/* needed for parse_attribute functions as buffer functions do not work with
 2281|       |	 * buffers on the stack */
 2282|  4.02M|	hoedown_buffer *attr = newbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  4.02M|#define BUFFER_ATTRIBUTE 2
  ------------------
 2283|       |
 2284|       |
 2285|       |	/* parse codefence line */
 2286|   399M|	while (i < size && data[i] != '\n')
  ------------------
  |  Branch (2286:9): [True: 399M, False: 27.3k]
  |  Branch (2286:21): [True: 395M, False: 3.99M]
  ------------------
 2287|   395M|		i++;
 2288|       |
 2289|  4.02M|	w = parse_codefence(doc, data, i, &lang, &width, &chr, flags, attr);
 2290|  4.02M|	if (!w) {
  ------------------
  |  Branch (2290:6): [True: 4.00M, False: 16.6k]
  ------------------
 2291|  4.00M|		popbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  4.00M|#define BUFFER_ATTRIBUTE 2
  ------------------
 2292|  4.00M|		return 0;
 2293|  4.00M|	}
 2294|       |
 2295|       |	/* search for end */
 2296|  16.6k|	i++;
 2297|  16.6k|	text_start = i;
 2298|  2.55M|	while ((line_start = i) < size) {
  ------------------
  |  Branch (2298:9): [True: 2.54M, False: 11.5k]
  ------------------
 2299|   106M|		while (i < size && data[i] != '\n')
  ------------------
  |  Branch (2299:10): [True: 106M, False: 285]
  |  Branch (2299:22): [True: 103M, False: 2.54M]
  ------------------
 2300|   103M|			i++;
 2301|       |
 2302|  2.54M|		w2 = is_codefence(data + line_start, i - line_start, &width2, &chr2);
 2303|  2.54M|		if (w == w2 && width == width2 && chr == chr2 &&
  ------------------
  |  Branch (2303:7): [True: 14.6k, False: 2.53M]
  |  Branch (2303:18): [True: 13.3k, False: 1.30k]
  |  Branch (2303:37): [True: 7.16k, False: 6.17k]
  ------------------
 2304|  7.16k|			is_empty(data + (line_start+w), i - (line_start+w)))
  ------------------
  |  Branch (2304:4): [True: 5.14k, False: 2.01k]
  ------------------
 2305|  5.14k|			break;
 2306|       |
 2307|  2.54M|		if (i < size) i++;
  ------------------
  |  Branch (2307:7): [True: 2.54M, False: 285]
  ------------------
 2308|  2.54M|	}
 2309|       |
 2310|  16.6k|	text.data = data + text_start;
 2311|  16.6k|	text.size = line_start - text_start;
 2312|       |
 2313|  16.6k|	if (doc->md.blockcode) {
  ------------------
  |  Branch (2313:6): [True: 7.50k, False: 9.19k]
  ------------------
 2314|  7.50k|		doc->fencedcode_char = chr;
 2315|  7.50k|		doc->md.blockcode(ob, text.size ? &text : NULL, lang.size ? &lang : NULL, attr->size ? attr : NULL, &doc->data);
  ------------------
  |  Branch (2315:25): [True: 2.17k, False: 5.32k]
  |  Branch (2315:51): [True: 4.16k, False: 3.33k]
  |  Branch (2315:77): [True: 2.16k, False: 5.33k]
  ------------------
 2316|  7.50k|		doc->fencedcode_char = 0;
 2317|  7.50k|	}
 2318|       |
 2319|  16.6k|	popbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  16.6k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2320|       |
 2321|  16.6k|	return i;
 2322|  4.02M|}
document.c:parse_codefence:
 1823|  4.02M|{
 1824|  4.02M|	size_t i, w, lang_start, attr_start = 0;
 1825|       |
 1826|  4.02M|	i = w = is_codefence(data, size, width, chr);
 1827|  4.02M|	if (i == 0)
  ------------------
  |  Branch (1827:6): [True: 4.00M, False: 16.6k]
  ------------------
 1828|  4.00M|		return 0;
 1829|       |
 1830|  72.0k|	while (i < size && _isspace(data[i]))
  ------------------
  |  Branch (1830:9): [True: 64.2k, False: 7.78k]
  |  Branch (1830:21): [True: 55.3k, False: 8.91k]
  ------------------
 1831|  55.3k|		i++;
 1832|       |
 1833|  16.6k|	lang_start = i;
 1834|       |
 1835|  16.6k|	if (flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE) {
  ------------------
  |  Branch (1835:6): [True: 16.6k, False: 0]
  ------------------
 1836|  16.6k|		attr_start = i + parse_attributes(data + i, size - i, attr, NULL, "", 0, doc->attr_activation);
 1837|  1.04M|		while (i < attr_start) {
  ------------------
  |  Branch (1837:10): [True: 1.03M, False: 14.4k]
  ------------------
 1838|  1.03M|			if (_isspace(data[i])) {
  ------------------
  |  Branch (1838:8): [True: 2.23k, False: 1.03M]
  ------------------
 1839|  2.23k|				break;
 1840|  2.23k|			}
 1841|  1.03M|			i++;
 1842|  1.03M|		}
 1843|  16.6k|	} else {
 1844|      0|		while (i < size && !_isspace(data[i]))
  ------------------
  |  Branch (1844:10): [True: 0, False: 0]
  |  Branch (1844:22): [True: 0, False: 0]
  ------------------
 1845|      0|			i++;
 1846|      0|	}
 1847|       |
 1848|  16.6k|	lang->data = data + lang_start;
 1849|  16.6k|	lang->size = i - lang_start;
 1850|       |
 1851|  16.6k|	return w;
 1852|  4.02M|}
document.c:is_codefence:
 1782|  7.24M|{
 1783|  7.24M|	size_t i = 0, n = 1, j;
 1784|  7.24M|	uint8_t c;
 1785|       |
 1786|       |	/* skipping initial spaces */
 1787|  7.24M|	if (size < 3)
  ------------------
  |  Branch (1787:6): [True: 4.15M, False: 3.09M]
  ------------------
 1788|  4.15M|		return 0;
 1789|       |
 1790|  3.09M|	if (data[0] == ' ') { i++;
  ------------------
  |  Branch (1790:6): [True: 301k, False: 2.78M]
  ------------------
 1791|   301k|	if (data[1] == ' ') { i++;
  ------------------
  |  Branch (1791:6): [True: 197k, False: 103k]
  ------------------
 1792|   197k|	if (data[2] == ' ') { i++; } } }
  ------------------
  |  Branch (1792:6): [True: 130k, False: 67.2k]
  ------------------
 1793|       |
 1794|       |	/* looking at the hrule uint8_t */
 1795|  3.09M|	if (i + 2 >= size)
  ------------------
  |  Branch (1795:6): [True: 83.8k, False: 3.00M]
  ------------------
 1796|  83.8k|		return 0;
 1797|  3.00M|	c = data[i];
 1798|  3.00M|	if (!(c=='~' || c=='`'))
  ------------------
  |  Branch (1798:8): [True: 37.0k, False: 2.96M]
  |  Branch (1798:18): [True: 71.8k, False: 2.89M]
  ------------------
 1799|  2.89M|		return 0;
 1800|       |
 1801|       |	/* the fence must be that same character */
 1802|   439k|	while (++i < size && data[i] == c)
  ------------------
  |  Branch (1802:9): [True: 415k, False: 24.3k]
  |  Branch (1802:23): [True: 331k, False: 84.6k]
  ------------------
 1803|   331k|		++n;
 1804|       |
 1805|   108k|	if (n < 3)
  ------------------
  |  Branch (1805:6): [True: 50.1k, False: 58.8k]
  ------------------
 1806|  50.1k|		return 0;
 1807|       |
 1808|  13.4M|	for (j = i; j < size && data[j] != '\n'; ++j) {
  ------------------
  |  Branch (1808:14): [True: 13.4M, False: 39.1k]
  |  Branch (1808:26): [True: 13.4M, False: 12.4k]
  ------------------
 1809|  13.4M|		if (data[j] == c) {
  ------------------
  |  Branch (1809:7): [True: 7.25k, False: 13.3M]
  ------------------
 1810|       |			/* Avoid parsing codespan as fence. */
 1811|  7.25k|			return 0;
 1812|  7.25k|		}
 1813|  13.4M|	}
 1814|       |
 1815|  51.5k|	if (width) *width = n;
  ------------------
  |  Branch (1815:6): [True: 40.6k, False: 10.9k]
  ------------------
 1816|  51.5k|	if (chr) *chr = c;
  ------------------
  |  Branch (1816:6): [True: 36.3k, False: 15.2k]
  ------------------
 1817|  51.5k|	return i;
 1818|  58.8k|}
document.c:parse_table:
 3332|  4.00M|{
 3333|  4.00M|	size_t i;
 3334|       |
 3335|  4.00M|	hoedown_buffer *work = 0;
 3336|  4.00M|	hoedown_buffer *header_work = 0;
 3337|  4.00M|	hoedown_buffer *body_work = 0;
 3338|  4.00M|	hoedown_buffer *attr_work = 0;
 3339|       |
 3340|  4.00M|	size_t columns;
 3341|  4.00M|	hoedown_table_flags *col_data = NULL;
 3342|       |
 3343|  4.00M|	work = newbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  4.00M|#define BUFFER_BLOCK 0
  ------------------
 3344|  4.00M|	header_work = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  4.00M|#define BUFFER_SPAN 1
  ------------------
 3345|  4.00M|	body_work = newbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  4.00M|#define BUFFER_BLOCK 0
  ------------------
 3346|  4.00M|	attr_work = newbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  4.00M|#define BUFFER_ATTRIBUTE 2
  ------------------
 3347|  4.00M|	i = parse_table_header(header_work, attr_work, doc, data, size, &columns, &col_data);
 3348|  4.00M|	if (i > 0) {
  ------------------
  |  Branch (3348:6): [True: 33.0k, False: 3.97M]
  ------------------
 3349|       |
 3350|   513k|		while (i < size) {
  ------------------
  |  Branch (3350:10): [True: 499k, False: 14.4k]
  ------------------
 3351|   499k|			size_t row_start;
 3352|   499k|			size_t pipes = 0;
 3353|   499k|			size_t rows = 1;
 3354|       |
 3355|   499k|			row_start = i;
 3356|       |
 3357|   173M|			while (i < size && data[i] != '\n') {
  ------------------
  |  Branch (3357:11): [True: 173M, False: 422]
  |  Branch (3357:23): [True: 173M, False: 498k]
  ------------------
 3358|   173M|				if (data[i] == '|' && !is_backslashed(data, i)) pipes++;
  ------------------
  |  Branch (3358:9): [True: 2.08M, False: 171M]
  |  Branch (3358:27): [True: 2.07M, False: 8.31k]
  ------------------
 3359|   173M|				i++;
 3360|   173M|			}
 3361|       |
 3362|   499k|			if (pipes == 0 || i == size) {
  ------------------
  |  Branch (3362:8): [True: 18.3k, False: 480k]
  |  Branch (3362:22): [True: 194, False: 480k]
  ------------------
 3363|  18.5k|				i = row_start;
 3364|  18.5k|				break;
 3365|  18.5k|			}
 3366|       |
 3367|       |			/* Don't count a leading pipe. */
 3368|   480k|			if (data[row_start] == '|')
  ------------------
  |  Branch (3368:8): [True: 200k, False: 279k]
  ------------------
 3369|   200k|				pipes--;
 3370|       |
 3371|       |			/* Don't count a trailing pipe. */
 3372|   480k|			if (data[i - 1] == '|' && !is_backslashed(data, i - 1))
  ------------------
  |  Branch (3372:8): [True: 441k, False: 38.7k]
  |  Branch (3372:30): [True: 435k, False: 6.89k]
  ------------------
 3373|   435k|				pipes--;
 3374|       |
 3375|       |			/* If the multiline table extension is enabled, check the next
 3376|       |			   lines for continuation markers, to find the number of text rows
 3377|       |			   that make up this logical row.
 3378|       |			*/
 3379|   480k|			if ((doc->ext_flags & HOEDOWN_EXT_MULTILINE_TABLES) != 0) {
  ------------------
  |  Branch (3379:8): [True: 480k, False: 0]
  ------------------
 3380|   494k|				while (i < size) {
  ------------------
  |  Branch (3380:12): [True: 494k, False: 194]
  ------------------
 3381|   494k|					size_t j = i + 1;
 3382|   494k|					size_t colons = 0;
 3383|       |
 3384|       |					/* Require that a continued row starts with a colon. */
 3385|   494k|					if (j >= size || data[j] != ':') break;
  ------------------
  |  Branch (3385:10): [True: 10.7k, False: 483k]
  |  Branch (3385:23): [True: 207k, False: 275k]
  ------------------
 3386|       |
 3387|       |					/* Don't count leading colon for comparison to pipes. */
 3388|   275k|					j++;
 3389|       |
 3390|   173M|					while (j < size && data[j] != '\n') {
  ------------------
  |  Branch (3390:13): [True: 173M, False: 389]
  |  Branch (3390:25): [True: 173M, False: 275k]
  ------------------
 3391|   173M|						if (!is_backslashed(data, j) && data[j] == ':')
  ------------------
  |  Branch (3391:11): [True: 173M, False: 117k]
  |  Branch (3391:39): [True: 3.87M, False: 169M]
  ------------------
 3392|  3.87M|							colons++;
 3393|   173M|						j++;
 3394|   173M|					}
 3395|       |
 3396|       |					/* Don't count a trailing colon for comparison to pipes. */
 3397|   275k|					if (!is_backslashed(data, j - 1) && data[j - 1] == ':')
  ------------------
  |  Branch (3397:10): [True: 274k, False: 768]
  |  Branch (3397:42): [True: 3.68k, False: 271k]
  ------------------
 3398|  3.68k|						colons--;
 3399|       |
 3400|       |					/* Hoedown allows table rows where the number of cells is different
 3401|       |					 * from `columns`. In this case, `parse_table_row` will add empty
 3402|       |					 * cells. However, the code does not work in the multi-line case, so
 3403|       |					 * we require the right number of columns. */
 3404|   275k|					if (colons != pipes || colons + 1 != columns) break;
  ------------------
  |  Branch (3404:10): [True: 260k, False: 14.5k]
  |  Branch (3404:29): [True: 950, False: 13.5k]
  ------------------
 3405|       |
 3406|  13.5k|					rows++;
 3407|  13.5k|					i = j;
 3408|  13.5k|				}
 3409|   480k|			}
 3410|       |
 3411|   480k|			parse_table_row(
 3412|   480k|				body_work,
 3413|   480k|				doc,
 3414|   480k|				data + row_start,
 3415|   480k|				i - row_start,
 3416|   480k|				columns,
 3417|   480k|				rows,
 3418|   480k|				col_data, 0
 3419|   480k|			);
 3420|       |
 3421|   480k|			i++;
 3422|       |
 3423|       |			/* Skip an optional row separator, if it's there. */
 3424|   480k|			if ((doc->ext_flags & HOEDOWN_EXT_MULTILINE_TABLES) != 0) {
  ------------------
  |  Branch (3424:8): [True: 480k, False: 0]
  ------------------
 3425|       |				/* Use j instead of i, and set i to j only if this is actually a row separator. */
 3426|   480k|				size_t j = i, next_line_end = i, col;
 3427|       |
 3428|       |				/* Seek next_line_end to the position of the terminating new line. */
 3429|   173M|				while (next_line_end < size && data[next_line_end] != '\n')
  ------------------
  |  Branch (3429:12): [True: 173M, False: 11.1k]
  |  Branch (3429:36): [True: 172M, False: 469k]
  ------------------
 3430|   172M|					next_line_end++;
 3431|       |
 3432|       |				/* Skip leading pipe, if any. */
 3433|   480k|				if (j < next_line_end && data[j] == '|')
  ------------------
  |  Branch (3433:9): [True: 467k, False: 13.5k]
  |  Branch (3433:30): [True: 19.6k, False: 447k]
  ------------------
 3434|  19.6k|					j++;
 3435|       |
 3436|       |				/* Ensure that there are at least columns pipe/plus separated
 3437|       |				   runs of dashes, each at least 3 long. The pipes may be
 3438|       |				   padded with spaces, and the line may end in a pipe.
 3439|       |				*/
 3440|   651k|				for (col = 0; col < columns && j < next_line_end; col++) {
  ------------------
  |  Branch (3440:19): [True: 480k, False: 171k]
  |  Branch (3440:36): [True: 465k, False: 15.3k]
  ------------------
 3441|   465k|					size_t dashes = 0;
 3442|       |
 3443|  1.09M|					while (j < next_line_end && data[j] == ' ')
  ------------------
  |  Branch (3443:13): [True: 1.09M, False: 1.25k]
  |  Branch (3443:34): [True: 632k, False: 464k]
  ------------------
 3444|   632k|						j++;
 3445|       |
 3446|   988k|					while (j < next_line_end && data[j] == '-') {
  ------------------
  |  Branch (3446:13): [True: 815k, False: 172k]
  |  Branch (3446:34): [True: 523k, False: 292k]
  ------------------
 3447|   523k|						j++;
 3448|   523k|						dashes++;
 3449|   523k|					}
 3450|       |
 3451|   540k|					while (j < next_line_end && data[j] == ' ')
  ------------------
  |  Branch (3451:13): [True: 366k, False: 174k]
  |  Branch (3451:34): [True: 75.2k, False: 291k]
  ------------------
 3452|  75.2k|						j++;
 3453|       |
 3454|   465k|					if (j < next_line_end && data[j] != '|' && data[j] != '+')
  ------------------
  |  Branch (3454:10): [True: 291k, False: 174k]
  |  Branch (3454:31): [True: 288k, False: 2.73k]
  |  Branch (3454:49): [True: 286k, False: 1.50k]
  ------------------
 3455|   286k|						break;
 3456|       |
 3457|   178k|					if (dashes < 3)
  ------------------
  |  Branch (3457:10): [True: 7.47k, False: 171k]
  ------------------
 3458|  7.47k|						break;
 3459|       |
 3460|   171k|					j++;
 3461|   171k|				}
 3462|       |
 3463|       |				/* Skip i past the row separator, if it was valid. */
 3464|   480k|				if (col == columns)
  ------------------
  |  Branch (3464:9): [True: 171k, False: 309k]
  ------------------
 3465|   171k|					i = next_line_end + 1;
 3466|   480k|			}
 3467|   480k|		}
 3468|       |
 3469|  33.0k|		if (doc->md.table_header)
  ------------------
  |  Branch (3469:7): [True: 11.1k, False: 21.8k]
  ------------------
 3470|  11.1k|			doc->md.table_header(work, header_work, &doc->data);
 3471|       |
 3472|  33.0k|		if (doc->md.table_body)
  ------------------
  |  Branch (3472:7): [True: 11.1k, False: 21.8k]
  ------------------
 3473|  11.1k|			doc->md.table_body(work, body_work, &doc->data);
 3474|       |
 3475|  33.0k|		if (doc->md.table)
  ------------------
  |  Branch (3475:7): [True: 11.1k, False: 21.8k]
  ------------------
 3476|  11.1k|			doc->md.table(ob, work, attr_work, &doc->data);
 3477|  33.0k|	}
 3478|       |
 3479|  4.00M|	free(col_data);
 3480|  4.00M|	popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  4.00M|#define BUFFER_SPAN 1
  ------------------
 3481|  4.00M|	popbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  4.00M|#define BUFFER_BLOCK 0
  ------------------
 3482|  4.00M|	popbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  4.00M|#define BUFFER_BLOCK 0
  ------------------
 3483|  4.00M|	popbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  4.00M|#define BUFFER_ATTRIBUTE 2
  ------------------
 3484|  4.00M|	return i;
 3485|  4.00M|}
document.c:parse_table_header:
 3158|  4.00M|{
 3159|  4.00M|	int pipes, rows;
 3160|  4.00M|	size_t i = 0, col, header_end, under_end;
 3161|  4.00M|	hoedown_buffer *header_contents = 0;
 3162|  4.00M|	size_t min_dashes = 3;
 3163|       |
 3164|  4.00M|	if (HOEDOWN_EXT_GFM & doc->ext_flags) {
  ------------------
  |  Branch (3164:6): [True: 0, False: 4.00M]
  ------------------
 3165|       |		// GFM allows 1 dashes
 3166|      0|		min_dashes = 1;
 3167|      0|	}
 3168|       |
 3169|  4.00M|	pipes = 0;
 3170|   390M|	while (i < size && data[i] != '\n') {
  ------------------
  |  Branch (3170:9): [True: 390M, False: 26.7k]
  |  Branch (3170:21): [True: 386M, False: 3.97M]
  ------------------
 3171|   386M|		if (!is_backslashed(data, i) && data[i] == '|') {
  ------------------
  |  Branch (3171:7): [True: 386M, False: 252k]
  |  Branch (3171:35): [True: 2.77M, False: 383M]
  ------------------
 3172|  2.77M|			pipes++;
 3173|  2.77M|		}
 3174|   386M|		i++;
 3175|   386M|	}
 3176|       |
 3177|  4.00M|	if (i == size || pipes == 0)
  ------------------
  |  Branch (3177:6): [True: 26.7k, False: 3.97M]
  |  Branch (3177:19): [True: 3.75M, False: 220k]
  ------------------
 3178|  3.78M|		return 0;
 3179|       |
 3180|   220k|	header_end = i;
 3181|       |
 3182|  1.20M|	while (header_end > 0 && _isspace(data[header_end - 1]))
  ------------------
  |  Branch (3182:9): [True: 1.20M, False: 0]
  |  Branch (3182:27): [True: 984k, False: 220k]
  ------------------
 3183|   984k|		header_end--;
 3184|       |
 3185|   220k|	if (data[0] == '|')
  ------------------
  |  Branch (3185:6): [True: 70.5k, False: 149k]
  ------------------
 3186|  70.5k|		pipes--;
 3187|       |
 3188|   220k|	if (header_end && data[header_end - 1] == '|' && !is_backslashed(data, header_end - 1))
  ------------------
  |  Branch (3188:6): [True: 220k, False: 0]
  |  Branch (3188:20): [True: 87.0k, False: 133k]
  |  Branch (3188:51): [True: 85.2k, False: 1.79k]
  ------------------
 3189|  85.2k|		pipes--;
 3190|       |
 3191|   220k|	if (doc->ext_flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE) {
  ------------------
  |  Branch (3191:6): [True: 220k, False: 0]
  ------------------
 3192|   220k|		size_t n = parse_attributes(data, header_end, attr, NULL, "", 1, doc->attr_activation);
 3193|       |		/* n == header_end when no attribute is found */
 3194|   220k|		if (n != header_end) {
  ------------------
  |  Branch (3194:7): [True: 14.1k, False: 205k]
  ------------------
 3195|  14.1k|			while (n > 0 && _isspace(data[n - 1]))
  ------------------
  |  Branch (3195:11): [True: 2.53k, False: 11.6k]
  |  Branch (3195:20): [True: 0, False: 2.53k]
  ------------------
 3196|      0|				n--;
 3197|  14.1k|			if (attr->size && n && data[n - 1] == '|' && !is_backslashed(data, n - 1))
  ------------------
  |  Branch (3197:8): [True: 13.5k, False: 674]
  |  Branch (3197:22): [True: 1.86k, False: 11.6k]
  |  Branch (3197:27): [True: 677, False: 1.18k]
  |  Branch (3197:49): [True: 481, False: 196]
  ------------------
 3198|    481|				pipes--;
 3199|       |
 3200|  14.1k|			header_end = n + 1;
 3201|  14.1k|		}
 3202|   220k|	}
 3203|       |
 3204|   220k|	if (pipes < 0)
  ------------------
  |  Branch (3204:6): [True: 30.5k, False: 189k]
  ------------------
 3205|  30.5k|		return 0;
 3206|       |
 3207|       |	/* header_contents will have the lines of the header copied into it, and then
 3208|       |	   is passed to parse_table_row. We need a separate buffer to avoid passing
 3209|       |	   the attribute to parse_table_row.
 3210|       |	*/
 3211|   189k|	header_contents = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   189k|#define BUFFER_SPAN 1
  ------------------
 3212|   189k|	hoedown_buffer_put(header_contents, data, header_end);
 3213|       |
 3214|   189k|	*columns = pipes + 1;
 3215|   189k|	*column_data = hoedown_calloc(*columns, sizeof(hoedown_table_flags));
 3216|       |
 3217|       |	/* If the multiline table extension is enabled, check the next lines for
 3218|       |	   continuation markers, to find the number of text rows that make up this
 3219|       |	   logical row, and copy the contents of each row to header_contents,
 3220|       |	   separated by new lines.
 3221|       |	*/
 3222|   189k|	rows = 1;
 3223|   189k|	if ((doc->ext_flags & HOEDOWN_EXT_MULTILINE_TABLES) != 0) {
  ------------------
  |  Branch (3223:6): [True: 189k, False: 0]
  ------------------
 3224|   194k|		while (i < size) {
  ------------------
  |  Branch (3224:10): [True: 194k, False: 194]
  ------------------
 3225|   194k|			size_t j = i + 1;
 3226|   194k|			int colons = 0;
 3227|       |
 3228|       |			/* Require that the continuation line starts with a colon */
 3229|   194k|			if (j >= size || data[j] != ':') break;
  ------------------
  |  Branch (3229:8): [True: 9.02k, False: 185k]
  |  Branch (3229:21): [True: 154k, False: 30.3k]
  ------------------
 3230|       |			/* Skip the leading colon to match the pipe counting behavior above */
 3231|  30.3k|			j++;
 3232|       |
 3233|       |			/* Require that the continuation line start with ": ", to
 3234|       |			   distinguish from ":-" which could start a left-aligned header
 3235|       |			   bar.
 3236|       |			*/
 3237|  30.3k|			if (j >= size || data[j] != ' ') break;
  ------------------
  |  Branch (3237:8): [True: 194, False: 30.1k]
  |  Branch (3237:21): [True: 22.4k, False: 7.74k]
  ------------------
 3238|       |
 3239|  13.6M|			while (j < size && data[j] != '\n') {
  ------------------
  |  Branch (3239:11): [True: 13.6M, False: 210]
  |  Branch (3239:23): [True: 13.6M, False: 7.53k]
  ------------------
 3240|  13.6M|				j++;
 3241|  13.6M|				if (j < size && !is_backslashed(data, j) && data[j] == ':')
  ------------------
  |  Branch (3241:9): [True: 13.6M, False: 210]
  |  Branch (3241:21): [True: 13.6M, False: 3.75k]
  |  Branch (3241:49): [True: 4.68M, False: 8.98M]
  ------------------
 3242|  4.68M|					colons++;
 3243|  13.6M|			}
 3244|       |
 3245|       |			/* Allow a trailing colon to match the pipe counting behavior above */
 3246|  7.74k|			if (!is_backslashed(data, j - 1) && data[j - 1] == ':')
  ------------------
  |  Branch (3246:8): [True: 6.88k, False: 865]
  |  Branch (3246:40): [True: 750, False: 6.13k]
  ------------------
 3247|    750|				colons--;
 3248|       |
 3249|  7.74k|			if (colons != pipes) break;
  ------------------
  |  Branch (3249:8): [True: 2.86k, False: 4.87k]
  ------------------
 3250|       |
 3251|  4.87k|			hoedown_buffer_putc(header_contents, '\n');
 3252|       |			/* data[i] is the previous new line, and data[j] is the next new
 3253|       |			   line. This copies all the text between the new lines.
 3254|       |			 */
 3255|  4.87k|			hoedown_buffer_put(header_contents, data + i + 1, j - i - 1);
 3256|       |
 3257|  4.87k|			rows++;
 3258|  4.87k|			i = j;
 3259|  4.87k|			header_end = j;
 3260|  4.87k|		}
 3261|   189k|	}
 3262|       |
 3263|       |	/* Parse the header underline */
 3264|   189k|	i++;
 3265|   189k|	if (i < size && data[i] == '|')
  ------------------
  |  Branch (3265:6): [True: 180k, False: 9.21k]
  |  Branch (3265:18): [True: 19.4k, False: 160k]
  ------------------
 3266|  19.4k|		i++;
 3267|       |
 3268|   189k|	under_end = i;
 3269|  68.8M|	while (under_end < size && data[under_end] != '\n')
  ------------------
  |  Branch (3269:9): [True: 68.8M, False: 9.61k]
  |  Branch (3269:29): [True: 68.6M, False: 179k]
  ------------------
 3270|  68.6M|		under_end++;
 3271|       |
 3272|   248k|	for (col = 0; col < *columns && i < under_end; ++col) {
  ------------------
  |  Branch (3272:16): [True: 215k, False: 33.0k]
  |  Branch (3272:34): [True: 193k, False: 22.1k]
  ------------------
 3273|   193k|		size_t colons = 0;
 3274|   193k|		size_t dashes = 0;
 3275|       |
 3276|   664k|		while (i < under_end && data[i] == ' ')
  ------------------
  |  Branch (3276:10): [True: 659k, False: 5.00k]
  |  Branch (3276:27): [True: 471k, False: 188k]
  ------------------
 3277|   471k|			i++;
 3278|       |
 3279|   193k|		if (i < under_end && data[i] == ':') {
  ------------------
  |  Branch (3279:7): [True: 188k, False: 5.00k]
  |  Branch (3279:24): [True: 47.1k, False: 141k]
  ------------------
 3280|  47.1k|			i++; (*column_data)[col] |= HOEDOWN_TABLE_ALIGN_LEFT;
 3281|  47.1k|			colons++;
 3282|  47.1k|		}
 3283|       |
 3284|   416k|		while (i < under_end && data[i] == '-') {
  ------------------
  |  Branch (3284:10): [True: 373k, False: 42.5k]
  |  Branch (3284:27): [True: 222k, False: 151k]
  ------------------
 3285|   222k|			i++; dashes++;
 3286|   222k|		}
 3287|       |
 3288|   193k|		if (i < under_end && data[i] == ':') {
  ------------------
  |  Branch (3288:7): [True: 151k, False: 42.5k]
  |  Branch (3288:24): [True: 46.0k, False: 105k]
  ------------------
 3289|  46.0k|			i++; (*column_data)[col] |= HOEDOWN_TABLE_ALIGN_RIGHT;
 3290|  46.0k|			colons++;
 3291|  46.0k|		}
 3292|       |
 3293|   770k|		while (i < under_end && data[i] == ' ')
  ------------------
  |  Branch (3293:10): [True: 705k, False: 64.7k]
  |  Branch (3293:27): [True: 576k, False: 129k]
  ------------------
 3294|   576k|			i++;
 3295|       |
 3296|   193k|		if (i < under_end && data[i] != '|' && data[i] != '+')
  ------------------
  |  Branch (3296:7): [True: 129k, False: 64.7k]
  |  Branch (3296:24): [True: 101k, False: 27.7k]
  |  Branch (3296:42): [True: 100k, False: 648]
  ------------------
 3297|   100k|			break;
 3298|       |
 3299|  93.0k|		if (dashes < 1 || colons + dashes < min_dashes)
  ------------------
  |  Branch (3299:7): [True: 13.9k, False: 79.1k]
  |  Branch (3299:21): [True: 19.8k, False: 59.3k]
  ------------------
 3300|  33.7k|			break;
 3301|       |
 3302|  59.3k|		i++;
 3303|  59.3k|	}
 3304|       |
 3305|   189k|	if (col < *columns) {
  ------------------
  |  Branch (3305:6): [True: 156k, False: 33.0k]
  ------------------
 3306|       |		/* clean up header_contents */
 3307|   156k|		popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   156k|#define BUFFER_SPAN 1
  ------------------
 3308|   156k|		return 0;
 3309|   156k|	}
 3310|       |
 3311|  33.0k|	parse_table_row(
 3312|  33.0k|		ob, doc, header_contents->data,
 3313|  33.0k|		header_contents->size,
 3314|  33.0k|		*columns,
 3315|  33.0k|		rows,
 3316|  33.0k|		*column_data,
 3317|  33.0k|		HOEDOWN_TABLE_HEADER
 3318|  33.0k|	);
 3319|       |
 3320|       |	/* clean up header_contents */
 3321|  33.0k|	popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  33.0k|#define BUFFER_SPAN 1
  ------------------
 3322|       |
 3323|  33.0k|	return under_end + 1;
 3324|   189k|}
document.c:is_backslashed:
  747|   584M|{
  748|   584M|	return loc >= 1 && data[loc - 1] == '\\';
  ------------------
  |  Branch (748:9): [True: 580M, False: 4.04M]
  |  Branch (748:21): [True: 395k, False: 580M]
  ------------------
  749|   584M|}
document.c:parse_table_row:
 3068|   513k|{
 3069|   513k|	size_t i = 0, col;
 3070|   513k|	hoedown_buffer *row_work = 0;
 3071|       |
 3072|   513k|	if (!doc->md.table_cell || !doc->md.table_row)
  ------------------
  |  Branch (3072:6): [True: 487k, False: 25.8k]
  |  Branch (3072:29): [True: 0, False: 25.8k]
  ------------------
 3073|   487k|		return;
 3074|       |
 3075|  25.8k|	row_work = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  25.8k|#define BUFFER_SPAN 1
  ------------------
 3076|       |
 3077|       |	/* skip optional first pipe */
 3078|  25.8k|	if (i < size && data[i] == '|')
  ------------------
  |  Branch (3078:6): [True: 25.8k, False: 0]
  |  Branch (3078:18): [True: 9.90k, False: 15.9k]
  ------------------
 3079|  9.90k|		i++;
 3080|       |
 3081|  63.4k|	for (col = 0; col < columns && i < size; ++col) {
  ------------------
  |  Branch (3081:16): [True: 39.7k, False: 23.6k]
  |  Branch (3081:33): [True: 37.5k, False: 2.17k]
  ------------------
 3082|  37.5k|		size_t pos, extra_rows_in_cell;
 3083|  37.5k|		hoedown_buffer *cell_content;
 3084|  37.5k|		hoedown_buffer *cell_work;
 3085|       |
 3086|       |		/* cell_content is the text that is inline parsed into cell_work. It
 3087|       |		   consists of the values of this cell from each row, concatenated and
 3088|       |		   separated by new lines.
 3089|       |		*/
 3090|  37.5k|		cell_content = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  37.5k|#define BUFFER_SPAN 1
  ------------------
 3091|  37.5k|		cell_work = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  37.5k|#define BUFFER_SPAN 1
  ------------------
 3092|       |
 3093|  37.5k|		i += parse_table_cell_line(cell_content, data, size, i, '|', 0 /* is_contination */);
 3094|       |
 3095|       |		/* Add extra rows of the cell. This only occurs if rows is greater than 0,
 3096|       |		   which only happens when multiline tables are enabled.
 3097|       |
 3098|       |		   Each extra row is a colon, followed by cell contents for the continued
 3099|       |		   row, separated by colons.
 3100|       |		*/
 3101|  37.5k|		extra_rows_in_cell = rows - 1;
 3102|  37.5k|		pos = i;
 3103|  49.2k|		while (extra_rows_in_cell > 0 && pos < size) {
  ------------------
  |  Branch (3103:10): [True: 12.0k, False: 37.1k]
  |  Branch (3103:36): [True: 11.6k, False: 390]
  ------------------
 3104|  11.6k|			size_t c;
 3105|       |
 3106|       |			/* seek to the end of the current row */
 3107|  4.75M|			while (pos < size && data[pos] != '\n') {
  ------------------
  |  Branch (3107:11): [True: 4.75M, False: 1.32k]
  |  Branch (3107:25): [True: 4.74M, False: 10.2k]
  ------------------
 3108|  4.74M|				pos++;
 3109|  4.74M|			}
 3110|       |
 3111|       |			/* skip new line and leading colon */
 3112|  11.6k|			if (pos < size) pos++;
  ------------------
  |  Branch (3112:8): [True: 10.2k, False: 1.32k]
  ------------------
 3113|  11.6k|			if (pos < size) pos++;
  ------------------
  |  Branch (3113:8): [True: 10.2k, False: 1.32k]
  ------------------
 3114|       |
 3115|       |			/* Seek to the beginning of the correct column on the continuation line.
 3116|       |			 * The continuation line should have the expected number of columns, and
 3117|       |			 * so we never expect pos >= size or data[pos] == '\n'. These checks serve
 3118|       |			 * as defense in depth against wrong preconditions. */
 3119|  19.4k|			for (c = 0; c < col; c++) {
  ------------------
  |  Branch (3119:16): [True: 7.84k, False: 11.6k]
  ------------------
 3120|  8.47M|				while (pos < size && data[pos] != '\n' && (is_backslashed(data, pos) || data[pos] != ':'))
  ------------------
  |  Branch (3120:12): [True: 8.46M, False: 1.23k]
  |  Branch (3120:26): [True: 8.46M, False: 0]
  |  Branch (3120:48): [True: 670, False: 8.46M]
  |  Branch (3120:77): [True: 8.46M, False: 6.60k]
  ------------------
 3121|  8.46M|					pos++;
 3122|  7.84k|				if (pos < size && data[pos] == ':') pos++;  /* skip colon */
  ------------------
  |  Branch (3122:9): [True: 6.60k, False: 1.23k]
  |  Branch (3122:23): [True: 6.60k, False: 0]
  ------------------
 3123|  7.84k|			}
 3124|       |
 3125|  11.6k|			parse_table_cell_line(cell_content, data, size, pos, ':', 1 /* is_contination */);
 3126|       |
 3127|  11.6k|			extra_rows_in_cell--;
 3128|  11.6k|		}
 3129|       |
 3130|  37.5k|		parse_inline(cell_work, doc, cell_content->data, cell_content->size);
 3131|       |
 3132|  37.5k|		doc->md.table_cell(row_work, cell_work, col_data[col] | header_flag, &doc->data);
 3133|       |
 3134|  37.5k|		popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  37.5k|#define BUFFER_SPAN 1
  ------------------
 3135|  37.5k|		popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  37.5k|#define BUFFER_SPAN 1
  ------------------
 3136|  37.5k|		i++;
 3137|  37.5k|	}
 3138|       |
 3139|  29.1k|	for (; col < columns; ++col) {
  ------------------
  |  Branch (3139:9): [True: 3.23k, False: 25.8k]
  ------------------
 3140|  3.23k|		hoedown_buffer empty_cell = { 0, 0, 0, 0, NULL, NULL, NULL };
 3141|  3.23k|		doc->md.table_cell(row_work, &empty_cell, col_data[col] | header_flag, &doc->data);
 3142|  3.23k|	}
 3143|       |
 3144|  25.8k|	doc->md.table_row(ob, row_work, &doc->data);
 3145|       |
 3146|  25.8k|	popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  25.8k|#define BUFFER_SPAN 1
  ------------------
 3147|  25.8k|}
document.c:parse_table_cell_line:
 3010|  49.2k|		int is_continuation) {
 3011|  49.2k|	size_t pos, line_end, cell_start, cell_end, len, copy_start, copy_end;
 3012|       |
 3013|  49.2k|	pos = offset;
 3014|       |
 3015|   106k|	while (pos < size && _isspace(data[pos])) pos++;
  ------------------
  |  Branch (3015:9): [True: 101k, False: 5.48k]
  |  Branch (3015:23): [True: 57.3k, False: 43.7k]
  ------------------
 3016|       |
 3017|  49.2k|	cell_start = pos;
 3018|       |
 3019|  49.2k|	line_end = pos;
 3020|  26.1M|	while (line_end < size && data[line_end] != '\n') line_end++;
  ------------------
  |  Branch (3020:9): [True: 26.1M, False: 38.9k]
  |  Branch (3020:28): [True: 26.1M, False: 10.2k]
  ------------------
 3021|  49.2k|	len = find_separator_char(data + pos, line_end - pos, separator);
 3022|       |
 3023|       |	/* Two possibilities for len == 0:
 3024|       |	   1) No more separator char found in the current line.
 3025|       |	   2) The next separator is right after the current one, i.e. empty cell.
 3026|       |	   For case 1, we skip to the end of line; for case 2 we just continue.
 3027|       |	*/
 3028|  49.2k|	if (len == 0 && pos < size && data[pos] != separator) {
  ------------------
  |  Branch (3028:6): [True: 28.1k, False: 21.0k]
  |  Branch (3028:18): [True: 22.6k, False: 5.48k]
  |  Branch (3028:32): [True: 16.8k, False: 5.77k]
  ------------------
 3029|  5.23M|		while (pos + len < size && data[pos + len] != '\n') len++;
  ------------------
  |  Branch (3029:10): [True: 5.22M, False: 12.7k]
  |  Branch (3029:30): [True: 5.22M, False: 4.11k]
  ------------------
 3030|  16.8k|	}
 3031|  49.2k|	pos += len;
 3032|       |
 3033|  49.2k|	cell_end = pos - 1;
 3034|       |
 3035|   148k|	while (cell_end > cell_start && _isspace(data[cell_end]))
  ------------------
  |  Branch (3035:9): [True: 116k, False: 32.4k]
  |  Branch (3035:34): [True: 99.4k, False: 16.8k]
  ------------------
 3036|  99.4k|		cell_end--;
 3037|       |
 3038|       |	/* If this isn't the first line of the cell, add a new line before the
 3039|       |	   extra cell contents, to separate them (and make backslash linebreaks
 3040|       |	   work).
 3041|       |	*/
 3042|  49.2k|	if (is_continuation) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (3042:6): [True: 11.6k, False: 37.5k]
  ------------------
 3043|       |
 3044|       |	/* Remove escaping from pipes */
 3045|  49.2k|	copy_start = copy_end = cell_start;
 3046|  18.1M|	while (copy_end < cell_end + 1) {
  ------------------
  |  Branch (3046:9): [True: 18.0M, False: 49.2k]
  ------------------
 3047|  18.0M|		if (data[copy_end] == separator && copy_end > copy_start && data[copy_end - 1] == '\\') {
  ------------------
  |  Branch (3047:7): [True: 1.78k, False: 18.0M]
  |  Branch (3047:38): [True: 1.78k, False: 0]
  |  Branch (3047:63): [True: 1.78k, False: 0]
  ------------------
 3048|  1.78k|			hoedown_buffer_put(ob, data + copy_start, copy_end - copy_start - 1);
 3049|  1.78k|			copy_start = copy_end;
 3050|  1.78k|		}
 3051|  18.0M|		copy_end++;
 3052|  18.0M|	}
 3053|  49.2k|	hoedown_buffer_put(ob, data + copy_start, copy_end - copy_start);
 3054|       |
 3055|  49.2k|	return pos - offset;
 3056|  49.2k|}
document.c:find_separator_char:
  847|  49.2k|{
  848|  49.2k|	size_t i = 0;
  849|       |
  850|  50.9k|	while (i < size) {
  ------------------
  |  Branch (850:9): [True: 44.7k, False: 6.26k]
  ------------------
  851|  18.2M|		while (i < size && data[i] != c)
  ------------------
  |  Branch (851:10): [True: 18.2M, False: 16.1k]
  |  Branch (851:22): [True: 18.1M, False: 28.6k]
  ------------------
  852|  18.1M|			i++;
  853|       |
  854|  44.7k|		if (i == size)
  ------------------
  |  Branch (854:7): [True: 16.1k, False: 28.6k]
  ------------------
  855|  16.1k|			return 0;
  856|       |
  857|       |		/* not counting backslashed separators */
  858|  28.6k|		if (is_backslashed(data, i)) {
  ------------------
  |  Branch (858:7): [True: 1.78k, False: 26.8k]
  ------------------
  859|  1.78k|			i++; continue;
  860|  1.78k|		}
  861|       |
  862|  26.8k|		if (data[i] == c)
  ------------------
  |  Branch (862:7): [True: 26.8k, False: 0]
  ------------------
  863|  26.8k|			return i;
  864|  26.8k|	}
  865|       |
  866|  6.26k|	return 0;
  867|  49.2k|}
document.c:prefix_quote:
 1941|  4.91M|{
 1942|  4.91M|	size_t i = 0;
 1943|  4.91M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (1943:6): [True: 4.91M, False: 0]
  |  Branch (1943:18): [True: 334k, False: 4.57M]
  ------------------
 1944|  4.91M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (1944:6): [True: 4.91M, False: 1]
  |  Branch (1944:18): [True: 83.4k, False: 4.82M]
  ------------------
 1945|  4.91M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (1945:6): [True: 4.91M, False: 1]
  |  Branch (1945:18): [True: 70.8k, False: 4.84M]
  ------------------
 1946|       |
 1947|  4.91M|	if (i < size && data[i] == '>') {
  ------------------
  |  Branch (1947:6): [True: 4.91M, False: 1]
  |  Branch (1947:18): [True: 57.9k, False: 4.85M]
  ------------------
 1948|  57.9k|		if (i + 1 < size && data[i + 1] == ' ')
  ------------------
  |  Branch (1948:7): [True: 57.2k, False: 657]
  |  Branch (1948:23): [True: 5.58k, False: 51.6k]
  ------------------
 1949|  5.58k|			return i + 2;
 1950|       |
 1951|  52.3k|		return i + 1;
 1952|  57.9k|	}
 1953|       |
 1954|  4.85M|	return 0;
 1955|  4.91M|}
document.c:parse_blockquote:
 2107|  22.7k|{
 2108|  22.7k|	size_t beg, end = 0, pre, work_size = 0;
 2109|  22.7k|	uint8_t *work_data = 0;
 2110|  22.7k|	hoedown_buffer *out = 0;
 2111|       |
 2112|  22.7k|	doc->blockquote_depth++;
 2113|       |
 2114|  22.7k|	out = newbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  22.7k|#define BUFFER_BLOCK 0
  ------------------
 2115|  22.7k|	beg = 0;
 2116|   155k|	while (beg < size) {
  ------------------
  |  Branch (2116:9): [True: 147k, False: 7.92k]
  ------------------
 2117|  68.9M|		for (end = beg + 1; end < size && data[end - 1] != '\n'; end++);
  ------------------
  |  Branch (2117:23): [True: 68.9M, False: 7.96k]
  |  Branch (2117:37): [True: 68.7M, False: 139k]
  ------------------
 2118|       |
 2119|   147k|		pre = prefix_quote(data + beg, end - beg);
 2120|       |
 2121|   147k|		if (pre)
  ------------------
  |  Branch (2121:7): [True: 24.9k, False: 122k]
  ------------------
 2122|  24.9k|			beg += pre; /* skipping prefix */
 2123|       |
 2124|       |		/* empty line finished */
 2125|   122k|		else if ((doc->ext_flags & HOEDOWN_EXT_BLOCKQUOTE_EMPTY_LINE) &&
  ------------------
  |  Branch (2125:12): [True: 122k, False: 0]
  ------------------
 2126|   122k|				(is_empty(data + beg, end - beg)))
  ------------------
  |  Branch (2126:5): [True: 14.8k, False: 107k]
  ------------------
 2127|  14.8k|			break;
 2128|       |
 2129|       |		/* empty line followed by non-quote line */
 2130|   107k|		else if (is_empty(data + beg, end - beg) &&
  ------------------
  |  Branch (2130:12): [True: 0, False: 107k]
  ------------------
 2131|      0|				(end >= size || (prefix_quote(data + end, size - end) == 0 &&
  ------------------
  |  Branch (2131:6): [True: 0, False: 0]
  |  Branch (2131:22): [True: 0, False: 0]
  ------------------
 2132|      0|				!is_empty(data + end, size - end))))
  ------------------
  |  Branch (2132:5): [True: 0, False: 0]
  ------------------
 2133|      0|			break;
 2134|       |
 2135|   132k|		if (beg < end) { /* copy into the in-place working buffer */
  ------------------
  |  Branch (2135:7): [True: 132k, False: 328]
  ------------------
 2136|       |			/* hoedown_buffer_put(work, data + beg, end - beg); */
 2137|   132k|			if (!work_data)
  ------------------
  |  Branch (2137:8): [True: 22.4k, False: 109k]
  ------------------
 2138|  22.4k|				work_data = data + beg;
 2139|   109k|			else if (data + beg != work_data + work_size)
  ------------------
  |  Branch (2139:13): [True: 16.9k, False: 92.9k]
  ------------------
 2140|  16.9k|				memmove(work_data + work_size, data + beg, end - beg);
 2141|   132k|			work_size += end - beg;
 2142|   132k|		}
 2143|   132k|		beg = end;
 2144|   132k|	}
 2145|       |
 2146|  22.7k|	parse_block(out, doc, work_data, work_size);
 2147|  22.7k|	if (doc->md.blockquote)
  ------------------
  |  Branch (2147:6): [True: 22.7k, False: 0]
  ------------------
 2148|  22.7k|		doc->md.blockquote(ob, out, &doc->data);
 2149|  22.7k|	popbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  22.7k|#define BUFFER_BLOCK 0
  ------------------
 2150|       |
 2151|  22.7k|	doc->blockquote_depth--;
 2152|       |
 2153|  22.7k|	return end;
 2154|  22.7k|}
document.c:prefix_uli:
 1995|  4.60M|{
 1996|  4.60M|	size_t i = 0;
 1997|       |
 1998|  4.60M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (1998:6): [True: 4.60M, False: 0]
  |  Branch (1998:18): [True: 123k, False: 4.47M]
  ------------------
 1999|  4.60M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (1999:6): [True: 4.60M, False: 0]
  |  Branch (1999:18): [True: 61.0k, False: 4.54M]
  ------------------
 2000|  4.60M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (2000:6): [True: 4.60M, False: 0]
  |  Branch (2000:18): [True: 52.6k, False: 4.55M]
  ------------------
 2001|       |
 2002|  4.60M|	if (i + 1 >= size ||
  ------------------
  |  Branch (2002:6): [True: 9.64k, False: 4.59M]
  ------------------
 2003|  4.59M|		(data[i] != '*' && data[i] != '+' && data[i] != '-') ||
  ------------------
  |  Branch (2003:4): [True: 4.53M, False: 59.0k]
  |  Branch (2003:22): [True: 4.52M, False: 12.1k]
  |  Branch (2003:40): [True: 2.57M, False: 1.94M]
  ------------------
 2004|  2.01M|		data[i + 1] != ' ')
  ------------------
  |  Branch (2004:3): [True: 1.78M, False: 228k]
  ------------------
 2005|  4.37M|		return 0;
 2006|       |
 2007|   228k|	if (is_next_headerline(data + i, size - i))
  ------------------
  |  Branch (2007:6): [True: 21.8k, False: 206k]
  ------------------
 2008|  21.8k|		return 0;
 2009|       |
 2010|   206k|	return i + 2;
 2011|   228k|}
document.c:is_next_headerline:
 1926|   513k|{
 1927|   513k|	size_t i = 0;
 1928|       |
 1929|  45.2M|	while (i < size && data[i] != '\n')
  ------------------
  |  Branch (1929:9): [True: 45.2M, False: 10.7k]
  |  Branch (1929:21): [True: 44.7M, False: 502k]
  ------------------
 1930|  44.7M|		i++;
 1931|       |
 1932|   513k|	if (++i >= size)
  ------------------
  |  Branch (1932:6): [True: 174k, False: 338k]
  ------------------
 1933|   174k|		return 0;
 1934|       |
 1935|   338k|	return is_headerline(data + i, size - i);
 1936|   513k|}
document.c:is_headerline:
 1906|  1.28M|{
 1907|  1.28M|	size_t i = 0;
 1908|       |
 1909|       |	/* test of level 1 header */
 1910|  1.28M|	if (data[i] == '=') {
  ------------------
  |  Branch (1910:6): [True: 83.7k, False: 1.19M]
  ------------------
 1911|  88.6k|		for (i = 1; i < size && data[i] == '='; i++);
  ------------------
  |  Branch (1911:15): [True: 83.8k, False: 4.77k]
  |  Branch (1911:27): [True: 4.94k, False: 78.9k]
  ------------------
 1912|   228k|		while (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (1912:10): [True: 224k, False: 4.95k]
  |  Branch (1912:22): [True: 145k, False: 78.7k]
  ------------------
 1913|  83.7k|		return (i >= size || data[i] == '\n') ? 1 : 0; }
  ------------------
  |  Branch (1913:11): [True: 4.95k, False: 78.7k]
  |  Branch (1913:24): [True: 57.6k, False: 21.0k]
  ------------------
 1914|       |
 1915|       |	/* test of level 2 header */
 1916|  1.19M|	if (data[i] == '-') {
  ------------------
  |  Branch (1916:6): [True: 225k, False: 974k]
  ------------------
 1917|   264k|		for (i = 1; i < size && data[i] == '-'; i++);
  ------------------
  |  Branch (1917:15): [True: 263k, False: 1.05k]
  |  Branch (1917:27): [True: 39.2k, False: 223k]
  ------------------
 1918|   468k|		while (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (1918:10): [True: 467k, False: 1.20k]
  |  Branch (1918:22): [True: 243k, False: 223k]
  ------------------
 1919|   225k|		return (i >= size || data[i] == '\n') ? 2 : 0; }
  ------------------
  |  Branch (1919:11): [True: 1.20k, False: 223k]
  |  Branch (1919:24): [True: 138k, False: 85.7k]
  ------------------
 1920|       |
 1921|   974k|	return 0;
 1922|  1.19M|}
document.c:parse_list:
 2666|  53.6k|{
 2667|  53.6k|	hoedown_buffer *work = 0;
 2668|  53.6k|	hoedown_buffer *attr = 0;
 2669|  53.6k|	size_t i = 0, j;
 2670|       |
 2671|  53.6k|	doc->list_depth++;
 2672|       |
 2673|  53.6k|	work = newbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  53.6k|#define BUFFER_BLOCK 0
  ------------------
 2674|  53.6k|	attr = newbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  53.6k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2675|       |
 2676|   139k|	while (i < size) {
  ------------------
  |  Branch (2676:9): [True: 121k, False: 18.0k]
  ------------------
 2677|   121k|		if (flags & HOEDOWN_LIST_DEFINITION) {
  ------------------
  |  Branch (2677:7): [True: 48.8k, False: 72.7k]
  ------------------
 2678|  48.8k|			j = parse_definition(work, doc, data + i, size - i, &flags, attr);
 2679|  72.7k|		} else {
 2680|  72.7k|			j = parse_listitem(work, doc, data + i, size - i, &flags, attr);
 2681|  72.7k|		}
 2682|   121k|		i += j;
 2683|       |
 2684|   121k|		if (!j || (flags & HOEDOWN_LI_END))
  ------------------
  |  Branch (2684:7): [True: 14.6k, False: 106k]
  |  Branch (2684:13): [True: 20.9k, False: 85.9k]
  ------------------
 2685|  35.5k|			break;
 2686|   121k|	}
 2687|       |
 2688|  53.6k|	if (doc->md.list)
  ------------------
  |  Branch (2688:6): [True: 53.6k, False: 0]
  ------------------
 2689|  53.6k|		doc->md.list(ob, work, attr, flags, &doc->data);
 2690|  53.6k|	popbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  53.6k|#define BUFFER_BLOCK 0
  ------------------
 2691|  53.6k|	popbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  53.6k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2692|       |
 2693|  53.6k|	doc->list_depth--;
 2694|       |
 2695|  53.6k|	return i;
 2696|  53.6k|}
document.c:parse_definition:
 2603|  48.8k|{
 2604|       |	/* end represents the position of the first line where definitions start */
 2605|  48.8k|	size_t j = 0, k = 0, len = 0, end = prefix_dli(doc, data, size);
 2606|  48.8k|	if (end <= 0) {
  ------------------
  |  Branch (2606:6): [True: 13.6k, False: 35.1k]
  ------------------
 2607|  13.6k|		return 0;
 2608|  13.6k|	}
 2609|  35.1k|	hoedown_buffer *work = 0, *attr_work;
 2610|       |
 2611|       |
 2612|       |	/* scan all the definition terms, rendering them to the output buffer
 2613|       |	 * the +1 is to account for the trailing newline on each term
 2614|       |	 * j is a counter keeping track of the beginning of each new term */
 2615|  35.1k|	*flags |= HOEDOWN_LI_DT;
 2616|   135k|	while (j + 1 < end) {
  ------------------
  |  Branch (2616:9): [True: 100k, False: 35.1k]
  ------------------
 2617|       |		/* find the end of the term (where the newline is) */
 2618|  11.6M|		for(k = j + 1; k - 1 < end && data[k - 1] != '\n'; k++);
  ------------------
  |  Branch (2618:18): [True: 11.6M, False: 0]
  |  Branch (2618:33): [True: 11.5M, False: 100k]
  ------------------
 2619|       |
 2620|   100k|		len = k - j;
 2621|       |
 2622|   100k|		if (is_empty(data + j, len)) {
  ------------------
  |  Branch (2622:7): [True: 3.14k, False: 97.6k]
  ------------------
 2623|  3.14k|			j = k;
 2624|  3.14k|			continue;
 2625|  3.14k|		}
 2626|       |
 2627|  97.6k|		work = newbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  97.6k|#define BUFFER_BLOCK 0
  ------------------
 2628|  97.6k|		attr_work = newbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  97.6k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2629|       |
 2630|  97.6k|		if (doc->ext_flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE) {
  ------------------
  |  Branch (2630:7): [True: 97.6k, False: 0]
  ------------------
 2631|  97.6k|			len = parse_attributes(data + j, len, attr_work, NULL, "", 1, doc->attr_activation);
 2632|  97.6k|		}
 2633|       |
 2634|  97.6k|		parse_inline(work, doc, data + j, len);
 2635|       |
 2636|  97.6k|		if (doc->md.listitem) {
  ------------------
  |  Branch (2636:7): [True: 97.6k, False: 0]
  ------------------
 2637|  97.6k|			doc->md.listitem(ob, work, attr_work, flags, &doc->data);
 2638|  97.6k|		}
 2639|       |
 2640|  97.6k|		j = k;
 2641|       |
 2642|  97.6k|		popbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  97.6k|#define BUFFER_BLOCK 0
  ------------------
 2643|  97.6k|		popbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  97.6k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2644|  97.6k|	}
 2645|  35.1k|	*flags &= ~HOEDOWN_LI_DT;
 2646|       |
 2647|       |	/* scan all the definitions, rendering it to the output buffer */
 2648|  35.1k|	*flags |= HOEDOWN_LI_DD;
 2649|   138k|	while (end < size) {
  ------------------
  |  Branch (2649:9): [True: 132k, False: 5.36k]
  ------------------
 2650|   132k|		j = parse_listitem(ob, doc, data + end, size - end, flags, attribute);
 2651|   132k|		if (j <= 0) {
  ------------------
  |  Branch (2651:7): [True: 29.8k, False: 103k]
  ------------------
 2652|  29.8k|			break;
 2653|  29.8k|		}
 2654|   103k|		end += j;
 2655|   103k|	}
 2656|       |
 2657|  35.1k|	*flags &= ~HOEDOWN_LI_DD;
 2658|  35.1k|	*flags &= ~HOEDOWN_LI_END;
 2659|       |
 2660|  35.1k|	return end;
 2661|  48.8k|}
document.c:parse_listitem:
 2376|   205k|{
 2377|   205k|	hoedown_buffer *work = 0, *inter = 0;
 2378|   205k|	hoedown_buffer *attr = 0;
 2379|   205k|	size_t beg = 0, end, pre, sublist = 0, orgpre = 0, i, len, fence_pre = 0;
 2380|   205k|	int in_empty = 0, has_inside_empty = 0, in_fence = 0;
 2381|   205k|	uint8_t ul_item_char = '*';
 2382|   205k|	hoedown_buffer *ol_numeral = NULL;
 2383|       |
 2384|       |	/* keeping track of the first indentation prefix */
 2385|   210k|	while (orgpre < 3 && orgpre < size && data[orgpre] == ' ')
  ------------------
  |  Branch (2385:9): [True: 209k, False: 690]
  |  Branch (2385:23): [True: 209k, False: 0]
  |  Branch (2385:40): [True: 4.37k, False: 204k]
  ------------------
 2386|  4.37k|		orgpre++;
 2387|       |
 2388|   205k|	beg = prefix_uli(data, size);
 2389|   205k|	if (beg) ul_item_char = data[beg - 2];
  ------------------
  |  Branch (2389:6): [True: 83.7k, False: 121k]
  ------------------
 2390|   205k|	if (!beg) {
  ------------------
  |  Branch (2390:6): [True: 121k, False: 83.7k]
  ------------------
 2391|   121k|		beg = prefix_oli(data, size);
 2392|   121k|		if (beg) {
  ------------------
  |  Branch (2392:7): [True: 20.6k, False: 101k]
  ------------------
 2393|  20.6k|			ol_numeral = hoedown_buffer_new(1024);
 2394|       |			/* -2 to eliminate the trailing ". " */
 2395|  20.6k|			hoedown_buffer_put(ol_numeral, data, beg - 2);
 2396|  20.6k|		}
 2397|   121k|		if (*flags & HOEDOWN_LIST_DEFINITION) {
  ------------------
  |  Branch (2397:7): [True: 104k, False: 17.4k]
  ------------------
 2398|   104k|			beg = prefix_dt(data, size);
 2399|   104k|			if (beg) ul_item_char = data[beg - 2];
  ------------------
  |  Branch (2399:8): [True: 74.5k, False: 29.8k]
  ------------------
 2400|   104k|		}
 2401|   121k|	}
 2402|       |
 2403|   205k|	if (!beg) {
  ------------------
  |  Branch (2403:6): [True: 30.8k, False: 174k]
  ------------------
 2404|  30.8k|		if (ol_numeral) hoedown_buffer_free(ol_numeral);
  ------------------
  |  Branch (2404:7): [True: 4.20k, False: 26.6k]
  ------------------
 2405|  30.8k|		return 0;
 2406|  30.8k|	}
 2407|       |
 2408|       |	/* skipping to the beginning of the following line */
 2409|   174k|	end = beg;
 2410|  17.6M|	while (end < size && data[end - 1] != '\n')
  ------------------
  |  Branch (2410:9): [True: 17.5M, False: 13.3k]
  |  Branch (2410:23): [True: 17.4M, False: 161k]
  ------------------
 2411|  17.4M|		end++;
 2412|       |
 2413|   174k|	if (doc->ext_flags & HOEDOWN_EXT_FENCED_CODE) {
  ------------------
  |  Branch (2413:6): [True: 174k, False: 0]
  ------------------
 2414|   174k|		fence_pre = is_codefence(data + beg, end - beg, &len, NULL);
 2415|   174k|		if (fence_pre) {
  ------------------
  |  Branch (2415:7): [True: 4.33k, False: 170k]
  ------------------
 2416|  4.33k|			in_fence = 1;
 2417|  4.33k|			fence_pre = fence_pre + beg - len;
 2418|  4.33k|		}
 2419|   174k|	}
 2420|       |
 2421|       |	/* getting working buffers */
 2422|   174k|	work = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   174k|#define BUFFER_SPAN 1
  ------------------
 2423|   174k|	inter = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   174k|#define BUFFER_SPAN 1
  ------------------
 2424|       |
 2425|       |	/* calculating the indentation */
 2426|   174k|	i = 0;
 2427|   332k|	while (i < 4 && beg + i < end && data[beg + i] == ' ')
  ------------------
  |  Branch (2427:9): [True: 326k, False: 6.21k]
  |  Branch (2427:18): [True: 326k, False: 33]
  |  Branch (2427:35): [True: 158k, False: 168k]
  ------------------
 2428|   158k|		i++;
 2429|       |
 2430|   174k|	beg += i;
 2431|       |
 2432|       |	/* putting the first line into the working buffer */
 2433|   174k|	hoedown_buffer_put(work, data + beg, end - beg);
 2434|   174k|	beg = end;
 2435|       |
 2436|   174k|	attr = newbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|   174k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2437|       |
 2438|       |	/* process the following lines */
 2439|   583k|	while (beg < size) {
  ------------------
  |  Branch (2439:9): [True: 565k, False: 18.0k]
  ------------------
 2440|   565k|		size_t has_next_uli = 0, has_next_oli = 0, has_next_dli = 0;
 2441|       |
 2442|   565k|		end++;
 2443|       |
 2444|  64.4M|		while (end < size && data[end - 1] != '\n')
  ------------------
  |  Branch (2444:10): [True: 64.4M, False: 6.11k]
  |  Branch (2444:24): [True: 63.8M, False: 559k]
  ------------------
 2445|  63.8M|			end++;
 2446|       |
 2447|       |		/* process an empty line */
 2448|   565k|		if (is_empty(data + beg, end - beg)) {
  ------------------
  |  Branch (2448:7): [True: 63.7k, False: 501k]
  ------------------
 2449|  63.7k|			in_empty = 1;
 2450|  63.7k|			beg = end;
 2451|  63.7k|			continue;
 2452|  63.7k|		}
 2453|       |
 2454|       |		/* calculating the indentation */
 2455|   501k|		i = 0;
 2456|   623k|		while (i < 4 && beg + i < end && data[beg + i] == ' ')
  ------------------
  |  Branch (2456:10): [True: 606k, False: 16.0k]
  |  Branch (2456:19): [True: 606k, False: 0]
  |  Branch (2456:36): [True: 121k, False: 485k]
  ------------------
 2457|   121k|			i++;
 2458|       |
 2459|   501k|		if (in_fence && i > fence_pre) {
  ------------------
  |  Branch (2459:7): [True: 44.4k, False: 457k]
  |  Branch (2459:19): [True: 3.29k, False: 41.1k]
  ------------------
 2460|  3.29k|			i = fence_pre;
 2461|  3.29k|		}
 2462|       |
 2463|   501k|		pre = i;
 2464|       |
 2465|   501k|		if (doc->ext_flags & HOEDOWN_EXT_FENCED_CODE) {
  ------------------
  |  Branch (2465:7): [True: 501k, False: 0]
  ------------------
 2466|   501k|			if (is_codefence(data + beg + i, end - beg - i, NULL, NULL))
  ------------------
  |  Branch (2466:8): [True: 10.9k, False: 490k]
  ------------------
 2467|  10.9k|				in_fence = !in_fence;
 2468|   501k|			if (in_fence && fence_pre == 0) {
  ------------------
  |  Branch (2468:8): [True: 45.2k, False: 456k]
  |  Branch (2468:20): [True: 21.5k, False: 23.6k]
  ------------------
 2469|  21.5k|				fence_pre = pre;
 2470|  21.5k|			}
 2471|   501k|		}
 2472|       |
 2473|       |		/* Only check for new list items if we are **not** inside
 2474|       |		 * a fenced code block */
 2475|   501k|		if (!in_fence) {
  ------------------
  |  Branch (2475:7): [True: 456k, False: 45.2k]
  ------------------
 2476|   456k|			has_next_uli = prefix_uli(data + beg + i, end - beg - i);
 2477|   456k|			has_next_oli = prefix_oli(data + beg + i, end - beg - i);
 2478|       |
 2479|       |			/* only check for the next definition if it is same indentation or less
 2480|       |			 * since embedded definition lists need terms, so finding just a
 2481|       |			 * colon by itself does not mean anything */
 2482|   456k|			if (pre <= orgpre)
  ------------------
  |  Branch (2482:8): [True: 403k, False: 52.8k]
  ------------------
 2483|   403k|				has_next_dli = prefix_dt(data + beg + i, end - beg - i);
 2484|   456k|		}
 2485|       |
 2486|       |		/* checking for a new item */
 2487|   501k|		if ((has_next_uli && !is_hrule(data + beg + i, end - beg - i)) || 
  ------------------
  |  Branch (2487:8): [True: 78.0k, False: 423k]
  |  Branch (2487:24): [True: 77.5k, False: 446]
  ------------------
 2488|   424k|			has_next_oli || (*flags & HOEDOWN_LI_DD && has_next_dli)) {
  ------------------
  |  Branch (2488:4): [True: 11.4k, False: 412k]
  |  Branch (2488:21): [True: 311k, False: 101k]
  |  Branch (2488:47): [True: 48.7k, False: 262k]
  ------------------
 2489|   137k|			if (in_empty)
  ------------------
  |  Branch (2489:8): [True: 21.2k, False: 116k]
  ------------------
 2490|  21.2k|				has_inside_empty = 1;
 2491|       |
 2492|       |			/* the following item must have the same (or less) indentation */
 2493|   137k|			if (pre <= orgpre) {
  ------------------
  |  Branch (2493:8): [True: 128k, False: 9.27k]
  ------------------
 2494|       |				/* if the following item has different list type, we end this list */
 2495|   128k|				if (in_empty && (
  ------------------
  |  Branch (2495:9): [True: 19.0k, False: 109k]
  ------------------
 2496|  19.0k|					((*flags & HOEDOWN_LIST_ORDERED) && has_next_uli) ||
  ------------------
  |  Branch (2496:7): [True: 5.66k, False: 13.4k]
  |  Branch (2496:42): [True: 4.18k, False: 1.47k]
  ------------------
 2497|  14.8k|					(!(*flags & HOEDOWN_LIST_ORDERED) && has_next_oli))) {
  ------------------
  |  Branch (2497:7): [True: 13.4k, False: 1.47k]
  |  Branch (2497:43): [True: 7.77k, False: 5.65k]
  ------------------
 2498|  11.9k|					*flags |= HOEDOWN_LI_END;
 2499|  11.9k|					has_inside_empty = 0;
 2500|  11.9k|				}
 2501|   128k|				break;
 2502|   128k|			}
 2503|       |
 2504|  9.27k|			if (!sublist)
  ------------------
  |  Branch (2504:8): [True: 4.72k, False: 4.54k]
  ------------------
 2505|  4.72k|				sublist = work->size;
 2506|  9.27k|		}
 2507|       |		/* joining only indented stuff after empty lines;
 2508|       |		 * note that now we only require 1 space of indentation
 2509|       |		 * to continue a list */
 2510|   363k|		else if (in_empty && pre == 0) {
  ------------------
  |  Branch (2510:12): [True: 35.3k, False: 328k]
  |  Branch (2510:24): [True: 28.2k, False: 7.12k]
  ------------------
 2511|  28.2k|			*flags |= HOEDOWN_LI_END;
 2512|  28.2k|			break;
 2513|  28.2k|		}
 2514|       |
 2515|   345k|		if (in_empty) {
  ------------------
  |  Branch (2515:7): [True: 9.28k, False: 335k]
  ------------------
 2516|  9.28k|			hoedown_buffer_putc(work, '\n');
 2517|  9.28k|			has_inside_empty = 1;
 2518|  9.28k|			in_empty = 0;
 2519|  9.28k|		}
 2520|       |
 2521|       |		/* adding the line without prefix into the working buffer */
 2522|   345k|		hoedown_buffer_put(work, data + beg + i, end - beg - i);
 2523|   345k|		beg = end;
 2524|   345k|	}
 2525|       |
 2526|       |	/* render of li contents */
 2527|   174k|	if (has_inside_empty)
  ------------------
  |  Branch (2527:6): [True: 13.3k, False: 161k]
  ------------------
 2528|  13.3k|		*flags |= HOEDOWN_LI_BLOCK;
 2529|       |
 2530|   174k|	if (*flags & HOEDOWN_LI_BLOCK) {
  ------------------
  |  Branch (2530:6): [True: 70.5k, False: 104k]
  ------------------
 2531|       |		/* intermediate render of block li */
 2532|  70.5k|		pre = 0;
 2533|  70.5k|		if (sublist && sublist < work->size) {
  ------------------
  |  Branch (2533:7): [True: 3.21k, False: 67.3k]
  |  Branch (2533:18): [True: 3.21k, False: 0]
  ------------------
 2534|  3.21k|			end = sublist;
 2535|  67.3k|		} else {
 2536|  67.3k|			end = work->size;
 2537|  67.3k|		}
 2538|       |
 2539|  70.5k|		do {
 2540|  70.5k|			if (!(doc->ext_flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE)) {
  ------------------
  |  Branch (2540:8): [True: 0, False: 70.5k]
  ------------------
 2541|      0|				break;
 2542|      0|			}
 2543|       |
 2544|  70.5k|			i = 0;
 2545|  7.10M|			while (i < end && work->data[i] != '\n') {
  ------------------
  |  Branch (2545:11): [True: 7.10M, False: 2]
  |  Branch (2545:22): [True: 7.03M, False: 70.5k]
  ------------------
 2546|  7.03M|				i++;
 2547|  7.03M|			}
 2548|       |
 2549|  70.5k|			len = parse_attributes(work->data, i, attr, attribute, "list", 0, doc->attr_activation);
 2550|  70.5k|			if (i == len) {
  ------------------
  |  Branch (2550:8): [True: 44.7k, False: 25.7k]
  ------------------
 2551|  44.7k|				break;
 2552|  44.7k|			}
 2553|       |
 2554|  25.7k|			pre = i;
 2555|  25.7k|			parse_block(inter, doc, work->data, len);
 2556|  25.7k|		} while (0);
  ------------------
  |  Branch (2556:12): [Folded, False: 25.7k]
  ------------------
 2557|       |
 2558|  70.5k|		parse_block(inter, doc, work->data + pre, end - pre);
 2559|  70.5k|		if (end == sublist) {
  ------------------
  |  Branch (2559:7): [True: 3.21k, False: 67.3k]
  ------------------
 2560|  3.21k|			parse_block(inter, doc, work->data + sublist, work->size - sublist);
 2561|  3.21k|		}
 2562|   104k|	} else {
 2563|       |		/* intermediate render of inline li */
 2564|   104k|		if (sublist && sublist < work->size) {
  ------------------
  |  Branch (2564:7): [True: 1.51k, False: 102k]
  |  Branch (2564:18): [True: 1.51k, False: 0]
  ------------------
 2565|  1.51k|			if (doc->ext_flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE) {
  ------------------
  |  Branch (2565:8): [True: 1.51k, False: 0]
  ------------------
 2566|  1.51k|				len = parse_attributes(work->data, sublist, attr, attribute, "list", 0, doc->attr_activation);
 2567|  1.51k|			} else {
 2568|      0|				len = sublist;
 2569|      0|			}
 2570|  1.51k|			parse_inline(inter, doc, work->data, len);
 2571|  1.51k|			parse_block(inter, doc, work->data + sublist, work->size - sublist);
 2572|   102k|		} else {
 2573|   102k|			if (doc->ext_flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE) {
  ------------------
  |  Branch (2573:8): [True: 102k, False: 0]
  ------------------
 2574|   102k|				len = parse_attributes(work->data, work->size, attr, attribute, "list", 0, doc->attr_activation);
 2575|   102k|			} else {
 2576|      0|				len = work->size;
 2577|      0|			}
 2578|   102k|			parse_inline(inter, doc, work->data, len);
 2579|   102k|		}
 2580|   104k|	}
 2581|       |
 2582|       |	/* render of li itself */
 2583|   174k|	if (doc->md.listitem) {
  ------------------
  |  Branch (2583:6): [True: 174k, False: 0]
  ------------------
 2584|   174k|		doc->ul_item_char = ul_item_char;
 2585|   174k|		doc->ol_numeral = ol_numeral;
 2586|   174k|		doc->md.listitem(ob, inter, attr, flags, &doc->data);
 2587|   174k|		doc->ol_numeral = NULL;
 2588|   174k|		doc->ul_item_char = 0;
 2589|   174k|	}
 2590|       |
 2591|   174k|	if (ol_numeral) hoedown_buffer_free(ol_numeral);
  ------------------
  |  Branch (2591:6): [True: 16.4k, False: 158k]
  ------------------
 2592|       |
 2593|   174k|	popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   174k|#define BUFFER_SPAN 1
  ------------------
 2594|   174k|	popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   174k|#define BUFFER_SPAN 1
  ------------------
 2595|   174k|	popbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|   174k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2596|   174k|	return beg;
 2597|   205k|}
document.c:prefix_dt:
 2017|  4.42M|{
 2018|  4.42M|	size_t i = 0;
 2019|       |
 2020|       |	/* skip up to 3 whitespaces (since it's an indented codeblock at 4) */
 2021|  4.42M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (2021:6): [True: 4.42M, False: 0]
  |  Branch (2021:18): [True: 109k, False: 4.31M]
  ------------------
 2022|  4.42M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (2022:6): [True: 4.42M, False: 0]
  |  Branch (2022:18): [True: 56.2k, False: 4.37M]
  ------------------
 2023|  4.42M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (2023:6): [True: 4.42M, False: 0]
  |  Branch (2023:18): [True: 48.7k, False: 4.37M]
  ------------------
 2024|       |
 2025|       |	/* if the first character after whitespaces isn't :, it isn't a dt */
 2026|  4.42M|	if (i + 1 >= size ||
  ------------------
  |  Branch (2026:6): [True: 9.64k, False: 4.41M]
  ------------------
 2027|  4.41M|		data[i] != ':' ||
  ------------------
  |  Branch (2027:3): [True: 4.10M, False: 308k]
  ------------------
 2028|   308k|		data[i + 1] != ' ')
  ------------------
  |  Branch (2028:3): [True: 82.4k, False: 225k]
  ------------------
 2029|  4.20M|		return 0;
 2030|       |
 2031|   225k|	if (is_next_headerline(data + i, size - i))
  ------------------
  |  Branch (2031:6): [True: 40.4k, False: 185k]
  ------------------
 2032|  40.4k|		return 0;
 2033|       |
 2034|   185k|	return i + 2;
 2035|   225k|}
document.c:prefix_oli:
 1970|  4.47M|{
 1971|  4.47M|	size_t i = 0;
 1972|       |
 1973|  4.47M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (1973:6): [True: 4.47M, False: 0]
  |  Branch (1973:18): [True: 117k, False: 4.35M]
  ------------------
 1974|  4.47M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (1974:6): [True: 4.47M, False: 0]
  |  Branch (1974:18): [True: 59.4k, False: 4.41M]
  ------------------
 1975|  4.47M|	if (i < size && data[i] == ' ') i++;
  ------------------
  |  Branch (1975:6): [True: 4.47M, False: 0]
  |  Branch (1975:18): [True: 51.5k, False: 4.42M]
  ------------------
 1976|       |
 1977|  4.47M|	if (i >= size || data[i] < '0' || data[i] > '9')
  ------------------
  |  Branch (1977:6): [True: 0, False: 4.47M]
  |  Branch (1977:19): [True: 2.26M, False: 2.20M]
  |  Branch (1977:36): [True: 2.09M, False: 107k]
  ------------------
 1978|  4.36M|		return 0;
 1979|       |
 1980|   887k|	while (i < size && data[i] >= '0' && data[i] <= '9')
  ------------------
  |  Branch (1980:9): [True: 887k, False: 310]
  |  Branch (1980:21): [True: 802k, False: 84.5k]
  |  Branch (1980:39): [True: 779k, False: 22.8k]
  ------------------
 1981|   779k|		i++;
 1982|       |
 1983|   107k|	if (i + 1 >= size || data[i] != '.' || data[i + 1] != ' ')
  ------------------
  |  Branch (1983:6): [True: 1.09k, False: 106k]
  |  Branch (1983:23): [True: 46.5k, False: 60.0k]
  |  Branch (1983:41): [True: 916, False: 59.1k]
  ------------------
 1984|  48.5k|		return 0;
 1985|       |
 1986|  59.1k|	if (is_next_headerline(data + i, size - i))
  ------------------
  |  Branch (1986:6): [True: 1.94k, False: 57.2k]
  ------------------
 1987|  1.94k|		return 0;
 1988|       |
 1989|  57.2k|	return i + 2;
 1990|  59.1k|}
document.c:prefix_dli:
 2047|   342k|{
 2048|       |	/* end is to keep track of the final return value */
 2049|   342k|	size_t i = 0, j = 0, end = 0;
 2050|   342k|	int empty = 0;
 2051|       |
 2052|       |	/* if the first line has a : in front of it, it can't be a definition list
 2053|       |	 * that starts at this point */
 2054|   342k|	if (prefix_dt(data, size)) {
  ------------------
  |  Branch (2054:6): [True: 2.42k, False: 340k]
  ------------------
 2055|  2.42k|		return 0;
 2056|  2.42k|	}
 2057|       |
 2058|       |	/* temporarily toggle definition lists off to prevent infinite loops */
 2059|   340k|	doc->ext_flags &= ~HOEDOWN_EXT_DEFINITION_LISTS;
 2060|       |
 2061|       |	/* check if it is a block of text with no double newlines inside, followed by
 2062|       |	 *  another block of text starting with : */
 2063|  4.01M|	while (i < size) {
  ------------------
  |  Branch (2063:9): [True: 3.94M, False: 63.8k]
  ------------------
 2064|       |		/* if the line we are on is empty, flip the empty flag to indicate that
 2065|       |		 * the next block of text we see has to start with : to be considered
 2066|       |		 * a definition list; then skip to the next line */
 2067|  3.94M|		j = is_empty(data + i, size - i);
 2068|  3.94M|		if(j != 0) {
  ------------------
  |  Branch (2068:6): [True: 270k, False: 3.67M]
  ------------------
 2069|   270k|			empty = 1;
 2070|   270k|			i += j;
 2071|   270k|			continue;
 2072|   270k|		}
 2073|       |
 2074|       |		/* if anything special is found while parsing the definition term part,
 2075|       |		 * then return so that the main loop can deal with it */
 2076|  3.67M|		if (!is_paragraph(doc, data + i, size - i)) {
  ------------------
  |  Branch (2076:7): [True: 99.5k, False: 3.57M]
  ------------------
 2077|  99.5k|			break;
 2078|  99.5k|		}
 2079|       |
 2080|       |		/* check if the current line starts with :, returning the position of the
 2081|       |		 * beginning of the line if it does */
 2082|  3.57M|		j = prefix_dt(data + i, size - i);
 2083|  3.57M|		if (j > 0) {
  ------------------
  |  Branch (2083:7): [True: 54.1k, False: 3.52M]
  ------------------
 2084|  54.1k|			end = i;
 2085|  54.1k|			break;
 2086|  3.52M|		} else if(empty) {
  ------------------
  |  Branch (2086:13): [True: 122k, False: 3.39M]
  ------------------
 2087|       |			/* if an empty newline has been found, then since : was not the first
 2088|       |			 * character after whitespaces, it can't be a definition list */
 2089|   122k|			break;
 2090|   122k|		}
 2091|       |		/* scan characters until the next newline */
 2092|   249M|		for (i = i + 1; i < size && data[i - 1] != '\n'; i++);
  ------------------
  |  Branch (2092:19): [True: 249M, False: 63.4k]
  |  Branch (2092:31): [True: 245M, False: 3.33M]
  ------------------
 2093|  3.39M|	}
 2094|       |
 2095|   340k|	doc->ext_flags |= HOEDOWN_EXT_DEFINITION_LISTS;
 2096|   340k|	return end;
 2097|   342k|}
document.c:is_paragraph:
 3513|  3.67M|{
 3514|       |	/* temporary buffer for results of checking special blocks */
 3515|  3.67M|	hoedown_buffer *tmp = newbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  3.67M|#define BUFFER_BLOCK 0
  ------------------
 3516|       |	/* temporary renderer that has no rendering function */
 3517|  3.67M|	hoedown_renderer temp_renderer;
 3518|       |	/* ensure all callbacks are NULL */
 3519|  3.67M|	memset(&temp_renderer, 0, sizeof(hoedown_renderer));
 3520|       |	/* store the old renderer */
 3521|  3.67M|	hoedown_renderer old_renderer;
 3522|  3.67M|	memcpy(&old_renderer, &doc->md, sizeof(hoedown_renderer));
 3523|       |	/* copy the new renderer over to the document */
 3524|  3.67M|	memcpy(&doc->md, &temp_renderer, sizeof(hoedown_renderer));
 3525|       |	/* these are all the if branches inside parse_block, wrapped into one bool,
 3526|       |	 * with minimal parsing, and completely idempotent */
 3527|  3.67M|	int result = !(is_atxheader(doc, txt_data, end) ||
  ------------------
  |  Branch (3527:17): [True: 5.20k, False: 3.67M]
  ------------------
 3528|  3.67M|					(doc->user_block && parse_userblock(tmp, doc, txt_data, end)) ||
  ------------------
  |  Branch (3528:7): [True: 0, False: 3.67M]
  |  Branch (3528:26): [True: 0, False: 0]
  ------------------
 3529|  3.67M|					(txt_data[0] == '<' &&
  ------------------
  |  Branch (3529:7): [True: 263k, False: 3.40M]
  ------------------
 3530|   263k|						parse_htmlblock(tmp, doc, txt_data, end, 0)) ||
  ------------------
  |  Branch (3530:7): [True: 5.22k, False: 257k]
  ------------------
 3531|  3.66M|					is_hrule(txt_data, end) ||
  ------------------
  |  Branch (3531:6): [True: 14.0k, False: 3.65M]
  ------------------
 3532|  3.65M|					((doc->ext_flags & HOEDOWN_EXT_FENCED_CODE) &&
  ------------------
  |  Branch (3532:7): [True: 3.65M, False: 0]
  ------------------
 3533|  3.65M|						parse_fencedcode(tmp, doc, txt_data, end, doc->ext_flags)) ||
  ------------------
  |  Branch (3533:7): [True: 9.19k, False: 3.64M]
  ------------------
 3534|  3.64M|					((doc->ext_flags & HOEDOWN_EXT_TABLES) &&
  ------------------
  |  Branch (3534:7): [True: 3.64M, False: 0]
  ------------------
 3535|  3.64M|						parse_table(tmp, doc, txt_data, end)) ||
  ------------------
  |  Branch (3535:7): [True: 21.8k, False: 3.62M]
  ------------------
 3536|  3.62M|					prefix_quote(txt_data, end) ||
  ------------------
  |  Branch (3536:6): [True: 8.67k, False: 3.61M]
  ------------------
 3537|  3.61M|					(!(doc->ext_flags & HOEDOWN_EXT_DISABLE_INDENTED_CODE) &&
  ------------------
  |  Branch (3537:7): [True: 0, False: 3.61M]
  ------------------
 3538|      0|						prefix_code(txt_data, end)) ||
  ------------------
  |  Branch (3538:7): [True: 0, False: 0]
  ------------------
 3539|  3.61M|					prefix_uli(txt_data, end) ||
  ------------------
  |  Branch (3539:6): [True: 24.3k, False: 3.58M]
  ------------------
 3540|  3.58M|					prefix_oli(txt_data, end) ||
  ------------------
  |  Branch (3540:6): [True: 10.9k, False: 3.57M]
  ------------------
 3541|  3.57M|					((doc->ext_flags & HOEDOWN_EXT_DEFINITION_LISTS) &&
  ------------------
  |  Branch (3541:7): [True: 0, False: 3.57M]
  ------------------
 3542|      0|						prefix_dli(doc, txt_data, end)));
  ------------------
  |  Branch (3542:7): [True: 0, False: 0]
  ------------------
 3543|  3.67M|	popbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  3.67M|#define BUFFER_BLOCK 0
  ------------------
 3544|  3.67M|	memcpy(&doc->md, &old_renderer, sizeof(hoedown_renderer));
 3545|  3.67M|	return result;
 3546|  3.67M|}
document.c:parse_paragraph:
 2162|   275k|{
 2163|   275k|	hoedown_buffer work = { NULL, 0, 0, 0, NULL, NULL, NULL };
 2164|   275k|	size_t i = 0, end = 0;
 2165|   275k|	int level = 0;
 2166|       |
 2167|   275k|	work.data = data;
 2168|       |
 2169|  1.06M|	while (i < size) {
  ------------------
  |  Branch (2169:9): [True: 1.02M, False: 42.8k]
  ------------------
 2170|   200M|		for (end = i + 1; end < size && data[end - 1] != '\n'; end++) /* empty */;
  ------------------
  |  Branch (2170:21): [True: 200M, False: 50.0k]
  |  Branch (2170:35): [True: 199M, False: 974k]
  ------------------
 2171|       |
 2172|  1.02M|		if (is_empty(data + i, size - i))
  ------------------
  |  Branch (2172:7): [True: 79.0k, False: 945k]
  ------------------
 2173|  79.0k|			break;
 2174|       |
 2175|   945k|		if ((level = is_headerline(data + i, size - i)) != 0) {
  ------------------
  |  Branch (2175:7): [True: 137k, False: 807k]
  ------------------
 2176|   137k|			if (i == 0) {
  ------------------
  |  Branch (2176:8): [True: 71.3k, False: 66.3k]
  ------------------
 2177|  71.3k|				level = 0;
 2178|  71.3k|				i = end;
 2179|  71.3k|			}
 2180|   137k|			break;
 2181|   137k|		}
 2182|       |
 2183|   807k|		if (is_atxheader(doc, data + i, size - i) ||
  ------------------
  |  Branch (2183:7): [True: 2.62k, False: 804k]
  ------------------
 2184|   804k|			is_hrule(data + i, size - i) ||
  ------------------
  |  Branch (2184:4): [True: 11.1k, False: 793k]
  ------------------
 2185|   793k|			prefix_quote(data + i, size - i)) {
  ------------------
  |  Branch (2185:4): [True: 1.53k, False: 791k]
  ------------------
 2186|  15.3k|			end = i;
 2187|  15.3k|			break;
 2188|  15.3k|		}
 2189|       |
 2190|   791k|		i = end;
 2191|   791k|	}
 2192|       |
 2193|   275k|	work.size = i;
 2194|   539k|	while (work.size && data[work.size - 1] == '\n')
  ------------------
  |  Branch (2194:9): [True: 539k, False: 0]
  |  Branch (2194:22): [True: 264k, False: 275k]
  ------------------
 2195|   264k|		work.size--;
 2196|       |
 2197|   275k|	if (!level) {
  ------------------
  |  Branch (2197:6): [True: 208k, False: 66.3k]
  ------------------
 2198|   208k|		hoedown_buffer *attr = newbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|   208k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2199|   208k|		if (doc->ext_flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE) {
  ------------------
  |  Branch (2199:7): [True: 208k, False: 0]
  ------------------
 2200|   208k|			parse_attributes(work.data, work.size, NULL, attr, "paragraph", 1, doc->attr_activation);
 2201|   208k|			if (attr->size > 0) {
  ------------------
  |  Branch (2201:8): [True: 0, False: 208k]
  ------------------
 2202|       |				/* remove the length of the attribute from the work size - the 12 comes
 2203|       |				* from the leading space (1), the paragraph (9), the @ symbol (1), and
 2204|       |				* the {} (2) (any extra spaces in the attribute are included inside
 2205|       |				* the attribute) */
 2206|      0|				work.size -= attr->size + 12;
 2207|      0|			}
 2208|   208k|		}
 2209|       |
 2210|   208k|		hoedown_buffer *tmp = newbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|   208k|#define BUFFER_BLOCK 0
  ------------------
 2211|   208k|		parse_inline(tmp, doc, work.data, work.size);
 2212|   208k|		if (doc->md.paragraph)
  ------------------
  |  Branch (2212:7): [True: 208k, False: 0]
  ------------------
 2213|   208k|			doc->md.paragraph(ob, tmp, attr, &doc->data);
 2214|   208k|		popbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|   208k|#define BUFFER_BLOCK 0
  ------------------
 2215|   208k|		popbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|   208k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2216|   208k|	} else {
 2217|  66.3k|		hoedown_buffer *header_work;
 2218|  66.3k|		hoedown_buffer *attr_work;
 2219|  66.3k|		size_t len;
 2220|       |
 2221|  66.3k|		if (work.size) {
  ------------------
  |  Branch (2221:7): [True: 66.3k, False: 0]
  ------------------
 2222|  66.3k|			size_t beg;
 2223|  66.3k|			i = work.size;
 2224|  66.3k|			work.size -= 1;
 2225|       |
 2226|  9.84M|			while (work.size && data[work.size] != '\n')
  ------------------
  |  Branch (2226:11): [True: 9.80M, False: 37.4k]
  |  Branch (2226:24): [True: 9.78M, False: 28.8k]
  ------------------
 2227|  9.78M|				work.size -= 1;
 2228|       |
 2229|  66.3k|			beg = work.size + 1;
 2230|  66.3k|			while (work.size && data[work.size - 1] == '\n')
  ------------------
  |  Branch (2230:11): [True: 28.8k, False: 37.4k]
  |  Branch (2230:24): [True: 0, False: 28.8k]
  ------------------
 2231|      0|				work.size -= 1;
 2232|       |
 2233|  66.3k|			if (work.size > 0) {
  ------------------
  |  Branch (2233:8): [True: 28.8k, False: 37.4k]
  ------------------
 2234|  28.8k|				hoedown_buffer *tmp = newbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  28.8k|#define BUFFER_BLOCK 0
  ------------------
 2235|  28.8k|				parse_inline(tmp, doc, work.data, work.size);
 2236|       |
 2237|  28.8k|				if (doc->md.paragraph)
  ------------------
  |  Branch (2237:9): [True: 28.8k, False: 0]
  ------------------
 2238|  28.8k|					doc->md.paragraph(ob, tmp, NULL, &doc->data);
 2239|       |
 2240|  28.8k|				popbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|  28.8k|#define BUFFER_BLOCK 0
  ------------------
 2241|  28.8k|				work.data += beg;
 2242|  28.8k|				work.size = i - beg;
 2243|  28.8k|			}
 2244|  37.4k|			else work.size = i;
 2245|  66.3k|		}
 2246|       |
 2247|  66.3k|		header_work = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  66.3k|#define BUFFER_SPAN 1
  ------------------
 2248|  66.3k|		attr_work = newbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  66.3k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2249|       |
 2250|  66.3k|		len = work.size;
 2251|  66.3k|		if (doc->ext_flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE) {
  ------------------
  |  Branch (2251:7): [True: 66.3k, False: 0]
  ------------------
 2252|  66.3k|			len = parse_attributes(work.data, work.size, attr_work, NULL, "", 1, doc->attr_activation);
 2253|  66.3k|		}
 2254|       |
 2255|  66.3k|		parse_inline(header_work, doc, work.data, len);
 2256|       |
 2257|  66.3k|		if (doc->md.header) {
  ------------------
  |  Branch (2257:7): [True: 66.3k, False: 0]
  ------------------
 2258|  66.3k|			doc->header_type = HOEDOWN_HEADER_SETEXT;
 2259|  66.3k|			doc->md.header(ob, header_work, attr_work, (int)level, &doc->data);
 2260|  66.3k|			doc->header_type = HOEDOWN_HEADER_NONE;
 2261|  66.3k|		}
 2262|       |
 2263|  66.3k|		popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  66.3k|#define BUFFER_SPAN 1
  ------------------
 2264|  66.3k|		popbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  66.3k|#define BUFFER_ATTRIBUTE 2
  ------------------
 2265|  66.3k|	}
 2266|       |
 2267|   275k|	return end;
 2268|   275k|}
document.c:parse_footnote_list:
 2766|  11.8k|{
 2767|  11.8k|	hoedown_buffer *work = 0;
 2768|  11.8k|	struct footnote_item *item;
 2769|  11.8k|	struct footnote_ref *ref;
 2770|       |
 2771|  11.8k|	if (footnotes->count == 0)
  ------------------
  |  Branch (2771:6): [True: 11.1k, False: 639]
  ------------------
 2772|  11.1k|		return;
 2773|       |
 2774|    639|	work = newbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|    639|#define BUFFER_BLOCK 0
  ------------------
 2775|       |
 2776|    639|	item = footnotes->head;
 2777|  1.72k|	while (item) {
  ------------------
  |  Branch (2777:9): [True: 1.08k, False: 639]
  ------------------
 2778|  1.08k|		ref = item->ref;
 2779|  1.08k|		parse_footnote_def(work, doc, ref->num, ref->name, ref->contents->data, ref->contents->size);
 2780|  1.08k|		item = item->next;
 2781|  1.08k|	}
 2782|       |
 2783|    639|	if (doc->md.footnotes)
  ------------------
  |  Branch (2783:6): [True: 639, False: 0]
  ------------------
 2784|    639|		doc->md.footnotes(ob, work, &doc->data);
 2785|    639|	popbuf(doc, BUFFER_BLOCK);
  ------------------
  |  |   18|    639|#define BUFFER_BLOCK 0
  ------------------
 2786|    639|}
document.c:parse_footnote_def:
 2749|  1.08k|{
 2750|  1.08k|	hoedown_buffer *work = 0;
 2751|  1.08k|	work = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  1.08k|#define BUFFER_SPAN 1
  ------------------
 2752|  1.08k|	doc->footnote_id = name;
 2753|       |
 2754|  1.08k|	parse_block(work, doc, data, size);
 2755|       |
 2756|  1.08k|	if (doc->md.footnote_def)
  ------------------
  |  Branch (2756:6): [True: 1.08k, False: 0]
  ------------------
 2757|  1.08k|	doc->md.footnote_def(ob, work, num, &doc->data);
 2758|       |
 2759|  1.08k|	doc->footnote_id = NULL;
 2760|  1.08k|	popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  1.08k|#define BUFFER_SPAN 1
  ------------------
 2761|  1.08k|}
document.c:free_link_refs:
  253|  11.8k|{
  254|  11.8k|	size_t i;
  255|       |
  256|   106k|	for (i = 0; i < REF_TABLE_SIZE; ++i) {
  ------------------
  |  |   16|   106k|#define REF_TABLE_SIZE 8
  ------------------
  |  Branch (256:14): [True: 94.5k, False: 11.8k]
  ------------------
  257|  94.5k|		struct link_ref *r = references[i];
  258|  94.5k|		struct link_ref *next;
  259|       |
  260|   181k|		while (r) {
  ------------------
  |  Branch (260:10): [True: 87.1k, False: 94.5k]
  ------------------
  261|  87.1k|			next = r->next;
  262|  87.1k|			hoedown_buffer_free(r->link);
  263|  87.1k|			hoedown_buffer_free(r->title);
  264|  87.1k|			hoedown_buffer_free(r->attr);
  265|  87.1k|			free(r);
  266|  87.1k|			r = next;
  267|  87.1k|		}
  268|  94.5k|	}
  269|  11.8k|}
document.c:free_footnote_list:
  327|  23.6k|{
  328|  23.6k|	struct footnote_item *item = list->head;
  329|  23.6k|	struct footnote_item *next;
  330|       |
  331|   333k|	while (item) {
  ------------------
  |  Branch (331:9): [True: 309k, False: 23.6k]
  ------------------
  332|   309k|		next = item->next;
  333|   309k|		if (free_refs)
  ------------------
  |  Branch (333:7): [True: 308k, False: 1.08k]
  ------------------
  334|   308k|			free_footnote_ref(item->ref);
  335|   309k|		free(item);
  336|   309k|		item = next;
  337|   309k|	}
  338|  23.6k|}
document.c:parse_inline:
  543|   996k|{
  544|   996k|	size_t i = 0, end = 0, consumed = 0;
  545|   996k|	hoedown_buffer work = { 0, 0, 0, 0, NULL, NULL, NULL };
  546|   996k|	uint8_t *active_char = doc->active_char;
  547|       |
  548|   996k|	if (doc->work_bufs[BUFFER_SPAN].size +
  ------------------
  |  |   19|   996k|#define BUFFER_SPAN 1
  ------------------
  |  Branch (548:6): [True: 4.69k, False: 991k]
  ------------------
  549|   996k|		doc->work_bufs[BUFFER_BLOCK].size > doc->max_nesting)
  ------------------
  |  |   18|   996k|#define BUFFER_BLOCK 0
  ------------------
  550|  4.69k|		return;
  551|       |
  552|  8.60M|	while (i < size) {
  ------------------
  |  Branch (552:9): [True: 8.39M, False: 202k]
  ------------------
  553|  8.39M|		size_t user_block = 0;
  554|   172M|		while (end < size) {
  ------------------
  |  Branch (554:10): [True: 171M, False: 789k]
  ------------------
  555|   171M|			if (doc->user_block) {
  ------------------
  |  Branch (555:8): [True: 0, False: 171M]
  ------------------
  556|      0|				user_block = doc->user_block(data+end, size - end, &doc->data);
  557|      0|				if (user_block) {
  ------------------
  |  Branch (557:9): [True: 0, False: 0]
  ------------------
  558|      0|					break;
  559|      0|				}
  560|      0|			}
  561|       |			/* copying inactive chars into the output */
  562|   171M|			if (active_char[data[end]] != 0) {
  ------------------
  |  Branch (562:8): [True: 7.61M, False: 163M]
  ------------------
  563|  7.61M|				break;
  564|  7.61M|			}
  565|   163M|			end++;
  566|   163M|		}
  567|       |
  568|  8.39M|		if (doc->md.normal_text) {
  ------------------
  |  Branch (568:7): [True: 8.39M, False: 0]
  ------------------
  569|  8.39M|			work.data = data + i;
  570|  8.39M|			work.size = end - i;
  571|  8.39M|			doc->md.normal_text(ob, &work, &doc->data);
  572|  8.39M|		}
  573|      0|		else
  574|      0|			hoedown_buffer_put(ob, data + i, end - i);
  575|       |
  576|  8.39M|		if (end >= size) {
  ------------------
  |  Branch (576:7): [True: 789k, False: 7.61M]
  ------------------
  577|   789k|			break;
  578|   789k|		}
  579|  7.61M|		i = end;
  580|       |
  581|  7.61M|		if (user_block) {
  ------------------
  |  Branch (581:7): [True: 0, False: 7.61M]
  ------------------
  582|      0|			work.data = data + i;
  583|      0|			work.size = user_block;
  584|      0|			end = user_block;
  585|      0|			if (doc->md.user_block) {
  ------------------
  |  Branch (585:8): [True: 0, False: 0]
  ------------------
  586|      0|				doc->md.user_block(ob, &work, &doc->data);
  587|      0|			} else {
  588|      0|				hoedown_buffer_put(ob, data + i, size - i);
  589|      0|			}
  590|      0|			if (!end) {
  ------------------
  |  Branch (590:8): [True: 0, False: 0]
  ------------------
  591|      0|				end = i + 1;
  592|      0|			} else {
  593|      0|				i += end;
  594|      0|				end = i;
  595|      0|				consumed = i;
  596|      0|			}
  597|  7.61M|		} else {
  598|  7.61M|			end = markdown_char_ptrs[ (int)active_char[data[end]] ](ob, doc, data + i, i - consumed, size - i);
  599|  7.61M|			if (!end) /* no action from the callback */
  ------------------
  |  Branch (599:8): [True: 6.61M, False: 999k]
  ------------------
  600|  6.61M|				end = i + 1;
  601|   999k|			else {
  602|   999k|				i += end;
  603|   999k|				end = i;
  604|   999k|				consumed = i;
  605|   999k|			}
  606|  7.61M|		}
  607|  7.61M|	}
  608|   991k|}
document.c:char_emphasis:
 1030|  1.12M|{
 1031|  1.12M|	uint8_t c = data[0];
 1032|  1.12M|	size_t ret;
 1033|       |
 1034|  1.12M|	if (doc->ext_flags & HOEDOWN_EXT_NO_INTRA_EMPHASIS) {
  ------------------
  |  Branch (1034:6): [True: 1.12M, False: 0]
  ------------------
 1035|  1.12M|		if (offset > 0 && !_isspace(data[-1]) && data[-1] != '>' && data[-1] != '(')
  ------------------
  |  Branch (1035:7): [True: 984k, False: 142k]
  |  Branch (1035:21): [True: 798k, False: 186k]
  |  Branch (1035:44): [True: 791k, False: 6.55k]
  |  Branch (1035:63): [True: 783k, False: 7.91k]
  ------------------
 1036|   783k|			return 0;
 1037|  1.12M|	}
 1038|       |
 1039|   343k|	if (size > 2 && data[1] != c) {
  ------------------
  |  Branch (1039:6): [True: 299k, False: 43.9k]
  |  Branch (1039:18): [True: 158k, False: 141k]
  ------------------
 1040|       |		/* spacing cannot follow an opening emphasis;
 1041|       |		 * strikethrough and highlight only takes two characters '~~' */
 1042|   158k|		if (c == '~' || c == '=' || _isspace(data[1]) || (ret = parse_emph1(ob, doc, data + 1, size - 1, c)) == 0)
  ------------------
  |  Branch (1042:7): [True: 16.9k, False: 141k]
  |  Branch (1042:19): [True: 31.5k, False: 109k]
  |  Branch (1042:31): [True: 7.61k, False: 102k]
  |  Branch (1042:52): [True: 54.9k, False: 47.3k]
  ------------------
 1043|   111k|			return 0;
 1044|       |
 1045|  47.3k|		return ret + 1;
 1046|   158k|	}
 1047|       |
 1048|   185k|	if (size > 3 && data[1] == c && data[2] != c) {
  ------------------
  |  Branch (1048:6): [True: 133k, False: 51.7k]
  |  Branch (1048:18): [True: 133k, False: 0]
  |  Branch (1048:34): [True: 40.1k, False: 93.4k]
  ------------------
 1049|  40.1k|		if (_isspace(data[2]) || (ret = parse_emph2(ob, doc, data + 2, size - 2, c)) == 0)
  ------------------
  |  Branch (1049:7): [True: 3.15k, False: 37.0k]
  |  Branch (1049:28): [True: 29.0k, False: 8.01k]
  ------------------
 1050|  32.1k|			return 0;
 1051|       |
 1052|  8.01k|		return ret + 2;
 1053|  40.1k|	}
 1054|       |
 1055|   145k|	if (size > 4 && data[1] == c && data[2] == c && data[3] != c) {
  ------------------
  |  Branch (1055:6): [True: 93.1k, False: 52.0k]
  |  Branch (1055:18): [True: 93.1k, False: 0]
  |  Branch (1055:34): [True: 93.1k, False: 0]
  |  Branch (1055:50): [True: 80.4k, False: 12.7k]
  ------------------
 1056|  80.4k|		if (c == '~' || c == '=' || _isspace(data[3]) || (ret = parse_emph3(ob, doc, data + 3, size - 3, c)) == 0)
  ------------------
  |  Branch (1056:7): [True: 2.87k, False: 77.5k]
  |  Branch (1056:19): [True: 407, False: 77.1k]
  |  Branch (1056:31): [True: 2.50k, False: 74.6k]
  |  Branch (1056:52): [True: 73.2k, False: 1.34k]
  ------------------
 1057|  79.0k|			return 0;
 1058|       |
 1059|  1.34k|		return ret + 3;
 1060|  80.4k|	}
 1061|       |
 1062|  64.8k|	return 0;
 1063|   145k|}
document.c:parse_emph1:
  873|   111k|{
  874|   111k|	size_t i = 0, len;
  875|   111k|	hoedown_buffer *work = 0;
  876|   111k|	int r;
  877|       |
  878|       |	/* skipping one symbol if coming from emph3 */
  879|   111k|	if (size > 1 && data[0] == c && data[1] == c) i = 1;
  ------------------
  |  Branch (879:6): [True: 111k, False: 0]
  |  Branch (879:18): [True: 9.10k, False: 102k]
  |  Branch (879:34): [True: 9.10k, False: 0]
  ------------------
  880|       |
  881|   139k|	while (i < size) {
  ------------------
  |  Branch (881:9): [True: 139k, False: 0]
  ------------------
  882|   139k|		len = find_emph_char(data + i, size - i, c);
  883|   139k|		if (!len) return 0;
  ------------------
  |  Branch (883:7): [True: 62.9k, False: 76.3k]
  ------------------
  884|  76.3k|		i += len;
  885|  76.3k|		if (i >= size) return 0;
  ------------------
  |  Branch (885:7): [True: 0, False: 76.3k]
  ------------------
  886|       |
  887|  76.3k|		if (data[i] == c && !_isspace(data[i - 1])) {
  ------------------
  |  Branch (887:7): [True: 76.3k, False: 0]
  |  Branch (887:23): [True: 49.0k, False: 27.3k]
  ------------------
  888|       |
  889|  49.0k|			if (doc->ext_flags & HOEDOWN_EXT_NO_INTRA_EMPHASIS ||
  ------------------
  |  Branch (889:8): [True: 49.0k, False: 0]
  ------------------
  890|  49.0k|				(doc->ext_flags & HOEDOWN_EXT_NO_INTRA_UNDERLINE_EMPHASIS && c == '_')) {
  ------------------
  |  Branch (890:6): [True: 0, False: 0]
  |  Branch (890:66): [True: 0, False: 0]
  ------------------
  891|  49.0k|				if (i + 1 < size && isalnum(data[i + 1]))
  ------------------
  |  Branch (891:9): [True: 48.1k, False: 890]
  |  Branch (891:25): [True: 626, False: 47.5k]
  ------------------
  892|    626|					continue;
  893|  49.0k|			}
  894|       |
  895|  48.4k|			work = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  48.4k|#define BUFFER_SPAN 1
  ------------------
  896|  48.4k|			parse_inline(work, doc, data, i);
  897|       |
  898|  48.4k|			if (doc->ext_flags & HOEDOWN_EXT_UNDERLINE && c == '_')
  ------------------
  |  Branch (898:8): [True: 48.4k, False: 0]
  |  Branch (898:50): [True: 45.3k, False: 3.02k]
  ------------------
  899|  45.3k|				r = doc->md.underline(ob, work, &doc->data);
  900|  3.02k|			else
  901|  3.02k|				r = doc->md.emphasis(ob, work, &doc->data);
  902|       |
  903|  48.4k|			popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  48.4k|#define BUFFER_SPAN 1
  ------------------
  904|  48.4k|			return r ? i + 1 : 0;
  ------------------
  |  Branch (904:11): [True: 47.3k, False: 1.11k]
  ------------------
  905|  49.0k|		}
  906|  76.3k|	}
  907|       |
  908|      0|	return 0;
  909|   111k|}
document.c:find_emph_char:
  754|  2.18M|{
  755|  2.18M|	size_t i = 0;
  756|       |
  757|  7.65M|	while (i < size) {
  ------------------
  |  Branch (757:9): [True: 7.63M, False: 21.4k]
  ------------------
  758|   262M|		while (i < size && data[i] != c && data[i] != '[' && data[i] != '`')
  ------------------
  |  Branch (758:10): [True: 262M, False: 188k]
  |  Branch (758:22): [True: 260M, False: 1.69M]
  |  Branch (758:38): [True: 255M, False: 5.71M]
  |  Branch (758:56): [True: 255M, False: 35.8k]
  ------------------
  759|   255M|			i++;
  760|       |
  761|  7.63M|		if (i == size)
  ------------------
  |  Branch (761:7): [True: 188k, False: 7.44M]
  ------------------
  762|   188k|			return 0;
  763|       |
  764|       |		/* not counting escaped chars */
  765|  7.44M|		if (is_escaped(data, i)) {
  ------------------
  |  Branch (765:7): [True: 7.53k, False: 7.43M]
  ------------------
  766|  7.53k|			i++; continue;
  767|  7.53k|		}
  768|       |
  769|  7.43M|		if (data[i] == c)
  ------------------
  |  Branch (769:7): [True: 1.68M, False: 5.74M]
  ------------------
  770|  1.68M|			return i;
  771|       |
  772|       |		/* skipping a codespan */
  773|  5.74M|		if (data[i] == '`') {
  ------------------
  |  Branch (773:7): [True: 35.7k, False: 5.70M]
  ------------------
  774|  35.7k|			size_t span_nb = 0, bt;
  775|  35.7k|			size_t tmp_i = 0;
  776|       |
  777|       |			/* counting the number of opening backticks */
  778|   147k|			while (i < size && data[i] == '`') {
  ------------------
  |  Branch (778:11): [True: 146k, False: 872]
  |  Branch (778:23): [True: 112k, False: 34.8k]
  ------------------
  779|   112k|				i++; span_nb++;
  780|   112k|			}
  781|       |
  782|  35.7k|			if (i >= size) return 0;
  ------------------
  |  Branch (782:8): [True: 872, False: 34.8k]
  ------------------
  783|       |
  784|       |			/* finding the matching closing sequence */
  785|  34.8k|			bt = 0;
  786|   131M|			while (i < size && bt < span_nb) {
  ------------------
  |  Branch (786:11): [True: 131M, False: 11.5k]
  |  Branch (786:23): [True: 131M, False: 23.3k]
  ------------------
  787|   131M|				if (!tmp_i && data[i] == c) tmp_i = i;
  ------------------
  |  Branch (787:9): [True: 51.2M, False: 80.6M]
  |  Branch (787:19): [True: 12.2k, False: 51.2M]
  ------------------
  788|   131M|				if (data[i] == '`') bt++;
  ------------------
  |  Branch (788:9): [True: 100k, False: 131M]
  ------------------
  789|   131M|				else bt = 0;
  790|   131M|				i++;
  791|   131M|			}
  792|       |
  793|       |			/* not a well-formed codespan; use found matching emph char */
  794|  34.8k|			if (bt < span_nb && i >= size) return tmp_i;
  ------------------
  |  Branch (794:8): [True: 11.3k, False: 23.4k]
  |  Branch (794:24): [True: 11.3k, False: 0]
  ------------------
  795|  34.8k|		}
  796|       |		/* skipping a link */
  797|  5.70M|		else if (data[i] == '[') {
  ------------------
  |  Branch (797:12): [True: 5.70M, False: 0]
  ------------------
  798|  5.70M|			size_t tmp_i = 0;
  799|  5.70M|			uint8_t cc;
  800|       |
  801|  5.70M|			i++;
  802|   488M|			while (i < size && data[i] != ']') {
  ------------------
  |  Branch (802:11): [True: 488M, False: 197k]
  |  Branch (802:23): [True: 482M, False: 5.51M]
  ------------------
  803|   482M|				if (!tmp_i && data[i] == c) tmp_i = i;
  ------------------
  |  Branch (803:9): [True: 452M, False: 30.7M]
  |  Branch (803:19): [True: 132k, False: 451M]
  ------------------
  804|   482M|				i++;
  805|   482M|			}
  806|       |
  807|  5.70M|			i++;
  808|  23.4M|			while (i < size && _isspace(data[i]))
  ------------------
  |  Branch (808:11): [True: 23.2M, False: 235k]
  |  Branch (808:23): [True: 17.7M, False: 5.47M]
  ------------------
  809|  17.7M|				i++;
  810|       |
  811|  5.70M|			if (i >= size)
  ------------------
  |  Branch (811:8): [True: 235k, False: 5.47M]
  ------------------
  812|   235k|				return tmp_i;
  813|       |
  814|  5.47M|			switch (data[i]) {
  815|   829k|			case '[':
  ------------------
  |  Branch (815:4): [True: 829k, False: 4.64M]
  ------------------
  816|   829k|				cc = ']'; break;
  817|       |
  818|  15.8k|			case '(':
  ------------------
  |  Branch (818:4): [True: 15.8k, False: 5.45M]
  ------------------
  819|  15.8k|				cc = ')'; break;
  820|       |
  821|  4.62M|			default:
  ------------------
  |  Branch (821:4): [True: 4.62M, False: 845k]
  ------------------
  822|  4.62M|				if (tmp_i)
  ------------------
  |  Branch (822:9): [True: 24.7k, False: 4.60M]
  ------------------
  823|  24.7k|					return tmp_i;
  824|  4.60M|				else
  825|  4.60M|					continue;
  826|  5.47M|			}
  827|       |
  828|   845k|			i++;
  829|  68.7M|			while (i < size && data[i] != cc) {
  ------------------
  |  Branch (829:11): [True: 68.7M, False: 17.7k]
  |  Branch (829:23): [True: 67.9M, False: 827k]
  ------------------
  830|  67.9M|				if (!tmp_i && data[i] == c) tmp_i = i;
  ------------------
  |  Branch (830:9): [True: 29.7M, False: 38.1M]
  |  Branch (830:19): [True: 10.1k, False: 29.7M]
  ------------------
  831|  67.9M|				i++;
  832|  67.9M|			}
  833|       |
  834|   845k|			if (i >= size)
  ------------------
  |  Branch (834:8): [True: 17.7k, False: 827k]
  ------------------
  835|  17.7k|				return tmp_i;
  836|       |
  837|   827k|			i++;
  838|   827k|		}
  839|  5.74M|	}
  840|       |
  841|  21.4k|	return 0;
  842|  2.18M|}
document.c:is_escaped:
  735|  43.5M|{
  736|  43.5M|	size_t i = loc;
  737|  43.6M|	while (i >= 1 && data[i - 1] == '\\')
  ------------------
  |  Branch (737:9): [True: 42.3M, False: 1.27M]
  |  Branch (737:19): [True: 99.5k, False: 42.2M]
  ------------------
  738|  99.5k|		i--;
  739|       |
  740|       |	/* odd numbers of backslashes escapes data[loc] */
  741|  43.5M|	return (loc - i) % 2;
  742|  43.5M|}
document.c:parse_emph2:
  914|  44.2k|{
  915|  44.2k|	size_t i = 0, len;
  916|  44.2k|	hoedown_buffer *work = 0;
  917|  44.2k|	int r;
  918|       |
  919|  70.9k|	while (i < size) {
  ------------------
  |  Branch (919:9): [True: 70.5k, False: 401]
  ------------------
  920|  70.5k|		len = find_emph_char(data + i, size - i, c);
  921|  70.5k|		if (!len) return 0;
  ------------------
  |  Branch (921:7): [True: 28.7k, False: 41.7k]
  ------------------
  922|  41.7k|		i += len;
  923|       |
  924|  41.7k|		if (i + 1 < size && data[i] == c && data[i + 1] == c && i && !_isspace(data[i - 1])) {
  ------------------
  |  Branch (924:7): [True: 41.3k, False: 401]
  |  Branch (924:23): [True: 41.3k, False: 0]
  |  Branch (924:39): [True: 29.7k, False: 11.6k]
  |  Branch (924:59): [True: 29.7k, False: 0]
  |  Branch (924:64): [True: 15.1k, False: 14.6k]
  ------------------
  925|  15.1k|			work = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  15.1k|#define BUFFER_SPAN 1
  ------------------
  926|  15.1k|			parse_inline(work, doc, data, i);
  927|       |
  928|  15.1k|			if (c == '~')
  ------------------
  |  Branch (928:8): [True: 4.97k, False: 10.1k]
  ------------------
  929|  4.97k|				r = doc->md.strikethrough(ob, work, &doc->data);
  930|  10.1k|			else if (c == '=')
  ------------------
  |  Branch (930:13): [True: 612, False: 9.53k]
  ------------------
  931|    612|				r = doc->md.highlight(ob, work, &doc->data);
  932|  9.53k|			else
  933|  9.53k|				r = doc->md.double_emphasis(ob, work, &doc->data);
  934|       |
  935|  15.1k|			popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  15.1k|#define BUFFER_SPAN 1
  ------------------
  936|  15.1k|			return r ? i + 2 : 0;
  ------------------
  |  Branch (936:11): [True: 8.01k, False: 7.10k]
  ------------------
  937|  15.1k|		}
  938|  26.6k|		i++;
  939|  26.6k|	}
  940|    401|	return 0;
  941|  44.2k|}
document.c:parse_emph3:
  947|  74.6k|{
  948|  74.6k|	size_t i = 0, len;
  949|  74.6k|	int r;
  950|       |
  951|   122k|	while (i < size) {
  ------------------
  |  Branch (951:9): [True: 122k, False: 0]
  ------------------
  952|   122k|		len = find_emph_char(data + i, size - i, c);
  953|   122k|		if (!len) return 0;
  ------------------
  |  Branch (953:7): [True: 56.7k, False: 65.7k]
  ------------------
  954|  65.7k|		i += len;
  955|       |
  956|       |		/* skip spacing preceded symbols */
  957|  65.7k|		if (data[i] != c || _isspace(data[i - 1]))
  ------------------
  |  Branch (957:7): [True: 0, False: 65.7k]
  |  Branch (957:23): [True: 47.8k, False: 17.9k]
  ------------------
  958|  47.8k|			continue;
  959|       |
  960|  17.9k|		if (i + 2 < size && data[i + 1] == c && data[i + 2] == c && doc->md.triple_emphasis) {
  ------------------
  |  Branch (960:7): [True: 17.3k, False: 609]
  |  Branch (960:23): [True: 10.6k, False: 6.66k]
  |  Branch (960:43): [True: 1.55k, False: 9.08k]
  |  Branch (960:63): [True: 1.55k, False: 0]
  ------------------
  961|       |			/* triple symbol found */
  962|  1.55k|			hoedown_buffer *work = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  1.55k|#define BUFFER_SPAN 1
  ------------------
  963|       |
  964|  1.55k|			parse_inline(work, doc, data, i);
  965|  1.55k|			r = doc->md.triple_emphasis(ob, work, &doc->data);
  966|  1.55k|			popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  1.55k|#define BUFFER_SPAN 1
  ------------------
  967|  1.55k|			return r ? i + 3 : 0;
  ------------------
  |  Branch (967:11): [True: 1.34k, False: 216]
  ------------------
  968|       |
  969|  16.3k|		} else if (i + 1 < size && data[i + 1] == c) {
  ------------------
  |  Branch (969:14): [True: 16.0k, False: 300]
  |  Branch (969:30): [True: 9.10k, False: 6.95k]
  ------------------
  970|       |			/* double symbol found, handing over to emph1 */
  971|  9.10k|			len = parse_emph1(ob, doc, data - 2, size + 2, c);
  972|  9.10k|			if (!len) return 0;
  ------------------
  |  Branch (972:8): [True: 9.10k, False: 0]
  ------------------
  973|      0|			else return len - 2;
  974|       |
  975|  9.10k|		} else {
  976|       |			/* single symbol found, handing over to emph2 */
  977|  7.25k|			len = parse_emph2(ob, doc, data - 1, size + 1, c);
  978|  7.25k|			if (!len) return 0;
  ------------------
  |  Branch (978:8): [True: 7.25k, False: 0]
  ------------------
  979|      0|			else return len - 1;
  980|  7.25k|		}
  981|  17.9k|	}
  982|      0|	return 0;
  983|  74.6k|}
document.c:char_codespan:
 1084|   132k|{
 1085|   132k|	hoedown_buffer work = { NULL, 0, 0, 0, NULL, NULL, NULL };
 1086|   132k|	size_t end, nb = 0, i, f_begin, f_end;
 1087|       |
 1088|       |	/* counting the number of backticks in the delimiter */
 1089|   221M|	while (nb < size && data[nb] == '`')
  ------------------
  |  Branch (1089:9): [True: 221M, False: 30.2k]
  |  Branch (1089:22): [True: 221M, False: 102k]
  ------------------
 1090|   221M|		nb++;
 1091|       |
 1092|       |	/* finding the next delimiter */
 1093|   132k|	i = 0;
 1094|   173M|	for (end = nb; end < size && i < nb; end++) {
  ------------------
  |  Branch (1094:17): [True: 173M, False: 110k]
  |  Branch (1094:31): [True: 173M, False: 22.5k]
  ------------------
 1095|   173M|		if (data[end] == '`') {
  ------------------
  |  Branch (1095:7): [True: 35.8M, False: 137M]
  ------------------
 1096|  35.8M|			if (end + 1 == size || !is_escaped(data, end)) {
  ------------------
  |  Branch (1096:8): [True: 9.91k, False: 35.8M]
  |  Branch (1096:27): [True: 35.8M, False: 313]
  ------------------
 1097|  35.8M|				i++;
 1098|  35.8M|			} else {
 1099|    313|				i = 0;
 1100|    313|			}
 1101|  35.8M|		}
 1102|   137M|		else i = 0;
 1103|   173M|	}
 1104|       |
 1105|   132k|	if (i < nb && end >= size)
  ------------------
  |  Branch (1105:6): [True: 108k, False: 24.8k]
  |  Branch (1105:16): [True: 108k, False: 0]
  ------------------
 1106|   108k|		return 0; /* no matching delimiter */
 1107|       |
 1108|       |	/* trimming outside whitespace */
 1109|  24.8k|	f_begin = nb;
 1110|   874k|	while (f_begin < end && (data[f_begin] == ' ' || data[f_begin] == '\n'))
  ------------------
  |  Branch (1110:9): [True: 874k, False: 0]
  |  Branch (1110:27): [True: 844k, False: 30.2k]
  |  Branch (1110:51): [True: 5.42k, False: 24.8k]
  ------------------
 1111|   849k|		f_begin++;
 1112|       |
 1113|  24.8k|	f_end = end - nb;
 1114|   331k|	while (f_end > nb && (data[f_end-1] == ' ' || data[f_end-1] == '\n'))
  ------------------
  |  Branch (1114:9): [True: 327k, False: 4.59k]
  |  Branch (1114:24): [True: 300k, False: 26.5k]
  |  Branch (1114:48): [True: 6.26k, False: 20.2k]
  ------------------
 1115|   306k|		f_end--;
 1116|       |
 1117|       |	/* real code span */
 1118|  24.8k|	if (f_begin < f_end) {
  ------------------
  |  Branch (1118:6): [True: 20.2k, False: 4.59k]
  ------------------
 1119|       |		/* needed for parse_attribute functions as buffer functions do not work with
 1120|       |		 * buffers made on the stack */
 1121|  20.2k|		hoedown_buffer *attr = newbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  20.2k|#define BUFFER_ATTRIBUTE 2
  ------------------
 1122|       |
 1123|  20.2k|		work.data = data + f_begin;
 1124|  20.2k|		work.size = f_end - f_begin;
 1125|       |
 1126|  20.2k|		if (doc->ext_flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE) {
  ------------------
  |  Branch (1126:7): [True: 20.2k, False: 0]
  ------------------
 1127|  20.2k|			end += parse_inline_attributes(data + end, size - end, attr, doc->attr_activation);
 1128|  20.2k|		}
 1129|       |
 1130|  20.2k|		if (!doc->md.codespan(ob, &work, attr, &doc->data))
  ------------------
  |  Branch (1130:7): [True: 0, False: 20.2k]
  ------------------
 1131|      0|			end = 0;
 1132|  20.2k|		popbuf(doc, BUFFER_ATTRIBUTE);
  ------------------
  |  |   20|  20.2k|#define BUFFER_ATTRIBUTE 2
  ------------------
 1133|  20.2k|	} else {
 1134|  4.59k|		if (!doc->md.codespan(ob, 0, 0, &doc->data))
  ------------------
  |  Branch (1134:7): [True: 0, False: 4.59k]
  ------------------
 1135|      0|			end = 0;
 1136|  4.59k|	}
 1137|       |
 1138|  24.8k|	return end;
 1139|   132k|}
document.c:char_linebreak:
 1069|   619k|{
 1070|   619k|	if (offset < 2 || data[-1] != ' ' || data[-2] != ' ')
  ------------------
  |  Branch (1070:6): [True: 125k, False: 494k]
  |  Branch (1070:20): [True: 324k, False: 169k]
  |  Branch (1070:39): [True: 141k, False: 28.4k]
  ------------------
 1071|   590k|		return 0;
 1072|       |
 1073|       |	/* removing the last space from ob and rendering */
 1074|   996k|	while (ob->size && ob->data[ob->size - 1] == ' ')
  ------------------
  |  Branch (1074:9): [True: 996k, False: 505]
  |  Branch (1074:21): [True: 968k, False: 27.9k]
  ------------------
 1075|   968k|		ob->size--;
 1076|       |
 1077|  28.4k|	return doc->md.linebreak(ob, &doc->data) ? 1 : 0;
  ------------------
  |  Branch (1077:9): [True: 28.4k, False: 0]
  ------------------
 1078|   619k|}
document.c:char_link:
 1383|  1.24M|{
 1384|  1.24M|	int is_img = (offset && data[-1] == '!' && !is_escaped(data - offset, offset - 1));
  ------------------
  |  Branch (1384:16): [True: 1.04M, False: 200k]
  |  Branch (1384:26): [True: 92.7k, False: 952k]
  |  Branch (1384:45): [True: 92.7k, False: 0]
  ------------------
 1385|  1.24M|	int is_footnote = (doc->ext_flags & HOEDOWN_EXT_FOOTNOTES && size > 1 && data[1] == '^');
  ------------------
  |  Branch (1385:21): [True: 1.24M, False: 0]
  |  Branch (1385:63): [True: 1.23M, False: 12.4k]
  |  Branch (1385:75): [True: 64.5k, False: 1.16M]
  ------------------
 1386|  1.24M|	size_t i = 1, txt_e, link_b = 0, link_e = 0, title_b = 0, title_e = 0;
 1387|  1.24M|	hoedown_buffer *content = NULL;
 1388|  1.24M|	hoedown_buffer *link = NULL;
 1389|  1.24M|	hoedown_buffer *title = NULL;
 1390|  1.24M|	hoedown_buffer *u_link = NULL;
 1391|  1.24M|	hoedown_buffer *inline_attr = NULL;
 1392|  1.24M|	hoedown_buffer *ref_attr = NULL;
 1393|  1.24M|	hoedown_buffer *attr = NULL;
 1394|  1.24M|	hoedown_buffer *id = NULL;
 1395|  1.24M|	size_t org_work_size = doc->work_bufs[BUFFER_SPAN].size;
  ------------------
  |  |   19|  1.24M|#define BUFFER_SPAN 1
  ------------------
 1396|  1.24M|	int ret = 0, in_title = 0, qtype = 0;
 1397|  1.24M|	hoedown_link_type link_type = HOEDOWN_LINK_NONE;
 1398|  1.24M|	int ref_attr_exists = 0, inline_attr_exists = 0;
 1399|       |
 1400|       |	/* checking whether the correct renderer exists */
 1401|  1.24M|	if ((is_footnote && !doc->md.footnote_ref) || (is_img && !doc->md.image)
  ------------------
  |  Branch (1401:7): [True: 64.5k, False: 1.18M]
  |  Branch (1401:22): [True: 0, False: 64.5k]
  |  Branch (1401:49): [True: 92.7k, False: 1.15M]
  |  Branch (1401:59): [True: 0, False: 92.7k]
  ------------------
 1402|  1.24M|		|| (!is_img && !is_footnote && !doc->md.link))
  ------------------
  |  Branch (1402:7): [True: 1.15M, False: 92.7k]
  |  Branch (1402:18): [True: 1.08M, False: 63.8k]
  |  Branch (1402:34): [True: 0, False: 1.08M]
  ------------------
 1403|      0|		goto cleanup;
 1404|       |
 1405|       |	/* looking for the matching closing bracket */
 1406|  1.24M|	i += find_emph_char(data + i, size - i, ']');
 1407|  1.24M|	txt_e = i;
 1408|       |
 1409|  1.24M|	if (i < size && data[i] == ']') i++;
  ------------------
  |  Branch (1409:6): [True: 1.23M, False: 12.4k]
  |  Branch (1409:18): [True: 1.00M, False: 226k]
  ------------------
 1410|   239k|	else goto cleanup;
 1411|       |
 1412|       |	/* footnote link */
 1413|  1.00M|	if (is_footnote) {
  ------------------
  |  Branch (1413:6): [True: 55.6k, False: 951k]
  ------------------
 1414|  55.6k|		hoedown_buffer id = { NULL, 0, 0, 0, NULL, NULL, NULL };
 1415|  55.6k|		struct footnote_ref *fr;
 1416|       |
 1417|  55.6k|		if (txt_e < 3)
  ------------------
  |  Branch (1417:7): [True: 43.1k, False: 12.4k]
  ------------------
 1418|  43.1k|			goto cleanup;
 1419|       |
 1420|  12.4k|		id.data = data + 2;
 1421|  12.4k|		id.size = txt_e - 2;
 1422|       |
 1423|  12.4k|		fr = find_footnote_ref(&doc->footnotes_found, id.data, id.size);
 1424|       |
 1425|       |		/* mark footnote used */
 1426|  12.4k|		if (fr && !fr->is_used) {
  ------------------
  |  Branch (1426:7): [True: 4.53k, False: 7.95k]
  |  Branch (1426:13): [True: 1.08k, False: 3.45k]
  ------------------
 1427|  1.08k|			if(!add_footnote_ref(&doc->footnotes_used, fr))
  ------------------
  |  Branch (1427:7): [True: 0, False: 1.08k]
  ------------------
 1428|      0|				goto cleanup;
 1429|  1.08k|			fr->is_used = 1;
 1430|  1.08k|			fr->num = doc->footnotes_used.count;
 1431|       |
 1432|       |			/* render */
 1433|  1.08k|			if (doc->md.footnote_ref) {
  ------------------
  |  Branch (1433:8): [True: 1.08k, False: 0]
  ------------------
 1434|  1.08k|				doc->link_id = &id;
 1435|  1.08k|				ret = doc->md.footnote_ref(ob, fr->num, &doc->data);
 1436|  1.08k|				doc->link_id = NULL;
 1437|  1.08k|			}
 1438|  1.08k|		}
 1439|       |
 1440|  12.4k|		goto cleanup;
 1441|  12.4k|	}
 1442|       |
 1443|       |	/* skip any amount of spacing */
 1444|       |	/* (this is much more laxist than original markdown syntax) */
 1445|  2.58M|	while (i < size && _isspace(data[i]))
  ------------------
  |  Branch (1445:9): [True: 2.51M, False: 76.5k]
  |  Branch (1445:21): [True: 1.63M, False: 874k]
  ------------------
 1446|  1.63M|		i++;
 1447|       |
 1448|       |	/* inline style link */
 1449|   951k|	if (i < size && data[i] == '(') {
  ------------------
  |  Branch (1449:6): [True: 874k, False: 76.5k]
  |  Branch (1449:18): [True: 20.4k, False: 854k]
  ------------------
 1450|  20.4k|		size_t nb_p;
 1451|       |
 1452|  20.4k|		link_type = HOEDOWN_LINK_INLINE;
 1453|       |
 1454|       |		/* skipping initial spacing */
 1455|  20.4k|		i++;
 1456|       |
 1457|   769k|		while (i < size && _isspace(data[i]))
  ------------------
  |  Branch (1457:10): [True: 767k, False: 2.33k]
  |  Branch (1457:22): [True: 749k, False: 18.1k]
  ------------------
 1458|   749k|			i++;
 1459|       |
 1460|  20.4k|		link_b = i;
 1461|       |
 1462|       |		/* looking for link end: ' " ) */
 1463|       |		/* Count the number of open parenthesis */
 1464|  20.4k|		nb_p = 0;
 1465|       |
 1466|  48.0M|		while (i < size) {
  ------------------
  |  Branch (1466:10): [True: 48.0M, False: 6.83k]
  ------------------
 1467|  48.0M|			if (data[i] == '\\') i += 2;
  ------------------
  |  Branch (1467:8): [True: 46.3k, False: 47.9M]
  ------------------
 1468|  47.9M|			else if (data[i] == '(' && i != 0) {
  ------------------
  |  Branch (1468:13): [True: 123k, False: 47.8M]
  |  Branch (1468:31): [True: 123k, False: 0]
  ------------------
 1469|   123k|				nb_p++; i++;
 1470|   123k|			}
 1471|  47.8M|			else if (data[i] == ')') {
  ------------------
  |  Branch (1471:13): [True: 19.6k, False: 47.8M]
  ------------------
 1472|  19.6k|				if (nb_p == 0) break;
  ------------------
  |  Branch (1472:9): [True: 3.51k, False: 16.1k]
  ------------------
 1473|  16.1k|				nb_p--; i++;
 1474|  47.8M|			} else if (i >= 1 && _isspace(data[i-1]) && (data[i] == '\'' || data[i] == '"')) break;
  ------------------
  |  Branch (1474:15): [True: 47.8M, False: 0]
  |  Branch (1474:25): [True: 45.7M, False: 2.07M]
  |  Branch (1474:49): [True: 2.97k, False: 45.7M]
  |  Branch (1474:68): [True: 7.14k, False: 45.7M]
  ------------------
 1475|  47.8M|			else i++;
 1476|  48.0M|		}
 1477|       |
 1478|  20.4k|		if (i >= size) goto cleanup;
  ------------------
  |  Branch (1478:7): [True: 6.83k, False: 13.6k]
  ------------------
 1479|  13.6k|		link_e = i;
 1480|       |
 1481|       |		/* looking for title end if present */
 1482|  13.6k|		if (data[i] == '\'' || data[i] == '"') {
  ------------------
  |  Branch (1482:7): [True: 2.97k, False: 10.6k]
  |  Branch (1482:26): [True: 7.14k, False: 3.51k]
  ------------------
 1483|  10.1k|			qtype = data[i];
 1484|  10.1k|			in_title = 1;
 1485|  10.1k|			i++;
 1486|  10.1k|			title_b = i;
 1487|       |
 1488|   883M|			while (i < size) {
  ------------------
  |  Branch (1488:11): [True: 883M, False: 4.89k]
  ------------------
 1489|   883M|				if (data[i] == '\\') i += 2;
  ------------------
  |  Branch (1489:9): [True: 3.99k, False: 883M]
  ------------------
 1490|   883M|				else if (data[i] == qtype) {in_title = 0; i++;}
  ------------------
  |  Branch (1490:14): [True: 11.6k, False: 883M]
  ------------------
 1491|   883M|				else if ((data[i] == ')') && !in_title) break;
  ------------------
  |  Branch (1491:14): [True: 11.2k, False: 883M]
  |  Branch (1491:34): [True: 5.22k, False: 6.03k]
  ------------------
 1492|   883M|				else i++;
 1493|   883M|			}
 1494|       |
 1495|  10.1k|			if (i >= size) goto cleanup;
  ------------------
  |  Branch (1495:8): [True: 4.89k, False: 5.22k]
  ------------------
 1496|       |
 1497|       |			/* skipping spacing after title */
 1498|  5.22k|			title_e = i - 1;
 1499|  73.8k|			while (title_e > title_b && _isspace(data[title_e]))
  ------------------
  |  Branch (1499:11): [True: 70.6k, False: 3.22k]
  |  Branch (1499:32): [True: 68.6k, False: 2.00k]
  ------------------
 1500|  68.6k|				title_e--;
 1501|       |
 1502|       |			/* checking for closing quote presence */
 1503|  5.22k|			if (data[title_e] != '\'' &&  data[title_e] != '"') {
  ------------------
  |  Branch (1503:8): [True: 4.04k, False: 1.17k]
  |  Branch (1503:34): [True: 673, False: 3.37k]
  ------------------
 1504|    673|				title_b = title_e = 0;
 1505|    673|				link_e = i;
 1506|    673|			}
 1507|  5.22k|		}
 1508|       |
 1509|       |		/* remove spacing at the end of the link */
 1510|  53.5k|		while (link_e > link_b && _isspace(data[link_e - 1]))
  ------------------
  |  Branch (1510:10): [True: 47.0k, False: 6.47k]
  |  Branch (1510:29): [True: 44.8k, False: 2.27k]
  ------------------
 1511|  44.8k|			link_e--;
 1512|       |
 1513|       |		/* remove optional angle brackets around the link */
 1514|  8.74k|		if (data[link_b] == '<' && data[link_e - 1] == '>') {
  ------------------
  |  Branch (1514:7): [True: 714, False: 8.02k]
  |  Branch (1514:30): [True: 326, False: 388]
  ------------------
 1515|    326|			link_b++;
 1516|    326|			link_e--;
 1517|    326|		}
 1518|       |
 1519|       |		/* building escaped link and title */
 1520|  8.74k|		if (link_e > link_b) {
  ------------------
  |  Branch (1520:7): [True: 1.94k, False: 6.79k]
  ------------------
 1521|  1.94k|			link = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  1.94k|#define BUFFER_SPAN 1
  ------------------
 1522|  1.94k|			hoedown_buffer_put(link, data + link_b, link_e - link_b);
 1523|  1.94k|		}
 1524|       |
 1525|  8.74k|		if (title_e > title_b) {
  ------------------
  |  Branch (1525:7): [True: 1.33k, False: 7.40k]
  ------------------
 1526|  1.33k|			title = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  1.33k|#define BUFFER_SPAN 1
  ------------------
 1527|  1.33k|			hoedown_buffer_put(title, data + title_b, title_e - title_b);
 1528|  1.33k|		}
 1529|       |
 1530|  8.74k|		i++;
 1531|  8.74k|	}
 1532|       |
 1533|       |	/* reference style link */
 1534|   930k|	else if (i < size && data[i] == '[') {
  ------------------
  |  Branch (1534:11): [True: 854k, False: 76.5k]
  |  Branch (1534:23): [True: 135k, False: 718k]
  ------------------
 1535|   135k|		struct link_ref *lr;
 1536|       |
 1537|   135k|		id = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   135k|#define BUFFER_SPAN 1
  ------------------
 1538|       |
 1539|       |		/* looking for the id */
 1540|   135k|		i++;
 1541|   135k|		link_b = i;
 1542|  2.33M|		while (i < size && data[i] != ']') i++;
  ------------------
  |  Branch (1542:10): [True: 2.33M, False: 3.16k]
  |  Branch (1542:22): [True: 2.20M, False: 132k]
  ------------------
 1543|   135k|		if (i >= size) goto cleanup;
  ------------------
  |  Branch (1543:7): [True: 3.16k, False: 132k]
  ------------------
 1544|   132k|		link_e = i;
 1545|       |
 1546|       |		/* finding the link_ref */
 1547|   132k|		if (link_b == link_e) {
  ------------------
  |  Branch (1547:7): [True: 95.2k, False: 37.5k]
  ------------------
 1548|  95.2k|			link_type = HOEDOWN_LINK_EMPTY_REFERENCE;
 1549|  95.2k|			replace_spacing(id, data + 1, txt_e - 1);
 1550|  95.2k|		} else {
 1551|  37.5k|			link_type = HOEDOWN_LINK_REFERENCE;
 1552|  37.5k|			hoedown_buffer_put(id, data + link_b, link_e - link_b);
 1553|  37.5k|		}
 1554|       |
 1555|   132k|		lr = find_link_ref(doc->refs, id->data, id->size);
 1556|   132k|		if (!lr)
  ------------------
  |  Branch (1556:7): [True: 127k, False: 5.69k]
  ------------------
 1557|   127k|			goto cleanup;
 1558|       |
 1559|       |		/* keeping link and title from link_ref */
 1560|  5.69k|		link = lr->link;
 1561|  5.69k|		title = lr->title;
 1562|  5.69k|		ref_attr = lr->attr;
 1563|  5.69k|		i++;
 1564|  5.69k|	}
 1565|       |
 1566|       |	/* shortcut reference style link */
 1567|   794k|	else {
 1568|   794k|		struct link_ref *lr;
 1569|       |
 1570|   794k|		id = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   794k|#define BUFFER_SPAN 1
  ------------------
 1571|       |
 1572|   794k|		link_type = HOEDOWN_LINK_SHORTCUT;
 1573|       |
 1574|       |		/* crafting the id */
 1575|   794k|		replace_spacing(id, data + 1, txt_e - 1);
 1576|       |
 1577|       |		/* finding the link_ref */
 1578|   794k|		lr = find_link_ref(doc->refs, id->data, id->size);
 1579|   794k|		if (!lr)
  ------------------
  |  Branch (1579:7): [True: 495k, False: 298k]
  ------------------
 1580|   495k|			goto cleanup;
 1581|       |
 1582|       |		/* keeping link and title from link_ref */
 1583|   298k|		link = lr->link;
 1584|   298k|		title = lr->title;
 1585|   298k|		ref_attr = lr->attr;
 1586|       |
 1587|       |		/* rewinding the spacing */
 1588|   298k|		i = txt_e + 1;
 1589|   298k|	}
 1590|       |
 1591|       |	/* building content: img alt is kept, only link content is parsed */
 1592|   313k|	if (txt_e > 1) {
  ------------------
  |  Branch (1592:6): [True: 15.3k, False: 297k]
  ------------------
 1593|  15.3k|		content = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  15.3k|#define BUFFER_SPAN 1
  ------------------
 1594|  15.3k|		if (is_img) {
  ------------------
  |  Branch (1594:7): [True: 5.14k, False: 10.1k]
  ------------------
 1595|  5.14k|			hoedown_buffer_put(content, data + 1, txt_e - 1);
 1596|  10.1k|		} else {
 1597|       |			/* disable autolinking when parsing inline the
 1598|       |			 * content of a link */
 1599|  10.1k|			doc->in_link_body = 1;
 1600|  10.1k|			parse_inline(content, doc, data + 1, txt_e - 1);
 1601|  10.1k|			doc->in_link_body = 0;
 1602|  10.1k|		}
 1603|  15.3k|	}
 1604|       |
 1605|   313k|	if (link) {
  ------------------
  |  Branch (1605:6): [True: 306k, False: 6.79k]
  ------------------
 1606|   306k|		u_link = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   306k|#define BUFFER_SPAN 1
  ------------------
 1607|   306k|		unscape_text(u_link, link);
 1608|   306k|	}
 1609|       |
 1610|       |	/* if special attributes are enabled, attempt to parse an inline one from
 1611|       |	 * the link */
 1612|   313k|	if (doc->ext_flags & HOEDOWN_EXT_SPECIAL_ATTRIBUTE) {
  ------------------
  |  Branch (1612:6): [True: 313k, False: 0]
  ------------------
 1613|       |		/* attr is a span because cleanup code depends on it being span */
 1614|   313k|		inline_attr = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   313k|#define BUFFER_SPAN 1
  ------------------
 1615|   313k|		i += parse_inline_attributes(data + i, size - i, inline_attr, doc->attr_activation);
 1616|   313k|	}
 1617|       |
 1618|       |	/* remove optional < and > around inline and ref special attributes */
 1619|   313k|	if (ref_attr && ref_attr->size > 0) {
  ------------------
  |  Branch (1619:6): [True: 27.4k, False: 285k]
  |  Branch (1619:18): [True: 27.2k, False: 194]
  ------------------
 1620|  27.2k|		if (ref_attr->size > 1) {
  ------------------
  |  Branch (1620:7): [True: 5.29k, False: 21.9k]
  ------------------
 1621|  5.29k|			if (ref_attr->data[0] == '<') {
  ------------------
  |  Branch (1621:8): [True: 446, False: 4.84k]
  ------------------
 1622|    446|				hoedown_buffer_slurp(ref_attr, 1);
 1623|    446|			}
 1624|  5.29k|			if (ref_attr->data[ref_attr->size - 1] == '>') {
  ------------------
  |  Branch (1624:8): [True: 205, False: 5.09k]
  ------------------
 1625|    205|				ref_attr->size--;
 1626|    205|			}
 1627|  5.29k|		}
 1628|  27.2k|	}
 1629|   313k|	if (inline_attr && inline_attr->size > 0) {
  ------------------
  |  Branch (1629:6): [True: 313k, False: 0]
  |  Branch (1629:21): [True: 1.35k, False: 311k]
  ------------------
 1630|  1.35k|		if (inline_attr->size > 1) {
  ------------------
  |  Branch (1630:7): [True: 799, False: 556]
  ------------------
 1631|    799|			if (inline_attr->data[0] == '<') {
  ------------------
  |  Branch (1631:8): [True: 356, False: 443]
  ------------------
 1632|    356|				hoedown_buffer_slurp(inline_attr, 1);
 1633|    356|			}
 1634|    799|			if (inline_attr->data[inline_attr->size - 1] == '>') {
  ------------------
  |  Branch (1634:8): [True: 205, False: 594]
  ------------------
 1635|    205|				inline_attr->size--;
 1636|    205|			}
 1637|    799|		}
 1638|  1.35k|	}
 1639|       |
 1640|       |	/* construct the final attr that is actually applied to the link */
 1641|   313k|	ref_attr_exists = ref_attr && ref_attr->size > 0;
  ------------------
  |  Branch (1641:20): [True: 27.4k, False: 285k]
  |  Branch (1641:32): [True: 27.1k, False: 204]
  ------------------
 1642|   313k|	inline_attr_exists = inline_attr && inline_attr->size > 0;
  ------------------
  |  Branch (1642:23): [True: 313k, False: 0]
  |  Branch (1642:38): [True: 1.17k, False: 312k]
  ------------------
 1643|   313k|	if (ref_attr_exists || inline_attr_exists) {
  ------------------
  |  Branch (1643:6): [True: 27.1k, False: 286k]
  |  Branch (1643:25): [True: 953, False: 285k]
  ------------------
 1644|  28.1k|		attr = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  28.1k|#define BUFFER_SPAN 1
  ------------------
 1645|  28.1k|		if (ref_attr_exists) {
  ------------------
  |  Branch (1645:7): [True: 27.1k, False: 953]
  ------------------
 1646|  27.1k|			hoedown_buffer_put(attr, ref_attr->data, ref_attr->size);
 1647|  27.1k|		}
 1648|       |		/* if both inline and ref attrs exist, join them with a space to prevent
 1649|       |		 * conflicts */
 1650|  28.1k|		if (ref_attr_exists && inline_attr_exists) {
  ------------------
  |  Branch (1650:7): [True: 27.1k, False: 953]
  |  Branch (1650:26): [True: 221, False: 26.9k]
  ------------------
 1651|    221|			hoedown_buffer_putc(attr, ' ');
 1652|    221|		}
 1653|  28.1k|		if (inline_attr_exists) {
  ------------------
  |  Branch (1653:7): [True: 1.17k, False: 26.9k]
  ------------------
 1654|  1.17k|			hoedown_buffer_put(attr, inline_attr->data, inline_attr->size);
 1655|  1.17k|		}
 1656|  28.1k|	}
 1657|       |
 1658|       |	/* calling the relevant rendering function */
 1659|   313k|	doc->link_id = id;
 1660|   313k|	doc->link_type = link_type;
 1661|   313k|	doc->link_ref_attr = ref_attr;
 1662|   313k|	doc->link_inline_attr = inline_attr;
 1663|   313k|	if (is_img) {
  ------------------
  |  Branch (1663:6): [True: 11.2k, False: 302k]
  ------------------
 1664|  11.2k|		ret = doc->md.image(ob, u_link, title, content, attr, &doc->data);
 1665|   302k|	} else {
 1666|   302k|		ret = doc->md.link(ob, content, u_link, title, attr, &doc->data);
 1667|   302k|	}
 1668|   313k|	doc->link_inline_attr = NULL;
 1669|   313k|	doc->link_ref_attr = NULL;
 1670|   313k|	doc->link_type = HOEDOWN_LINK_NONE;
 1671|   313k|	doc->link_id = NULL;
 1672|       |
 1673|       |	/* cleanup */
 1674|  1.24M|cleanup:
 1675|  1.24M|	doc->work_bufs[BUFFER_SPAN].size = (int)org_work_size;
  ------------------
  |  |   19|  1.24M|#define BUFFER_SPAN 1
  ------------------
 1676|  1.24M|	return ret ? i : 0;
  ------------------
  |  Branch (1676:9): [True: 309k, False: 937k]
  ------------------
 1677|   313k|}
document.c:find_footnote_ref:
  302|  12.4k|{
  303|  12.4k|	unsigned int hash = hash_link_ref(name, length);
  304|  12.4k|	struct footnote_item *item = NULL;
  305|       |
  306|  12.4k|	item = list->head;
  307|       |
  308|  16.9M|	while (item != NULL) {
  ------------------
  |  Branch (308:9): [True: 16.9M, False: 7.95k]
  ------------------
  309|  16.9M|		if (item->ref->id == hash)
  ------------------
  |  Branch (309:7): [True: 4.53k, False: 16.9M]
  ------------------
  310|  4.53k|			return item->ref;
  311|  16.9M|		item = item->next;
  312|  16.9M|	}
  313|       |
  314|  7.95k|	return NULL;
  315|  12.4k|}
document.c:replace_spacing:
  373|   889k|{
  374|   889k|	size_t i = 0, mark;
  375|   889k|	hoedown_buffer_grow(ob, size);
  376|  2.70M|	while (1) {
  ------------------
  |  Branch (376:9): [True: 2.70M, Folded]
  ------------------
  377|  2.70M|		mark = i;
  378|  99.6M|		while (i < size && data[i] != '\n') i++;
  ------------------
  |  Branch (378:10): [True: 98.7M, False: 889k]
  |  Branch (378:22): [True: 96.9M, False: 1.81M]
  ------------------
  379|  2.70M|		hoedown_buffer_put(ob, data + mark, i - mark);
  380|       |
  381|  2.70M|		if (i >= size) break;
  ------------------
  |  Branch (381:7): [True: 889k, False: 1.81M]
  ------------------
  382|       |
  383|  1.81M|		if (!(i > 0 && data[i-1] == ' '))
  ------------------
  |  Branch (383:9): [True: 1.81M, False: 1.96k]
  |  Branch (383:18): [True: 1.56M, False: 246k]
  ------------------
  384|   248k|			hoedown_buffer_putc(ob, ' ');
  385|  1.81M|		i++;
  386|  1.81M|	}
  387|   889k|}
document.c:find_link_ref:
  235|   927k|{
  236|   927k|	unsigned int hash = hash_link_ref(name, length);
  237|   927k|	struct link_ref *ref = NULL;
  238|       |
  239|   927k|	ref = references[hash % REF_TABLE_SIZE];
  ------------------
  |  |   16|   927k|#define REF_TABLE_SIZE 8
  ------------------
  240|       |
  241|  15.2M|	while (ref != NULL) {
  ------------------
  |  Branch (241:9): [True: 14.6M, False: 623k]
  ------------------
  242|  14.6M|		if (ref->id == hash)
  ------------------
  |  Branch (242:7): [True: 304k, False: 14.3M]
  ------------------
  243|   304k|			return ref;
  244|       |
  245|  14.3M|		ref = ref->next;
  246|  14.3M|	}
  247|       |
  248|   623k|	return NULL;
  249|   927k|}
document.c:unscape_text:
  189|   312k|{
  190|   312k|	size_t i = 0, org;
  191|   319k|	while (i < src->size) {
  ------------------
  |  Branch (191:9): [True: 318k, False: 1.15k]
  ------------------
  192|   318k|		org = i;
  193|  23.8M|		while (i < src->size && src->data[i] != '\\')
  ------------------
  |  Branch (193:10): [True: 23.5M, False: 274k]
  |  Branch (193:27): [True: 23.5M, False: 43.9k]
  ------------------
  194|  23.5M|			i++;
  195|       |
  196|   318k|		if (i > org)
  ------------------
  |  Branch (196:7): [True: 275k, False: 42.7k]
  ------------------
  197|   275k|			hoedown_buffer_put(ob, src->data + org, i - org);
  198|       |
  199|   318k|		if (i + 1 >= src->size)
  ------------------
  |  Branch (199:7): [True: 311k, False: 7.45k]
  ------------------
  200|   311k|			break;
  201|       |
  202|  7.45k|		hoedown_buffer_putc(ob, src->data[i + 1]);
  203|  7.45k|		i += 2;
  204|  7.45k|	}
  205|   312k|}
document.c:char_image:
 1370|   141k|char_image(hoedown_buffer *ob, hoedown_document *doc, uint8_t *data, size_t offset, size_t size) {
 1371|   141k|	size_t ret;
 1372|       |
 1373|   141k|	if (size < 2 || data[1] != '[') return 0;
  ------------------
  |  Branch (1373:6): [True: 4.72k, False: 137k]
  |  Branch (1373:18): [True: 87.7k, False: 49.3k]
  ------------------
 1374|       |
 1375|  49.3k|	ret = char_link(ob, doc, data + 1, offset + 1, size - 1);
 1376|  49.3k|	if (!ret) return 0;
  ------------------
  |  Branch (1376:6): [True: 43.4k, False: 5.91k]
  ------------------
 1377|  5.91k|	return ret + 1;
 1378|  49.3k|}
document.c:char_langle_tag:
 1259|   272k|{
 1260|   272k|	hoedown_buffer work = { NULL, 0, 0, 0, NULL, NULL, NULL };
 1261|   272k|	hoedown_autolink_type altype = HOEDOWN_AUTOLINK_NONE;
 1262|   272k|	size_t end = tag_length(data, size, &altype, doc->ext_flags & HOEDOWN_EXT_SCRIPT_TAGS);
 1263|   272k|	int ret = 0;
 1264|       |
 1265|   272k|	work.data = data;
 1266|   272k|	work.size = end;
 1267|       |
 1268|   272k|	if (end > 2) {
  ------------------
  |  Branch (1268:6): [True: 53.4k, False: 218k]
  ------------------
 1269|  53.4k|		if (doc->md.autolink && altype != HOEDOWN_AUTOLINK_NONE) {
  ------------------
  |  Branch (1269:7): [True: 53.4k, False: 0]
  |  Branch (1269:27): [True: 5.72k, False: 47.7k]
  ------------------
 1270|  5.72k|			hoedown_buffer *u_link = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  5.72k|#define BUFFER_SPAN 1
  ------------------
 1271|  5.72k|			work.data = data + 1;
 1272|  5.72k|			work.size = end - 2;
 1273|  5.72k|			unscape_text(u_link, &work);
 1274|  5.72k|			ret = doc->md.autolink(ob, u_link, altype, &doc->data);
 1275|  5.72k|			popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  5.72k|#define BUFFER_SPAN 1
  ------------------
 1276|  5.72k|		}
 1277|  47.7k|		else if (doc->md.raw_html)
  ------------------
  |  Branch (1277:12): [True: 47.7k, False: 0]
  ------------------
 1278|  47.7k|			ret = doc->md.raw_html(ob, &work, &doc->data);
 1279|  53.4k|	}
 1280|       |
 1281|   272k|	if (!ret) return 0;
  ------------------
  |  Branch (1281:6): [True: 218k, False: 53.4k]
  ------------------
 1282|  53.4k|	else return end;
 1283|   272k|}
document.c:tag_length:
  463|   272k|{
  464|   272k|	size_t i, j;
  465|       |
  466|       |	/* a valid tag can't be shorter than 3 chars */
  467|   272k|	if (size < 3) return 0;
  ------------------
  |  Branch (467:6): [True: 13.8k, False: 258k]
  ------------------
  468|       |
  469|   258k|	if (data[0] != '<') return 0;
  ------------------
  |  Branch (469:6): [True: 0, False: 258k]
  ------------------
  470|       |
  471|       |	/* HTML comment, laxist form */
  472|   258k|	if (size > 5 && data[1] == '!' && data[2] == '-' && data[3] == '-') {
  ------------------
  |  Branch (472:6): [True: 234k, False: 23.4k]
  |  Branch (472:18): [True: 50.5k, False: 184k]
  |  Branch (472:36): [True: 40.9k, False: 9.60k]
  |  Branch (472:54): [True: 38.4k, False: 2.50k]
  ------------------
  473|  38.4k|		i = 5;
  474|       |
  475|  11.2M|		while (i < size && !(data[i - 2] == '-' && data[i - 1] == '-' && data[i] == '>'))
  ------------------
  |  Branch (475:10): [True: 11.1M, False: 25.3k]
  |  Branch (475:24): [True: 1.04M, False: 10.1M]
  |  Branch (475:46): [True: 491k, False: 555k]
  |  Branch (475:68): [True: 13.1k, False: 478k]
  ------------------
  476|  11.1M|			i++;
  477|       |
  478|  38.4k|		i++;
  479|       |
  480|  38.4k|		if (i <= size)
  ------------------
  |  Branch (480:7): [True: 13.1k, False: 25.3k]
  ------------------
  481|  13.1k|			return i;
  482|  38.4k|	}
  483|       |
  484|       |	/* begins with a '<' optionally followed by '/', followed by letter or number */
  485|   245k|	i = (data[1] == '/') ? 2 : 1;
  ------------------
  |  Branch (485:6): [True: 19.0k, False: 226k]
  ------------------
  486|       |
  487|   245k|	if (!isalnum(data[i])) {
  ------------------
  |  Branch (487:6): [True: 139k, False: 105k]
  ------------------
  488|   139k|		if (script_tag) {
  ------------------
  |  Branch (488:7): [True: 139k, False: 0]
  ------------------
  489|   139k|			return script_tag_length(data, size);
  490|   139k|		}
  491|      0|		return 0;
  492|   139k|	}
  493|       |
  494|       |	/* scheme test */
  495|   105k|	*autolink = HOEDOWN_AUTOLINK_NONE;
  496|       |
  497|       |	/* try to find the beginning of an URI */
  498|   529k|	while (i < size && (isalnum(data[i]) || data[i] == '.' || data[i] == '+' || data[i] == '-'))
  ------------------
  |  Branch (498:9): [True: 524k, False: 5.09k]
  |  Branch (498:22): [True: 399k, False: 124k]
  |  Branch (498:42): [True: 16.5k, False: 107k]
  |  Branch (498:60): [True: 533, False: 107k]
  |  Branch (498:78): [True: 6.72k, False: 100k]
  ------------------
  499|   423k|		i++;
  500|       |
  501|   105k|	if (i > 1 && i < size && data[i] == '@') {
  ------------------
  |  Branch (501:6): [True: 105k, False: 0]
  |  Branch (501:15): [True: 100k, False: 5.09k]
  |  Branch (501:27): [True: 3.09k, False: 97.4k]
  ------------------
  502|  3.09k|		if ((j = is_mail_autolink(data + i, size - i)) != 0) {
  ------------------
  |  Branch (502:7): [True: 443, False: 2.65k]
  ------------------
  503|    443|			*autolink = HOEDOWN_AUTOLINK_EMAIL;
  504|    443|			return i + j;
  505|    443|		}
  506|  3.09k|	}
  507|       |
  508|   105k|	if (i > 2 && i < size && data[i] == ':') {
  ------------------
  |  Branch (508:6): [True: 84.1k, False: 21.0k]
  |  Branch (508:15): [True: 79.0k, False: 5.09k]
  |  Branch (508:27): [True: 20.6k, False: 58.3k]
  ------------------
  509|  20.6k|		*autolink = HOEDOWN_AUTOLINK_NORMAL;
  510|  20.6k|		i++;
  511|  20.6k|	}
  512|       |
  513|       |	/* completing autolink test: no spacing or ' or " */
  514|   105k|	if (i >= size)
  ------------------
  |  Branch (514:6): [True: 5.11k, False: 100k]
  ------------------
  515|  5.11k|		*autolink = HOEDOWN_AUTOLINK_NONE;
  516|       |
  517|   100k|	else if (*autolink) {
  ------------------
  |  Branch (517:11): [True: 20.5k, False: 79.4k]
  ------------------
  518|  20.5k|		j = i;
  519|       |
  520|  19.1M|		while (i < size) {
  ------------------
  |  Branch (520:10): [True: 19.1M, False: 3.78k]
  ------------------
  521|  19.1M|			if (data[i] == '\\') i += 2;
  ------------------
  |  Branch (521:8): [True: 10.8k, False: 19.1M]
  ------------------
  522|  19.1M|			else if (data[i] == '>' || data[i] == '\'' ||
  ------------------
  |  Branch (522:13): [True: 5.28k, False: 19.1M]
  |  Branch (522:31): [True: 7.75k, False: 19.1M]
  ------------------
  523|  19.1M|					data[i] == '"' || data[i] == ' ' || data[i] == '\n')
  ------------------
  |  Branch (523:6): [True: 648, False: 19.1M]
  |  Branch (523:24): [True: 1.51k, False: 19.1M]
  |  Branch (523:42): [True: 1.60k, False: 19.1M]
  ------------------
  524|  16.8k|					break;
  525|  19.1M|			else i++;
  526|  19.1M|		}
  527|       |
  528|  20.5k|		if (i >= size) return 0;
  ------------------
  |  Branch (528:7): [True: 3.78k, False: 16.8k]
  ------------------
  529|  16.8k|		if (i > j && data[i] == '>') return i + 1;
  ------------------
  |  Branch (529:7): [True: 8.90k, False: 7.89k]
  |  Branch (529:16): [True: 5.28k, False: 3.62k]
  ------------------
  530|       |		/* one of the forbidden chars has been found */
  531|  11.5k|		*autolink = HOEDOWN_AUTOLINK_NONE;
  532|  11.5k|	}
  533|       |
  534|       |	/* looking for something looking like a tag end */
  535|   114M|	while (i < size && data[i] != '>') i++;
  ------------------
  |  Branch (535:9): [True: 113M, False: 64.1k]
  |  Branch (535:21): [True: 113M, False: 31.9k]
  ------------------
  536|  96.0k|	if (i >= size) return 0;
  ------------------
  |  Branch (536:6): [True: 64.1k, False: 31.9k]
  ------------------
  537|  31.9k|	return i + 1;
  538|  96.0k|}
document.c:is_mail_autolink:
  397|  3.09k|{
  398|  3.09k|	size_t i = 0, nb = 0;
  399|       |
  400|       |	/* address is assumed to be: [-@._a-zA-Z0-9]+ with exactly one '@' */
  401|  17.9k|	for (i = 0; i < size; ++i) {
  ------------------
  |  Branch (401:14): [True: 16.9k, False: 1.01k]
  ------------------
  402|  16.9k|		if (isalnum(data[i]))
  ------------------
  |  Branch (402:7): [True: 1.93k, False: 14.9k]
  ------------------
  403|  1.93k|			continue;
  404|       |
  405|  14.9k|		switch (data[i]) {
  406|  10.9k|			case '@':
  ------------------
  |  Branch (406:4): [True: 10.9k, False: 4.03k]
  ------------------
  407|  10.9k|				nb++;
  408|       |
  409|  11.5k|			case '-':
  ------------------
  |  Branch (409:4): [True: 607, False: 14.3k]
  ------------------
  410|  12.6k|			case '.':
  ------------------
  |  Branch (410:4): [True: 1.08k, False: 13.8k]
  ------------------
  411|  12.8k|			case '_':
  ------------------
  |  Branch (411:4): [True: 258, False: 14.7k]
  ------------------
  412|  12.8k|				break;
  413|       |
  414|    672|			case '>':
  ------------------
  |  Branch (414:4): [True: 672, False: 14.3k]
  ------------------
  415|    672|				return (nb == 1) ? i + 1 : 0;
  ------------------
  |  Branch (415:12): [True: 443, False: 229]
  ------------------
  416|       |
  417|  1.41k|			default:
  ------------------
  |  Branch (417:4): [True: 1.41k, False: 13.5k]
  ------------------
  418|  1.41k|				return 0;
  419|  14.9k|		}
  420|  14.9k|	}
  421|       |
  422|  1.01k|	return 0;
  423|  3.09k|}
document.c:char_escape:
 1191|   124k|{
 1192|   124k|	static const char *escape_chars = "\\`*_{}[]()#+-.!:|&<>^~=\"$";
 1193|   124k|	hoedown_buffer work = { 0, 0, 0, 0, NULL, NULL, NULL };
 1194|   124k|	size_t w;
 1195|       |
 1196|   124k|	if (size > 1) {
  ------------------
  |  Branch (1196:6): [True: 122k, False: 2.19k]
  ------------------
 1197|   122k|		if (data[1] == '\\' && (doc->ext_flags & HOEDOWN_EXT_MATH) &&
  ------------------
  |  Branch (1197:7): [True: 49.2k, False: 73.4k]
  |  Branch (1197:26): [True: 49.2k, False: 0]
  ------------------
 1198|  49.2k|			size > 2 && (data[2] == '(' || data[2] == '[')) {
  ------------------
  |  Branch (1198:4): [True: 48.5k, False: 669]
  |  Branch (1198:17): [True: 1.02k, False: 47.5k]
  |  Branch (1198:35): [True: 2.80k, False: 44.7k]
  ------------------
 1199|  3.82k|			const char *end = (data[2] == '[') ? "\\\\]" : "\\\\)";
  ------------------
  |  Branch (1199:22): [True: 2.80k, False: 1.02k]
  ------------------
 1200|  3.82k|			w = parse_math(ob, doc, data, offset, size, end, 3, data[2] == '[');
 1201|  3.82k|			if (w) return w;
  ------------------
  |  Branch (1201:8): [True: 360, False: 3.46k]
  ------------------
 1202|  3.82k|		}
 1203|       |
 1204|   122k|		if (strchr(escape_chars, data[1]) == NULL)
  ------------------
  |  Branch (1204:7): [True: 46.6k, False: 75.7k]
  ------------------
 1205|  46.6k|			return 0;
 1206|       |
 1207|  75.7k|		if (doc->md.normal_text) {
  ------------------
  |  Branch (1207:7): [True: 75.7k, False: 0]
  ------------------
 1208|  75.7k|			work.data = data + 1;
 1209|  75.7k|			work.size = 1;
 1210|  75.7k|			doc->is_escape_char = 1;
 1211|  75.7k|			doc->md.normal_text(ob, &work, &doc->data);
 1212|  75.7k|			doc->is_escape_char = 0;
 1213|  75.7k|		}
 1214|      0|		else hoedown_buffer_putc(ob, data[1]);
 1215|  75.7k|	} else if (size == 1) {
  ------------------
  |  Branch (1215:13): [True: 2.19k, False: 0]
  ------------------
 1216|  2.19k|		if (doc->md.normal_text) {
  ------------------
  |  Branch (1216:7): [True: 2.19k, False: 0]
  ------------------
 1217|  2.19k|			work.data = data;
 1218|  2.19k|			work.size = 1;
 1219|  2.19k|			doc->md.normal_text(ob, &work, &doc->data);
 1220|  2.19k|		}
 1221|      0|		else hoedown_buffer_putc(ob, data[0]);
 1222|  2.19k|	}
 1223|       |
 1224|  77.9k|	return 2;
 1225|   124k|}
document.c:parse_math:
  988|  60.6k|{
  989|  60.6k|	hoedown_buffer text = { NULL, 0, 0, 0, NULL, NULL, NULL };
  990|  60.6k|	size_t i = delimsz;
  991|       |
  992|  60.6k|	if (!doc->md.math)
  ------------------
  |  Branch (992:6): [True: 0, False: 60.6k]
  ------------------
  993|      0|		return 0;
  994|       |
  995|       |	/* find ending delimiter */
  996|   153k|	while (1) {
  ------------------
  |  Branch (996:9): [True: 153k, Folded]
  ------------------
  997|  74.1M|		while (i < size && data[i] != (uint8_t)end[0])
  ------------------
  |  Branch (997:10): [True: 74.1M, False: 32.0k]
  |  Branch (997:22): [True: 74.0M, False: 121k]
  ------------------
  998|  74.0M|			i++;
  999|       |
 1000|   153k|		if (i >= size)
  ------------------
  |  Branch (1000:7): [True: 32.0k, False: 121k]
  ------------------
 1001|  32.0k|			return 0;
 1002|       |
 1003|   121k|		if (!is_escaped(data, i) && !(i + delimsz > size)
  ------------------
  |  Branch (1003:7): [True: 78.3k, False: 42.8k]
  |  Branch (1003:31): [True: 77.5k, False: 835]
  ------------------
 1004|  77.5k|			&& memcmp(data + i, end, delimsz) == 0)
  ------------------
  |  Branch (1004:7): [True: 28.5k, False: 48.9k]
  ------------------
 1005|  28.5k|			break;
 1006|       |
 1007|  92.6k|		i++;
 1008|  92.6k|	}
 1009|       |
 1010|       |	/* prepare buffers */
 1011|  28.5k|	text.data = data + delimsz;
 1012|  28.5k|	text.size = i - delimsz;
 1013|       |
 1014|       |	/* if this is a $$ and MATH_EXPLICIT is not active,
 1015|       |	 * guess whether displaymode should be enabled from the context */
 1016|  28.5k|	i += delimsz;
 1017|  28.5k|	if (delimsz == 2 && !(doc->ext_flags & HOEDOWN_EXT_MATH_EXPLICIT))
  ------------------
  |  Branch (1017:6): [True: 3.35k, False: 25.2k]
  |  Branch (1017:22): [True: 0, False: 3.35k]
  ------------------
 1018|      0|		displaymode = is_empty_all(data - offset, offset) && is_empty_all(data + i, size - i);
  ------------------
  |  Branch (1018:17): [True: 0, False: 0]
  |  Branch (1018:56): [True: 0, False: 0]
  ------------------
 1019|       |
 1020|       |	/* call callback */
 1021|  28.5k|	if (doc->md.math(ob, &text, displaymode, &doc->data))
  ------------------
  |  Branch (1021:6): [True: 28.5k, False: 0]
  ------------------
 1022|  28.5k|		return i;
 1023|       |
 1024|      0|	return 0;
 1025|  28.5k|}
document.c:char_entity:
 1231|   153k|{
 1232|   153k|	size_t end = 1;
 1233|   153k|	hoedown_buffer work = { 0, 0, 0, 0, NULL, NULL, NULL };
 1234|       |
 1235|   153k|	if (end < size && data[end] == '#')
  ------------------
  |  Branch (1235:6): [True: 146k, False: 7.32k]
  |  Branch (1235:20): [True: 313, False: 146k]
  ------------------
 1236|    313|		end++;
 1237|       |
 1238|   168k|	while (end < size && isalnum(data[end]))
  ------------------
  |  Branch (1238:9): [True: 160k, False: 8.45k]
  |  Branch (1238:23): [True: 14.6k, False: 145k]
  ------------------
 1239|  14.6k|		end++;
 1240|       |
 1241|   153k|	if (end < size && data[end] == ';')
  ------------------
  |  Branch (1241:6): [True: 145k, False: 8.45k]
  |  Branch (1241:20): [True: 1.21k, False: 144k]
  ------------------
 1242|  1.21k|		end++; /* real entity */
 1243|   152k|	else
 1244|   152k|		return 0; /* lone '&' */
 1245|       |
 1246|  1.21k|	if (doc->md.entity) {
  ------------------
  |  Branch (1246:6): [True: 0, False: 1.21k]
  ------------------
 1247|      0|		work.data = data;
 1248|      0|		work.size = end;
 1249|      0|		doc->md.entity(ob, &work, &doc->data);
 1250|      0|	}
 1251|  1.21k|	else hoedown_buffer_put(ob, data, end);
 1252|       |
 1253|  1.21k|	return end;
 1254|   153k|}
document.c:char_autolink_url:
 1347|  2.24M|{
 1348|  2.24M|	hoedown_buffer *link;
 1349|  2.24M|	size_t link_len, rewind;
 1350|       |
 1351|  2.24M|	if (!doc->md.autolink || doc->in_link_body)
  ------------------
  |  Branch (1351:6): [True: 0, False: 2.24M]
  |  Branch (1351:27): [True: 20.0k, False: 2.22M]
  ------------------
 1352|  20.0k|		return 0;
 1353|       |
 1354|  2.22M|	link = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  2.22M|#define BUFFER_SPAN 1
  ------------------
 1355|       |
 1356|  2.22M|	if ((link_len = hoedown_autolink__url(&rewind, link, data, offset, size, 0)) > 0) {
  ------------------
  |  Branch (1356:6): [True: 4.89k, False: 2.21M]
  ------------------
 1357|  4.89k|		if (ob->size > rewind)
  ------------------
  |  Branch (1357:7): [True: 3.89k, False: 1.00k]
  ------------------
 1358|  3.89k|			ob->size -= rewind;
 1359|  1.00k|		else
 1360|  1.00k|			ob->size = 0;
 1361|       |
 1362|  4.89k|		doc->md.autolink(ob, link, HOEDOWN_AUTOLINK_NORMAL, &doc->data);
 1363|  4.89k|	}
 1364|       |
 1365|  2.22M|	popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  2.22M|#define BUFFER_SPAN 1
  ------------------
 1366|  2.22M|	return link_len;
 1367|  2.24M|}
document.c:char_autolink_email:
 1323|   383k|{
 1324|   383k|	hoedown_buffer *link;
 1325|   383k|	size_t link_len, rewind;
 1326|       |
 1327|   383k|	if (!doc->md.autolink || doc->in_link_body)
  ------------------
  |  Branch (1327:6): [True: 0, False: 383k]
  |  Branch (1327:27): [True: 657, False: 382k]
  ------------------
 1328|    657|		return 0;
 1329|       |
 1330|   382k|	link = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   382k|#define BUFFER_SPAN 1
  ------------------
 1331|       |
 1332|   382k|	if ((link_len = hoedown_autolink__email(&rewind, link, data, offset, size, 0)) > 0) {
  ------------------
  |  Branch (1332:6): [True: 2.58k, False: 380k]
  ------------------
 1333|  2.58k|		if (ob->size > rewind)
  ------------------
  |  Branch (1333:7): [True: 2.22k, False: 358]
  ------------------
 1334|  2.22k|			ob->size -= rewind;
 1335|    358|		else
 1336|    358|			ob->size = 0;
 1337|       |
 1338|  2.58k|		doc->md.autolink(ob, link, HOEDOWN_AUTOLINK_EMAIL, &doc->data);
 1339|  2.58k|	}
 1340|       |
 1341|   382k|	popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   382k|#define BUFFER_SPAN 1
  ------------------
 1342|   382k|	return link_len;
 1343|   383k|}
document.c:char_autolink_www:
 1287|   667k|{
 1288|   667k|	hoedown_buffer *link, *link_url, *link_text;
 1289|   667k|	size_t link_len, rewind;
 1290|       |
 1291|   667k|	if (!doc->md.link || doc->in_link_body)
  ------------------
  |  Branch (1291:6): [True: 0, False: 667k]
  |  Branch (1291:23): [True: 921, False: 666k]
  ------------------
 1292|    921|		return 0;
 1293|       |
 1294|   666k|	link = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   666k|#define BUFFER_SPAN 1
  ------------------
 1295|       |
 1296|   666k|	if ((link_len = hoedown_autolink__www(&rewind, link, data, offset, size, HOEDOWN_AUTOLINK_SHORT_DOMAINS)) > 0) {
  ------------------
  |  Branch (1296:6): [True: 22.9k, False: 643k]
  ------------------
 1297|  22.9k|		link_url = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  22.9k|#define BUFFER_SPAN 1
  ------------------
 1298|  22.9k|		HOEDOWN_BUFPUTSL(link_url, "http://");
  ------------------
  |  |  119|  22.9k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
 1299|  22.9k|		hoedown_buffer_put(link_url, link->data, link->size);
 1300|       |
 1301|  22.9k|		if (ob->size > rewind)
  ------------------
  |  Branch (1301:7): [True: 20.6k, False: 2.23k]
  ------------------
 1302|  20.6k|			ob->size -= rewind;
 1303|  2.23k|		else
 1304|  2.23k|			ob->size = 0;
 1305|       |
 1306|  22.9k|		if (doc->md.normal_text) {
  ------------------
  |  Branch (1306:7): [True: 22.9k, False: 0]
  ------------------
 1307|  22.9k|			link_text = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  22.9k|#define BUFFER_SPAN 1
  ------------------
 1308|  22.9k|			doc->md.normal_text(link_text, link, &doc->data);
 1309|  22.9k|			doc->md.link(ob, link_text, link_url, NULL, NULL, &doc->data);
 1310|  22.9k|			popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  22.9k|#define BUFFER_SPAN 1
  ------------------
 1311|  22.9k|		} else {
 1312|      0|			doc->md.link(ob, link, link_url, NULL, NULL, &doc->data);
 1313|      0|		}
 1314|  22.9k|		popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|  22.9k|#define BUFFER_SPAN 1
  ------------------
 1315|  22.9k|	}
 1316|       |
 1317|   666k|	popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   666k|#define BUFFER_SPAN 1
  ------------------
 1318|   666k|	return link_len;
 1319|   667k|}
document.c:char_superscript:
 1681|   223k|{
 1682|   223k|	size_t sup_start, sup_len;
 1683|   223k|	hoedown_buffer *sup;
 1684|       |
 1685|   223k|	if (!doc->md.superscript)
  ------------------
  |  Branch (1685:6): [True: 0, False: 223k]
  ------------------
 1686|      0|		return 0;
 1687|       |
 1688|   223k|	if (size < 2)
  ------------------
  |  Branch (1688:6): [True: 6.22k, False: 217k]
  ------------------
 1689|  6.22k|		return 0;
 1690|       |
 1691|   217k|	if (data[1] == '(') {
  ------------------
  |  Branch (1691:6): [True: 27.1k, False: 190k]
  ------------------
 1692|  27.1k|		sup_start = 2;
 1693|  27.1k|		sup_len = find_emph_char(data + 2, size - 2, ')') + 2;
 1694|       |
 1695|  27.1k|		if (sup_len == size)
  ------------------
  |  Branch (1695:7): [True: 454, False: 26.7k]
  ------------------
 1696|    454|			return 0;
 1697|   190k|	} else {
 1698|   190k|		sup_start = sup_len = 1;
 1699|       |
 1700|  29.1M|		while (sup_len < size && !_isspace(data[sup_len]))
  ------------------
  |  Branch (1700:10): [True: 29.0M, False: 66.9k]
  |  Branch (1700:28): [True: 28.9M, False: 123k]
  ------------------
 1701|  28.9M|			sup_len++;
 1702|   190k|	}
 1703|       |
 1704|   217k|	if (sup_len - sup_start == 0)
  ------------------
  |  Branch (1704:6): [True: 27.7k, False: 189k]
  ------------------
 1705|  27.7k|		return (sup_start == 2) ? 3 : 0;
  ------------------
  |  Branch (1705:10): [True: 23.1k, False: 4.59k]
  ------------------
 1706|       |
 1707|   189k|	sup = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   189k|#define BUFFER_SPAN 1
  ------------------
 1708|   189k|	parse_inline(sup, doc, data + sup_start, sup_len - sup_start);
 1709|   189k|	doc->md.superscript(ob, sup, &doc->data);
 1710|   189k|	popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   189k|#define BUFFER_SPAN 1
  ------------------
 1711|       |
 1712|   189k|	return (sup_start == 2) ? sup_len + 1 : sup_len;
  ------------------
  |  Branch (1712:9): [True: 3.57k, False: 185k]
  ------------------
 1713|   217k|}
document.c:char_quote:
 1144|   265k|{
 1145|   265k|	size_t end, nq = 0, i, f_begin, f_end;
 1146|       |
 1147|       |	/* counting the number of quotes in the delimiter */
 1148|  1.76M|	while (nq < size && data[nq] == '"')
  ------------------
  |  Branch (1148:9): [True: 1.75M, False: 4.11k]
  |  Branch (1148:22): [True: 1.49M, False: 261k]
  ------------------
 1149|  1.49M|		nq++;
 1150|       |
 1151|       |	/* finding the next delimiter */
 1152|   265k|	end = nq;
 1153|   583k|	while (1) {
  ------------------
  |  Branch (1153:9): [True: 583k, Folded]
  ------------------
 1154|   583k|		i = end;
 1155|   583k|		end += find_emph_char(data + end, size - end, '"');
 1156|   583k|		if (end == i) return 0;		/* no matching delimiter */
  ------------------
  |  Branch (1156:7): [True: 86.6k, False: 496k]
  ------------------
 1157|   496k|		i = end;
 1158|  1.68M|		while (end < size && data[end] == '"' && end - i < nq) end++;
  ------------------
  |  Branch (1158:10): [True: 1.68M, False: 2.22k]
  |  Branch (1158:24): [True: 1.20M, False: 482k]
  |  Branch (1158:44): [True: 1.18M, False: 12.4k]
  ------------------
 1159|   496k|		if (end - i >= nq) break;
  ------------------
  |  Branch (1159:7): [True: 178k, False: 317k]
  ------------------
 1160|   496k|	}
 1161|       |
 1162|       |	/* trimming outside spaces */
 1163|   178k|	f_begin = nq;
 1164|   939k|	while (f_begin < end && data[f_begin] == ' ')
  ------------------
  |  Branch (1164:9): [True: 939k, False: 0]
  |  Branch (1164:26): [True: 760k, False: 178k]
  ------------------
 1165|   760k|		f_begin++;
 1166|       |
 1167|   178k|	f_end = end - nq;
 1168|  1.04M|	while (f_end > nq && data[f_end-1] == ' ')
  ------------------
  |  Branch (1168:9): [True: 1.04M, False: 1.43k]
  |  Branch (1168:23): [True: 864k, False: 177k]
  ------------------
 1169|   864k|		f_end--;
 1170|       |
 1171|       |	/* real quote */
 1172|   178k|	if (f_begin < f_end) {
  ------------------
  |  Branch (1172:6): [True: 177k, False: 1.43k]
  ------------------
 1173|   177k|		hoedown_buffer *work = newbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   177k|#define BUFFER_SPAN 1
  ------------------
 1174|   177k|		parse_inline(work, doc, data + f_begin, f_end - f_begin);
 1175|       |
 1176|   177k|		if (!doc->md.quote(ob, work, &doc->data))
  ------------------
  |  Branch (1176:7): [True: 673, False: 176k]
  ------------------
 1177|    673|			end = 0;
 1178|   177k|		popbuf(doc, BUFFER_SPAN);
  ------------------
  |  |   19|   177k|#define BUFFER_SPAN 1
  ------------------
 1179|   177k|	} else {
 1180|  1.43k|		if (!doc->md.quote(ob, 0, &doc->data))
  ------------------
  |  Branch (1180:7): [True: 1.43k, False: 0]
  ------------------
 1181|  1.43k|			end = 0;
 1182|  1.43k|	}
 1183|       |
 1184|   178k|	return end;
 1185|   265k|}
document.c:char_math:
 1717|  56.7k|{
 1718|       |	/* double dollar */
 1719|  56.7k|	if (size > 1 && data[1] == '$')
  ------------------
  |  Branch (1719:6): [True: 49.4k, False: 7.35k]
  |  Branch (1719:18): [True: 8.92k, False: 40.4k]
  ------------------
 1720|  8.92k|		return parse_math(ob, doc, data, offset, size, "$$", 2, 1);
 1721|       |
 1722|       |	/* single dollar allowed only with MATH_EXPLICIT flag */
 1723|  47.8k|	if (doc->ext_flags & HOEDOWN_EXT_MATH_EXPLICIT)
  ------------------
  |  Branch (1723:6): [True: 47.8k, False: 0]
  ------------------
 1724|  47.8k|		return parse_math(ob, doc, data, offset, size, "$", 1, 0);
 1725|       |
 1726|      0|	return 0;
 1727|  47.8k|}

hoedown_escape_href:
   58|   306k|{
   59|   306k|	static const char hex_chars[] = "0123456789ABCDEF";
   60|   306k|	size_t  i = 0, mark;
   61|   306k|	char hex_str[3];
   62|       |
   63|   306k|	hex_str[0] = '%';
   64|       |
   65|  9.48M|	while (i < size) {
  ------------------
  |  Branch (65:9): [True: 9.29M, False: 195k]
  ------------------
   66|  9.29M|		mark = i;
   67|  31.3M|		while (i < size && HREF_SAFE[data[i]]) i++;
  ------------------
  |  Branch (67:10): [True: 31.2M, False: 110k]
  |  Branch (67:22): [True: 22.0M, False: 9.18M]
  ------------------
   68|       |
   69|       |		/* Optimization for cases where there's nothing to escape */
   70|  9.29M|		if (mark == 0 && i >= size) {
  ------------------
  |  Branch (70:7): [True: 306k, False: 8.98M]
  |  Branch (70:20): [True: 39.0k, False: 267k]
  ------------------
   71|  39.0k|			hoedown_buffer_put(ob, data, size);
   72|  39.0k|			return;
   73|  39.0k|		}
   74|       |
   75|  9.25M|		if (likely(i > mark)) {
  ------------------
  |  |    8|  9.25M|#define likely(x)       __builtin_expect((x),1)
  |  |  ------------------
  |  |  |  Branch (8:25): [True: 189k, False: 9.06M]
  |  |  ------------------
  ------------------
   76|   189k|			hoedown_buffer_put(ob, data + mark, i - mark);
   77|   189k|		}
   78|       |
   79|       |		/* escaping */
   80|  9.25M|		if (i >= size)
  ------------------
  |  Branch (80:7): [True: 71.8k, False: 9.18M]
  ------------------
   81|  71.8k|			break;
   82|       |
   83|  9.18M|		switch (data[i]) {
   84|       |		/* amp appears all the time in URLs, but needs
   85|       |		 * HTML-entity escaping to be inside an href */
   86|  21.5k|		case '&':
  ------------------
  |  Branch (86:3): [True: 21.5k, False: 9.15M]
  ------------------
   87|  21.5k|			HOEDOWN_BUFPUTSL(ob, "&amp;");
  ------------------
  |  |  119|  21.5k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
   88|  21.5k|			break;
   89|       |
   90|       |		/* the single quote is a valid URL character
   91|       |		 * according to the standard; it needs HTML
   92|       |		 * entity escaping too */
   93|  32.9k|		case '\'':
  ------------------
  |  Branch (93:3): [True: 32.9k, False: 9.14M]
  ------------------
   94|  32.9k|			HOEDOWN_BUFPUTSL(ob, "&#x27;");
  ------------------
  |  |  119|  32.9k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
   95|  32.9k|			break;
   96|       |
   97|       |		/* the space can be escaped to %20 or a plus
   98|       |		 * sign. we're going with the generic escape
   99|       |		 * for now. the plus thing is more commonly seen
  100|       |		 * when building GET strings */
  101|       |#if 0
  102|       |		case ' ':
  103|       |			hoedown_buffer_putc(ob, '+');
  104|       |			break;
  105|       |#endif
  106|       |
  107|       |		/* every other character goes with a %XX escaping */
  108|  9.12M|		default:
  ------------------
  |  Branch (108:3): [True: 9.12M, False: 54.4k]
  ------------------
  109|  9.12M|			hex_str[1] = hex_chars[(data[i] >> 4) & 0xF];
  110|  9.12M|			hex_str[2] = hex_chars[data[i] & 0xF];
  111|  9.12M|			hoedown_buffer_put(ob, (uint8_t *)hex_str, 3);
  112|  9.18M|		}
  113|       |
  114|  9.18M|		i++;
  115|  9.18M|	}
  116|   306k|}
hoedown_escape_html:
  161|  8.86M|{
  162|  8.86M|	size_t i = 0, mark;
  163|       |
  164|  37.8M|	while (1) {
  ------------------
  |  Branch (164:9): [True: 37.8M, Folded]
  ------------------
  165|  37.8M|		mark = i;
  166|  2.77G|		while (i < size && HTML_ESCAPE_TABLE[data[i]] == 0) i++;
  ------------------
  |  Branch (166:10): [True: 2.76G, False: 8.86M]
  |  Branch (166:22): [True: 2.73G, False: 29.0M]
  ------------------
  167|       |
  168|       |		/* Optimization for cases where there's nothing to escape */
  169|  37.8M|		if (mark == 0 && i >= size) {
  ------------------
  |  Branch (169:7): [True: 8.86M, False: 29.0M]
  |  Branch (169:20): [True: 7.93M, False: 933k]
  ------------------
  170|  7.93M|			hoedown_buffer_put(ob, data, size);
  171|  7.93M|			return;
  172|  7.93M|		}
  173|       |
  174|  29.9M|		if (likely(i > mark))
  ------------------
  |  |    8|  29.9M|#define likely(x)       __builtin_expect((x),1)
  |  |  ------------------
  |  |  |  Branch (8:25): [True: 19.0M, False: 10.8M]
  |  |  ------------------
  ------------------
  175|  19.0M|			hoedown_buffer_put(ob, data + mark, i - mark);
  176|       |
  177|  29.9M|		if (i >= size) break;
  ------------------
  |  Branch (177:7): [True: 933k, False: 29.0M]
  ------------------
  178|       |
  179|       |		/* The forward slash is only escaped in secure mode */
  180|  29.0M|		if (!secure && data[i] == '/') {
  ------------------
  |  Branch (180:7): [True: 29.0M, False: 0]
  |  Branch (180:18): [True: 1.66M, False: 27.3M]
  ------------------
  181|  1.66M|			hoedown_buffer_putc(ob, '/');
  182|  27.3M|		} else {
  183|  27.3M|			hoedown_buffer_puts(ob, HTML_ESCAPES[HTML_ESCAPE_TABLE[data[i]]]);
  184|  27.3M|		}
  185|       |
  186|  29.0M|		i++;
  187|  29.0M|	}
  188|  8.86M|}

hoedown_hash_new:
  132|  11.8k|{
  133|  11.8k|    hoedown_hash *hash;
  134|  11.8k|    size_t items_size;
  135|       |
  136|  11.8k|    hash = (hoedown_hash *)malloc(sizeof(hoedown_hash));
  137|  11.8k|    if (!hash) {
  ------------------
  |  Branch (137:9): [True: 0, False: 11.8k]
  ------------------
  138|      0|        return NULL;
  139|      0|    }
  140|       |
  141|  11.8k|    if (size == 0) {
  ------------------
  |  Branch (141:9): [True: 11.8k, False: 0]
  ------------------
  142|  11.8k|        size = HOEDOWN_HASH_ITEM_SIZE;
  ------------------
  |  |    6|  11.8k|#define HOEDOWN_HASH_ITEM_SIZE 255
  ------------------
  143|  11.8k|    }
  144|       |
  145|  11.8k|    items_size = sizeof(hoedown_hash_item *) * size;
  146|       |
  147|  11.8k|    hash->items = (hoedown_hash_item **)malloc(items_size);
  148|  11.8k|    if (!hash->items) {
  ------------------
  |  Branch (148:9): [True: 0, False: 11.8k]
  ------------------
  149|      0|        free(hash);
  150|      0|        return NULL;
  151|      0|    }
  152|       |
  153|  11.8k|    memset(hash->items, 0, items_size);
  154|       |
  155|  11.8k|    hash->asize = size;
  156|       |
  157|  11.8k|    return hash;
  158|  11.8k|}
hoedown_hash_free:
  162|  11.8k|{
  163|  11.8k|    if (hash) {
  ------------------
  |  Branch (163:9): [True: 11.8k, False: 0]
  ------------------
  164|  11.8k|        if (hash->items) {
  ------------------
  |  Branch (164:13): [True: 11.8k, False: 0]
  ------------------
  165|  11.8k|            size_t i = 0;
  166|  3.02M|            while (i < hash->asize) {
  ------------------
  |  Branch (166:20): [True: 3.01M, False: 11.8k]
  ------------------
  167|  3.01M|                if (hash->items[i]) {
  ------------------
  |  Branch (167:21): [True: 14.0k, False: 3.00M]
  ------------------
  168|  14.0k|                    hoedown_hash_item_free(hash->items[i]);
  169|  14.0k|                }
  170|  3.01M|                ++i;
  171|  3.01M|            }
  172|  11.8k|            free(hash->items);
  173|  11.8k|        }
  174|  11.8k|        free(hash);
  175|  11.8k|    }
  176|  11.8k|}
hoedown_hash_add:
  181|  16.0k|{
  182|  16.0k|    unsigned int h;
  183|       |
  184|  16.0k|    if (!hash || !key || !value) {
  ------------------
  |  Branch (184:9): [True: 0, False: 16.0k]
  |  Branch (184:18): [True: 0, False: 16.0k]
  |  Branch (184:26): [True: 0, False: 16.0k]
  ------------------
  185|      0|        return 1;
  186|      0|    }
  187|       |
  188|  16.0k|    h = hoedown_hash_fnv(key, key + key_len, hash->asize);
  189|       |
  190|  16.0k|    if (!hash->items[h]) {
  ------------------
  |  Branch (190:9): [True: 14.0k, False: 2.00k]
  ------------------
  191|  14.0k|        hash->items[h] = hoedown_hash_item_new();
  192|  14.0k|        if (!hash->items[h]) {
  ------------------
  |  Branch (192:13): [True: 0, False: 14.0k]
  ------------------
  193|      0|            return 1;
  194|      0|        }
  195|  14.0k|    }
  196|       |
  197|  16.0k|    if (hoedown_hash_item_push(hash->items[h], key, key_len,
  ------------------
  |  Branch (197:9): [True: 0, False: 16.0k]
  ------------------
  198|  16.0k|                               value, destruct) != 0) {
  199|      0|        return 1;
  200|      0|    }
  201|       |
  202|  16.0k|    return 0;
  203|  16.0k|}
hoedown_hash_find:
  207|  76.3k|{
  208|  76.3k|    unsigned int h;
  209|       |
  210|  76.3k|    if (!hash || !key) {
  ------------------
  |  Branch (210:9): [True: 0, False: 76.3k]
  |  Branch (210:18): [True: 0, False: 76.3k]
  ------------------
  211|      0|        return NULL;
  212|      0|    }
  213|       |
  214|  76.3k|    h = hoedown_hash_fnv(key, key + key_len, hash->asize);
  215|       |
  216|  76.3k|    if (hash->items[h]) {
  ------------------
  |  Branch (216:9): [True: 62.3k, False: 14.0k]
  ------------------
  217|  62.3k|        hoedown_hash_item *item = hash->items[h];
  218|  68.9k|        while (item != NULL) {
  ------------------
  |  Branch (218:16): [True: 66.9k, False: 2.00k]
  ------------------
  219|  66.9k|            if (item->key && strncmp(item->key, key, key_len) == 0) {
  ------------------
  |  Branch (219:17): [True: 66.9k, False: 0]
  |  Branch (219:30): [True: 60.3k, False: 6.63k]
  ------------------
  220|  60.3k|                return item->value;
  221|  60.3k|            }
  222|  6.63k|            item = item->next;
  223|  6.63k|        }
  224|  62.3k|    }
  225|       |
  226|  16.0k|    return NULL;
  227|  76.3k|}
hash.c:hoedown_hash_item_free:
   78|  16.0k|{
   79|  16.0k|    if (item) {
  ------------------
  |  Branch (79:9): [True: 16.0k, False: 0]
  ------------------
   80|  16.0k|        if (item->next) {
  ------------------
  |  Branch (80:13): [True: 2.00k, False: 14.0k]
  ------------------
   81|  2.00k|            hoedown_hash_item_free(item->next);
   82|  2.00k|        }
   83|  16.0k|        if (item->key) {
  ------------------
  |  Branch (83:13): [True: 16.0k, False: 0]
  ------------------
   84|  16.0k|            free(item->key);
   85|  16.0k|        }
   86|  16.0k|        if (item->destruct) {
  ------------------
  |  Branch (86:13): [True: 16.0k, False: 0]
  ------------------
   87|  16.0k|            (item->destruct)(item->value);
   88|  16.0k|        }
   89|  16.0k|        free(item);
   90|  16.0k|    }
   91|  16.0k|}
hash.c:hoedown_hash_fnv:
   35|  92.4k|{
   36|  92.4k|    unsigned int hash = HOEDOWN_HASH_FNV_OFFSET_BASIS;
  ------------------
  |  |    8|  92.4k|#define HOEDOWN_HASH_FNV_OFFSET_BASIS 0x811c9dc5
  ------------------
   37|       |
   38|  92.4k|    if (max == NULL) {
  ------------------
  |  Branch (38:9): [True: 0, False: 92.4k]
  ------------------
   39|      0|        if (key) {
  ------------------
  |  Branch (39:13): [True: 0, False: 0]
  ------------------
   40|      0|            max = key + strlen(key);
   41|      0|        } else {
   42|      0|            max = key;
   43|      0|        }
   44|      0|    }
   45|       |
   46|   291M|    while (key < max) {
  ------------------
  |  Branch (46:12): [True: 291M, False: 92.4k]
  ------------------
   47|   291M|        hash *= HOEDOWN_HASH_FNV_PRIME;
  ------------------
  |  |    7|   291M|#define HOEDOWN_HASH_FNV_PRIME 0x01000193
  ------------------
   48|   291M|        hash ^= *key;
   49|   291M|        key++;
   50|   291M|    }
   51|       |
   52|  92.4k|    hash %= limit;
   53|       |
   54|  92.4k|    return hash;
   55|  92.4k|}
hash.c:hoedown_hash_item_new:
   59|  16.0k|{
   60|  16.0k|    hoedown_hash_item *item;
   61|       |
   62|  16.0k|    item = (hoedown_hash_item *)malloc(sizeof(hoedown_hash_item));
   63|  16.0k|    if (!item) {
  ------------------
  |  Branch (63:9): [True: 0, False: 16.0k]
  ------------------
   64|      0|        return NULL;
   65|      0|    }
   66|       |
   67|  16.0k|    item->key = NULL;
   68|  16.0k|    item->value = NULL;
   69|  16.0k|    item->destruct = NULL;
   70|  16.0k|    item->next = NULL;
   71|  16.0k|    item->tail = NULL;
   72|       |
   73|  16.0k|    return item;
   74|  16.0k|}
hash.c:hoedown_hash_item_push:
   96|  16.0k|{
   97|  16.0k|    hoedown_hash_item *entry;
   98|       |
   99|  16.0k|    if (!item || !key || !value) {
  ------------------
  |  Branch (99:9): [True: 0, False: 16.0k]
  |  Branch (99:18): [True: 0, False: 16.0k]
  |  Branch (99:26): [True: 0, False: 16.0k]
  ------------------
  100|      0|        return 1;
  101|      0|    }
  102|       |
  103|  16.0k|    if (item->key != NULL) {
  ------------------
  |  Branch (103:9): [True: 2.00k, False: 14.0k]
  ------------------
  104|  2.00k|        entry = hoedown_hash_item_new();
  105|  2.00k|        if (!entry) {
  ------------------
  |  Branch (105:13): [True: 0, False: 2.00k]
  ------------------
  106|      0|            return 1;
  107|      0|        }
  108|  14.0k|    } else {
  109|  14.0k|        entry = item;
  110|  14.0k|    }
  111|       |
  112|  16.0k|    if (key_len > 0) {
  ------------------
  |  Branch (112:9): [True: 16.0k, False: 0]
  ------------------
  113|  16.0k|        entry->key = hoedown_hash_strndup(key, key_len);
  114|  16.0k|    } else {
  115|      0|        entry->key = hoedown_hash_strdup(key);
  116|      0|    }
  117|  16.0k|    entry->value = value;
  118|  16.0k|    entry->destruct = destruct;
  119|       |
  120|  16.0k|    if (item->tail) {
  ------------------
  |  Branch (120:9): [True: 2.00k, False: 14.0k]
  ------------------
  121|  2.00k|        item->tail->next = entry;
  122|  14.0k|    } else if (item != entry) {
  ------------------
  |  Branch (122:16): [True: 0, False: 14.0k]
  ------------------
  123|      0|        item->next = entry;
  124|      0|    }
  125|  16.0k|    item->tail = entry;
  126|       |
  127|  16.0k|    return 0;
  128|  16.0k|}
hash.c:hoedown_hash_strndup:
   12|  16.0k|{
   13|  16.0k|    if (str) {
  ------------------
  |  Branch (13:9): [True: 16.0k, False: 0]
  ------------------
   14|  16.0k|        char *s = (char *)malloc(sizeof(char) * (n + 1));
   15|  16.0k|        if (s) {
  ------------------
  |  Branch (15:13): [True: 16.0k, False: 0]
  ------------------
   16|  16.0k|            memcpy(s, str, n);
   17|  16.0k|            s[n] = '\0';
   18|  16.0k|        }
   19|  16.0k|        return s;
   20|  16.0k|    }
   21|      0|    return NULL;
   22|  16.0k|}

hoedown_html_renderer_new:
 1111|  11.8k|{
 1112|  11.8k|	static const hoedown_renderer cb_default = {
 1113|  11.8k|		NULL,
 1114|       |
 1115|  11.8k|		rndr_blockcode,
 1116|  11.8k|		rndr_blockquote,
 1117|  11.8k|		rndr_header,
 1118|  11.8k|		rndr_hrule,
 1119|  11.8k|		rndr_list,
 1120|  11.8k|		rndr_listitem,
 1121|  11.8k|		rndr_paragraph,
 1122|  11.8k|		rndr_table,
 1123|  11.8k|		rndr_table_header,
 1124|  11.8k|		rndr_table_body,
 1125|  11.8k|		rndr_tablerow,
 1126|  11.8k|		rndr_tablecell,
 1127|  11.8k|		rndr_footnotes,
 1128|  11.8k|		rndr_footnote_def,
 1129|  11.8k|		rndr_raw_block,
 1130|       |
 1131|  11.8k|		rndr_autolink,
 1132|  11.8k|		rndr_codespan,
 1133|  11.8k|		rndr_double_emphasis,
 1134|  11.8k|		rndr_emphasis,
 1135|  11.8k|		rndr_underline,
 1136|  11.8k|		rndr_highlight,
 1137|  11.8k|		rndr_quote,
 1138|  11.8k|		rndr_image,
 1139|  11.8k|		rndr_linebreak,
 1140|  11.8k|		rndr_link,
 1141|  11.8k|		rndr_triple_emphasis,
 1142|  11.8k|		rndr_strikethrough,
 1143|  11.8k|		rndr_superscript,
 1144|  11.8k|		rndr_footnote_ref,
 1145|  11.8k|		rndr_math,
 1146|  11.8k|		rndr_raw_html,
 1147|       |
 1148|  11.8k|		NULL,
 1149|  11.8k|		rndr_normal_text,
 1150|       |
 1151|  11.8k|		NULL,
 1152|  11.8k|		NULL,
 1153|       |
 1154|  11.8k|		NULL,
 1155|       |
 1156|  11.8k|		NULL,
 1157|  11.8k|		NULL,
 1158|  11.8k|	};
 1159|       |
 1160|  11.8k|	hoedown_html_renderer_state *state;
 1161|  11.8k|	hoedown_renderer *renderer;
 1162|       |
 1163|       |	/* Prepare the state pointer */
 1164|  11.8k|	state = hoedown_malloc(sizeof(hoedown_html_renderer_state));
 1165|  11.8k|	memset(state, 0x0, sizeof(hoedown_html_renderer_state));
 1166|       |
 1167|  11.8k|	state->flags = render_flags;
 1168|  11.8k|	state->toc_data.nesting_level = nesting_level;
 1169|       |
 1170|       |	/* Prepare the renderer */
 1171|  11.8k|	renderer = hoedown_malloc(sizeof(hoedown_renderer));
 1172|  11.8k|	memcpy(renderer, &cb_default, sizeof(hoedown_renderer));
 1173|       |
 1174|  11.8k|	if (render_flags & HOEDOWN_HTML_SKIP_HTML || render_flags & HOEDOWN_HTML_ESCAPE)
  ------------------
  |  Branch (1174:6): [True: 11.8k, False: 0]
  |  Branch (1174:47): [True: 0, False: 0]
  ------------------
 1175|  11.8k|		renderer->blockhtml = NULL;
 1176|       |
 1177|  11.8k|	state->hash.header_id = hoedown_hash_new(0);
 1178|       |
 1179|  11.8k|	renderer->opaque = state;
 1180|       |
 1181|  11.8k|	return renderer;
 1182|  11.8k|}
hoedown_html_renderer_free:
 1186|  11.8k|{
 1187|  11.8k|	if (renderer->opaque) {
  ------------------
  |  Branch (1187:6): [True: 11.8k, False: 0]
  ------------------
 1188|  11.8k|		hoedown_html_renderer_state *state = renderer->opaque;
 1189|  11.8k|		if (state->hash.header_id) {
  ------------------
  |  Branch (1189:7): [True: 11.8k, False: 0]
  ------------------
 1190|  11.8k|			hoedown_hash_free(state->hash.header_id);
 1191|  11.8k|		}
 1192|  11.8k|	}
 1193|  11.8k|	free(renderer->opaque);
 1194|  11.8k|	free(renderer);
 1195|  11.8k|}
html.c:escape_html:
   57|  8.86M|{
   58|  8.86M|	hoedown_escape_html(ob, source, length, 0);
   59|  8.86M|}
html.c:rndr_header_id:
  366|  76.3k|{
  367|  76.3k|	size_t i = 0, n = 0;
  368|  76.3k|	hoedown_html_renderer_state *state = data->opaque;
  369|  76.3k|	hoedown_hash *hash = state->hash.header_id;
  370|       |
  371|  14.8M|	while (i < length) {
  ------------------
  |  Branch (371:9): [True: 14.7M, False: 76.3k]
  ------------------
  372|  14.7M|		if (isalnum(source[i])) {
  ------------------
  |  Branch (372:7): [True: 543k, False: 14.1M]
  ------------------
  373|   543k|			hoedown_buffer_putc(ob, tolower(source[i]));
  ------------------
  |  Branch (373:28): [True: 0, False: 0]
  |  Branch (373:28): [True: 0, False: 0]
  |  Branch (373:28): [Folded, False: 543k]
  ------------------
  374|  14.1M|		} else if (source[i] == ' ') {
  ------------------
  |  Branch (374:14): [True: 11.3M, False: 2.84M]
  ------------------
  375|  11.3M|			hoedown_buffer_putc(ob, '-');
  376|  11.3M|		} else if (source[i] == '-' || source[i] == '_') {
  ------------------
  |  Branch (376:14): [True: 50.9k, False: 2.79M]
  |  Branch (376:34): [True: 8.13k, False: 2.78M]
  ------------------
  377|  59.0k|			hoedown_buffer_putc(ob, source[i]);
  378|  2.78M|		} else if (!isascii(source[i])) {
  ------------------
  |  Branch (378:14): [True: 691k, False: 2.09M]
  ------------------
  379|   691k|			if (escape) {
  ------------------
  |  Branch (379:8): [True: 0, False: 691k]
  ------------------
  380|      0|				hoedown_buffer_printf(ob, "%%%02X", source[i]);
  381|   691k|			} else {
  382|   691k|				hoedown_buffer_putc(ob, source[i]);
  383|   691k|			}
  384|  2.09M|		} else if (source[i] == '&') {
  ------------------
  |  Branch (384:14): [True: 55.5k, False: 2.04M]
  ------------------
  385|   265k|			while (i < length && source[i] != ';') {
  ------------------
  |  Branch (385:11): [True: 265k, False: 0]
  |  Branch (385:25): [True: 209k, False: 55.5k]
  ------------------
  386|   209k|				++i;
  387|   209k|			}
  388|  2.04M|		} else if (source[i] == '<') {
  ------------------
  |  Branch (388:14): [True: 116k, False: 1.92M]
  ------------------
  389|   133M|			while (i < length && source[i] != '>') {
  ------------------
  |  Branch (389:11): [True: 133M, False: 0]
  |  Branch (389:25): [True: 132M, False: 116k]
  ------------------
  390|   132M|				++i;
  391|   132M|			}
  392|   116k|		}
  393|  14.7M|		++i;
  394|  14.7M|	}
  395|       |
  396|  76.3k|	if (hash) {
  ------------------
  |  Branch (396:6): [True: 76.3k, False: 0]
  ------------------
  397|  76.3k|		void *value = hoedown_hash_find(hash, (char *)source, length);
  398|  76.3k|		if (value) {
  ------------------
  |  Branch (398:7): [True: 60.3k, False: 16.0k]
  ------------------
  399|  60.3k|			size_t *p = (size_t *)value;
  400|  60.3k|			++(*p);
  401|  60.3k|			n = *p;
  402|  60.3k|		}
  403|  76.3k|		if (n > 0) {
  ------------------
  |  Branch (403:7): [True: 60.3k, False: 16.0k]
  ------------------
  404|  60.3k|			hoedown_buffer_printf(ob, "-%ld", n);
  405|  60.3k|		} else if (hash) {
  ------------------
  |  Branch (405:14): [True: 16.0k, False: 0]
  ------------------
  406|  16.0k|			size_t *p = (size_t *)malloc(sizeof(size_t));
  407|  16.0k|			if (p) {
  ------------------
  |  Branch (407:8): [True: 16.0k, False: 0]
  ------------------
  408|  16.0k|				*p = 0;
  409|  16.0k|				hoedown_hash_add(hash, (char *)source, length, (void *)p, free);
  410|  16.0k|			}
  411|  16.0k|		}
  412|  76.3k|	}
  413|  76.3k|}
html.c:rndr_codespan:
  271|  24.8k|{
  272|  24.8k|	HOEDOWN_BUFPUTSL(ob, "<code");
  ------------------
  |  |  119|  24.8k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  273|  24.8k|	if (attr && attr->size) {
  ------------------
  |  Branch (273:6): [True: 20.2k, False: 4.59k]
  |  Branch (273:14): [True: 316, False: 19.9k]
  ------------------
  274|    316|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  275|    316|	}
  276|  24.8k|	hoedown_buffer_putc(ob, '>');
  277|  24.8k|	if (text) escape_html(ob, text->data, text->size);
  ------------------
  |  Branch (277:6): [True: 20.2k, False: 4.59k]
  ------------------
  278|  24.8k|	HOEDOWN_BUFPUTSL(ob, "</code>");
  ------------------
  |  |  119|  24.8k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  279|  24.8k|	return 1;
  280|  24.8k|}
html.c:rndr_attributes:
   71|   123k|{
   72|       |	/* i keeps track of how much we've parsed so far. */
   73|   123k|	size_t i = 0;
   74|   123k|	int rendered_id = 0;
   75|   123k|	int must_free_class = 0;
   76|       |
   77|   246k|	while (i < size) {
  ------------------
  |  Branch (77:9): [True: 131k, False: 114k]
  ------------------
   78|       |		/* An attribute can come in a variety of shapes:
   79|       |		 * - #id, where "id" is a sequence of non-space characters
   80|       |		 * - .cls, where  "cls" is a sequence of non-space characters
   81|       |		 * - key=val, where "key" and "val" are sequences of non-space characters
   82|       |		 * - key="quoted val", where "quoted val" may not contain a quote.
   83|       |		 * We look for each case and set the key and val variables. We ignore text
   84|       |		 * that does not match the patterns above (e.g., single words).
   85|       |		 * */
   86|   131k|		int is_id = 0;
   87|   131k|		int is_class = 0;
   88|   131k|		size_t key_start = 0, key_end = 0, val_start = 0, val_end = 0;
   89|       |
   90|       |		/* Skip to the first non-space character */
   91|  21.0M|		for (; i < size && buf[i] == ' '; ++i) {}
  ------------------
  |  Branch (91:10): [True: 21.0M, False: 1.36k]
  |  Branch (91:22): [True: 20.9M, False: 130k]
  ------------------
   92|   131k|		if (i >= size) break;
  ------------------
  |  Branch (92:7): [True: 1.36k, False: 130k]
  ------------------
   93|       |
   94|   130k|		if (buf[i] == '#') {
  ------------------
  |  Branch (94:7): [True: 77.2k, False: 53.2k]
  ------------------
   95|       |			/* #id */
   96|  77.2k|			is_id = 1;
   97|  77.2k|			++i;
   98|  77.2k|		} else if (buf[i] == '.') {
  ------------------
  |  Branch (98:14): [True: 3.86k, False: 49.3k]
  ------------------
   99|       |			/* .cls */
  100|  3.86k|			is_class = 1;
  101|  3.86k|			++i;
  102|  3.86k|		}
  103|   130k|		if (is_id || is_class) {
  ------------------
  |  Branch (103:7): [True: 77.2k, False: 53.2k]
  |  Branch (103:16): [True: 3.86k, False: 49.3k]
  ------------------
  104|  81.0k|			val_start = i;
  105|  12.9M|			for (val_end = val_start; val_end < size && buf[val_end] != ' '; ++val_end) {}
  ------------------
  |  Branch (105:30): [True: 12.8M, False: 80.0k]
  |  Branch (105:48): [True: 12.8M, False: 1.03k]
  ------------------
  106|  81.0k|			i = val_end;
  107|  81.0k|		} else {
  108|       |			/* key=... */
  109|  49.3k|			key_start = i;
  110|   112M|			for (key_end = key_start; key_end < size && buf[key_end] != ' ' && buf[key_end] != '='; ++key_end) {}
  ------------------
  |  Branch (110:30): [True: 112M, False: 6.20k]
  |  Branch (110:48): [True: 112M, False: 13.5k]
  |  Branch (110:71): [True: 112M, False: 29.6k]
  ------------------
  111|  49.3k|			i = key_end;
  112|  49.3k|			if (i >= size) break;
  ------------------
  |  Branch (112:8): [True: 6.20k, False: 43.1k]
  ------------------
  113|  43.1k|			++i;
  114|  43.1k|			if (buf[key_end] != '=') continue;
  ------------------
  |  Branch (114:8): [True: 13.5k, False: 29.6k]
  ------------------
  115|  29.6k|			if (strncasecmp((char *)buf + key_start, "id", key_end - key_start) == 0) {
  ------------------
  |  Branch (115:8): [True: 26.9k, False: 2.71k]
  ------------------
  116|  26.9k|				is_id = 1;
  117|  26.9k|			} else if (strncasecmp((char *)buf + key_start, "class", key_end - key_start) == 0) {
  ------------------
  |  Branch (117:15): [True: 912, False: 1.80k]
  ------------------
  118|    912|				is_class = 1;
  119|    912|			}
  120|       |
  121|  29.6k|			val_start = i;
  122|  29.6k|			if (val_start < size && (buf[val_start] == '"' || buf[val_start] == '\'')) {
  ------------------
  |  Branch (122:8): [True: 6.65k, False: 22.9k]
  |  Branch (122:29): [True: 3.82k, False: 2.82k]
  |  Branch (122:54): [True: 851, False: 1.97k]
  ------------------
  123|       |				/* key="quoted val" */
  124|  4.67k|				val_start += 1;
  125|  1.71M|				for (val_end = val_start; val_end < size && buf[val_end] != buf[val_start - 1]; ++val_end) {}
  ------------------
  |  Branch (125:31): [True: 1.71M, False: 986]
  |  Branch (125:49): [True: 1.71M, False: 3.69k]
  ------------------
  126|  4.67k|				i = val_end;
  127|  4.67k|				if (i >= size) break;
  ------------------
  |  Branch (127:9): [True: 986, False: 3.69k]
  ------------------
  128|  3.69k|				++i;
  129|  24.9k|			} else {
  130|       |				/* key=val */
  131|  81.9k|				for (val_end = val_start; val_end < size && buf[val_end] != ' '; ++val_end) {}
  ------------------
  |  Branch (131:31): [True: 58.4k, False: 23.4k]
  |  Branch (131:49): [True: 56.9k, False: 1.50k]
  ------------------
  132|  24.9k|				i = val_end;
  133|  24.9k|			}
  134|  29.6k|		}
  135|       |
  136|       |		/* Now that we found our keys and values, let's render the attribute. */
  137|   109k|		if (is_id) {
  ------------------
  |  Branch (137:7): [True: 103k, False: 6.32k]
  ------------------
  138|   103k|			if (rendered_id) continue;
  ------------------
  |  Branch (138:8): [True: 2.10k, False: 101k]
  ------------------
  139|   101k|			if (val_end == val_start) continue;
  ------------------
  |  Branch (139:8): [True: 26.4k, False: 74.8k]
  ------------------
  140|  74.8k|			rendered_id = 1;
  141|  74.8k|			HOEDOWN_BUFPUTSL(ob, " id=\"");
  ------------------
  |  |  119|  74.8k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  142|  74.8k|			escape_html(ob, buf + val_start, val_end - val_start);
  143|  74.8k|			hoedown_buffer_putc(ob, '"');
  144|  74.8k|		} else if (is_class) {
  ------------------
  |  Branch (144:14): [True: 4.68k, False: 1.63k]
  ------------------
  145|  4.68k|			if (val_end == val_start) continue;
  ------------------
  |  Branch (145:8): [True: 834, False: 3.85k]
  ------------------
  146|  3.85k|			if (!class) {
  ------------------
  |  Branch (146:8): [True: 3.24k, False: 611]
  ------------------
  147|  3.24k|				class = hoedown_buffer_new(size);
  148|  3.24k|				must_free_class = 1;
  149|  3.24k|			}
  150|  3.85k|			escape_html(class, buf + val_start, val_end - val_start);
  151|  3.85k|			hoedown_buffer_putc(class, ' ');
  152|  3.85k|		} else {
  153|  1.63k|			if (key_end == key_start) continue;
  ------------------
  |  Branch (153:8): [True: 0, False: 1.63k]
  ------------------
  154|  1.63k|			hoedown_buffer_putc(ob, ' ');
  155|  1.63k|			escape_html(ob, buf + key_start, key_end - key_start);
  156|  1.63k|			HOEDOWN_BUFPUTSL(ob, "=\"");
  ------------------
  |  |  119|  1.63k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  157|  1.63k|			escape_html(ob, buf + val_start, val_end - val_start);
  158|  1.63k|			hoedown_buffer_putc(ob, '"');
  159|  1.63k|		}
  160|   109k|	}
  161|       |
  162|   123k|	if (class) {
  ------------------
  |  Branch (162:6): [True: 4.00k, False: 119k]
  ------------------
  163|  4.00k|		if (class->size > 0) {
  ------------------
  |  Branch (163:7): [True: 4.00k, False: 0]
  ------------------
  164|  4.00k|			HOEDOWN_BUFPUTSL(ob, " class=\"");
  ------------------
  |  |  119|  4.00k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  165|  4.00k|			hoedown_buffer_put(ob, class->data, class->size-1);
  166|  4.00k|			hoedown_buffer_putc(ob, '"');
  167|  4.00k|		}
  168|  4.00k|		if (must_free_class) {
  ------------------
  |  Branch (168:7): [True: 3.24k, False: 757]
  ------------------
  169|  3.24k|			hoedown_buffer_free(class);
  170|  3.24k|		}
  171|  4.00k|	}
  172|   123k|	return 1;
  173|   123k|}
html.c:rndr_double_emphasis:
  296|  9.53k|{
  297|  9.53k|	if (!content || !content->size)
  ------------------
  |  Branch (297:6): [True: 0, False: 9.53k]
  |  Branch (297:18): [True: 4.20k, False: 5.32k]
  ------------------
  298|  4.20k|		return 0;
  299|       |
  300|  5.32k|	HOEDOWN_BUFPUTSL(ob, "<strong>");
  ------------------
  |  |  119|  5.32k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  301|  5.32k|	hoedown_buffer_put(ob, content->data, content->size);
  302|  5.32k|	HOEDOWN_BUFPUTSL(ob, "</strong>");
  ------------------
  |  |  119|  5.32k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  303|       |
  304|  5.32k|	return 1;
  305|  9.53k|}
html.c:rndr_emphasis:
  309|  3.02k|{
  310|  3.02k|	if (!content || !content->size) return 0;
  ------------------
  |  Branch (310:6): [True: 0, False: 3.02k]
  |  Branch (310:18): [True: 363, False: 2.66k]
  ------------------
  311|  2.66k|	HOEDOWN_BUFPUTSL(ob, "<em>");
  ------------------
  |  |  119|  2.66k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  312|  2.66k|	if (content) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (312:6): [True: 2.66k, False: 0]
  ------------------
  313|  2.66k|	HOEDOWN_BUFPUTSL(ob, "</em>");
  ------------------
  |  |  119|  2.66k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  314|  2.66k|	return 1;
  315|  3.02k|}
html.c:rndr_underline:
  319|  45.3k|{
  320|  45.3k|	if (!content || !content->size)
  ------------------
  |  Branch (320:6): [True: 0, False: 45.3k]
  |  Branch (320:18): [True: 753, False: 44.6k]
  ------------------
  321|    753|		return 0;
  322|       |
  323|  44.6k|	HOEDOWN_BUFPUTSL(ob, "<u>");
  ------------------
  |  |  119|  44.6k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  324|  44.6k|	hoedown_buffer_put(ob, content->data, content->size);
  325|  44.6k|	HOEDOWN_BUFPUTSL(ob, "</u>");
  ------------------
  |  |  119|  44.6k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  326|       |
  327|  44.6k|	return 1;
  328|  45.3k|}
html.c:rndr_highlight:
  332|    612|{
  333|    612|	if (!content || !content->size)
  ------------------
  |  Branch (333:6): [True: 0, False: 612]
  |  Branch (333:18): [True: 314, False: 298]
  ------------------
  334|    314|		return 0;
  335|       |
  336|    298|	HOEDOWN_BUFPUTSL(ob, "<mark>");
  ------------------
  |  |  119|    298|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  337|    298|	hoedown_buffer_put(ob, content->data, content->size);
  338|    298|	HOEDOWN_BUFPUTSL(ob, "</mark>");
  ------------------
  |  |  119|    298|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  339|       |
  340|    298|	return 1;
  341|    612|}
html.c:rndr_quote:
  345|   178k|{
  346|   178k|	if (!content || !content->size)
  ------------------
  |  Branch (346:6): [True: 1.43k, False: 177k]
  |  Branch (346:18): [True: 673, False: 176k]
  ------------------
  347|  2.10k|		return 0;
  348|       |
  349|   176k|	HOEDOWN_BUFPUTSL(ob, "<q>");
  ------------------
  |  |  119|   176k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  350|   176k|	hoedown_buffer_put(ob, content->data, content->size);
  351|   176k|	HOEDOWN_BUFPUTSL(ob, "</q>");
  ------------------
  |  |  119|   176k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  352|       |
  353|   176k|	return 1;
  354|   178k|}
html.c:rndr_triple_emphasis:
  731|  1.55k|{
  732|  1.55k|	if (!content || !content->size) return 0;
  ------------------
  |  Branch (732:6): [True: 0, False: 1.55k]
  |  Branch (732:18): [True: 216, False: 1.34k]
  ------------------
  733|  1.34k|	HOEDOWN_BUFPUTSL(ob, "<strong><em>");
  ------------------
  |  |  119|  1.34k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  734|  1.34k|	hoedown_buffer_put(ob, content->data, content->size);
  735|  1.34k|	HOEDOWN_BUFPUTSL(ob, "</em></strong>");
  ------------------
  |  |  119|  1.34k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  736|  1.34k|	return 1;
  737|  1.55k|}
html.c:rndr_strikethrough:
  284|  4.97k|{
  285|  4.97k|	if (!content || !content->size)
  ------------------
  |  Branch (285:6): [True: 0, False: 4.97k]
  |  Branch (285:18): [True: 2.58k, False: 2.38k]
  ------------------
  286|  2.58k|		return 0;
  287|       |
  288|  2.38k|	HOEDOWN_BUFPUTSL(ob, "<del>");
  ------------------
  |  |  119|  2.38k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  289|  2.38k|	hoedown_buffer_put(ob, content->data, content->size);
  290|  2.38k|	HOEDOWN_BUFPUTSL(ob, "</del>");
  ------------------
  |  |  119|  2.38k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  291|  2.38k|	return 1;
  292|  4.97k|}
html.c:rndr_superscript:
  867|   189k|{
  868|   189k|	if (!content || !content->size) return 0;
  ------------------
  |  Branch (868:6): [True: 0, False: 189k]
  |  Branch (868:18): [True: 3.72k, False: 185k]
  ------------------
  869|   185k|	HOEDOWN_BUFPUTSL(ob, "<sup>");
  ------------------
  |  |  119|   185k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  870|   185k|	hoedown_buffer_put(ob, content->data, content->size);
  871|   185k|	HOEDOWN_BUFPUTSL(ob, "</sup>");
  ------------------
  |  |  119|   185k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  872|   185k|	return 1;
  873|   189k|}
html.c:rndr_normal_text:
  877|  8.50M|{
  878|  8.50M|	if (content)
  ------------------
  |  Branch (878:6): [True: 8.50M, False: 0]
  ------------------
  879|  8.50M|		escape_html(ob, content->data, content->size);
  880|  8.50M|}
html.c:rndr_blockcode:
  214|  7.50k|{
  215|  7.50k|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (215:6): [True: 1.37k, False: 6.12k]
  ------------------
  216|       |
  217|  7.50k|	if (lang) {
  ------------------
  |  Branch (217:6): [True: 4.16k, False: 3.33k]
  ------------------
  218|  4.16k|		hoedown_html_renderer_state *state = data->opaque;
  219|  4.16k|		if ((state->flags & HOEDOWN_HTML_FENCED_CODE_SCRIPT) &&
  ------------------
  |  Branch (219:7): [True: 4.16k, False: 0]
  ------------------
  220|  4.16k|		    lang->size > 7 && memcmp(lang->data, "script@", 7) == 0 && text) {
  ------------------
  |  Branch (220:7): [True: 1.84k, False: 2.31k]
  |  Branch (220:25): [True: 850, False: 999]
  |  Branch (220:66): [True: 255, False: 595]
  ------------------
  221|    255|			HOEDOWN_BUFPUTSL(ob, "<script type=\"");
  ------------------
  |  |  119|    255|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  222|    255|			escape_html(ob, lang->data + 7, lang->size - 7);
  223|    255|			HOEDOWN_BUFPUTSL(ob, "\">\n");
  ------------------
  |  |  119|    255|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  224|    255|			hoedown_buffer_put(ob, text->data, text->size);
  225|    255|			HOEDOWN_BUFPUTSL(ob, "</script>\n");
  ------------------
  |  |  119|    255|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  226|    255|			return;
  227|    255|		}
  228|  3.91k|		HOEDOWN_BUFPUTSL(ob, "<pre><code");
  ------------------
  |  |  119|  3.91k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  229|  3.91k|		if (attr && attr->size) {
  ------------------
  |  Branch (229:7): [True: 757, False: 3.15k]
  |  Branch (229:15): [True: 757, False: 0]
  ------------------
  230|    757|			hoedown_buffer *lang_class = hoedown_buffer_new(lang->size + 9);
  231|    757|			if (lang->size) {
  ------------------
  |  Branch (231:8): [True: 757, False: 0]
  ------------------
  232|    757|				HOEDOWN_BUFPUTSL(lang_class, "language-");
  ------------------
  |  |  119|    757|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  233|    757|				escape_html(lang_class, lang->data, lang->size);
  234|    757|				if (lang_class->data[lang_class->size-1] != ' ') {
  ------------------
  |  Branch (234:9): [True: 757, False: 0]
  ------------------
  235|    757|					hoedown_buffer_putc(lang_class, ' ');
  236|    757|				}
  237|    757|			}
  238|    757|			rndr_attributes(ob, attr->data, attr->size, lang_class, data);
  239|    757|			hoedown_buffer_free(lang_class);
  240|  3.15k|		} else {
  241|  3.15k|			HOEDOWN_BUFPUTSL(ob, " class=\"language-");
  ------------------
  |  |  119|  3.15k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  242|  3.15k|			escape_html(ob, lang->data, lang->size);
  243|  3.15k|			hoedown_buffer_putc(ob, '"');
  244|  3.15k|		}
  245|  3.91k|		hoedown_buffer_putc(ob, '>');
  246|  3.91k|	} else if (attr && attr->size) {
  ------------------
  |  Branch (246:13): [True: 1.40k, False: 1.93k]
  |  Branch (246:21): [True: 1.40k, False: 0]
  ------------------
  247|  1.40k|		HOEDOWN_BUFPUTSL(ob, "<pre><code");
  ------------------
  |  |  119|  1.40k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  248|  1.40k|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  249|  1.40k|		hoedown_buffer_putc(ob, '>');
  250|  1.93k|	} else {
  251|  1.93k|		HOEDOWN_BUFPUTSL(ob, "<pre><code>");
  ------------------
  |  |  119|  1.93k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  252|  1.93k|	}
  253|       |
  254|  7.24k|	if (text)
  ------------------
  |  Branch (254:6): [True: 1.91k, False: 5.32k]
  ------------------
  255|  1.91k|		escape_html(ob, text->data, text->size);
  256|       |
  257|  7.24k|	HOEDOWN_BUFPUTSL(ob, "</code></pre>\n");
  ------------------
  |  |  119|  7.24k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  258|  7.24k|}
html.c:rndr_blockquote:
  262|  22.7k|{
  263|  22.7k|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (263:6): [True: 15.3k, False: 7.48k]
  ------------------
  264|  22.7k|	HOEDOWN_BUFPUTSL(ob, "<blockquote>\n");
  ------------------
  |  |  119|  22.7k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  265|  22.7k|	if (content) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (265:6): [True: 22.7k, False: 0]
  ------------------
  266|  22.7k|	HOEDOWN_BUFPUTSL(ob, "</blockquote>\n");
  ------------------
  |  |  119|  22.7k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  267|  22.7k|}
html.c:rndr_header:
  417|  78.1k|{
  418|  78.1k|	hoedown_html_renderer_state *state = data->opaque;
  419|       |
  420|  78.1k|	if (ob->size)
  ------------------
  |  Branch (420:6): [True: 72.2k, False: 5.96k]
  ------------------
  421|  72.2k|		hoedown_buffer_putc(ob, '\n');
  422|       |
  423|  78.1k|	hoedown_buffer *merged_attr = hoedown_buffer_new(sizeof(hoedown_buffer));
  424|       |
  425|  78.1k|	if (attr && attr->size) {
  ------------------
  |  Branch (425:6): [True: 76.9k, False: 1.28k]
  |  Branch (425:14): [True: 553, False: 76.3k]
  ------------------
  426|    553|		hoedown_buffer_put(merged_attr, attr->data, attr->size);
  427|    553|	}
  428|  78.1k|	if (content && content->size && ((state->flags & HOEDOWN_HTML_HEADER_ID) || (level <= state->toc_data.nesting_level))) {
  ------------------
  |  Branch (428:6): [True: 76.9k, False: 1.28k]
  |  Branch (428:17): [True: 76.3k, False: 543]
  |  Branch (428:35): [True: 76.3k, False: 0]
  |  Branch (428:78): [True: 0, False: 0]
  ------------------
  429|  76.3k|		hoedown_buffer_puts(merged_attr, " #");
  430|  76.3k|		rndr_header_id(merged_attr, content->data, content->size, 0, data);
  431|  76.3k|	}
  432|       |
  433|  78.1k|	if (merged_attr && merged_attr->size) {
  ------------------
  |  Branch (433:6): [True: 78.1k, False: 0]
  |  Branch (433:21): [True: 76.6k, False: 1.51k]
  ------------------
  434|  76.6k|		hoedown_buffer_printf(ob, "<h%d", level);
  435|  76.6k|		rndr_attributes(ob, merged_attr->data, merged_attr->size, NULL, data);
  436|  76.6k|		hoedown_buffer_putc(ob, '>');
  437|  76.6k|	} else {
  438|  1.51k|		hoedown_buffer_printf(ob, "<h%d>", level);
  439|  1.51k|	}
  440|       |
  441|  78.1k|	hoedown_buffer_free(merged_attr);
  442|       |
  443|  78.1k|	if (content) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (443:6): [True: 76.9k, False: 1.28k]
  ------------------
  444|  78.1k|	hoedown_buffer_printf(ob, "</h%d>\n", level);
  445|  78.1k|}
html.c:rndr_hrule:
  741|  16.9k|{
  742|  16.9k|	hoedown_html_renderer_state *state = data->opaque;
  743|  16.9k|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (743:6): [True: 11.7k, False: 5.16k]
  ------------------
  744|  16.9k|	hoedown_buffer_puts(ob, USE_XHTML(state) ? "<hr/>\n" : "<hr>\n");
  ------------------
  |  |   15|  16.9k|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 16.9k, False: 0]
  |  |  ------------------
  ------------------
  745|  16.9k|}
html.c:rndr_list:
  503|  53.6k|{
  504|  53.6k|        hoedown_html_renderer_state *state = data->opaque;
  505|       |
  506|  53.6k|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (506:6): [True: 37.9k, False: 15.7k]
  ------------------
  507|       |
  508|  53.6k|	if (flags & HOEDOWN_LIST_ORDERED) {
  ------------------
  |  Branch (508:6): [True: 14.0k, False: 39.5k]
  ------------------
  509|  14.0k|		HOEDOWN_BUFPUTSL(ob, "<ol");
  ------------------
  |  |  119|  14.0k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  510|  39.5k|	} else if (flags & HOEDOWN_LIST_DEFINITION) {
  ------------------
  |  Branch (510:13): [True: 19.0k, False: 20.5k]
  ------------------
  511|  19.0k|		HOEDOWN_BUFPUTSL(ob, "<dl");
  ------------------
  |  |  119|  19.0k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  512|  20.5k|	} else {
  513|  20.5k|		HOEDOWN_BUFPUTSL(ob, "<ul");
  ------------------
  |  |  119|  20.5k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  514|  20.5k|	}
  515|  53.6k|	if (attr && attr->size) {
  ------------------
  |  Branch (515:6): [True: 53.6k, False: 0]
  |  Branch (515:14): [True: 1.00k, False: 52.6k]
  ------------------
  516|  1.00k|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  517|  1.00k|	}
  518|       |
  519|  53.6k|	HOEDOWN_BUFPUTSL(ob, ">\n");
  ------------------
  |  |  119|  53.6k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  520|       |
  521|  53.6k|	if (content) {
  ------------------
  |  Branch (521:6): [True: 53.6k, False: 0]
  ------------------
  522|  53.6k|		if (flags & HOEDOWN_LI_RADIO) {
  ------------------
  |  Branch (522:7): [True: 0, False: 53.6k]
  ------------------
  523|       |			// Rewrite the content to fill in any list ids
  524|      0|			state->cur_list_id++;
  525|      0|			hoedown_buffer *replace = hoedown_buffer_new(RADIO_NAME_THUNK_LEN);
  ------------------
  |  |   21|      0|#define RADIO_NAME_THUNK_LEN (sizeof(RADIO_NAME_THUNK) - 1)
  |  |  ------------------
  |  |  |  |   20|      0|#define RADIO_NAME_THUNK RADIO_NAME_PREFIX "00000000"
  |  |  |  |  ------------------
  |  |  |  |  |  |   19|      0|#define RADIO_NAME_PREFIX "radio-list-"
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  526|      0|			hoedown_buffer_printf(replace, "%s%08x", RADIO_NAME_PREFIX, state->cur_list_id);
  ------------------
  |  |   19|      0|#define RADIO_NAME_PREFIX "radio-list-"
  ------------------
  527|      0|			buffer_copy_with_replace(ob, content, RADIO_NAME_THUNK, replace);
  ------------------
  |  |   20|      0|#define RADIO_NAME_THUNK RADIO_NAME_PREFIX "00000000"
  |  |  ------------------
  |  |  |  |   19|      0|#define RADIO_NAME_PREFIX "radio-list-"
  |  |  ------------------
  ------------------
  528|  53.6k|		} else {
  529|  53.6k|			hoedown_buffer_put(ob, content->data, content->size);
  530|  53.6k|		}
  531|  53.6k|        }
  532|       |
  533|  53.6k|	if (flags & HOEDOWN_LIST_ORDERED) {
  ------------------
  |  Branch (533:6): [True: 14.0k, False: 39.5k]
  ------------------
  534|  14.0k|		HOEDOWN_BUFPUTSL(ob, "</ol>\n");
  ------------------
  |  |  119|  14.0k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  535|  39.5k|	} else if (flags & HOEDOWN_LIST_DEFINITION) {
  ------------------
  |  Branch (535:13): [True: 19.0k, False: 20.5k]
  ------------------
  536|  19.0k|		HOEDOWN_BUFPUTSL(ob, "</dl>\n");
  ------------------
  |  |  119|  19.0k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  537|  20.5k|	} else {
  538|  20.5k|		HOEDOWN_BUFPUTSL(ob, "</ul>\n");
  ------------------
  |  |  119|  20.5k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  539|  20.5k|	}
  540|  53.6k|}
html.c:rndr_listitem:
  544|   272k|{
  545|   272k|	if (content) {
  ------------------
  |  Branch (545:6): [True: 272k, False: 0]
  ------------------
  546|   272k|		hoedown_html_renderer_state *state = data->opaque;
  547|   272k|		size_t prefix = 0;
  548|   272k|		size_t size = content->size;
  549|   272k|		int is_li_tag = 0;
  550|   330k|		while (size && content->data[size - 1] == '\n')
  ------------------
  |  Branch (550:10): [True: 279k, False: 50.5k]
  |  Branch (550:18): [True: 57.7k, False: 221k]
  ------------------
  551|  57.7k|			size--;
  552|       |
  553|   272k|		if (*flags & HOEDOWN_LI_DD) {
  ------------------
  |  Branch (553:7): [True: 103k, False: 169k]
  ------------------
  554|   103k|			HOEDOWN_BUFPUTSL(ob, "<dd");
  ------------------
  |  |  119|   103k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  555|   169k|		} else  if (*flags & HOEDOWN_LI_DT) {
  ------------------
  |  Branch (555:15): [True: 97.6k, False: 71.7k]
  ------------------
  556|  97.6k|			HOEDOWN_BUFPUTSL(ob, "<dt");
  ------------------
  |  |  119|  97.6k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  557|  97.6k|		} else {
  558|  71.7k|			HOEDOWN_BUFPUTSL(ob, "<li");
  ------------------
  |  |  119|  71.7k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  559|  71.7k|			is_li_tag = 1;
  560|  71.7k|		}
  561|       |
  562|   272k|		if (attr && attr->size) {
  ------------------
  |  Branch (562:7): [True: 272k, False: 0]
  |  Branch (562:15): [True: 5.08k, False: 267k]
  ------------------
  563|  5.08k|			rndr_attributes(ob, attr->data, attr->size, NULL, data);
  564|  5.08k|		}
  565|   272k|		hoedown_buffer_putc(ob, '>');
  566|       |
  567|   272k|		if (USE_TASK_LIST(state) && is_li_tag && size >= 3) {
  ------------------
  |  |   16|   545k|#define USE_TASK_LIST(opt) (opt->flags & HOEDOWN_HTML_USE_TASK_LIST)
  |  |  ------------------
  |  |  |  Branch (16:28): [True: 272k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (567:31): [True: 71.7k, False: 200k]
  |  Branch (567:44): [True: 45.4k, False: 26.2k]
  ------------------
  568|       |			/* Block list items are wrapped in <p> tags. Output the opening tag now,
  569|       |			 * then check for a task list. */
  570|  45.4k|			if (*flags & HOEDOWN_LI_BLOCK) {
  ------------------
  |  Branch (570:8): [True: 21.1k, False: 24.3k]
  ------------------
  571|  21.1k|				prefix = 3;
  572|  21.1k|				hoedown_buffer_put(ob, content->data, prefix);
  573|  21.1k|			}
  574|  45.4k|			if (size >= prefix + 3) {
  ------------------
  |  Branch (574:8): [True: 42.3k, False: 3.15k]
  ------------------
  575|  42.3k|				if (strncmp((char *)content->data + prefix, "[ ]", 3) == 0) {
  ------------------
  |  Branch (575:9): [True: 975, False: 41.3k]
  ------------------
  576|    975|					HOEDOWN_BUFPUTSL(ob, "<input type=\"checkbox\"");
  ------------------
  |  |  119|    975|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  577|    975|					hoedown_buffer_puts(ob, USE_XHTML(state) ? "/>" : ">");
  ------------------
  |  |   15|    975|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 975, False: 0]
  |  |  ------------------
  ------------------
  578|    975|					prefix += 3;
  579|    975|					*flags |= HOEDOWN_LI_TASK;
  580|  41.3k|				} else if (strncasecmp((char *)content->data + prefix, "[x]", 3) == 0) {
  ------------------
  |  Branch (580:16): [True: 536, False: 40.7k]
  ------------------
  581|    536|					HOEDOWN_BUFPUTSL(ob, "<input checked=\"\" type=\"checkbox\"");
  ------------------
  |  |  119|    536|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  582|    536|					hoedown_buffer_puts(ob, USE_XHTML(state) ? "/>" : ">");
  ------------------
  |  |   15|    536|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 536, False: 0]
  |  |  ------------------
  ------------------
  583|    536|					prefix += 3;
  584|    536|					*flags |= HOEDOWN_LI_TASK;
  585|    536|				}
  586|  42.3k|			}
  587|  45.4k|		}
  588|   272k|		if (USE_RADIO_LIST(state) && is_li_tag && size >= 3) {
  ------------------
  |  |   17|   545k|#define USE_RADIO_LIST(opt) (opt->flags & HOEDOWN_HTML_USE_RADIO_LIST)
  |  |  ------------------
  |  |  |  Branch (17:29): [True: 0, False: 272k]
  |  |  ------------------
  ------------------
  |  Branch (588:32): [True: 0, False: 0]
  |  Branch (588:45): [True: 0, False: 0]
  ------------------
  589|      0|			if (*flags & HOEDOWN_LI_BLOCK) {
  ------------------
  |  Branch (589:8): [True: 0, False: 0]
  ------------------
  590|      0|				prefix = 3;
  591|      0|				hoedown_buffer_put(ob, content->data, prefix);
  592|      0|			}
  593|      0|			if (size >= prefix + 3) {
  ------------------
  |  Branch (593:8): [True: 0, False: 0]
  ------------------
  594|      0|				if (strncmp((char *)content->data + prefix, "( )", 3) == 0) {
  ------------------
  |  Branch (594:9): [True: 0, False: 0]
  ------------------
  595|      0|					HOEDOWN_BUFPUTSL(ob, "<input type=\"radio\" name=\"" RADIO_NAME_THUNK "\"");
  ------------------
  |  |  119|      0|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  596|      0|					hoedown_buffer_puts(ob, USE_XHTML(state) ? "/>" : ">");
  ------------------
  |  |   15|      0|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  597|      0|					prefix += 3;
  598|      0|					*flags |= HOEDOWN_LI_RADIO;
  599|      0|				} else if (strncasecmp((char *)content->data + prefix, "(x)", 3) == 0) {
  ------------------
  |  Branch (599:16): [True: 0, False: 0]
  ------------------
  600|      0|					HOEDOWN_BUFPUTSL(ob, "<input checked=\"\" type=\"radio\" name=\"" RADIO_NAME_THUNK "\"");
  ------------------
  |  |  119|      0|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  601|      0|					hoedown_buffer_puts(ob, USE_XHTML(state) ? "/>" : ">");
  ------------------
  |  |   15|      0|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  602|      0|					prefix += 3;
  603|      0|					*flags |= HOEDOWN_LI_RADIO;
  604|      0|				}
  605|      0|			}
  606|      0|		}
  607|       |
  608|   272k|		hoedown_buffer_put(ob, content->data+prefix, size-prefix);
  609|   272k|	} else {
  610|      0|		if (*flags & HOEDOWN_LI_DD) {
  ------------------
  |  Branch (610:7): [True: 0, False: 0]
  ------------------
  611|      0|			HOEDOWN_BUFPUTSL(ob, "<dd>");
  ------------------
  |  |  119|      0|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  612|      0|		} else if (*flags & HOEDOWN_LI_DT) {
  ------------------
  |  Branch (612:14): [True: 0, False: 0]
  ------------------
  613|      0|			HOEDOWN_BUFPUTSL(ob, "<dt>");
  ------------------
  |  |  119|      0|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  614|      0|		} else {
  615|      0|			HOEDOWN_BUFPUTSL(ob, "<li>");
  ------------------
  |  |  119|      0|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  616|      0|		}
  617|      0|	}
  618|   272k|	if (*flags & HOEDOWN_LI_DD) {
  ------------------
  |  Branch (618:6): [True: 103k, False: 169k]
  ------------------
  619|   103k|		HOEDOWN_BUFPUTSL(ob, "</dd>\n");
  ------------------
  |  |  119|   103k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  620|   169k|	} else if (*flags & HOEDOWN_LI_DT) {
  ------------------
  |  Branch (620:13): [True: 97.6k, False: 71.7k]
  ------------------
  621|  97.6k|		HOEDOWN_BUFPUTSL(ob, "</dt>\n");
  ------------------
  |  |  119|  97.6k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  622|  97.6k|	} else {
  623|  71.7k|		HOEDOWN_BUFPUTSL(ob, "</li>\n");
  ------------------
  |  |  119|  71.7k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  624|  71.7k|	}
  625|   272k|}
html.c:rndr_paragraph:
  629|   237k|{
  630|   237k|	hoedown_html_renderer_state *state = data->opaque;
  631|   237k|	size_t i = 0;
  632|       |
  633|   237k|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (633:6): [True: 191k, False: 46.0k]
  ------------------
  634|       |
  635|   237k|	if (!content || !content->size)
  ------------------
  |  Branch (635:6): [True: 0, False: 237k]
  |  Branch (635:18): [True: 280, False: 237k]
  ------------------
  636|    280|		return;
  637|       |
  638|   606k|	while (i < content->size && isspace(content->data[i])) i++;
  ------------------
  |  Branch (638:9): [True: 605k, False: 410]
  |  Branch (638:30): [True: 368k, False: 236k]
  ------------------
  639|       |
  640|   237k|	if (i == content->size)
  ------------------
  |  Branch (640:6): [True: 410, False: 236k]
  ------------------
  641|    410|		return;
  642|       |
  643|   236k|	HOEDOWN_BUFPUTSL(ob, "<p");
  ------------------
  |  |  119|   236k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  644|       |
  645|   236k|	if (attr && attr->size) {
  ------------------
  |  Branch (645:6): [True: 207k, False: 28.8k]
  |  Branch (645:14): [True: 0, False: 207k]
  ------------------
  646|      0|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  647|      0|	}
  648|       |
  649|   236k|	HOEDOWN_BUFPUTSL(ob, ">");
  ------------------
  |  |  119|   236k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  650|       |
  651|   236k|	if (state->flags & HOEDOWN_HTML_HARD_WRAP) {
  ------------------
  |  Branch (651:6): [True: 236k, False: 0]
  ------------------
  652|   236k|		size_t org;
  653|   789k|		while (i < content->size) {
  ------------------
  |  Branch (653:10): [True: 789k, False: 0]
  ------------------
  654|   789k|			org = i;
  655|  1.55G|			while (i < content->size && content->data[i] != '\n')
  ------------------
  |  Branch (655:11): [True: 1.55G, False: 236k]
  |  Branch (655:32): [True: 1.55G, False: 552k]
  ------------------
  656|  1.55G|				i++;
  657|       |
  658|   789k|			if (i > org)
  ------------------
  |  Branch (658:8): [True: 785k, False: 4.46k]
  ------------------
  659|   785k|				hoedown_buffer_put(ob, content->data + org, i - org);
  660|       |
  661|       |			/*
  662|       |			 * do not insert a line break if this newline
  663|       |			 * is the last character on the paragraph
  664|       |			 */
  665|   789k|			if (i >= content->size - 1)
  ------------------
  |  Branch (665:8): [True: 236k, False: 552k]
  ------------------
  666|   236k|				break;
  667|       |
  668|   552k|			rndr_linebreak(ob, data);
  669|   552k|			i++;
  670|   552k|		}
  671|   236k|	} else if (state->flags & HOEDOWN_HTML_LINE_CONTINUE) {
  ------------------
  |  Branch (671:13): [True: 0, False: 0]
  ------------------
  672|      0|		size_t org;
  673|      0|		while (i < content->size) {
  ------------------
  |  Branch (673:10): [True: 0, False: 0]
  ------------------
  674|      0|			org = i;
  675|      0|			while (i < content->size && content->data[i] != '\n') {
  ------------------
  |  Branch (675:11): [True: 0, False: 0]
  |  Branch (675:32): [True: 0, False: 0]
  ------------------
  676|      0|				++i;
  677|      0|			}
  678|      0|			if (i > org) {
  ------------------
  |  Branch (678:8): [True: 0, False: 0]
  ------------------
  679|      0|				hoedown_buffer_put(ob, content->data + org, i - org);
  680|      0|			}
  681|       |
  682|      0|			if (i >= content->size - 1) {
  ------------------
  |  Branch (682:8): [True: 0, False: 0]
  ------------------
  683|      0|				break;
  684|      0|			}
  685|       |
  686|      0|			if (content->data[i] == '\n' &&
  ------------------
  |  Branch (686:8): [True: 0, False: 0]
  ------------------
  687|      0|				(isascii(content->data[i-1]) || isascii(content->data[i+1]))) {
  ------------------
  |  Branch (687:6): [True: 0, False: 0]
  |  Branch (687:37): [True: 0, False: 0]
  ------------------
  688|      0|				if (i < 5 ||
  ------------------
  |  Branch (688:9): [True: 0, False: 0]
  ------------------
  689|      0|					strncmp((char *)content->data+i-5, "<br/>", 5) != 0 ||
  ------------------
  |  Branch (689:6): [True: 0, False: 0]
  ------------------
  690|      0|					strncmp((char *)content->data+i-4, "<br>", 4) != 0) {
  ------------------
  |  Branch (690:6): [True: 0, False: 0]
  ------------------
  691|      0|					HOEDOWN_BUFPUTSL(ob, " ");
  ------------------
  |  |  119|      0|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  692|      0|				}
  693|      0|			}
  694|      0|			++i;
  695|      0|		}
  696|      0|	} else {
  697|      0|		hoedown_buffer_put(ob, content->data + i, content->size - i);
  698|      0|	}
  699|   236k|	HOEDOWN_BUFPUTSL(ob, "</p>\n");
  ------------------
  |  |  119|   236k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  700|   236k|}
html.c:rndr_table:
  794|  11.1k|{
  795|  11.1k|    if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (795:9): [True: 7.00k, False: 4.15k]
  ------------------
  796|  11.1k|    HOEDOWN_BUFPUTSL(ob, "<table");
  ------------------
  |  |  119|  11.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  797|  11.1k|    if (attr) rndr_attributes(ob, attr->data, attr->size, NULL, data);
  ------------------
  |  Branch (797:9): [True: 11.1k, False: 0]
  ------------------
  798|  11.1k|    HOEDOWN_BUFPUTSL(ob, ">\n");
  ------------------
  |  |  119|  11.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  799|  11.1k|    hoedown_buffer_put(ob, content->data, content->size);
  800|  11.1k|    HOEDOWN_BUFPUTSL(ob, "</table>\n");
  ------------------
  |  |  119|  11.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  801|  11.1k|}
html.c:rndr_table_header:
  805|  11.1k|{
  806|  11.1k|    if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (806:9): [True: 0, False: 11.1k]
  ------------------
  807|  11.1k|    HOEDOWN_BUFPUTSL(ob, "<thead>\n");
  ------------------
  |  |  119|  11.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  808|  11.1k|    hoedown_buffer_put(ob, content->data, content->size);
  809|  11.1k|    HOEDOWN_BUFPUTSL(ob, "</thead>\n");
  ------------------
  |  |  119|  11.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  810|  11.1k|}
html.c:rndr_table_body:
  814|  11.1k|{
  815|  11.1k|    if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (815:9): [True: 11.1k, False: 0]
  ------------------
  816|  11.1k|    HOEDOWN_BUFPUTSL(ob, "<tbody>\n");
  ------------------
  |  |  119|  11.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  817|  11.1k|    hoedown_buffer_put(ob, content->data, content->size);
  818|  11.1k|    HOEDOWN_BUFPUTSL(ob, "</tbody>\n");
  ------------------
  |  |  119|  11.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  819|  11.1k|}
html.c:rndr_tablerow:
  823|  25.8k|{
  824|  25.8k|	HOEDOWN_BUFPUTSL(ob, "<tr>\n");
  ------------------
  |  |  119|  25.8k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  825|  25.8k|	if (content) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (825:6): [True: 25.8k, False: 0]
  ------------------
  826|  25.8k|	HOEDOWN_BUFPUTSL(ob, "</tr>\n");
  ------------------
  |  |  119|  25.8k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  827|  25.8k|}
html.c:rndr_tablecell:
  831|  40.8k|{
  832|  40.8k|	if (flags & HOEDOWN_TABLE_HEADER) {
  ------------------
  |  Branch (832:6): [True: 16.1k, False: 24.6k]
  ------------------
  833|  16.1k|		HOEDOWN_BUFPUTSL(ob, "<th");
  ------------------
  |  |  119|  16.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  834|  24.6k|	} else {
  835|  24.6k|		HOEDOWN_BUFPUTSL(ob, "<td");
  ------------------
  |  |  119|  24.6k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  836|  24.6k|	}
  837|       |
  838|  40.8k|	switch (flags & HOEDOWN_TABLE_ALIGNMASK) {
  839|  15.3k|	case HOEDOWN_TABLE_ALIGN_CENTER:
  ------------------
  |  Branch (839:2): [True: 15.3k, False: 25.4k]
  ------------------
  840|  15.3k|		HOEDOWN_BUFPUTSL(ob, " style=\"text-align: center\">");
  ------------------
  |  |  119|  15.3k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  841|  15.3k|		break;
  842|       |
  843|  5.82k|	case HOEDOWN_TABLE_ALIGN_LEFT:
  ------------------
  |  Branch (843:2): [True: 5.82k, False: 34.9k]
  ------------------
  844|  5.82k|		HOEDOWN_BUFPUTSL(ob, " style=\"text-align: left\">");
  ------------------
  |  |  119|  5.82k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  845|  5.82k|		break;
  846|       |
  847|  14.7k|	case HOEDOWN_TABLE_ALIGN_RIGHT:
  ------------------
  |  Branch (847:2): [True: 14.7k, False: 26.0k]
  ------------------
  848|  14.7k|		HOEDOWN_BUFPUTSL(ob, " style=\"text-align: right\">");
  ------------------
  |  |  119|  14.7k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  849|  14.7k|		break;
  850|       |
  851|  4.86k|	default:
  ------------------
  |  Branch (851:2): [True: 4.86k, False: 35.9k]
  ------------------
  852|  4.86k|		HOEDOWN_BUFPUTSL(ob, ">");
  ------------------
  |  |  119|  4.86k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  853|  40.8k|	}
  854|       |
  855|  40.8k|	if (content)
  ------------------
  |  Branch (855:6): [True: 40.8k, False: 0]
  ------------------
  856|  40.8k|		hoedown_buffer_put(ob, content->data, content->size);
  857|       |
  858|  40.8k|	if (flags & HOEDOWN_TABLE_HEADER) {
  ------------------
  |  Branch (858:6): [True: 16.1k, False: 24.6k]
  ------------------
  859|  16.1k|		HOEDOWN_BUFPUTSL(ob, "</th>\n");
  ------------------
  |  |  119|  16.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  860|  24.6k|	} else {
  861|  24.6k|		HOEDOWN_BUFPUTSL(ob, "</td>\n");
  ------------------
  |  |  119|  24.6k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  862|  24.6k|	}
  863|  40.8k|}
html.c:rndr_footnotes:
  884|    639|{
  885|    639|	hoedown_html_renderer_state *state = data->opaque;
  886|       |
  887|    639|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (887:6): [True: 639, False: 0]
  ------------------
  888|    639|	HOEDOWN_BUFPUTSL(ob, "<div class=\"footnotes\">\n");
  ------------------
  |  |  119|    639|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  889|    639|	hoedown_buffer_puts(ob, USE_XHTML(state) ? "<hr/>\n" : "<hr>\n");
  ------------------
  |  |   15|    639|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 639, False: 0]
  |  |  ------------------
  ------------------
  890|    639|	HOEDOWN_BUFPUTSL(ob, "<ol>\n");
  ------------------
  |  |  119|    639|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  891|       |
  892|    639|	if (content) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (892:6): [True: 639, False: 0]
  ------------------
  893|       |
  894|    639|	HOEDOWN_BUFPUTSL(ob, "\n</ol>\n</div>\n");
  ------------------
  |  |  119|    639|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  895|    639|}
html.c:rndr_footnote_def:
  899|  1.08k|{
  900|  1.08k|	size_t i = 0;
  901|  1.08k|	int pfound = 0;
  902|       |
  903|       |	/* insert anchor at the end of first paragraph block */
  904|  1.08k|	if (content) {
  ------------------
  |  Branch (904:6): [True: 1.08k, False: 0]
  ------------------
  905|  47.0M|		while ((i+3) < content->size) {
  ------------------
  |  Branch (905:10): [True: 47.0M, False: 597]
  ------------------
  906|  47.0M|			if (content->data[i++] != '<') continue;
  ------------------
  |  Branch (906:8): [True: 46.9M, False: 9.04k]
  ------------------
  907|  9.04k|			if (content->data[i++] != '/') continue;
  ------------------
  |  Branch (907:8): [True: 4.41k, False: 4.63k]
  ------------------
  908|  4.63k|			if (content->data[i++] != 'p' && content->data[i] != 'P') continue;
  ------------------
  |  Branch (908:8): [True: 3.91k, False: 722]
  |  Branch (908:37): [True: 3.71k, False: 195]
  ------------------
  909|    917|			if (content->data[i] != '>') continue;
  ------------------
  |  Branch (909:8): [True: 429, False: 488]
  ------------------
  910|    488|			i -= 3;
  911|    488|			pfound = 1;
  912|    488|			break;
  913|    917|		}
  914|  1.08k|	}
  915|       |
  916|  1.08k|	hoedown_buffer_printf(ob, "\n<li id=\"fn%d\">\n", num);
  917|  1.08k|	if (pfound) {
  ------------------
  |  Branch (917:6): [True: 488, False: 597]
  ------------------
  918|    488|		hoedown_buffer_put(ob, content->data, i);
  919|    488|		hoedown_buffer_printf(ob, "&nbsp;<a href=\"#fnref%d\" rev=\"footnote\">&#8617;</a>", num);
  920|    488|		hoedown_buffer_put(ob, content->data + i, content->size - i);
  921|    597|	} else if (content) {
  ------------------
  |  Branch (921:13): [True: 597, False: 0]
  ------------------
  922|    597|		hoedown_buffer_put(ob, content->data, content->size);
  923|    597|	}
  924|  1.08k|	HOEDOWN_BUFPUTSL(ob, "</li>\n");
  ------------------
  |  |  119|  1.08k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  925|  1.08k|}
html.c:rndr_autolink:
  177|  13.2k|{
  178|  13.2k|	hoedown_html_renderer_state *state = data->opaque;
  179|       |
  180|  13.2k|	if (!link || !link->size)
  ------------------
  |  Branch (180:6): [True: 0, False: 13.2k]
  |  Branch (180:15): [True: 0, False: 13.2k]
  ------------------
  181|      0|		return 0;
  182|       |
  183|  13.2k|	HOEDOWN_BUFPUTSL(ob, "<a href=\"");
  ------------------
  |  |  119|  13.2k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  184|  13.2k|	if (type == HOEDOWN_AUTOLINK_EMAIL)
  ------------------
  |  Branch (184:6): [True: 3.02k, False: 10.1k]
  ------------------
  185|  3.02k|		HOEDOWN_BUFPUTSL(ob, "mailto:");
  ------------------
  |  |  119|  3.02k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  186|  13.2k|	escape_href(ob, link->data, link->size);
  187|       |
  188|  13.2k|	if (state->link_attributes) {
  ------------------
  |  Branch (188:6): [True: 0, False: 13.2k]
  ------------------
  189|      0|		hoedown_buffer_putc(ob, '\"');
  190|      0|		state->link_attributes(ob, link, data);
  191|      0|		hoedown_buffer_putc(ob, '>');
  192|  13.2k|	} else {
  193|  13.2k|		HOEDOWN_BUFPUTSL(ob, "\">");
  ------------------
  |  |  119|  13.2k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  194|  13.2k|	}
  195|       |
  196|       |	/*
  197|       |	 * Pretty printing: if we get an email address as
  198|       |	 * an actual URI, e.g. `mailto:foo@bar.com`, we don't
  199|       |	 * want to print the `mailto:` prefix
  200|       |	 */
  201|  13.2k|	if (hoedown_buffer_prefix(link, "mailto:") == 0) {
  ------------------
  |  Branch (201:6): [True: 4.23k, False: 8.97k]
  ------------------
  202|  4.23k|		escape_html(ob, link->data + 7, link->size - 7);
  203|  8.97k|	} else {
  204|  8.97k|		escape_html(ob, link->data, link->size);
  205|  8.97k|	}
  206|       |
  207|  13.2k|	HOEDOWN_BUFPUTSL(ob, "</a>");
  ------------------
  |  |  119|  13.2k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  208|       |
  209|  13.2k|	return 1;
  210|  13.2k|}
html.c:escape_href:
   62|   306k|{
   63|   306k|	hoedown_escape_href(ob, source, length);
   64|   306k|}
html.c:rndr_image:
  749|  11.2k|{
  750|  11.2k|	hoedown_html_renderer_state *state = data->opaque;
  751|  11.2k|	if (!link || !link->size) return 0;
  ------------------
  |  Branch (751:6): [True: 3.70k, False: 7.52k]
  |  Branch (751:15): [True: 1.60k, False: 5.91k]
  ------------------
  752|       |
  753|  5.91k|	HOEDOWN_BUFPUTSL(ob, "<img src=\"");
  ------------------
  |  |  119|  5.91k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  754|  5.91k|	escape_href(ob, link->data, link->size);
  755|  5.91k|	HOEDOWN_BUFPUTSL(ob, "\" alt=\"");
  ------------------
  |  |  119|  5.91k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  756|       |
  757|  5.91k|	if (alt && alt->size)
  ------------------
  |  Branch (757:6): [True: 574, False: 5.34k]
  |  Branch (757:13): [True: 574, False: 0]
  ------------------
  758|    574|		escape_html(ob, alt->data, alt->size);
  759|       |
  760|  5.91k|	if (title && title->size) {
  ------------------
  |  Branch (760:6): [True: 4.17k, False: 1.74k]
  |  Branch (760:15): [True: 4.17k, False: 0]
  ------------------
  761|  4.17k|		HOEDOWN_BUFPUTSL(ob, "\" title=\"");
  ------------------
  |  |  119|  4.17k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  762|  4.17k|		escape_html(ob, title->data, title->size); }
  763|       |
  764|  5.91k|	hoedown_buffer_putc(ob, '"');
  765|  5.91k|	if (attr && attr->size) {
  ------------------
  |  Branch (765:6): [True: 1.08k, False: 4.83k]
  |  Branch (765:14): [True: 1.08k, False: 0]
  ------------------
  766|  1.08k|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  767|  1.08k|	}
  768|       |
  769|  5.91k|	hoedown_buffer_puts(ob, USE_XHTML(state) ? "/>" : ">");
  ------------------
  |  |   15|  5.91k|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 5.91k, False: 0]
  |  |  ------------------
  ------------------
  770|  5.91k|	return 1;
  771|  11.2k|}
html.c:rndr_linebreak:
  358|   581k|{
  359|   581k|	hoedown_html_renderer_state *state = data->opaque;
  360|   581k|	hoedown_buffer_puts(ob, USE_XHTML(state) ? "<br/>\n" : "<br>\n");
  ------------------
  |  |   15|   581k|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 581k, False: 0]
  |  |  ------------------
  ------------------
  361|   581k|	return 1;
  362|   581k|}
html.c:rndr_link:
  449|   324k|{
  450|   324k|	hoedown_html_renderer_state *state = data->opaque;
  451|       |
  452|   324k|	HOEDOWN_BUFPUTSL(ob, "<a href=\"");
  ------------------
  |  |  119|   324k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  453|       |
  454|   324k|	if (link && link->size) {
  ------------------
  |  Branch (454:6): [True: 321k, False: 3.08k]
  |  Branch (454:14): [True: 287k, False: 34.8k]
  ------------------
  455|   287k|		escape_href(ob, link->data, link->size);
  456|   287k|	}
  457|       |
  458|   324k|	if (title && title->size) {
  ------------------
  |  Branch (458:6): [True: 161k, False: 163k]
  |  Branch (458:15): [True: 161k, False: 0]
  ------------------
  459|   161k|		HOEDOWN_BUFPUTSL(ob, "\" title=\"");
  ------------------
  |  |  119|   161k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  460|   161k|		escape_html(ob, title->data, title->size);
  461|   161k|	}
  462|       |
  463|   324k|	hoedown_buffer_putc(ob, '"');
  464|   324k|	if (state->link_attributes) {
  ------------------
  |  Branch (464:6): [True: 0, False: 324k]
  ------------------
  465|      0|		state->link_attributes(ob, link, data);
  466|      0|	}
  467|   324k|	if (attr && attr->size) {
  ------------------
  |  Branch (467:6): [True: 25.8k, False: 299k]
  |  Branch (467:14): [True: 25.8k, False: 0]
  ------------------
  468|  25.8k|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  469|  25.8k|	}
  470|   324k|	hoedown_buffer_putc(ob, '>');
  471|       |
  472|   324k|	if (content && content->size) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (472:6): [True: 33.1k, False: 291k]
  |  Branch (472:17): [True: 32.5k, False: 510]
  ------------------
  473|   324k|	HOEDOWN_BUFPUTSL(ob, "</a>");
  ------------------
  |  |  119|   324k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  474|   324k|	return 1;
  475|   324k|}
html.c:rndr_footnote_ref:
  929|  1.08k|{
  930|  1.08k|	hoedown_buffer_printf(ob, "<sup id=\"fnref%d\"><a href=\"#fn%d\" rel=\"footnote\">%d</a></sup>", num, num, num);
  931|  1.08k|	return 1;
  932|  1.08k|}
html.c:rndr_math:
  936|  28.5k|{
  937|  28.5k|	hoedown_buffer_put(ob, (const uint8_t *)(displaymode ? "\\[" : "\\("), 2);
  ------------------
  |  Branch (937:43): [True: 3.60k, False: 24.9k]
  ------------------
  938|  28.5k|	escape_html(ob, text->data, text->size);
  939|  28.5k|	hoedown_buffer_put(ob, (const uint8_t *)(displaymode ? "\\]" : "\\)"), 2);
  ------------------
  |  Branch (939:43): [True: 3.60k, False: 24.9k]
  ------------------
  940|  28.5k|	return 1;
  941|  28.5k|}
html.c:rndr_raw_html:
  775|  47.7k|{
  776|  47.7k|	hoedown_html_renderer_state *state = data->opaque;
  777|       |
  778|       |	/* ESCAPE overrides SKIP_HTML. It doesn't look to see if
  779|       |	 * there are any valid tags, just escapes all of them. */
  780|  47.7k|	if((state->flags & HOEDOWN_HTML_ESCAPE) != 0) {
  ------------------
  |  Branch (780:5): [True: 47.7k, False: 0]
  ------------------
  781|  47.7k|		escape_html(ob, text->data, text->size);
  782|  47.7k|		return 1;
  783|  47.7k|	}
  784|       |
  785|      0|	if ((state->flags & HOEDOWN_HTML_SKIP_HTML) != 0)
  ------------------
  |  Branch (785:6): [True: 0, False: 0]
  ------------------
  786|      0|		return 1;
  787|       |
  788|      0|	hoedown_buffer_put(ob, text->data, text->size);
  789|      0|	return 1;
  790|      0|}

hoedown_find_html5_block_tag:
  140|   244k|{
  141|   244k|  enum
  142|   244k|    {
  143|   244k|      TOTAL_KEYWORDS = 35,
  144|   244k|      MIN_WORD_LENGTH = 1,
  145|   244k|      MAX_WORD_LENGTH = 10,
  146|   244k|      MIN_HASH_VALUE = 1,
  147|   244k|      MAX_HASH_VALUE = 37
  148|   244k|    };
  149|       |
  150|   244k|  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
  ------------------
  |  Branch (150:7): [True: 145k, False: 99.0k]
  |  Branch (150:33): [True: 142k, False: 3.31k]
  ------------------
  151|   142k|    {
  152|   142k|      register int key = hash (str, len);
  153|       |
  154|   142k|      if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
  ------------------
  |  Branch (154:11): [True: 91.9k, False: 50.6k]
  |  Branch (154:36): [True: 91.9k, False: 0]
  ------------------
  155|  91.9k|        {
  156|  91.9k|          register const char *resword;
  157|       |
  158|  91.9k|          switch (key - 1)
  ------------------
  |  Branch (158:19): [True: 85.5k, False: 6.41k]
  ------------------
  159|  91.9k|            {
  160|  5.45k|              case 0:
  ------------------
  |  Branch (160:15): [True: 5.45k, False: 86.5k]
  ------------------
  161|  5.45k|                resword = "p";
  162|  5.45k|                goto compare;
  163|  5.50k|              case 2:
  ------------------
  |  Branch (163:15): [True: 5.50k, False: 86.4k]
  ------------------
  164|  5.50k|                resword = "ul";
  165|  5.50k|                goto compare;
  166|  44.3k|              case 3:
  ------------------
  |  Branch (166:15): [True: 44.3k, False: 47.6k]
  ------------------
  167|  44.3k|                resword = "pre";
  168|  44.3k|                goto compare;
  169|  1.20k|              case 5:
  ------------------
  |  Branch (169:15): [True: 1.20k, False: 90.7k]
  ------------------
  170|  1.20k|                resword = "form";
  171|  1.20k|                goto compare;
  172|    603|              case 6:
  ------------------
  |  Branch (172:15): [True: 603, False: 91.3k]
  ------------------
  173|    603|                resword = "style";
  174|    603|                goto compare;
  175|    834|              case 7:
  ------------------
  |  Branch (175:15): [True: 834, False: 91.1k]
  ------------------
  176|    834|                resword = "footer";
  177|    834|                goto compare;
  178|    992|              case 8:
  ------------------
  |  Branch (178:15): [True: 992, False: 90.9k]
  ------------------
  179|    992|                resword = "figure";
  180|    992|                goto compare;
  181|  1.55k|              case 9:
  ------------------
  |  Branch (181:15): [True: 1.55k, False: 90.4k]
  ------------------
  182|  1.55k|                resword = "section";
  183|  1.55k|                goto compare;
  184|  1.05k|              case 10:
  ------------------
  |  Branch (184:15): [True: 1.05k, False: 90.9k]
  ------------------
  185|  1.05k|                resword = "fieldset";
  186|  1.05k|                goto compare;
  187|  2.00k|              case 11:
  ------------------
  |  Branch (187:15): [True: 2.00k, False: 89.9k]
  ------------------
  188|  2.00k|                resword = "dl";
  189|  2.00k|                goto compare;
  190|  1.95k|              case 12:
  ------------------
  |  Branch (190:15): [True: 1.95k, False: 90.0k]
  ------------------
  191|  1.95k|                resword = "figcaption";
  192|  1.95k|                goto compare;
  193|    675|              case 13:
  ------------------
  |  Branch (193:15): [True: 675, False: 91.3k]
  ------------------
  194|    675|                resword = "div";
  195|    675|                goto compare;
  196|  1.34k|              case 14:
  ------------------
  |  Branch (196:15): [True: 1.34k, False: 90.6k]
  ------------------
  197|  1.34k|                resword = "del";
  198|  1.34k|                goto compare;
  199|    160|              case 15:
  ------------------
  |  Branch (199:15): [True: 160, False: 91.8k]
  ------------------
  200|    160|                resword = "header";
  201|    160|                goto compare;
  202|    354|              case 16:
  ------------------
  |  Branch (202:15): [True: 354, False: 91.6k]
  ------------------
  203|    354|                resword = "script";
  204|    354|                goto compare;
  205|    330|              case 17:
  ------------------
  |  Branch (205:15): [True: 330, False: 91.6k]
  ------------------
  206|    330|                resword = "math";
  207|    330|                goto compare;
  208|    469|              case 18:
  ------------------
  |  Branch (208:15): [True: 469, False: 91.5k]
  ------------------
  209|    469|                resword = "video";
  210|    469|                goto compare;
  211|    649|              case 19:
  ------------------
  |  Branch (211:15): [True: 649, False: 91.3k]
  ------------------
  212|    649|                resword = "ol";
  213|    649|                goto compare;
  214|  5.36k|              case 20:
  ------------------
  |  Branch (214:15): [True: 5.36k, False: 86.6k]
  ------------------
  215|  5.36k|                resword = "noscript";
  216|  5.36k|                goto compare;
  217|    201|              case 21:
  ------------------
  |  Branch (217:15): [True: 201, False: 91.7k]
  ------------------
  218|    201|                resword = "hgroup";
  219|    201|                goto compare;
  220|    308|              case 22:
  ------------------
  |  Branch (220:15): [True: 308, False: 91.6k]
  ------------------
  221|    308|                resword = "table";
  222|    308|                goto compare;
  223|    477|              case 23:
  ------------------
  |  Branch (223:15): [True: 477, False: 91.5k]
  ------------------
  224|    477|                resword = "blockquote";
  225|    477|                goto compare;
  226|    184|              case 24:
  ------------------
  |  Branch (226:15): [True: 184, False: 91.8k]
  ------------------
  227|    184|                resword = "article";
  228|    184|                goto compare;
  229|    702|              case 25:
  ------------------
  |  Branch (229:15): [True: 702, False: 91.2k]
  ------------------
  230|    702|                resword = "aside";
  231|    702|                goto compare;
  232|  1.35k|              case 26:
  ------------------
  |  Branch (232:15): [True: 1.35k, False: 90.6k]
  ------------------
  233|  1.35k|                resword = "ins";
  234|  1.35k|                goto compare;
  235|    245|              case 27:
  ------------------
  |  Branch (235:15): [True: 245, False: 91.7k]
  ------------------
  236|    245|                resword = "iframe";
  237|    245|                goto compare;
  238|  3.14k|              case 28:
  ------------------
  |  Branch (238:15): [True: 3.14k, False: 88.8k]
  ------------------
  239|  3.14k|                resword = "canvas";
  240|  3.14k|                goto compare;
  241|    532|              case 29:
  ------------------
  |  Branch (241:15): [True: 532, False: 91.4k]
  ------------------
  242|    532|                resword = "nav";
  243|    532|                goto compare;
  244|    654|              case 30:
  ------------------
  |  Branch (244:15): [True: 654, False: 91.3k]
  ------------------
  245|    654|                resword = "h6";
  246|    654|                goto compare;
  247|    158|              case 31:
  ------------------
  |  Branch (247:15): [True: 158, False: 91.8k]
  ------------------
  248|    158|                resword = "h5";
  249|    158|                goto compare;
  250|    128|              case 32:
  ------------------
  |  Branch (250:15): [True: 128, False: 91.8k]
  ------------------
  251|    128|                resword = "h4";
  252|    128|                goto compare;
  253|    430|              case 33:
  ------------------
  |  Branch (253:15): [True: 430, False: 91.5k]
  ------------------
  254|    430|                resword = "h3";
  255|    430|                goto compare;
  256|    300|              case 34:
  ------------------
  |  Branch (256:15): [True: 300, False: 91.6k]
  ------------------
  257|    300|                resword = "h2";
  258|    300|                goto compare;
  259|    542|              case 35:
  ------------------
  |  Branch (259:15): [True: 542, False: 91.4k]
  ------------------
  260|    542|                resword = "h1";
  261|    542|                goto compare;
  262|  1.33k|              case 36:
  ------------------
  |  Branch (262:15): [True: 1.33k, False: 90.6k]
  ------------------
  263|  1.33k|                resword = "output";
  264|  1.33k|                goto compare;
  265|  91.9k|            }
  266|  6.41k|          return 0;
  267|  85.5k|        compare:
  268|  85.5k|          if ((((unsigned char)*str ^ (unsigned char)*resword) & ~32) == 0 && !gperf_case_strncmp (str, resword, len) && resword[len] == '\0')
  ------------------
  |  Branch (268:15): [True: 53.0k, False: 32.5k]
  |  Branch (268:79): [True: 7.53k, False: 45.5k]
  |  Branch (268:122): [True: 7.53k, False: 0]
  ------------------
  269|  7.53k|            return resword;
  270|  85.5k|        }
  271|   142k|    }
  272|   230k|  return 0;
  273|   244k|}
html5_blocks.c:hash:
   88|   142k|{
   89|   142k|  static const unsigned char asso_values[] =
   90|   142k|    {
   91|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
   92|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
   93|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
   94|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
   95|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
   96|   142k|      26, 25, 24, 23, 22, 21, 38, 38, 38, 38,
   97|   142k|      38, 38, 38, 38, 38, 17, 14,  9, 10, 38,
   98|   142k|       2, 16,  8,  6,  1, 38, 38,  0, 13, 18,
   99|   142k|       0, 38, 38,  1,  4,  1, 13, 38, 38, 38,
  100|   142k|      38, 38, 38, 38, 38, 38, 38, 17, 14,  9,
  101|   142k|      10, 38,  2, 16,  8,  6,  1, 38, 38,  0,
  102|   142k|      13, 18,  0, 38, 38,  1,  4,  1, 13, 38,
  103|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  104|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  105|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  106|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  107|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  108|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  109|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  110|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  111|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  112|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  113|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  114|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  115|   142k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  116|   142k|      38, 38, 38, 38, 38, 38, 38
  117|   142k|    };
  118|   142k|  register int hval = len;
  119|       |
  120|   142k|  switch (hval)
  121|   142k|    {
  122|   123k|      default:
  ------------------
  |  Branch (122:7): [True: 123k, False: 19.4k]
  ------------------
  123|   123k|        hval += asso_values[(unsigned char)str[1]+1];
  124|       |      /*FALLTHROUGH*/
  125|   142k|      case 1:
  ------------------
  |  Branch (125:7): [True: 19.4k, False: 123k]
  ------------------
  126|   142k|        hval += asso_values[(unsigned char)str[0]];
  127|   142k|        break;
  128|   142k|    }
  129|   142k|  return hval;
  130|   142k|}
html5_blocks.c:gperf_case_strncmp:
   63|  53.0k|{
   64|   111k|  for (; n > 0;)
  ------------------
  |  Branch (64:10): [True: 104k, False: 7.53k]
  ------------------
   65|   104k|    {
   66|   104k|      unsigned char c1 = gperf_downcase[(unsigned char)*s1++];
   67|   104k|      unsigned char c2 = gperf_downcase[(unsigned char)*s2++];
   68|   104k|      if (c1 != 0 && c1 == c2)
  ------------------
  |  Branch (68:11): [True: 103k, False: 579]
  |  Branch (68:22): [True: 58.6k, False: 44.9k]
  ------------------
   69|  58.6k|        {
   70|  58.6k|          n--;
   71|  58.6k|          continue;
   72|  58.6k|        }
   73|  45.5k|      return (int)c1 - (int)c2;
   74|   104k|    }
   75|  7.53k|  return 0;
   76|  53.0k|}

hoedown_stack_init:
   11|  35.4k|{
   12|  35.4k|	assert(st);
  ------------------
  |  Branch (12:2): [True: 0, False: 35.4k]
  |  Branch (12:2): [True: 35.4k, False: 0]
  ------------------
   13|       |
   14|  35.4k|	st->item = NULL;
   15|  35.4k|	st->size = st->asize = 0;
   16|       |
   17|  35.4k|	if (!initial_size)
  ------------------
  |  Branch (17:6): [True: 0, False: 35.4k]
  ------------------
   18|      0|		initial_size = 8;
   19|       |
   20|  35.4k|	hoedown_stack_grow(st, initial_size);
   21|  35.4k|}
hoedown_stack_uninit:
   25|  35.4k|{
   26|  35.4k|	assert(st);
  ------------------
  |  Branch (26:2): [True: 0, False: 35.4k]
  |  Branch (26:2): [True: 35.4k, False: 0]
  ------------------
   27|       |
   28|  35.4k|	free(st->item);
   29|  35.4k|}
hoedown_stack_grow:
   33|  37.3k|{
   34|  37.3k|	assert(st);
  ------------------
  |  Branch (34:2): [True: 0, False: 37.3k]
  |  Branch (34:2): [True: 37.3k, False: 0]
  ------------------
   35|       |
   36|  37.3k|	if (st->asize >= neosz)
  ------------------
  |  Branch (36:6): [True: 0, False: 37.3k]
  ------------------
   37|      0|		return;
   38|       |
   39|  37.3k|	st->item = hoedown_realloc(st->item, neosz * sizeof(void *));
   40|  37.3k|	memset(st->item + st->asize, 0x0, (neosz - st->asize) * sizeof(void *));
   41|       |
   42|  37.3k|	st->asize = neosz;
   43|       |
   44|  37.3k|	if (st->size > neosz)
  ------------------
  |  Branch (44:6): [True: 0, False: 37.3k]
  ------------------
   45|      0|		st->size = neosz;
   46|  37.3k|}
hoedown_stack_push:
   50|  86.7k|{
   51|  86.7k|	assert(st);
  ------------------
  |  Branch (51:2): [True: 0, False: 86.7k]
  |  Branch (51:2): [True: 86.7k, False: 0]
  ------------------
   52|       |
   53|  86.7k|	if (st->size >= st->asize)
  ------------------
  |  Branch (53:6): [True: 1.84k, False: 84.9k]
  ------------------
   54|  1.84k|		hoedown_stack_grow(st, st->size * 2);
   55|       |
   56|  86.7k|	st->item[st->size++] = item;
   57|  86.7k|}

LLVMFuzzerTestOneInput:
   50|  11.8k|int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   51|  11.8k|  struct option_data opt;
   52|  11.8k|  hoedown_buffer *ib, *ob, *meta;
   53|  11.8k|  hoedown_renderer *renderer = NULL;
   54|  11.8k|  void (*renderer_free)(hoedown_renderer *) = NULL;
   55|  11.8k|  hoedown_document *document;
   56|       |
   57|       |  /* Parse options */
   58|  11.8k|  opt.basename = "fuzz";
   59|  11.8k|  opt.done = 0;
   60|  11.8k|  opt.show_time = 0;
   61|  11.8k|  opt.iunit = DEF_IUNIT;
  ------------------
  |  |   18|  11.8k|#define DEF_IUNIT 1024
  ------------------
   62|  11.8k|  opt.ounit = DEF_OUNIT;
  ------------------
  |  |   19|  11.8k|#define DEF_OUNIT 64
  ------------------
   63|  11.8k|  opt.filename = NULL;
   64|  11.8k|  opt.renderer = RENDERER_HTML;
   65|  11.8k|  opt.toc_level = 0;
   66|  11.8k|  opt.attr_activation = 0;
   67|       |  // opt.html_flags = 0;
   68|  11.8k|  opt.html_flags = HOEDOWN_HTML_SKIP_HTML | HOEDOWN_HTML_ESCAPE | HOEDOWN_HTML_HARD_WRAP | HOEDOWN_HTML_USE_XHTML | HOEDOWN_HTML_USE_TASK_LIST | HOEDOWN_HTML_LINE_CONTINUE | HOEDOWN_HTML_HEADER_ID | HOEDOWN_HTML_FENCED_CODE_SCRIPT;
   69|       |  //opt.extensions = 0;
   70|  11.8k|  opt.extensions = HOEDOWN_EXT_TABLES | HOEDOWN_EXT_MULTILINE_TABLES | HOEDOWN_EXT_FENCED_CODE | HOEDOWN_EXT_FOOTNOTES | HOEDOWN_EXT_DEFINITION_LISTS | HOEDOWN_EXT_BLOCKQUOTE_EMPTY_LINE | HOEDOWN_EXT_AUTOLINK | HOEDOWN_EXT_STRIKETHROUGH | HOEDOWN_EXT_UNDERLINE | HOEDOWN_EXT_HIGHLIGHT | HOEDOWN_EXT_QUOTE | HOEDOWN_EXT_SUPERSCRIPT | HOEDOWN_EXT_MATH | HOEDOWN_EXT_NO_INTRA_EMPHASIS | HOEDOWN_EXT_SPACE_HEADERS | HOEDOWN_EXT_MATH_EXPLICIT | HOEDOWN_EXT_HTML5_BLOCKS | HOEDOWN_EXT_NO_INTRA_UNDERLINE_EMPHASIS | HOEDOWN_EXT_DISABLE_INDENTED_CODE | HOEDOWN_EXT_SPECIAL_ATTRIBUTE | HOEDOWN_EXT_SCRIPT_TAGS | HOEDOWN_EXT_META_BLOCK;
   71|  11.8k|  opt.max_nesting = DEF_MAX_NESTING;
  ------------------
  |  |   20|  11.8k|#define DEF_MAX_NESTING 16
  ------------------
   72|  11.8k|  opt.link_attributes = 0;
   73|       |
   74|       |  /* Read everything */
   75|  11.8k|  ib = hoedown_buffer_new(opt.iunit);
   76|  11.8k|  hoedown_buffer_put(ib, data, size);
   77|       |
   78|  11.8k|  renderer = hoedown_html_renderer_new(opt.html_flags, opt.toc_level);
   79|  11.8k|  renderer_free = hoedown_html_renderer_free;
   80|       |
   81|       |  /* Perform Markdown rendering */
   82|  11.8k|  ob = hoedown_buffer_new(opt.ounit);
   83|  11.8k|  meta = hoedown_buffer_new(opt.ounit);
   84|  11.8k|  document = hoedown_document_new(renderer, opt.extensions, opt.max_nesting, opt.attr_activation, NULL, meta);
   85|       |
   86|  11.8k|  hoedown_html_renderer_state *state;
   87|  11.8k|  state = (hoedown_html_renderer_state *)renderer->opaque;
   88|       |
   89|  11.8k|  hoedown_document_render(document, ob, ib->data, ib->size);
   90|       |
   91|       |  /* Cleanup */
   92|  11.8k|  hoedown_buffer_free(ib);
   93|  11.8k|  hoedown_document_free(document);
   94|  11.8k|  renderer_free(renderer);
   95|       |
   96|       |  /* Write the result to stdout */
   97|       |  // (void)fwrite(ob->data, 1, ob->size, stdout);
   98|  11.8k|  hoedown_buffer_free(ob);
   99|       |
  100|  11.8k|  hoedown_buffer_free(meta);
  101|       |
  102|  11.8k|  return 0;
  103|  11.8k|}

