hoedown_autolink_is_safe:
   16|  30.1k|{
   17|  30.1k|	static const size_t valid_uris_count = 6;
   18|  30.1k|	static const char *valid_uris[] = {
   19|  30.1k|		"http://", "https://", "/", "#", "ftp://", "mailto:"
   20|  30.1k|	};
   21|  30.1k|	static const size_t valid_uris_size[] = { 7, 8, 1, 1, 6, 7 };
   22|  30.1k|	size_t i;
   23|       |
   24|   203k|	for (i = 0; i < valid_uris_count; ++i) {
  ------------------
  |  Branch (24:14): [True: 176k, False: 26.7k]
  ------------------
   25|   176k|		size_t len = valid_uris_size[i];
   26|       |
   27|   176k|		if (size > len &&
  ------------------
  |  Branch (27:7): [True: 173k, False: 3.10k]
  ------------------
   28|   176k|			strncasecmp((char *)data, valid_uris[i], len) == 0 &&
  ------------------
  |  Branch (28:4): [True: 4.42k, False: 168k]
  ------------------
   29|   176k|			isalnum(data[len]))
   30|  3.33k|			return 1;
   31|   176k|	}
   32|       |
   33|  26.7k|	return 0;
   34|  30.1k|}
hoedown_autolink__www:
  154|  92.6k|{
  155|  92.6k|	size_t link_end;
  156|       |
  157|  92.6k|	if (max_rewind > 0 && !ispunct(data[-1]) && !isspace(data[-1]))
  ------------------
  |  Branch (157:6): [True: 88.8k, False: 3.80k]
  |  Branch (157:24): [True: 70.2k, False: 18.5k]
  |  Branch (157:46): [True: 57.7k, False: 12.5k]
  ------------------
  158|  57.7k|		return 0;
  159|       |
  160|  34.9k|	if (size < 4 || memcmp(data, "www.", strlen("www.")) != 0)
  ------------------
  |  Branch (160:6): [True: 2.81k, False: 32.0k]
  |  Branch (160:18): [True: 19.5k, False: 12.5k]
  ------------------
  161|  22.3k|		return 0;
  162|       |
  163|  12.5k|	link_end = check_domain(data, size, 0);
  164|       |
  165|  12.5k|	if (link_end == 0)
  ------------------
  |  Branch (165:6): [True: 2.28k, False: 10.2k]
  ------------------
  166|  2.28k|		return 0;
  167|       |
  168|  15.8M|	while (link_end < size && !isspace(data[link_end]))
  ------------------
  |  Branch (168:9): [True: 15.8M, False: 2.04k]
  |  Branch (168:28): [True: 15.8M, False: 8.23k]
  ------------------
  169|  15.8M|		link_end++;
  170|       |
  171|  10.2k|	link_end = autolink_delim(data, link_end, max_rewind, size);
  172|       |
  173|  10.2k|	if (link_end == 0)
  ------------------
  |  Branch (173:6): [True: 0, False: 10.2k]
  ------------------
  174|      0|		return 0;
  175|       |
  176|  10.2k|	hoedown_buffer_put(link, data, link_end);
  177|  10.2k|	*rewind_p = 0;
  178|       |
  179|  10.2k|	return (int)link_end;
  180|  10.2k|}
hoedown_autolink__email:
  190|  98.7k|{
  191|  98.7k|	size_t link_end, rewind;
  192|  98.7k|	int nb = 0, np = 0;
  193|       |
  194|  6.11M|	for (rewind = 0; rewind < max_rewind; ++rewind) {
  ------------------
  |  Branch (194:19): [True: 6.10M, False: 7.55k]
  ------------------
  195|  6.10M|		uint8_t c = data[-1 - rewind];
  196|       |
  197|  6.10M|		if (isalnum(c))
  198|  40.6k|			continue;
  199|       |
  200|  6.06M|		if (strchr(".+-_", c) != NULL)
  ------------------
  |  Branch (200:7): [True: 5.97M, False: 91.1k]
  ------------------
  201|  5.97M|			continue;
  202|       |
  203|  91.1k|		break;
  204|  6.06M|	}
  205|       |
  206|  98.7k|	if (rewind == 0)
  ------------------
  |  Branch (206:6): [True: 34.2k, False: 64.4k]
  ------------------
  207|  34.2k|		return 0;
  208|       |
  209|   255M|	for (link_end = 0; link_end < size; ++link_end) {
  ------------------
  |  Branch (209:21): [True: 255M, False: 21.5k]
  ------------------
  210|   255M|		uint8_t c = data[link_end];
  211|       |
  212|   255M|		if (isalnum(c))
  213|  16.9M|			continue;
  214|       |
  215|   238M|		if (c == '@')
  ------------------
  |  Branch (215:7): [True: 72.0M, False: 166M]
  ------------------
  216|  72.0M|			nb++;
  217|   166M|		else if (c == '.' && link_end < size - 1)
  ------------------
  |  Branch (217:12): [True: 166M, False: 54.0k]
  |  Branch (217:24): [True: 166M, False: 231]
  ------------------
  218|   166M|			np++;
  219|  54.2k|		else if (c != '-' && c != '_')
  ------------------
  |  Branch (219:12): [True: 44.1k, False: 10.1k]
  |  Branch (219:24): [True: 42.9k, False: 1.13k]
  ------------------
  220|  42.9k|			break;
  221|   238M|	}
  222|       |
  223|  64.4k|	if (link_end < 2 || nb != 1 || np == 0 ||
  ------------------
  |  Branch (223:6): [True: 33.1k, False: 31.3k]
  |  Branch (223:22): [True: 27.6k, False: 3.66k]
  |  Branch (223:33): [True: 1.91k, False: 1.75k]
  ------------------
  224|  64.4k|		!isalpha(data[link_end - 1]))
  ------------------
  |  Branch (224:3): [True: 933, False: 818]
  ------------------
  225|  63.6k|		return 0;
  226|       |
  227|    818|	link_end = autolink_delim(data, link_end, max_rewind, size);
  228|       |
  229|    818|	if (link_end == 0)
  ------------------
  |  Branch (229:6): [True: 0, False: 818]
  ------------------
  230|      0|		return 0;
  231|       |
  232|    818|	hoedown_buffer_put(link, data - rewind, link_end + rewind);
  233|    818|	*rewind_p = rewind;
  234|       |
  235|    818|	return link_end;
  236|    818|}
hoedown_autolink__url:
  246|  2.12M|{
  247|  2.12M|	size_t link_end, rewind = 0, domain_len;
  248|       |
  249|  2.12M|	if (size < 4 || data[1] != '/' || data[2] != '/')
  ------------------
  |  Branch (249:6): [True: 131k, False: 1.98M]
  |  Branch (249:18): [True: 1.95M, False: 31.7k]
  |  Branch (249:36): [True: 1.63k, False: 30.1k]
  ------------------
  250|  2.08M|		return 0;
  251|       |
  252|   123k|	while (rewind < max_rewind && isalpha(data[-1 - rewind]))
  ------------------
  |  Branch (252:9): [True: 121k, False: 1.92k]
  ------------------
  253|  93.5k|		rewind++;
  254|       |
  255|  30.1k|	if (!hoedown_autolink_is_safe(data - rewind, size + rewind))
  ------------------
  |  Branch (255:6): [True: 26.7k, False: 3.33k]
  ------------------
  256|  26.7k|		return 0;
  257|       |
  258|  3.33k|	link_end = strlen("://");
  259|       |
  260|  3.33k|	domain_len = check_domain(
  261|  3.33k|		data + link_end,
  262|  3.33k|		size - link_end,
  263|  3.33k|		flags & HOEDOWN_AUTOLINK_SHORT_DOMAINS);
  264|       |
  265|  3.33k|	if (domain_len == 0)
  ------------------
  |  Branch (265:6): [True: 1.68k, False: 1.65k]
  ------------------
  266|  1.68k|		return 0;
  267|       |
  268|  1.65k|	link_end += domain_len;
  269|  3.19M|	while (link_end < size && !isspace(data[link_end]))
  ------------------
  |  Branch (269:9): [True: 3.19M, False: 888]
  |  Branch (269:28): [True: 3.19M, False: 764]
  ------------------
  270|  3.19M|		link_end++;
  271|       |
  272|  1.65k|	link_end = autolink_delim(data, link_end, max_rewind, size);
  273|       |
  274|  1.65k|	if (link_end == 0)
  ------------------
  |  Branch (274:6): [True: 0, False: 1.65k]
  ------------------
  275|      0|		return 0;
  276|       |
  277|  1.65k|	hoedown_buffer_put(link, data - rewind, link_end + rewind);
  278|  1.65k|	*rewind_p = rewind;
  279|       |
  280|  1.65k|	return link_end;
  281|  1.65k|}
autolink.c:check_domain:
  122|  15.9k|{
  123|  15.9k|	size_t i, np = 0;
  124|       |
  125|  15.9k|	if (!isalnum(data[0]))
  ------------------
  |  Branch (125:6): [True: 0, False: 15.9k]
  ------------------
  126|      0|		return 0;
  127|       |
  128|   402k|	for (i = 1; i < size - 1; ++i) {
  ------------------
  |  Branch (128:14): [True: 398k, False: 3.51k]
  ------------------
  129|   398k|		if (strchr(".:", data[i]) != NULL) np++;
  ------------------
  |  Branch (129:7): [True: 335k, False: 63.7k]
  ------------------
  130|  63.7k|		else if (!isalnum(data[i]) && data[i] != '-') break;
  ------------------
  |  Branch (130:12): [True: 13.4k, False: 50.2k]
  |  Branch (130:33): [True: 12.3k, False: 1.09k]
  ------------------
  131|   398k|	}
  132|       |
  133|  15.9k|	if (allow_short) {
  ------------------
  |  Branch (133:6): [True: 0, False: 15.9k]
  ------------------
  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|  15.9k|	} else {
  140|       |		/* a valid domain needs to have at least a dot.
  141|       |		 * that's as far as we get */
  142|  15.9k|		return np ? i : 0;
  ------------------
  |  Branch (142:10): [True: 11.9k, False: 3.97k]
  ------------------
  143|  15.9k|	}
  144|  15.9k|}
autolink.c:autolink_delim:
   38|  12.7k|{
   39|  12.7k|	uint8_t cclose, copen = 0;
   40|  12.7k|	size_t i;
   41|       |
   42|  16.1M|	for (i = 0; i < link_end; ++i)
  ------------------
  |  Branch (42:14): [True: 16.1M, False: 9.06k]
  ------------------
   43|  16.1M|		if (data[i] == '<') {
  ------------------
  |  Branch (43:7): [True: 3.69k, False: 16.1M]
  ------------------
   44|  3.69k|			link_end = i;
   45|  3.69k|			break;
   46|  3.69k|		}
   47|       |
   48|   118k|	while (link_end > 0) {
  ------------------
  |  Branch (48:9): [True: 118k, False: 0]
  ------------------
   49|   118k|		if (strchr("?!.,:", data[link_end - 1]) != NULL)
  ------------------
  |  Branch (49:7): [True: 100k, False: 18.2k]
  ------------------
   50|   100k|			link_end--;
   51|       |
   52|  18.2k|		else if (data[link_end - 1] == ';') {
  ------------------
  |  Branch (52:12): [True: 5.48k, False: 12.7k]
  ------------------
   53|  5.48k|			size_t new_end = link_end - 2;
   54|       |
   55|  11.7k|			while (new_end > 0 && isalpha(data[new_end]))
  ------------------
  |  Branch (55:11): [True: 11.7k, False: 0]
  ------------------
   56|  6.21k|				new_end--;
   57|       |
   58|  5.48k|			if (new_end < link_end - 2 && data[new_end] == '&')
  ------------------
  |  Branch (58:8): [True: 5.00k, False: 480]
  |  Branch (58:34): [True: 213, False: 4.79k]
  ------------------
   59|    213|				link_end = new_end;
   60|  5.27k|			else
   61|  5.27k|				link_end--;
   62|  5.48k|		}
   63|  12.7k|		else break;
   64|   118k|	}
   65|       |
   66|  12.7k|	if (link_end == 0)
  ------------------
  |  Branch (66:6): [True: 0, False: 12.7k]
  ------------------
   67|      0|		return 0;
   68|       |
   69|  12.7k|	cclose = data[link_end - 1];
   70|       |
   71|  12.7k|	switch (cclose) {
  ------------------
  |  Branch (71:10): [True: 8.84k, False: 3.91k]
  ------------------
   72|    250|	case '"':	copen = '"'; break;
  ------------------
  |  Branch (72:2): [True: 250, False: 12.5k]
  ------------------
   73|  2.49k|	case '\'':	copen = '\''; break;
  ------------------
  |  Branch (73:2): [True: 2.49k, False: 10.2k]
  ------------------
   74|    272|	case ')':	copen = '('; break;
  ------------------
  |  Branch (74:2): [True: 272, False: 12.4k]
  ------------------
   75|    472|	case ']':	copen = '['; break;
  ------------------
  |  Branch (75:2): [True: 472, False: 12.2k]
  ------------------
   76|    425|	case '}':	copen = '{'; break;
  ------------------
  |  Branch (76:2): [True: 425, False: 12.3k]
  ------------------
   77|  12.7k|	}
   78|       |
   79|  12.7k|	if (copen != 0) {
  ------------------
  |  Branch (79:6): [True: 3.91k, False: 8.84k]
  ------------------
   80|  3.91k|		size_t closing = 0;
   81|  3.91k|		size_t opening = 0;
   82|  3.91k|		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|  3.47M|		while (i < link_end) {
  ------------------
  |  Branch (104:10): [True: 3.47M, False: 3.91k]
  ------------------
  105|  3.47M|			if (data[i] == copen)
  ------------------
  |  Branch (105:8): [True: 8.02k, False: 3.46M]
  ------------------
  106|  8.02k|				opening++;
  107|  3.46M|			else if (data[i] == cclose)
  ------------------
  |  Branch (107:13): [True: 1.70M, False: 1.76M]
  ------------------
  108|  1.70M|				closing++;
  109|       |
  110|  3.47M|			i++;
  111|  3.47M|		}
  112|       |
  113|  3.91k|		if (closing != opening)
  ------------------
  |  Branch (113:7): [True: 3.59k, False: 323]
  ------------------
  114|  3.59k|			link_end--;
  115|  3.91k|	}
  116|       |
  117|  12.7k|	return link_end;
  118|  12.7k|}

hoedown_malloc:
   10|  1.53M|{
   11|  1.53M|	void *ret = malloc(size);
   12|       |
   13|  1.53M|	if (!ret) {
  ------------------
  |  Branch (13:6): [True: 0, False: 1.53M]
  ------------------
   14|      0|		fprintf(stderr, "Allocation failed.\n");
   15|      0|		abort();
   16|      0|	}
   17|       |
   18|  1.53M|	return ret;
   19|  1.53M|}
hoedown_calloc:
   23|  1.70M|{
   24|  1.70M|	void *ret = calloc(nmemb, size);
   25|       |
   26|  1.70M|	if (!ret) {
  ------------------
  |  Branch (26:6): [True: 0, False: 1.70M]
  ------------------
   27|      0|		fprintf(stderr, "Allocation failed.\n");
   28|      0|		abort();
   29|      0|	}
   30|       |
   31|  1.70M|	return ret;
   32|  1.70M|}
hoedown_realloc:
   36|  4.51M|{
   37|  4.51M|	void *ret = realloc(ptr, size);
   38|       |
   39|  4.51M|	if (!ret) {
  ------------------
  |  Branch (39:6): [True: 0, False: 4.51M]
  ------------------
   40|      0|		fprintf(stderr, "Allocation failed.\n");
   41|      0|		abort();
   42|      0|	}
   43|       |
   44|  4.51M|	return ret;
   45|  4.51M|}
hoedown_buffer_init:
   54|  1.49M|{
   55|  1.49M|	assert(buf);
   56|       |
   57|  1.49M|	buf->data = NULL;
   58|  1.49M|	buf->size = buf->asize = 0;
   59|  1.49M|	buf->unit = unit;
   60|  1.49M|	buf->data_realloc = data_realloc;
   61|  1.49M|	buf->data_free = data_free;
   62|  1.49M|	buf->buffer_free = buffer_free;
   63|  1.49M|}
hoedown_buffer_new:
   74|  1.49M|{
   75|  1.49M|	hoedown_buffer *ret = hoedown_malloc(sizeof (hoedown_buffer));
   76|  1.49M|	hoedown_buffer_init(ret, unit, hoedown_realloc, free, free);
   77|  1.49M|	return ret;
   78|  1.49M|}
hoedown_buffer_free:
   82|  1.81M|{
   83|  1.81M|	if (!buf) return;
  ------------------
  |  Branch (83:6): [True: 323k, False: 1.49M]
  ------------------
   84|  1.49M|	assert(buf && buf->unit);
   85|       |
   86|  1.49M|	buf->data_free(buf->data);
   87|       |
   88|  1.49M|	if (buf->buffer_free)
  ------------------
  |  Branch (88:6): [True: 1.49M, False: 0]
  ------------------
   89|  1.49M|		buf->buffer_free(buf);
   90|  1.49M|}
hoedown_buffer_reset:
   94|    416|{
   95|    416|	assert(buf && buf->unit);
   96|       |
   97|    416|	buf->data_free(buf->data);
   98|    416|	buf->data = NULL;
   99|    416|	buf->size = buf->asize = 0;
  100|    416|}
hoedown_buffer_grow:
  104|  5.25M|{
  105|  5.25M|	size_t neoasz;
  106|  5.25M|	assert(buf && buf->unit);
  107|       |
  108|  5.25M|	if (buf->asize >= neosz)
  ------------------
  |  Branch (108:6): [True: 786k, False: 4.47M]
  ------------------
  109|   786k|		return;
  110|       |
  111|  4.47M|	neoasz = buf->asize + buf->unit;
  112|   128M|	while (neoasz < neosz)
  ------------------
  |  Branch (112:9): [True: 123M, False: 4.47M]
  ------------------
  113|   123M|		neoasz += buf->unit;
  114|       |
  115|  4.47M|	buf->data = buf->data_realloc(buf->data, neoasz);
  116|  4.47M|	buf->asize = neoasz;
  117|  4.47M|}
hoedown_buffer_put:
  121|   128M|{
  122|   128M|	assert(buf && buf->unit);
  123|       |
  124|   128M|	if (buf->size + size > buf->asize)
  ------------------
  |  Branch (124:6): [True: 1.88M, False: 126M]
  ------------------
  125|  1.88M|		hoedown_buffer_grow(buf, buf->size + size);
  126|       |
  127|   128M|	memcpy(buf->data + buf->size, data, size);
  128|   128M|	buf->size += size;
  129|   128M|}
hoedown_buffer_puts:
  133|  61.4M|{
  134|  61.4M|	hoedown_buffer_put(buf, (const uint8_t *)str, strlen(str));
  135|  61.4M|}
hoedown_buffer_putc:
  139|   243M|{
  140|   243M|	assert(buf && buf->unit);
  141|       |
  142|   243M|	if (buf->size >= buf->asize)
  ------------------
  |  Branch (142:6): [True: 2.55M, False: 240M]
  ------------------
  143|  2.55M|		hoedown_buffer_grow(buf, buf->size + 1);
  144|       |
  145|   243M|	buf->data[buf->size] = c;
  146|   243M|	buf->size += 1;
  147|   243M|}
hoedown_buffer_prefix:
  195|  5.03k|{
  196|  5.03k|	size_t i;
  197|       |
  198|  7.48k|	for (i = 0; i < buf->size; ++i) {
  ------------------
  |  Branch (198:14): [True: 7.48k, False: 0]
  ------------------
  199|  7.48k|		if (prefix[i] == 0)
  ------------------
  |  Branch (199:7): [True: 307, False: 7.17k]
  ------------------
  200|    307|			return 0;
  201|       |
  202|  7.17k|		if (buf->data[i] != prefix[i])
  ------------------
  |  Branch (202:7): [True: 4.72k, False: 2.45k]
  ------------------
  203|  4.72k|			return buf->data[i] - prefix[i];
  204|  7.17k|	}
  205|       |
  206|      0|	return 0;
  207|  5.03k|}
hoedown_buffer_slurp:
  211|  1.20k|{
  212|  1.20k|	assert(buf && buf->unit);
  213|       |
  214|  1.20k|	if (size >= buf->size) {
  ------------------
  |  Branch (214:6): [True: 0, False: 1.20k]
  ------------------
  215|      0|		buf->size = 0;
  216|      0|		return;
  217|      0|	}
  218|       |
  219|  1.20k|	buf->size -= size;
  220|  1.20k|	memmove(buf->data, buf->data + size, buf->size);
  221|  1.20k|}
hoedown_buffer_printf:
  239|   191k|{
  240|   191k|	va_list ap;
  241|   191k|	int n;
  242|       |
  243|   191k|	assert(buf && buf->unit);
  244|       |
  245|   191k|	if (buf->size >= buf->asize)
  ------------------
  |  Branch (245:6): [True: 973, False: 190k]
  ------------------
  246|    973|		hoedown_buffer_grow(buf, buf->size + 1);
  247|       |
  248|   191k|	va_start(ap, fmt);
  249|   191k|	n = vsnprintf((char *)buf->data + buf->size, buf->asize - buf->size, fmt, ap);
  250|   191k|	va_end(ap);
  251|       |
  252|   191k|	if (n < 0) {
  ------------------
  |  Branch (252:6): [True: 0, False: 191k]
  ------------------
  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|   191k|	if ((size_t)n >= buf->asize - buf->size) {
  ------------------
  |  Branch (262:6): [True: 2.23k, False: 188k]
  ------------------
  263|  2.23k|		hoedown_buffer_grow(buf, buf->size + n + 1);
  264|       |
  265|  2.23k|		va_start(ap, fmt);
  266|  2.23k|		n = vsnprintf((char *)buf->data + buf->size, buf->asize - buf->size, fmt, ap);
  267|  2.23k|		va_end(ap);
  268|  2.23k|	}
  269|       |
  270|   191k|	if (n < 0)
  ------------------
  |  Branch (270:6): [True: 0, False: 191k]
  ------------------
  271|      0|		return;
  272|       |
  273|   191k|	buf->size += n;
  274|   191k|}

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

hoedown_escape_href:
   58|   292k|{
   59|   292k|	static const char hex_chars[] = "0123456789ABCDEF";
   60|   292k|	size_t  i = 0, mark;
   61|   292k|	char hex_str[3];
   62|       |
   63|   292k|	hex_str[0] = '%';
   64|       |
   65|  6.17M|	while (i < size) {
  ------------------
  |  Branch (65:9): [True: 5.94M, False: 235k]
  ------------------
   66|  5.94M|		mark = i;
   67|  49.8M|		while (i < size && HREF_SAFE[data[i]]) i++;
  ------------------
  |  Branch (67:10): [True: 49.8M, False: 57.0k]
  |  Branch (67:22): [True: 43.9M, False: 5.88M]
  ------------------
   68|       |
   69|       |		/* Optimization for cases where there's nothing to escape */
   70|  5.94M|		if (mark == 0 && i >= size) {
  ------------------
  |  Branch (70:7): [True: 292k, False: 5.65M]
  |  Branch (70:20): [True: 45.7k, False: 246k]
  ------------------
   71|  45.7k|			hoedown_buffer_put(ob, data, size);
   72|  45.7k|			return;
   73|  45.7k|		}
   74|       |
   75|  5.89M|		if (likely(i > mark)) {
  ------------------
  |  |    8|  5.89M|#define likely(x)       __builtin_expect((x),1)
  |  |  ------------------
  |  |  |  Branch (8:25): [True: 88.9k, False: 5.80M]
  |  |  ------------------
  ------------------
   76|  88.9k|			hoedown_buffer_put(ob, data + mark, i - mark);
   77|  88.9k|		}
   78|       |
   79|       |		/* escaping */
   80|  5.89M|		if (i >= size)
  ------------------
  |  Branch (80:7): [True: 11.3k, False: 5.88M]
  ------------------
   81|  11.3k|			break;
   82|       |
   83|  5.88M|		switch (data[i]) {
   84|       |		/* amp appears all the time in URLs, but needs
   85|       |		 * HTML-entity escaping to be inside an href */
   86|    854|		case '&':
  ------------------
  |  Branch (86:3): [True: 854, False: 5.88M]
  ------------------
   87|    854|			HOEDOWN_BUFPUTSL(ob, "&amp;");
  ------------------
  |  |  119|    854|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
   88|    854|			break;
   89|       |
   90|       |		/* the single quote is a valid URL character
   91|       |		 * according to the standard; it needs HTML
   92|       |		 * entity escaping too */
   93|  11.1k|		case '\'':
  ------------------
  |  Branch (93:3): [True: 11.1k, False: 5.87M]
  ------------------
   94|  11.1k|			HOEDOWN_BUFPUTSL(ob, "&#x27;");
  ------------------
  |  |  119|  11.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
   95|  11.1k|			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|  5.87M|		default:
  ------------------
  |  Branch (108:3): [True: 5.87M, False: 12.0k]
  ------------------
  109|  5.87M|			hex_str[1] = hex_chars[(data[i] >> 4) & 0xF];
  110|  5.87M|			hex_str[2] = hex_chars[data[i] & 0xF];
  111|  5.87M|			hoedown_buffer_put(ob, (uint8_t *)hex_str, 3);
  112|  5.88M|		}
  113|       |
  114|  5.88M|		i++;
  115|  5.88M|	}
  116|   292k|}
hoedown_escape_html:
  161|  9.62M|{
  162|  9.62M|	size_t i = 0, mark;
  163|       |
  164|  70.9M|	while (1) {
  ------------------
  |  Branch (164:9): [Folded - Ignored]
  ------------------
  165|  70.9M|		mark = i;
  166|  2.50G|		while (i < size && HTML_ESCAPE_TABLE[data[i]] == 0) i++;
  ------------------
  |  Branch (166:10): [True: 2.49G, False: 9.62M]
  |  Branch (166:22): [True: 2.43G, False: 61.2M]
  ------------------
  167|       |
  168|       |		/* Optimization for cases where there's nothing to escape */
  169|  70.9M|		if (mark == 0 && i >= size) {
  ------------------
  |  Branch (169:7): [True: 9.62M, False: 61.2M]
  |  Branch (169:20): [True: 8.74M, False: 881k]
  ------------------
  170|  8.74M|			hoedown_buffer_put(ob, data, size);
  171|  8.74M|			return;
  172|  8.74M|		}
  173|       |
  174|  62.1M|		if (likely(i > mark))
  ------------------
  |  |    8|  62.1M|#define likely(x)       __builtin_expect((x),1)
  |  |  ------------------
  |  |  |  Branch (8:25): [True: 38.4M, False: 23.6M]
  |  |  ------------------
  ------------------
  175|  38.4M|			hoedown_buffer_put(ob, data + mark, i - mark);
  176|       |
  177|  62.1M|		if (i >= size) break;
  ------------------
  |  Branch (177:7): [True: 881k, False: 61.2M]
  ------------------
  178|       |
  179|       |		/* The forward slash is only escaped in secure mode */
  180|  61.2M|		if (!secure && data[i] == '/') {
  ------------------
  |  Branch (180:7): [True: 61.2M, False: 0]
  |  Branch (180:18): [True: 490k, False: 60.8M]
  ------------------
  181|   490k|			hoedown_buffer_putc(ob, '/');
  182|  60.8M|		} else {
  183|  60.8M|			hoedown_buffer_puts(ob, HTML_ESCAPES[HTML_ESCAPE_TABLE[data[i]]]);
  184|  60.8M|		}
  185|       |
  186|  61.2M|		i++;
  187|  61.2M|	}
  188|  9.62M|}

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

hoedown_html_renderer_new:
 1111|  12.4k|{
 1112|  12.4k|	static const hoedown_renderer cb_default = {
 1113|  12.4k|		NULL,
 1114|       |
 1115|  12.4k|		rndr_blockcode,
 1116|  12.4k|		rndr_blockquote,
 1117|  12.4k|		rndr_header,
 1118|  12.4k|		rndr_hrule,
 1119|  12.4k|		rndr_list,
 1120|  12.4k|		rndr_listitem,
 1121|  12.4k|		rndr_paragraph,
 1122|  12.4k|		rndr_table,
 1123|  12.4k|		rndr_table_header,
 1124|  12.4k|		rndr_table_body,
 1125|  12.4k|		rndr_tablerow,
 1126|  12.4k|		rndr_tablecell,
 1127|  12.4k|		rndr_footnotes,
 1128|  12.4k|		rndr_footnote_def,
 1129|  12.4k|		rndr_raw_block,
 1130|       |
 1131|  12.4k|		rndr_autolink,
 1132|  12.4k|		rndr_codespan,
 1133|  12.4k|		rndr_double_emphasis,
 1134|  12.4k|		rndr_emphasis,
 1135|  12.4k|		rndr_underline,
 1136|  12.4k|		rndr_highlight,
 1137|  12.4k|		rndr_quote,
 1138|  12.4k|		rndr_image,
 1139|  12.4k|		rndr_linebreak,
 1140|  12.4k|		rndr_link,
 1141|  12.4k|		rndr_triple_emphasis,
 1142|  12.4k|		rndr_strikethrough,
 1143|  12.4k|		rndr_superscript,
 1144|  12.4k|		rndr_footnote_ref,
 1145|  12.4k|		rndr_math,
 1146|  12.4k|		rndr_raw_html,
 1147|       |
 1148|  12.4k|		NULL,
 1149|  12.4k|		rndr_normal_text,
 1150|       |
 1151|  12.4k|		NULL,
 1152|  12.4k|		NULL,
 1153|       |
 1154|  12.4k|		NULL,
 1155|       |
 1156|  12.4k|		NULL,
 1157|  12.4k|		NULL,
 1158|  12.4k|	};
 1159|       |
 1160|  12.4k|	hoedown_html_renderer_state *state;
 1161|  12.4k|	hoedown_renderer *renderer;
 1162|       |
 1163|       |	/* Prepare the state pointer */
 1164|  12.4k|	state = hoedown_malloc(sizeof(hoedown_html_renderer_state));
 1165|  12.4k|	memset(state, 0x0, sizeof(hoedown_html_renderer_state));
 1166|       |
 1167|  12.4k|	state->flags = render_flags;
 1168|  12.4k|	state->toc_data.nesting_level = nesting_level;
 1169|       |
 1170|       |	/* Prepare the renderer */
 1171|  12.4k|	renderer = hoedown_malloc(sizeof(hoedown_renderer));
 1172|  12.4k|	memcpy(renderer, &cb_default, sizeof(hoedown_renderer));
 1173|       |
 1174|  12.4k|	if (render_flags & HOEDOWN_HTML_SKIP_HTML || render_flags & HOEDOWN_HTML_ESCAPE)
  ------------------
  |  Branch (1174:6): [True: 12.4k, False: 0]
  |  Branch (1174:47): [True: 0, False: 0]
  ------------------
 1175|  12.4k|		renderer->blockhtml = NULL;
 1176|       |
 1177|  12.4k|	state->hash.header_id = hoedown_hash_new(0);
 1178|       |
 1179|  12.4k|	renderer->opaque = state;
 1180|       |
 1181|  12.4k|	return renderer;
 1182|  12.4k|}
hoedown_html_renderer_free:
 1186|  12.4k|{
 1187|  12.4k|	if (renderer->opaque) {
  ------------------
  |  Branch (1187:6): [True: 12.4k, False: 0]
  ------------------
 1188|  12.4k|		hoedown_html_renderer_state *state = renderer->opaque;
 1189|  12.4k|		if (state->hash.header_id) {
  ------------------
  |  Branch (1189:7): [True: 12.4k, False: 0]
  ------------------
 1190|  12.4k|			hoedown_hash_free(state->hash.header_id);
 1191|  12.4k|		}
 1192|  12.4k|	}
 1193|  12.4k|	free(renderer->opaque);
 1194|  12.4k|	free(renderer);
 1195|  12.4k|}
html.c:escape_html:
   57|  9.62M|{
   58|  9.62M|	hoedown_escape_html(ob, source, length, 0);
   59|  9.62M|}
html.c:rndr_header_id:
  366|  65.9k|{
  367|  65.9k|	size_t i = 0, n = 0;
  368|  65.9k|	hoedown_html_renderer_state *state = data->opaque;
  369|  65.9k|	hoedown_hash *hash = state->hash.header_id;
  370|       |
  371|  20.9M|	while (i < length) {
  ------------------
  |  Branch (371:9): [True: 20.8M, False: 65.9k]
  ------------------
  372|  20.8M|		if (isalnum(source[i])) {
  373|  4.83M|			hoedown_buffer_putc(ob, tolower(source[i]));
  374|  16.0M|		} else if (source[i] == ' ') {
  ------------------
  |  Branch (374:14): [True: 9.51M, False: 6.49M]
  ------------------
  375|  9.51M|			hoedown_buffer_putc(ob, '-');
  376|  9.51M|		} else if (source[i] == '-' || source[i] == '_') {
  ------------------
  |  Branch (376:14): [True: 49.0k, False: 6.44M]
  |  Branch (376:34): [True: 5.84k, False: 6.44M]
  ------------------
  377|  54.9k|			hoedown_buffer_putc(ob, source[i]);
  378|  6.44M|		} else if (!isascii(source[i])) {
  ------------------
  |  Branch (378:14): [True: 184k, False: 6.25M]
  ------------------
  379|   184k|			if (escape) {
  ------------------
  |  Branch (379:8): [True: 0, False: 184k]
  ------------------
  380|      0|				hoedown_buffer_printf(ob, "%%%02X", source[i]);
  381|   184k|			} else {
  382|   184k|				hoedown_buffer_putc(ob, source[i]);
  383|   184k|			}
  384|  6.25M|		} else if (source[i] == '&') {
  ------------------
  |  Branch (384:14): [True: 32.1k, False: 6.22M]
  ------------------
  385|   147k|			while (i < length && source[i] != ';') {
  ------------------
  |  Branch (385:11): [True: 147k, False: 0]
  |  Branch (385:25): [True: 115k, False: 32.1k]
  ------------------
  386|   115k|				++i;
  387|   115k|			}
  388|  6.22M|		} else if (source[i] == '<') {
  ------------------
  |  Branch (388:14): [True: 98.7k, False: 6.12M]
  ------------------
  389|   344M|			while (i < length && source[i] != '>') {
  ------------------
  |  Branch (389:11): [True: 344M, False: 0]
  |  Branch (389:25): [True: 344M, False: 98.7k]
  ------------------
  390|   344M|				++i;
  391|   344M|			}
  392|  98.7k|		}
  393|  20.8M|		++i;
  394|  20.8M|	}
  395|       |
  396|  65.9k|	if (hash) {
  ------------------
  |  Branch (396:6): [True: 65.9k, False: 0]
  ------------------
  397|  65.9k|		void *value = hoedown_hash_find(hash, (char *)source, length);
  398|  65.9k|		if (value) {
  ------------------
  |  Branch (398:7): [True: 53.6k, False: 12.3k]
  ------------------
  399|  53.6k|			size_t *p = (size_t *)value;
  400|  53.6k|			++(*p);
  401|  53.6k|			n = *p;
  402|  53.6k|		}
  403|  65.9k|		if (n > 0) {
  ------------------
  |  Branch (403:7): [True: 53.6k, False: 12.3k]
  ------------------
  404|  53.6k|			hoedown_buffer_printf(ob, "-%ld", n);
  405|  53.6k|		} else if (hash) {
  ------------------
  |  Branch (405:14): [True: 12.3k, False: 0]
  ------------------
  406|  12.3k|			size_t *p = (size_t *)malloc(sizeof(size_t));
  407|  12.3k|			if (p) {
  ------------------
  |  Branch (407:8): [True: 12.3k, False: 0]
  ------------------
  408|  12.3k|				*p = 0;
  409|  12.3k|				hoedown_hash_add(hash, (char *)source, length, (void *)p, free);
  410|  12.3k|			}
  411|  12.3k|		}
  412|  65.9k|	}
  413|  65.9k|}
html.c:rndr_codespan:
  271|  18.7k|{
  272|  18.7k|	HOEDOWN_BUFPUTSL(ob, "<code");
  ------------------
  |  |  119|  18.7k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  273|  18.7k|	if (attr && attr->size) {
  ------------------
  |  Branch (273:6): [True: 18.2k, False: 505]
  |  Branch (273:14): [True: 1.84k, False: 16.4k]
  ------------------
  274|  1.84k|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  275|  1.84k|	}
  276|  18.7k|	hoedown_buffer_putc(ob, '>');
  277|  18.7k|	if (text) escape_html(ob, text->data, text->size);
  ------------------
  |  Branch (277:6): [True: 18.2k, False: 505]
  ------------------
  278|  18.7k|	HOEDOWN_BUFPUTSL(ob, "</code>");
  ------------------
  |  |  119|  18.7k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  279|  18.7k|	return 1;
  280|  18.7k|}
html.c:rndr_attributes:
   71|   119k|{
   72|       |	/* i keeps track of how much we've parsed so far. */
   73|   119k|	size_t i = 0;
   74|   119k|	int rendered_id = 0;
   75|   119k|	int must_free_class = 0;
   76|       |
   77|   302k|	while (i < size) {
  ------------------
  |  Branch (77:9): [True: 224k, False: 78.3k]
  ------------------
   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|   224k|		int is_id = 0;
   87|   224k|		int is_class = 0;
   88|   224k|		size_t key_start = 0, key_end = 0, val_start = 0, val_end = 0;
   89|       |
   90|       |		/* Skip to the first non-space character */
   91|  17.8M|		for (; i < size && buf[i] == ' '; ++i) {}
  ------------------
  |  Branch (91:10): [True: 17.8M, False: 1.33k]
  |  Branch (91:22): [True: 17.6M, False: 223k]
  ------------------
   92|   224k|		if (i >= size) break;
  ------------------
  |  Branch (92:7): [True: 1.33k, False: 223k]
  ------------------
   93|       |
   94|   223k|		if (buf[i] == '#') {
  ------------------
  |  Branch (94:7): [True: 66.2k, False: 156k]
  ------------------
   95|       |			/* #id */
   96|  66.2k|			is_id = 1;
   97|  66.2k|			++i;
   98|   156k|		} else if (buf[i] == '.') {
  ------------------
  |  Branch (98:14): [True: 3.74k, False: 153k]
  ------------------
   99|       |			/* .cls */
  100|  3.74k|			is_class = 1;
  101|  3.74k|			++i;
  102|  3.74k|		}
  103|   223k|		if (is_id || is_class) {
  ------------------
  |  Branch (103:7): [True: 66.2k, False: 156k]
  |  Branch (103:16): [True: 3.74k, False: 153k]
  ------------------
  104|  69.9k|			val_start = i;
  105|  17.0M|			for (val_end = val_start; val_end < size && buf[val_end] != ' '; ++val_end) {}
  ------------------
  |  Branch (105:30): [True: 16.9M, False: 68.8k]
  |  Branch (105:48): [True: 16.9M, False: 1.12k]
  ------------------
  106|  69.9k|			i = val_end;
  107|   153k|		} else {
  108|       |			/* key=... */
  109|   153k|			key_start = i;
  110|  12.8M|			for (key_end = key_start; key_end < size && buf[key_end] != ' ' && buf[key_end] != '='; ++key_end) {}
  ------------------
  |  Branch (110:30): [True: 12.8M, False: 39.4k]
  |  Branch (110:48): [True: 12.7M, False: 55.4k]
  |  Branch (110:71): [True: 12.7M, False: 58.3k]
  ------------------
  111|   153k|			i = key_end;
  112|   153k|			if (i >= size) break;
  ------------------
  |  Branch (112:8): [True: 39.4k, False: 113k]
  ------------------
  113|   113k|			++i;
  114|   113k|			if (buf[key_end] != '=') continue;
  ------------------
  |  Branch (114:8): [True: 55.4k, False: 58.3k]
  ------------------
  115|  58.3k|			if (strncasecmp((char *)buf + key_start, "id", key_end - key_start) == 0) {
  ------------------
  |  Branch (115:8): [True: 11.5k, False: 46.7k]
  ------------------
  116|  11.5k|				is_id = 1;
  117|  46.7k|			} else if (strncasecmp((char *)buf + key_start, "class", key_end - key_start) == 0) {
  ------------------
  |  Branch (117:15): [True: 45.1k, False: 1.56k]
  ------------------
  118|  45.1k|				is_class = 1;
  119|  45.1k|			}
  120|       |
  121|  58.3k|			val_start = i;
  122|  58.3k|			if (val_start < size && (buf[val_start] == '"' || buf[val_start] == '\'')) {
  ------------------
  |  Branch (122:8): [True: 53.1k, False: 5.13k]
  |  Branch (122:29): [True: 411, False: 52.7k]
  |  Branch (122:54): [True: 5.30k, False: 47.4k]
  ------------------
  123|       |				/* key="quoted val" */
  124|  5.71k|				val_start += 1;
  125|  11.6M|				for (val_end = val_start; val_end < size && buf[val_end] != buf[val_start - 1]; ++val_end) {}
  ------------------
  |  Branch (125:31): [True: 11.6M, False: 436]
  |  Branch (125:49): [True: 11.6M, False: 5.27k]
  ------------------
  126|  5.71k|				i = val_end;
  127|  5.71k|				if (i >= size) break;
  ------------------
  |  Branch (127:9): [True: 436, False: 5.27k]
  ------------------
  128|  5.27k|				++i;
  129|  52.6k|			} else {
  130|       |				/* key=val */
  131|   668k|				for (val_end = val_start; val_end < size && buf[val_end] != ' '; ++val_end) {}
  ------------------
  |  Branch (131:31): [True: 662k, False: 6.26k]
  |  Branch (131:49): [True: 616k, False: 46.3k]
  ------------------
  132|  52.6k|				i = val_end;
  133|  52.6k|			}
  134|  58.3k|		}
  135|       |
  136|       |		/* Now that we found our keys and values, let's render the attribute. */
  137|   127k|		if (is_id) {
  ------------------
  |  Branch (137:7): [True: 77.5k, False: 50.3k]
  ------------------
  138|  77.5k|			if (rendered_id) continue;
  ------------------
  |  Branch (138:8): [True: 5.36k, False: 72.1k]
  ------------------
  139|  72.1k|			if (val_end == val_start) continue;
  ------------------
  |  Branch (139:8): [True: 7.41k, False: 64.7k]
  ------------------
  140|  64.7k|			rendered_id = 1;
  141|  64.7k|			HOEDOWN_BUFPUTSL(ob, " id=\"");
  ------------------
  |  |  119|  64.7k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  142|  64.7k|			escape_html(ob, buf + val_start, val_end - val_start);
  143|  64.7k|			hoedown_buffer_putc(ob, '"');
  144|  64.7k|		} else if (is_class) {
  ------------------
  |  Branch (144:14): [True: 48.9k, False: 1.43k]
  ------------------
  145|  48.9k|			if (val_end == val_start) continue;
  ------------------
  |  Branch (145:8): [True: 38.4k, False: 10.4k]
  ------------------
  146|  10.4k|			if (!class) {
  ------------------
  |  Branch (146:8): [True: 3.10k, False: 7.32k]
  ------------------
  147|  3.10k|				class = hoedown_buffer_new(size);
  148|  3.10k|				must_free_class = 1;
  149|  3.10k|			}
  150|  10.4k|			escape_html(class, buf + val_start, val_end - val_start);
  151|  10.4k|			hoedown_buffer_putc(class, ' ');
  152|  10.4k|		} else {
  153|  1.43k|			if (key_end == key_start) continue;
  ------------------
  |  Branch (153:8): [True: 0, False: 1.43k]
  ------------------
  154|  1.43k|			hoedown_buffer_putc(ob, ' ');
  155|  1.43k|			escape_html(ob, buf + key_start, key_end - key_start);
  156|  1.43k|			HOEDOWN_BUFPUTSL(ob, "=\"");
  ------------------
  |  |  119|  1.43k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  157|  1.43k|			escape_html(ob, buf + val_start, val_end - val_start);
  158|  1.43k|			hoedown_buffer_putc(ob, '"');
  159|  1.43k|		}
  160|   127k|	}
  161|       |
  162|   119k|	if (class) {
  ------------------
  |  Branch (162:6): [True: 3.90k, False: 115k]
  ------------------
  163|  3.90k|		if (class->size > 0) {
  ------------------
  |  Branch (163:7): [True: 3.90k, False: 0]
  ------------------
  164|  3.90k|			HOEDOWN_BUFPUTSL(ob, " class=\"");
  ------------------
  |  |  119|  3.90k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  165|  3.90k|			hoedown_buffer_put(ob, class->data, class->size-1);
  166|  3.90k|			hoedown_buffer_putc(ob, '"');
  167|  3.90k|		}
  168|  3.90k|		if (must_free_class) {
  ------------------
  |  Branch (168:7): [True: 3.10k, False: 802]
  ------------------
  169|  3.10k|			hoedown_buffer_free(class);
  170|  3.10k|		}
  171|  3.90k|	}
  172|   119k|	return 1;
  173|   119k|}
html.c:rndr_double_emphasis:
  296|  15.5k|{
  297|  15.5k|	if (!content || !content->size)
  ------------------
  |  Branch (297:6): [True: 0, False: 15.5k]
  |  Branch (297:18): [True: 9.08k, False: 6.49k]
  ------------------
  298|  9.08k|		return 0;
  299|       |
  300|  6.49k|	HOEDOWN_BUFPUTSL(ob, "<strong>");
  ------------------
  |  |  119|  6.49k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  301|  6.49k|	hoedown_buffer_put(ob, content->data, content->size);
  302|  6.49k|	HOEDOWN_BUFPUTSL(ob, "</strong>");
  ------------------
  |  |  119|  6.49k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  303|       |
  304|  6.49k|	return 1;
  305|  15.5k|}
html.c:rndr_emphasis:
  309|  9.10k|{
  310|  9.10k|	if (!content || !content->size) return 0;
  ------------------
  |  Branch (310:6): [True: 0, False: 9.10k]
  |  Branch (310:18): [True: 300, False: 8.80k]
  ------------------
  311|  8.80k|	HOEDOWN_BUFPUTSL(ob, "<em>");
  ------------------
  |  |  119|  8.80k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  312|  8.80k|	if (content) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (312:6): [True: 8.80k, False: 0]
  ------------------
  313|  8.80k|	HOEDOWN_BUFPUTSL(ob, "</em>");
  ------------------
  |  |  119|  8.80k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  314|  8.80k|	return 1;
  315|  9.10k|}
html.c:rndr_underline:
  319|  15.2k|{
  320|  15.2k|	if (!content || !content->size)
  ------------------
  |  Branch (320:6): [True: 0, False: 15.2k]
  |  Branch (320:18): [True: 1.49k, False: 13.7k]
  ------------------
  321|  1.49k|		return 0;
  322|       |
  323|  13.7k|	HOEDOWN_BUFPUTSL(ob, "<u>");
  ------------------
  |  |  119|  13.7k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  324|  13.7k|	hoedown_buffer_put(ob, content->data, content->size);
  325|  13.7k|	HOEDOWN_BUFPUTSL(ob, "</u>");
  ------------------
  |  |  119|  13.7k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  326|       |
  327|  13.7k|	return 1;
  328|  15.2k|}
html.c:rndr_highlight:
  332|    490|{
  333|    490|	if (!content || !content->size)
  ------------------
  |  Branch (333:6): [True: 0, False: 490]
  |  Branch (333:18): [True: 224, False: 266]
  ------------------
  334|    224|		return 0;
  335|       |
  336|    266|	HOEDOWN_BUFPUTSL(ob, "<mark>");
  ------------------
  |  |  119|    266|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  337|    266|	hoedown_buffer_put(ob, content->data, content->size);
  338|    266|	HOEDOWN_BUFPUTSL(ob, "</mark>");
  ------------------
  |  |  119|    266|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  339|       |
  340|    266|	return 1;
  341|    490|}
html.c:rndr_quote:
  345|  82.1k|{
  346|  82.1k|	if (!content || !content->size)
  ------------------
  |  Branch (346:6): [True: 649, False: 81.4k]
  |  Branch (346:18): [True: 820, False: 80.6k]
  ------------------
  347|  1.46k|		return 0;
  348|       |
  349|  80.6k|	HOEDOWN_BUFPUTSL(ob, "<q>");
  ------------------
  |  |  119|  80.6k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  350|  80.6k|	hoedown_buffer_put(ob, content->data, content->size);
  351|  80.6k|	HOEDOWN_BUFPUTSL(ob, "</q>");
  ------------------
  |  |  119|  80.6k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  352|       |
  353|  80.6k|	return 1;
  354|  82.1k|}
html.c:rndr_triple_emphasis:
  731|  3.07k|{
  732|  3.07k|	if (!content || !content->size) return 0;
  ------------------
  |  Branch (732:6): [True: 0, False: 3.07k]
  |  Branch (732:18): [True: 712, False: 2.35k]
  ------------------
  733|  2.35k|	HOEDOWN_BUFPUTSL(ob, "<strong><em>");
  ------------------
  |  |  119|  2.35k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  734|  2.35k|	hoedown_buffer_put(ob, content->data, content->size);
  735|  2.35k|	HOEDOWN_BUFPUTSL(ob, "</em></strong>");
  ------------------
  |  |  119|  2.35k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  736|  2.35k|	return 1;
  737|  3.07k|}
html.c:rndr_strikethrough:
  284|  3.54k|{
  285|  3.54k|	if (!content || !content->size)
  ------------------
  |  Branch (285:6): [True: 0, False: 3.54k]
  |  Branch (285:18): [True: 1.69k, False: 1.85k]
  ------------------
  286|  1.69k|		return 0;
  287|       |
  288|  1.85k|	HOEDOWN_BUFPUTSL(ob, "<del>");
  ------------------
  |  |  119|  1.85k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  289|  1.85k|	hoedown_buffer_put(ob, content->data, content->size);
  290|  1.85k|	HOEDOWN_BUFPUTSL(ob, "</del>");
  ------------------
  |  |  119|  1.85k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  291|  1.85k|	return 1;
  292|  3.54k|}
html.c:rndr_superscript:
  867|   100k|{
  868|   100k|	if (!content || !content->size) return 0;
  ------------------
  |  Branch (868:6): [True: 0, False: 100k]
  |  Branch (868:18): [True: 1.65k, False: 98.8k]
  ------------------
  869|  98.8k|	HOEDOWN_BUFPUTSL(ob, "<sup>");
  ------------------
  |  |  119|  98.8k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  870|  98.8k|	hoedown_buffer_put(ob, content->data, content->size);
  871|  98.8k|	HOEDOWN_BUFPUTSL(ob, "</sup>");
  ------------------
  |  |  119|  98.8k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  872|  98.8k|	return 1;
  873|   100k|}
html.c:rndr_normal_text:
  877|  9.16M|{
  878|  9.16M|	if (content)
  ------------------
  |  Branch (878:6): [True: 9.16M, False: 0]
  ------------------
  879|  9.16M|		escape_html(ob, content->data, content->size);
  880|  9.16M|}
html.c:rndr_blockcode:
  214|  4.84k|{
  215|  4.84k|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (215:6): [True: 1.53k, False: 3.31k]
  ------------------
  216|       |
  217|  4.84k|	if (lang) {
  ------------------
  |  Branch (217:6): [True: 2.52k, False: 2.32k]
  ------------------
  218|  2.52k|		hoedown_html_renderer_state *state = data->opaque;
  219|  2.52k|		if ((state->flags & HOEDOWN_HTML_FENCED_CODE_SCRIPT) &&
  ------------------
  |  Branch (219:7): [True: 2.52k, False: 0]
  ------------------
  220|  2.52k|		    lang->size > 7 && memcmp(lang->data, "script@", 7) == 0 && text) {
  ------------------
  |  Branch (220:7): [True: 1.08k, False: 1.43k]
  |  Branch (220:25): [True: 738, False: 351]
  |  Branch (220:66): [True: 251, False: 487]
  ------------------
  221|    251|			HOEDOWN_BUFPUTSL(ob, "<script type=\"");
  ------------------
  |  |  119|    251|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  222|    251|			escape_html(ob, lang->data + 7, lang->size - 7);
  223|    251|			HOEDOWN_BUFPUTSL(ob, "\">\n");
  ------------------
  |  |  119|    251|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  224|    251|			hoedown_buffer_put(ob, text->data, text->size);
  225|    251|			HOEDOWN_BUFPUTSL(ob, "</script>\n");
  ------------------
  |  |  119|    251|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  226|    251|			return;
  227|    251|		}
  228|  2.27k|		HOEDOWN_BUFPUTSL(ob, "<pre><code");
  ------------------
  |  |  119|  2.27k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  229|  2.27k|		if (attr && attr->size) {
  ------------------
  |  Branch (229:7): [True: 802, False: 1.47k]
  |  Branch (229:15): [True: 802, False: 0]
  ------------------
  230|    802|			hoedown_buffer *lang_class = hoedown_buffer_new(lang->size + 9);
  231|    802|			if (lang->size) {
  ------------------
  |  Branch (231:8): [True: 802, False: 0]
  ------------------
  232|    802|				HOEDOWN_BUFPUTSL(lang_class, "language-");
  ------------------
  |  |  119|    802|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  233|    802|				escape_html(lang_class, lang->data, lang->size);
  234|    802|				if (lang_class->data[lang_class->size-1] != ' ') {
  ------------------
  |  Branch (234:9): [True: 802, False: 0]
  ------------------
  235|    802|					hoedown_buffer_putc(lang_class, ' ');
  236|    802|				}
  237|    802|			}
  238|    802|			rndr_attributes(ob, attr->data, attr->size, lang_class, data);
  239|    802|			hoedown_buffer_free(lang_class);
  240|  1.47k|		} else {
  241|  1.47k|			HOEDOWN_BUFPUTSL(ob, " class=\"language-");
  ------------------
  |  |  119|  1.47k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  242|  1.47k|			escape_html(ob, lang->data, lang->size);
  243|  1.47k|			hoedown_buffer_putc(ob, '"');
  244|  1.47k|		}
  245|  2.27k|		hoedown_buffer_putc(ob, '>');
  246|  2.32k|	} else if (attr && attr->size) {
  ------------------
  |  Branch (246:13): [True: 227, False: 2.09k]
  |  Branch (246:21): [True: 227, False: 0]
  ------------------
  247|    227|		HOEDOWN_BUFPUTSL(ob, "<pre><code");
  ------------------
  |  |  119|    227|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  248|    227|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  249|    227|		hoedown_buffer_putc(ob, '>');
  250|  2.09k|	} else {
  251|  2.09k|		HOEDOWN_BUFPUTSL(ob, "<pre><code>");
  ------------------
  |  |  119|  2.09k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  252|  2.09k|	}
  253|       |
  254|  4.59k|	if (text)
  ------------------
  |  Branch (254:6): [True: 1.51k, False: 3.08k]
  ------------------
  255|  1.51k|		escape_html(ob, text->data, text->size);
  256|       |
  257|  4.59k|	HOEDOWN_BUFPUTSL(ob, "</code></pre>\n");
  ------------------
  |  |  119|  4.59k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  258|  4.59k|}
html.c:rndr_blockquote:
  262|  22.3k|{
  263|  22.3k|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (263:6): [True: 10.6k, False: 11.6k]
  ------------------
  264|  22.3k|	HOEDOWN_BUFPUTSL(ob, "<blockquote>\n");
  ------------------
  |  |  119|  22.3k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  265|  22.3k|	if (content) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (265:6): [True: 22.3k, False: 0]
  ------------------
  266|  22.3k|	HOEDOWN_BUFPUTSL(ob, "</blockquote>\n");
  ------------------
  |  |  119|  22.3k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  267|  22.3k|}
html.c:rndr_header:
  417|  67.7k|{
  418|  67.7k|	hoedown_html_renderer_state *state = data->opaque;
  419|       |
  420|  67.7k|	if (ob->size)
  ------------------
  |  Branch (420:6): [True: 65.0k, False: 2.72k]
  ------------------
  421|  65.0k|		hoedown_buffer_putc(ob, '\n');
  422|       |
  423|  67.7k|	hoedown_buffer *merged_attr = hoedown_buffer_new(sizeof(hoedown_buffer));
  424|       |
  425|  67.7k|	if (attr && attr->size) {
  ------------------
  |  Branch (425:6): [True: 66.5k, False: 1.15k]
  |  Branch (425:14): [True: 4.23k, False: 62.3k]
  ------------------
  426|  4.23k|		hoedown_buffer_put(merged_attr, attr->data, attr->size);
  427|  4.23k|	}
  428|  67.7k|	if (content && content->size && ((state->flags & HOEDOWN_HTML_HEADER_ID) || (level <= state->toc_data.nesting_level))) {
  ------------------
  |  Branch (428:6): [True: 66.5k, False: 1.15k]
  |  Branch (428:17): [True: 65.9k, False: 617]
  |  Branch (428:35): [True: 65.9k, False: 0]
  |  Branch (428:78): [True: 0, False: 0]
  ------------------
  429|  65.9k|		hoedown_buffer_puts(merged_attr, " #");
  430|  65.9k|		rndr_header_id(merged_attr, content->data, content->size, 0, data);
  431|  65.9k|	}
  432|       |
  433|  67.7k|	if (merged_attr && merged_attr->size) {
  ------------------
  |  Branch (433:6): [True: 67.7k, False: 0]
  |  Branch (433:21): [True: 66.3k, False: 1.35k]
  ------------------
  434|  66.3k|		hoedown_buffer_printf(ob, "<h%d", level);
  435|  66.3k|		rndr_attributes(ob, merged_attr->data, merged_attr->size, NULL, data);
  436|  66.3k|		hoedown_buffer_putc(ob, '>');
  437|  66.3k|	} else {
  438|  1.35k|		hoedown_buffer_printf(ob, "<h%d>", level);
  439|  1.35k|	}
  440|       |
  441|  67.7k|	hoedown_buffer_free(merged_attr);
  442|       |
  443|  67.7k|	if (content) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (443:6): [True: 66.5k, False: 1.15k]
  ------------------
  444|  67.7k|	hoedown_buffer_printf(ob, "</h%d>\n", level);
  445|  67.7k|}
html.c:rndr_hrule:
  741|  8.73k|{
  742|  8.73k|	hoedown_html_renderer_state *state = data->opaque;
  743|  8.73k|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (743:6): [True: 2.98k, False: 5.75k]
  ------------------
  744|  8.73k|	hoedown_buffer_puts(ob, USE_XHTML(state) ? "<hr/>\n" : "<hr>\n");
  ------------------
  |  |   15|  8.73k|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 8.73k, False: 0]
  |  |  ------------------
  ------------------
  745|  8.73k|}
html.c:rndr_list:
  503|  53.7k|{
  504|  53.7k|        hoedown_html_renderer_state *state = data->opaque;
  505|       |
  506|  53.7k|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (506:6): [True: 44.8k, False: 8.90k]
  ------------------
  507|       |
  508|  53.7k|	if (flags & HOEDOWN_LIST_ORDERED) {
  ------------------
  |  Branch (508:6): [True: 22.0k, False: 31.6k]
  ------------------
  509|  22.0k|		HOEDOWN_BUFPUTSL(ob, "<ol");
  ------------------
  |  |  119|  22.0k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  510|  31.6k|	} else if (flags & HOEDOWN_LIST_DEFINITION) {
  ------------------
  |  Branch (510:13): [True: 20.1k, False: 11.5k]
  ------------------
  511|  20.1k|		HOEDOWN_BUFPUTSL(ob, "<dl");
  ------------------
  |  |  119|  20.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  512|  20.1k|	} else {
  513|  11.5k|		HOEDOWN_BUFPUTSL(ob, "<ul");
  ------------------
  |  |  119|  11.5k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  514|  11.5k|	}
  515|  53.7k|	if (attr && attr->size) {
  ------------------
  |  Branch (515:6): [True: 53.7k, False: 0]
  |  Branch (515:14): [True: 479, False: 53.3k]
  ------------------
  516|    479|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  517|    479|	}
  518|       |
  519|  53.7k|	HOEDOWN_BUFPUTSL(ob, ">\n");
  ------------------
  |  |  119|  53.7k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  520|       |
  521|  53.7k|	if (content) {
  ------------------
  |  Branch (521:6): [True: 53.7k, False: 0]
  ------------------
  522|  53.7k|		if (flags & HOEDOWN_LI_RADIO) {
  ------------------
  |  Branch (522:7): [True: 0, False: 53.7k]
  ------------------
  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.7k|		} else {
  529|  53.7k|			hoedown_buffer_put(ob, content->data, content->size);
  530|  53.7k|		}
  531|  53.7k|        }
  532|       |
  533|  53.7k|	if (flags & HOEDOWN_LIST_ORDERED) {
  ------------------
  |  Branch (533:6): [True: 22.0k, False: 31.6k]
  ------------------
  534|  22.0k|		HOEDOWN_BUFPUTSL(ob, "</ol>\n");
  ------------------
  |  |  119|  22.0k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  535|  31.6k|	} else if (flags & HOEDOWN_LIST_DEFINITION) {
  ------------------
  |  Branch (535:13): [True: 20.1k, False: 11.5k]
  ------------------
  536|  20.1k|		HOEDOWN_BUFPUTSL(ob, "</dl>\n");
  ------------------
  |  |  119|  20.1k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  537|  20.1k|	} else {
  538|  11.5k|		HOEDOWN_BUFPUTSL(ob, "</ul>\n");
  ------------------
  |  |  119|  11.5k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  539|  11.5k|	}
  540|  53.7k|}
html.c:rndr_listitem:
  544|   241k|{
  545|   241k|	if (content) {
  ------------------
  |  Branch (545:6): [True: 241k, False: 0]
  ------------------
  546|   241k|		hoedown_html_renderer_state *state = data->opaque;
  547|   241k|		size_t prefix = 0;
  548|   241k|		size_t size = content->size;
  549|   241k|		int is_li_tag = 0;
  550|   279k|		while (size && content->data[size - 1] == '\n')
  ------------------
  |  Branch (550:10): [True: 225k, False: 53.8k]
  |  Branch (550:18): [True: 37.6k, False: 187k]
  ------------------
  551|  37.6k|			size--;
  552|       |
  553|   241k|		if (*flags & HOEDOWN_LI_DD) {
  ------------------
  |  Branch (553:7): [True: 73.3k, False: 168k]
  ------------------
  554|  73.3k|			HOEDOWN_BUFPUTSL(ob, "<dd");
  ------------------
  |  |  119|  73.3k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  555|   168k|		} else  if (*flags & HOEDOWN_LI_DT) {
  ------------------
  |  Branch (555:15): [True: 93.3k, False: 74.9k]
  ------------------
  556|  93.3k|			HOEDOWN_BUFPUTSL(ob, "<dt");
  ------------------
  |  |  119|  93.3k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  557|  93.3k|		} else {
  558|  74.9k|			HOEDOWN_BUFPUTSL(ob, "<li");
  ------------------
  |  |  119|  74.9k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  559|  74.9k|			is_li_tag = 1;
  560|  74.9k|		}
  561|       |
  562|   241k|		if (attr && attr->size) {
  ------------------
  |  Branch (562:7): [True: 241k, False: 0]
  |  Branch (562:15): [True: 6.62k, False: 234k]
  ------------------
  563|  6.62k|			rndr_attributes(ob, attr->data, attr->size, NULL, data);
  564|  6.62k|		}
  565|   241k|		hoedown_buffer_putc(ob, '>');
  566|       |
  567|   241k|		if (USE_TASK_LIST(state) && is_li_tag && size >= 3) {
  ------------------
  |  |   16|   483k|#define USE_TASK_LIST(opt) (opt->flags & HOEDOWN_HTML_USE_TASK_LIST)
  |  |  ------------------
  |  |  |  Branch (16:28): [True: 241k, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (567:31): [True: 74.9k, False: 166k]
  |  Branch (567:44): [True: 48.1k, False: 26.7k]
  ------------------
  568|       |			/* Block list items are wrapped in <p> tags. Output the opening tag now,
  569|       |			 * then check for a task list. */
  570|  48.1k|			if (*flags & HOEDOWN_LI_BLOCK) {
  ------------------
  |  Branch (570:8): [True: 27.1k, False: 21.0k]
  ------------------
  571|  27.1k|				prefix = 3;
  572|  27.1k|				hoedown_buffer_put(ob, content->data, prefix);
  573|  27.1k|			}
  574|  48.1k|			if (size >= prefix + 3) {
  ------------------
  |  Branch (574:8): [True: 43.0k, False: 5.13k]
  ------------------
  575|  43.0k|				if (strncmp((char *)content->data + prefix, "[ ]", 3) == 0) {
  ------------------
  |  Branch (575:9): [True: 266, False: 42.7k]
  ------------------
  576|    266|					HOEDOWN_BUFPUTSL(ob, "<input type=\"checkbox\"");
  ------------------
  |  |  119|    266|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  577|    266|					hoedown_buffer_puts(ob, USE_XHTML(state) ? "/>" : ">");
  ------------------
  |  |   15|    266|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 266, False: 0]
  |  |  ------------------
  ------------------
  578|    266|					prefix += 3;
  579|    266|					*flags |= HOEDOWN_LI_TASK;
  580|  42.7k|				} else if (strncasecmp((char *)content->data + prefix, "[x]", 3) == 0) {
  ------------------
  |  Branch (580:16): [True: 218, False: 42.5k]
  ------------------
  581|    218|					HOEDOWN_BUFPUTSL(ob, "<input checked=\"\" type=\"checkbox\"");
  ------------------
  |  |  119|    218|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  582|    218|					hoedown_buffer_puts(ob, USE_XHTML(state) ? "/>" : ">");
  ------------------
  |  |   15|    218|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 218, False: 0]
  |  |  ------------------
  ------------------
  583|    218|					prefix += 3;
  584|    218|					*flags |= HOEDOWN_LI_TASK;
  585|    218|				}
  586|  43.0k|			}
  587|  48.1k|		}
  588|   241k|		if (USE_RADIO_LIST(state) && is_li_tag && size >= 3) {
  ------------------
  |  |   17|   483k|#define USE_RADIO_LIST(opt) (opt->flags & HOEDOWN_HTML_USE_RADIO_LIST)
  |  |  ------------------
  |  |  |  Branch (17:29): [True: 0, False: 241k]
  |  |  ------------------
  ------------------
  |  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|   241k|		hoedown_buffer_put(ob, content->data+prefix, size-prefix);
  609|   241k|	} 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|   241k|	if (*flags & HOEDOWN_LI_DD) {
  ------------------
  |  Branch (618:6): [True: 73.3k, False: 168k]
  ------------------
  619|  73.3k|		HOEDOWN_BUFPUTSL(ob, "</dd>\n");
  ------------------
  |  |  119|  73.3k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  620|   168k|	} else if (*flags & HOEDOWN_LI_DT) {
  ------------------
  |  Branch (620:13): [True: 93.3k, False: 74.9k]
  ------------------
  621|  93.3k|		HOEDOWN_BUFPUTSL(ob, "</dt>\n");
  ------------------
  |  |  119|  93.3k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  622|  93.3k|	} else {
  623|  74.9k|		HOEDOWN_BUFPUTSL(ob, "</li>\n");
  ------------------
  |  |  119|  74.9k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  624|  74.9k|	}
  625|   241k|}
html.c:rndr_paragraph:
  629|   374k|{
  630|   374k|	hoedown_html_renderer_state *state = data->opaque;
  631|   374k|	size_t i = 0;
  632|       |
  633|   374k|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (633:6): [True: 339k, False: 34.9k]
  ------------------
  634|       |
  635|   374k|	if (!content || !content->size)
  ------------------
  |  Branch (635:6): [True: 0, False: 374k]
  |  Branch (635:18): [True: 222, False: 373k]
  ------------------
  636|    222|		return;
  637|       |
  638|   668k|	while (i < content->size && isspace(content->data[i])) i++;
  ------------------
  |  Branch (638:9): [True: 667k, False: 526]
  ------------------
  639|       |
  640|   373k|	if (i == content->size)
  ------------------
  |  Branch (640:6): [True: 526, False: 373k]
  ------------------
  641|    526|		return;
  642|       |
  643|   373k|	HOEDOWN_BUFPUTSL(ob, "<p");
  ------------------
  |  |  119|   373k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  644|       |
  645|   373k|	if (attr && attr->size) {
  ------------------
  |  Branch (645:6): [True: 351k, False: 21.6k]
  |  Branch (645:14): [True: 0, False: 351k]
  ------------------
  646|      0|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  647|      0|	}
  648|       |
  649|   373k|	HOEDOWN_BUFPUTSL(ob, ">");
  ------------------
  |  |  119|   373k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  650|       |
  651|   373k|	if (state->flags & HOEDOWN_HTML_HARD_WRAP) {
  ------------------
  |  Branch (651:6): [True: 373k, False: 0]
  ------------------
  652|   373k|		size_t org;
  653|   889k|		while (i < content->size) {
  ------------------
  |  Branch (653:10): [True: 889k, False: 0]
  ------------------
  654|   889k|			org = i;
  655|  1.19G|			while (i < content->size && content->data[i] != '\n')
  ------------------
  |  Branch (655:11): [True: 1.19G, False: 373k]
  |  Branch (655:32): [True: 1.19G, False: 516k]
  ------------------
  656|  1.19G|				i++;
  657|       |
  658|   889k|			if (i > org)
  ------------------
  |  Branch (658:8): [True: 889k, False: 467]
  ------------------
  659|   889k|				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|   889k|			if (i >= content->size - 1)
  ------------------
  |  Branch (665:8): [True: 373k, False: 516k]
  ------------------
  666|   373k|				break;
  667|       |
  668|   516k|			rndr_linebreak(ob, data);
  669|   516k|			i++;
  670|   516k|		}
  671|   373k|	} 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]))) {
  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|   373k|	HOEDOWN_BUFPUTSL(ob, "</p>\n");
  ------------------
  |  |  119|   373k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  700|   373k|}
html.c:rndr_table:
  794|  3.06k|{
  795|  3.06k|    if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (795:9): [True: 1.64k, False: 1.42k]
  ------------------
  796|  3.06k|    HOEDOWN_BUFPUTSL(ob, "<table");
  ------------------
  |  |  119|  3.06k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  797|  3.06k|    if (attr) rndr_attributes(ob, attr->data, attr->size, NULL, data);
  ------------------
  |  Branch (797:9): [True: 3.06k, False: 0]
  ------------------
  798|  3.06k|    HOEDOWN_BUFPUTSL(ob, ">\n");
  ------------------
  |  |  119|  3.06k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  799|  3.06k|    hoedown_buffer_put(ob, content->data, content->size);
  800|  3.06k|    HOEDOWN_BUFPUTSL(ob, "</table>\n");
  ------------------
  |  |  119|  3.06k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  801|  3.06k|}
html.c:rndr_table_header:
  805|  3.06k|{
  806|  3.06k|    if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (806:9): [True: 0, False: 3.06k]
  ------------------
  807|  3.06k|    HOEDOWN_BUFPUTSL(ob, "<thead>\n");
  ------------------
  |  |  119|  3.06k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  808|  3.06k|    hoedown_buffer_put(ob, content->data, content->size);
  809|  3.06k|    HOEDOWN_BUFPUTSL(ob, "</thead>\n");
  ------------------
  |  |  119|  3.06k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  810|  3.06k|}
html.c:rndr_table_body:
  814|  3.06k|{
  815|  3.06k|    if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (815:9): [True: 3.06k, False: 0]
  ------------------
  816|  3.06k|    HOEDOWN_BUFPUTSL(ob, "<tbody>\n");
  ------------------
  |  |  119|  3.06k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  817|  3.06k|    hoedown_buffer_put(ob, content->data, content->size);
  818|  3.06k|    HOEDOWN_BUFPUTSL(ob, "</tbody>\n");
  ------------------
  |  |  119|  3.06k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  819|  3.06k|}
html.c:rndr_tablerow:
  823|  11.2k|{
  824|  11.2k|	HOEDOWN_BUFPUTSL(ob, "<tr>\n");
  ------------------
  |  |  119|  11.2k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  825|  11.2k|	if (content) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (825:6): [True: 11.2k, False: 0]
  ------------------
  826|  11.2k|	HOEDOWN_BUFPUTSL(ob, "</tr>\n");
  ------------------
  |  |  119|  11.2k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  827|  11.2k|}
html.c:rndr_tablecell:
  831|  19.6k|{
  832|  19.6k|	if (flags & HOEDOWN_TABLE_HEADER) {
  ------------------
  |  Branch (832:6): [True: 4.72k, False: 14.9k]
  ------------------
  833|  4.72k|		HOEDOWN_BUFPUTSL(ob, "<th");
  ------------------
  |  |  119|  4.72k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  834|  14.9k|	} else {
  835|  14.9k|		HOEDOWN_BUFPUTSL(ob, "<td");
  ------------------
  |  |  119|  14.9k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  836|  14.9k|	}
  837|       |
  838|  19.6k|	switch (flags & HOEDOWN_TABLE_ALIGNMASK) {
  839|  7.65k|	case HOEDOWN_TABLE_ALIGN_CENTER:
  ------------------
  |  Branch (839:2): [True: 7.65k, False: 12.0k]
  ------------------
  840|  7.65k|		HOEDOWN_BUFPUTSL(ob, " style=\"text-align: center\">");
  ------------------
  |  |  119|  7.65k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  841|  7.65k|		break;
  842|       |
  843|  1.31k|	case HOEDOWN_TABLE_ALIGN_LEFT:
  ------------------
  |  Branch (843:2): [True: 1.31k, False: 18.3k]
  ------------------
  844|  1.31k|		HOEDOWN_BUFPUTSL(ob, " style=\"text-align: left\">");
  ------------------
  |  |  119|  1.31k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  845|  1.31k|		break;
  846|       |
  847|  8.48k|	case HOEDOWN_TABLE_ALIGN_RIGHT:
  ------------------
  |  Branch (847:2): [True: 8.48k, False: 11.2k]
  ------------------
  848|  8.48k|		HOEDOWN_BUFPUTSL(ob, " style=\"text-align: right\">");
  ------------------
  |  |  119|  8.48k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  849|  8.48k|		break;
  850|       |
  851|  2.22k|	default:
  ------------------
  |  Branch (851:2): [True: 2.22k, False: 17.4k]
  ------------------
  852|  2.22k|		HOEDOWN_BUFPUTSL(ob, ">");
  ------------------
  |  |  119|  2.22k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  853|  19.6k|	}
  854|       |
  855|  19.6k|	if (content)
  ------------------
  |  Branch (855:6): [True: 19.6k, False: 0]
  ------------------
  856|  19.6k|		hoedown_buffer_put(ob, content->data, content->size);
  857|       |
  858|  19.6k|	if (flags & HOEDOWN_TABLE_HEADER) {
  ------------------
  |  Branch (858:6): [True: 4.72k, False: 14.9k]
  ------------------
  859|  4.72k|		HOEDOWN_BUFPUTSL(ob, "</th>\n");
  ------------------
  |  |  119|  4.72k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  860|  14.9k|	} else {
  861|  14.9k|		HOEDOWN_BUFPUTSL(ob, "</td>\n");
  ------------------
  |  |  119|  14.9k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  862|  14.9k|	}
  863|  19.6k|}
html.c:rndr_footnotes:
  884|    525|{
  885|    525|	hoedown_html_renderer_state *state = data->opaque;
  886|       |
  887|    525|	if (ob->size) hoedown_buffer_putc(ob, '\n');
  ------------------
  |  Branch (887:6): [True: 525, False: 0]
  ------------------
  888|    525|	HOEDOWN_BUFPUTSL(ob, "<div class=\"footnotes\">\n");
  ------------------
  |  |  119|    525|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  889|    525|	hoedown_buffer_puts(ob, USE_XHTML(state) ? "<hr/>\n" : "<hr>\n");
  ------------------
  |  |   15|    525|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 525, False: 0]
  |  |  ------------------
  ------------------
  890|    525|	HOEDOWN_BUFPUTSL(ob, "<ol>\n");
  ------------------
  |  |  119|    525|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  891|       |
  892|    525|	if (content) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (892:6): [True: 525, False: 0]
  ------------------
  893|       |
  894|    525|	HOEDOWN_BUFPUTSL(ob, "\n</ol>\n</div>\n");
  ------------------
  |  |  119|    525|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  895|    525|}
html.c:rndr_footnote_def:
  899|    770|{
  900|    770|	size_t i = 0;
  901|    770|	int pfound = 0;
  902|       |
  903|       |	/* insert anchor at the end of first paragraph block */
  904|    770|	if (content) {
  ------------------
  |  Branch (904:6): [True: 770, False: 0]
  ------------------
  905|  4.17M|		while ((i+3) < content->size) {
  ------------------
  |  Branch (905:10): [True: 4.17M, False: 346]
  ------------------
  906|  4.17M|			if (content->data[i++] != '<') continue;
  ------------------
  |  Branch (906:8): [True: 4.17M, False: 7.21k]
  ------------------
  907|  7.21k|			if (content->data[i++] != '/') continue;
  ------------------
  |  Branch (907:8): [True: 3.35k, False: 3.86k]
  ------------------
  908|  3.86k|			if (content->data[i++] != 'p' && content->data[i] != 'P') continue;
  ------------------
  |  Branch (908:8): [True: 3.22k, False: 637]
  |  Branch (908:37): [True: 2.77k, False: 456]
  ------------------
  909|  1.09k|			if (content->data[i] != '>') continue;
  ------------------
  |  Branch (909:8): [True: 669, False: 424]
  ------------------
  910|    424|			i -= 3;
  911|    424|			pfound = 1;
  912|    424|			break;
  913|  1.09k|		}
  914|    770|	}
  915|       |
  916|    770|	hoedown_buffer_printf(ob, "\n<li id=\"fn%d\">\n", num);
  917|    770|	if (pfound) {
  ------------------
  |  Branch (917:6): [True: 424, False: 346]
  ------------------
  918|    424|		hoedown_buffer_put(ob, content->data, i);
  919|    424|		hoedown_buffer_printf(ob, "&nbsp;<a href=\"#fnref%d\" rev=\"footnote\">&#8617;</a>", num);
  920|    424|		hoedown_buffer_put(ob, content->data + i, content->size - i);
  921|    424|	} else if (content) {
  ------------------
  |  Branch (921:13): [True: 346, False: 0]
  ------------------
  922|    346|		hoedown_buffer_put(ob, content->data, content->size);
  923|    346|	}
  924|    770|	HOEDOWN_BUFPUTSL(ob, "</li>\n");
  ------------------
  |  |  119|    770|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  925|    770|}
html.c:rndr_autolink:
  177|  5.03k|{
  178|  5.03k|	hoedown_html_renderer_state *state = data->opaque;
  179|       |
  180|  5.03k|	if (!link || !link->size)
  ------------------
  |  Branch (180:6): [True: 0, False: 5.03k]
  |  Branch (180:15): [True: 0, False: 5.03k]
  ------------------
  181|      0|		return 0;
  182|       |
  183|  5.03k|	HOEDOWN_BUFPUTSL(ob, "<a href=\"");
  ------------------
  |  |  119|  5.03k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  184|  5.03k|	if (type == HOEDOWN_AUTOLINK_EMAIL)
  ------------------
  |  Branch (184:6): [True: 1.74k, False: 3.28k]
  ------------------
  185|  1.74k|		HOEDOWN_BUFPUTSL(ob, "mailto:");
  ------------------
  |  |  119|  1.74k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  186|  5.03k|	escape_href(ob, link->data, link->size);
  187|       |
  188|  5.03k|	if (state->link_attributes) {
  ------------------
  |  Branch (188:6): [True: 0, False: 5.03k]
  ------------------
  189|      0|		hoedown_buffer_putc(ob, '\"');
  190|      0|		state->link_attributes(ob, link, data);
  191|      0|		hoedown_buffer_putc(ob, '>');
  192|  5.03k|	} else {
  193|  5.03k|		HOEDOWN_BUFPUTSL(ob, "\">");
  ------------------
  |  |  119|  5.03k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  194|  5.03k|	}
  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|  5.03k|	if (hoedown_buffer_prefix(link, "mailto:") == 0) {
  ------------------
  |  Branch (201:6): [True: 307, False: 4.72k]
  ------------------
  202|    307|		escape_html(ob, link->data + 7, link->size - 7);
  203|  4.72k|	} else {
  204|  4.72k|		escape_html(ob, link->data, link->size);
  205|  4.72k|	}
  206|       |
  207|  5.03k|	HOEDOWN_BUFPUTSL(ob, "</a>");
  ------------------
  |  |  119|  5.03k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  208|       |
  209|  5.03k|	return 1;
  210|  5.03k|}
html.c:escape_href:
   62|   292k|{
   63|   292k|	hoedown_escape_href(ob, source, length);
   64|   292k|}
html.c:rndr_image:
  749|  13.5k|{
  750|  13.5k|	hoedown_html_renderer_state *state = data->opaque;
  751|  13.5k|	if (!link || !link->size) return 0;
  ------------------
  |  Branch (751:6): [True: 3.49k, False: 10.0k]
  |  Branch (751:15): [True: 1.54k, False: 8.47k]
  ------------------
  752|       |
  753|  8.47k|	HOEDOWN_BUFPUTSL(ob, "<img src=\"");
  ------------------
  |  |  119|  8.47k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  754|  8.47k|	escape_href(ob, link->data, link->size);
  755|  8.47k|	HOEDOWN_BUFPUTSL(ob, "\" alt=\"");
  ------------------
  |  |  119|  8.47k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  756|       |
  757|  8.47k|	if (alt && alt->size)
  ------------------
  |  Branch (757:6): [True: 704, False: 7.77k]
  |  Branch (757:13): [True: 704, False: 0]
  ------------------
  758|    704|		escape_html(ob, alt->data, alt->size);
  759|       |
  760|  8.47k|	if (title && title->size) {
  ------------------
  |  Branch (760:6): [True: 2.96k, False: 5.51k]
  |  Branch (760:15): [True: 2.96k, False: 0]
  ------------------
  761|  2.96k|		HOEDOWN_BUFPUTSL(ob, "\" title=\"");
  ------------------
  |  |  119|  2.96k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  762|  2.96k|		escape_html(ob, title->data, title->size); }
  763|       |
  764|  8.47k|	hoedown_buffer_putc(ob, '"');
  765|  8.47k|	if (attr && attr->size) {
  ------------------
  |  Branch (765:6): [True: 2.35k, False: 6.12k]
  |  Branch (765:14): [True: 2.35k, False: 0]
  ------------------
  766|  2.35k|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  767|  2.35k|	}
  768|       |
  769|  8.47k|	hoedown_buffer_puts(ob, USE_XHTML(state) ? "/>" : ">");
  ------------------
  |  |   15|  8.47k|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 8.47k, False: 0]
  |  |  ------------------
  ------------------
  770|  8.47k|	return 1;
  771|  13.5k|}
html.c:rndr_linebreak:
  358|   535k|{
  359|   535k|	hoedown_html_renderer_state *state = data->opaque;
  360|   535k|	hoedown_buffer_puts(ob, USE_XHTML(state) ? "<br/>\n" : "<br>\n");
  ------------------
  |  |   15|   535k|#define USE_XHTML(opt) (opt->flags & HOEDOWN_HTML_USE_XHTML)
  |  |  ------------------
  |  |  |  Branch (15:24): [True: 535k, False: 0]
  |  |  ------------------
  ------------------
  361|   535k|	return 1;
  362|   535k|}
html.c:rndr_link:
  449|   287k|{
  450|   287k|	hoedown_html_renderer_state *state = data->opaque;
  451|       |
  452|   287k|	HOEDOWN_BUFPUTSL(ob, "<a href=\"");
  ------------------
  |  |  119|   287k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  453|       |
  454|   287k|	if (link && link->size) {
  ------------------
  |  Branch (454:6): [True: 282k, False: 4.53k]
  |  Branch (454:14): [True: 278k, False: 4.06k]
  ------------------
  455|   278k|		escape_href(ob, link->data, link->size);
  456|   278k|	}
  457|       |
  458|   287k|	if (title && title->size) {
  ------------------
  |  Branch (458:6): [True: 175k, False: 112k]
  |  Branch (458:15): [True: 175k, False: 0]
  ------------------
  459|   175k|		HOEDOWN_BUFPUTSL(ob, "\" title=\"");
  ------------------
  |  |  119|   175k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  460|   175k|		escape_html(ob, title->data, title->size);
  461|   175k|	}
  462|       |
  463|   287k|	hoedown_buffer_putc(ob, '"');
  464|   287k|	if (state->link_attributes) {
  ------------------
  |  Branch (464:6): [True: 0, False: 287k]
  ------------------
  465|      0|		state->link_attributes(ob, link, data);
  466|      0|	}
  467|   287k|	if (attr && attr->size) {
  ------------------
  |  Branch (467:6): [True: 37.7k, False: 249k]
  |  Branch (467:14): [True: 37.7k, False: 0]
  ------------------
  468|  37.7k|		rndr_attributes(ob, attr->data, attr->size, NULL, data);
  469|  37.7k|	}
  470|   287k|	hoedown_buffer_putc(ob, '>');
  471|       |
  472|   287k|	if (content && content->size) hoedown_buffer_put(ob, content->data, content->size);
  ------------------
  |  Branch (472:6): [True: 16.8k, False: 270k]
  |  Branch (472:17): [True: 16.6k, False: 245]
  ------------------
  473|   287k|	HOEDOWN_BUFPUTSL(ob, "</a>");
  ------------------
  |  |  119|   287k|	hoedown_buffer_put(output, (const uint8_t *)literal, sizeof(literal) - 1)
  ------------------
  474|   287k|	return 1;
  475|   287k|}
html.c:rndr_footnote_ref:
  929|    770|{
  930|    770|	hoedown_buffer_printf(ob, "<sup id=\"fnref%d\"><a href=\"#fn%d\" rel=\"footnote\">%d</a></sup>", num, num, num);
  931|    770|	return 1;
  932|    770|}
html.c:rndr_math:
  936|   123k|{
  937|   123k|	hoedown_buffer_put(ob, (const uint8_t *)(displaymode ? "\\[" : "\\("), 2);
  ------------------
  |  Branch (937:43): [True: 108k, False: 15.5k]
  ------------------
  938|   123k|	escape_html(ob, text->data, text->size);
  939|   123k|	hoedown_buffer_put(ob, (const uint8_t *)(displaymode ? "\\]" : "\\)"), 2);
  ------------------
  |  Branch (939:43): [True: 108k, False: 15.5k]
  ------------------
  940|   123k|	return 1;
  941|   123k|}
html.c:rndr_raw_html:
  775|  55.0k|{
  776|  55.0k|	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|  55.0k|	if((state->flags & HOEDOWN_HTML_ESCAPE) != 0) {
  ------------------
  |  Branch (780:5): [True: 55.0k, False: 0]
  ------------------
  781|  55.0k|		escape_html(ob, text->data, text->size);
  782|  55.0k|		return 1;
  783|  55.0k|	}
  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|   262k|{
  141|   262k|  enum
  142|   262k|    {
  143|   262k|      TOTAL_KEYWORDS = 35,
  144|   262k|      MIN_WORD_LENGTH = 1,
  145|   262k|      MAX_WORD_LENGTH = 10,
  146|   262k|      MIN_HASH_VALUE = 1,
  147|   262k|      MAX_HASH_VALUE = 37
  148|   262k|    };
  149|       |
  150|   262k|  if (len <= MAX_WORD_LENGTH && len >= MIN_WORD_LENGTH)
  ------------------
  |  Branch (150:7): [True: 95.8k, False: 166k]
  |  Branch (150:33): [True: 94.7k, False: 1.11k]
  ------------------
  151|  94.7k|    {
  152|  94.7k|      register int key = hash (str, len);
  153|       |
  154|  94.7k|      if (key <= MAX_HASH_VALUE && key >= MIN_HASH_VALUE)
  ------------------
  |  Branch (154:11): [True: 18.1k, False: 76.5k]
  |  Branch (154:36): [True: 18.1k, False: 0]
  ------------------
  155|  18.1k|        {
  156|  18.1k|          register const char *resword;
  157|       |
  158|  18.1k|          switch (key - 1)
  ------------------
  |  Branch (158:19): [True: 408, False: 17.7k]
  ------------------
  159|  18.1k|            {
  160|  8.28k|              case 0:
  ------------------
  |  Branch (160:15): [True: 8.28k, False: 9.83k]
  ------------------
  161|  8.28k|                resword = "p";
  162|  8.28k|                goto compare;
  163|      5|              case 2:
  ------------------
  |  Branch (163:15): [True: 5, False: 18.1k]
  ------------------
  164|      5|                resword = "ul";
  165|      5|                goto compare;
  166|      6|              case 3:
  ------------------
  |  Branch (166:15): [True: 6, False: 18.1k]
  ------------------
  167|      6|                resword = "pre";
  168|      6|                goto compare;
  169|      0|              case 5:
  ------------------
  |  Branch (169:15): [True: 0, False: 18.1k]
  ------------------
  170|      0|                resword = "form";
  171|      0|                goto compare;
  172|      2|              case 6:
  ------------------
  |  Branch (172:15): [True: 2, False: 18.1k]
  ------------------
  173|      2|                resword = "style";
  174|      2|                goto compare;
  175|      0|              case 7:
  ------------------
  |  Branch (175:15): [True: 0, False: 18.1k]
  ------------------
  176|      0|                resword = "footer";
  177|      0|                goto compare;
  178|    263|              case 8:
  ------------------
  |  Branch (178:15): [True: 263, False: 17.8k]
  ------------------
  179|    263|                resword = "figure";
  180|    263|                goto compare;
  181|      0|              case 9:
  ------------------
  |  Branch (181:15): [True: 0, False: 18.1k]
  ------------------
  182|      0|                resword = "section";
  183|      0|                goto compare;
  184|    367|              case 10:
  ------------------
  |  Branch (184:15): [True: 367, False: 17.7k]
  ------------------
  185|    367|                resword = "fieldset";
  186|    367|                goto compare;
  187|    443|              case 11:
  ------------------
  |  Branch (187:15): [True: 443, False: 17.6k]
  ------------------
  188|    443|                resword = "dl";
  189|    443|                goto compare;
  190|  2.97k|              case 12:
  ------------------
  |  Branch (190:15): [True: 2.97k, False: 15.1k]
  ------------------
  191|  2.97k|                resword = "figcaption";
  192|  2.97k|                goto compare;
  193|    254|              case 13:
  ------------------
  |  Branch (193:15): [True: 254, False: 17.8k]
  ------------------
  194|    254|                resword = "div";
  195|    254|                goto compare;
  196|  2.72k|              case 14:
  ------------------
  |  Branch (196:15): [True: 2.72k, False: 15.3k]
  ------------------
  197|  2.72k|                resword = "del";
  198|  2.72k|                goto compare;
  199|     16|              case 15:
  ------------------
  |  Branch (199:15): [True: 16, False: 18.1k]
  ------------------
  200|     16|                resword = "header";
  201|     16|                goto compare;
  202|    716|              case 16:
  ------------------
  |  Branch (202:15): [True: 716, False: 17.4k]
  ------------------
  203|    716|                resword = "script";
  204|    716|                goto compare;
  205|     10|              case 17:
  ------------------
  |  Branch (205:15): [True: 10, False: 18.1k]
  ------------------
  206|     10|                resword = "math";
  207|     10|                goto compare;
  208|     75|              case 18:
  ------------------
  |  Branch (208:15): [True: 75, False: 18.0k]
  ------------------
  209|     75|                resword = "video";
  210|     75|                goto compare;
  211|     11|              case 19:
  ------------------
  |  Branch (211:15): [True: 11, False: 18.1k]
  ------------------
  212|     11|                resword = "ol";
  213|     11|                goto compare;
  214|     21|              case 20:
  ------------------
  |  Branch (214:15): [True: 21, False: 18.1k]
  ------------------
  215|     21|                resword = "noscript";
  216|     21|                goto compare;
  217|      8|              case 21:
  ------------------
  |  Branch (217:15): [True: 8, False: 18.1k]
  ------------------
  218|      8|                resword = "hgroup";
  219|      8|                goto compare;
  220|     42|              case 22:
  ------------------
  |  Branch (220:15): [True: 42, False: 18.0k]
  ------------------
  221|     42|                resword = "table";
  222|     42|                goto compare;
  223|      3|              case 23:
  ------------------
  |  Branch (223:15): [True: 3, False: 18.1k]
  ------------------
  224|      3|                resword = "blockquote";
  225|      3|                goto compare;
  226|     17|              case 24:
  ------------------
  |  Branch (226:15): [True: 17, False: 18.1k]
  ------------------
  227|     17|                resword = "article";
  228|     17|                goto compare;
  229|     26|              case 25:
  ------------------
  |  Branch (229:15): [True: 26, False: 18.0k]
  ------------------
  230|     26|                resword = "aside";
  231|     26|                goto compare;
  232|    759|              case 26:
  ------------------
  |  Branch (232:15): [True: 759, False: 17.3k]
  ------------------
  233|    759|                resword = "ins";
  234|    759|                goto compare;
  235|      3|              case 27:
  ------------------
  |  Branch (235:15): [True: 3, False: 18.1k]
  ------------------
  236|      3|                resword = "iframe";
  237|      3|                goto compare;
  238|     34|              case 28:
  ------------------
  |  Branch (238:15): [True: 34, False: 18.0k]
  ------------------
  239|     34|                resword = "canvas";
  240|     34|                goto compare;
  241|      1|              case 29:
  ------------------
  |  Branch (241:15): [True: 1, False: 18.1k]
  ------------------
  242|      1|                resword = "nav";
  243|      1|                goto compare;
  244|      5|              case 30:
  ------------------
  |  Branch (244:15): [True: 5, False: 18.1k]
  ------------------
  245|      5|                resword = "h6";
  246|      5|                goto compare;
  247|      5|              case 31:
  ------------------
  |  Branch (247:15): [True: 5, False: 18.1k]
  ------------------
  248|      5|                resword = "h5";
  249|      5|                goto compare;
  250|    529|              case 32:
  ------------------
  |  Branch (250:15): [True: 529, False: 17.5k]
  ------------------
  251|    529|                resword = "h4";
  252|    529|                goto compare;
  253|      3|              case 33:
  ------------------
  |  Branch (253:15): [True: 3, False: 18.1k]
  ------------------
  254|      3|                resword = "h3";
  255|      3|                goto compare;
  256|     22|              case 34:
  ------------------
  |  Branch (256:15): [True: 22, False: 18.1k]
  ------------------
  257|     22|                resword = "h2";
  258|     22|                goto compare;
  259|      5|              case 35:
  ------------------
  |  Branch (259:15): [True: 5, False: 18.1k]
  ------------------
  260|      5|                resword = "h1";
  261|      5|                goto compare;
  262|     77|              case 36:
  ------------------
  |  Branch (262:15): [True: 77, False: 18.0k]
  ------------------
  263|     77|                resword = "output";
  264|     77|                goto compare;
  265|  18.1k|            }
  266|    408|          return 0;
  267|  17.7k|        compare:
  268|  17.7k|          if ((((unsigned char)*str ^ (unsigned char)*resword) & ~32) == 0 && !gperf_case_strncmp (str, resword, len) && resword[len] == '\0')
  ------------------
  |  Branch (268:15): [True: 10.3k, False: 7.37k]
  |  Branch (268:79): [True: 9.49k, False: 845]
  |  Branch (268:122): [True: 9.49k, False: 0]
  ------------------
  269|  9.49k|            return resword;
  270|  17.7k|        }
  271|  94.7k|    }
  272|   252k|  return 0;
  273|   262k|}
html5_blocks.c:hash:
   88|  94.7k|{
   89|  94.7k|  static const unsigned char asso_values[] =
   90|  94.7k|    {
   91|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
   92|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
   93|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
   94|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
   95|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
   96|  94.7k|      26, 25, 24, 23, 22, 21, 38, 38, 38, 38,
   97|  94.7k|      38, 38, 38, 38, 38, 17, 14,  9, 10, 38,
   98|  94.7k|       2, 16,  8,  6,  1, 38, 38,  0, 13, 18,
   99|  94.7k|       0, 38, 38,  1,  4,  1, 13, 38, 38, 38,
  100|  94.7k|      38, 38, 38, 38, 38, 38, 38, 17, 14,  9,
  101|  94.7k|      10, 38,  2, 16,  8,  6,  1, 38, 38,  0,
  102|  94.7k|      13, 18,  0, 38, 38,  1,  4,  1, 13, 38,
  103|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  104|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  105|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  106|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  107|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  108|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  109|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  110|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  111|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  112|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  113|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  114|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  115|  94.7k|      38, 38, 38, 38, 38, 38, 38, 38, 38, 38,
  116|  94.7k|      38, 38, 38, 38, 38, 38, 38
  117|  94.7k|    };
  118|  94.7k|  register int hval = len;
  119|       |
  120|  94.7k|  switch (hval)
  121|  94.7k|    {
  122|  74.6k|      default:
  ------------------
  |  Branch (122:7): [True: 74.6k, False: 20.0k]
  ------------------
  123|  74.6k|        hval += asso_values[(unsigned char)str[1]+1];
  124|       |      /*FALLTHROUGH*/
  125|  94.7k|      case 1:
  ------------------
  |  Branch (125:7): [True: 20.0k, False: 74.6k]
  ------------------
  126|  94.7k|        hval += asso_values[(unsigned char)str[0]];
  127|  94.7k|        break;
  128|  94.7k|    }
  129|  94.7k|  return hval;
  130|  94.7k|}
html5_blocks.c:gperf_case_strncmp:
   63|  10.3k|{
   64|  23.3k|  for (; n > 0;)
  ------------------
  |  Branch (64:10): [True: 13.9k, False: 9.49k]
  ------------------
   65|  13.9k|    {
   66|  13.9k|      unsigned char c1 = gperf_downcase[(unsigned char)*s1++];
   67|  13.9k|      unsigned char c2 = gperf_downcase[(unsigned char)*s2++];
   68|  13.9k|      if (c1 != 0 && c1 == c2)
  ------------------
  |  Branch (68:11): [True: 13.3k, False: 597]
  |  Branch (68:22): [True: 13.0k, False: 248]
  ------------------
   69|  13.0k|        {
   70|  13.0k|          n--;
   71|  13.0k|          continue;
   72|  13.0k|        }
   73|    845|      return (int)c1 - (int)c2;
   74|  13.9k|    }
   75|  9.49k|  return 0;
   76|  10.3k|}

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

LLVMFuzzerTestOneInput:
   50|  12.4k|int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   51|  12.4k|  struct option_data opt;
   52|  12.4k|  hoedown_buffer *ib, *ob, *meta;
   53|  12.4k|  hoedown_renderer *renderer = NULL;
   54|  12.4k|  void (*renderer_free)(hoedown_renderer *) = NULL;
   55|  12.4k|  hoedown_document *document;
   56|       |
   57|       |  /* Parse options */
   58|  12.4k|  opt.basename = "fuzz";
   59|  12.4k|  opt.done = 0;
   60|  12.4k|  opt.show_time = 0;
   61|  12.4k|  opt.iunit = DEF_IUNIT;
  ------------------
  |  |   18|  12.4k|#define DEF_IUNIT 1024
  ------------------
   62|  12.4k|  opt.ounit = DEF_OUNIT;
  ------------------
  |  |   19|  12.4k|#define DEF_OUNIT 64
  ------------------
   63|  12.4k|  opt.filename = NULL;
   64|  12.4k|  opt.renderer = RENDERER_HTML;
   65|  12.4k|  opt.toc_level = 0;
   66|  12.4k|  opt.attr_activation = 0;
   67|       |  // opt.html_flags = 0;
   68|  12.4k|  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|  12.4k|  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|  12.4k|  opt.max_nesting = DEF_MAX_NESTING;
  ------------------
  |  |   20|  12.4k|#define DEF_MAX_NESTING 16
  ------------------
   72|  12.4k|  opt.link_attributes = 0;
   73|       |
   74|       |  /* Read everything */
   75|  12.4k|  ib = hoedown_buffer_new(opt.iunit);
   76|  12.4k|  hoedown_buffer_put(ib, data, size);
   77|       |
   78|  12.4k|  renderer = hoedown_html_renderer_new(opt.html_flags, opt.toc_level);
   79|  12.4k|  renderer_free = hoedown_html_renderer_free;
   80|       |
   81|       |  /* Perform Markdown rendering */
   82|  12.4k|  ob = hoedown_buffer_new(opt.ounit);
   83|  12.4k|  meta = hoedown_buffer_new(opt.ounit);
   84|  12.4k|  document = hoedown_document_new(renderer, opt.extensions, opt.max_nesting, opt.attr_activation, NULL, meta);
   85|       |
   86|  12.4k|  hoedown_html_renderer_state *state;
   87|  12.4k|  state = (hoedown_html_renderer_state *)renderer->opaque;
   88|       |
   89|  12.4k|  hoedown_document_render(document, ob, ib->data, ib->size);
   90|       |
   91|       |  /* Cleanup */
   92|  12.4k|  hoedown_buffer_free(ib);
   93|  12.4k|  hoedown_document_free(document);
   94|  12.4k|  renderer_free(renderer);
   95|       |
   96|       |  /* Write the result to stdout */
   97|       |  // (void)fwrite(ob->data, 1, ob->size, stdout);
   98|  12.4k|  hoedown_buffer_free(ob);
   99|       |
  100|  12.4k|  hoedown_buffer_free(meta);
  101|       |
  102|  12.4k|  return 0;
  103|  12.4k|}

