file_ms_alloc:
  541|      2|{
  542|      2|	struct magic_set *ms;
  543|      2|	size_t i, len;
  544|       |
  545|      2|	if ((ms = CAST(struct magic_set *, calloc(CAST(size_t, 1u),
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (545:6): [True: 0, False: 2]
  ------------------
  546|      2|	    sizeof(*ms)))) == NULL)
  547|      0|		return NULL;
  548|       |
  549|      2|	if (magic_setflags(ms, flags) == -1) {
  ------------------
  |  Branch (549:6): [True: 0, False: 2]
  ------------------
  550|      0|		errno = EINVAL;
  551|      0|		goto free;
  552|      0|	}
  553|       |
  554|      2|	ms->o.buf = ms->o.pbuf = NULL;
  555|      2|	ms->o.blen = 0;
  556|      2|	len = (ms->c.len = 10) * sizeof(*ms->c.li);
  557|       |
  558|      2|	if ((ms->c.li = CAST(struct level_info *, malloc(len))) == NULL)
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (558:6): [True: 0, False: 2]
  ------------------
  559|      0|		goto free;
  560|       |
  561|      2|	ms->event_flags = 0;
  562|      2|	ms->error = -1;
  563|      6|	for (i = 0; i < MAGIC_SETS; i++)
  ------------------
  |  |  479|      6|#define MAGIC_SETS	2
  ------------------
  |  Branch (563:14): [True: 4, False: 2]
  ------------------
  564|      4|		ms->mlist[i] = NULL;
  565|      2|	ms->fnamebuf = NULL;
  566|      2|	ms->file = "unknown";
  567|      2|	ms->line = 0;
  568|      2|	ms->magwarn = 0;
  569|      2|	ms->indir_max = FILE_INDIR_MAX;
  ------------------
  |  |  530|      2|#define	FILE_INDIR_MAX			50
  ------------------
  570|      2|	ms->name_max = FILE_NAME_MAX;
  ------------------
  |  |  531|      2|#define	FILE_NAME_MAX			150
  ------------------
  571|      2|	ms->elf_shnum_max = FILE_ELF_SHNUM_MAX;
  ------------------
  |  |  528|      2|#define	FILE_ELF_SHNUM_MAX		32768
  ------------------
  572|      2|	ms->elf_shsize_max = FILE_ELF_SHSIZE_MAX;
  ------------------
  |  |  529|      2|#define	FILE_ELF_SHSIZE_MAX		(128 * 1024 * 1024)
  ------------------
  573|      2|	ms->elf_phnum_max = FILE_ELF_PHNUM_MAX;
  ------------------
  |  |  527|      2|#define	FILE_ELF_PHNUM_MAX		2048
  ------------------
  574|      2|	ms->elf_notes_max = FILE_ELF_NOTES_MAX;
  ------------------
  |  |  526|      2|#define	FILE_ELF_NOTES_MAX		256
  ------------------
  575|      2|	ms->regex_max = FILE_REGEX_MAX;
  ------------------
  |  |  532|      2|#define	FILE_REGEX_MAX			8192
  ------------------
  576|      2|	ms->bytes_max = FILE_BYTES_MAX;
  ------------------
  |  |  524|      2|# define FILE_BYTES_MAX (7 * 1024 * 1024)/* how much of the file to look at */
  ------------------
  577|      2|	ms->encoding_max = FILE_ENCODING_MAX;
  ------------------
  |  |  533|      2|#define	FILE_ENCODING_MAX		(64 * 1024)
  ------------------
  578|      2|	ms->magwarn_max = FILE_MAGWARN_MAX;
  ------------------
  |  |  534|      2|#define	FILE_MAGWARN_MAX		64
  ------------------
  579|      2|#ifdef USE_C_LOCALE
  580|      2|	ms->c_lc_ctype = newlocale(LC_CTYPE_MASK, "C", 0);
  581|      2|	assert(ms->c_lc_ctype != NULL);
  ------------------
  |  Branch (581:2): [True: 0, False: 2]
  |  Branch (581:2): [True: 2, False: 0]
  ------------------
  582|      2|#endif
  583|      2|	return ms;
  584|      0|free:
  585|      0|	free(ms);
  586|       |	return NULL;
  587|      2|}
file_apprentice:
  728|      2|{
  729|      2|	char *p, *sfn;
  730|      2|	int fileerr, errs = -1;
  731|      2|	size_t i, j;
  732|       |
  733|      2|	(void)file_reset(ms, 0);
  734|       |
  735|      2|	if ((fn = magic_getpath(fn, action)) == NULL)
  ------------------
  |  Branch (735:6): [True: 0, False: 2]
  ------------------
  736|      0|		return -1;
  737|       |
  738|      2|	init_file_tables();
  739|       |
  740|      2|	free(ms->fnamebuf);
  741|      2|	ms->file = NULL;
  742|      2|	if ((ms->fnamebuf = strdup(fn)) == NULL) {
  ------------------
  |  Branch (742:6): [True: 0, False: 2]
  ------------------
  743|      0|out:		file_oomem(ms, strlen(fn));
  744|      0|		return -1;
  745|      0|	}
  746|       |
  747|      6|	for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  479|      6|#define MAGIC_SETS	2
  ------------------
  |  Branch (747:14): [True: 4, False: 2]
  ------------------
  748|      4|		mlist_free(ms->mlist[i]);
  749|      4|		if ((ms->mlist[i] = mlist_alloc()) == NULL) {
  ------------------
  |  Branch (749:7): [True: 0, False: 4]
  ------------------
  750|      0|			file_oomem(ms, sizeof(*ms->mlist[0]));
  751|      0|			for (j = 0; j < i; j++) {
  ------------------
  |  Branch (751:16): [True: 0, False: 0]
  ------------------
  752|      0|				mlist_free(ms->mlist[j]);
  753|      0|				ms->mlist[j] = NULL;
  754|      0|			}
  755|      0|			return -1;
  756|      0|		}
  757|      4|	}
  758|      2|	fn = sfn = strdup(ms->fnamebuf);
  759|      2|	if (fn == NULL)
  ------------------
  |  Branch (759:6): [True: 0, False: 2]
  ------------------
  760|      0|		goto out;
  761|       |
  762|      4|	while (fn) {
  ------------------
  |  Branch (762:9): [True: 2, False: 2]
  ------------------
  763|      2|		p = CCAST(char *, strchr(fn, PATHSEP));
  ------------------
  |  |  462|      2|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  764|      2|		if (p)
  ------------------
  |  Branch (764:7): [True: 0, False: 2]
  ------------------
  765|      0|			*p++ = '\0';
  766|      2|		if (*fn == '\0')
  ------------------
  |  Branch (766:7): [True: 0, False: 2]
  ------------------
  767|      0|			break;
  768|      2|		fileerr = apprentice_1(ms, fn, action);
  769|      2|		errs = MAX(errs, fileerr);
  ------------------
  |  Branch (769:10): [True: 0, False: 2]
  ------------------
  770|      2|		fn = p;
  771|      2|	}
  772|      2|	free(sfn);
  773|       |
  774|      2|	if (errs == -1) {
  ------------------
  |  Branch (774:6): [True: 0, False: 2]
  ------------------
  775|      0|		for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  479|      0|#define MAGIC_SETS	2
  ------------------
  |  Branch (775:15): [True: 0, False: 0]
  ------------------
  776|      0|			mlist_free(ms->mlist[i]);
  777|      0|			ms->mlist[i] = NULL;
  778|      0|		}
  779|      0|		file_error(ms, 0, "could not find any valid magic files!");
  780|      0|		return -1;
  781|      0|	}
  782|       |
  783|       |#if 0
  784|       |	/*
  785|       |	 * Always leave the database loaded
  786|       |	 */
  787|       |	if (action == FILE_LOAD)
  788|       |		return 0;
  789|       |
  790|       |	for (i = 0; i < MAGIC_SETS; i++) {
  791|       |		mlist_free(ms->mlist[i]);
  792|       |		ms->mlist[i] = NULL;
  793|       |	}
  794|       |#endif
  795|       |
  796|      2|	switch (action) {
  797|      2|	case FILE_LOAD:
  ------------------
  |  |  195|      2|#define	FILE_LOAD	0
  ------------------
  |  Branch (797:2): [True: 2, False: 0]
  ------------------
  798|      2|	case FILE_COMPILE:
  ------------------
  |  |  197|      2|#define FILE_COMPILE	2
  ------------------
  |  Branch (798:2): [True: 0, False: 2]
  ------------------
  799|      2|	case FILE_CHECK:
  ------------------
  |  |  196|      2|#define FILE_CHECK	1
  ------------------
  |  Branch (799:2): [True: 0, False: 2]
  ------------------
  800|      2|	case FILE_LIST:
  ------------------
  |  |  198|      2|#define FILE_LIST	3
  ------------------
  |  Branch (800:2): [True: 0, False: 2]
  ------------------
  801|      2|		return 0;
  802|      0|	default:
  ------------------
  |  Branch (802:2): [True: 0, False: 2]
  ------------------
  803|      0|		file_error(ms, 0, "Invalid action %d", action);
  804|      0|		return -1;
  805|      2|	}
  806|      2|}
file_signextend:
 1663|   104M|{
 1664|   104M|	if (!(m->flag & UNSIGNED)) {
  ------------------
  |  |  237|   104M|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (1664:6): [True: 97.7M, False: 6.44M]
  ------------------
 1665|  97.7M|		switch(m->type) {
 1666|       |		/*
 1667|       |		 * Do not remove the casts below.  They are
 1668|       |		 * vital.  When later compared with the data,
 1669|       |		 * the sign extension must have happened.
 1670|       |		 */
 1671|  1.08M|		case FILE_BYTE:
  ------------------
  |  |  254|  1.08M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1671:3): [True: 1.08M, False: 96.6M]
  ------------------
 1672|  1.08M|			v = CAST(signed char,  v);
  ------------------
  |  |  460|  1.08M|#define CAST(T, b)	((T)(b))
  ------------------
 1673|  1.08M|			break;
 1674|  1.86M|		case FILE_SHORT:
  ------------------
  |  |  255|  1.86M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1674:3): [True: 1.86M, False: 95.8M]
  ------------------
 1675|  6.01M|		case FILE_BESHORT:
  ------------------
  |  |  260|  6.01M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1675:3): [True: 4.15M, False: 93.5M]
  ------------------
 1676|  9.73M|		case FILE_LESHORT:
  ------------------
  |  |  263|  9.73M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1676:3): [True: 3.72M, False: 93.9M]
  ------------------
 1677|  9.73M|			v = CAST(short, v);
  ------------------
  |  |  460|  9.73M|#define CAST(T, b)	((T)(b))
  ------------------
 1678|  9.73M|			break;
 1679|      0|		case FILE_DATE:
  ------------------
  |  |  259|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (1679:3): [True: 0, False: 97.7M]
  ------------------
 1680|    424|		case FILE_BEDATE:
  ------------------
  |  |  262|    424|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1680:3): [True: 424, False: 97.7M]
  ------------------
 1681|    858|		case FILE_LEDATE:
  ------------------
  |  |  265|    858|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1681:3): [True: 434, False: 97.7M]
  ------------------
 1682|    957|		case FILE_MEDATE:
  ------------------
  |  |  274|    957|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1682:3): [True: 99, False: 97.7M]
  ------------------
 1683|    957|		case FILE_LDATE:
  ------------------
  |  |  267|    957|#define				FILE_LDATE		14
  ------------------
  |  Branch (1683:3): [True: 0, False: 97.7M]
  ------------------
 1684|  1.19k|		case FILE_BELDATE:
  ------------------
  |  |  268|  1.19k|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1684:3): [True: 242, False: 97.7M]
  ------------------
 1685|  1.23k|		case FILE_LELDATE:
  ------------------
  |  |  269|  1.23k|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1685:3): [True: 34, False: 97.7M]
  ------------------
 1686|  1.23k|		case FILE_MELDATE:
  ------------------
  |  |  275|  1.23k|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1686:3): [True: 0, False: 97.7M]
  ------------------
 1687|  1.60M|		case FILE_LONG:
  ------------------
  |  |  257|  1.60M|#define				FILE_LONG		4
  ------------------
  |  Branch (1687:3): [True: 1.60M, False: 96.1M]
  ------------------
 1688|  14.3M|		case FILE_BELONG:
  ------------------
  |  |  261|  14.3M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1688:3): [True: 12.7M, False: 84.9M]
  ------------------
 1689|  19.2M|		case FILE_LELONG:
  ------------------
  |  |  264|  19.2M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1689:3): [True: 4.92M, False: 92.7M]
  ------------------
 1690|  19.2M|		case FILE_MELONG:
  ------------------
  |  |  276|  19.2M|#define				FILE_MELONG		23
  ------------------
  |  Branch (1690:3): [True: 70, False: 97.7M]
  ------------------
 1691|  19.2M|		case FILE_FLOAT:
  ------------------
  |  |  286|  19.2M|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1691:3): [True: 0, False: 97.7M]
  ------------------
 1692|  19.2M|		case FILE_BEFLOAT:
  ------------------
  |  |  287|  19.2M|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1692:3): [True: 0, False: 97.7M]
  ------------------
 1693|  19.2M|		case FILE_LEFLOAT:
  ------------------
  |  |  288|  19.2M|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1693:3): [True: 0, False: 97.7M]
  ------------------
 1694|  19.2M|		case FILE_MSDOSDATE:
  ------------------
  |  |  308|  19.2M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (1694:3): [True: 0, False: 97.7M]
  ------------------
 1695|  19.2M|		case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|  19.2M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1695:3): [True: 0, False: 97.7M]
  ------------------
 1696|  19.2M|		case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|  19.2M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1696:3): [True: 241, False: 97.7M]
  ------------------
 1697|  19.2M|		case FILE_MSDOSTIME:
  ------------------
  |  |  311|  19.2M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (1697:3): [True: 0, False: 97.7M]
  ------------------
 1698|  19.2M|		case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|  19.2M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1698:3): [True: 0, False: 97.7M]
  ------------------
 1699|  19.2M|		case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|  19.2M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1699:3): [True: 241, False: 97.7M]
  ------------------
 1700|  19.2M|			v = CAST(int32_t, v);
  ------------------
  |  |  460|  19.2M|#define CAST(T, b)	((T)(b))
  ------------------
 1701|  19.2M|			break;
 1702|  71.7k|		case FILE_QUAD:
  ------------------
  |  |  277|  71.7k|#define				FILE_QUAD		24
  ------------------
  |  Branch (1702:3): [True: 71.7k, False: 97.6M]
  ------------------
 1703|   865k|		case FILE_BEQUAD:
  ------------------
  |  |  279|   865k|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1703:3): [True: 793k, False: 96.9M]
  ------------------
 1704|  1.30M|		case FILE_LEQUAD:
  ------------------
  |  |  278|  1.30M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1704:3): [True: 444k, False: 97.2M]
  ------------------
 1705|  1.30M|		case FILE_QDATE:
  ------------------
  |  |  280|  1.30M|#define				FILE_QDATE		27
  ------------------
  |  Branch (1705:3): [True: 0, False: 97.7M]
  ------------------
 1706|  1.30M|		case FILE_QLDATE:
  ------------------
  |  |  283|  1.30M|#define				FILE_QLDATE		30
  ------------------
  |  Branch (1706:3): [True: 0, False: 97.7M]
  ------------------
 1707|  1.31M|		case FILE_QWDATE:
  ------------------
  |  |  295|  1.31M|#define				FILE_QWDATE		42
  ------------------
  |  Branch (1707:3): [True: 313, False: 97.7M]
  ------------------
 1708|  1.31M|		case FILE_BEQDATE:
  ------------------
  |  |  282|  1.31M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1708:3): [True: 264, False: 97.7M]
  ------------------
 1709|  1.31M|		case FILE_BEQLDATE:
  ------------------
  |  |  285|  1.31M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1709:3): [True: 263, False: 97.7M]
  ------------------
 1710|  1.31M|		case FILE_BEQWDATE:
  ------------------
  |  |  297|  1.31M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1710:3): [True: 0, False: 97.7M]
  ------------------
 1711|  1.31M|		case FILE_LEQDATE:
  ------------------
  |  |  281|  1.31M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1711:3): [True: 0, False: 97.7M]
  ------------------
 1712|  1.31M|		case FILE_LEQLDATE:
  ------------------
  |  |  284|  1.31M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1712:3): [True: 10, False: 97.7M]
  ------------------
 1713|  1.31M|		case FILE_LEQWDATE:
  ------------------
  |  |  296|  1.31M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1713:3): [True: 1.76k, False: 97.7M]
  ------------------
 1714|  1.31M|		case FILE_DOUBLE:
  ------------------
  |  |  289|  1.31M|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1714:3): [True: 0, False: 97.7M]
  ------------------
 1715|  1.31M|		case FILE_BEDOUBLE:
  ------------------
  |  |  290|  1.31M|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1715:3): [True: 0, False: 97.7M]
  ------------------
 1716|  1.31M|		case FILE_LEDOUBLE:
  ------------------
  |  |  291|  1.31M|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1716:3): [True: 0, False: 97.7M]
  ------------------
 1717|  1.31M|		case FILE_OFFSET:
  ------------------
  |  |  305|  1.31M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1717:3): [True: 4.37k, False: 97.7M]
  ------------------
 1718|  1.31M|		case FILE_BEVARINT:
  ------------------
  |  |  306|  1.31M|#define				FILE_BEVARINT		53
  ------------------
  |  Branch (1718:3): [True: 0, False: 97.7M]
  ------------------
 1719|  1.31M|		case FILE_LEVARINT:
  ------------------
  |  |  307|  1.31M|#define				FILE_LEVARINT		54
  ------------------
  |  Branch (1719:3): [True: 0, False: 97.7M]
  ------------------
 1720|  1.31M|			v = CAST(int64_t, v);
  ------------------
  |  |  460|  1.31M|#define CAST(T, b)	((T)(b))
  ------------------
 1721|  1.31M|			break;
 1722|  64.7M|		case FILE_STRING:
  ------------------
  |  |  258|  64.7M|#define				FILE_STRING		5
  ------------------
  |  Branch (1722:3): [True: 64.7M, False: 32.9M]
  ------------------
 1723|  64.7M|		case FILE_PSTRING:
  ------------------
  |  |  266|  64.7M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1723:3): [True: 27.0k, False: 97.6M]
  ------------------
 1724|  64.7M|		case FILE_BESTRING16:
  ------------------
  |  |  271|  64.7M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1724:3): [True: 216, False: 97.7M]
  ------------------
 1725|  64.8M|		case FILE_LESTRING16:
  ------------------
  |  |  272|  64.8M|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1725:3): [True: 69.6k, False: 97.6M]
  ------------------
 1726|  65.3M|		case FILE_REGEX:
  ------------------
  |  |  270|  65.3M|#define				FILE_REGEX		17
  ------------------
  |  Branch (1726:3): [True: 508k, False: 97.2M]
  ------------------
 1727|  66.0M|		case FILE_SEARCH:
  ------------------
  |  |  273|  66.0M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1727:3): [True: 733k, False: 96.9M]
  ------------------
 1728|  66.0M|		case FILE_DEFAULT:
  ------------------
  |  |  256|  66.0M|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (1728:3): [True: 11.9k, False: 97.7M]
  ------------------
 1729|  66.0M|		case FILE_INDIRECT:
  ------------------
  |  |  294|  66.0M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (1729:3): [True: 0, False: 97.7M]
  ------------------
 1730|  66.0M|		case FILE_NAME:
  ------------------
  |  |  298|  66.0M|#define				FILE_NAME		45
  ------------------
  |  Branch (1730:3): [True: 0, False: 97.7M]
  ------------------
 1731|  66.0M|		case FILE_USE:
  ------------------
  |  |  299|  66.0M|#define				FILE_USE		46
  ------------------
  |  Branch (1731:3): [True: 0, False: 97.7M]
  ------------------
 1732|  66.0M|		case FILE_CLEAR:
  ------------------
  |  |  300|  66.0M|#define				FILE_CLEAR		47
  ------------------
  |  Branch (1732:3): [True: 3.52k, False: 97.7M]
  ------------------
 1733|  66.0M|		case FILE_DER:
  ------------------
  |  |  301|  66.0M|#define				FILE_DER		48
  ------------------
  |  Branch (1733:3): [True: 0, False: 97.7M]
  ------------------
 1734|  66.2M|		case FILE_GUID:
  ------------------
  |  |  302|  66.2M|#define				FILE_GUID		49
  ------------------
  |  Branch (1734:3): [True: 200k, False: 97.5M]
  ------------------
 1735|  66.2M|		case FILE_LEGUID:
  ------------------
  |  |  303|  66.2M|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1735:3): [True: 0, False: 97.7M]
  ------------------
 1736|  66.2M|		case FILE_BEGUID:
  ------------------
  |  |  304|  66.2M|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1736:3): [True: 66, False: 97.7M]
  ------------------
 1737|  66.2M|		case FILE_OCTAL:
  ------------------
  |  |  314|  66.2M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1737:3): [True: 0, False: 97.7M]
  ------------------
 1738|  66.2M|			break;
 1739|      0|		default:
  ------------------
  |  Branch (1739:3): [True: 0, False: 97.7M]
  ------------------
 1740|      0|			if (ms->flags & MAGIC_CHECK)
  ------------------
  |  |   39|      0|#define	MAGIC_CHECK		0x0000040 /* Print warnings to stderr */
  ------------------
  |  Branch (1740:8): [True: 0, False: 0]
  ------------------
 1741|      0|			    file_magwarn(ms, "cannot happen: m->type=%d\n",
 1742|      0|				    m->type);
 1743|      0|			return FILE_BADSIZE;
  ------------------
  |  |  183|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1744|  97.7M|		}
 1745|  97.7M|	}
 1746|   104M|	return v;
 1747|   104M|}
file_pstring_length_size:
 3642|  31.4k|{
 3643|  31.4k|	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  390|  31.4k|#define str_flags _u._s._flags
  ------------------
              	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  419|  31.4k|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  411|  31.4k|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  31.4k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  414|  31.4k|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  31.4k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  413|  31.4k|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  31.4k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  416|  31.4k|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  31.4k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  415|  31.4k|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  31.4k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3644|  25.7k|	case PSTRING_1_LE:
  ------------------
  |  |  412|  25.7k|#define PSTRING_1_LE				BIT(7)
  |  |  ------------------
  |  |  |  |  403|  25.7k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3644:2): [True: 25.7k, False: 5.66k]
  ------------------
 3645|  25.7k|		return 1;
 3646|    354|	case PSTRING_2_LE:
  ------------------
  |  |  414|    354|#define PSTRING_2_LE				BIT(9)
  |  |  ------------------
  |  |  |  |  403|    354|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3646:2): [True: 354, False: 31.0k]
  ------------------
 3647|  4.88k|	case PSTRING_2_BE:
  ------------------
  |  |  413|  4.88k|#define PSTRING_2_BE				BIT(8)
  |  |  ------------------
  |  |  |  |  403|  4.88k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3647:2): [True: 4.53k, False: 26.9k]
  ------------------
 3648|  4.88k|		return 2;
 3649|    255|	case PSTRING_4_LE:
  ------------------
  |  |  416|    255|#define PSTRING_4_LE				BIT(11)
  |  |  ------------------
  |  |  |  |  403|    255|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3649:2): [True: 255, False: 31.1k]
  ------------------
 3650|    774|	case PSTRING_4_BE:
  ------------------
  |  |  415|    774|#define PSTRING_4_BE				BIT(10)
  |  |  ------------------
  |  |  |  |  403|    774|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3650:2): [True: 519, False: 30.9k]
  ------------------
 3651|    774|		return 4;
 3652|      0|	default:
  ------------------
  |  Branch (3652:2): [True: 0, False: 31.4k]
  ------------------
 3653|      0|		file_error(ms, 0, "corrupt magic file "
 3654|      0|		    "(bad pascal string length %d)",
 3655|      0|		    m->str_flags & PSTRING_LEN);
  ------------------
  |  |  390|      0|#define str_flags _u._s._flags
  ------------------
              		    m->str_flags & PSTRING_LEN);
  ------------------
  |  |  419|      0|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  411|      0|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  414|      0|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  413|      0|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  416|      0|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  415|      0|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3656|      0|		return FILE_BADSIZE;
  ------------------
  |  |  183|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 3657|  31.4k|	}
 3658|  31.4k|}
file_pstring_get_length:
 3663|  27.1k|{
 3664|  27.1k|	size_t len = 0;
 3665|  27.1k|	const unsigned char *s = RCAST(const unsigned char *, ss);
  ------------------
  |  |  461|  27.1k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 3666|  27.1k|	unsigned int s3, s2, s1, s0;
 3667|       |
 3668|  27.1k|	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  390|  27.1k|#define str_flags _u._s._flags
  ------------------
              	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  419|  27.1k|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  411|  27.1k|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  27.1k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  414|  27.1k|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  27.1k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  413|  27.1k|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  27.1k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  416|  27.1k|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  27.1k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  415|  27.1k|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  27.1k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3669|  25.5k|	case PSTRING_1_LE:
  ------------------
  |  |  412|  25.5k|#define PSTRING_1_LE				BIT(7)
  |  |  ------------------
  |  |  |  |  403|  25.5k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3669:2): [True: 25.5k, False: 1.59k]
  ------------------
 3670|  25.5k|		len = *s;
 3671|  25.5k|		break;
 3672|    118|	case PSTRING_2_LE:
  ------------------
  |  |  414|    118|#define PSTRING_2_LE				BIT(9)
  |  |  ------------------
  |  |  |  |  403|    118|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3672:2): [True: 118, False: 26.9k]
  ------------------
 3673|    118|		s0 = s[0];
 3674|    118|		s1 = s[1];
 3675|    118|		len = (s1 << 8) | s0;
 3676|    118|		break;
 3677|  1.21k|	case PSTRING_2_BE:
  ------------------
  |  |  413|  1.21k|#define PSTRING_2_BE				BIT(8)
  |  |  ------------------
  |  |  |  |  403|  1.21k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3677:2): [True: 1.21k, False: 25.9k]
  ------------------
 3678|  1.21k|		s0 = s[0];
 3679|  1.21k|		s1 = s[1];
 3680|  1.21k|		len = (s0 << 8) | s1;
 3681|  1.21k|		break;
 3682|     87|	case PSTRING_4_LE:
  ------------------
  |  |  416|     87|#define PSTRING_4_LE				BIT(11)
  |  |  ------------------
  |  |  |  |  403|     87|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3682:2): [True: 87, False: 27.0k]
  ------------------
 3683|     87|		s0 = s[0];
 3684|     87|		s1 = s[1];
 3685|     87|		s2 = s[2];
 3686|     87|		s3 = s[3];
 3687|     87|		len = (s3 << 24) | (s2 << 16) | (s1 << 8) | s0;
 3688|     87|		break;
 3689|    173|	case PSTRING_4_BE:
  ------------------
  |  |  415|    173|#define PSTRING_4_BE				BIT(10)
  |  |  ------------------
  |  |  |  |  403|    173|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3689:2): [True: 173, False: 26.9k]
  ------------------
 3690|    173|		s0 = s[0];
 3691|    173|		s1 = s[1];
 3692|    173|		s2 = s[2];
 3693|    173|		s3 = s[3];
 3694|    173|		len = (s0 << 24) | (s1 << 16) | (s2 << 8) | s3;
 3695|    173|		break;
 3696|      0|	default:
  ------------------
  |  Branch (3696:2): [True: 0, False: 27.1k]
  ------------------
 3697|      0|		file_error(ms, 0, "corrupt magic file "
 3698|      0|		    "(bad pascal string length %d)",
 3699|      0|		    m->str_flags & PSTRING_LEN);
  ------------------
  |  |  390|      0|#define str_flags _u._s._flags
  ------------------
              		    m->str_flags & PSTRING_LEN);
  ------------------
  |  |  419|      0|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  411|      0|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  414|      0|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  413|      0|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  416|      0|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  415|      0|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|      0|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3700|      0|		return FILE_BADSIZE;
  ------------------
  |  |  183|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 3701|  27.1k|	}
 3702|       |
 3703|  27.1k|	if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF) {
  ------------------
  |  |  390|  27.1k|#define str_flags _u._s._flags
  ------------------
              	if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF) {
  ------------------
  |  |  420|  27.1k|#define PSTRING_LENGTH_INCLUDES_ITSELF		BIT(12)
  |  |  ------------------
  |  |  |  |  403|  27.1k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3703:6): [True: 1.06k, False: 26.0k]
  ------------------
 3704|  1.06k|		size_t l = file_pstring_length_size(ms, m);
 3705|  1.06k|		if (l == FILE_BADSIZE)
  ------------------
  |  |  183|  1.06k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  1.06k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (3705:7): [True: 0, False: 1.06k]
  ------------------
 3706|      0|			return l;
 3707|  1.06k|		len -= l;
 3708|  1.06k|	}
 3709|       |
 3710|  27.1k|	return len;
 3711|  27.1k|}
file_magicfind:
 3715|  65.7k|{
 3716|  65.7k|	uint32_t i, j;
 3717|  65.7k|	struct mlist *mlist, *ml;
 3718|       |
 3719|  65.7k|	mlist = ms->mlist[1];
 3720|       |
 3721|  65.7k|	for (ml = mlist->next; ml != mlist; ml = ml->next) {
  ------------------
  |  Branch (3721:25): [True: 65.7k, False: 0]
  ------------------
 3722|  65.7k|		struct magic *ma = ml->magic;
 3723|   264M|		for (i = 0; i < ml->nmagic; i++) {
  ------------------
  |  Branch (3723:15): [True: 264M, False: 0]
  ------------------
 3724|   264M|			if (ma[i].type != FILE_NAME)
  ------------------
  |  |  298|   264M|#define				FILE_NAME		45
  ------------------
  |  Branch (3724:8): [True: 251M, False: 12.5M]
  ------------------
 3725|   251M|				continue;
 3726|  12.5M|			if (strcmp(ma[i].value.s, name) == 0) {
  ------------------
  |  Branch (3726:8): [True: 65.7k, False: 12.4M]
  ------------------
 3727|  65.7k|				v->magic = &ma[i];
 3728|  65.7k|				v->magic_rxcomp = &(ml->magic_rxcomp[i]);
 3729|  2.58M|				for (j = i + 1; j < ml->nmagic; j++)
  ------------------
  |  Branch (3729:21): [True: 2.58M, False: 66]
  ------------------
 3730|  2.58M|				    if (ma[j].cont_level == 0)
  ------------------
  |  Branch (3730:13): [True: 65.7k, False: 2.51M]
  ------------------
 3731|  65.7k|					    break;
 3732|  65.7k|				v->nmagic = j - i;
 3733|  65.7k|				return 0;
 3734|  65.7k|			}
 3735|  12.5M|		}
 3736|  65.7k|	}
 3737|      0|	return -1;
 3738|  65.7k|}
apprentice.c:mlist_free:
  667|      4|{
  668|      4|	struct mlist *ml, *next;
  669|       |
  670|      4|	if (mlist == NULL)
  ------------------
  |  Branch (670:6): [True: 4, False: 0]
  ------------------
  671|      4|		return;
  672|       |
  673|      0|	for (ml = mlist->next; ml != mlist;) {
  ------------------
  |  Branch (673:25): [True: 0, False: 0]
  ------------------
  674|      0|		next = ml->next;
  675|      0|		mlist_free_one(ml);
  676|      0|		ml = next;
  677|      0|	}
  678|      0|	mlist_free_one(mlist);
  679|      0|}
apprentice.c:init_file_tables:
  415|      2|{
  416|      2|	static int done = 0;
  417|      2|	const struct type_tbl_s *p;
  418|       |
  419|      2|	if (done)
  ------------------
  |  Branch (419:6): [True: 0, False: 2]
  ------------------
  420|      0|		return;
  421|      2|	done++;
  422|       |
  423|    126|	for (p = type_tbl; p->len; p++) {
  ------------------
  |  Branch (423:21): [True: 124, False: 2]
  ------------------
  424|    124|		assert(p->type < FILE_NAMES_SIZE);
  ------------------
  |  Branch (424:3): [True: 0, False: 124]
  |  Branch (424:3): [True: 124, False: 0]
  ------------------
  425|    124|		file_names[p->type] = p->name;
  426|    124|		file_formats[p->type] = p->format;
  427|    124|	}
  428|      2|	assert(p - type_tbl == FILE_NAMES_SIZE);
  ------------------
  |  Branch (428:2): [True: 0, False: 2]
  |  Branch (428:2): [True: 2, False: 0]
  ------------------
  429|      2|}
apprentice.c:mlist_alloc:
  625|      4|{
  626|      4|	struct mlist *mlist;
  627|      4|	if ((mlist = CAST(struct mlist *, calloc(1, sizeof(*mlist)))) == NULL) {
  ------------------
  |  |  460|      4|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (627:6): [True: 0, False: 4]
  ------------------
  628|      0|		return NULL;
  629|      0|	}
  630|      4|	mlist->next = mlist->prev = mlist;
  631|      4|	return mlist;
  632|      4|}
apprentice.c:add_mlist:
  433|      4|{
  434|      4|	struct mlist *ml;
  435|       |
  436|      4|	mlp->map = NULL;
  437|      4|	if ((ml = CAST(struct mlist *, malloc(sizeof(*ml)))) == NULL)
  ------------------
  |  |  460|      4|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (437:6): [True: 0, False: 4]
  ------------------
  438|      0|		return -1;
  439|       |
  440|      4|	ml->map = idx == 0 ? map : NULL;
  ------------------
  |  Branch (440:12): [True: 2, False: 2]
  ------------------
  441|      4|	ml->magic = map->magic[idx];
  442|      4|	ml->nmagic = map->nmagic[idx];
  443|      4|	if (ml->nmagic) {
  ------------------
  |  Branch (443:6): [True: 4, False: 0]
  ------------------
  444|      4|		ml->magic_rxcomp = CAST(file_regex_t **,
  ------------------
  |  |  460|      4|#define CAST(T, b)	((T)(b))
  ------------------
  445|      4|		    calloc(ml->nmagic, sizeof(*ml->magic_rxcomp)));
  446|      4|		if (ml->magic_rxcomp == NULL) {
  ------------------
  |  Branch (446:7): [True: 0, False: 4]
  ------------------
  447|      0|			free(ml);
  448|      0|			return -1;
  449|      0|		}
  450|      4|	} else
  451|      0|		ml->magic_rxcomp = NULL;
  452|      4|	mlp->prev->next = ml;
  453|      4|	ml->prev = mlp->prev;
  454|      4|	ml->next = mlp;
  455|      4|	mlp->prev = ml;
  456|      4|	return 0;
  457|      4|}
apprentice.c:apprentice_1:
  464|      2|{
  465|      2|	struct magic_map *map;
  466|      2|#ifndef COMPILE_ONLY
  467|      2|	size_t i;
  468|      2|#endif
  469|       |
  470|      2|	if (magicsize != FILE_MAGICSIZE) {
  ------------------
  |  |  191|      2|#define FILE_MAGICSIZE	432
  ------------------
  |  Branch (470:6): [True: 0, False: 2]
  ------------------
  471|      0|		file_error(ms, 0, "magic element size %lu != %lu",
  472|      0|		    CAST(unsigned long, sizeof(*map->magic[0])),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  473|      0|		    CAST(unsigned long, FILE_MAGICSIZE));
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  474|      0|		return -1;
  475|      0|	}
  476|       |
  477|      2|	if (action == FILE_COMPILE) {
  ------------------
  |  |  197|      2|#define FILE_COMPILE	2
  ------------------
  |  Branch (477:6): [True: 0, False: 2]
  ------------------
  478|      0|		map = apprentice_load(ms, fn, action);
  479|      0|		if (map == NULL)
  ------------------
  |  Branch (479:7): [True: 0, False: 0]
  ------------------
  480|      0|			return -1;
  481|      0|		return apprentice_compile(ms, map, fn);
  482|      0|	}
  483|       |
  484|      2|#ifndef COMPILE_ONLY
  485|      2|	map = apprentice_map(ms, fn);
  486|      2|	if (map == NULL) {
  ------------------
  |  Branch (486:6): [True: 0, False: 2]
  ------------------
  487|      0|		if (ms->flags & MAGIC_CHECK)
  ------------------
  |  |   39|      0|#define	MAGIC_CHECK		0x0000040 /* Print warnings to stderr */
  ------------------
  |  Branch (487:7): [True: 0, False: 0]
  ------------------
  488|      0|			file_magwarn(ms, "using regular magic file `%s'", fn);
  489|      0|		map = apprentice_load(ms, fn, action);
  490|      0|		if (map == NULL)
  ------------------
  |  Branch (490:7): [True: 0, False: 0]
  ------------------
  491|      0|			return -1;
  492|      0|	}
  493|       |
  494|      6|	for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  479|      6|#define MAGIC_SETS	2
  ------------------
  |  Branch (494:14): [True: 4, False: 2]
  ------------------
  495|      4|		if (add_mlist(ms->mlist[i], map, i) == -1) {
  ------------------
  |  Branch (495:7): [True: 0, False: 4]
  ------------------
  496|       |			/* failed to add to any list, free explicitly */
  497|      0|			if (i == 0)
  ------------------
  |  Branch (497:8): [True: 0, False: 0]
  ------------------
  498|      0|				apprentice_unmap(map);
  499|      0|			else
  500|      0|				mlist_free_all(ms);
  501|      0|			file_oomem(ms, sizeof(*ms->mlist[0]));
  502|      0|			return -1;
  503|      0|		}
  504|      4|	}
  505|       |
  506|      2|	if (action == FILE_LIST) {
  ------------------
  |  |  198|      2|#define FILE_LIST	3
  ------------------
  |  Branch (506:6): [True: 0, False: 2]
  ------------------
  507|      0|		for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  479|      0|#define MAGIC_SETS	2
  ------------------
  |  Branch (507:15): [True: 0, False: 0]
  ------------------
  508|      0|			printf("Set %" SIZE_T_FORMAT "u:\nBinary patterns:\n",
  509|      0|			    i);
  510|      0|			apprentice_list(ms->mlist[i], BINTEST);
  ------------------
  |  |  239|      0|#define BINTEST		0x20	/* test is for a binary type (set only
  ------------------
  511|      0|			printf("Text patterns:\n");
  512|      0|			apprentice_list(ms->mlist[i], TEXTTEST);
  ------------------
  |  |  241|      0|#define TEXTTEST	0x40	/* for passing to file_softmagic */
  ------------------
  513|      0|		}
  514|      0|	}
  515|      2|	return 0;
  516|       |#else
  517|       |	return 0;
  518|       |#endif /* COMPILE_ONLY */
  519|      2|}
apprentice.c:mkdbname:
 3538|      2|{
 3539|      2|	const char *p, *q;
 3540|      2|	char *buf;
 3541|       |
 3542|      2|	if (strip) {
  ------------------
  |  Branch (3542:6): [True: 0, False: 2]
  ------------------
 3543|      0|		if ((p = strrchr(fn, '/')) != NULL)
  ------------------
  |  Branch (3543:7): [True: 0, False: 0]
  ------------------
 3544|      0|			fn = ++p;
 3545|      0|	}
 3546|       |
 3547|     94|	for (q = fn; *q; q++)
  ------------------
  |  Branch (3547:15): [True: 92, False: 2]
  ------------------
 3548|     92|		continue;
 3549|       |	/* Look for .mgc */
 3550|      6|	for (p = ext + sizeof(ext) - 1; p >= ext && q >= fn; p--, q--)
  ------------------
  |  Branch (3550:34): [True: 6, False: 0]
  |  Branch (3550:46): [True: 6, False: 0]
  ------------------
 3551|      6|		if (*p != *q)
  ------------------
  |  Branch (3551:7): [True: 2, False: 4]
  ------------------
 3552|      2|			break;
 3553|       |
 3554|       |	/* Did not find .mgc, restore q */
 3555|      2|	if (p >= ext)
  ------------------
  |  Branch (3555:6): [True: 2, False: 0]
  ------------------
 3556|     94|		for (q = fn; *q; q++)
  ------------------
  |  Branch (3556:16): [True: 92, False: 2]
  ------------------
 3557|     92|			continue;
 3558|       |
 3559|      2|	q++;
 3560|       |	/* Compatibility with old code that looked in .mime */
 3561|      2|	if (ms->flags & MAGIC_MIME) {
  ------------------
  |  |   44|      2|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|      2|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|      2|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (3561:6): [True: 0, False: 2]
  ------------------
 3562|      0|		if (asprintf(&buf, "%.*s.mime%s", CAST(int, q - fn), fn, ext)
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3562:7): [True: 0, False: 0]
  ------------------
 3563|      0|		    < 0)
 3564|      0|			return NULL;
 3565|      0|		if (access(buf, R_OK) != -1) {
  ------------------
  |  Branch (3565:7): [True: 0, False: 0]
  ------------------
 3566|      0|			ms->flags &= MAGIC_MIME_TYPE;
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
 3567|      0|			return buf;
 3568|      0|		}
 3569|      0|		free(buf);
 3570|      0|	}
 3571|      2|	if (asprintf(&buf, "%.*s%s", CAST(int, q - fn), fn, ext) < 0)
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3571:6): [True: 0, False: 2]
  ------------------
 3572|      0|		return NULL;
 3573|       |
 3574|       |	/* Compatibility with old code that looked in .mime */
 3575|      2|	if (strstr(fn, ".mime") != NULL)
  ------------------
  |  Branch (3575:6): [True: 0, False: 2]
  ------------------
 3576|      0|		ms->flags &= MAGIC_MIME_TYPE;
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
 3577|      2|	return buf;
 3578|      2|}
apprentice.c:apprentice_map:
 3335|      2|{
 3336|      2|	int fd;
 3337|      2|	struct stat st;
 3338|      2|	char *dbname = NULL;
 3339|      2|	struct magic_map *map;
 3340|      2|	struct magic_map *rv = NULL;
 3341|       |
 3342|      2|	fd = -1;
 3343|      2|	if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3343:6): [True: 0, False: 2]
  ------------------
 3344|      0|		file_oomem(ms, sizeof(*map));
 3345|      0|		goto error;
 3346|      0|	}
 3347|      2|	map->type = MAP_TYPE_USER;	/* unspecified */
  ------------------
  |  |   83|      2|#define MAP_TYPE_USER	0
  ------------------
 3348|       |
 3349|      2|	dbname = mkdbname(ms, fn, 0);
 3350|      2|	if (dbname == NULL)
  ------------------
  |  Branch (3350:6): [True: 0, False: 2]
  ------------------
 3351|      0|		goto error;
 3352|       |
 3353|      2|	if ((fd = open(dbname, O_RDONLY|O_BINARY)) == -1)
  ------------------
  |  |  740|      2|#define O_BINARY	0
  ------------------
  |  Branch (3353:6): [True: 0, False: 2]
  ------------------
 3354|      0|		goto error;
 3355|       |
 3356|      2|	if (fstat(fd, &st) == -1) {
  ------------------
  |  Branch (3356:6): [True: 0, False: 2]
  ------------------
 3357|      0|		file_error(ms, errno, "cannot stat `%s'", dbname);
 3358|      0|		goto error;
 3359|      0|	}
 3360|      2|	if (st.st_size < 8 || st.st_size > maxoff_t()) {
  ------------------
  |  Branch (3360:6): [True: 0, False: 2]
  |  Branch (3360:24): [True: 0, False: 2]
  ------------------
 3361|      0|		file_error(ms, 0, "file `%s' is too %s", dbname,
 3362|      0|		    st.st_size < 8 ? "small" : "large");
  ------------------
  |  Branch (3362:7): [True: 0, False: 0]
  ------------------
 3363|      0|		goto error;
 3364|      0|	}
 3365|       |
 3366|      2|	map->len = CAST(size_t, st.st_size);
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3367|      2|#ifdef QUICK
 3368|      2|	map->type = MAP_TYPE_MMAP;
  ------------------
  |  |   85|      2|#define MAP_TYPE_MMAP	2
  ------------------
 3369|      2|	if ((map->p = mmap(0, CAST(size_t, st.st_size), PROT_READ|PROT_WRITE,
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3369:6): [True: 0, False: 2]
  ------------------
 3370|      2|	    MAP_PRIVATE|MAP_FILE, fd, CAST(off_t, 0))) == MAP_FAILED) {
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3371|      0|		file_error(ms, errno, "cannot map `%s'", dbname);
 3372|      0|		goto error;
 3373|      0|	}
 3374|       |#else
 3375|       |	map->type = MAP_TYPE_MALLOC;
 3376|       |	if ((map->p = CAST(void *, malloc(map->len))) == NULL) {
 3377|       |		file_oomem(ms, map->len);
 3378|       |		goto error;
 3379|       |	}
 3380|       |	if (read(fd, map->p, map->len) != (ssize_t)map->len) {
 3381|       |		file_badread(ms);
 3382|       |		goto error;
 3383|       |	}
 3384|       |#endif
 3385|      2|	(void)close(fd);
 3386|      2|	fd = -1;
 3387|       |
 3388|      2|	if (check_buffer(ms, map, dbname) != 0) {
  ------------------
  |  Branch (3388:6): [True: 0, False: 2]
  ------------------
 3389|      0|		goto error;
 3390|      0|	}
 3391|      2|#ifdef QUICK
 3392|      2|	if (mprotect(map->p, CAST(size_t, st.st_size), PROT_READ) == -1) {
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3392:6): [True: 0, False: 2]
  ------------------
 3393|      0|		file_error(ms, errno, "cannot mprotect `%s'", dbname);
 3394|      0|		goto error;
 3395|      0|	}
 3396|      2|#endif
 3397|       |
 3398|      2|	free(dbname);
 3399|      2|	return map;
 3400|       |
 3401|      0|error:
 3402|      0|	if (fd != -1)
  ------------------
  |  Branch (3402:6): [True: 0, False: 0]
  ------------------
 3403|      0|		(void)close(fd);
 3404|      0|	apprentice_unmap(map);
 3405|      0|	free(dbname);
 3406|      0|	return rv;
 3407|      2|}
apprentice.c:maxoff_t:
  316|      2|maxoff_t(void) {
  317|      2|	if (/*CONSTCOND*/sizeof(off_t) == sizeof(int))
  ------------------
  |  Branch (317:19): [Folded, False: 2]
  ------------------
  318|      0|		return CAST(off_t, INT_MAX);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  319|      2|	if (/*CONSTCOND*/sizeof(off_t) == sizeof(long))
  ------------------
  |  Branch (319:19): [True: 2, Folded]
  ------------------
  320|      2|		return CAST(off_t, LONG_MAX);
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
  321|      0|	return 0x7fffffff;
  322|      2|}
apprentice.c:check_buffer:
 3411|      2|{
 3412|      2|	uint32_t *ptr;
 3413|      2|	uint32_t entries, nentries;
 3414|      2|	uint32_t version;
 3415|      2|	int i, needsbyteswap;
 3416|       |
 3417|      2|	entries = CAST(uint32_t, map->len / sizeof(struct magic));
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3418|      2|	if (entries < MAGIC_SETS) {
  ------------------
  |  |  479|      2|#define MAGIC_SETS	2
  ------------------
  |  Branch (3418:6): [True: 0, False: 2]
  ------------------
 3419|      0|		file_error(ms, 0, "Too few magic entries %u in `%s'",
 3420|      0|		    entries, dbname);
 3421|      0|		return -1;
 3422|      0|	}
 3423|      2|	if ((entries * sizeof(struct magic)) != map->len) {
  ------------------
  |  Branch (3423:6): [True: 0, False: 2]
  ------------------
 3424|      0|		file_error(ms, 0, "Size of `%s' %" SIZE_T_FORMAT "u is not "
 3425|      0|		    "a multiple of %" SIZE_T_FORMAT "u",
 3426|      0|		    dbname, map->len, sizeof(struct magic));
 3427|      0|		return -1;
 3428|      0|	}
 3429|       |
 3430|      2|	ptr = CAST(uint32_t *, map->p);
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3431|      2|	if (*ptr != MAGICNO) {
  ------------------
  |  |  189|      2|#define MAGICNO		0xF11E041C
  ------------------
  |  Branch (3431:6): [True: 0, False: 2]
  ------------------
 3432|      0|		if (file_swap4(*ptr) != MAGICNO) {
  ------------------
  |  |   38|      0|#define file_swap4(x)	bswap_32(x)
  ------------------
              		if (file_swap4(*ptr) != MAGICNO) {
  ------------------
  |  |  189|      0|#define MAGICNO		0xF11E041C
  ------------------
  |  Branch (3432:7): [True: 0, False: 0]
  ------------------
 3433|      0|			file_error(ms, 0, "bad magic in `%s'", dbname);
 3434|      0|			return -1;
 3435|      0|		}
 3436|      0|		needsbyteswap = 1;
 3437|      0|	} else
 3438|      2|		needsbyteswap = 0;
 3439|      2|	if (needsbyteswap)
  ------------------
  |  Branch (3439:6): [True: 0, False: 2]
  ------------------
 3440|      0|		version = file_swap4(ptr[1]);
  ------------------
  |  |   38|      0|#define file_swap4(x)	bswap_32(x)
  ------------------
 3441|      2|	else
 3442|      2|		version = ptr[1];
 3443|      2|	if (version != VERSIONNO) {
  ------------------
  |  |  190|      2|#define VERSIONNO	21
  ------------------
  |  Branch (3443:6): [True: 0, False: 2]
  ------------------
 3444|      0|		file_error(ms, 0, "File %s supports only version %d magic "
 3445|      0|		    "files. `%s' is version %d", VERSION,
  ------------------
  |  |  506|      0|#define VERSION "5.48"
  ------------------
 3446|      0|		    VERSIONNO, dbname, version);
  ------------------
  |  |  190|      0|#define VERSIONNO	21
  ------------------
 3447|      0|		return -1;
 3448|      0|	}
 3449|      2|	map->magic[0] = CAST(struct magic *, map->p) + 1;
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3450|      2|	nentries = 0;
 3451|      6|	for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  479|      6|#define MAGIC_SETS	2
  ------------------
  |  Branch (3451:14): [True: 4, False: 2]
  ------------------
 3452|      4|		if (needsbyteswap)
  ------------------
  |  Branch (3452:7): [True: 0, False: 4]
  ------------------
 3453|      0|			map->nmagic[i] = file_swap4(ptr[i + 2]);
  ------------------
  |  |   38|      0|#define file_swap4(x)	bswap_32(x)
  ------------------
 3454|      4|		else
 3455|      4|			map->nmagic[i] = ptr[i + 2];
 3456|      4|		if (map->nmagic[i] > entries) {
  ------------------
  |  Branch (3456:7): [True: 0, False: 4]
  ------------------
 3457|      0|			file_error(ms, 0, "nmagic[%u] too large in `%s'", i,
 3458|      0|			    dbname);
 3459|      0|			return -1;
 3460|      0|		}
 3461|      4|		if (i != MAGIC_SETS - 1)
  ------------------
  |  |  479|      4|#define MAGIC_SETS	2
  ------------------
  |  Branch (3461:7): [True: 2, False: 2]
  ------------------
 3462|      2|			map->magic[i + 1] = map->magic[i] + map->nmagic[i];
 3463|      4|		nentries += map->nmagic[i];
 3464|      4|	}
 3465|      2|	if (entries != nentries + 1) {
  ------------------
  |  Branch (3465:6): [True: 0, False: 2]
  ------------------
 3466|      0|		file_error(ms, 0, "Inconsistent entries in `%s' %u != %u",
 3467|      0|		    dbname, entries, nentries + 1);
 3468|      0|		return -1;
 3469|      0|	}
 3470|      2|	if (needsbyteswap)
  ------------------
  |  Branch (3470:6): [True: 0, False: 2]
  ------------------
 3471|      0|		for (i = 0; i < MAGIC_SETS; i++)
  ------------------
  |  |  479|      0|#define MAGIC_SETS	2
  ------------------
  |  Branch (3471:15): [True: 0, False: 0]
  ------------------
 3472|      0|			byteswap(map->magic[i], map->nmagic[i]);
 3473|      2|	return 0;
 3474|      2|}

file_ascmagic:
   72|  16.3k|{
   73|  16.3k|	file_unichar_t *ubuf = NULL;
   74|  16.3k|	size_t ulen = 0;
   75|  16.3k|	int rv = 1;
   76|  16.3k|	struct buffer bb;
   77|       |
   78|  16.3k|	const char *code = NULL;
   79|  16.3k|	const char *code_mime = NULL;
   80|  16.3k|	const char *type = NULL;
   81|       |
   82|  16.3k|	bb = *b;
   83|  16.3k|	bb.flen = trim_nuls(CAST(const unsigned char *, b->fbuf), b->flen);
  ------------------
  |  |  460|  16.3k|#define CAST(T, b)	((T)(b))
  ------------------
   84|       |	/*
   85|       |	 * Avoid trimming at an odd byte if the original buffer was evenly
   86|       |	 * sized; this avoids losing the last character on UTF-16 LE text
   87|       |	 */
   88|  16.3k|	if ((bb.flen & 1) && !(b->flen & 1))
  ------------------
  |  Branch (88:6): [True: 7.41k, False: 8.96k]
  |  Branch (88:23): [True: 2.17k, False: 5.23k]
  ------------------
   89|  2.17k|		bb.flen++;
   90|       |
   91|       |	/* If file doesn't look like any sort of text, give up. */
   92|  16.3k|	if (file_encoding(ms, &bb, &ubuf, &ulen, &code, &code_mime,
  ------------------
  |  Branch (92:6): [True: 13.7k, False: 2.62k]
  ------------------
   93|  16.3k|	    &type) == 0)
   94|  13.7k|		rv = 0;
   95|  2.62k|        else
   96|  2.62k|		rv = file_ascmagic_with_encoding(ms, &bb,
   97|  2.62k|		    ubuf, ulen, code, type, text);
   98|       |
   99|  16.3k|	free(ubuf);
  100|       |
  101|  16.3k|	return rv;
  102|  16.3k|}
file_ascmagic_with_encoding:
  108|  2.62k|{
  109|  2.62k|	struct buffer bb;
  110|  2.62k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  2.62k|#define CAST(T, b)	((T)(b))
  ------------------
  111|  2.62k|	size_t nbytes = b->flen;
  112|  2.62k|	unsigned char *utf8_buf = NULL, *utf8_end;
  113|  2.62k|	size_t mlen, i, len;
  114|  2.62k|	int rv = -1;
  115|  2.62k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  2.62k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  2.62k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  2.62k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  116|  2.62k|	int need_separator = 0;
  117|       |
  118|  2.62k|	const char *subtype = NULL;
  119|       |
  120|  2.62k|	int has_escapes = 0;
  121|  2.62k|	int has_backspace = 0;
  122|  2.62k|	int seen_cr = 0;
  123|       |
  124|  2.62k|	size_t n_crlf = 0;
  125|  2.62k|	size_t n_lf = 0;
  126|  2.62k|	size_t n_cr = 0;
  127|  2.62k|	size_t n_nel = 0;
  128|  2.62k|	int executable = 0;
  129|       |
  130|  2.62k|	size_t last_line_end = CAST(size_t, -1);
  ------------------
  |  |  460|  2.62k|#define CAST(T, b)	((T)(b))
  ------------------
  131|  2.62k|	size_t has_long_lines = 0;
  132|       |
  133|  2.62k|	nbytes = trim_nuls(buf, nbytes);
  134|       |
  135|       |	/* If we have fewer than 2 bytes, give up. */
  136|  2.62k|	if (nbytes <= 1) {
  ------------------
  |  Branch (136:6): [True: 28, False: 2.59k]
  ------------------
  137|     28|		rv = 0;
  138|     28|		goto done;
  139|     28|	}
  140|       |
  141|  2.59k|	if (ulen > 0 && (ms->flags & MAGIC_NO_CHECK_SOFT) == 0) {
  ------------------
  |  |   56|  2.51k|#define	MAGIC_NO_CHECK_SOFT	0x0004000 /* Don't check magic entries */
  ------------------
  |  Branch (141:6): [True: 2.51k, False: 88]
  |  Branch (141:18): [True: 2.51k, False: 0]
  ------------------
  142|       |		/* Convert ubuf to UTF-8 and try text soft magic */
  143|       |		/* malloc size is a conservative overestimate; could be
  144|       |		   improved, or at least realloced after conversion. */
  145|  2.51k|		if (ulen > SIZE_MAX / 6) {
  ------------------
  |  Branch (145:7): [True: 0, False: 2.51k]
  ------------------
  146|      0|			goto done;
  147|      0|		}
  148|  2.51k|		mlen = ulen * 6;
  149|  2.51k|		if ((utf8_buf = CAST(unsigned char *, malloc(mlen))) == NULL) {
  ------------------
  |  |  460|  2.51k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (149:7): [True: 0, False: 2.51k]
  ------------------
  150|      0|			file_oomem(ms, mlen);
  151|      0|			goto done;
  152|      0|		}
  153|  2.51k|		if ((utf8_end = encode_utf8(utf8_buf, mlen, ubuf, ulen))
  ------------------
  |  Branch (153:7): [True: 50, False: 2.46k]
  ------------------
  154|  2.51k|		    == NULL) {
  155|     50|			rv = 0;
  156|     50|			goto done;
  157|     50|		}
  158|  2.46k|		buffer_init(&bb, b->fd, &b->st, utf8_buf,
  159|  2.46k|		    CAST(size_t, utf8_end - utf8_buf));
  ------------------
  |  |  460|  2.46k|#define CAST(T, b)	((T)(b))
  ------------------
  160|       |
  161|  2.46k|		if ((rv = file_softmagic(ms, &bb, NULL, NULL,
  ------------------
  |  Branch (161:7): [True: 2.33k, False: 129]
  ------------------
  162|  2.46k|		    TEXTTEST, text)) == 0)
  ------------------
  |  |  241|  2.46k|#define TEXTTEST	0x40	/* for passing to file_softmagic */
  ------------------
  163|  2.33k|			rv = -1;
  164|    129|		else
  165|    129|			need_separator = 1;
  166|  2.46k|		buffer_fini(&bb);
  167|  2.46k|		if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   45|  2.46k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              		if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   46|  2.46k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (167:7): [True: 0, False: 2.46k]
  ------------------
  168|      0|			rv = rv == -1 ? 0 : 1;
  ------------------
  |  Branch (168:9): [True: 0, False: 0]
  ------------------
  169|      0|			goto done;
  170|      0|		}
  171|  2.46k|	}
  172|       |
  173|  2.54k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   45|  2.54k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   46|  2.54k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (173:6): [True: 0, False: 2.54k]
  ------------------
  174|      0|		rv = 0;
  175|      0|		goto done;
  176|      0|	}
  177|       |
  178|       |	/* Now try to discover other details about the file. */
  179|  17.1M|	for (i = 0; i < ulen; i++) {
  ------------------
  |  Branch (179:14): [True: 17.1M, False: 2.54k]
  ------------------
  180|  17.1M|		if (ubuf[i] == '\n') {
  ------------------
  |  Branch (180:7): [True: 1.20M, False: 15.9M]
  ------------------
  181|  1.20M|			if (seen_cr)
  ------------------
  |  Branch (181:8): [True: 29.3k, False: 1.17M]
  ------------------
  182|  29.3k|				n_crlf++;
  183|  1.17M|			else
  184|  1.17M|				n_lf++;
  185|  1.20M|			last_line_end = i;
  186|  15.9M|		} else if (seen_cr)
  ------------------
  |  Branch (186:14): [True: 1.42M, False: 14.5M]
  ------------------
  187|  1.42M|			n_cr++;
  188|       |
  189|  17.1M|		seen_cr = (ubuf[i] == '\r');
  190|  17.1M|		if (seen_cr)
  ------------------
  |  Branch (190:7): [True: 1.45M, False: 15.6M]
  ------------------
  191|  1.45M|			last_line_end = i;
  192|       |
  193|  17.1M|		if (ubuf[i] == 0x85) { /* X3.64/ECMA-43 "next line" character */
  ------------------
  |  Branch (193:7): [True: 483k, False: 16.6M]
  ------------------
  194|   483k|			n_nel++;
  195|   483k|			last_line_end = i;
  196|   483k|		}
  197|       |
  198|       |		/* If this line is _longer_ than MAXLINELEN, remember it. */
  199|  17.1M|		if (i > last_line_end + MAXLINELEN) {
  ------------------
  |  |   49|  17.1M|#define MAXLINELEN 300	/* longest sane line length */
  ------------------
  |  Branch (199:7): [True: 13.6M, False: 3.49M]
  ------------------
  200|  13.6M|			size_t ll = i - last_line_end;
  201|  13.6M|			if (ll > has_long_lines)
  ------------------
  |  Branch (201:8): [True: 13.5M, False: 79.9k]
  ------------------
  202|  13.5M|				has_long_lines = ll;
  203|  13.6M|		}
  204|       |
  205|  17.1M|		if (ubuf[i] == '\033')
  ------------------
  |  Branch (205:7): [True: 65.5k, False: 17.0M]
  ------------------
  206|  65.5k|			has_escapes = 1;
  207|  17.1M|		if (ubuf[i] == '\b')
  ------------------
  |  Branch (207:7): [True: 230k, False: 16.9M]
  ------------------
  208|   230k|			has_backspace = 1;
  209|  17.1M|	}
  210|       |
  211|  2.54k|	if (seen_cr && n_cr == 0 && n_crlf == 0)
  ------------------
  |  Branch (211:6): [True: 64, False: 2.48k]
  |  Branch (211:17): [True: 19, False: 45]
  |  Branch (211:30): [True: 15, False: 4]
  ------------------
  212|     15|		n_cr++;
  213|       |
  214|  2.54k|	if (strcmp(type, "binary") == 0) {
  ------------------
  |  Branch (214:6): [True: 0, False: 2.54k]
  ------------------
  215|      0|		rv = 0;
  216|      0|		goto done;
  217|      0|	}
  218|  2.54k|	len = file_printedlen(ms);
  219|  2.54k|	if (mime) {
  ------------------
  |  Branch (219:6): [True: 0, False: 2.54k]
  ------------------
  220|      0|		if ((mime & MAGIC_MIME_TYPE) != 0) {
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (220:7): [True: 0, False: 0]
  ------------------
  221|      0|			if (len) {
  ------------------
  |  Branch (221:8): [True: 0, False: 0]
  ------------------
  222|       |				/*
  223|       |				 * Softmagic printed something, we
  224|       |				 * are either done, or we need a separator
  225|       |				 */
  226|      0|				if ((ms->flags & MAGIC_CONTINUE) == 0) {
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (226:9): [True: 0, False: 0]
  ------------------
  227|      0|					rv = 1;
  228|      0|					goto done;
  229|      0|				}
  230|      0|				if (need_separator && file_separator(ms) == -1)
  ------------------
  |  Branch (230:9): [True: 0, False: 0]
  |  Branch (230:27): [True: 0, False: 0]
  ------------------
  231|      0|					goto done;
  232|      0|			}
  233|      0|			if (file_printf(ms, "text/plain") == -1)
  ------------------
  |  Branch (233:8): [True: 0, False: 0]
  ------------------
  234|      0|				goto done;
  235|      0|		}
  236|  2.54k|	} else {
  237|  2.54k|		if (len) {
  ------------------
  |  Branch (237:7): [True: 884, False: 1.66k]
  ------------------
  238|    884|			switch (file_replace(ms, " text$", ", ")) {
  239|    840|			case 0:
  ------------------
  |  Branch (239:4): [True: 840, False: 44]
  ------------------
  240|    840|				switch (file_replace(ms, " text executable$",
  241|    840|				    ", ")) {
  242|    762|				case 0:
  ------------------
  |  Branch (242:5): [True: 762, False: 78]
  ------------------
  243|    762|					if (file_printf(ms, ", ") == -1)
  ------------------
  |  Branch (243:10): [True: 0, False: 762]
  ------------------
  244|      0|						goto done;
  245|    762|					break;
  246|    762|				case -1:
  ------------------
  |  Branch (246:5): [True: 0, False: 840]
  ------------------
  247|      0|					goto done;
  248|     78|				default:
  ------------------
  |  Branch (248:5): [True: 78, False: 762]
  ------------------
  249|     78|					executable = 1;
  250|     78|					break;
  251|    840|				}
  252|    840|				break;
  253|    840|			case -1:
  ------------------
  |  Branch (253:4): [True: 0, False: 884]
  ------------------
  254|      0|				goto done;
  255|     44|			default:
  ------------------
  |  Branch (255:4): [True: 44, False: 840]
  ------------------
  256|     44|				break;
  257|    884|			}
  258|    884|		}
  259|       |
  260|  2.54k|		if (file_printf(ms, "%s", code) == -1)
  ------------------
  |  Branch (260:7): [True: 0, False: 2.54k]
  ------------------
  261|      0|			goto done;
  262|       |
  263|  2.54k|		if (subtype) {
  ------------------
  |  Branch (263:7): [True: 0, False: 2.54k]
  ------------------
  264|      0|			if (file_printf(ms, " %s", subtype) == -1)
  ------------------
  |  Branch (264:8): [True: 0, False: 0]
  ------------------
  265|      0|				goto done;
  266|      0|		}
  267|       |
  268|  2.54k|		if (file_printf(ms, " %s", type) == -1)
  ------------------
  |  Branch (268:7): [True: 0, False: 2.54k]
  ------------------
  269|      0|			goto done;
  270|       |
  271|  2.54k|		if (executable)
  ------------------
  |  Branch (271:7): [True: 78, False: 2.47k]
  ------------------
  272|     78|			if (file_printf(ms, " executable") == -1)
  ------------------
  |  Branch (272:8): [True: 0, False: 78]
  ------------------
  273|      0|				goto done;
  274|       |
  275|  2.54k|		if (has_long_lines)
  ------------------
  |  Branch (275:7): [True: 350, False: 2.19k]
  ------------------
  276|    350|			if (file_printf(ms, ", with very long lines (%"
  ------------------
  |  Branch (276:8): [True: 0, False: 350]
  ------------------
  277|    350|			    SIZE_T_FORMAT "u)", has_long_lines) == -1)
  278|      0|				goto done;
  279|       |
  280|       |		/*
  281|       |		 * Only report line terminators if we find one other than LF,
  282|       |		 * or if we find none at all.
  283|       |		 */
  284|  2.54k|		if ((n_crlf == 0 && n_cr == 0 && n_nel == 0 && n_lf == 0) ||
  ------------------
  |  Branch (284:8): [True: 2.50k, False: 49]
  |  Branch (284:23): [True: 2.41k, False: 86]
  |  Branch (284:36): [True: 2.36k, False: 47]
  |  Branch (284:50): [True: 2.22k, False: 143]
  ------------------
  285|  2.40k|		    (n_crlf != 0 || n_cr != 0 || n_nel != 0)) {
  ------------------
  |  Branch (285:8): [True: 49, False: 276]
  |  Branch (285:23): [True: 86, False: 190]
  |  Branch (285:36): [True: 47, False: 143]
  ------------------
  286|  2.40k|			if (file_printf(ms, ", with") == -1)
  ------------------
  |  Branch (286:8): [True: 0, False: 2.40k]
  ------------------
  287|      0|				goto done;
  288|       |
  289|  2.40k|			if (n_crlf == 0 && n_cr == 0 &&
  ------------------
  |  Branch (289:8): [True: 2.35k, False: 49]
  |  Branch (289:23): [True: 2.27k, False: 86]
  ------------------
  290|  2.27k|			    n_nel == 0 && n_lf == 0) {
  ------------------
  |  Branch (290:8): [True: 2.22k, False: 47]
  |  Branch (290:22): [True: 2.22k, False: 0]
  ------------------
  291|  2.22k|				if (file_printf(ms, " no") == -1)
  ------------------
  |  Branch (291:9): [True: 0, False: 2.22k]
  ------------------
  292|      0|					goto done;
  293|  2.22k|			} else {
  294|    182|				if (n_crlf) {
  ------------------
  |  Branch (294:9): [True: 49, False: 133]
  ------------------
  295|     49|					if (file_printf(ms, " CRLF") == -1)
  ------------------
  |  Branch (295:10): [True: 0, False: 49]
  ------------------
  296|      0|						goto done;
  297|     49|					if (n_cr || n_lf || n_nel)
  ------------------
  |  Branch (297:10): [True: 30, False: 19]
  |  Branch (297:18): [True: 4, False: 15]
  |  Branch (297:26): [True: 1, False: 14]
  ------------------
  298|     35|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (298:11): [True: 0, False: 35]
  ------------------
  299|      0|							goto done;
  300|     49|				}
  301|    182|				if (n_cr) {
  ------------------
  |  Branch (301:9): [True: 116, False: 66]
  ------------------
  302|    116|					if (file_printf(ms, " CR") == -1)
  ------------------
  |  Branch (302:10): [True: 0, False: 116]
  ------------------
  303|      0|						goto done;
  304|    116|					if (n_lf || n_nel)
  ------------------
  |  Branch (304:10): [True: 29, False: 87]
  |  Branch (304:18): [True: 7, False: 80]
  ------------------
  305|     36|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (305:11): [True: 0, False: 36]
  ------------------
  306|      0|							goto done;
  307|    116|				}
  308|    182|				if (n_lf) {
  ------------------
  |  Branch (308:9): [True: 39, False: 143]
  ------------------
  309|     39|					if (file_printf(ms, " LF") == -1)
  ------------------
  |  Branch (309:10): [True: 0, False: 39]
  ------------------
  310|      0|						goto done;
  311|     39|					if (n_nel)
  ------------------
  |  Branch (311:10): [True: 6, False: 33]
  ------------------
  312|      6|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (312:11): [True: 0, False: 6]
  ------------------
  313|      0|							goto done;
  314|     39|				}
  315|    182|				if (n_nel)
  ------------------
  |  Branch (315:9): [True: 55, False: 127]
  ------------------
  316|     55|					if (file_printf(ms, " NEL") == -1)
  ------------------
  |  Branch (316:10): [True: 0, False: 55]
  ------------------
  317|      0|						goto done;
  318|    182|			}
  319|       |
  320|  2.40k|			if (file_printf(ms, " line terminators") == -1)
  ------------------
  |  Branch (320:8): [True: 0, False: 2.40k]
  ------------------
  321|      0|				goto done;
  322|  2.40k|		}
  323|       |
  324|  2.54k|		if (has_escapes)
  ------------------
  |  Branch (324:7): [True: 20, False: 2.52k]
  ------------------
  325|     20|			if (file_printf(ms, ", with escape sequences") == -1)
  ------------------
  |  Branch (325:8): [True: 0, False: 20]
  ------------------
  326|      0|				goto done;
  327|  2.54k|		if (has_backspace)
  ------------------
  |  Branch (327:7): [True: 60, False: 2.48k]
  ------------------
  328|     60|			if (file_printf(ms, ", with overstriking") == -1)
  ------------------
  |  Branch (328:8): [True: 0, False: 60]
  ------------------
  329|      0|				goto done;
  330|  2.54k|	}
  331|  2.54k|	rv = 1;
  332|  2.62k|done:
  333|  2.62k|	free(utf8_buf);
  334|       |
  335|  2.62k|	return rv;
  336|  2.54k|}
ascmagic.c:trim_nuls:
   63|  19.0k|{
   64|   325M|	while (nbytes > 1 && buf[nbytes - 1] == '\0')
  ------------------
  |  Branch (64:9): [True: 325M, False: 296]
  |  Branch (64:23): [True: 325M, False: 18.7k]
  ------------------
   65|   325M|		nbytes--;
   66|       |
   67|  19.0k|	return nbytes;
   68|  19.0k|}
ascmagic.c:encode_utf8:
  344|  2.51k|{
  345|  2.51k|	size_t i;
  346|  2.51k|	unsigned char *end = buf + len;
  347|       |
  348|  17.1M|	for (i = 0; i < ulen; i++) {
  ------------------
  |  Branch (348:14): [True: 17.1M, False: 2.46k]
  ------------------
  349|  17.1M|		if (ubuf[i] <= 0x7f) {
  ------------------
  |  Branch (349:7): [True: 10.6M, False: 6.52M]
  ------------------
  350|  10.6M|			if (end - buf < 1)
  ------------------
  |  Branch (350:8): [True: 0, False: 10.6M]
  ------------------
  351|      0|				return NULL;
  352|  10.6M|			*buf++ = CAST(unsigned char, ubuf[i]);
  ------------------
  |  |  460|  10.6M|#define CAST(T, b)	((T)(b))
  ------------------
  353|  10.6M|			continue;
  354|  10.6M|		} 
  355|  6.52M|		if (ubuf[i] <= 0x7ff) {
  ------------------
  |  Branch (355:7): [True: 6.08M, False: 435k]
  ------------------
  356|  6.08M|			if (end - buf < 2)
  ------------------
  |  Branch (356:8): [True: 0, False: 6.08M]
  ------------------
  357|      0|				return NULL;
  358|  6.08M|			*buf++ = CAST(unsigned char, (ubuf[i] >> 6) + 0xc0);
  ------------------
  |  |  460|  6.08M|#define CAST(T, b)	((T)(b))
  ------------------
  359|  6.08M|			goto out1;
  360|  6.08M|		}
  361|   435k|		if (ubuf[i] <= 0xffff) {
  ------------------
  |  Branch (361:7): [True: 335k, False: 99.5k]
  ------------------
  362|   335k|			if (end - buf < 3)
  ------------------
  |  Branch (362:8): [True: 0, False: 335k]
  ------------------
  363|      0|				return NULL;
  364|   335k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 12) + 0xe0);
  ------------------
  |  |  460|   335k|#define CAST(T, b)	((T)(b))
  ------------------
  365|   335k|			goto out2;
  366|   335k|		}
  367|  99.5k|		if (ubuf[i] <= 0x1fffff) {
  ------------------
  |  Branch (367:7): [True: 493, False: 99.1k]
  ------------------
  368|    493|			if (end - buf < 4)
  ------------------
  |  Branch (368:8): [True: 0, False: 493]
  ------------------
  369|      0|				return NULL;
  370|    493|			*buf++ = CAST(unsigned char, (ubuf[i] >> 18) + 0xf0);
  ------------------
  |  |  460|    493|#define CAST(T, b)	((T)(b))
  ------------------
  371|    493|			goto out3;
  372|    493|		}
  373|  99.1k|		if (ubuf[i] <= 0x3ffffff) {
  ------------------
  |  Branch (373:7): [True: 21.8k, False: 77.2k]
  ------------------
  374|  21.8k|			if (end - buf < 5)
  ------------------
  |  Branch (374:8): [True: 0, False: 21.8k]
  ------------------
  375|      0|				return NULL;
  376|  21.8k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 24) + 0xf8);
  ------------------
  |  |  460|  21.8k|#define CAST(T, b)	((T)(b))
  ------------------
  377|  21.8k|			goto out4;
  378|  21.8k|		} 
  379|  77.2k|		if (ubuf[i] <= 0x7fffffff) {
  ------------------
  |  Branch (379:7): [True: 77.2k, False: 50]
  ------------------
  380|  77.2k|			if (end - buf < 6)
  ------------------
  |  Branch (380:8): [True: 0, False: 77.2k]
  ------------------
  381|      0|				return NULL;
  382|  77.2k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 30) + 0xfc);
  ------------------
  |  |  460|  77.2k|#define CAST(T, b)	((T)(b))
  ------------------
  383|  77.2k|			goto out5;
  384|  77.2k|		} 
  385|       |		/* Invalid character */
  386|     50|		return NULL;
  387|  77.2k|	out5:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 24) & 0x3f) + 0x80);
  ------------------
  |  |  460|  77.2k|#define CAST(T, b)	((T)(b))
  ------------------
  388|  99.0k|	out4:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 18) & 0x3f) + 0x80);
  ------------------
  |  |  460|  99.0k|#define CAST(T, b)	((T)(b))
  ------------------
  389|  99.5k|	out3:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 12) & 0x3f) + 0x80);
  ------------------
  |  |  460|  99.5k|#define CAST(T, b)	((T)(b))
  ------------------
  390|   435k|	out2:	*buf++ = CAST(unsigned char, ((ubuf[i] >>  6) & 0x3f) + 0x80);
  ------------------
  |  |  460|   435k|#define CAST(T, b)	((T)(b))
  ------------------
  391|  6.52M|	out1:	*buf++ = CAST(unsigned char, ((ubuf[i] >>  0) & 0x3f) + 0x80);
  ------------------
  |  |  460|  6.52M|#define CAST(T, b)	((T)(b))
  ------------------
  392|  6.52M|	}
  393|       |
  394|  2.46k|	return buf;
  395|  2.51k|}

buffer_init:
   42|   120M|{
   43|   120M|	b->fd = fd;
   44|   120M|	if (st)
  ------------------
  |  Branch (44:6): [True: 15.2k, False: 120M]
  ------------------
   45|  15.2k|		memcpy(&b->st, st, sizeof(b->st));
   46|   120M|	else if (b->fd == -1 || fstat(b->fd, &b->st) == -1)
  ------------------
  |  Branch (46:11): [True: 120M, False: 0]
  |  Branch (46:26): [True: 0, False: 0]
  ------------------
   47|   120M|		memset(&b->st, 0, sizeof(b->st));
   48|   120M|	b->fbuf = data;
   49|   120M|	b->flen = len;
   50|   120M|	b->eoff = 0;
   51|       |	b->ebuf = NULL;
   52|   120M|	b->elen = 0;
   53|   120M|}
buffer_fini:
   57|  40.6k|{
   58|  40.6k|	free(b->ebuf);
   59|       |	b->ebuf = NULL;
   60|  40.6k|	b->elen = 0;
   61|  40.6k|}
buffer_fill:
   65|   350k|{
   66|   350k|	struct buffer *b = CCAST(struct buffer *, bb);
  ------------------
  |  |  462|   350k|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
   67|       |
   68|   350k|	if (b->elen != 0)
  ------------------
  |  Branch (68:6): [True: 210k, False: 139k]
  ------------------
   69|   210k|		return b->elen == FILE_BADSIZE ? -1 : 0;
  ------------------
  |  |  183|   210k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|   210k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (69:10): [True: 0, False: 210k]
  ------------------
   70|       |
   71|       |	// Nothing to refill, everything is in memory
   72|   139k|	if (b->fd == -1)
  ------------------
  |  Branch (72:6): [True: 113k, False: 25.7k]
  ------------------
   73|   113k|		return 0;
   74|       |
   75|  25.7k|	if (!S_ISREG(b->st.st_mode))
  ------------------
  |  Branch (75:6): [True: 0, False: 25.7k]
  ------------------
   76|      0|		goto out;
   77|       |
   78|  25.7k|	b->elen = CAST(size_t, b->st.st_size) < b->flen ?
  ------------------
  |  |  460|  25.7k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (78:12): [True: 0, False: 25.7k]
  ------------------
   79|  25.7k|	    CAST(size_t, b->st.st_size) : b->flen;
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
   80|  25.7k|	if (b->elen == 0) {
  ------------------
  |  Branch (80:6): [True: 2.54k, False: 23.2k]
  ------------------
   81|  2.54k|		free(b->ebuf);
   82|  2.54k|		b->ebuf = NULL;
   83|  2.54k|		return 0;
   84|  2.54k|	}
   85|  23.2k|	if ((b->ebuf = malloc(b->elen)) == NULL)
  ------------------
  |  Branch (85:6): [True: 0, False: 23.2k]
  ------------------
   86|      0|		goto out;
   87|       |
   88|  23.2k|	b->eoff = b->st.st_size - b->elen;
   89|  23.2k|	if (pread(b->fd, b->ebuf, b->elen, b->eoff) != 
  ------------------
  |  Branch (89:6): [True: 0, False: 23.2k]
  ------------------
   90|  23.2k|	    CAST(ssize_t, b->elen)) {
  ------------------
  |  |  460|  23.2k|#define CAST(T, b)	((T)(b))
  ------------------
   91|      0|		free(b->ebuf);
   92|      0|		b->ebuf = NULL;
   93|      0|		goto out;
   94|      0|	}
   95|       |
   96|  23.2k|	return 0;
   97|      0|out:
   98|      0|	b->elen = FILE_BADSIZE;
  ------------------
  |  |  183|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
   99|      0|	return -1;
  100|  23.2k|}

cdf_swap_header:
  230|  4.01k|{
  231|  4.01k|	size_t i;
  232|       |
  233|  4.01k|	h->h_magic = CDF_TOLE8(h->h_magic);
  ------------------
  |  |   82|  4.01k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  4.01k|	h->h_uuid[0] = CDF_TOLE8(h->h_uuid[0]);
  ------------------
  |  |   82|  4.01k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|  4.01k|	h->h_uuid[1] = CDF_TOLE8(h->h_uuid[1]);
  ------------------
  |  |   82|  4.01k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  4.01k|	h->h_revision = CDF_TOLE2(h->h_revision);
  ------------------
  |  |   86|  4.01k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|  4.01k|	h->h_version = CDF_TOLE2(h->h_version);
  ------------------
  |  |   86|  4.01k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  4.01k|	h->h_byte_order = CDF_TOLE2(h->h_byte_order);
  ------------------
  |  |   86|  4.01k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  4.01k|	h->h_sec_size_p2 = CDF_TOLE2(h->h_sec_size_p2);
  ------------------
  |  |   86|  4.01k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|  4.01k|	h->h_short_sec_size_p2 = CDF_TOLE2(h->h_short_sec_size_p2);
  ------------------
  |  |   86|  4.01k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  4.01k|	h->h_num_sectors_in_sat = CDF_TOLE4(h->h_num_sectors_in_sat);
  ------------------
  |  |   84|  4.01k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|  4.01k|	h->h_secid_first_directory = CDF_TOLE4(h->h_secid_first_directory);
  ------------------
  |  |   84|  4.01k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  243|  4.01k|	h->h_min_size_standard_stream =
  244|  4.01k|	    CDF_TOLE4(h->h_min_size_standard_stream);
  ------------------
  |  |   84|  4.01k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|  4.01k|	h->h_secid_first_sector_in_short_sat =
  246|  4.01k|	    CDF_TOLE4(CAST(uint32_t, h->h_secid_first_sector_in_short_sat));
  ------------------
  |  |   84|  4.01k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|  4.01k|	h->h_num_sectors_in_short_sat =
  248|  4.01k|	    CDF_TOLE4(h->h_num_sectors_in_short_sat);
  ------------------
  |  |   84|  4.01k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|  4.01k|	h->h_secid_first_sector_in_master_sat =
  250|  4.01k|	    CDF_TOLE4(CAST(uint32_t, h->h_secid_first_sector_in_master_sat));
  ------------------
  |  |   84|  4.01k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|  4.01k|	h->h_num_sectors_in_master_sat =
  252|  4.01k|	    CDF_TOLE4(h->h_num_sectors_in_master_sat);
  ------------------
  |  |   84|  4.01k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.03k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.01k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|   441k|	for (i = 0; i < __arraycount(h->h_master_sat); i++) {
  ------------------
  |  |  138|   441k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (253:14): [True: 437k, False: 4.01k]
  ------------------
  254|   437k|		h->h_master_sat[i] =
  255|   437k|		    CDF_TOLE4(CAST(uint32_t, h->h_master_sat[i]));
  ------------------
  |  |   84|   437k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|   875k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 437k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|   437k|	}
  257|  4.01k|}
cdf_unpack_header:
  261|  4.01k|{
  262|  4.01k|	size_t i;
  263|  4.01k|	size_t len = 0;
  264|       |
  265|  4.01k|	CDF_UNPACK(h->h_magic);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  266|  4.01k|	CDF_UNPACKA(h->h_uuid);
  ------------------
  |  |  208|  4.01k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  267|  4.01k|	CDF_UNPACK(h->h_revision);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  268|  4.01k|	CDF_UNPACK(h->h_version);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  269|  4.01k|	CDF_UNPACK(h->h_byte_order);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  270|  4.01k|	CDF_UNPACK(h->h_sec_size_p2);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  271|  4.01k|	CDF_UNPACK(h->h_short_sec_size_p2);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  272|  4.01k|	CDF_UNPACKA(h->h_unused0);
  ------------------
  |  |  208|  4.01k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  273|  4.01k|	CDF_UNPACK(h->h_num_sectors_in_sat);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  274|  4.01k|	CDF_UNPACK(h->h_secid_first_directory);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  275|  4.01k|	CDF_UNPACKA(h->h_unused1);
  ------------------
  |  |  208|  4.01k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  276|  4.01k|	CDF_UNPACK(h->h_min_size_standard_stream);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  277|  4.01k|	CDF_UNPACK(h->h_secid_first_sector_in_short_sat);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  278|  4.01k|	CDF_UNPACK(h->h_num_sectors_in_short_sat);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  279|  4.01k|	CDF_UNPACK(h->h_secid_first_sector_in_master_sat);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  280|  4.01k|	CDF_UNPACK(h->h_num_sectors_in_master_sat);
  ------------------
  |  |  206|  4.01k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  281|   441k|	for (i = 0; i < __arraycount(h->h_master_sat); i++)
  ------------------
  |  |  138|   441k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (281:14): [True: 437k, False: 4.01k]
  ------------------
  282|   437k|		CDF_UNPACK(h->h_master_sat[i]);
  ------------------
  |  |  206|   437k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  283|  4.01k|}
cdf_swap_class:
  304|    841|{
  305|    841|	d->cl_dword = CDF_TOLE4(d->cl_dword);
  ------------------
  |  |   84|    841|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.68k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 841]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  306|    841|	d->cl_word[0] = CDF_TOLE2(d->cl_word[0]);
  ------------------
  |  |   86|    841|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.68k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 841]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|    841|	d->cl_word[1] = CDF_TOLE2(d->cl_word[1]);
  ------------------
  |  |   86|    841|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.68k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 841]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  308|    841|}
cdf_unpack_dir:
  312|  12.5k|{
  313|  12.5k|	size_t len = 0;
  314|       |
  315|  12.5k|	CDF_UNPACKA(d->d_name);
  ------------------
  |  |  208|  12.5k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  316|  12.5k|	CDF_UNPACK(d->d_namelen);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  317|  12.5k|	CDF_UNPACK(d->d_type);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  318|  12.5k|	CDF_UNPACK(d->d_color);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  319|  12.5k|	CDF_UNPACK(d->d_left_child);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  320|  12.5k|	CDF_UNPACK(d->d_right_child);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  321|  12.5k|	CDF_UNPACK(d->d_storage);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  322|  12.5k|	CDF_UNPACKA(d->d_storage_uuid);
  ------------------
  |  |  208|  12.5k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  323|  12.5k|	CDF_UNPACK(d->d_flags);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  324|  12.5k|	CDF_UNPACK(d->d_created);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  325|  12.5k|	CDF_UNPACK(d->d_modified);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  326|  12.5k|	CDF_UNPACK(d->d_stream_first_sector);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  327|  12.5k|	CDF_UNPACK(d->d_size);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  328|  12.5k|	CDF_UNPACK(d->d_unused0);
  ------------------
  |  |  206|  12.5k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  329|  12.5k|}
cdf_zero_stream:
  333|  4.11k|{
  334|  4.11k|	scn->sst_len = 0;
  335|  4.11k|	scn->sst_dirlen = 0;
  336|  4.11k|	scn->sst_ss = 0;
  337|  4.11k|	free(scn->sst_tab);
  338|       |	scn->sst_tab = NULL;
  339|  4.11k|	return -1;
  340|  4.11k|}
cdf_read_header:
  396|  16.4k|{
  397|  16.4k|	char buf[512];
  398|       |
  399|  16.4k|	(void)memcpy(cdf_bo.s, "\01\02\03\04", 4);
  400|  16.4k|	if (cdf_read(info, CAST(off_t, 0), buf, sizeof(buf)) == -1)
  ------------------
  |  |  460|  16.4k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (400:6): [True: 12.3k, False: 4.01k]
  ------------------
  401|  12.3k|		return -1;
  402|  4.01k|	cdf_unpack_header(h, buf);
  403|  4.01k|	cdf_swap_header(h);
  404|  4.01k|	if (h->h_magic != CDF_MAGIC) {
  ------------------
  |  |   62|  4.01k|#define CDF_MAGIC	0xE11AB1A1E011CFD0LL
  ------------------
  |  Branch (404:6): [True: 2.24k, False: 1.76k]
  ------------------
  405|  2.24k|		DPRINTF(("Bad magic %#" INT64_T_FORMAT "x != %#"
  406|  2.24k|		    INT64_T_FORMAT "x\n",
  407|  2.24k|		    (unsigned long long)h->h_magic,
  408|  2.24k|		    (unsigned long long)CDF_MAGIC));
  409|  2.24k|		goto out;
  410|  2.24k|	}
  411|  1.76k|	if (h->h_sec_size_p2 > 20) {
  ------------------
  |  Branch (411:6): [True: 1, False: 1.76k]
  ------------------
  412|      1|		DPRINTF(("Bad sector size %hu\n", h->h_sec_size_p2));
  413|      1|		goto out;
  414|      1|	}
  415|  1.76k|	if (h->h_short_sec_size_p2 > 20) {
  ------------------
  |  Branch (415:6): [True: 4, False: 1.76k]
  ------------------
  416|      4|		DPRINTF(("Bad short sector size %hu\n",
  417|      4|		    h->h_short_sec_size_p2));
  418|      4|		goto out;
  419|      4|	}
  420|  1.76k|	return 0;
  421|  2.25k|out:
  422|  2.25k|	errno = EFTYPE;
  ------------------
  |  |   59|  2.25k|#define EFTYPE EINVAL
  ------------------
  423|  2.25k|	return -1;
  424|  1.76k|}
cdf_read_sector:
  430|   174k|{
  431|   174k|	size_t ss = CDF_SEC_SIZE(h);
  ------------------
  |  |   81|   174k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|   174k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  432|   174k|	size_t pos;
  433|       |
  434|   174k|	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |   63|   174k|#define SIZE_T_MAX CAST(size_t, ~0ULL)
  |  |  ------------------
  |  |  |  |  460|   174k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |  460|   174k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (434:6): [True: 0, False: 174k]
  ------------------
  435|      0|		return -1;
  436|       |
  437|   174k|	pos = CDF_SEC_POS(h, id);
  ------------------
  |  |   82|   174k|#define CDF_SEC_POS(h, secid) (CDF_SEC_SIZE(h) + (secid) * CDF_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   81|   174k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   174k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define CDF_SEC_POS(h, secid) (CDF_SEC_SIZE(h) + (secid) * CDF_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   81|   174k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   174k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  438|   174k|	assert(ss == len);
  ------------------
  |  Branch (438:2): [True: 0, False: 174k]
  |  Branch (438:2): [True: 174k, False: 0]
  ------------------
  439|   174k|	return cdf_read(info, CAST(off_t, pos), RCAST(char *, buf) + offs, len);
  ------------------
  |  |  460|   174k|#define CAST(T, b)	((T)(b))
  ------------------
              	return cdf_read(info, CAST(off_t, pos), RCAST(char *, buf) + offs, len);
  ------------------
  |  |  461|   174k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  440|   174k|}
cdf_read_short_sector:
  445|    534|{
  446|    534|	size_t ss = CDF_SHORT_SEC_SIZE(h);
  ------------------
  |  |   83|    534|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|    534|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  447|    534|	size_t pos;
  448|       |
  449|    534|	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |   63|    534|#define SIZE_T_MAX CAST(size_t, ~0ULL)
  |  |  ------------------
  |  |  |  |  460|    534|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |  460|    534|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (449:6): [True: 0, False: 534]
  ------------------
  450|      0|		return -1;
  451|       |
  452|    534|	pos = CDF_SHORT_SEC_POS(h, id);
  ------------------
  |  |   84|    534|#define CDF_SHORT_SEC_POS(h, secid) ((secid) * CDF_SHORT_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   83|    534|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    534|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|    534|	assert(ss == len);
  ------------------
  |  Branch (453:2): [True: 0, False: 534]
  |  Branch (453:2): [True: 534, False: 0]
  ------------------
  454|    534|	if (pos + len > CDF_SEC_SIZE(h) * sst->sst_len) {
  ------------------
  |  |   81|    534|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|    534|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (454:6): [True: 8, False: 526]
  ------------------
  455|      8|		DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %"
  456|      8|		    SIZE_T_FORMAT "u\n",
  457|      8|		    pos + len, CDF_SEC_SIZE(h) * sst->sst_len));
  458|      8|		goto out;
  459|      8|	}
  460|    526|	(void)memcpy(RCAST(char *, buf) + offs,
  ------------------
  |  |  461|    526|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  461|    526|	    RCAST(const char *, sst->sst_tab) + pos, len);
  ------------------
  |  |  461|    526|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  462|    526|	return len;
  463|      8|out:
  464|      8|	errno = EFTYPE;
  ------------------
  |  |   59|      8|#define EFTYPE EINVAL
  ------------------
  465|      8|	return -1;
  466|    534|}
cdf_read_sat:
  473|  1.76k|{
  474|  1.76k|	size_t i, j, k;
  475|  1.76k|	size_t ss = CDF_SEC_SIZE(h);
  ------------------
  |  |   81|  1.76k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|  1.76k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  476|  1.76k|	cdf_secid_t *msa, mid, sec;
  477|  1.76k|	size_t nsatpersec = (ss / sizeof(mid)) - 1;
  478|       |
  479|   108k|	for (i = 0; i < __arraycount(h->h_master_sat); i++)
  ------------------
  |  |  138|   108k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (479:14): [True: 107k, False: 854]
  ------------------
  480|   107k|		if (h->h_master_sat[i] == CDF_SECID_FREE)
  ------------------
  |  |   55|   107k|#define CDF_SECID_FREE					-1
  ------------------
  |  Branch (480:7): [True: 909, False: 107k]
  ------------------
  481|    909|			break;
  482|       |
  483|  1.76k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  484|  1.76k|	if ((nsatpersec > 0 &&
  ------------------
  |  Branch (484:7): [True: 1.61k, False: 144]
  ------------------
  485|  1.61k|	    h->h_num_sectors_in_master_sat > CDF_SEC_LIMIT / nsatpersec) ||
  ------------------
  |  |  483|  1.61k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  ------------------
  |  Branch (485:6): [True: 19, False: 1.60k]
  ------------------
  486|  1.74k|	    i > CDF_SEC_LIMIT) {
  ------------------
  |  |  483|  1.74k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  ------------------
  |  Branch (486:6): [True: 1, False: 1.74k]
  ------------------
  487|     20|		DPRINTF(("Number of sectors in master SAT too big %u %"
  488|     20|		    SIZE_T_FORMAT "u\n", h->h_num_sectors_in_master_sat, i));
  489|     20|		errno = EFTYPE;
  ------------------
  |  |   59|     20|#define EFTYPE EINVAL
  ------------------
  490|     20|		return -1;
  491|     20|	}
  492|       |
  493|  1.74k|	sat->sat_len = h->h_num_sectors_in_master_sat * nsatpersec + i;
  494|  1.74k|#define CDF_SAT_LIMIT	(16 * 1024 * 1024)
  495|  1.74k|	if (ss != 0 && sat->sat_len > CDF_SAT_LIMIT / ss) {
  ------------------
  |  |  494|  1.74k|#define CDF_SAT_LIMIT	(16 * 1024 * 1024)
  ------------------
  |  Branch (495:6): [True: 1.74k, False: 0]
  |  Branch (495:17): [True: 28, False: 1.71k]
  ------------------
  496|     28|		errno = EFTYPE;
  ------------------
  |  |   59|     28|#define EFTYPE EINVAL
  ------------------
  497|     28|		return -1;
  498|     28|	}
  499|  1.71k|	DPRINTF(("sat_len = %" SIZE_T_FORMAT "u ss = %" SIZE_T_FORMAT "u\n",
  500|  1.71k|	    sat->sat_len, ss));
  501|  1.71k|	if ((sat->sat_tab = CAST(cdf_secid_t *, CDF_CALLOC(sat->sat_len, ss)))
  ------------------
  |  |  460|  1.71k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (501:6): [True: 0, False: 1.71k]
  ------------------
  502|  1.71k|	    == NULL)
  503|      0|		return -1;
  504|       |
  505|  46.7k|	for (i = 0; i < __arraycount(h->h_master_sat); i++) {
  ------------------
  |  |  138|  46.7k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (505:14): [True: 46.3k, False: 388]
  ------------------
  506|  46.3k|		if (h->h_master_sat[i] < 0)
  ------------------
  |  Branch (506:7): [True: 1.29k, False: 45.0k]
  ------------------
  507|  1.29k|			break;
  508|  45.0k|		if (cdf_read_sector(info, sat->sat_tab, ss * i, ss, h,
  ------------------
  |  Branch (508:7): [True: 37, False: 45.0k]
  ------------------
  509|  45.0k|		    h->h_master_sat[i]) != CAST(ssize_t, ss)) {
  ------------------
  |  |  460|  45.0k|#define CAST(T, b)	((T)(b))
  ------------------
  510|     37|			DPRINTF(("Reading sector %d", h->h_master_sat[i]));
  511|     37|			goto out1;
  512|     37|		}
  513|  45.0k|	}
  514|       |
  515|  1.67k|	if ((msa = CAST(cdf_secid_t *, CDF_CALLOC(1, ss))) == NULL)
  ------------------
  |  |  460|  1.67k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (515:6): [True: 0, False: 1.67k]
  ------------------
  516|      0|		goto out1;
  517|       |
  518|  1.67k|	mid = h->h_secid_first_sector_in_master_sat;
  519|  24.9k|	for (j = 0; j < h->h_num_sectors_in_master_sat; j++) {
  ------------------
  |  Branch (519:14): [True: 24.3k, False: 656]
  ------------------
  520|  24.3k|		if (mid < 0)
  ------------------
  |  Branch (520:7): [True: 147, False: 24.1k]
  ------------------
  521|    147|			goto out;
  522|  24.1k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  24.1k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (522:7): [True: 2, False: 24.1k]
  ------------------
  523|      2|			DPRINTF(("Reading master sector loop limit"));
  524|      2|			goto out3;
  525|      2|		}
  526|  24.1k|		if (cdf_read_sector(info, msa, 0, ss, h, mid) !=
  ------------------
  |  Branch (526:7): [True: 73, False: 24.0k]
  ------------------
  527|  24.1k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  460|  24.1k|#define CAST(T, b)	((T)(b))
  ------------------
  528|     73|			DPRINTF(("Reading master sector %d", mid));
  529|     73|			goto out2;
  530|     73|		}
  531|   120k|		for (k = 0; k < nsatpersec; k++, i++) {
  ------------------
  |  Branch (531:15): [True: 96.7k, False: 23.2k]
  ------------------
  532|  96.7k|			sec = CDF_TOLE4(CAST(uint32_t, msa[k]));
  ------------------
  |  |   84|  96.7k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|   193k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 96.7k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  533|  96.7k|			if (sec < 0)
  ------------------
  |  Branch (533:8): [True: 755, False: 95.9k]
  ------------------
  534|    755|				goto out;
  535|  95.9k|			if (i >= sat->sat_len) {
  ------------------
  |  Branch (535:8): [True: 0, False: 95.9k]
  ------------------
  536|      0|			    DPRINTF(("Out of bounds reading MSA %"
  537|      0|				SIZE_T_FORMAT "u >= %" SIZE_T_FORMAT "u",
  538|      0|				i, sat->sat_len));
  539|      0|			    goto out3;
  540|      0|			}
  541|  95.9k|			if (cdf_read_sector(info, sat->sat_tab, ss * i, ss, h,
  ------------------
  |  Branch (541:8): [True: 45, False: 95.9k]
  ------------------
  542|  95.9k|			    sec) != CAST(ssize_t, ss)) {
  ------------------
  |  |  460|  95.9k|#define CAST(T, b)	((T)(b))
  ------------------
  543|     45|				DPRINTF(("Reading sector %d",
  544|     45|				    CDF_TOLE4(msa[k])));
  545|     45|				goto out2;
  546|     45|			}
  547|  95.9k|		}
  548|  23.2k|		mid = CDF_TOLE4(CAST(uint32_t, msa[nsatpersec]));
  ------------------
  |  |   84|  23.2k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  46.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 23.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  549|  23.2k|	}
  550|  1.55k|out:
  551|  1.55k|	sat->sat_len = i;
  552|  1.55k|	free(msa);
  553|  1.55k|	return 0;
  554|      2|out3:
  555|      2|	errno = EFTYPE;
  ------------------
  |  |   59|      2|#define EFTYPE EINVAL
  ------------------
  556|    120|out2:
  557|    120|	free(msa);
  558|    157|out1:
  559|    157|	free(sat->sat_tab);
  560|    157|	return -1;
  561|    120|}
cdf_count_chain:
  565|  4.25k|{
  566|  4.25k|	size_t i, j;
  567|  4.25k|	cdf_secid_t maxsector;
  568|       |
  569|  4.25k|	if (size == 0 || sat->sat_len > SIZE_MAX / size)
  ------------------
  |  Branch (569:6): [True: 0, False: 4.25k]
  |  Branch (569:19): [True: 0, False: 4.25k]
  ------------------
  570|      0|		goto out;
  571|  4.25k|	maxsector = CAST(cdf_secid_t, (sat->sat_len * size) /
  ------------------
  |  |  460|  4.25k|#define CAST(T, b)	((T)(b))
  ------------------
  572|  4.25k|	    sizeof(maxsector));
  573|       |
  574|  4.25k|	DPRINTF(("Chain:"));
  575|  4.25k|	if (sid == CDF_SECID_END_OF_CHAIN) {
  ------------------
  |  |   56|  4.25k|#define CDF_SECID_END_OF_CHAIN				-2
  ------------------
  |  Branch (575:6): [True: 22, False: 4.23k]
  ------------------
  576|       |		/* 0-length chain. */
  577|     22|		DPRINTF((" empty\n"));
  578|     22|		return 0;
  579|     22|	}
  580|       |
  581|   280k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (581:18): [True: 277k, False: 3.85k]
  ------------------
  582|   277k|		DPRINTF((" %d", sid));
  583|   277k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|   277k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (583:7): [True: 25, False: 277k]
  ------------------
  584|     25|			DPRINTF(("Counting chain loop limit"));
  585|     25|			goto out;
  586|     25|		}
  587|   277k|		if (i >= CDF_MEMORY_LIMIT / size) {
  ------------------
  |  |   52|   277k|#define CDF_MEMORY_LIMIT				(16 * 1024 * 1024)
  ------------------
  |  Branch (587:7): [True: 5, False: 276k]
  ------------------
  588|      5|			DPRINTF(("Counting chain size limit"));
  589|      5|			goto out;
  590|      5|		}
  591|   276k|		if (sid >= maxsector) {
  ------------------
  |  Branch (591:7): [True: 344, False: 276k]
  ------------------
  592|    344|			DPRINTF(("Sector %d >= %d\n", sid, maxsector));
  593|    344|			goto out;
  594|    344|		}
  595|   276k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|   276k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|   553k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 276k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  596|   276k|	}
  597|  3.85k|	if (i == 0) {
  ------------------
  |  Branch (597:6): [True: 195, False: 3.66k]
  ------------------
  598|    195|		DPRINTF((" none, sid: %d\n", sid));
  599|    195|		goto out;
  600|       |
  601|    195|	}
  602|  3.66k|	DPRINTF(("\n"));
  603|  3.66k|	return i;
  604|    569|out:
  605|    569|	errno = EFTYPE;
  ------------------
  |  |   59|    569|#define EFTYPE EINVAL
  ------------------
  606|    569|	return CAST(size_t, -1);
  ------------------
  |  |  460|    569|#define CAST(T, b)	((T)(b))
  ------------------
  607|  3.85k|}
cdf_read_long_sector_chain:
  612|  1.17k|{
  613|  1.17k|	size_t ss = CDF_SEC_SIZE(h), i, j;
  ------------------
  |  |   81|  1.17k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|  1.17k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  614|  1.17k|	ssize_t nr;
  615|  1.17k|	scn->sst_tab = NULL;
  616|  1.17k|	scn->sst_len = cdf_count_chain(sat, sid, ss);
  617|  1.17k|	scn->sst_dirlen = MAX(h->h_min_size_standard_stream, len);
  ------------------
  |  Branch (617:20): [True: 471, False: 699]
  ------------------
  618|  1.17k|	scn->sst_ss = ss;
  619|       |
  620|  1.17k|	if (sid == CDF_SECID_END_OF_CHAIN || len == 0)
  ------------------
  |  |   56|  2.34k|#define CDF_SECID_END_OF_CHAIN				-2
  ------------------
  |  Branch (620:6): [True: 3, False: 1.16k]
  |  Branch (620:39): [True: 76, False: 1.09k]
  ------------------
  621|     79|		return cdf_zero_stream(scn);
  622|       |
  623|  1.09k|	if (scn->sst_len == CAST(size_t, -1))
  ------------------
  |  |  460|  1.09k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (623:6): [True: 79, False: 1.01k]
  ------------------
  624|     79|		goto out;
  625|       |
  626|  1.01k|	scn->sst_tab = CDF_CALLOC(scn->sst_len, ss);
  ------------------
  |  |   96|  1.01k|#define CDF_CALLOC(n, u) cdf_calloc(__FILE__, __LINE__, (n), (u))
  ------------------
  627|  1.01k|	if (scn->sst_tab == NULL)
  ------------------
  |  Branch (627:6): [True: 0, False: 1.01k]
  ------------------
  628|      0|		return cdf_zero_stream(scn);
  629|       |
  630|  4.02k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (630:18): [True: 3.03k, False: 990]
  ------------------
  631|  3.03k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  3.03k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (631:7): [True: 0, False: 3.03k]
  ------------------
  632|      0|			DPRINTF(("Read long sector chain loop limit"));
  633|      0|			goto out;
  634|      0|		}
  635|  3.03k|		if (i >= scn->sst_len) {
  ------------------
  |  Branch (635:7): [True: 0, False: 3.03k]
  ------------------
  636|      0|			DPRINTF(("Out of bounds reading long sector chain "
  637|      0|			    "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i,
  638|      0|			    scn->sst_len));
  639|      0|			goto out;
  640|      0|		}
  641|  3.03k|		if ((nr = cdf_read_sector(info, scn->sst_tab, i * ss, ss, h,
  ------------------
  |  Branch (641:7): [True: 22, False: 3.00k]
  ------------------
  642|  3.03k|		    sid)) != CAST(ssize_t, ss)) {
  ------------------
  |  |  460|  3.03k|#define CAST(T, b)	((T)(b))
  ------------------
  643|     22|			if (i == scn->sst_len - 1 && nr > 0) {
  ------------------
  |  Branch (643:8): [True: 11, False: 11]
  |  Branch (643:33): [True: 0, False: 11]
  ------------------
  644|       |				/* Last sector might be truncated */
  645|      0|				return 0;
  646|      0|			}
  647|     22|			DPRINTF(("Reading long sector chain %d", sid));
  648|     22|			goto out;
  649|     22|		}
  650|  3.00k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|  3.00k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  6.01k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 3.00k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  651|  3.00k|	}
  652|    990|	return 0;
  653|    101|out:
  654|    101|	errno = EFTYPE;
  ------------------
  |  |   59|    101|#define EFTYPE EINVAL
  ------------------
  655|    101|	return cdf_zero_stream(scn);
  656|  1.01k|}
cdf_read_short_sector_chain:
  662|    251|{
  663|    251|	size_t ss = CDF_SHORT_SEC_SIZE(h), i, j;
  ------------------
  |  |   83|    251|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|    251|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  664|    251|	scn->sst_tab = NULL;
  665|    251|	scn->sst_len = cdf_count_chain(ssat, sid, CDF_SEC_SIZE(h));
  ------------------
  |  |   81|    251|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|    251|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  666|    251|	scn->sst_dirlen = len;
  667|    251|	scn->sst_ss = ss;
  668|       |
  669|    251|	if (scn->sst_len == CAST(size_t, -1))
  ------------------
  |  |  460|    251|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (669:6): [True: 104, False: 147]
  ------------------
  670|    104|		goto out;
  671|       |
  672|    147|	scn->sst_tab = CDF_CALLOC(scn->sst_len, ss);
  ------------------
  |  |   96|    147|#define CDF_CALLOC(n, u) cdf_calloc(__FILE__, __LINE__, (n), (u))
  ------------------
  673|    147|	if (scn->sst_tab == NULL)
  ------------------
  |  Branch (673:6): [True: 0, False: 147]
  ------------------
  674|      0|		return cdf_zero_stream(scn);
  675|       |
  676|    673|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (676:18): [True: 534, False: 139]
  ------------------
  677|    534|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|    534|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (677:7): [True: 0, False: 534]
  ------------------
  678|      0|			DPRINTF(("Read short sector chain loop limit"));
  679|      0|			goto out;
  680|      0|		}
  681|    534|		if (i >= scn->sst_len) {
  ------------------
  |  Branch (681:7): [True: 0, False: 534]
  ------------------
  682|      0|			DPRINTF(("Out of bounds reading short sector chain "
  683|      0|			    "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n",
  684|      0|			    i, scn->sst_len));
  685|      0|			goto out;
  686|      0|		}
  687|    534|		if (cdf_read_short_sector(sst, scn->sst_tab, i * ss, ss, h,
  ------------------
  |  Branch (687:7): [True: 8, False: 526]
  ------------------
  688|    534|		    sid) != CAST(ssize_t, ss)) {
  ------------------
  |  |  460|    534|#define CAST(T, b)	((T)(b))
  ------------------
  689|      8|			DPRINTF(("Reading short sector chain %d", sid));
  690|      8|			goto out;
  691|      8|		}
  692|    526|		sid = CDF_TOLE4(CAST(uint32_t, ssat->sat_tab[sid]));
  ------------------
  |  |   84|    526|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.05k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 526]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  693|    526|	}
  694|    139|	return 0;
  695|    112|out:
  696|    112|	errno = EFTYPE;
  ------------------
  |  |   59|    112|#define EFTYPE EINVAL
  ------------------
  697|    112|	return cdf_zero_stream(scn);
  698|    147|}
cdf_read_sector_chain:
  704|  1.06k|{
  705|       |
  706|  1.06k|	if (len < h->h_min_size_standard_stream && sst->sst_tab != NULL)
  ------------------
  |  Branch (706:6): [True: 483, False: 583]
  |  Branch (706:45): [True: 251, False: 232]
  ------------------
  707|    251|		return cdf_read_short_sector_chain(h, ssat, sst, sid, len,
  708|    251|		    scn);
  709|    815|	else
  710|    815|		return cdf_read_long_sector_chain(info, h, sat, sid, len, scn);
  711|  1.06k|}
cdf_read_dir:
  716|  1.27k|{
  717|  1.27k|	size_t i, j;
  718|  1.27k|	size_t ss = CDF_SEC_SIZE(h), ns, nd;
  ------------------
  |  |   81|  1.27k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|  1.27k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  719|  1.27k|	char *buf;
  720|  1.27k|	cdf_secid_t sid = h->h_secid_first_directory;
  721|       |
  722|  1.27k|	ns = cdf_count_chain(sat, sid, ss);
  723|  1.27k|	if (ns == CAST(size_t, -1))
  ------------------
  |  |  460|  1.27k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (723:6): [True: 72, False: 1.20k]
  ------------------
  724|     72|		return -1;
  725|       |
  726|  1.20k|	nd = ss / CDF_DIRECTORY_SIZE;
  ------------------
  |  |  118|  1.20k|#define CDF_DIRECTORY_SIZE	128
  ------------------
  727|  1.20k|	if (nd != 0 && ns > CDF_MEMORY_LIMIT / nd / sizeof(dir->dir_tab[0])) {
  ------------------
  |  |   52|  1.16k|#define CDF_MEMORY_LIMIT				(16 * 1024 * 1024)
  ------------------
  |  Branch (727:6): [True: 1.16k, False: 38]
  |  Branch (727:17): [True: 0, False: 1.16k]
  ------------------
  728|      0|		DPRINTF(("Directory size limit"));
  729|      0|		errno = EFTYPE;
  ------------------
  |  |   59|      0|#define EFTYPE EINVAL
  ------------------
  730|      0|		return -1;
  731|      0|	}
  732|       |
  733|  1.20k|	dir->dir_len = ns * nd;
  734|  1.20k|	dir->dir_tab = CAST(cdf_directory_t *,
  ------------------
  |  |  460|  1.20k|#define CAST(T, b)	((T)(b))
  ------------------
  735|  1.20k|	    CDF_CALLOC(dir->dir_len, sizeof(dir->dir_tab[0])));
  736|  1.20k|	if (dir->dir_tab == NULL)
  ------------------
  |  Branch (736:6): [True: 0, False: 1.20k]
  ------------------
  737|      0|		return -1;
  738|       |
  739|  1.20k|	if ((buf = CAST(char *, CDF_MALLOC(ss))) == NULL) {
  ------------------
  |  |  460|  1.20k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (739:6): [True: 0, False: 1.20k]
  ------------------
  740|      0|		free(dir->dir_tab);
  741|      0|		return -1;
  742|      0|	}
  743|       |
  744|  4.71k|	for (j = i = 0; i < ns; i++, j++) {
  ------------------
  |  Branch (744:18): [True: 3.51k, False: 1.19k]
  ------------------
  745|  3.51k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  3.51k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (745:7): [True: 0, False: 3.51k]
  ------------------
  746|      0|			DPRINTF(("Read dir loop limit"));
  747|      0|			goto out;
  748|      0|		}
  749|  3.51k|		if (cdf_read_sector(info, buf, 0, ss, h, sid) !=
  ------------------
  |  Branch (749:7): [True: 8, False: 3.50k]
  ------------------
  750|  3.51k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  460|  3.51k|#define CAST(T, b)	((T)(b))
  ------------------
  751|      8|			DPRINTF(("Reading directory sector %d", sid));
  752|      8|			goto out;
  753|      8|		}
  754|  16.0k|		for (j = 0; j < nd; j++) {
  ------------------
  |  Branch (754:15): [True: 12.5k, False: 3.50k]
  ------------------
  755|  12.5k|			cdf_unpack_dir(&dir->dir_tab[i * nd + j],
  756|  12.5k|			    &buf[j * CDF_DIRECTORY_SIZE]);
  ------------------
  |  |  118|  12.5k|#define CDF_DIRECTORY_SIZE	128
  ------------------
  757|  12.5k|		}
  758|  3.50k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|  3.50k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  7.01k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 3.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  759|  3.50k|	}
  760|  1.19k|	if (NEED_SWAP)
  ------------------
  |  |   79|  1.19k|#define NEED_SWAP	(cdf_bo.u == CAST(uint32_t, 0x01020304))
  |  |  ------------------
  |  |  |  |  460|  1.19k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (79:19): [True: 0, False: 1.19k]
  |  |  ------------------
  ------------------
  761|      0|		for (i = 0; i < dir->dir_len; i++)
  ------------------
  |  Branch (761:15): [True: 0, False: 0]
  ------------------
  762|      0|			cdf_swap_dir(&dir->dir_tab[i]);
  763|  1.19k|	free(buf);
  764|  1.19k|	return 0;
  765|      8|out:
  766|      8|	free(dir->dir_tab);
  767|      8|	free(buf);
  768|      8|	errno = EFTYPE;
  ------------------
  |  |   59|      8|#define EFTYPE EINVAL
  ------------------
  769|      8|	return -1;
  770|  1.20k|}
cdf_read_ssat:
  776|  1.55k|{
  777|  1.55k|	size_t i, j;
  778|  1.55k|	size_t ss = CDF_SEC_SIZE(h);
  ------------------
  |  |   81|  1.55k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|  1.55k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  779|  1.55k|	cdf_secid_t sid = h->h_secid_first_sector_in_short_sat;
  780|       |
  781|  1.55k|	ssat->sat_tab = NULL;
  782|  1.55k|	ssat->sat_len = cdf_count_chain(sat, sid, ss);
  783|  1.55k|	if (ssat->sat_len == CAST(size_t, -1))
  ------------------
  |  |  460|  1.55k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (783:6): [True: 259, False: 1.29k]
  ------------------
  784|    259|		goto out;
  785|       |
  786|  1.29k|	ssat->sat_tab = CAST(cdf_secid_t *, CDF_CALLOC(ssat->sat_len, ss));
  ------------------
  |  |  460|  1.29k|#define CAST(T, b)	((T)(b))
  ------------------
  787|  1.29k|	if (ssat->sat_tab == NULL)
  ------------------
  |  Branch (787:6): [True: 0, False: 1.29k]
  ------------------
  788|      0|		goto out1;
  789|       |
  790|  3.79k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (790:18): [True: 2.52k, False: 1.27k]
  ------------------
  791|  2.52k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  2.52k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (791:7): [True: 0, False: 2.52k]
  ------------------
  792|      0|			DPRINTF(("Read short sat sector loop limit"));
  793|      0|			goto out;
  794|      0|		}
  795|  2.52k|		if (i >= ssat->sat_len) {
  ------------------
  |  Branch (795:7): [True: 0, False: 2.52k]
  ------------------
  796|      0|			DPRINTF(("Out of bounds reading short sector chain "
  797|      0|			    "%" SIZE_T_FORMAT "u > %" SIZE_T_FORMAT "u\n", i,
  798|      0|			    ssat->sat_len));
  799|      0|			goto out;
  800|      0|		}
  801|  2.52k|		if (cdf_read_sector(info, ssat->sat_tab, i * ss, ss, h, sid) !=
  ------------------
  |  Branch (801:7): [True: 23, False: 2.50k]
  ------------------
  802|  2.52k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  460|  2.52k|#define CAST(T, b)	((T)(b))
  ------------------
  803|     23|			DPRINTF(("Reading short sat sector %d", sid));
  804|     23|			goto out1;
  805|     23|		}
  806|  2.50k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|  2.50k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  5.00k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 2.50k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  807|  2.50k|	}
  808|  1.27k|	return 0;
  809|    259|out:
  810|    259|	errno = EFTYPE;
  ------------------
  |  |   59|    259|#define EFTYPE EINVAL
  ------------------
  811|    282|out1:
  812|    282|	free(ssat->sat_tab);
  813|    282|	return -1;
  814|    259|}
cdf_read_short_stream:
  820|  1.19k|{
  821|  1.19k|	size_t i;
  822|  1.19k|	const cdf_directory_t *d;
  823|       |
  824|  1.19k|	*root = NULL;
  825|  9.57k|	for (i = 0; i < dir->dir_len; i++)
  ------------------
  |  Branch (825:14): [True: 8.89k, False: 683]
  ------------------
  826|  8.89k|		if (dir->dir_tab[i].d_type == CDF_DIR_TYPE_ROOT_STORAGE)
  ------------------
  |  |  102|  8.89k|#define CDF_DIR_TYPE_ROOT_STORAGE	5
  ------------------
  |  Branch (826:7): [True: 513, False: 8.38k]
  ------------------
  827|    513|			break;
  828|       |
  829|       |	/* If the it is not there, just fake it; some docs don't have it */
  830|  1.19k|	if (i == dir->dir_len) {
  ------------------
  |  Branch (830:6): [True: 683, False: 513]
  ------------------
  831|    683|		DPRINTF(("Cannot find root storage dir\n"));
  832|    683|		goto out;
  833|    683|	}
  834|    513|	d = &dir->dir_tab[i];
  835|    513|	*root = d;
  836|       |
  837|       |	/* If the it is not there, just fake it; some docs don't have it */
  838|    513|	if (d->d_stream_first_sector < 0) {
  ------------------
  |  Branch (838:6): [True: 158, False: 355]
  ------------------
  839|    158|		DPRINTF(("No first secror in dir\n"));
  840|    158|		goto out;
  841|    158|	}
  842|       |
  843|    355|	return cdf_read_long_sector_chain(info, h, sat,
  844|    355|	    d->d_stream_first_sector, d->d_size, scn);
  845|    841|out:
  846|       |	scn->sst_tab = NULL;
  847|    841|	(void)cdf_zero_stream(scn);
  848|    841|	return 0;
  849|    513|}
cdf_namecmp:
  853|  16.3k|{
  854|  39.7k|	for (; l--; d++, s++)
  ------------------
  |  Branch (854:9): [True: 38.6k, False: 1.07k]
  ------------------
  855|  38.6k|		if (*d != CDF_TOLE2(*s))
  ------------------
  |  |   86|  38.6k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  77.3k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 38.6k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (855:7): [True: 15.2k, False: 23.3k]
  ------------------
  856|  15.2k|			return CAST(unsigned char, *d) - CDF_TOLE2(*s);
  ------------------
  |  |  460|  15.2k|#define CAST(T, b)	((T)(b))
  ------------------
              			return CAST(unsigned char, *d) - CDF_TOLE2(*s);
  ------------------
  |  |   86|  15.2k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  30.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 15.2k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  857|  1.07k|	return 0;
  858|  16.3k|}
cdf_read_doc_summary_info:
  864|    971|{
  865|    971|	return cdf_read_user_stream(info, h, sat, ssat, sst, dir,
  866|    971|	    "\05DocumentSummaryInformation", scn);
  867|    971|}
cdf_read_summary_info:
  873|  1.10k|{
  874|  1.10k|	return cdf_read_user_stream(info, h, sat, ssat, sst, dir,
  875|  1.10k|	    "\05SummaryInformation", scn);
  876|  1.10k|}
cdf_read_user_stream:
  882|  3.17k|{
  883|  3.17k|	const cdf_directory_t *d;
  884|  3.17k|	int i = cdf_find_stream(dir, name, CDF_DIR_TYPE_USER_STREAM);
  ------------------
  |  |   99|  3.17k|#define CDF_DIR_TYPE_USER_STREAM	2
  ------------------
  885|       |
  886|  3.17k|	if (i <= 0) {
  ------------------
  |  Branch (886:6): [True: 2.10k, False: 1.06k]
  ------------------
  887|  2.10k|		memset(scn, 0, sizeof(*scn));
  888|  2.10k|		return -1;
  889|  2.10k|	}
  890|       |
  891|  1.06k|	d = &dir->dir_tab[i - 1];
  892|  1.06k|	return cdf_read_sector_chain(info, h, sat, ssat, sst,
  893|  1.06k|	    d->d_stream_first_sector, d->d_size, scn);
  894|  3.17k|}
cdf_find_stream:
  898|  3.17k|{
  899|  3.17k|	size_t i, name_len = strlen(name) + 1;
  900|       |
  901|  24.0k|	for (i = 1; i <= dir->dir_len; i++)
  ------------------
  |  Branch (901:14): [True: 21.8k, False: 2.10k]
  ------------------
  902|  21.8k|		if (dir->dir_tab[i-1].d_type == type &&
  ------------------
  |  Branch (902:7): [True: 4.41k, False: 17.4k]
  ------------------
  903|  4.41k|		    cdf_namecmp(name, dir->dir_tab[i-1].d_name, name_len)
  ------------------
  |  Branch (903:7): [True: 1.06k, False: 3.34k]
  ------------------
  904|  4.41k|		    == 0)
  905|  1.06k|			break;
  906|  3.17k|	if (i <= dir->dir_len)
  ------------------
  |  Branch (906:6): [True: 1.06k, False: 2.10k]
  ------------------
  907|  1.06k|		return CAST(int, i);
  ------------------
  |  |  460|  1.06k|#define CAST(T, b)	((T)(b))
  ------------------
  908|       |
  909|  2.10k|	DPRINTF(("Cannot find type %d `%s'\n", type, name));
  910|  2.10k|	errno = ESRCH;
  911|  2.10k|	return 0;
  912|  3.17k|}
cdf_read_property_info:
 1011|    841|{
 1012|    841|	const uint8_t *shp;
 1013|    841|	cdf_section_header_t sh;
 1014|    841|	const uint8_t *p, *q, *e;
 1015|    841|	size_t i, o4, nelements, j, slen, left;
 1016|    841|	cdf_property_info_t *inp;
 1017|       |
 1018|    841|	if (offs > UINT32_MAX / 4) {
  ------------------
  |  Branch (1018:6): [True: 14, False: 827]
  ------------------
 1019|     14|		errno = EFTYPE;
  ------------------
  |  |   59|     14|#define EFTYPE EINVAL
  ------------------
 1020|     14|		goto out;
 1021|     14|	}
 1022|    827|	shp = CAST(const uint8_t *, cdf_offset(sst->sst_tab, offs));
  ------------------
  |  |  460|    827|#define CAST(T, b)	((T)(b))
  ------------------
 1023|    827|	if (cdf_check_stream_offset(sst, h, shp, sizeof(sh), __LINE__) == -1)
  ------------------
  |  Branch (1023:6): [True: 80, False: 747]
  ------------------
 1024|     80|		goto out;
 1025|    747|	memcpy(&sh, shp, sizeof(sh));
 1026|    747|	sh.sh_len = CDF_TOLE4(sh.sh_len);
  ------------------
  |  |   84|    747|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.49k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 747]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1027|    747|	if (sh.sh_len > CDF_SHLEN_LIMIT) {
  ------------------
  |  |  914|    747|#define CDF_SHLEN_LIMIT (UINT32_MAX / 64)
  ------------------
  |  Branch (1027:6): [True: 18, False: 729]
  ------------------
 1028|     18|		errno = EFTYPE;
  ------------------
  |  |   59|     18|#define EFTYPE EINVAL
  ------------------
 1029|     18|		goto out;
 1030|     18|	}
 1031|       |
 1032|    729|	if (cdf_check_stream_offset(sst, h, shp, sh.sh_len, __LINE__) == -1)
  ------------------
  |  Branch (1032:6): [True: 59, False: 670]
  ------------------
 1033|     59|		goto out;
 1034|       |
 1035|    670|	sh.sh_properties = CDF_TOLE4(sh.sh_properties);
  ------------------
  |  |   84|    670|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.34k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 670]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1036|    670|	DPRINTF(("section len: %u properties %u\n", sh.sh_len,
 1037|    670|	    sh.sh_properties));
 1038|    670|	if (sh.sh_properties > CDF_PROP_LIMIT)
  ------------------
  |  |  915|    670|#define CDF_PROP_LIMIT (UINT32_MAX / (64 * sizeof(cdf_property_info_t)))
  ------------------
  |  Branch (1038:6): [True: 22, False: 648]
  ------------------
 1039|     22|		goto out;
 1040|    648|	inp = cdf_grow_info(info, maxcount, sh.sh_properties);
 1041|    648|	if (inp == NULL)
  ------------------
  |  Branch (1041:6): [True: 0, False: 648]
  ------------------
 1042|      0|		goto out;
 1043|    648|	inp += *count;
 1044|    648|	*count += sh.sh_properties;
 1045|    648|	p = CAST(const uint8_t *, cdf_offset(sst->sst_tab, offs + sizeof(sh)));
  ------------------
  |  |  460|    648|#define CAST(T, b)	((T)(b))
  ------------------
 1046|    648|	e = CAST(const uint8_t *, cdf_offset(shp, sh.sh_len));
  ------------------
  |  |  460|    648|#define CAST(T, b)	((T)(b))
  ------------------
 1047|    648|	if (p >= e || cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
  ------------------
  |  Branch (1047:6): [True: 26, False: 622]
  |  Branch (1047:16): [True: 0, False: 622]
  ------------------
 1048|     26|		goto out;
 1049|       |
 1050|  8.12k|	for (i = 0; i < sh.sh_properties; i++) {
  ------------------
  |  Branch (1050:14): [True: 7.87k, False: 257]
  ------------------
 1051|  7.87k|		if ((q = cdf_get_property_info_pos(sst, h, p, e, i)) == NULL)
  ------------------
  |  Branch (1051:7): [True: 261, False: 7.61k]
  ------------------
 1052|    261|			goto out;
 1053|  7.61k|		inp[i].pi_id = CDF_GETUINT32(p, i << 1);
  ------------------
  |  |   92|  7.61k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1054|  7.61k|		left = CAST(size_t, e - q);
  ------------------
  |  |  460|  7.61k|#define CAST(T, b)	((T)(b))
  ------------------
 1055|  7.61k|		if (left < sizeof(uint32_t)) {
  ------------------
  |  Branch (1055:7): [True: 16, False: 7.59k]
  ------------------
 1056|     16|			DPRINTF(("short info (no type)_\n"));
 1057|     16|			goto out;
 1058|     16|		}
 1059|  7.59k|		inp[i].pi_type = CDF_GETUINT32(q, 0);
  ------------------
  |  |   92|  7.59k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1060|  7.59k|		DPRINTF(("%" SIZE_T_FORMAT "u) id=%#x type=%#x offs=%#tx,%#x\n",
 1061|  7.59k|		    i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
 1062|  7.59k|		if (inp[i].pi_type & CDF_VECTOR) {
  ------------------
  |  |  238|  7.59k|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (1062:7): [True: 624, False: 6.97k]
  ------------------
 1063|    624|			if (left < sizeof(uint32_t) * 2) {
  ------------------
  |  Branch (1063:8): [True: 3, False: 621]
  ------------------
 1064|      3|				DPRINTF(("missing CDF_VECTOR length\n"));
 1065|      3|				goto out;
 1066|      3|			}
 1067|    621|			nelements = CDF_GETUINT32(q, 1);
  ------------------
  |  |   92|    621|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1068|    621|			if (nelements > CDF_ELEMENT_LIMIT || nelements == 0) {
  ------------------
  |  |   51|  1.24k|#define CDF_ELEMENT_LIMIT				100000
  ------------------
  |  Branch (1068:8): [True: 32, False: 589]
  |  Branch (1068:41): [True: 3, False: 586]
  ------------------
 1069|     35|				DPRINTF(("CDF_VECTOR with nelements == %"
 1070|     35|				    SIZE_T_FORMAT "u\n", nelements));
 1071|     35|				goto out;
 1072|     35|			}
 1073|    586|			slen = 2;
 1074|  6.97k|		} else {
 1075|  6.97k|			nelements = 1;
 1076|  6.97k|			slen = 1;
 1077|  6.97k|		}
 1078|  7.55k|		o4 = slen * sizeof(uint32_t);
 1079|  7.55k|		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  239|  7.55k|#define CDF_ARRAY		0x00002000
  ------------------
              		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  240|  7.55k|#define CDF_BYREF		0x00004000
  ------------------
              		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  241|  7.55k|#define CDF_RESERVED		0x00008000
  ------------------
  |  Branch (1079:7): [True: 484, False: 7.07k]
  ------------------
 1080|    484|			goto unknown;
 1081|  7.07k|		switch (inp[i].pi_type & CDF_TYPEMASK) {
  ------------------
  |  |  244|  7.07k|#define CDF_TYPEMASK		0x00000fff
  ------------------
 1082|    370|		case CDF_NULL:
  ------------------
  |  |  199|    370|#define CDF_NULL		0x00000001
  ------------------
  |  Branch (1082:3): [True: 370, False: 6.70k]
  ------------------
 1083|    958|		case CDF_EMPTY:
  ------------------
  |  |  198|    958|#define CDF_EMPTY		0x00000000
  ------------------
  |  Branch (1083:3): [True: 588, False: 6.48k]
  ------------------
 1084|    958|			break;
 1085|    692|		case CDF_SIGNED16:
  ------------------
  |  |  200|    692|#define CDF_SIGNED16		0x00000002
  ------------------
  |  Branch (1085:3): [True: 692, False: 6.38k]
  ------------------
 1086|    692|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int16_t)))
  ------------------
  |  Branch (1086:8): [True: 325, False: 367]
  ------------------
 1087|    325|				goto unknown;
 1088|    367|			break;
 1089|    367|		case CDF_SIGNED32:
  ------------------
  |  |  201|    249|#define CDF_SIGNED32		0x00000003
  ------------------
  |  Branch (1089:3): [True: 249, False: 6.82k]
  ------------------
 1090|    536|		case CDF_BOOL:
  ------------------
  |  |  209|    536|#define CDF_BOOL		0x0000000b
  ------------------
  |  Branch (1090:3): [True: 287, False: 6.78k]
  ------------------
 1091|    831|		case CDF_UNSIGNED32:
  ------------------
  |  |  216|    831|#define CDF_UNSIGNED32		0x00000013
  ------------------
  |  Branch (1091:3): [True: 295, False: 6.77k]
  ------------------
 1092|  1.32k|		case CDF_FLOAT:
  ------------------
  |  |  202|  1.32k|#define CDF_FLOAT		0x00000004
  ------------------
  |  Branch (1092:3): [True: 492, False: 6.58k]
  ------------------
 1093|  1.32k|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int32_t)))
  ------------------
  |  Branch (1093:8): [True: 370, False: 953]
  ------------------
 1094|    370|				goto unknown;
 1095|    953|			break;
 1096|    953|		case CDF_SIGNED64:
  ------------------
  |  |  217|    258|#define CDF_SIGNED64		0x00000014
  ------------------
  |  Branch (1096:3): [True: 258, False: 6.81k]
  ------------------
 1097|    489|		case CDF_UNSIGNED64:
  ------------------
  |  |  218|    489|#define CDF_UNSIGNED64		0x00000015
  ------------------
  |  Branch (1097:3): [True: 231, False: 6.84k]
  ------------------
 1098|    714|		case CDF_DOUBLE:
  ------------------
  |  |  203|    714|#define CDF_DOUBLE		0x00000005
  ------------------
  |  Branch (1098:3): [True: 225, False: 6.84k]
  ------------------
 1099|  1.53k|		case CDF_FILETIME:
  ------------------
  |  |  229|  1.53k|#define CDF_FILETIME		0x00000040
  ------------------
  |  Branch (1099:3): [True: 822, False: 6.25k]
  ------------------
 1100|  1.53k|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int64_t)))
  ------------------
  |  Branch (1100:8): [True: 375, False: 1.16k]
  ------------------
 1101|    375|				goto unknown;
 1102|  1.16k|			break;
 1103|  1.16k|		case CDF_LENGTH32_STRING:
  ------------------
  |  |  227|    456|#define CDF_LENGTH32_STRING	0x0000001e
  ------------------
  |  Branch (1103:3): [True: 456, False: 6.61k]
  ------------------
 1104|    738|		case CDF_LENGTH32_WSTRING:
  ------------------
  |  |  228|    738|#define CDF_LENGTH32_WSTRING	0x0000001f
  ------------------
  |  Branch (1104:3): [True: 282, False: 6.79k]
  ------------------
 1105|    738|			if (nelements > 1) {
  ------------------
  |  Branch (1105:8): [True: 131, False: 607]
  ------------------
 1106|    131|				size_t nelem = inp - *info;
 1107|    131|				inp = cdf_grow_info(info, maxcount, nelements);
 1108|    131|				if (inp == NULL)
  ------------------
  |  Branch (1108:9): [True: 1, False: 130]
  ------------------
 1109|      1|					goto out;
 1110|    130|				inp += nelem;
 1111|    130|			}
 1112|   244k|			for (j = 0; j < nelements && i < sh.sh_properties;
  ------------------
  |  Branch (1112:16): [True: 243k, False: 687]
  |  Branch (1112:33): [True: 243k, False: 1]
  ------------------
 1113|   243k|			    j++, i++)
 1114|   243k|			{
 1115|   243k|				uint32_t l;
 1116|       |
 1117|   243k|				if (o4 + sizeof(uint32_t) > left)
  ------------------
  |  Branch (1117:9): [True: 5, False: 243k]
  ------------------
 1118|      5|					goto out;
 1119|       |
 1120|   243k|				l = CDF_GETUINT32(q, slen);
  ------------------
  |  |   92|   243k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1121|   243k|				o4 += sizeof(uint32_t);
 1122|   243k|				if (o4 + l > left)
  ------------------
  |  Branch (1122:9): [True: 44, False: 243k]
  ------------------
 1123|     44|					goto out;
 1124|       |
 1125|   243k|				inp[i].pi_str.s_len = l;
  ------------------
  |  |  192|   243k|#define pi_str	pi_val._pi_str
  ------------------
 1126|   243k|				inp[i].pi_str.s_buf = CAST(const char *,
  ------------------
  |  |  192|   243k|#define pi_str	pi_val._pi_str
  ------------------
              				inp[i].pi_str.s_buf = CAST(const char *,
  ------------------
  |  |  460|   243k|#define CAST(T, b)	((T)(b))
  ------------------
 1127|   243k|				    CAST(const void *, &q[o4]));
 1128|       |
 1129|   243k|				DPRINTF(("o=%" SIZE_T_FORMAT "u l=%d(%"
 1130|   243k|				    SIZE_T_FORMAT "u), t=%" SIZE_T_FORMAT
 1131|   243k|				    "u s=%.*s\n", o4, l,
 1132|   243k|				    CDF_ROUND(l, sizeof(l)),
 1133|   243k|				    left, (int)l, inp[i].pi_str.s_buf));
 1134|       |
 1135|   243k|				if (l & 1)
  ------------------
  |  Branch (1135:9): [True: 346, False: 243k]
  ------------------
 1136|    346|					l++;
 1137|       |
 1138|   243k|				slen += l >> 1;
 1139|   243k|				o4 = slen * sizeof(uint32_t);
 1140|   243k|			}
 1141|    688|			i--;
 1142|    688|			break;
 1143|    261|		case CDF_CLIPBOARD:
  ------------------
  |  |  236|    261|#define CDF_CLIPBOARD		0x00000047
  ------------------
  |  Branch (1143:3): [True: 261, False: 6.81k]
  ------------------
 1144|    261|			if (inp[i].pi_type & CDF_VECTOR)
  ------------------
  |  |  238|    261|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (1144:8): [True: 20, False: 241]
  ------------------
 1145|     20|				goto unknown;
 1146|    241|			break;
 1147|  1.56k|		default:
  ------------------
  |  Branch (1147:3): [True: 1.56k, False: 5.50k]
  ------------------
 1148|  3.13k|		unknown:
 1149|  3.13k|			memset(&inp[i].pi_val, 0, sizeof(inp[i].pi_val));
 1150|  3.13k|			DPRINTF(("Don't know how to deal with %#x\n",
 1151|  3.13k|			    inp[i].pi_type));
 1152|  3.13k|			break;
 1153|  7.07k|		}
 1154|  7.07k|	}
 1155|    257|	return 0;
 1156|    584|out:
 1157|    584|	free(*info);
 1158|    584|	*info = NULL;
 1159|    584|	*count = 0;
 1160|    584|	*maxcount = 0;
 1161|    584|	errno = EFTYPE;
  ------------------
  |  |   59|    584|#define EFTYPE EINVAL
  ------------------
 1162|    584|	return -1;
 1163|    622|}
cdf_unpack_summary_info:
 1168|    864|{
 1169|    864|	size_t maxcount;
 1170|    864|	const cdf_summary_info_header_t *si =
 1171|    864|	    CAST(const cdf_summary_info_header_t *, sst->sst_tab);
  ------------------
  |  |  460|    864|#define CAST(T, b)	((T)(b))
  ------------------
 1172|    864|	const cdf_section_declaration_t *sd =
 1173|    864|	    CAST(const cdf_section_declaration_t *, RCAST(const void *,
  ------------------
  |  |  460|    864|#define CAST(T, b)	((T)(b))
  ------------------
 1174|    864|	    RCAST(const char *, sst->sst_tab)
 1175|    864|	    + CDF_SECTION_DECLARATION_OFFSET));
 1176|       |
 1177|    864|	if (cdf_check_stream_offset(sst, h, si, sizeof(*si), __LINE__) == -1 ||
  ------------------
  |  Branch (1177:6): [True: 17, False: 847]
  ------------------
 1178|    847|	    cdf_check_stream_offset(sst, h, sd, sizeof(*sd), __LINE__) == -1)
  ------------------
  |  Branch (1178:6): [True: 6, False: 841]
  ------------------
 1179|     23|		return -1;
 1180|    841|	ssi->si_byte_order = CDF_TOLE2(si->si_byte_order);
  ------------------
  |  |   86|    841|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.68k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 841]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1181|    841|	ssi->si_os_version = CDF_TOLE2(si->si_os_version);
  ------------------
  |  |   86|    841|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.68k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 841]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1182|    841|	ssi->si_os = CDF_TOLE2(si->si_os);
  ------------------
  |  |   86|    841|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.68k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 841]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1183|    841|	ssi->si_class = si->si_class;
 1184|    841|	cdf_swap_class(&ssi->si_class);
 1185|    841|	ssi->si_count = CDF_TOLE4(si->si_count);
  ------------------
  |  |   84|    841|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.68k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 841]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1186|    841|	*count = 0;
 1187|    841|	maxcount = 0;
 1188|    841|	*info = NULL;
 1189|    841|	if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset), info,
  ------------------
  |  |   84|    841|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.68k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 841]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1189:6): [True: 584, False: 257]
  ------------------
 1190|    841|	    count, &maxcount) == -1)
 1191|    584|		return -1;
 1192|    257|	return 0;
 1193|    841|}
cdf_print_property_name:
 1315|  1.12k|{
 1316|  1.12k|	size_t i;
 1317|       |
 1318|  19.1k|	for (i = 0; i < __arraycount(vn); i++)
  ------------------
  |  |  138|  19.1k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (1318:14): [True: 18.3k, False: 812]
  ------------------
 1319|  18.3k|		if (vn[i].v == p)
  ------------------
  |  Branch (1319:7): [True: 310, False: 17.9k]
  ------------------
 1320|    310|			return snprintf(buf, bufsiz, "%s", vn[i].n);
 1321|    812|	return snprintf(buf, bufsiz, "%#x", p);
 1322|  1.12k|}
cdf_print_elapsed_time:
 1326|    172|{
 1327|    172|	int len = 0;
 1328|    172|	int days, hours, mins, secs;
 1329|       |
 1330|    172|	ts /= CDF_TIME_PREC;
  ------------------
  |  |   91|    172|#define CDF_TIME_PREC	10000000
  ------------------
 1331|    172|	secs = CAST(int, ts % 60);
  ------------------
  |  |  460|    172|#define CAST(T, b)	((T)(b))
  ------------------
 1332|    172|	ts /= 60;
 1333|    172|	mins = CAST(int, ts % 60);
  ------------------
  |  |  460|    172|#define CAST(T, b)	((T)(b))
  ------------------
 1334|    172|	ts /= 60;
 1335|    172|	hours = CAST(int, ts % 24);
  ------------------
  |  |  460|    172|#define CAST(T, b)	((T)(b))
  ------------------
 1336|    172|	ts /= 24;
 1337|    172|	days = CAST(int, ts);
  ------------------
  |  |  460|    172|#define CAST(T, b)	((T)(b))
  ------------------
 1338|       |
 1339|    172|	if (days) {
  ------------------
  |  Branch (1339:6): [True: 94, False: 78]
  ------------------
 1340|     94|		len += snprintf(buf + len, bufsiz - len, "%dd+", days);
 1341|     94|		if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  460|     94|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1341:7): [True: 0, False: 94]
  ------------------
 1342|      0|			return len;
 1343|     94|	}
 1344|       |
 1345|    172|	if (days || hours) {
  ------------------
  |  Branch (1345:6): [True: 94, False: 78]
  |  Branch (1345:14): [True: 38, False: 40]
  ------------------
 1346|    132|		len += snprintf(buf + len, bufsiz - len, "%.2d:", hours);
 1347|    132|		if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  460|    132|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1347:7): [True: 0, False: 132]
  ------------------
 1348|      0|			return len;
 1349|    132|	}
 1350|       |
 1351|    172|	len += snprintf(buf + len, bufsiz - len, "%.2d:", mins);
 1352|    172|	if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  460|    172|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1352:6): [True: 0, False: 172]
  ------------------
 1353|      0|		return len;
 1354|       |
 1355|    172|	len += snprintf(buf + len, bufsiz - len, "%.2d", secs);
 1356|    172|	return len;
 1357|    172|}
cdf.c:cdf_read:
  371|   190k|{
  372|   190k|	size_t siz = CAST(size_t, off + len);
  ------------------
  |  |  460|   190k|#define CAST(T, b)	((T)(b))
  ------------------
  373|       |
  374|   190k|	if (CAST(off_t, off + len) != CAST(off_t, siz))
  ------------------
  |  |  460|   190k|#define CAST(T, b)	((T)(b))
  ------------------
              	if (CAST(off_t, off + len) != CAST(off_t, siz))
  ------------------
  |  |  460|   190k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (374:6): [True: 0, False: 190k]
  ------------------
  375|      0|		goto out;
  376|       |
  377|   190k|	if (info->i_buf != NULL && info->i_len >= siz) {
  ------------------
  |  Branch (377:6): [True: 190k, False: 0]
  |  Branch (377:29): [True: 178k, False: 12.6k]
  ------------------
  378|   178k|		(void)memcpy(buf, &info->i_buf[off], len);
  379|   178k|		return CAST(ssize_t, len);
  ------------------
  |  |  460|   178k|#define CAST(T, b)	((T)(b))
  ------------------
  380|   178k|	}
  381|       |
  382|  12.6k|	if (info->i_fd == -1)
  ------------------
  |  Branch (382:6): [True: 4.13k, False: 8.47k]
  ------------------
  383|  4.13k|		goto out;
  384|       |
  385|  8.47k|	if (pread(info->i_fd, buf, len, off) != CAST(ssize_t, len))
  ------------------
  |  |  460|  8.47k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (385:6): [True: 8.47k, False: 0]
  ------------------
  386|  8.47k|		return -1;
  387|       |
  388|      0|	return CAST(ssize_t, len);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  389|  4.13k|out:
  390|  4.13k|	errno = EINVAL;
  391|  4.13k|	return -1;
  392|  8.47k|}
cdf.c:cdf_calloc:
  125|  7.05k|{
  126|  7.05k|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u %"
  127|  7.05k|	    SIZE_T_FORMAT "u\n", file, line, __func__, n, u));
  128|  7.05k|	if (n == 0)
  ------------------
  |  Branch (128:6): [True: 59, False: 6.99k]
  ------------------
  129|     59|	    n++;
  130|  7.05k|	return calloc(n, u);
  131|  7.05k|}
cdf.c:cdf_malloc:
  103|  1.20k|{
  104|  1.20k|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u\n",
  105|  1.20k|	    file, line, __func__, n));
  106|  1.20k|	if (n == 0)
  ------------------
  |  Branch (106:6): [True: 0, False: 1.20k]
  ------------------
  107|      0|	    n++;
  108|  1.20k|	return malloc(n);
  109|  1.20k|}
cdf.c:cdf_offset:
  919|  9.73k|{
  920|  9.73k|	return CAST(const void *, CAST(const uint8_t *, p) + l);
  ------------------
  |  |  460|  9.73k|#define CAST(T, b)	((T)(b))
  ------------------
  921|  9.73k|}
cdf.c:cdf_check_stream_offset:
  354|  11.7k|{
  355|  11.7k|	const char *b = RCAST(const char *, sst->sst_tab);
  ------------------
  |  |  461|  11.7k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  356|  11.7k|	const char *e = RCAST(const char *, p) + tail;
  ------------------
  |  |  461|  11.7k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  357|  11.7k|	size_t ss = cdf_check_stream(sst, h);
  358|  11.7k|	/*LINTED*/(void)&line;
  359|  11.7k|	if (e >= b && CAST(size_t, e - b) <= ss * sst->sst_len)
  ------------------
  |  |  460|  11.7k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (359:6): [True: 11.7k, False: 0]
  |  Branch (359:16): [True: 11.5k, False: 176]
  ------------------
  360|  11.5k|		return 0;
  361|    176|	DPRINTF(("%d: offset begin %p < end %p || %" SIZE_T_FORMAT "u"
  362|    176|	    " > %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %"
  363|    176|	    SIZE_T_FORMAT "u]\n", line, b, e, (size_t)(e - b),
  364|    176|	    ss * sst->sst_len, ss, sst->sst_len));
  365|    176|	errno = EFTYPE;
  ------------------
  |  |   59|    176|#define EFTYPE EINVAL
  ------------------
  366|    176|	return -1;
  367|  11.7k|}
cdf.c:cdf_grow_info:
  956|    779|{
  957|    779|	cdf_property_info_t *inp;
  958|    779|	size_t newcount = *maxcount + incr;
  959|       |
  960|    779|	if (newcount > CDF_PROP_LIMIT) {
  ------------------
  |  |  915|    779|#define CDF_PROP_LIMIT (UINT32_MAX / (64 * sizeof(cdf_property_info_t)))
  ------------------
  |  Branch (960:6): [True: 1, False: 778]
  ------------------
  961|      1|		DPRINTF(("exceeded property limit %" SIZE_T_FORMAT "u > %"
  962|      1|		    SIZE_T_FORMAT "u\n", newcount, CDF_PROP_LIMIT));
  963|      1|		goto out;
  964|      1|	}
  965|    778|	inp = CAST(cdf_property_info_t *,
  ------------------
  |  |  460|    778|#define CAST(T, b)	((T)(b))
  ------------------
  966|    778|	    CDF_REALLOC(*info, newcount * sizeof(*inp)));
  967|    778|	if (inp == NULL)
  ------------------
  |  Branch (967:6): [True: 0, False: 778]
  ------------------
  968|      0|		goto out;
  969|       |
  970|    778|	*info = inp;
  971|    778|	*maxcount = newcount;
  972|    778|	return inp;
  973|      1|out:
  974|      1|	free(*info);
  975|      1|	*maxcount = 0;
  976|      1|	*info = NULL;
  977|       |	return NULL;
  978|    778|}
cdf.c:cdf_realloc:
  115|    778|{
  116|    778|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u\n",
  117|    778|	    file, line, __func__, n));
  118|    778|	return realloc(p, n);
  119|    778|}
cdf.c:cdf_get_property_info_pos:
  926|  7.87k|{
  927|  7.87k|	size_t tail = (i << 1) + 1;
  928|  7.87k|	size_t ofs;
  929|       |
  930|  7.87k|	if (p >= e) {
  ------------------
  |  Branch (930:6): [True: 0, False: 7.87k]
  ------------------
  931|      0|		DPRINTF(("Past end %p < %p\n", e, p));
  932|      0|		return NULL;
  933|      0|	}
  934|       |
  935|  7.87k|	if (cdf_check_stream_offset(sst, h, p, (tail + 1) * sizeof(uint32_t),
  ------------------
  |  Branch (935:6): [True: 14, False: 7.85k]
  ------------------
  936|  7.87k|	    __LINE__) == -1)
  937|     14|		return NULL;
  938|       |
  939|  7.85k|	ofs = CDF_GETUINT32(p, tail);
  ------------------
  |  |   92|  7.85k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
  940|  7.85k|	if (ofs < 2 * sizeof(uint32_t)) {
  ------------------
  |  Branch (940:6): [True: 40, False: 7.81k]
  ------------------
  941|     40|		DPRINTF(("Offset too small %zu\n", ofs));
  942|     40|		return NULL;
  943|     40|	}
  944|       |
  945|  7.81k|	ofs -= 2 * sizeof(uint32_t);
  946|  7.81k|	if (ofs > CAST(size_t, e - p)) {
  ------------------
  |  |  460|  7.81k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (946:6): [True: 207, False: 7.61k]
  ------------------
  947|    207|		DPRINTF(("Offset too big %zu %td\n", ofs, e - p));
  948|    207|		return NULL;
  949|    207|	}
  950|       |
  951|  7.61k|	return CAST(const uint8_t *, cdf_offset(CAST(const void *, p), ofs));
  ------------------
  |  |  460|  7.61k|#define CAST(T, b)	((T)(b))
  ------------------
  952|  7.81k|}
cdf.c:cdf_getuint32:
  199|   267k|{
  200|   267k|	uint32_t rv;
  201|   267k|	(void)memcpy(&rv, p + offs * sizeof(uint32_t), sizeof(rv));
  202|   267k|	return CDF_TOLE4(rv);
  ------------------
  |  |   84|   267k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|   534k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 267k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  203|   267k|}
cdf.c:cdf_copy_info:
  983|  3.55k|{
  984|  3.55k|	if (inp->pi_type & CDF_VECTOR)
  ------------------
  |  |  238|  3.55k|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (984:6): [True: 183, False: 3.36k]
  ------------------
  985|    183|		return 0;
  986|       |
  987|  3.36k|	if (CAST(size_t, CAST(const char *, e) - CAST(const char *, p)) < len)
  ------------------
  |  |  460|  3.36k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (987:6): [True: 887, False: 2.48k]
  ------------------
  988|    887|		return 0;
  989|       |
  990|  2.48k|	(void)memcpy(&inp->pi_val, p, len);
  991|       |
  992|  2.48k|	switch (len) {
  993|    367|	case 2:
  ------------------
  |  Branch (993:2): [True: 367, False: 2.11k]
  ------------------
  994|    367|		inp->pi_u16 = CDF_TOLE2(inp->pi_u16);
  ------------------
  |  |  187|    367|#define pi_u16	pi_val._pi_u16
  ------------------
              		inp->pi_u16 = CDF_TOLE2(inp->pi_u16);
  ------------------
  |  |   86|    367|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|    734|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 367]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  995|    367|		break;
  996|    953|	case 4:
  ------------------
  |  Branch (996:2): [True: 953, False: 1.52k]
  ------------------
  997|    953|		inp->pi_u32 = CDF_TOLE4(inp->pi_u32);
  ------------------
  |  |  185|    953|#define pi_u32	pi_val._pi_u32
  ------------------
              		inp->pi_u32 = CDF_TOLE4(inp->pi_u32);
  ------------------
  |  |   84|    953|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.90k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 953]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  998|    953|		break;
  999|  1.16k|	case 8:
  ------------------
  |  Branch (999:2): [True: 1.16k, False: 1.32k]
  ------------------
 1000|  1.16k|		inp->pi_u64 = CDF_TOLE8(inp->pi_u64);
  ------------------
  |  |  183|  1.16k|#define pi_u64	pi_val._pi_u64
  ------------------
              		inp->pi_u64 = CDF_TOLE8(inp->pi_u64);
  ------------------
  |  |   82|  1.16k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  460|  2.32k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 1.16k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1001|  1.16k|		break;
 1002|      0|	default:
  ------------------
  |  Branch (1002:2): [True: 0, False: 2.48k]
  ------------------
 1003|      0|		abort();
 1004|  2.48k|	}
 1005|  2.48k|	return 1;
 1006|  2.48k|}
cdf.c:cdf_check_stream:
  344|  11.7k|{
  345|  11.7k|	size_t ss = sst->sst_dirlen < h->h_min_size_standard_stream ?
  ------------------
  |  Branch (345:14): [True: 465, False: 11.2k]
  ------------------
  346|  11.7k|	    CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
  ------------------
  |  |   83|    465|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|    465|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	    CDF_SHORT_SEC_SIZE(h) : CDF_SEC_SIZE(h);
  ------------------
  |  |   81|  11.2k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|  11.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  347|  11.7k|	assert(ss == sst->sst_ss);
  ------------------
  |  Branch (347:2): [True: 0, False: 11.7k]
  |  Branch (347:2): [True: 11.7k, False: 0]
  ------------------
  348|  11.7k|	return sst->sst_ss;
  349|  11.7k|}

cdf_timestamp_to_timespec:
  100|  2.07k|{
  101|  2.07k|	struct tm tm;
  102|  2.07k|#ifdef HAVE_STRUCT_TM_TM_ZONE
  103|  2.07k|	file_private char UTC[] = "UTC";
  ------------------
  |  |  116|  2.07k|#define file_private static
  ------------------
  104|  2.07k|#endif
  105|  2.07k|	int rdays;
  106|       |
  107|       |	/* Unit is 100's of nanoseconds */
  108|  2.07k|	ts->tv_nsec = (t % CDF_TIME_PREC) * 100;
  ------------------
  |  |   91|  2.07k|#define CDF_TIME_PREC	10000000
  ------------------
  109|       |
  110|  2.07k|	t /= CDF_TIME_PREC;
  ------------------
  |  |   91|  2.07k|#define CDF_TIME_PREC	10000000
  ------------------
  111|  2.07k|	tm.tm_sec = CAST(int, t % 60);
  ------------------
  |  |  460|  2.07k|#define CAST(T, b)	((T)(b))
  ------------------
  112|  2.07k|	t /= 60;
  113|       |
  114|  2.07k|	tm.tm_min = CAST(int, t % 60);
  ------------------
  |  |  460|  2.07k|#define CAST(T, b)	((T)(b))
  ------------------
  115|  2.07k|	t /= 60;
  116|       |
  117|  2.07k|	tm.tm_hour = CAST(int, t % 24);
  ------------------
  |  |  460|  2.07k|#define CAST(T, b)	((T)(b))
  ------------------
  118|  2.07k|	t /= 24;
  119|       |
  120|       |	/* XXX: Approx */
  121|  2.07k|	tm.tm_year = CAST(int, CDF_BASE_YEAR + (t / 365));
  ------------------
  |  |  460|  2.07k|#define CAST(T, b)	((T)(b))
  ------------------
  122|       |
  123|  2.07k|	if (tm.tm_year > 9999) {
  ------------------
  |  Branch (123:6): [True: 398, False: 1.67k]
  ------------------
  124|    398|		ts->tv_sec = 0;
  125|    398|		goto out;
  126|    398|	}
  127|       |
  128|  1.67k|	rdays = cdf_getdays(tm.tm_year);
  129|  1.67k|	t -= rdays - 1;
  130|  1.67k|	tm.tm_mday = cdf_getday(tm.tm_year, CAST(int, t));
  ------------------
  |  |  460|  1.67k|#define CAST(T, b)	((T)(b))
  ------------------
  131|  1.67k|	tm.tm_mon = cdf_getmonth(tm.tm_year, CAST(int, t));
  ------------------
  |  |  460|  1.67k|#define CAST(T, b)	((T)(b))
  ------------------
  132|  1.67k|	tm.tm_wday = 0;
  133|  1.67k|	tm.tm_yday = 0;
  134|  1.67k|	tm.tm_isdst = 0;
  135|  1.67k|#ifdef HAVE_STRUCT_TM_TM_GMTOFF
  136|  1.67k|	tm.tm_gmtoff = 0;
  137|  1.67k|#endif
  138|  1.67k|#ifdef HAVE_STRUCT_TM_TM_ZONE
  139|  1.67k|	tm.tm_zone = UTC;
  140|  1.67k|#endif
  141|  1.67k|	tm.tm_year -= 1900;
  142|  1.67k|	ts->tv_sec = mktime(&tm);
  143|  1.67k|	if (ts->tv_sec == -1)
  ------------------
  |  Branch (143:6): [True: 18, False: 1.65k]
  ------------------
  144|     18|		goto out;
  145|  1.65k|	return 0;
  146|    416|out:
  147|    416|	errno = EINVAL;
  148|    416|	return -1;
  149|  1.67k|}
cdf_ctime:
  176|    320|{
  177|    320|	char *ptr = *sec > MAX_CTIME ? NULL : ctime_r(sec, buf);
  ------------------
  |  |  181|    320|    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
  |  |  ------------------
  |  |  |  |  460|    640|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 320, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (177:14): [True: 0, False: 320]
  ------------------
  178|    320|	if (ptr != NULL)
  ------------------
  |  Branch (178:6): [True: 320, False: 0]
  ------------------
  179|    320|		return buf;
  180|       |#ifdef WIN32
  181|       |	(void)snprintf(buf, 26, "*Bad* 0x%16.16I64x\n",
  182|       |	    CAST(long long, *sec));
  183|       |#else
  184|      0|	(void)snprintf(buf, 26, "*Bad* %#16.16" INT64_T_FORMAT "x\n",
  185|      0|	    CAST(long long, *sec));
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  186|      0|#endif
  187|      0|	return buf;
  188|    320|}
cdf_time.c:cdf_getdays:
   53|  1.67k|{
   54|  1.67k|	int days = 0;
   55|  1.67k|	int y;
   56|       |
   57|   800k|	for (y = CDF_BASE_YEAR; y < year; y++)
  ------------------
  |  |   90|  1.67k|#define CDF_BASE_YEAR	1601
  ------------------
  |  Branch (57:26): [True: 798k, False: 1.67k]
  ------------------
   58|   798k|		days += isleap(y) + 365;
  ------------------
  |  |   41|   798k|#define isleap(y) ((((y) % 4) == 0) && \
  |  |  ------------------
  |  |  |  Branch (41:20): [True: 199k, False: 599k]
  |  |  ------------------
  |  |   42|   798k|    ((((y) % 100) != 0) || (((y) % 400) == 0)))
  |  |  ------------------
  |  |  |  Branch (42:6): [True: 191k, False: 7.52k]
  |  |  |  Branch (42:28): [True: 1.65k, False: 5.87k]
  |  |  ------------------
  ------------------
   59|       |
   60|  1.67k|	return days;
   61|  1.67k|}
cdf_time.c:cdf_getday:
   68|  1.67k|{
   69|  1.67k|	size_t m;
   70|       |
   71|  6.95k|	for (m = 0; m < __arraycount(mdays); m++) {
  ------------------
  |  |  138|  6.95k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (71:14): [True: 6.88k, False: 70]
  ------------------
   72|  6.88k|		int sub = mdays[m] + (m == 1 && isleap(year));
  ------------------
  |  |   41|    870|#define isleap(y) ((((y) % 4) == 0) && \
  |  |  ------------------
  |  |  |  Branch (41:20): [True: 299, False: 571]
  |  |  ------------------
  |  |   42|    870|    ((((y) % 100) != 0) || (((y) % 400) == 0)))
  |  |  ------------------
  |  |  |  Branch (42:6): [True: 162, False: 137]
  |  |  |  Branch (42:28): [True: 70, False: 67]
  |  |  ------------------
  ------------------
  |  Branch (72:25): [True: 870, False: 6.01k]
  ------------------
   73|  6.88k|		if (days < sub)
  ------------------
  |  Branch (73:7): [True: 1.60k, False: 5.28k]
  ------------------
   74|  1.60k|			return days;
   75|  5.28k|		days -= sub;
   76|  5.28k|	}
   77|     70|	return days;
   78|  1.67k|}
cdf_time.c:cdf_getmonth:
   85|  1.67k|{
   86|  1.67k|	size_t m;
   87|       |
   88|  6.85k|	for (m = 0; m < __arraycount(mdays); m++) {
  ------------------
  |  |  138|  6.85k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (88:14): [True: 6.85k, False: 0]
  ------------------
   89|  6.85k|		days -= mdays[m];
   90|  6.85k|		if (m == 1 && isleap(year))
  ------------------
  |  |   41|    843|#define isleap(y) ((((y) % 4) == 0) && \
  |  |  ------------------
  |  |  |  Branch (41:20): [True: 299, False: 544]
  |  |  ------------------
  |  |   42|    843|    ((((y) % 100) != 0) || (((y) % 400) == 0)))
  |  |  ------------------
  |  |  |  Branch (42:6): [True: 162, False: 137]
  |  |  |  Branch (42:28): [True: 70, False: 67]
  |  |  ------------------
  ------------------
  |  Branch (90:7): [True: 843, False: 6.01k]
  ------------------
   91|    232|			days--;
   92|  6.85k|		if (days <= 0)
  ------------------
  |  Branch (92:7): [True: 1.67k, False: 5.18k]
  ------------------
   93|  1.67k|			return CAST(int, m);
  ------------------
  |  |  460|  1.67k|#define CAST(T, b)	((T)(b))
  ------------------
   94|  6.85k|	}
   95|      0|	return CAST(int, m);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
   96|  1.67k|}

file_zmagic:
  306|  19.6k|{
  307|  19.6k|	unsigned char *newbuf = NULL;
  308|  19.6k|	size_t i, nsz;
  309|  19.6k|	char *rbuf;
  310|  19.6k|	file_pushbuf_t *pb;
  311|  19.6k|	int urv, prv, rv = 0;
  312|  19.6k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  19.6k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  19.6k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  19.6k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  313|  19.6k|	int fd = b->fd;
  314|  19.6k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  19.6k|#define CAST(T, b)	((T)(b))
  ------------------
  315|  19.6k|	size_t nbytes = b->flen;
  316|  19.6k|#ifdef HAVE_SIGACTION
  317|  19.6k|	int sa_saved = 0;
  318|  19.6k|	struct sigaction sig_act;
  319|  19.6k|#endif
  320|       |
  321|  19.6k|	if ((ms->flags & MAGIC_COMPRESS) == 0)
  ------------------
  |  |   35|  19.6k|#define	MAGIC_COMPRESS		0x0000004 /* Check inside compressed files */
  ------------------
  |  Branch (321:6): [True: 6.82k, False: 12.8k]
  ------------------
  322|  6.82k|		return 0;
  323|       |
  324|   204k|	for (i = 0; i < ncompr; i++) {
  ------------------
  |  Branch (324:14): [True: 192k, False: 12.8k]
  ------------------
  325|   192k|		int zm;
  326|   192k|		if (nbytes < CAST(size_t, abs(compr[i].maglen)))
  ------------------
  |  |  460|   192k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (326:7): [True: 8.24k, False: 183k]
  ------------------
  327|  8.24k|			continue;
  328|   183k|		if (compr[i].maglen < 0) {
  ------------------
  |  Branch (328:7): [True: 22.2k, False: 161k]
  ------------------
  329|  22.2k|			zm = (*compr[i].u.func)(buf);
  330|   161k|		} else {
  331|   161k|			zm = memcmp(buf, compr[i].u.magic,
  332|   161k|			    CAST(size_t, compr[i].maglen)) == 0;
  ------------------
  |  |  460|   161k|#define CAST(T, b)	((T)(b))
  ------------------
  333|   161k|		}
  334|       |
  335|   183k|		if (!zm)
  ------------------
  |  Branch (335:7): [True: 180k, False: 3.60k]
  ------------------
  336|   180k|			continue;
  337|       |
  338|  3.60k|#ifdef HAVE_SIGACTION
  339|       |		/* Prevent SIGPIPE death if child dies unexpectedly */
  340|  3.60k|		if (!sa_saved) {
  ------------------
  |  Branch (340:7): [True: 3.22k, False: 382]
  ------------------
  341|       |			//We can use sig_act for both new and old, but
  342|  3.22k|			struct sigaction new_act;
  343|  3.22k|			memset(&new_act, 0, sizeof(new_act));
  344|  3.22k|			new_act.sa_handler = SIG_IGN;
  345|  3.22k|			sa_saved = sigaction(SIGPIPE, &new_act, &sig_act) != -1;
  346|  3.22k|		}
  347|  3.60k|#endif
  348|       |
  349|  3.60k|		nsz = nbytes;
  350|  3.60k|		free(newbuf);
  351|  3.60k|		urv = uncompressbuf(fd, ms->bytes_max, i, 
  352|  3.60k|		    (ms->flags & MAGIC_NO_COMPRESS_FORK), buf, &newbuf, &nsz);
  ------------------
  |  |   50|  3.60k|#define MAGIC_NO_COMPRESS_FORK	0x4000000 /* Don't allow decompression that
  ------------------
  353|  3.60k|		DPRINTF("uncompressbuf = %d, %s, %" SIZE_T_FORMAT "u\n", urv,
  354|  3.60k|		    (char *)newbuf, nsz);
  355|  3.60k|		switch (urv) {
  356|  3.38k|		case OKDATA:
  ------------------
  |  |  242|  3.38k|#define OKDATA 	0
  ------------------
  |  Branch (356:3): [True: 3.38k, False: 219]
  ------------------
  357|  3.60k|		case ERRDATA:
  ------------------
  |  |  244|  3.60k|#define ERRDATA	2
  ------------------
  |  Branch (357:3): [True: 219, False: 3.38k]
  ------------------
  358|  3.60k|			ms->flags &= ~MAGIC_COMPRESS;
  ------------------
  |  |   35|  3.60k|#define	MAGIC_COMPRESS		0x0000004 /* Check inside compressed files */
  ------------------
  359|  3.60k|			if (urv == ERRDATA)
  ------------------
  |  |  244|  3.60k|#define ERRDATA	2
  ------------------
  |  Branch (359:8): [True: 219, False: 3.38k]
  ------------------
  360|    219|				prv = format_decompression_error(ms, i, newbuf);
  361|  3.38k|			else
  362|  3.38k|				prv = file_buffer(ms, -1, NULL, name, newbuf,
  363|  3.38k|				    nsz);
  364|  3.60k|			if (prv == -1)
  ------------------
  |  Branch (364:8): [True: 0, False: 3.60k]
  ------------------
  365|      0|				goto error;
  366|  3.60k|			rv = 1;
  367|  3.60k|			if ((ms->flags & MAGIC_COMPRESS_TRANSP) != 0)
  ------------------
  |  |   48|  3.60k|#define MAGIC_COMPRESS_TRANSP	0x2000000 /* Check inside compressed files
  ------------------
  |  Branch (367:8): [True: 0, False: 3.60k]
  ------------------
  368|      0|				goto out;
  369|  3.60k|			if (mime != MAGIC_MIME && mime != 0)
  ------------------
  |  |   44|  7.20k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  3.60k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  3.60k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (369:8): [True: 3.60k, False: 0]
  |  Branch (369:30): [True: 0, False: 3.60k]
  ------------------
  370|      0|				goto out;
  371|  3.60k|			if ((file_printf(ms,
  ------------------
  |  Branch (371:8): [True: 0, False: 3.60k]
  ------------------
  372|  3.60k|			    mime ? " compressed-encoding=" : " (")) == -1)
  ------------------
  |  Branch (372:8): [True: 0, False: 3.60k]
  ------------------
  373|      0|				goto error;
  374|  3.60k|			if ((pb = file_push_buffer(ms)) == NULL)
  ------------------
  |  Branch (374:8): [True: 140, False: 3.46k]
  ------------------
  375|    140|				goto error;
  376|       |			/*
  377|       |			 * XXX: If file_buffer fails here, we overwrite
  378|       |			 * the compressed text. FIXME.
  379|       |			 */
  380|  3.46k|			if (file_buffer(ms, -1, NULL, NULL, buf, nbytes) == -1)
  ------------------
  |  Branch (380:8): [True: 0, False: 3.46k]
  ------------------
  381|      0|			{
  382|      0|				if (file_pop_buffer(ms, pb) != NULL)
  ------------------
  |  Branch (382:9): [True: 0, False: 0]
  ------------------
  383|      0|					abort();
  384|      0|				goto error;
  385|      0|			}
  386|  3.46k|			if ((rbuf = file_pop_buffer(ms, pb)) != NULL) {
  ------------------
  |  Branch (386:8): [True: 3.46k, False: 0]
  ------------------
  387|  3.46k|				if (file_printf(ms, "%s", rbuf) == -1) {
  ------------------
  |  Branch (387:9): [True: 3, False: 3.46k]
  ------------------
  388|      3|					free(rbuf);
  389|      3|					goto error;
  390|      3|				}
  391|  3.46k|				free(rbuf);
  392|  3.46k|			}
  393|  3.46k|			if (!mime && file_printf(ms, ")") == -1)
  ------------------
  |  Branch (393:8): [True: 3.46k, False: 0]
  |  Branch (393:17): [True: 0, False: 3.46k]
  ------------------
  394|      0|				goto error;
  395|       |			/*FALLTHROUGH*/
  396|  3.46k|		case NODATA:
  ------------------
  |  |  243|  3.46k|#define NODATA	1
  ------------------
  |  Branch (396:3): [True: 0, False: 3.60k]
  ------------------
  397|  3.46k|			break;
  398|      0|		default:
  ------------------
  |  Branch (398:3): [True: 0, False: 3.60k]
  ------------------
  399|      0|			abort();
  400|       |			/*NOTREACHED*/
  401|    143|		error:
  402|    143|			rv = -1;
  403|    143|			break;
  404|  3.60k|		}
  405|  3.60k|	}
  406|  12.8k|out:
  407|  12.8k|	DPRINTF("rv = %d\n", rv);
  408|       |
  409|  12.8k|#ifdef HAVE_SIGACTION
  410|  12.8k|	if (sa_saved && sig_act.sa_handler != SIG_IGN)
  ------------------
  |  Branch (410:6): [True: 3.22k, False: 9.58k]
  |  Branch (410:18): [True: 3.22k, False: 0]
  ------------------
  411|  3.22k|		(void)sigaction(SIGPIPE, &sig_act, NULL);
  412|  12.8k|#endif
  413|       |
  414|  12.8k|	free(newbuf);
  415|  12.8k|	ms->flags |= MAGIC_COMPRESS;
  ------------------
  |  |   35|  12.8k|#define	MAGIC_COMPRESS		0x0000004 /* Check inside compressed files */
  ------------------
  416|  12.8k|	DPRINTF("Zmagic returns %d\n", rv);
  417|  12.8k|	return rv;
  418|  12.8k|}
sread:
  450|  6.91k|{
  451|  6.91k|	ssize_t rv;
  452|  6.91k|#if defined(FIONREAD) && defined(HAVE_IOCTL) && !defined(__MINGW32__)
  453|  6.91k|	int t = 0;
  454|  6.91k|#endif
  455|  6.91k|	size_t rn = n;
  456|       |
  457|  6.91k|	if (fd == STDIN_FILENO)
  ------------------
  |  Branch (457:6): [True: 0, False: 6.91k]
  ------------------
  458|      0|		goto nocheck;
  459|       |
  460|  6.91k|#if defined(FIONREAD) && defined(HAVE_IOCTL) && !defined(__MINGW32__)
  461|  6.91k|	if (canbepipe && (ioctl(fd, FIONREAD, &t) == -1 || t == 0)) {
  ------------------
  |  Branch (461:6): [True: 0, False: 6.91k]
  |  Branch (461:20): [True: 0, False: 0]
  |  Branch (461:53): [True: 0, False: 0]
  ------------------
  462|      0|#if defined(FD_ZERO) && defined(HAVE_SELECT)
  463|      0|		ssize_t cnt;
  464|      0|		for (cnt = 0;; cnt++) {
  465|      0|			fd_set check;
  466|      0|			struct timeval tout = {0, 100 * 1000};
  467|      0|			int selrv;
  468|       |
  469|      0|			FD_ZERO(&check);
  ------------------
  |  Branch (469:4): [True: 0, False: 0]
  |  Branch (469:4): [Folded, False: 0]
  ------------------
  470|      0|			FD_SET(fd, &check);
  471|       |
  472|       |			/*
  473|       |			 * Avoid soft deadlock: do not read if there
  474|       |			 * is nothing to read from sockets and pipes.
  475|       |			 */
  476|      0|			selrv = select(fd + 1, &check, NULL, NULL, &tout);
  477|      0|			if (selrv == -1) {
  ------------------
  |  Branch (477:8): [True: 0, False: 0]
  ------------------
  478|      0|				if (errno == EINTR || errno == EAGAIN)
  ------------------
  |  Branch (478:9): [True: 0, False: 0]
  |  Branch (478:27): [True: 0, False: 0]
  ------------------
  479|      0|					continue;
  480|      0|			} else if (selrv == 0 && cnt >= 5) {
  ------------------
  |  Branch (480:15): [True: 0, False: 0]
  |  Branch (480:29): [True: 0, False: 0]
  ------------------
  481|      0|				return 0;
  482|      0|			} else
  483|      0|				break;
  484|      0|		}
  485|      0|#endif
  486|      0|		(void)ioctl(fd, FIONREAD, &t);
  487|      0|	}
  488|       |
  489|  6.91k|	if (t > 0 && CAST(size_t, t) < n) {
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (489:6): [True: 0, False: 6.91k]
  |  Branch (489:15): [True: 0, False: 0]
  ------------------
  490|      0|		n = t;
  491|      0|		rn = n;
  492|      0|	}
  493|  6.91k|#endif
  494|       |
  495|  6.91k|nocheck:
  496|  6.91k|	do
  497|   253k|		switch ((rv = read(fd, buf, n))) {
  498|      1|		case -1:
  ------------------
  |  Branch (498:3): [True: 1, False: 253k]
  ------------------
  499|      1|			if (errno == EINTR)
  ------------------
  |  Branch (499:8): [True: 1, False: 0]
  ------------------
  500|      1|				continue;
  501|      0|			return -1;
  502|  6.77k|		case 0:
  ------------------
  |  Branch (502:3): [True: 6.77k, False: 246k]
  ------------------
  503|  6.77k|			return rn - n;
  504|   246k|		default:
  ------------------
  |  Branch (504:3): [True: 246k, False: 6.77k]
  ------------------
  505|   246k|			n -= rv;
  506|   246k|			buf = CAST(char *, CCAST(void *, buf)) + rv;
  ------------------
  |  |  460|   246k|#define CAST(T, b)	((T)(b))
  ------------------
  507|   246k|			break;
  508|   253k|		}
  509|   246k|	while (n > 0);
  ------------------
  |  Branch (509:9): [True: 246k, False: 136]
  ------------------
  510|    136|	return rn;
  511|  6.91k|}
compress.c:lzmacmp:
  162|  9.39k|{
  163|  9.39k|	if (buf[0] != 0x5d || buf[1] || buf[2])
  ------------------
  |  Branch (163:6): [True: 9.37k, False: 23]
  |  Branch (163:24): [True: 2, False: 21]
  |  Branch (163:34): [True: 8, False: 13]
  ------------------
  164|  9.38k|		return 0;
  165|     13|	if (buf[12] && buf[12] != 0xff)
  ------------------
  |  Branch (165:6): [True: 12, False: 1]
  |  Branch (165:17): [True: 11, False: 1]
  ------------------
  166|     11|		return 0;
  167|      2|	return 1;
  168|     13|}
compress.c:zlibcmp:
  145|  12.8k|{
  146|  12.8k|	unsigned short x;
  147|       |
  148|  12.8k|	if ((buf[0] & 0xf) != 8 || (buf[0] & 0x80) != 0)
  ------------------
  |  Branch (148:6): [True: 12.7k, False: 101]
  |  Branch (148:29): [True: 35, False: 66]
  ------------------
  149|  12.7k|		return 0;
  150|     66|	if (file_bigendian())	/* endianness test */
  ------------------
  |  Branch (150:6): [True: 0, False: 66]
  ------------------
  151|      0|		x = buf[0] | (buf[1] << 8);
  152|     66|	else
  153|     66|		x = buf[1] | (buf[0] << 8);
  154|     66|	if (x % 31)
  ------------------
  |  Branch (154:6): [True: 43, False: 23]
  ------------------
  155|     43|		return 0;
  156|     23|	return 1;
  157|     66|}
compress.c:format_decompression_error:
  289|    219|{
  290|    219|	unsigned char *p;
  291|    219|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|    219|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|    219|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|    219|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  292|       |
  293|    219|	if (!mime)
  ------------------
  |  Branch (293:6): [True: 219, False: 0]
  ------------------
  294|    219|		return file_printf(ms, "ERROR:[%s: %s]", methodname(i), buf);
  295|       |
  296|      0|	for (p = buf; *p; p++)
  ------------------
  |  Branch (296:16): [True: 0, False: 0]
  ------------------
  297|      0|		if (!isalnum(*p))
  ------------------
  |  Branch (297:7): [True: 0, False: 0]
  ------------------
  298|      0|			*p = '-';
  299|       |
  300|      0|	return file_printf(ms, "application/x-decompression-error-%s-%s",
  301|      0|	    methodname(i), buf);
  302|    219|}
compress.c:methodname:
 1113|    219|{
 1114|    219|	switch (method) {
 1115|      0|#ifdef BUILTIN_DECOMPRESS
 1116|     28|	case METH_FROZEN:
  ------------------
  |  |  210|     28|#define METH_FROZEN	2
  ------------------
  |  Branch (1116:2): [True: 28, False: 191]
  ------------------
 1117|     51|	case METH_ZLIB:
  ------------------
  |  |  218|     51|#define METH_ZLIB	14
  ------------------
  |  Branch (1117:2): [True: 23, False: 196]
  ------------------
 1118|     51|		return "zlib";
 1119|      0|#endif
 1120|      0|#ifdef BUILTIN_BZLIB
 1121|      5|	case METH_BZIP:
  ------------------
  |  |  211|      5|#define METH_BZIP	7
  ------------------
  |  Branch (1121:2): [True: 5, False: 214]
  ------------------
 1122|      5|		return "bzlib";
 1123|      0|#endif
 1124|      0|#ifdef BUILTIN_XZLIB
 1125|      1|	case METH_XZ:
  ------------------
  |  |  212|      1|#define METH_XZ		9
  ------------------
  |  Branch (1125:2): [True: 1, False: 218]
  ------------------
 1126|      3|	case METH_LZMA:
  ------------------
  |  |  217|      3|#define METH_LZMA	13
  ------------------
  |  Branch (1126:2): [True: 2, False: 217]
  ------------------
 1127|      3|		return "xzlib";
 1128|      0|#endif
 1129|      0|#ifdef BUILTIN_ZSTDLIB
 1130|      6|	case METH_ZSTD:
  ------------------
  |  |  216|      6|#define METH_ZSTD	12
  ------------------
  |  Branch (1130:2): [True: 6, False: 213]
  ------------------
 1131|      6|		return "zstd";
 1132|      0|#endif
 1133|       |#ifdef BUILTIN_LZLIB
 1134|       |	case METH_LZIP:
 1135|       |		return "lzlib";
 1136|       |#endif
 1137|       |#ifdef BUILTIN_LRZIP
 1138|       |	case METH_LRZIP:
 1139|       |		return "lrzip";
 1140|       |#endif
 1141|    154|	default:
  ------------------
  |  Branch (1141:2): [True: 154, False: 65]
  ------------------
 1142|    154|		return compr[method].argv[0];
 1143|    219|	}
 1144|    219|}
compress.c:uncompressbuf:
 1190|  3.60k|{
 1191|  3.60k|	int fdp[3][2];
 1192|  3.60k|	int status, rv, w;
 1193|  3.60k|	pid_t pid;
 1194|  3.60k|	pid_t writepid = -1;
 1195|  3.60k|	size_t i;
 1196|  3.60k|	ssize_t r, re;
 1197|  3.60k|	char *const *args;
 1198|  3.60k|#ifdef HAVE_POSIX_SPAWNP
 1199|  3.60k|	posix_spawn_file_actions_t fa;
 1200|  3.60k|#endif
 1201|  3.60k|	int (*decompress)(const unsigned char *, unsigned char **,
 1202|  3.60k|	    size_t, size_t *, int) = getdecompressor(method);
 1203|       |
 1204|  3.60k|	*newch = CAST(unsigned char *, malloc(bytes_max + 1));
  ------------------
  |  |  460|  3.60k|#define CAST(T, b)	((T)(b))
  ------------------
 1205|  3.60k|	if (*newch == NULL)
  ------------------
  |  Branch (1205:6): [True: 0, False: 3.60k]
  ------------------
 1206|      0|		return makeerror(newch, n, "No buffer, %s", strerror(errno));
 1207|       |
 1208|  3.60k|	if (decompress) {
  ------------------
  |  Branch (1208:6): [True: 67, False: 3.53k]
  ------------------
 1209|     67|		if (nofork) {
  ------------------
  |  Branch (1209:7): [True: 67, False: 0]
  ------------------
 1210|     67|			return makeerror(newch, n,
 1211|     67|			    "Fork is required to uncompress, but disabled");
 1212|     67|		}
 1213|      0|		return (*decompress)(old, newch, bytes_max, n, 1);
 1214|     67|	}
 1215|       |
 1216|  3.53k|	(void)fflush(stdout);
 1217|  3.53k|	(void)fflush(stderr);
 1218|       |
 1219|  14.1k|	for (i = 0; i < __arraycount(fdp); i++)
  ------------------
  |  |  138|  14.1k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (1219:14): [True: 10.6k, False: 3.53k]
  ------------------
 1220|  10.6k|		fdp[i][0] = fdp[i][1] = -1;
 1221|       |
 1222|       |	/*
 1223|       |	 * There are multithreaded users who run magic_file()
 1224|       |	 * from dozens of threads. If two parallel magic_file() calls
 1225|       |	 * analyze two large compressed files, both will spawn
 1226|       |	 * an uncompressing child here, which writes out uncompressed data.
 1227|       |	 * We read some portion, then close the pipe, then waitpid() the child.
 1228|       |	 * If uncompressed data is larger, child should get EPIPE and exit.
 1229|       |	 * However, with *parallel* calls OTHER child may unintentionally
 1230|       |	 * inherit pipe fds, thus keeping pipe open and making writes in
 1231|       |	 * our child block instead of failing with EPIPE!
 1232|       |	 * (For the bug to occur, two threads must mutually inherit their pipes,
 1233|       |	 * and both must have large outputs. Thus it happens not that often).
 1234|       |	 * To avoid this, be sure to create pipes with O_CLOEXEC.
 1235|       |	 */
 1236|  3.53k|	if ((fd == -1 && file_pipe_closexec(fdp[STDIN_FILENO]) == -1) ||
  ------------------
  |  Branch (1236:7): [True: 0, False: 3.53k]
  |  Branch (1236:19): [True: 0, False: 0]
  ------------------
 1237|  3.53k|	    file_pipe_closexec(fdp[STDOUT_FILENO]) == -1 ||
  ------------------
  |  Branch (1237:6): [True: 0, False: 3.53k]
  ------------------
 1238|  3.53k|	    file_pipe_closexec(fdp[STDERR_FILENO]) == -1) {
  ------------------
  |  Branch (1238:6): [True: 0, False: 3.53k]
  ------------------
 1239|      0|		closep(fdp[STDIN_FILENO]);
 1240|      0|		closep(fdp[STDOUT_FILENO]);
 1241|      0|		return makeerror(newch, n, "Cannot create pipe, %s",
 1242|      0|		    strerror(errno));
 1243|      0|	}
 1244|       |
 1245|  3.53k|	args = RCAST(char *const *, RCAST(intptr_t, compr[method].argv));
  ------------------
  |  |  461|  3.53k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1246|  3.53k|#ifdef HAVE_POSIX_SPAWNP
 1247|  3.53k|	posix_spawn_file_actions_init(&fa);
 1248|       |
 1249|  3.53k|	handledesc(&fa, fd, fdp);
 1250|       |
 1251|  3.53k|	DPRINTF("Executing %s\n", compr[method].argv[0]);
 1252|  3.53k|	status = posix_spawnp(&pid, compr[method].argv[0], &fa, NULL,
 1253|  3.53k|	    args, NULL);
 1254|       |
 1255|  3.53k|	posix_spawn_file_actions_destroy(&fa);
 1256|       |
 1257|  3.53k|	if (status != 0) {
  ------------------
  |  Branch (1257:6): [True: 14, False: 3.52k]
  ------------------
 1258|     14|		return makeerror(newch, n, "Cannot posix_spawn `%s', %s",
 1259|     14|		    compr[method].argv[0], strerror(status));
 1260|     14|	}
 1261|       |#else
 1262|       |	/* For processes with large mapped virtual sizes, vfork
 1263|       |	 * may be _much_ faster (10-100 times) than fork.
 1264|       |	 */
 1265|       |	pid = vfork();
 1266|       |	if (pid == -1) {
 1267|       |		return makeerror(newch, n, "Cannot vfork, %s",
 1268|       |		    strerror(errno));
 1269|       |	}
 1270|       |	if (pid == 0) {
 1271|       |		/* child */
 1272|       |		/* Note: we are after vfork, do not modify memory
 1273|       |		 * in a way which confuses parent. In particular,
 1274|       |		 * do not modify fdp[i][j].
 1275|       |		 */
 1276|       |		handledesc(NULL, fd, fdp);
 1277|       |		DPRINTF("Executing %s\n", compr[method].argv[0]);
 1278|       |
 1279|       |		(void)execvp(compr[method].argv[0], args);
 1280|       |		dprintf(STDERR_FILENO, "exec `%s' failed, %s",
 1281|       |		    compr[method].argv[0], strerror(errno));
 1282|       |		_exit(EXIT_FAILURE); /* _exit(), not exit(), because of vfork */
 1283|       |	}
 1284|       |#endif
 1285|       |	/* parent */
 1286|       |	/* Close write sides of child stdout/err pipes */
 1287|  10.5k|	for (i = 1; i < __arraycount(fdp); i++)
  ------------------
  |  |  138|  10.5k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (1287:14): [True: 7.04k, False: 3.52k]
  ------------------
 1288|  7.04k|		closefd(fdp[i], 1);
 1289|       |	/* Write the buffer data to child stdin, if we don't have fd */
 1290|  3.52k|	if (fd == -1) {
  ------------------
  |  Branch (1290:6): [True: 0, False: 3.52k]
  ------------------
 1291|      0|		closefd(fdp[STDIN_FILENO], 0);
 1292|      0|		writepid = writechild(fdp[STDIN_FILENO][1], old, *n);
 1293|      0|		if (writepid == (pid_t)-1) {
  ------------------
  |  Branch (1293:7): [True: 0, False: 0]
  ------------------
 1294|      0|			rv = makeerror(newch, n, "Write to child failed, %s",
 1295|      0|			    strerror(errno));
 1296|      0|			DPRINTF("Write to child failed\n");
 1297|      0|			goto err;
 1298|      0|		}
 1299|      0|		closefd(fdp[STDIN_FILENO], 1);
 1300|      0|	}
 1301|       |
 1302|  3.52k|	rv = OKDATA;
  ------------------
  |  |  242|  3.52k|#define OKDATA 	0
  ------------------
 1303|  3.52k|	r = sread(fdp[STDOUT_FILENO][0], *newch, bytes_max, 0);
 1304|  3.52k|	DPRINTF("read got %zd\n", r);
 1305|  3.52k|	if (r < 0) {
  ------------------
  |  Branch (1305:6): [True: 0, False: 3.52k]
  ------------------
 1306|      0|		rv = ERRDATA;
  ------------------
  |  |  244|      0|#define ERRDATA	2
  ------------------
 1307|      0|		DPRINTF("Read stdout failed %d (%s)\n", fdp[STDOUT_FILENO][0],
 1308|      0|		        strerror(errno));
 1309|      0|		goto err;
 1310|      0|	} 
 1311|  3.52k|	if (CAST(size_t, r) == bytes_max) {
  ------------------
  |  |  460|  3.52k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1311:6): [True: 136, False: 3.38k]
  ------------------
 1312|       |		/*
 1313|       |		 * close fd so that the child exits with sigpipe and ignore
 1314|       |		 * errors, otherwise we risk the child blocking and never
 1315|       |		 * exiting.
 1316|       |		 */
 1317|    136|		DPRINTF("Closing stdout for bytes_max\n");
 1318|    136|		closefd(fdp[STDOUT_FILENO], 0);
 1319|    136|		goto ok;
 1320|    136|	}
 1321|  3.38k|	if ((re = sread(fdp[STDERR_FILENO][0], *newch, bytes_max, 0)) > 0) {
  ------------------
  |  Branch (1321:6): [True: 138, False: 3.24k]
  ------------------
 1322|    138|		DPRINTF("Got stuff from stderr %s\n", *newch);
 1323|    138|		rv = ERRDATA;
  ------------------
  |  |  244|    138|#define ERRDATA	2
  ------------------
 1324|    138|		r = filter_error(*newch, r);
 1325|    138|		goto ok;
 1326|    138|	}
 1327|  3.24k|	if  (re == 0)
  ------------------
  |  Branch (1327:7): [True: 3.24k, False: 0]
  ------------------
 1328|  3.24k|		goto ok;
 1329|      0|	rv = makeerror(newch, n, "Read stderr failed, %s",
 1330|      0|	    strerror(errno));
 1331|      0|	goto err;
 1332|  3.52k|ok:
 1333|  3.52k|	*n = r;
 1334|       |	/* NUL terminate, as every buffer is handled here. */
 1335|  3.52k|	(*newch)[*n] = '\0';
 1336|  3.52k|err:
 1337|  3.52k|	closefd(fdp[STDIN_FILENO], 1);
 1338|  3.52k|	closefd(fdp[STDOUT_FILENO], 0);
 1339|  3.52k|	closefd(fdp[STDERR_FILENO], 0);
 1340|       |
 1341|  3.52k|	w = waitpid(pid, &status, 0);
 1342|  3.52k|wait_err:
 1343|  3.52k|	if (w == -1) {
  ------------------
  |  Branch (1343:6): [True: 0, False: 3.52k]
  ------------------
 1344|      0|		rv = makeerror(newch, n, "Wait failed, %s", strerror(errno));
 1345|      0|		DPRINTF("Child wait return %#x\n", status);
 1346|  3.52k|	} else if (!WIFEXITED(status)) {
  ------------------
  |  Branch (1346:13): [True: 0, False: 3.52k]
  ------------------
 1347|      0|		DPRINTF("Child not exited (%#x)\n", status);
 1348|  3.52k|	} else if (WEXITSTATUS(status) != 0) {
  ------------------
  |  Branch (1348:13): [True: 274, False: 3.24k]
  ------------------
 1349|    274|		DPRINTF("Child exited (%#x)\n", WEXITSTATUS(status));
 1350|    274|	}
 1351|  3.52k|	if (writepid > 0) {
  ------------------
  |  Branch (1351:6): [True: 0, False: 3.52k]
  ------------------
 1352|       |		/* _After_ we know decompressor has exited, our input writer
 1353|       |		 * definitely will exit now (at worst, writing fails in it,
 1354|       |		 * since output fd is closed now on the reading size).
 1355|       |		 */
 1356|      0|		w = waitpid(writepid, &status, 0);
 1357|      0|		writepid = -1;
 1358|      0|		goto wait_err;
 1359|      0|	}
 1360|       |
 1361|  3.52k|	closefd(fdp[STDIN_FILENO], 0); //why? it is already closed here!
 1362|  3.52k|	DPRINTF("Returning %p n=%" SIZE_T_FORMAT "u rv=%d\n", *newch, *n, rv);
 1363|       |
 1364|  3.52k|	return rv;
 1365|  3.52k|}
compress.c:getdecompressor:
 1149|  3.60k|{
 1150|  3.60k|	switch (method) {
 1151|      0|#ifdef BUILTIN_DECOMPRESS
 1152|     28|	case METH_FROZEN:
  ------------------
  |  |  210|     28|#define METH_FROZEN	2
  ------------------
  |  Branch (1152:2): [True: 28, False: 3.57k]
  ------------------
 1153|     28|		return uncompressgzipped;
 1154|     23|	case METH_ZLIB:
  ------------------
  |  |  218|     23|#define METH_ZLIB	14
  ------------------
  |  Branch (1154:2): [True: 23, False: 3.58k]
  ------------------
 1155|     23|		return uncompresszlib;
 1156|      0|#endif
 1157|      0|#ifdef BUILTIN_BZLIB
 1158|      5|	case METH_BZIP:
  ------------------
  |  |  211|      5|#define METH_BZIP	7
  ------------------
  |  Branch (1158:2): [True: 5, False: 3.59k]
  ------------------
 1159|      5|		return uncompressbzlib;
 1160|      0|#endif
 1161|      0|#ifdef BUILTIN_XZLIB
 1162|      1|	case METH_XZ:
  ------------------
  |  |  212|      1|#define METH_XZ		9
  ------------------
  |  Branch (1162:2): [True: 1, False: 3.60k]
  ------------------
 1163|      3|	case METH_LZMA:
  ------------------
  |  |  217|      3|#define METH_LZMA	13
  ------------------
  |  Branch (1163:2): [True: 2, False: 3.60k]
  ------------------
 1164|      3|		return uncompressxzlib;
 1165|      0|#endif
 1166|      0|#ifdef BUILTIN_ZSTDLIB
 1167|      6|	case METH_ZSTD:
  ------------------
  |  |  216|      6|#define METH_ZSTD	12
  ------------------
  |  Branch (1167:2): [True: 6, False: 3.59k]
  ------------------
 1168|      6|		return uncompresszstd;
 1169|      0|#endif
 1170|       |#ifdef BUILTIN_LZLIB
 1171|       |	case METH_LZIP:
 1172|       |		return uncompresslzlib;
 1173|       |#endif
 1174|       |#ifdef BUILTIN_LRZIP
 1175|       |	case METH_LRZIP:
 1176|       |		return uncompresslrzip;
 1177|       |#endif
 1178|      0|#ifdef BUILTIN_LZ4LIB
 1179|      2|	case METH_LZ4:
  ------------------
  |  |  215|      2|#define	METH_LZ4	11
  ------------------
  |  Branch (1179:2): [True: 2, False: 3.60k]
  ------------------
 1180|      2|		return uncompresslz4;
 1181|      0|#endif
 1182|  3.53k|	default:
  ------------------
  |  Branch (1182:2): [True: 3.53k, False: 67]
  ------------------
 1183|       |		return NULL;
 1184|  3.60k|	}
 1185|  3.60k|}
compress.c:makeerror:
  962|     81|{
  963|     81|	char *msg;
  964|     81|	va_list ap;
  965|     81|	int rv;
  966|       |
  967|     81|	DPRINTF("Makeerror %s\n", fmt);
  968|     81|	free(*buf);
  969|     81|	va_start(ap, fmt);
  970|     81|	rv = vasprintf(&msg, fmt, ap);
  971|     81|	va_end(ap);
  972|     81|	if (rv < 0) {
  ------------------
  |  Branch (972:6): [True: 0, False: 81]
  ------------------
  973|      0|		DPRINTF("Makeerror failed");
  974|      0|		*buf = NULL;
  975|      0|		*len = 0;
  976|      0|		return NODATA;
  ------------------
  |  |  243|      0|#define NODATA	1
  ------------------
  977|      0|	}
  978|     81|	*buf = RCAST(unsigned char *, msg);
  ------------------
  |  |  461|     81|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  979|     81|	*len = strlen(msg);
  980|     81|	return ERRDATA;
  ------------------
  |  |  244|     81|#define ERRDATA	2
  ------------------
  981|     81|}
compress.c:handledesc:
 1031|  3.53k|{
 1032|  3.53k|	if (fd != -1) {
  ------------------
  |  Branch (1032:6): [True: 3.53k, False: 0]
  ------------------
 1033|  3.53k|		(void) lseek(fd, CAST(off_t, 0), SEEK_SET);
  ------------------
  |  |  460|  3.53k|#define CAST(T, b)	((T)(b))
  ------------------
 1034|  3.53k|		movedesc(v, STDIN_FILENO, fd);
 1035|  3.53k|	} else {
 1036|      0|		movedesc(v, STDIN_FILENO, fdp[STDIN_FILENO][0]);
 1037|      0|		if (fdp[STDIN_FILENO][1] > 2)
  ------------------
  |  Branch (1037:7): [True: 0, False: 0]
  ------------------
 1038|      0|		    closedesc(v, fdp[STDIN_FILENO][1]);
 1039|      0|	}
 1040|       |
 1041|  3.53k|	file_clear_closexec(STDIN_FILENO);
 1042|       |
 1043|       |///FIXME: if one of the fdp[i][j] is 0 or 1, this can bomb spectacularly
 1044|  3.53k|	movedesc(v, STDOUT_FILENO, fdp[STDOUT_FILENO][1]);
 1045|  3.53k|	if (fdp[STDOUT_FILENO][0] > 2)
  ------------------
  |  Branch (1045:6): [True: 3.53k, False: 0]
  ------------------
 1046|  3.53k|		closedesc(v, fdp[STDOUT_FILENO][0]);
 1047|       |
 1048|  3.53k|	file_clear_closexec(STDOUT_FILENO);
 1049|       |
 1050|  3.53k|	movedesc(v, STDERR_FILENO, fdp[STDERR_FILENO][1]);
 1051|  3.53k|	if (fdp[STDERR_FILENO][0] > 2)
  ------------------
  |  Branch (1051:6): [True: 3.53k, False: 0]
  ------------------
 1052|  3.53k|		closedesc(v, fdp[STDERR_FILENO][0]);
 1053|       |
 1054|       |	file_clear_closexec(STDERR_FILENO);
 1055|  3.53k|}
compress.c:movedesc:
 1002|  10.6k|{
 1003|  10.6k|	if (fd == i)
  ------------------
  |  Branch (1003:6): [True: 0, False: 10.6k]
  ------------------
 1004|      0|		return; /* "no dup was necessary" */
 1005|  10.6k|#ifdef HAVE_POSIX_SPAWNP
 1006|  10.6k|	posix_spawn_file_actions_t *fa = RCAST(posix_spawn_file_actions_t *, v);
  ------------------
  |  |  461|  10.6k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1007|  10.6k|	posix_spawn_file_actions_adddup2(fa, fd, i);
 1008|  10.6k|	posix_spawn_file_actions_addclose(fa, fd);
 1009|       |#else
 1010|       |	if (dup2(fd, i) == -1) {
 1011|       |		DPRINTF("dup(%d, %d) failed (%s)\n", fd, i, strerror(errno));
 1012|       |		exit(EXIT_FAILURE);
 1013|       |	}
 1014|       |	close(v ? fd : fd);
 1015|       |#endif
 1016|  10.6k|}
compress.c:closedesc:
 1020|  7.07k|{
 1021|  7.07k|#ifdef HAVE_POSIX_SPAWNP
 1022|  7.07k|	posix_spawn_file_actions_t *fa = RCAST(posix_spawn_file_actions_t *, v);
  ------------------
  |  |  461|  7.07k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1023|  7.07k|	posix_spawn_file_actions_addclose(fa, fd);
 1024|       |#else
 1025|       |	close(v ? fd : fd);
 1026|       |#endif
 1027|  7.07k|}
compress.c:closefd:
  985|  21.2k|{
  986|  21.2k|	if (fd[i] == -1)
  ------------------
  |  Branch (986:6): [True: 7.18k, False: 14.0k]
  ------------------
  987|  7.18k|		return;
  988|  14.0k|	(void) close(fd[i]);
  989|  14.0k|	fd[i] = -1;
  990|  14.0k|}
compress.c:filter_error:
 1085|    138|{
 1086|    138|	char *p;
 1087|    138|	char *buf;
 1088|       |
 1089|    138|	ubuf[n] = '\0';
 1090|    138|	buf = RCAST(char *, ubuf);
  ------------------
  |  |  461|    138|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1091|    138|	while (isspace(CAST(unsigned char, *buf)))
  ------------------
  |  Branch (1091:9): [True: 32, False: 138]
  ------------------
 1092|     32|		buf++;
 1093|    138|	DPRINTF("Filter error[[[%s]]]\n", buf);
 1094|    138|	if ((p = strchr(CAST(char *, buf), '\n')) != NULL)
  ------------------
  |  |  460|    138|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1094:6): [True: 9, False: 129]
  ------------------
 1095|      9|		*p = '\0';
 1096|    138|	if ((p = strchr(CAST(char *, buf), ';')) != NULL)
  ------------------
  |  |  460|    138|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1096:6): [True: 0, False: 138]
  ------------------
 1097|      0|		*p = '\0';
 1098|    138|	if ((p = strrchr(CAST(char *, buf), ':')) != NULL) {
  ------------------
  |  |  460|    138|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1098:6): [True: 20, False: 118]
  ------------------
 1099|     20|		++p;
 1100|     20|		while (isspace(CAST(unsigned char, *p)))
  ------------------
  |  Branch (1100:10): [True: 16, False: 20]
  ------------------
 1101|     16|			p++;
 1102|     20|		n = strlen(p);
 1103|     20|		memmove(ubuf, p, CAST(size_t, n + 1));
  ------------------
  |  |  460|     20|#define CAST(T, b)	((T)(b))
  ------------------
 1104|     20|	}
 1105|    138|	DPRINTF("Filter error after[[[%s]]]\n", (char *)ubuf);
 1106|    138|	if (islower(*ubuf))
  ------------------
  |  Branch (1106:6): [True: 15, False: 123]
  ------------------
 1107|     15|		*ubuf = toupper(*ubuf);
  ------------------
  |  Branch (1107:11): [True: 0, False: 0]
  |  Branch (1107:11): [True: 0, False: 0]
  |  Branch (1107:11): [Folded, False: 15]
  ------------------
 1108|    138|	return n;
 1109|    138|}

der_offs:
  265|  33.5k|{
  266|  33.5k|	const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
  ------------------
  |  |  461|  33.5k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  267|  33.5k|	size_t offs = 0, len = ms->search.s_len ? ms->search.s_len : nbytes;
  ------------------
  |  Branch (267:25): [True: 33.5k, False: 0]
  ------------------
  268|       |
  269|  33.5k|	if (gettag(b, &offs, len) == DER_BAD) {
  ------------------
  |  |   62|  33.5k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  33.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (269:6): [True: 0, False: 33.5k]
  ------------------
  270|      0|		DPRINTF(("%s: bad tag 1\n", __func__));
  271|      0|		return -1;
  272|      0|	}
  273|  33.5k|	DPRINTF(("%s1: %u %" SIZE_T_FORMAT "u %d\n", __func__, ms->offset,
  274|  33.5k|	    offs, m->offset));
  275|       |
  276|  33.5k|	uint32_t tlen = getlength(b, &offs, len);
  277|  33.5k|	if (tlen == DER_BAD) {
  ------------------
  |  |   62|  33.5k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  33.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (277:6): [True: 0, False: 33.5k]
  ------------------
  278|      0|		DPRINTF(("%s: bad tag 2\n", __func__));
  279|      0|		return -1;
  280|      0|	}
  281|  33.5k|	DPRINTF(("%s2: %u %" SIZE_T_FORMAT "u %u\n", __func__, ms->offset,
  282|  33.5k|	    offs, tlen));
  283|       |
  284|  33.5k|	offs += ms->offset + m->offset;
  285|  33.5k|	DPRINTF(("cont_level = %d\n", m->cont_level));
  286|       |#ifdef DEBUG_DER
  287|       |	size_t i;
  288|       |	for (i = 0; i < m->cont_level; i++)
  289|       |		printf("cont_level[%" SIZE_T_FORMAT "u] = %d\n", i,
  290|       |		    ms->c.li[i].off);
  291|       |#endif
  292|  33.5k|	if (m->cont_level != 0) {
  ------------------
  |  Branch (292:6): [True: 3.48k, False: 30.1k]
  ------------------
  293|  3.48k|		if (offs + tlen > nbytes)
  ------------------
  |  Branch (293:7): [True: 0, False: 3.48k]
  ------------------
  294|      0|			return -1;
  295|  3.48k|		ms->c.li[m->cont_level - 1].off = CAST(int, offs + tlen);
  ------------------
  |  |  460|  3.48k|#define CAST(T, b)	((T)(b))
  ------------------
  296|  3.48k|		DPRINTF(("cont_level[%u] = %d\n", m->cont_level - 1,
  297|  3.48k|		    ms->c.li[m->cont_level - 1].off));
  298|  3.48k|	}
  299|  33.5k|	return CAST(int32_t, offs);
  ------------------
  |  |  460|  33.5k|#define CAST(T, b)	((T)(b))
  ------------------
  300|  33.5k|}
der_cmp:
  304|   443k|{
  305|   443k|	const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
  ------------------
  |  |  461|   443k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  306|   443k|	const char *s = m->value.s;
  307|   443k|	size_t offs = 0, len = ms->search.s_len;
  308|   443k|	uint32_t tag, tlen;
  309|   443k|	char buf[128];
  310|       |
  311|   443k|	DPRINTF(("%s: compare %zu bytes\n", __func__, len));
  312|       |
  313|   443k|	tag = gettag(b, &offs, len);
  314|   443k|	if (tag == DER_BAD) {
  ------------------
  |  |   62|   443k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|   443k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (314:6): [True: 12.3k, False: 431k]
  ------------------
  315|  12.3k|		DPRINTF(("%s: bad tag 1\n", __func__));
  316|  12.3k|		return -1;
  317|  12.3k|	}
  318|       |
  319|   431k|	DPRINTF(("%s1: %d %" SIZE_T_FORMAT "u %d\n", __func__, ms->offset,
  320|   431k|	    offs, m->offset));
  321|       |
  322|   431k|	tlen = getlength(b, &offs, len);
  323|   431k|	if (tlen == DER_BAD) {
  ------------------
  |  |   62|   431k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|   431k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (323:6): [True: 141k, False: 289k]
  ------------------
  324|   141k|		DPRINTF(("%s: bad tag 2\n", __func__));
  325|   141k|		return -1;
  326|   141k|	}
  327|       |
  328|   289k|	der_tag(buf, sizeof(buf), tag);
  329|   289k|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   289k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (329:6): [True: 0, False: 289k]
  ------------------
  330|      0|		fprintf(stderr, "%s: tag %p got=%s exp=%s\n", __func__, b,
  331|      0|		    buf, s);
  332|   289k|	size_t slen = strlen(buf);
  333|       |
  334|   289k|	if (strncmp(buf, s, slen) != 0) {
  ------------------
  |  Branch (334:6): [True: 253k, False: 36.4k]
  ------------------
  335|   253k|		DPRINTF(("%s: no string match %s != %s\n", __func__, buf, s));
  336|   253k|		return 0;
  337|   253k|	}
  338|       |
  339|  36.4k|	s += slen;
  340|       |
  341|  37.7k|again:
  342|  37.7k|	switch (*s) {
  343|  32.9k|	case '\0':
  ------------------
  |  Branch (343:2): [True: 32.9k, False: 4.76k]
  ------------------
  344|  32.9k|		DPRINTF(("%s: EOF match\n", __func__));
  345|  32.9k|		return 1;
  346|  1.45k|	case '=':
  ------------------
  |  Branch (346:2): [True: 1.45k, False: 36.3k]
  ------------------
  347|  1.45k|		s++;
  348|  1.45k|		goto val;
  349|  3.31k|	default:
  ------------------
  |  Branch (349:2): [True: 3.31k, False: 34.4k]
  ------------------
  350|  3.31k|		if (!isdigit(CAST(unsigned char, *s))) {
  ------------------
  |  Branch (350:7): [True: 0, False: 3.31k]
  ------------------
  351|      0|			DPRINTF(("%s: no digit %c\n", __func__, *s));
  352|      0|			return 0;
  353|      0|		}
  354|       |
  355|  3.31k|		slen = 0;
  356|  3.31k|		do
  357|  4.86k|			slen = slen * 10 + *s - '0';
  358|  3.31k|		while (isdigit(CAST(unsigned char, *++s)));
  ------------------
  |  Branch (358:10): [True: 1.55k, False: 3.31k]
  ------------------
  359|  3.31k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  3.31k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (359:7): [True: 0, False: 3.31k]
  ------------------
  360|      0|			fprintf(stderr, "%s: len %" SIZE_T_FORMAT "u %u\n",
  361|      0|			    __func__, slen, tlen);
  362|  3.31k|		if (tlen != slen) {
  ------------------
  |  Branch (362:7): [True: 1.99k, False: 1.32k]
  ------------------
  363|  1.99k|			DPRINTF(("%s: len %u != %zu\n", __func__, tlen, slen));
  364|  1.99k|			return 0;
  365|  1.99k|		}
  366|  1.32k|		goto again;
  367|  37.7k|	}
  368|  1.45k|val:
  369|  1.45k|	DPRINTF(("%s: before data %" SIZE_T_FORMAT "u %u\n", __func__, offs,
  370|  1.45k|	    tlen));
  371|  1.45k|	der_data(buf, sizeof(buf), tag, b + offs, tlen);
  372|  1.45k|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  1.45k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (372:6): [True: 0, False: 1.45k]
  ------------------
  373|      0|		fprintf(stderr, "%s: data %s %s\n", __func__, buf, s);
  374|  1.45k|	if (strcmp(buf, s) != 0 && strcmp("x", s) != 0) {
  ------------------
  |  Branch (374:6): [True: 1.04k, False: 407]
  |  Branch (374:29): [True: 850, False: 196]
  ------------------
  375|    850|		DPRINTF(("%s: no string match %s != %s\n", __func__, buf, s));
  376|    850|		return 0;
  377|    850|	}
  378|    603|	strlcpy(ms->ms_value.s, buf, sizeof(ms->ms_value.s));
  379|    603|	DPRINTF(("%s: complete match\n", __func__));
  380|    603|	return 1;
  381|  1.45k|}
der.c:gettag:
  150|   476k|{
  151|   476k|	uint32_t tag;
  152|       |
  153|   476k|	if (c == NULL || *p >= l)
  ------------------
  |  Branch (153:6): [True: 0, False: 476k]
  |  Branch (153:19): [True: 2.85k, False: 474k]
  ------------------
  154|  2.85k|		return DER_BAD;
  ------------------
  |  |   62|  2.85k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  2.85k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  155|       |
  156|   474k|	tag = c[(*p)++] & 0x1f;
  157|       |
  158|   474k|	if (tag != 0x1f)
  ------------------
  |  Branch (158:6): [True: 285k, False: 188k]
  ------------------
  159|   285k|		return tag;
  160|       |
  161|   188k|	if (*p >= l)
  ------------------
  |  Branch (161:6): [True: 1.11k, False: 187k]
  ------------------
  162|  1.11k|		return DER_BAD;
  ------------------
  |  |   62|  1.11k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  1.11k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  163|       |
  164|  2.57G|	while (c[*p] >= 0x80) {
  ------------------
  |  Branch (164:9): [True: 2.57G, False: 183k]
  ------------------
  165|  2.57G|		tag = tag * 128 + c[(*p)++] - 0x80;
  166|  2.57G|		if (*p >= l)
  ------------------
  |  Branch (166:7): [True: 3.29k, False: 2.57G]
  ------------------
  167|  3.29k|			return DER_BAD;
  ------------------
  |  |   62|  3.29k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  3.29k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  168|  2.57G|	}
  169|   183k|	return tag;
  170|   187k|}
der.c:getlength:
  183|   464k|{
  184|   464k|	uint8_t digits, i;
  185|   464k|	size_t len;
  186|   464k|	int is_onebyte_result;
  187|       |
  188|   464k|	if (*p >= l) {
  ------------------
  |  Branch (188:6): [True: 4.52k, False: 460k]
  ------------------
  189|  4.52k|		DPRINTF(("%s:[1] %zu >= %zu\n", __func__, *p, l));
  190|  4.52k|		return DER_BAD;
  ------------------
  |  |   62|  4.52k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  4.52k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  191|  4.52k|	}
  192|       |
  193|       |	/*
  194|       |	 * Digits can either be 0b0 followed by the result, or 0b1
  195|       |	 * followed by the number of digits of the result. In either case,
  196|       |	 * we verify that we can read so many bytes from the input.
  197|       |	 */
  198|   460k|	is_onebyte_result = (c[*p] & 0x80) == 0;
  199|   460k|	digits = c[(*p)++] & 0x7f;
  200|   460k|	if (*p + digits >= l) {
  ------------------
  |  Branch (200:6): [True: 122k, False: 337k]
  ------------------
  201|   122k|		DPRINTF(("%s:[2] %zu + %u >= %zu\n", __func__, *p, digits, l));
  202|   122k|		return DER_BAD;
  ------------------
  |  |   62|   122k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|   122k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  203|   122k|	}
  204|       |
  205|   337k|	if (is_onebyte_result)
  ------------------
  |  Branch (205:6): [True: 270k, False: 66.9k]
  ------------------
  206|   270k|		return digits;
  207|       |
  208|       |	/*
  209|       |	 * Decode len. We've already verified that we're allowed to read
  210|       |	 * `digits` bytes.
  211|       |	 */
  212|  66.9k|	len = 0;
  213|  4.67M|	for (i = 0; i < digits; i++)
  ------------------
  |  Branch (213:14): [True: 4.60M, False: 66.9k]
  ------------------
  214|  4.60M|		len = (len << 8) | c[(*p)++];
  215|       |
  216|  66.9k|	if (len > UINT32_MAX - *p || *p + len > l) {
  ------------------
  |  Branch (216:6): [True: 12.0k, False: 54.9k]
  |  Branch (216:31): [True: 2.19k, False: 52.7k]
  ------------------
  217|  14.2k|		DPRINTF(("%s:[3] bad len %zu + %zu >= %zu\n",
  218|  14.2k|		    __func__, *p, len, l));
  219|  14.2k|		return DER_BAD;
  ------------------
  |  |   62|  14.2k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  14.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  220|  14.2k|	}
  221|  52.7k|	return CAST(uint32_t, len);
  ------------------
  |  |  460|  52.7k|#define CAST(T, b)	((T)(b))
  ------------------
  222|  66.9k|}
der.c:der_tag:
  226|   289k|{
  227|   289k|	if (tag < DER_TAG_LAST)
  ------------------
  |  |  115|   289k|#define	DER_TAG_LAST			0x25
  ------------------
  |  Branch (227:6): [True: 195k, False: 94.7k]
  ------------------
  228|   195k|		strlcpy(buf, der__tag[tag], len);
  229|  94.7k|	else
  230|  94.7k|		snprintf(buf, len, "%#x", tag);
  231|   289k|	return buf;
  232|   289k|}
der.c:der_data:
  237|  1.45k|{
  238|  1.45k|	uint32_t i;
  239|  1.45k|	const uint8_t *d = CAST(const uint8_t *, q);
  ------------------
  |  |  460|  1.45k|#define CAST(T, b)	((T)(b))
  ------------------
  240|  1.45k|	switch (tag) {
  241|     66|	case DER_TAG_PRINTABLE_STRING:
  ------------------
  |  |   97|     66|#define	DER_TAG_PRINTABLE_STRING	0x13
  ------------------
  |  Branch (241:2): [True: 66, False: 1.38k]
  ------------------
  242|    132|	case DER_TAG_UTF8_STRING:
  ------------------
  |  |   90|    132|#define	DER_TAG_UTF8_STRING		0x0c
  ------------------
  |  Branch (242:2): [True: 66, False: 1.38k]
  ------------------
  243|    132|	case DER_TAG_IA5_STRING:
  ------------------
  |  |  100|    132|#define	DER_TAG_IA5_STRING		0x16
  ------------------
  |  Branch (243:2): [True: 0, False: 1.45k]
  ------------------
  244|    132|		return snprintf(buf, blen, "%.*s", len, RCAST(const char *, q));
  ------------------
  |  |  461|    132|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  245|      0|	case DER_TAG_UTCTIME:
  ------------------
  |  |  101|      0|#define	DER_TAG_UTCTIME			0x17
  ------------------
  |  Branch (245:2): [True: 0, False: 1.45k]
  ------------------
  246|      0|		if (len < 12)
  ------------------
  |  Branch (246:7): [True: 0, False: 0]
  ------------------
  247|      0|			break;
  248|      0|		return snprintf(buf, blen,
  249|      0|		    "20%c%c-%c%c-%c%c %c%c:%c%c:%c%c GMT", d[0], d[1], d[2],
  250|      0|		    d[3], d[4], d[5], d[6], d[7], d[8], d[9], d[10], d[11]);
  251|  1.32k|	default:
  ------------------
  |  Branch (251:2): [True: 1.32k, False: 132]
  ------------------
  252|  1.32k|		break;
  253|  1.45k|	}
  254|       |
  255|  4.96k|	for (i = 0; i < len; i++) {
  ------------------
  |  Branch (255:14): [True: 3.64k, False: 1.32k]
  ------------------
  256|  3.64k|		uint32_t z = i << 1;
  257|  3.64k|		if (z < blen - 2)
  ------------------
  |  Branch (257:7): [True: 3.41k, False: 228]
  ------------------
  258|  3.41k|			snprintf(buf + z, blen - z, "%.2x", d[i]);
  259|  3.64k|	}
  260|  1.32k|	return len * 2;
  261|  1.45k|}

file_encoding:
   78|  36.0k|{
   79|  36.0k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  36.0k|#define CAST(T, b)	((T)(b))
  ------------------
   80|  36.0k|	size_t nbytes = b->flen;
   81|  36.0k|	size_t mlen;
   82|  36.0k|	int rv = 1, ucs_type;
   83|  36.0k|	file_unichar_t *udefbuf;
   84|  36.0k|	size_t udeflen;
   85|       |
   86|  36.0k|	if (buf == NULL)
  ------------------
  |  Branch (86:6): [True: 0, False: 36.0k]
  ------------------
   87|      0|		return 0;
   88|  36.0k|	if (ubuf == NULL)
  ------------------
  |  Branch (88:6): [True: 19.6k, False: 16.3k]
  ------------------
   89|  19.6k|		ubuf = &udefbuf;
   90|  36.0k|	if (ulen == NULL)
  ------------------
  |  Branch (90:6): [True: 19.6k, False: 16.3k]
  ------------------
   91|  19.6k|		ulen = &udeflen;
   92|       |
   93|  36.0k|	*type = "text";
   94|  36.0k|	*ulen = 0;
   95|  36.0k|	*code = "unknown";
   96|  36.0k|	*code_mime = "binary";
   97|       |
   98|  36.0k|	if (nbytes > ms->encoding_max)
  ------------------
  |  Branch (98:6): [True: 1.15k, False: 34.8k]
  ------------------
   99|  1.15k|		nbytes = ms->encoding_max;
  100|       |
  101|  36.0k|	mlen = (nbytes + 1) * sizeof((*ubuf)[0]);
  102|  36.0k|	*ubuf = CAST(file_unichar_t *, calloc(CAST(size_t, 1), mlen));
  ------------------
  |  |  460|  36.0k|#define CAST(T, b)	((T)(b))
  ------------------
  103|  36.0k|	if (*ubuf == NULL) {
  ------------------
  |  Branch (103:6): [True: 0, False: 36.0k]
  ------------------
  104|      0|		file_oomem(ms, mlen);
  105|      0|		goto done;
  106|      0|	}
  107|  36.0k|	if (looks_ascii(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (107:6): [True: 2.18k, False: 33.8k]
  ------------------
  108|  2.18k|		if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) {
  ------------------
  |  Branch (108:7): [True: 14, False: 2.17k]
  ------------------
  109|     14|			DPRINTF(("utf-7 %" SIZE_T_FORMAT "u\n", *ulen));
  110|     14|			*code = "Unicode text, UTF-7";
  111|     14|			*code_mime = "utf-7";
  112|  2.17k|		} else {
  113|  2.17k|			DPRINTF(("ascii %" SIZE_T_FORMAT "u\n", *ulen));
  114|  2.17k|			*code = "ASCII";
  115|  2.17k|			*code_mime = "us-ascii";
  116|  2.17k|		}
  117|  33.8k|	} else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) {
  ------------------
  |  Branch (117:13): [True: 9, False: 33.8k]
  ------------------
  118|      9|		DPRINTF(("utf8/bom %" SIZE_T_FORMAT "u\n", *ulen));
  119|      9|		*code = "Unicode text, UTF-8 (with BOM)";
  120|      9|		*code_mime = "utf-8";
  121|  33.8k|	} else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) {
  ------------------
  |  Branch (121:13): [True: 176, False: 33.6k]
  ------------------
  122|    176|		DPRINTF(("utf8 %" SIZE_T_FORMAT "u\n", *ulen));
  123|    176|		*code = "Unicode text, UTF-8";
  124|    176|		*code_mime = "utf-8";
  125|  33.6k|	} else if ((ucs_type = looks_ucs32(buf, nbytes, *ubuf, ulen)) != 0) {
  ------------------
  |  Branch (125:13): [True: 433, False: 33.2k]
  ------------------
  126|    433|		if (ucs_type == 1) {
  ------------------
  |  Branch (126:7): [True: 143, False: 290]
  ------------------
  127|    143|			*code = "Unicode text, UTF-32, little-endian";
  128|    143|			*code_mime = "utf-32le";
  129|    290|		} else {
  130|    290|			*code = "Unicode text, UTF-32, big-endian";
  131|    290|			*code_mime = "utf-32be";
  132|    290|		}
  133|    433|		DPRINTF(("ucs32 %" SIZE_T_FORMAT "u\n", *ulen));
  134|  33.2k|	} else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) {
  ------------------
  |  Branch (134:13): [True: 472, False: 32.7k]
  ------------------
  135|    472|		if (ucs_type == 1) {
  ------------------
  |  Branch (135:7): [True: 271, False: 201]
  ------------------
  136|    271|			*code = "Unicode text, UTF-16, little-endian";
  137|    271|			*code_mime = "utf-16le";
  138|    271|		} else {
  139|    201|			*code = "Unicode text, UTF-16, big-endian";
  140|    201|			*code_mime = "utf-16be";
  141|    201|		}
  142|    472|		DPRINTF(("ucs16 %" SIZE_T_FORMAT "u\n", *ulen));
  143|  32.7k|	} else if (looks_latin1(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (143:13): [True: 1.01k, False: 31.7k]
  ------------------
  144|  1.01k|		DPRINTF(("latin1 %" SIZE_T_FORMAT "u\n", *ulen));
  145|  1.01k|		*code = "ISO-8859";
  146|  1.01k|		*code_mime = "iso-8859-1";
  147|  31.7k|	} else if (looks_extended(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (147:13): [True: 509, False: 31.2k]
  ------------------
  148|    509|		DPRINTF(("extended %" SIZE_T_FORMAT "u\n", *ulen));
  149|    509|		*code = "Non-ISO extended-ASCII";
  150|    509|		*code_mime = "unknown-8bit";
  151|  31.2k|	} else {
  152|  31.2k|		unsigned char *nbuf;
  153|       |
  154|  31.2k|		mlen = (nbytes + 1) * sizeof(nbuf[0]);
  155|  31.2k|		if ((nbuf = CAST(unsigned char *, malloc(mlen))) == NULL) {
  ------------------
  |  |  460|  31.2k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (155:7): [True: 0, False: 31.2k]
  ------------------
  156|      0|			file_oomem(ms, mlen);
  157|      0|			goto done;
  158|      0|		}
  159|  31.2k|		from_ebcdic(buf, nbytes, nbuf);
  160|       |
  161|  31.2k|		if (looks_ascii(nbuf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (161:7): [True: 78, False: 31.1k]
  ------------------
  162|     78|			DPRINTF(("ebcdic %" SIZE_T_FORMAT "u\n", *ulen));
  163|     78|			*code = "EBCDIC";
  164|     78|			*code_mime = "ebcdic";
  165|  31.1k|		} else if (looks_latin1(nbuf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (165:14): [True: 123, False: 31.0k]
  ------------------
  166|    123|			DPRINTF(("ebcdic/international %" SIZE_T_FORMAT "u\n",
  167|    123|			    *ulen));
  168|    123|			*code = "International EBCDIC";
  169|    123|			*code_mime = "ebcdic";
  170|  31.0k|		} else { /* Doesn't look like text at all */
  171|  31.0k|			DPRINTF(("binary\n"));
  172|  31.0k|			rv = 0;
  173|  31.0k|			*type = "binary";
  174|  31.0k|		}
  175|  31.2k|		free(nbuf);
  176|  31.2k|	}
  177|       |
  178|  36.0k| done:
  179|  36.0k|	if (ubuf == &udefbuf)
  ------------------
  |  Branch (179:6): [True: 19.6k, False: 16.3k]
  ------------------
  180|  19.6k|		free(udefbuf);
  181|       |
  182|  36.0k|	return rv;
  183|  36.0k|}
file_looks_utf8:
  358|  33.8k|{
  359|  33.8k|	size_t i;
  360|  33.8k|	int n;
  361|  33.8k|	file_unichar_t c;
  362|  33.8k|	int gotone = 0, ctrl = 0;
  363|       |
  364|  33.8k|	if (ubuf)
  ------------------
  |  Branch (364:6): [True: 33.8k, False: 0]
  ------------------
  365|  33.8k|		*ulen = 0;
  366|       |
  367|  23.8M|	for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (367:14): [True: 23.8M, False: 1.96k]
  ------------------
  368|  23.8M|		if ((buf[i] & 0x80) == 0) {	   /* 0xxxxxxx is plain ASCII */
  ------------------
  |  Branch (368:7): [True: 23.6M, False: 137k]
  ------------------
  369|       |			/*
  370|       |			 * Even if the whole file is valid UTF-8 sequences,
  371|       |			 * still reject it if it uses weird control characters.
  372|       |			 */
  373|       |
  374|  23.6M|			if (text_chars[buf[i]] != T)
  ------------------
  |  |  238|  23.6M|#define T 1   /* character appears in plain ASCII text */
  ------------------
  |  Branch (374:8): [True: 20.8M, False: 2.83M]
  ------------------
  375|  20.8M|				ctrl = 1;
  376|       |
  377|  23.6M|			if (ubuf)
  ------------------
  |  Branch (377:8): [True: 23.6M, False: 0]
  ------------------
  378|  23.6M|				ubuf[(*ulen)++] = buf[i];
  379|  23.6M|		} else if ((buf[i] & 0x40) == 0) { /* 10xxxxxx never 1st byte */
  ------------------
  |  Branch (379:14): [True: 14.4k, False: 122k]
  ------------------
  380|  14.4k|			return -1;
  381|   122k|		} else {			   /* 11xxxxxx begins UTF-8 */
  382|   122k|			int following;
  383|   122k|			uint8_t x = first[buf[i]];
  384|   122k|			const struct accept_range *ar =
  385|   122k|			    &accept_ranges[(unsigned int)x >> 4];
  386|   122k|			if (x == XX)
  ------------------
  |  |  306|   122k|#define	XX 0xF1 // invalid: size 1
  ------------------
  |  Branch (386:8): [True: 6.90k, False: 116k]
  ------------------
  387|  6.90k|				return -1;
  388|       |
  389|   116k|			if ((buf[i] & 0x20) == 0) {		/* 110xxxxx */
  ------------------
  |  Branch (389:8): [True: 98.0k, False: 17.9k]
  ------------------
  390|  98.0k|				c = buf[i] & 0x1f;
  391|  98.0k|				following = 1;
  392|  98.0k|			} else if ((buf[i] & 0x10) == 0) {	/* 1110xxxx */
  ------------------
  |  Branch (392:15): [True: 9.82k, False: 8.10k]
  ------------------
  393|  9.82k|				c = buf[i] & 0x0f;
  394|  9.82k|				following = 2;
  395|  9.82k|			} else if ((buf[i] & 0x08) == 0) {	/* 11110xxx */
  ------------------
  |  Branch (395:15): [True: 8.10k, False: 0]
  ------------------
  396|  8.10k|				c = buf[i] & 0x07;
  397|  8.10k|				following = 3;
  398|  8.10k|			} else if ((buf[i] & 0x04) == 0) {	/* 111110xx */
  ------------------
  |  Branch (398:15): [True: 0, False: 0]
  ------------------
  399|      0|				c = buf[i] & 0x03;
  400|      0|				following = 4;
  401|      0|			} else if ((buf[i] & 0x02) == 0) {	/* 1111110x */
  ------------------
  |  Branch (401:15): [True: 0, False: 0]
  ------------------
  402|      0|				c = buf[i] & 0x01;
  403|      0|				following = 5;
  404|      0|			} else
  405|      0|				return -1;
  406|       |
  407|   241k|			for (n = 0; n < following; n++) {
  ------------------
  |  Branch (407:16): [True: 135k, False: 105k]
  ------------------
  408|   135k|				i++;
  409|   135k|				if (i >= nbytes)
  ------------------
  |  Branch (409:9): [True: 227, False: 135k]
  ------------------
  410|    227|					goto done;
  411|       |
  412|   135k|				if (n == 0 &&
  ------------------
  |  Branch (412:9): [True: 115k, False: 19.9k]
  ------------------
  413|   115k|				     (buf[i] < ar->lo || buf[i] > ar->hi))
  ------------------
  |  Branch (413:11): [True: 4.69k, False: 111k]
  |  Branch (413:30): [True: 5.22k, False: 105k]
  ------------------
  414|  9.92k|					return -1;
  415|       |
  416|   125k|				if ((buf[i] & 0x80) == 0 || (buf[i] & 0x40))
  ------------------
  |  Branch (416:9): [True: 136, False: 125k]
  |  Branch (416:33): [True: 249, False: 125k]
  ------------------
  417|    385|					return -1;
  418|       |
  419|   125k|				c = (c << 6) + (buf[i] & 0x3f);
  420|   125k|			}
  421|       |
  422|   105k|			if (ubuf)
  ------------------
  |  Branch (422:8): [True: 105k, False: 0]
  ------------------
  423|   105k|				ubuf[(*ulen)++] = c;
  424|   105k|			gotone = 1;
  425|   105k|		}
  426|  23.8M|	}
  427|  2.18k|done:
  428|  2.18k|	return ctrl ? 0 : (gotone ? 2 : 1);
  ------------------
  |  Branch (428:9): [True: 1.87k, False: 313]
  |  Branch (428:21): [True: 176, False: 137]
  ------------------
  429|  33.8k|}
encoding.c:looks_ascii:
  271|  67.2k|    size_t *ulen) \
  272|  67.2k|{ \
  273|  67.2k|	size_t i; \
  274|  67.2k|\
  275|  67.2k|	*ulen = 0; \
  276|  67.2k|\
  277|  20.3M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 20.3M, False: 2.26k]
  ------------------
  278|  20.3M|		int t = text_chars[buf[i]]; \
  279|  20.3M|\
  280|  20.3M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 64.9k, False: 20.2M]
  ------------------
  281|  20.3M|			return 0; \
  282|  20.3M|\
  283|  20.3M|		ubuf[(*ulen)++] = buf[i]; \
  284|  20.2M|	} \
  285|  67.2k|	return 1; \
  286|  67.2k|}
encoding.c:looks_latin1:
  271|  63.8k|    size_t *ulen) \
  272|  63.8k|{ \
  273|  63.8k|	size_t i; \
  274|  63.8k|\
  275|  63.8k|	*ulen = 0; \
  276|  63.8k|\
  277|  11.3M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 11.3M, False: 1.13k]
  ------------------
  278|  11.3M|		int t = text_chars[buf[i]]; \
  279|  11.3M|\
  280|  32.8M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 10.0M, False: 1.35M]
  |  Branch (280:7): [True: 62.7k, False: 9.96M]
  ------------------
  281|  11.3M|			return 0; \
  282|  11.3M|\
  283|  11.3M|		ubuf[(*ulen)++] = buf[i]; \
  284|  11.3M|	} \
  285|  63.8k|	return 1; \
  286|  63.8k|}
encoding.c:looks_extended:
  271|  31.7k|    size_t *ulen) \
  272|  31.7k|{ \
  273|  31.7k|	size_t i; \
  274|  31.7k|\
  275|  31.7k|	*ulen = 0; \
  276|  31.7k|\
  277|  2.51M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 2.51M, False: 509]
  ------------------
  278|  2.51M|		int t = text_chars[buf[i]]; \
  279|  2.51M|\
  280|  10.5M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 1.60M, False: 910k]
  |  Branch (280:7): [True: 1.39M, False: 206k]
  |  Branch (280:7): [True: 31.2k, False: 1.36M]
  ------------------
  281|  2.51M|			return 0; \
  282|  2.51M|\
  283|  2.51M|		ubuf[(*ulen)++] = buf[i]; \
  284|  2.48M|	} \
  285|  31.7k|	return 1; \
  286|  31.7k|}
encoding.c:looks_utf8_with_BOM:
  439|  33.8k|{
  440|  33.8k|	if (nbytes > 3 && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf)
  ------------------
  |  Branch (440:6): [True: 32.3k, False: 1.50k]
  |  Branch (440:20): [True: 142, False: 32.1k]
  |  Branch (440:38): [True: 102, False: 40]
  |  Branch (440:56): [True: 75, False: 27]
  ------------------
  441|     75|		return file_looks_utf8(buf + 3, nbytes - 3, ubuf, ulen);
  442|  33.7k|	else
  443|  33.7k|		return -1;
  444|  33.8k|}
encoding.c:looks_utf7:
  449|  2.18k|{
  450|  2.18k|	if (nbytes > 4 && buf[0] == '+' && buf[1] == '/' && buf[2] == 'v')
  ------------------
  |  Branch (450:6): [True: 1.33k, False: 858]
  |  Branch (450:20): [True: 67, False: 1.26k]
  |  Branch (450:37): [True: 42, False: 25]
  |  Branch (450:54): [True: 17, False: 25]
  ------------------
  451|     17|		switch (buf[3]) {
  452|      3|		case '8':
  ------------------
  |  Branch (452:3): [True: 3, False: 14]
  ------------------
  453|      6|		case '9':
  ------------------
  |  Branch (453:3): [True: 3, False: 14]
  ------------------
  454|      9|		case '+':
  ------------------
  |  Branch (454:3): [True: 3, False: 14]
  ------------------
  455|     14|		case '/':
  ------------------
  |  Branch (455:3): [True: 5, False: 12]
  ------------------
  456|     14|			if (ubuf)
  ------------------
  |  Branch (456:8): [True: 14, False: 0]
  ------------------
  457|     14|				*ulen = 0;
  458|     14|			return 1;
  459|      3|		default:
  ------------------
  |  Branch (459:3): [True: 3, False: 14]
  ------------------
  460|      3|			return -1;
  461|     17|		}
  462|  2.17k|	else
  463|  2.17k|		return -1;
  464|  2.18k|}
encoding.c:looks_ucs16:
  475|  33.2k|{
  476|  33.2k|	int bigend;
  477|  33.2k|	uint32_t hi;
  478|  33.2k|	size_t i;
  479|       |
  480|  33.2k|	if (nbytes < 2)
  ------------------
  |  Branch (480:6): [True: 93, False: 33.1k]
  ------------------
  481|     93|		return 0;
  482|       |
  483|  33.1k|	if (bf[0] == 0xff && bf[1] == 0xfe)
  ------------------
  |  Branch (483:6): [True: 2.33k, False: 30.7k]
  |  Branch (483:23): [True: 357, False: 1.98k]
  ------------------
  484|    357|		bigend = 0;
  485|  32.7k|	else if (bf[0] == 0xfe && bf[1] == 0xff)
  ------------------
  |  Branch (485:11): [True: 307, False: 32.4k]
  |  Branch (485:28): [True: 252, False: 55]
  ------------------
  486|    252|		bigend = 1;
  487|  32.5k|	else
  488|  32.5k|		return 0;
  489|       |
  490|    609|	*ulen = 0;
  491|    609|	hi = 0;
  492|       |
  493|  1.96M|	for (i = 2; i + 1 < nbytes; i += 2) {
  ------------------
  |  Branch (493:14): [True: 1.96M, False: 472]
  ------------------
  494|  1.96M|		uint32_t uc;
  495|       |
  496|  1.96M|		if (bigend)
  ------------------
  |  Branch (496:7): [True: 336k, False: 1.62M]
  ------------------
  497|   336k|			uc = CAST(uint32_t,
  ------------------
  |  |  460|   336k|#define CAST(T, b)	((T)(b))
  ------------------
  498|  1.96M|			    bf[i + 1] | (CAST(file_unichar_t, bf[i]) << 8));
  499|  1.62M|		else
  500|  1.62M|			uc = CAST(uint32_t,
  ------------------
  |  |  460|  1.62M|#define CAST(T, b)	((T)(b))
  ------------------
  501|  1.96M|			    bf[i] | (CAST(file_unichar_t, bf[i + 1]) << 8));
  502|       |
  503|  1.96M|		uc &= 0xffff;
  504|       |
  505|  1.96M|		switch (uc) {
  506|      7|		case 0xfffe:
  ------------------
  |  Branch (506:3): [True: 7, False: 1.96M]
  ------------------
  507|     25|		case 0xffff:
  ------------------
  |  Branch (507:3): [True: 18, False: 1.96M]
  ------------------
  508|     25|			return 0;
  509|  1.96M|		default:
  ------------------
  |  Branch (509:3): [True: 1.96M, False: 25]
  ------------------
  510|  1.96M|			if (UCS16_NOCHAR(uc))
  ------------------
  |  |  466|  1.96M|#define UCS16_NOCHAR(c) ((c) >= 0xfdd0 && (c) <= 0xfdef)
  |  |  ------------------
  |  |  |  Branch (466:26): [True: 199k, False: 1.76M]
  |  |  |  Branch (466:43): [True: 13, False: 199k]
  |  |  ------------------
  ------------------
  511|     13|				return 0;
  512|  1.96M|			break;
  513|  1.96M|		}
  514|  1.96M|		if (hi) {
  ------------------
  |  Branch (514:7): [True: 917, False: 1.95M]
  ------------------
  515|    917|			if (!UCS16_LOSURR(uc))
  ------------------
  |  |  468|    917|#define UCS16_LOSURR(c) ((c) >= 0xdc00 && (c) <= 0xdfff)
  |  |  ------------------
  |  |  |  Branch (468:26): [True: 887, False: 30]
  |  |  |  Branch (468:43): [True: 878, False: 9]
  |  |  ------------------
  ------------------
  516|     39|				return 0;
  517|    878|			uc = 0x10000 + 0x400 * (hi - 1) + (uc - 0xdc00);
  518|    878|			hi = 0;
  519|    878|		}
  520|  1.96M|		if (NOTTEXT(uc))
  ------------------
  |  |  470|  1.96M|    ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  460|  1.18M|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |                   ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  238|  3.14M|#define T 1   /* character appears in plain ASCII text */
  |  |  ------------------
  |  |  |  Branch (470:6): [True: 1.18M, False: 772k]
  |  |  |  Branch (470:19): [True: 1.10M, False: 78.3k]
  |  |  |  Branch (470:57): [True: 35, False: 1.10M]
  |  |  ------------------
  ------------------
  521|     35|			return 0;
  522|  1.96M|		ubf[(*ulen)++] = uc;
  523|  1.96M|		if (UCS16_HISURR(uc))
  ------------------
  |  |  467|  1.96M|#define UCS16_HISURR(c) ((c) >= 0xd800 && (c) <= 0xdbff)
  |  |  ------------------
  |  |  |  Branch (467:26): [True: 209k, False: 1.75M]
  |  |  |  Branch (467:43): [True: 956, False: 208k]
  |  |  ------------------
  ------------------
  524|    956|			hi = uc - 0xd800 + 1;
  525|  1.96M|		if (UCS16_LOSURR(uc))
  ------------------
  |  |  468|  1.96M|#define UCS16_LOSURR(c) ((c) >= 0xdc00 && (c) <= 0xdfff)
  |  |  ------------------
  |  |  |  Branch (468:26): [True: 208k, False: 1.75M]
  |  |  |  Branch (468:43): [True: 25, False: 208k]
  |  |  ------------------
  ------------------
  526|     25|			return 0;
  527|  1.96M|	}
  528|       |
  529|    472|	return 1 + bigend;
  530|    609|}
encoding.c:looks_ucs32:
  536|  33.6k|{
  537|  33.6k|	int bigend;
  538|  33.6k|	file_unichar_t uc;
  539|  33.6k|	size_t i;
  540|       |
  541|  33.6k|	if (nbytes < 4)
  ------------------
  |  Branch (541:6): [True: 1.39k, False: 32.2k]
  ------------------
  542|  1.39k|		return 0;
  543|       |
  544|  32.2k|	if (bf[0] == 0xff && bf[1] == 0xfe && bf[2] == 0 && bf[3] == 0)
  ------------------
  |  Branch (544:6): [True: 2.39k, False: 29.8k]
  |  Branch (544:23): [True: 471, False: 1.92k]
  |  Branch (544:40): [True: 243, False: 228]
  |  Branch (544:54): [True: 155, False: 88]
  ------------------
  545|    155|		bigend = 0;
  546|  32.0k|	else if (bf[0] == 0 && bf[1] == 0 && bf[2] == 0xfe && bf[3] == 0xff)
  ------------------
  |  Branch (546:11): [True: 1.42k, False: 30.6k]
  |  Branch (546:25): [True: 802, False: 625]
  |  Branch (546:39): [True: 331, False: 471]
  |  Branch (546:56): [True: 302, False: 29]
  ------------------
  547|    302|		bigend = 1;
  548|  31.7k|	else
  549|  31.7k|		return 0;
  550|       |
  551|    457|	*ulen = 0;
  552|       |
  553|   904k|	for (i = 4; i + 3 < nbytes; i += 4) {
  ------------------
  |  Branch (553:14): [True: 903k, False: 433]
  ------------------
  554|       |		/* XXX fix to properly handle chars > 65536 */
  555|       |
  556|   903k|		if (bigend)
  ------------------
  |  Branch (556:7): [True: 557k, False: 345k]
  ------------------
  557|   557k|			ubf[(*ulen)++] = CAST(file_unichar_t, bf[i + 3])
  ------------------
  |  |  460|   557k|#define CAST(T, b)	((T)(b))
  ------------------
  558|   557k|			    | (CAST(file_unichar_t, bf[i + 2]) << 8)
  ------------------
  |  |  460|   557k|#define CAST(T, b)	((T)(b))
  ------------------
  559|   557k|			    | (CAST(file_unichar_t, bf[i + 1]) << 16)
  ------------------
  |  |  460|   557k|#define CAST(T, b)	((T)(b))
  ------------------
  560|   557k|			    | (CAST(file_unichar_t, bf[i]) << 24);
  ------------------
  |  |  460|   557k|#define CAST(T, b)	((T)(b))
  ------------------
  561|   345k|		else
  562|   345k|			ubf[(*ulen)++] = CAST(file_unichar_t, bf[i + 0])
  ------------------
  |  |  460|   345k|#define CAST(T, b)	((T)(b))
  ------------------
  563|   345k|			    | (CAST(file_unichar_t, bf[i + 1]) << 8) 
  ------------------
  |  |  460|   345k|#define CAST(T, b)	((T)(b))
  ------------------
  564|   345k|			    | (CAST(file_unichar_t, bf[i + 2]) << 16)
  ------------------
  |  |  460|   345k|#define CAST(T, b)	((T)(b))
  ------------------
  565|   345k|			    | (CAST(file_unichar_t, bf[i + 3]) << 24);
  ------------------
  |  |  460|   345k|#define CAST(T, b)	((T)(b))
  ------------------
  566|       |
  567|   903k|		uc = ubf[*ulen - 1];
  568|   903k|		if (uc == 0xfffe || NOTTEXT(uc))
  ------------------
  |  |  470|   903k|    ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  460|   148k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |                   ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  238|  1.05M|#define T 1   /* character appears in plain ASCII text */
  |  |  ------------------
  |  |  |  Branch (470:6): [True: 148k, False: 755k]
  |  |  |  Branch (470:19): [True: 148k, False: 35]
  |  |  |  Branch (470:57): [True: 17, False: 148k]
  |  |  ------------------
  ------------------
  |  Branch (568:7): [True: 7, False: 903k]
  ------------------
  569|     24|			return 0;
  570|   903k|	}
  571|       |
  572|    433|	return 1 + bigend;
  573|    457|}
encoding.c:from_ebcdic:
  660|  31.2k|{
  661|  31.2k|	size_t i;
  662|       |
  663|   114M|	for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (663:14): [True: 114M, False: 31.2k]
  ------------------
  664|   114M|		out[i] = ebcdic_to_ascii[buf[i]];
  665|   114M|	}
  666|  31.2k|}

file_fsmagic:
  178|  12.8k|{
  179|  12.8k|	int ret, didv = 0, *did;
  180|  12.8k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  12.8k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  12.8k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  12.8k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  181|  12.8k|	int silent = ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION);
  ------------------
  |  |   45|  12.8k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	int silent = ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION);
  ------------------
  |  |   46|  12.8k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  182|  12.8k|#if defined(S_IFLNK) && defined(HAVE_READLINK)
  183|  12.8k|	char buf[BUFSIZ+4];
  184|  12.8k|	ssize_t nch;
  185|  12.8k|	struct stat tstatbuf;
  186|  12.8k|#endif
  187|  12.8k|	did = &didv;
  188|       |
  189|  12.8k|	if (fn == NULL)
  ------------------
  |  Branch (189:6): [True: 12.8k, False: 0]
  ------------------
  190|  12.8k|		return 0;
  191|       |
  192|       |	/*
  193|       |	 * Fstat is cheaper but fails for files you don't have read perms on.
  194|       |	 * On 4.2BSD and similar systems, use lstat() to identify symlinks.
  195|       |	 */
  196|      0|#ifdef	S_IFLNK
  197|      0|	if ((ms->flags & MAGIC_SYMLINK) == 0)
  ------------------
  |  |   34|      0|#define	MAGIC_SYMLINK		0x0000002 /* Follow symlinks */
  ------------------
  |  Branch (197:6): [True: 0, False: 0]
  ------------------
  198|      0|		ret = lstat(fn, sb);
  199|      0|	else
  200|      0|#endif
  201|      0|	ret = stat(fn, sb);	/* don't merge into if; see "ret =" above */
  202|       |
  203|       |#ifdef WIN32
  204|       |	{
  205|       |		HANDLE hFile = CreateFile((LPCSTR)fn, 0, FILE_SHARE_DELETE |
  206|       |		    FILE_SHARE_READ | FILE_SHARE_WRITE, NULL, OPEN_EXISTING, 0,
  207|       |		    NULL);
  208|       |		if (hFile != INVALID_HANDLE_VALUE) {
  209|       |			/*
  210|       |			 * Stat failed, but we can still open it - assume it's
  211|       |			 * a block device, if nothing else.
  212|       |			 */
  213|       |			if (ret) {
  214|       |				sb->st_mode = S_IFBLK;
  215|       |				ret = 0;
  216|       |			}
  217|       |			switch (GetFileType(hFile)) {
  218|       |			case FILE_TYPE_CHAR:
  219|       |				sb->st_mode |= S_IFCHR;
  220|       |				sb->st_mode &= ~S_IFREG;
  221|       |				break;
  222|       |			case FILE_TYPE_PIPE:
  223|       |				sb->st_mode |= S_IFIFO;
  224|       |				sb->st_mode &= ~S_IFREG;
  225|       |				break;
  226|       |			}
  227|       |			CloseHandle(hFile);
  228|       |		}
  229|       |	}
  230|       |#endif
  231|       |
  232|      0|	if (ret) {
  ------------------
  |  Branch (232:6): [True: 0, False: 0]
  ------------------
  233|      0|		if (ms->flags & MAGIC_ERROR) {
  ------------------
  |  |   42|      0|#define	MAGIC_ERROR		0x0000200 /* Handle ENOENT etc as real errors */
  ------------------
  |  Branch (233:7): [True: 0, False: 0]
  ------------------
  234|      0|			file_error(ms, errno, "cannot stat `%s'", fn);
  235|      0|			return -1;
  236|      0|		}
  237|      0|		if (file_printf(ms, "cannot open `%s' (%s)",
  ------------------
  |  Branch (237:7): [True: 0, False: 0]
  ------------------
  238|      0|		    fn, strerror(errno)) == -1)
  239|      0|			return -1;
  240|      0|		return 0;
  241|      0|	}
  242|       |
  243|      0|	ret = 1;
  244|      0|	if (!mime && !silent) {
  ------------------
  |  Branch (244:6): [True: 0, False: 0]
  |  Branch (244:15): [True: 0, False: 0]
  ------------------
  245|      0|		if (pr_flags(ms, sb->st_mode, sugid, __arraycount(sugid),
  ------------------
  |  |  138|      0|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (245:7): [True: 0, False: 0]
  ------------------
  246|      0|		    did) == -1)
  247|      0|			return -1;
  248|       |#if HAVE_STRUCT_STAT_ST_FLAGS
  249|       |		if (pr_flags(ms, sb->st_flags, sflags, __arraycount(sflags),
  250|       |		    did) == -1)
  251|       |			return -1;
  252|       |#endif
  253|      0|	}
  254|       |
  255|      0|	switch (sb->st_mode & S_IFMT) {
  256|      0|	case S_IFDIR:
  ------------------
  |  Branch (256:2): [True: 0, False: 0]
  ------------------
  257|      0|		if (mime) {
  ------------------
  |  Branch (257:7): [True: 0, False: 0]
  ------------------
  258|      0|			if (handle_mime(ms, mime, "directory") == -1)
  ------------------
  |  Branch (258:8): [True: 0, False: 0]
  ------------------
  259|      0|				return -1;
  260|      0|		} else if (silent) {
  ------------------
  |  Branch (260:14): [True: 0, False: 0]
  ------------------
  261|      0|		} else if (file_printf(ms, "%sdirectory", COMMA) == -1)
  ------------------
  |  |  163|      0|#define COMMA	((*did)++ ? ", " : "")
  |  |  ------------------
  |  |  |  Branch (163:16): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (261:14): [True: 0, False: 0]
  ------------------
  262|      0|			return -1;
  263|      0|		break;
  264|      0|#ifdef S_IFCHR
  265|      0|	case S_IFCHR:
  ------------------
  |  Branch (265:2): [True: 0, False: 0]
  ------------------
  266|       |		/*
  267|       |		 * If -s has been specified, treat character special files
  268|       |		 * like ordinary files.  Otherwise, just report that they
  269|       |		 * are block special files and go on to the next file.
  270|       |		 */
  271|      0|		if ((ms->flags & MAGIC_DEVICES) != 0) {
  ------------------
  |  |   36|      0|#define	MAGIC_DEVICES		0x0000008 /* Look at the contents of devices */
  ------------------
  |  Branch (271:7): [True: 0, False: 0]
  ------------------
  272|      0|			ret = 0;
  273|      0|			break;
  274|      0|		}
  275|      0|		if (mime) {
  ------------------
  |  Branch (275:7): [True: 0, False: 0]
  ------------------
  276|      0|			if (handle_mime(ms, mime, "chardevice") == -1)
  ------------------
  |  Branch (276:8): [True: 0, False: 0]
  ------------------
  277|      0|				return -1;
  278|      0|		} else if (silent) {
  ------------------
  |  Branch (278:14): [True: 0, False: 0]
  ------------------
  279|      0|		} else {
  280|      0|#ifdef HAVE_STRUCT_STAT_ST_RDEV
  281|       |# ifdef dv_unit
  282|       |			if (file_printf(ms, "%scharacter special (%d/%d/%d)",
  283|       |			    COMMA, major(sb->st_rdev), dv_unit(sb->st_rdev),
  284|       |					dv_subunit(sb->st_rdev)) == -1)
  285|       |				return -1;
  286|       |# else
  287|      0|			if (file_printf(ms, "%scharacter special (%ld/%ld)",
  ------------------
  |  Branch (287:8): [True: 0, False: 0]
  ------------------
  288|      0|			    COMMA, (long)major(sb->st_rdev),
  ------------------
  |  |  163|      0|#define COMMA	((*did)++ ? ", " : "")
  |  |  ------------------
  |  |  |  Branch (163:16): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  289|      0|			    (long)minor(sb->st_rdev)) == -1)
  290|      0|				return -1;
  291|      0|# endif
  292|       |#else
  293|       |			if (file_printf(ms, "%scharacter special", COMMA) == -1)
  294|       |				return -1;
  295|       |#endif
  296|      0|		}
  297|      0|		break;
  298|      0|#endif
  299|      0|#ifdef S_IFBLK
  300|      0|	case S_IFBLK:
  ------------------
  |  Branch (300:2): [True: 0, False: 0]
  ------------------
  301|       |		/*
  302|       |		 * If -s has been specified, treat block special files
  303|       |		 * like ordinary files.  Otherwise, just report that they
  304|       |		 * are block special files and go on to the next file.
  305|       |		 */
  306|      0|		if ((ms->flags & MAGIC_DEVICES) != 0) {
  ------------------
  |  |   36|      0|#define	MAGIC_DEVICES		0x0000008 /* Look at the contents of devices */
  ------------------
  |  Branch (306:7): [True: 0, False: 0]
  ------------------
  307|      0|			ret = 0;
  308|      0|			break;
  309|      0|		}
  310|      0|		if (mime) {
  ------------------
  |  Branch (310:7): [True: 0, False: 0]
  ------------------
  311|      0|			if (handle_mime(ms, mime, "blockdevice") == -1)
  ------------------
  |  Branch (311:8): [True: 0, False: 0]
  ------------------
  312|      0|				return -1;
  313|      0|		} else if (silent) {
  ------------------
  |  Branch (313:14): [True: 0, False: 0]
  ------------------
  314|      0|		} else {
  315|      0|#ifdef HAVE_STRUCT_STAT_ST_RDEV
  316|       |# ifdef dv_unit
  317|       |			if (file_printf(ms, "%sblock special (%d/%d/%d)",
  318|       |			    COMMA, major(sb->st_rdev), dv_unit(sb->st_rdev),
  319|       |			    dv_subunit(sb->st_rdev)) == -1)
  320|       |				return -1;
  321|       |# else
  322|      0|			if (file_printf(ms, "%sblock special (%ld/%ld)",
  ------------------
  |  Branch (322:8): [True: 0, False: 0]
  ------------------
  323|      0|			    COMMA, (long)major(sb->st_rdev),
  ------------------
  |  |  163|      0|#define COMMA	((*did)++ ? ", " : "")
  |  |  ------------------
  |  |  |  Branch (163:16): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  324|      0|			    (long)minor(sb->st_rdev)) == -1)
  325|      0|				return -1;
  326|      0|# endif
  327|       |#else
  328|       |			if (file_printf(ms, "%sblock special", COMMA) == -1)
  329|       |				return -1;
  330|       |#endif
  331|      0|		}
  332|      0|		break;
  333|      0|#endif
  334|       |	/* TODO add code to handle V7 MUX and Blit MUX files */
  335|      0|#ifdef	S_IFIFO
  336|      0|	case S_IFIFO:
  ------------------
  |  Branch (336:2): [True: 0, False: 0]
  ------------------
  337|      0|		if((ms->flags & MAGIC_DEVICES) != 0)
  ------------------
  |  |   36|      0|#define	MAGIC_DEVICES		0x0000008 /* Look at the contents of devices */
  ------------------
  |  Branch (337:6): [True: 0, False: 0]
  ------------------
  338|      0|			break;
  339|      0|		if (mime) {
  ------------------
  |  Branch (339:7): [True: 0, False: 0]
  ------------------
  340|      0|			if (handle_mime(ms, mime, "fifo") == -1)
  ------------------
  |  Branch (340:8): [True: 0, False: 0]
  ------------------
  341|      0|				return -1;
  342|      0|		} else if (silent) {
  ------------------
  |  Branch (342:14): [True: 0, False: 0]
  ------------------
  343|      0|		} else if (file_printf(ms, "%sfifo (named pipe)", COMMA) == -1)
  ------------------
  |  |  163|      0|#define COMMA	((*did)++ ? ", " : "")
  |  |  ------------------
  |  |  |  Branch (163:16): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (343:14): [True: 0, False: 0]
  ------------------
  344|      0|			return -1;
  345|      0|		break;
  346|      0|#endif
  347|       |#ifdef	S_IFDOOR
  348|       |	case S_IFDOOR:
  349|       |		if (mime) {
  350|       |			if (handle_mime(ms, mime, "door") == -1)
  351|       |				return -1;
  352|       |		} else if (silent) {
  353|       |		} else if (file_printf(ms, "%sdoor", COMMA) == -1)
  354|       |			return -1;
  355|       |		break;
  356|       |#endif
  357|       |/* Resolving a symlink needs readlink(2); without it fall through to the
  358|       | * generic handling rather than failing to link. */
  359|      0|#if defined(S_IFLNK) && defined(HAVE_READLINK)
  360|      0|	case S_IFLNK:
  ------------------
  |  Branch (360:2): [True: 0, False: 0]
  ------------------
  361|      0|		if ((nch = readlink(fn, buf, BUFSIZ-1)) <= 0) {
  ------------------
  |  Branch (361:7): [True: 0, False: 0]
  ------------------
  362|      0|			if (ms->flags & MAGIC_ERROR) {
  ------------------
  |  |   42|      0|#define	MAGIC_ERROR		0x0000200 /* Handle ENOENT etc as real errors */
  ------------------
  |  Branch (362:8): [True: 0, False: 0]
  ------------------
  363|      0|			    file_error(ms, errno, "unreadable symlink `%s'",
  364|      0|				fn);
  365|      0|			    return -1;
  366|      0|			}
  367|      0|			if (mime) {
  ------------------
  |  Branch (367:8): [True: 0, False: 0]
  ------------------
  368|      0|				if (handle_mime(ms, mime, "symlink") == -1)
  ------------------
  |  Branch (368:9): [True: 0, False: 0]
  ------------------
  369|      0|					return -1;
  370|      0|			} else if (silent) {
  ------------------
  |  Branch (370:15): [True: 0, False: 0]
  ------------------
  371|      0|			} else if (file_printf(ms,
  ------------------
  |  Branch (371:15): [True: 0, False: 0]
  ------------------
  372|      0|			    "%sunreadable symlink `%s' (%s)", COMMA, fn,
  ------------------
  |  |  163|      0|#define COMMA	((*did)++ ? ", " : "")
  |  |  ------------------
  |  |  |  Branch (163:16): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  373|      0|			    strerror(errno)) == -1)
  374|      0|				return -1;
  375|      0|			break;
  376|      0|		}
  377|      0|		buf[nch] = '\0';	/* readlink(2) does not do this */
  378|       |
  379|       |		/* If broken symlink, say so and quit early. */
  380|      0|#ifdef __linux__
  381|       |		/*
  382|       |		 * linux procfs/devfs makes symlinks like pipe:[3515864880]
  383|       |		 * that we can't stat their readlink output, so stat the
  384|       |		 * original filename instead.
  385|       |		 */
  386|      0|		if (stat(fn, &tstatbuf) < 0)
  ------------------
  |  Branch (386:7): [True: 0, False: 0]
  ------------------
  387|      0|			return bad_link(ms, errno, buf);
  388|       |#else
  389|       |		if (*buf == '/') {
  390|       |			if (stat(buf, &tstatbuf) < 0)
  391|       |				return bad_link(ms, errno, buf);
  392|       |		} else {
  393|       |			char *tmp;
  394|       |			char buf2[BUFSIZ+BUFSIZ+4];
  395|       |
  396|       |			if ((tmp = CCAST(char *, strrchr(fn,  '/'))) == NULL) {
  397|       |				tmp = buf; /* in current directory anyway */
  398|       |			} else {
  399|       |				if (tmp - fn + 1 > BUFSIZ) {
  400|       |					if (ms->flags & MAGIC_ERROR) {
  401|       |						file_error(ms, 0,
  402|       |						    "path too long: `%s'", buf);
  403|       |						return -1;
  404|       |					}
  405|       |					if (mime) {
  406|       |						if (handle_mime(ms, mime,
  407|       |						    "x-path-too-long") == -1)
  408|       |							return -1;
  409|       |					} else if (silent) {
  410|       |					} else if (file_printf(ms,
  411|       |					    "%spath too long: `%s'", COMMA,
  412|       |					    fn) == -1)
  413|       |						return -1;
  414|       |					break;
  415|       |				}
  416|       |				/* take dir part */
  417|       |				(void)strlcpy(buf2, fn, sizeof buf2);
  418|       |				buf2[tmp - fn + 1] = '\0';
  419|       |				/* plus (rel) link */
  420|       |				(void)strlcat(buf2, buf, sizeof buf2);
  421|       |				tmp = buf2;
  422|       |			}
  423|       |			if (stat(tmp, &tstatbuf) < 0)
  424|       |				return bad_link(ms, errno, buf);
  425|       |		}
  426|       |#endif
  427|       |
  428|       |		/* Otherwise, handle it. */
  429|      0|		if ((ms->flags & MAGIC_SYMLINK) != 0) {
  ------------------
  |  |   34|      0|#define	MAGIC_SYMLINK		0x0000002 /* Follow symlinks */
  ------------------
  |  Branch (429:7): [True: 0, False: 0]
  ------------------
  430|      0|			const char *p;
  431|      0|			ms->flags &= MAGIC_SYMLINK;
  ------------------
  |  |   34|      0|#define	MAGIC_SYMLINK		0x0000002 /* Follow symlinks */
  ------------------
  432|      0|			p = magic_file(ms, buf);
  433|      0|			ms->flags |= MAGIC_SYMLINK;
  ------------------
  |  |   34|      0|#define	MAGIC_SYMLINK		0x0000002 /* Follow symlinks */
  ------------------
  434|      0|			if (p == NULL)
  ------------------
  |  Branch (434:8): [True: 0, False: 0]
  ------------------
  435|      0|				return -1;
  436|      0|		} else { /* just print what it points to */
  437|      0|			if (mime) {
  ------------------
  |  Branch (437:8): [True: 0, False: 0]
  ------------------
  438|      0|				if (handle_mime(ms, mime, "symlink") == -1)
  ------------------
  |  Branch (438:9): [True: 0, False: 0]
  ------------------
  439|      0|					return -1;
  440|      0|			} else if (silent) {
  ------------------
  |  Branch (440:15): [True: 0, False: 0]
  ------------------
  441|      0|			} else if (file_printf(ms, "%ssymbolic link to %s",
  ------------------
  |  Branch (441:15): [True: 0, False: 0]
  ------------------
  442|      0|			    COMMA, buf) == -1)
  ------------------
  |  |  163|      0|#define COMMA	((*did)++ ? ", " : "")
  |  |  ------------------
  |  |  |  Branch (163:16): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  443|      0|				return -1;
  444|      0|		}
  445|      0|		break;
  446|      0|#endif
  447|      0|#ifdef	S_IFSOCK
  448|      0|#ifndef __COHERENT__
  449|      0|	case S_IFSOCK:
  ------------------
  |  Branch (449:2): [True: 0, False: 0]
  ------------------
  450|      0|		if (mime) {
  ------------------
  |  Branch (450:7): [True: 0, False: 0]
  ------------------
  451|      0|			if (handle_mime(ms, mime, "socket") == -1)
  ------------------
  |  Branch (451:8): [True: 0, False: 0]
  ------------------
  452|      0|				return -1;
  453|      0|		} else if (silent) {
  ------------------
  |  Branch (453:14): [True: 0, False: 0]
  ------------------
  454|      0|		} else if (file_printf(ms, "%ssocket", COMMA) == -1)
  ------------------
  |  |  163|      0|#define COMMA	((*did)++ ? ", " : "")
  |  |  ------------------
  |  |  |  Branch (163:16): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (454:14): [True: 0, False: 0]
  ------------------
  455|      0|			return -1;
  456|      0|		break;
  457|      0|#endif
  458|      0|#endif
  459|      0|	case S_IFREG:
  ------------------
  |  Branch (459:2): [True: 0, False: 0]
  ------------------
  460|       |		/*
  461|       |		 * regular file, check next possibility
  462|       |		 *
  463|       |		 * If stat() tells us the file has zero length, report here that
  464|       |		 * the file is empty, so we can skip all the work of opening and
  465|       |		 * reading the file.
  466|       |		 * But if the -s option has been given, we skip this
  467|       |		 * optimization, since on some systems, stat() reports zero
  468|       |		 * size for raw disk partitions. (If the block special device
  469|       |		 * really has zero length, the fact that it is empty will be
  470|       |		 * detected and reported correctly when we read the file.)
  471|       |		 */
  472|      0|		if ((ms->flags & MAGIC_DEVICES) == 0 && sb->st_size == 0) {
  ------------------
  |  |   36|      0|#define	MAGIC_DEVICES		0x0000008 /* Look at the contents of devices */
  ------------------
  |  Branch (472:7): [True: 0, False: 0]
  |  Branch (472:43): [True: 0, False: 0]
  ------------------
  473|      0|			if (mime) {
  ------------------
  |  Branch (473:8): [True: 0, False: 0]
  ------------------
  474|      0|				if (handle_mime(ms, mime, "x-empty") == -1)
  ------------------
  |  Branch (474:9): [True: 0, False: 0]
  ------------------
  475|      0|					return -1;
  476|      0|			} else if (silent) {
  ------------------
  |  Branch (476:15): [True: 0, False: 0]
  ------------------
  477|      0|			} else if (file_printf(ms, "%sempty", COMMA) == -1)
  ------------------
  |  |  163|      0|#define COMMA	((*did)++ ? ", " : "")
  |  |  ------------------
  |  |  |  Branch (163:16): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (477:15): [True: 0, False: 0]
  ------------------
  478|      0|				return -1;
  479|      0|			break;
  480|      0|		}
  481|       |#ifdef HAVE_STRUCT_STAT_ST_FLAGS
  482|       |#ifdef SF_SNAPSHOT
  483|       |		if ((ms->flags & MAGIC_DEVICES) == 0 &&
  484|       |		    (sb->st_flags & SF_SNAPSHOT) != 0) {
  485|       |			char tbuf[256];
  486|       |
  487|       |			if (mime) {
  488|       |				if (handle_mime(ms, mime, "x-fs-snapshot")
  489|       |				    == -1)
  490|       |					return -1;
  491|       |			} else if (silent) {
  492|       |			} else if (file_printf(ms,
  493|       |				"%sinternal file system snapshot taken at %s",
  494|       |				COMMA,
  495|       |				file_fmtdatetime(tbuf, sizeof(tbuf),
  496|       |				    sb->st_mtime, 0))
  497|       |			    == -1)
  498|       |				return -1;
  499|       |			break;
  500|       |		}
  501|       |#endif
  502|       |#endif
  503|      0|		ret = 0;
  504|      0|		break;
  505|       |
  506|      0|	default:
  ------------------
  |  Branch (506:2): [True: 0, False: 0]
  ------------------
  507|      0|		file_error(ms, 0, "invalid mode 0%o", sb->st_mode);
  508|      0|		return -1;
  509|       |		/*NOTREACHED*/
  510|      0|	}
  511|       |
  512|      0|	if (!silent && !mime && *did && ret == 0) {
  ------------------
  |  Branch (512:6): [True: 0, False: 0]
  |  Branch (512:17): [True: 0, False: 0]
  |  Branch (512:26): [True: 0, False: 0]
  |  Branch (512:34): [True: 0, False: 0]
  ------------------
  513|      0|	    if (file_printf(ms, " ") == -1)
  ------------------
  |  Branch (513:10): [True: 0, False: 0]
  ------------------
  514|      0|		    return -1;
  515|      0|	}
  516|       |	/*
  517|       |	 * If we were looking for extensions or apple (silent) it is not our
  518|       |	 * job to print here, so don't count this as a match.
  519|       |	 */
  520|      0|	if (ret == 1 && silent)
  ------------------
  |  Branch (520:6): [True: 0, False: 0]
  |  Branch (520:18): [True: 0, False: 0]
  ------------------
  521|      0|		return 0;
  522|      0|	return ret;
  523|      0|}

file_bigendian:
   57|     66|{
   58|     66|	union {
   59|     66|		unsigned short x;
   60|     66|		unsigned char s[sizeof(unsigned short)];
   61|     66|	} u;
   62|       |
   63|     66|	u.x = 1;
   64|     66|	return u.s[0] != 1;
   65|     66|}
file_copystr:
   69|  1.36k|{
   70|  1.36k|	if (blen == 0)
  ------------------
  |  Branch (70:6): [True: 0, False: 1.36k]
  ------------------
   71|      0|		return buf;
   72|  1.36k|	if (width >= blen)
  ------------------
  |  Branch (72:6): [True: 13, False: 1.35k]
  ------------------
   73|     13|		width = blen - 1;
   74|  1.36k|	memcpy(buf, str, width);
   75|  1.36k|	buf[width] = '\0';
   76|  1.36k|	return buf;
   77|  1.36k|}
file_checkfmt:
  111|   418k|{
  112|   418k|	const char *p;
  113|  3.06M|	for (p = fmt; *p; p++) {
  ------------------
  |  Branch (113:16): [True: 2.64M, False: 418k]
  ------------------
  114|  2.64M|		if (*p != '%')
  ------------------
  |  Branch (114:7): [True: 2.45M, False: 184k]
  ------------------
  115|  2.45M|			continue;
  116|   184k|		if (*++p == '%')
  ------------------
  |  Branch (116:7): [True: 0, False: 184k]
  ------------------
  117|      0|			continue;
  118|   184k|		if (*p == '\0') {
  ------------------
  |  Branch (118:7): [True: 0, False: 184k]
  ------------------
  119|      0|			if (msg)
  ------------------
  |  Branch (119:8): [True: 0, False: 0]
  ------------------
  120|      0|				snprintf(msg, mlen, "incomplete %% format");
  121|      0|			return -1;
  122|      0|		}
  123|       |		// Skip uninteresting.
  124|   200k|		while (*p != '\0' && strchr("#0.'+- ", *p) != NULL)
  ------------------
  |  Branch (124:10): [True: 200k, False: 0]
  |  Branch (124:24): [True: 15.8k, False: 184k]
  ------------------
  125|  15.8k|			p++;
  126|   184k|		if (*p == '*') {
  ------------------
  |  Branch (126:7): [True: 0, False: 184k]
  ------------------
  127|      0|			if (msg)
  ------------------
  |  Branch (127:8): [True: 0, False: 0]
  ------------------
  128|      0|				snprintf(msg, mlen, "* not allowed in format");
  129|      0|			return -1;
  130|      0|		}
  131|       |
  132|   184k|		if (!file_checkfield(msg, mlen, "width", &p))
  ------------------
  |  Branch (132:7): [True: 0, False: 184k]
  ------------------
  133|      0|			return -1;
  134|       |
  135|   184k|		if (*p == '.') {
  ------------------
  |  Branch (135:7): [True: 3.11k, False: 181k]
  ------------------
  136|  3.11k|			p++;
  137|  3.11k|			if (!file_checkfield(msg, mlen, "precision", &p))
  ------------------
  |  Branch (137:8): [True: 0, False: 3.11k]
  ------------------
  138|      0|				return -1;
  139|  3.11k|		}
  140|       |
  141|   184k|		if (!isalpha((unsigned char)*p)) {
  ------------------
  |  Branch (141:7): [True: 0, False: 184k]
  ------------------
  142|      0|			if (msg)
  ------------------
  |  Branch (142:8): [True: 0, False: 0]
  ------------------
  143|      0|				snprintf(msg, mlen, "bad format char: %c", *p);
  144|      0|			return -1;
  145|      0|		}
  146|   184k|	}
  147|   418k|	return 0;
  148|   418k|}
file_vprintf:
  155|   421k|{
  156|   421k|	int len;
  157|   421k|	char *buf, *newstr;
  158|   421k|	char tbuf[1024];
  159|       |
  160|   421k|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  495|   421k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (160:6): [True: 2.66k, False: 418k]
  ------------------
  161|  2.66k|		return 0;
  162|       |
  163|   418k|	if (file_checkfmt(tbuf, sizeof(tbuf), fmt)) {
  ------------------
  |  Branch (163:6): [True: 0, False: 418k]
  ------------------
  164|      0|		file_clearbuf(ms);
  165|      0|		file_error(ms, 0, "Bad magic format `%s' (%s)", fmt, tbuf);
  166|      0|		return -1;
  167|      0|	}
  168|       |
  169|   418k|	len = vasprintf(&buf, fmt, ap);
  170|   418k|	if (len < 0 || (size_t)len > 1024 || len + ms->o.blen > 1024 * 1024) {
  ------------------
  |  Branch (170:6): [True: 0, False: 418k]
  |  Branch (170:17): [True: 170, False: 418k]
  |  Branch (170:39): [True: 0, False: 418k]
  ------------------
  171|    170|		size_t blen = ms->o.blen;
  172|    170|		free(buf);
  173|    170|		file_clearbuf(ms);
  174|    170|		file_error(ms, 0, "Output buffer space exceeded %d+%"
  175|    170|		    SIZE_T_FORMAT "u", len, blen);
  176|    170|		return -1;
  177|    170|	}
  178|       |
  179|   418k|	if (ms->o.buf != NULL) {
  ------------------
  |  Branch (179:6): [True: 380k, False: 38.1k]
  ------------------
  180|   380k|		len = asprintf(&newstr, "%s%s", ms->o.buf, buf);
  181|   380k|		free(buf);
  182|   380k|		if (len < 0)
  ------------------
  |  Branch (182:7): [True: 0, False: 380k]
  ------------------
  183|      0|			goto out;
  184|   380k|		free(ms->o.buf);
  185|   380k|		buf = newstr;
  186|   380k|	}
  187|   418k|	ms->o.buf = buf;
  188|   418k|	ms->o.blen = len;
  189|   418k|	return 0;
  190|      0|out:
  191|      0|	file_clearbuf(ms);
  192|       |	file_error(ms, errno, "vasprintf failed");
  193|      0|	return -1;
  194|   418k|}
file_printf:
  198|   404k|{
  199|   404k|	int rv;
  200|   404k|	va_list ap;
  201|       |
  202|   404k|	va_start(ap, fmt);
  203|   404k|	rv = file_vprintf(ms, fmt, ap);
  204|       |	va_end(ap);
  205|   404k|	return rv;
  206|   404k|}
file_error:
  236|    389|{
  237|    389|	va_list va;
  238|    389|	va_start(va, f);
  239|    389|	file_error_core(ms, error, f, va, 0);
  240|       |	va_end(va);
  241|    389|}
file_magerror:
  249|     38|{
  250|     38|	va_list va;
  251|     38|	va_start(va, f);
  252|     38|	file_error_core(ms, 0, f, va, ms->line);
  253|       |	va_end(va);
  254|     38|}
file_badseek:
  265|      8|{
  266|       |	file_error(ms, errno, "error seeking");
  267|      8|}
file_badread:
  271|    100|{
  272|       |	file_error(ms, errno, "error reading");
  273|    100|}
file_separator:
  280|  55.0k|{
  281|  55.0k|	return file_printf(ms, FILE_SEPARATOR);
  ------------------
  |  |  276|  55.0k|#define FILE_SEPARATOR "\n- "
  ------------------
  282|  55.0k|}
file_default:
  315|  13.8k|{
  316|  13.8k|	if (ms->flags & MAGIC_MIME) {
  ------------------
  |  |   44|  13.8k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  13.8k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  13.8k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (316:6): [True: 0, False: 13.8k]
  ------------------
  317|      0|		if ((ms->flags & MAGIC_MIME_TYPE) &&
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (317:7): [True: 0, False: 0]
  ------------------
  318|      0|		    file_printf(ms, "application/%s",
  ------------------
  |  Branch (318:7): [True: 0, False: 0]
  ------------------
  319|      0|			nb ? "octet-stream" : "x-empty") == -1)
  ------------------
  |  Branch (319:4): [True: 0, False: 0]
  ------------------
  320|      0|			return -1;
  321|      0|		return 1;
  322|      0|	}
  323|  13.8k|	if (ms->flags & MAGIC_APPLE) {
  ------------------
  |  |   45|  13.8k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
  |  Branch (323:6): [True: 0, False: 13.8k]
  ------------------
  324|       |		// This is not a typo: Type: UNKN Creator: UNKN
  325|      0|		if (file_printf(ms, "UNKNUNKN") == -1)
  ------------------
  |  Branch (325:7): [True: 0, False: 0]
  ------------------
  326|      0|			return -1;
  327|      0|		return 1;
  328|      0|	}
  329|  13.8k|	if (ms->flags & MAGIC_EXTENSION) {
  ------------------
  |  |   46|  13.8k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (329:6): [True: 0, False: 13.8k]
  ------------------
  330|      0|		if (file_printf(ms, "???") == -1)
  ------------------
  |  Branch (330:7): [True: 0, False: 0]
  ------------------
  331|      0|			return -1;
  332|      0|		return 1;
  333|      0|	}
  334|  13.8k|	return 0;
  335|  13.8k|}
file_buffer:
  348|  19.6k|{
  349|  19.6k|	int m = 0, rv = 0, looks_text = 0;
  350|  19.6k|	const char *code = NULL;
  351|  19.6k|	const char *code_mime = "binary";
  352|  19.6k|	const char *def = "data";
  353|  19.6k|	const char *ftype = NULL;
  354|  19.6k|	char *rbuf = NULL;
  355|  19.6k|	struct buffer b;
  356|       |
  357|  19.6k|	buffer_init(&b, fd, st, buf, nb);
  358|  19.6k|	ms->mode = b.st.st_mode;
  359|       |
  360|  19.6k|	if (nb == 0) {
  ------------------
  |  Branch (360:6): [True: 21, False: 19.6k]
  ------------------
  361|     21|		def = "empty";
  362|     21|		goto simple;
  363|  19.6k|	} else if (nb == 1) {
  ------------------
  |  Branch (363:13): [True: 6, False: 19.6k]
  ------------------
  364|      6|		def = "very short file (no magic)";
  365|      6|		goto simple;
  366|      6|	}
  367|       |
  368|  19.6k|	if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) {
  ------------------
  |  |   63|  19.6k|#define MAGIC_NO_CHECK_ENCODING 0x0200000 /* Don't check text encodings */
  ------------------
  |  Branch (368:6): [True: 19.6k, False: 0]
  ------------------
  369|  19.6k|		looks_text = file_encoding(ms, &b, NULL, 0,
  370|  19.6k|		    &code, &code_mime, &ftype);
  371|  19.6k|	}
  372|       |
  373|       |#ifdef __EMX__
  374|       |	if ((ms->flags & MAGIC_NO_CHECK_APPTYPE) == 0 && inname) {
  375|       |		m = file_os2_apptype(ms, inname, &b);
  376|       |		if ((ms->flags & MAGIC_DEBUG) != 0)
  377|       |			(void)fprintf(stderr, "[try os2_apptype %d]\n", m);
  378|       |		switch (m) {
  379|       |		case -1:
  380|       |			return -1;
  381|       |		case 0:
  382|       |			break;
  383|       |		default:
  384|       |			return 1;
  385|       |		}
  386|       |	}
  387|       |#endif
  388|  19.6k|#if HAVE_FORK
  389|       |	/* try compression stuff */
  390|  19.6k|	if ((ms->flags & MAGIC_NO_CHECK_COMPRESS) == 0) {
  ------------------
  |  |   54|  19.6k|#define	MAGIC_NO_CHECK_COMPRESS	0x0001000 /* Don't check for compressed files */
  ------------------
  |  Branch (390:6): [True: 19.6k, False: 0]
  ------------------
  391|  19.6k|		m = file_zmagic(ms, &b, inname);
  392|  19.6k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  19.6k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (392:7): [True: 0, False: 19.6k]
  ------------------
  393|      0|			(void)fprintf(stderr, "[try zmagic %d]\n", m);
  394|  19.6k|		if (m) {
  ------------------
  |  Branch (394:7): [True: 3.22k, False: 16.4k]
  ------------------
  395|  3.22k|			goto done_encoding;
  396|  3.22k|		}
  397|  19.6k|	}
  398|  16.4k|#endif
  399|       |	/* Check if we have a tar file */
  400|  16.4k|	if ((ms->flags & MAGIC_NO_CHECK_TAR) == 0) {
  ------------------
  |  |   55|  16.4k|#define	MAGIC_NO_CHECK_TAR	0x0002000 /* Don't check for tar files */
  ------------------
  |  Branch (400:6): [True: 16.4k, False: 0]
  ------------------
  401|  16.4k|		m = file_is_tar(ms, &b);
  402|  16.4k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  16.4k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (402:7): [True: 0, False: 16.4k]
  ------------------
  403|      0|			(void)fprintf(stderr, "[try tar %d]\n", m);
  404|  16.4k|		if (m) {
  ------------------
  |  Branch (404:7): [True: 18, False: 16.3k]
  ------------------
  405|     18|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (405:8): [True: 0, False: 18]
  ------------------
  406|      0|				goto done;
  407|     18|		}
  408|  16.4k|	}
  409|       |
  410|       |	/* Check if we have a JSON file */
  411|  16.4k|	if ((ms->flags & MAGIC_NO_CHECK_JSON) == 0) {
  ------------------
  |  |   64|  16.4k|#define MAGIC_NO_CHECK_JSON	0x0400000 /* Don't check for JSON files */
  ------------------
  |  Branch (411:6): [True: 16.4k, False: 0]
  ------------------
  412|  16.4k|		m = file_is_json(ms, &b);
  413|  16.4k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  16.4k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (413:7): [True: 0, False: 16.4k]
  ------------------
  414|      0|			(void)fprintf(stderr, "[try json %d]\n", m);
  415|  16.4k|		if (m) {
  ------------------
  |  Branch (415:7): [True: 50, False: 16.3k]
  ------------------
  416|     50|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (416:8): [True: 0, False: 50]
  ------------------
  417|      0|				goto done;
  418|     50|		}
  419|  16.4k|	}
  420|       |
  421|       |	/* Check if we have a CSV file */
  422|  16.4k|	if ((ms->flags & MAGIC_NO_CHECK_CSV) == 0) {
  ------------------
  |  |   61|  16.4k|#define MAGIC_NO_CHECK_CSV	0x0080000 /* Don't check for CSV files */
  ------------------
  |  Branch (422:6): [True: 16.4k, False: 0]
  ------------------
  423|  16.4k|		m = file_is_csv(ms, &b, looks_text, code);
  424|  16.4k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  16.4k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (424:7): [True: 0, False: 16.4k]
  ------------------
  425|      0|			(void)fprintf(stderr, "[try csv %d]\n", m);
  426|  16.4k|		if (m) {
  ------------------
  |  Branch (426:7): [True: 11, False: 16.4k]
  ------------------
  427|     11|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (427:8): [True: 0, False: 11]
  ------------------
  428|      0|				goto done;
  429|     11|		}
  430|  16.4k|	}
  431|       |
  432|       |	/* Check if we have a SIMH tape file */
  433|  16.4k|	if ((ms->flags & MAGIC_NO_CHECK_SIMH) == 0) {
  ------------------
  |  |   65|  16.4k|#define MAGIC_NO_CHECK_SIMH	0x0800000 /* Don't check for SIMH tape files */
  ------------------
  |  Branch (433:6): [True: 16.4k, False: 0]
  ------------------
  434|  16.4k|		m = file_is_simh(ms, &b);
  435|  16.4k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  16.4k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (435:7): [True: 0, False: 16.4k]
  ------------------
  436|      0|			(void)fprintf(stderr, "[try simh %d]\n", m);
  437|  16.4k|		if (m) {
  ------------------
  |  Branch (437:7): [True: 39, False: 16.3k]
  ------------------
  438|     39|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (438:8): [True: 0, False: 39]
  ------------------
  439|      0|				goto done;
  440|     39|		}
  441|  16.4k|	}
  442|       |
  443|       |	/* Check if we have a CDF file */
  444|  16.4k|	if ((ms->flags & MAGIC_NO_CHECK_CDF) == 0) {
  ------------------
  |  |   60|  16.4k|#define	MAGIC_NO_CHECK_CDF	0x0040000 /* Don't check for cdf files */
  ------------------
  |  Branch (444:6): [True: 16.4k, False: 0]
  ------------------
  445|  16.4k|		m = file_trycdf(ms, &b);
  446|  16.4k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  16.4k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (446:7): [True: 0, False: 16.4k]
  ------------------
  447|      0|			(void)fprintf(stderr, "[try cdf %d]\n", m);
  448|  16.4k|		if (m) {
  ------------------
  |  Branch (448:7): [True: 1.76k, False: 14.6k]
  ------------------
  449|  1.76k|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (449:8): [True: 0, False: 1.76k]
  ------------------
  450|      0|				goto done;
  451|  1.76k|		}
  452|  16.4k|	}
  453|  16.4k|#ifdef BUILTIN_ELF
  454|  16.4k|	if ((ms->flags & MAGIC_NO_CHECK_ELF) == 0 && nb > 5 && fd != -1) {
  ------------------
  |  |   58|  16.4k|#define	MAGIC_NO_CHECK_ELF	0x0010000 /* Don't check for elf details */
  ------------------
  |  Branch (454:6): [True: 16.4k, False: 0]
  |  Branch (454:47): [True: 14.6k, False: 1.80k]
  |  Branch (454:57): [True: 8.37k, False: 6.23k]
  ------------------
  455|  8.37k|		file_pushbuf_t *pb;
  456|       |		/*
  457|       |		 * We matched something in the file, so this
  458|       |		 * *might* be an ELF file, and the file is at
  459|       |		 * least 5 bytes long, so if it's an ELF file
  460|       |		 * it has at least one byte past the ELF magic
  461|       |		 * number - try extracting information from the
  462|       |		 * ELF headers that cannot easily be  extracted
  463|       |		 * with rules in the magic file. We we don't
  464|       |		 * print the information yet.
  465|       |		 */
  466|  8.37k|		if ((pb = file_push_buffer(ms)) == NULL)
  ------------------
  |  Branch (466:7): [True: 0, False: 8.37k]
  ------------------
  467|      0|			return -1;
  468|       |
  469|  8.37k|		rv = file_tryelf(ms, &b);
  470|  8.37k|		rbuf = file_pop_buffer(ms, pb);
  471|  8.37k|		if (rv == -1) {
  ------------------
  |  Branch (471:7): [True: 150, False: 8.22k]
  ------------------
  472|    150|			free(rbuf);
  473|    150|			rbuf = NULL;
  474|    150|		}
  475|  8.37k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  8.37k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (475:7): [True: 0, False: 8.37k]
  ------------------
  476|      0|			(void)fprintf(stderr, "[try elf %d]\n", m);
  477|  8.37k|	}
  478|  16.4k|#endif
  479|       |
  480|       |	/* try soft magic tests */
  481|  16.4k|	if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0) {
  ------------------
  |  |   56|  16.4k|#define	MAGIC_NO_CHECK_SOFT	0x0004000 /* Don't check magic entries */
  ------------------
  |  Branch (481:6): [True: 16.4k, False: 0]
  ------------------
  482|  16.4k|		m = file_softmagic(ms, &b, NULL, NULL, BINTEST, looks_text);
  ------------------
  |  |  239|  16.4k|#define BINTEST		0x20	/* test is for a binary type (set only
  ------------------
  483|  16.4k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  16.4k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (483:7): [True: 0, False: 16.4k]
  ------------------
  484|      0|			(void)fprintf(stderr, "[try softmagic %d]\n", m);
  485|  16.4k|		if (m == 1 && rbuf) {
  ------------------
  |  Branch (485:7): [True: 12.8k, False: 3.56k]
  |  Branch (485:17): [True: 4.55k, False: 8.29k]
  ------------------
  486|  4.55k|			if (file_printf(ms, "%s", rbuf) == -1)
  ------------------
  |  Branch (486:8): [True: 32, False: 4.52k]
  ------------------
  487|     32|				goto done;
  488|  4.55k|		}
  489|  16.3k|		if (m) {
  ------------------
  |  Branch (489:7): [True: 13.0k, False: 3.36k]
  ------------------
  490|  13.0k|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (490:8): [True: 0, False: 13.0k]
  ------------------
  491|      0|				goto done;
  492|  13.0k|		}
  493|  16.3k|	}
  494|       |
  495|       |	/* try text properties */
  496|  16.3k|	if ((ms->flags & MAGIC_NO_CHECK_TEXT) == 0) {
  ------------------
  |  |   59|  16.3k|#define	MAGIC_NO_CHECK_TEXT	0x0020000 /* Don't check for text files */
  ------------------
  |  Branch (496:6): [True: 16.3k, False: 0]
  ------------------
  497|       |
  498|  16.3k|		m = file_ascmagic(ms, &b, looks_text);
  499|  16.3k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  16.3k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (499:7): [True: 0, False: 16.3k]
  ------------------
  500|      0|			(void)fprintf(stderr, "[try ascmagic %d]\n", m);
  501|  16.3k|		if (m) {
  ------------------
  |  Branch (501:7): [True: 2.54k, False: 13.8k]
  ------------------
  502|  2.54k|			goto done;
  503|  2.54k|		}
  504|  16.3k|	}
  505|       |
  506|  13.8k|simple:
  507|       |	/* give up */
  508|  13.8k|	if (m == 0) {
  ------------------
  |  Branch (508:6): [True: 13.8k, False: 0]
  ------------------
  509|  13.8k|		m = 1;
  510|  13.8k|		rv = file_default(ms, nb);
  511|  13.8k|		if (rv == 0)
  ------------------
  |  Branch (511:7): [True: 13.8k, False: 0]
  ------------------
  512|  13.8k|			if (file_printf(ms, "%s", def) == -1)
  ------------------
  |  Branch (512:8): [True: 0, False: 13.8k]
  ------------------
  513|      0|				rv = -1;
  514|  13.8k|	}
  515|  16.4k| done:
  516|  16.4k|	trim_separator(ms);
  517|  16.4k|	if ((ms->flags & MAGIC_MIME_ENCODING) != 0) {
  ------------------
  |  |   43|  16.4k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (517:6): [True: 0, False: 16.4k]
  ------------------
  518|      0|		if (ms->flags & MAGIC_MIME_TYPE)
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (518:7): [True: 0, False: 0]
  ------------------
  519|      0|			if (file_printf(ms, "; charset=") == -1)
  ------------------
  |  Branch (519:8): [True: 0, False: 0]
  ------------------
  520|      0|				rv = -1;
  521|      0|		if (file_printf(ms, "%s", code_mime) == -1)
  ------------------
  |  Branch (521:7): [True: 0, False: 0]
  ------------------
  522|      0|			rv = -1;
  523|      0|	}
  524|  16.4k|#if HAVE_FORK
  525|  19.6k| done_encoding:
  526|  19.6k|#endif
  527|  19.6k|	free(rbuf);
  528|  19.6k|	buffer_fini(&b);
  529|  19.6k|	if (rv)
  ------------------
  |  Branch (529:6): [True: 32, False: 19.6k]
  ------------------
  530|     32|		return rv;
  531|       |
  532|  19.6k|	return m;
  533|  19.6k|}
file_reset:
  538|  12.8k|{
  539|  12.8k|	if (checkloaded && ms->mlist[0] == NULL) {
  ------------------
  |  Branch (539:6): [True: 12.8k, False: 2]
  |  Branch (539:21): [True: 0, False: 12.8k]
  ------------------
  540|      0|		file_error(ms, 0, "no magic files loaded");
  541|      0|		return -1;
  542|      0|	}
  543|  12.8k|	file_clearbuf(ms);
  544|  12.8k|	if (ms->o.pbuf) {
  ------------------
  |  Branch (544:6): [True: 12.3k, False: 426]
  ------------------
  545|  12.3k|		free(ms->o.pbuf);
  546|  12.3k|		ms->o.pbuf = NULL;
  547|  12.3k|	}
  548|  12.8k|	ms->event_flags &= ~EVENT_HAD_ERR;
  ------------------
  |  |  495|  12.8k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  549|  12.8k|	ms->error = -1;
  550|  12.8k|	return 0;
  551|  12.8k|}
file_getbuffer:
  563|  12.6k|{
  564|  12.6k|	char *pbuf, *op, *np;
  565|  12.6k|	size_t psize, len;
  566|       |
  567|  12.6k|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  495|  12.6k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (567:6): [True: 286, False: 12.3k]
  ------------------
  568|    286|		return NULL;
  569|       |
  570|  12.3k|	if (ms->flags & MAGIC_RAW)
  ------------------
  |  |   41|  12.3k|#define	MAGIC_RAW		0x0000100 /* Don't convert unprintable chars */
  ------------------
  |  Branch (570:6): [True: 0, False: 12.3k]
  ------------------
  571|      0|		return ms->o.buf;
  572|       |
  573|  12.3k|	if (ms->o.buf == NULL)
  ------------------
  |  Branch (573:6): [True: 0, False: 12.3k]
  ------------------
  574|      0|		return NULL;
  575|       |
  576|       |	/* * 4 is for octal representation, + 1 is for NUL */
  577|  12.3k|	len = strlen(ms->o.buf);
  578|  12.3k|	if (len > (SIZE_MAX - 1) / 4) {
  ------------------
  |  Branch (578:6): [True: 0, False: 12.3k]
  ------------------
  579|      0|		file_oomem(ms, len);
  580|      0|		return NULL;
  581|      0|	}
  582|  12.3k|	psize = len * 4 + 1;
  583|  12.3k|	if ((pbuf = CAST(char *, realloc(ms->o.pbuf, psize))) == NULL) {
  ------------------
  |  |  460|  12.3k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (583:6): [True: 0, False: 12.3k]
  ------------------
  584|      0|		file_oomem(ms, psize);
  585|      0|		return NULL;
  586|      0|	}
  587|  12.3k|	ms->o.pbuf = pbuf;
  588|       |
  589|  12.3k|#if defined(HAVE_WCHAR_H) && defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH)
  590|  12.3k|	{
  591|  12.3k|		mbstate_t state;
  592|  12.3k|		wchar_t nextchar;
  593|  12.3k|		int mb_conv = 1;
  594|  12.3k|		size_t bytesconsumed;
  595|  12.3k|		char *eop;
  596|  12.3k|		(void)memset(&state, 0, sizeof(mbstate_t));
  597|       |
  598|  12.3k|		np = ms->o.pbuf;
  599|  12.3k|		op = ms->o.buf;
  600|  12.3k|		eop = op + len;
  601|       |
  602|  2.89M|		while (op < eop) {
  ------------------
  |  Branch (602:10): [True: 2.88M, False: 12.3k]
  ------------------
  603|  2.88M|			bytesconsumed = mbrtowc(&nextchar, op,
  604|  2.88M|			    CAST(size_t, eop - op), &state);
  ------------------
  |  |  460|  2.88M|#define CAST(T, b)	((T)(b))
  ------------------
  605|  2.88M|			if (bytesconsumed == CAST(size_t, -1) ||
  ------------------
  |  |  460|  5.76M|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (605:8): [True: 74, False: 2.88M]
  ------------------
  606|  2.88M|			    bytesconsumed == CAST(size_t, -2)) {
  ------------------
  |  |  460|  2.88M|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (606:8): [True: 0, False: 2.88M]
  ------------------
  607|     74|				mb_conv = 0;
  608|     74|				break;
  609|     74|			}
  610|       |
  611|  2.88M|			if (iswprint(nextchar)) {
  ------------------
  |  Branch (611:8): [True: 2.83M, False: 43.9k]
  ------------------
  612|  2.83M|				(void)memcpy(np, op, bytesconsumed);
  613|  2.83M|				op += bytesconsumed;
  614|  2.83M|				np += bytesconsumed;
  615|  2.83M|			} else {
  616|  87.9k|				while (bytesconsumed-- > 0)
  ------------------
  |  Branch (616:12): [True: 43.9k, False: 43.9k]
  ------------------
  617|  43.9k|					OCTALIFY(np, op);
  ------------------
  |  |  555|  43.9k|	(void)(*(n)++ = '\\', \
  |  |  556|  43.9k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 6) & 3) + '0', \
  |  |  ------------------
  |  |  |  |  460|  43.9k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  557|  43.9k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 3) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  460|  43.9k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  558|  43.9k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 0) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  460|  43.9k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  559|  43.9k|	(o)++)
  ------------------
  618|  43.9k|			}
  619|  2.88M|		}
  620|  12.3k|		*np = '\0';
  621|       |
  622|       |		/* Parsing succeeded as a multi-byte sequence */
  623|  12.3k|		if (mb_conv != 0)
  ------------------
  |  Branch (623:7): [True: 12.3k, False: 74]
  ------------------
  624|  12.3k|			return ms->o.pbuf;
  625|  12.3k|	}
  626|     74|#endif
  627|       |
  628|  40.2k|	for (np = ms->o.pbuf, op = ms->o.buf; *op;) {
  ------------------
  |  Branch (628:40): [True: 40.1k, False: 74]
  ------------------
  629|  40.1k|		if (isprint(CAST(unsigned char, *op))) {
  ------------------
  |  Branch (629:7): [True: 38.5k, False: 1.62k]
  ------------------
  630|  38.5k|			*np++ = *op++;
  631|  38.5k|		} else {
  632|  1.62k|			OCTALIFY(np, op);
  ------------------
  |  |  555|  1.62k|	(void)(*(n)++ = '\\', \
  |  |  556|  1.62k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 6) & 3) + '0', \
  |  |  ------------------
  |  |  |  |  460|  1.62k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  557|  1.62k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 3) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  460|  1.62k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  558|  1.62k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 0) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  460|  1.62k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  559|  1.62k|	(o)++)
  ------------------
  633|  1.62k|		}
  634|  40.1k|	}
  635|     74|	*np = '\0';
  636|     74|	return ms->o.pbuf;
  637|  12.3k|}
file_check_mem:
  641|   979k|{
  642|   979k|	size_t len;
  643|       |
  644|   979k|	if (level >= ms->c.len) {
  ------------------
  |  Branch (644:6): [True: 1, False: 979k]
  ------------------
  645|      1|		len = (ms->c.len = 20 + level) * sizeof(*ms->c.li);
  646|      1|		ms->c.li = CAST(struct level_info *, (ms->c.li == NULL) ?
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 0, False: 1]
  |  |  ------------------
  ------------------
  647|      1|		    malloc(len) :
  648|      1|		    realloc(ms->c.li, len));
  649|      1|		if (ms->c.li == NULL) {
  ------------------
  |  Branch (649:7): [True: 0, False: 1]
  ------------------
  650|      0|			file_oomem(ms, len);
  651|      0|			return -1;
  652|      0|		}
  653|      1|	}
  654|   979k|	ms->c.li[level].got_match = 0;
  655|   979k|#ifdef ENABLE_CONDITIONALS
  656|   979k|	ms->c.li[level].last_match = 0;
  657|   979k|	ms->c.li[level].last_cond = COND_NONE;
  ------------------
  |  |  368|   979k|#define				COND_NONE	0
  ------------------
  658|   979k|#endif /* ENABLE_CONDITIONALS */
  659|   979k|	return 0;
  660|   979k|}
file_printedlen:
  664|  2.54k|{
  665|  2.54k|	return ms->o.blen;
  666|  2.54k|}
file_replace:
  670|  1.72k|{
  671|  1.72k|	file_regex_t rx;
  672|  1.72k|	int nm;
  673|  1.72k|	regmatch_t rm;
  674|       |
  675|  1.72k|	nm = file_regcomp(ms, &rx, pat, REG_EXTENDED);
  676|  1.72k|	if (nm != 0)
  ------------------
  |  Branch (676:6): [True: 0, False: 1.72k]
  ------------------
  677|      0|		return -1;
  678|       |
  679|  1.84k|	while (file_regexec(ms, &rx, ms->o.buf, 1, &rm, 0) == 0) {
  ------------------
  |  Branch (679:9): [True: 122, False: 1.72k]
  ------------------
  680|    122|		ms->o.buf[rm.rm_so] = '\0';
  681|    122|		if (file_printf(ms, "%s%s", rep,
  ------------------
  |  Branch (681:7): [True: 0, False: 122]
  ------------------
  682|    122|		    rm.rm_eo != 0 ? ms->o.buf + rm.rm_eo : "") == -1)
  ------------------
  |  Branch (682:7): [True: 122, False: 0]
  ------------------
  683|      0|			goto out;
  684|    122|		nm++;
  685|    122|	}
  686|  1.72k|out:
  687|  1.72k|	file_regfree(&rx);
  688|  1.72k|	return nm;
  689|  1.72k|}
file_regcomp:
  748|  38.7k|{
  749|  38.7k|	if (check_regex(ms, pat) == -1)
  ------------------
  |  Branch (749:6): [True: 0, False: 38.7k]
  ------------------
  750|      0|		return -1;
  751|       |
  752|  38.7k|#ifdef USE_C_LOCALE
  753|  38.7k|	locale_t old = uselocale(ms->c_lc_ctype);
  754|  38.7k|	assert(old != NULL);
  ------------------
  |  Branch (754:2): [True: 0, False: 38.7k]
  |  Branch (754:2): [True: 38.7k, False: 0]
  ------------------
  755|       |#else
  756|       |	char old[1024];
  757|       |	const char *ol = setlocale(LC_CTYPE, NULL);
  758|       |	if (ol != NULL)
  759|       |		strlcpy(old, ol, sizeof(old));
  760|       |
  761|       |	(void)setlocale(LC_CTYPE, "C");
  762|       |#endif
  763|  38.7k|	int rc;
  764|  38.7k|	rc = regcomp(rx, pat, flags);
  765|       |
  766|  38.7k|#ifdef USE_C_LOCALE
  767|  38.7k|	uselocale(old);
  768|       |#else
  769|       |	if (ol)
  770|       |		(void)setlocale(LC_CTYPE, old);
  771|       |#endif
  772|  38.7k|	if (rc > 0 && (ms->flags & MAGIC_CHECK)) {
  ------------------
  |  |   39|      0|#define	MAGIC_CHECK		0x0000040 /* Print warnings to stderr */
  ------------------
  |  Branch (772:6): [True: 0, False: 38.7k]
  |  Branch (772:16): [True: 0, False: 0]
  ------------------
  773|      0|		char errmsg[512], buf[512];
  774|       |
  775|      0|		(void)regerror(rc, rx, errmsg, sizeof(errmsg));
  776|      0|		file_magerror(ms, "regex error %d for `%s', (%s)", rc, 
  777|      0|		    file_printable(ms, buf, sizeof(buf), pat, strlen(pat)),
  778|      0|		    errmsg);
  779|      0|	}
  780|  38.7k|	return rc;
  781|  38.7k|}
file_regexec:
  787|   547k|{
  788|   547k|#ifdef USE_C_LOCALE
  789|   547k|	locale_t old = uselocale(ms->c_lc_ctype);
  790|   547k|	assert(old != NULL);
  ------------------
  |  Branch (790:2): [True: 0, False: 547k]
  |  Branch (790:2): [True: 547k, False: 0]
  ------------------
  791|       |#else
  792|       |	char old[1024];
  793|       |	const char *ol = setlocale(LC_CTYPE, NULL);
  794|       |	if (ol != NULL)
  795|       |		strlcpy(old, ol, sizeof(old));
  796|       |
  797|       |	(void)setlocale(LC_CTYPE, "C");
  798|       |#endif
  799|   547k|	int rc;
  800|       |	/* XXX: force initialization because glibc does not always do this */
  801|   547k|	if (nmatch != 0)
  ------------------
  |  Branch (801:6): [True: 510k, False: 36.8k]
  ------------------
  802|   510k|		memset(pmatch, 0, nmatch * sizeof(*pmatch));
  803|   547k|	rc = regexec(rx, str, nmatch, pmatch, eflags);
  804|   547k|#ifdef USE_C_LOCALE
  805|   547k|	uselocale(old);
  806|       |#else
  807|       |	if (ol)
  808|       |		(void)setlocale(LC_CTYPE, old);
  809|       |#endif
  810|   547k|	return rc;
  811|   547k|}
file_regfree:
  815|  38.5k|{
  816|  38.5k|	regfree(rx);
  817|  38.5k|}
file_push_buffer:
  821|  30.4k|{
  822|  30.4k|	file_pushbuf_t *pb;
  823|       |
  824|  30.4k|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  495|  30.4k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (824:6): [True: 141, False: 30.3k]
  ------------------
  825|    141|		return NULL;
  826|       |
  827|  30.3k|	if ((pb = (CAST(file_pushbuf_t *, malloc(sizeof(*pb))))) == NULL)
  ------------------
  |  |  460|  30.3k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (827:6): [True: 0, False: 30.3k]
  ------------------
  828|      0|		return NULL;
  829|       |
  830|  30.3k|	pb->buf = ms->o.buf;
  831|  30.3k|	pb->blen = ms->o.blen;
  832|  30.3k|	pb->offset = ms->offset;
  833|       |
  834|  30.3k|	ms->o.buf = NULL;
  835|  30.3k|	ms->o.blen = 0;
  836|  30.3k|	ms->offset = 0;
  837|       |
  838|  30.3k|	return pb;
  839|  30.3k|}
file_pop_buffer:
  843|  30.3k|{
  844|  30.3k|	char *rbuf;
  845|       |
  846|  30.3k|	if (ms->event_flags & EVENT_HAD_ERR) {
  ------------------
  |  |  495|  30.3k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (846:6): [True: 1.87k, False: 28.4k]
  ------------------
  847|  1.87k|		free(pb->buf);
  848|  1.87k|		free(pb);
  849|  1.87k|		return NULL;
  850|  1.87k|	}
  851|       |
  852|  28.4k|	rbuf = ms->o.buf;
  853|       |
  854|  28.4k|	ms->o.buf = pb->buf;
  855|  28.4k|	ms->o.blen = pb->blen;
  856|  28.4k|	ms->offset = pb->offset;
  857|       |
  858|  28.4k|	free(pb);
  859|  28.4k|	return rbuf;
  860|  30.3k|}
file_printable:
  868|  50.2k|{
  869|  50.2k|	char *ptr, *eptr = buf + bufsiz - 1;
  870|  50.2k|	const unsigned char *s = RCAST(const unsigned char *, str);
  ------------------
  |  |  461|  50.2k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  871|  50.2k|	const unsigned char *es = s + slen;
  872|       |
  873|   407k|	for (ptr = buf;  ptr < eptr && s < es && *s; s++) {
  ------------------
  |  Branch (873:19): [True: 407k, False: 80]
  |  Branch (873:33): [True: 406k, False: 974]
  |  Branch (873:43): [True: 357k, False: 49.0k]
  ------------------
  874|   357k|		if ((ms->flags & MAGIC_RAW) != 0 || isprint(*s)) {
  ------------------
  |  |   41|   357k|#define	MAGIC_RAW		0x0000100 /* Don't convert unprintable chars */
  ------------------
  |  Branch (874:7): [True: 0, False: 357k]
  |  Branch (874:39): [True: 149k, False: 208k]
  ------------------
  875|   149k|			*ptr++ = *s;
  876|   149k|			continue;
  877|   149k|		}
  878|   208k|		if (ptr >= eptr - 3)
  ------------------
  |  Branch (878:7): [True: 66, False: 208k]
  ------------------
  879|     66|			break;
  880|   208k|		*ptr++ = '\\';
  881|   208k|		*ptr++ = ((CAST(unsigned int, *s) >> 6) & 7) + '0';
  ------------------
  |  |  460|   208k|#define CAST(T, b)	((T)(b))
  ------------------
  882|   208k|		*ptr++ = ((CAST(unsigned int, *s) >> 3) & 7) + '0';
  ------------------
  |  |  460|   208k|#define CAST(T, b)	((T)(b))
  ------------------
  883|   208k|		*ptr++ = ((CAST(unsigned int, *s) >> 0) & 7) + '0';
  ------------------
  |  |  460|   208k|#define CAST(T, b)	((T)(b))
  ------------------
  884|   208k|	}
  885|  50.2k|	*ptr = '\0';
  886|  50.2k|	return buf;
  887|  50.2k|}
file_print_leguid:
  987|    339|{
  988|    339|	const struct guid *g = CAST(const struct guid *,
  ------------------
  |  |  460|    339|#define CAST(T, b)	((T)(b))
  ------------------
  989|    339|	    CAST(const void *, guid));
  990|    339|	return file_print_guid(str, len, g);
  991|    339|}
file_print_beguid:
  995|     66|{
  996|     66|	const struct guid *g = CAST(const struct guid *,
  ------------------
  |  |  460|     66|#define CAST(T, b)	((T)(b))
  ------------------
  997|     66|	    CAST(const void *, guid));
  998|     66|	struct guid gg = *g;
  999|     66|	gg.data1 = file_swap4(gg.data1);
  ------------------
  |  |   38|     66|#define file_swap4(x)	bswap_32(x)
  ------------------
 1000|     66|	gg.data2 = file_swap2(gg.data2);
  ------------------
  |  |   37|     66|#define file_swap2(x)	bswap_16(x)
  ------------------
 1001|       |	gg.data3 = file_swap2(gg.data3);
  ------------------
  |  |   37|     66|#define file_swap2(x)	bswap_16(x)
  ------------------
 1002|     66|	return file_print_guid(str, len, &gg);
 1003|     66|}
file_pipe_closexec:
 1007|  7.07k|{
 1008|       |#ifdef __MINGW32__
 1009|       |	return 0;
 1010|       |#elif defined(HAVE_PIPE2)
 1011|  7.07k|	return pipe2(fds, O_CLOEXEC);
 1012|       |#elif !defined(HAVE_PIPE)
 1013|       |	/*
 1014|       |	 * No pipe(2) at all -- e.g. AmigaOS clib2. Only the external
 1015|       |	 * decompressor path needs pipes, so report failure and let the
 1016|       |	 * caller fall back rather than failing to link.
 1017|       |	 */
 1018|       |	(void)fds;
 1019|       |	return -1;
 1020|       |#else
 1021|       |	if (pipe(fds) == -1)
 1022|       |		return -1;
 1023|       |# ifdef F_SETFD
 1024|       |	(void)fcntl(fds[0], F_SETFD, FD_CLOEXEC);
 1025|       |	(void)fcntl(fds[1], F_SETFD, FD_CLOEXEC);
 1026|       |# endif
 1027|       |	return 0;
 1028|       |#endif
 1029|  7.07k|}
file_clear_closexec:
 1032|  10.6k|file_clear_closexec(int fd) {
 1033|  10.6k|#ifdef F_SETFD
 1034|  10.6k|	return fcntl(fd, F_SETFD, 0);
 1035|       |#else
 1036|       |	return 0;
 1037|       |#endif
 1038|  10.6k|}
file_strtrim:
 1042|    438|{
 1043|    438|	char *last;
 1044|       |
 1045|    438|	while (isspace(CAST(unsigned char, *str)))
  ------------------
  |  Branch (1045:9): [True: 552, False: 438]
  ------------------
 1046|    552|		str++;
 1047|    438|	last = str;
 1048|  2.72k|	while (*last)
  ------------------
  |  Branch (1048:9): [True: 2.29k, False: 438]
  ------------------
 1049|  2.29k|		last++;
 1050|    438|	if (last == str)
  ------------------
  |  Branch (1050:6): [True: 91, False: 347]
  ------------------
 1051|     91|		return str;
 1052|    347|	--last;
 1053|    347|	while (isspace(CAST(unsigned char, *last)))
  ------------------
  |  Branch (1053:9): [True: 312, False: 347]
  ------------------
 1054|    312|		last--;
 1055|    347|	*++last = '\0';
 1056|    347|	return str;
 1057|    438|}
funcs.c:file_checkfield:
   89|   187k|{
   90|   187k|	const char *p = *pp;
   91|   187k|	int fw = 0;
   92|       |
   93|   196k|	while (*p && isdigit((unsigned char)*p)) {
  ------------------
  |  Branch (93:9): [True: 196k, False: 0]
  |  Branch (93:15): [True: 9.36k, False: 187k]
  ------------------
   94|  9.36k|		fw = fw * 10 + (*p++ - '0');
   95|  9.36k|		if (fw > 1024)
  ------------------
  |  Branch (95:7): [True: 0, False: 9.36k]
  ------------------
   96|      0|			break;
   97|  9.36k|	}
   98|       |
   99|   187k|	*pp = p;
  100|       |
  101|   187k|	if (fw < 1024)
  ------------------
  |  Branch (101:6): [True: 187k, False: 0]
  ------------------
  102|   187k|		return 1;
  103|      0|	if (msg)
  ------------------
  |  Branch (103:6): [True: 0, False: 0]
  ------------------
  104|      0|		snprintf(msg, mlen, "field %s too large: %d", what, fw);
  105|       |
  106|      0|	return 0;
  107|   187k|}
funcs.c:file_clearbuf:
   81|  13.0k|{
   82|  13.0k|	free(ms->o.buf);
   83|       |	ms->o.buf = NULL;
   84|  13.0k|	ms->o.blen = 0;
   85|  13.0k|}
funcs.c:file_error_core:
  216|    427|{
  217|       |	/* Only the first error is ok */
  218|    427|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  495|    427|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (218:6): [True: 4, False: 423]
  ------------------
  219|      4|		return;
  220|    423|	if (lineno != 0) {
  ------------------
  |  Branch (220:6): [True: 34, False: 389]
  ------------------
  221|     34|		file_clearbuf(ms);
  222|     34|		(void)file_printf(ms, "line %" SIZE_T_FORMAT "u:", lineno);
  223|     34|	}
  224|    423|	if (ms->o.buf && *ms->o.buf)
  ------------------
  |  Branch (224:6): [True: 182, False: 241]
  |  Branch (224:19): [True: 182, False: 0]
  ------------------
  225|    182|		(void)file_printf(ms, " ");
  226|    423|	(void)file_vprintf(ms, f, va);
  227|    423|	if (error > 0)
  ------------------
  |  Branch (227:6): [True: 148, False: 275]
  ------------------
  228|    148|		(void)file_printf(ms, " (%s)", strerror(error));
  229|    423|	ms->event_flags |= EVENT_HAD_ERR;
  ------------------
  |  |  495|    423|#define 		EVENT_HAD_ERR		0x01
  ------------------
  230|    423|	ms->error = error;
  231|    423|}
funcs.c:checkdone:
  305|  14.8k|{
  306|  14.8k|	if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|  14.8k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (306:6): [True: 0, False: 14.8k]
  ------------------
  307|      0|		return 1;
  308|  14.8k|	if (file_separator(ms) == -1)
  ------------------
  |  Branch (308:6): [True: 0, False: 14.8k]
  ------------------
  309|      0|		*rv = -1;
  310|  14.8k|	return 0;
  311|  14.8k|}
funcs.c:trim_separator:
  286|  16.4k|{
  287|  16.4k|	size_t l;
  288|       |
  289|  16.4k|	if (ms->o.buf == NULL)
  ------------------
  |  Branch (289:6): [True: 0, False: 16.4k]
  ------------------
  290|      0|		return;
  291|       |
  292|  16.4k|	l = strlen(ms->o.buf);
  293|  16.4k|	if (l < sizeof(FILE_SEPARATOR))
  ------------------
  |  |  276|  16.4k|#define FILE_SEPARATOR "\n- "
  ------------------
  |  Branch (293:6): [True: 0, False: 16.4k]
  ------------------
  294|      0|		return;
  295|       |
  296|  16.4k|	l -= sizeof(FILE_SEPARATOR) - 1;
  ------------------
  |  |  276|  16.4k|#define FILE_SEPARATOR "\n- "
  ------------------
  297|  16.4k|	if (strcmp(ms->o.buf + l, FILE_SEPARATOR) != 0)
  ------------------
  |  |  276|  16.4k|#define FILE_SEPARATOR "\n- "
  ------------------
  |  Branch (297:6): [True: 16.4k, False: 0]
  ------------------
  298|  16.4k|		return;
  299|       |
  300|      0|	ms->o.buf[l] = '\0';
  301|      0|}
funcs.c:check_regex:
  693|  38.7k|{
  694|  38.7k|	char sbuf[512];
  695|  38.7k|	unsigned char oc = '\0';
  696|  38.7k|	const char *p;
  697|  38.7k|	unsigned long l;
  698|  38.7k|	static const char wild[] = "?*+{";
  699|       |
  700|   468k|	for (p = pat; *p; p++) {
  ------------------
  |  Branch (700:16): [True: 429k, False: 38.7k]
  ------------------
  701|   429k|		unsigned char c = *p;
  702|       |		// Avoid repetition of wild characters
  703|   429k|		if (strchr(wild, oc) != NULL && strchr(wild, c) != NULL) {
  ------------------
  |  Branch (703:7): [True: 75.7k, False: 353k]
  |  Branch (703:35): [True: 0, False: 75.7k]
  ------------------
  704|      0|			size_t len = strlen(pat);
  705|      0|			file_magwarn(ms,
  706|      0|			    "repetition-operator operand `%c%c' "
  707|      0|			    "invalid in regex `%s'", oc, c,
  708|      0|			    file_printable(ms, sbuf, sizeof(sbuf), pat, len));
  709|      0|			return -1;
  710|      0|		}
  711|   429k|		if (c == '{') {
  ------------------
  |  Branch (711:7): [True: 97, False: 429k]
  ------------------
  712|     97|			char *ep, *eep;
  713|       |
  714|     97|			if (oc == '}') {
  ------------------
  |  Branch (714:8): [True: 0, False: 97]
  ------------------
  715|      0|				file_magwarn(ms, "cascading repetition "
  716|      0|				    "operators in regex `%s'", pat);
  717|      0|				return -1;
  718|      0|			}
  719|     97|			errno = 0;
  720|     97|			l = strtoul(p + 1, &ep, 10);
  721|     97|			if (ep != p + 1 && l > 1000)
  ------------------
  |  Branch (721:8): [True: 73, False: 24]
  |  Branch (721:23): [True: 0, False: 73]
  ------------------
  722|      0|				goto bounds;
  723|     97|			if (*ep == ',') {
  ------------------
  |  Branch (723:8): [True: 29, False: 68]
  ------------------
  724|     29|				l = strtoul(ep + 1, &eep, 10);
  725|     29|				if (eep != ep + 1 && l > 1000)
  ------------------
  |  Branch (725:9): [True: 29, False: 0]
  |  Branch (725:26): [True: 0, False: 29]
  ------------------
  726|      0|					goto bounds;
  727|     29|			}
  728|     97|		}
  729|   429k|		oc = c;
  730|   429k|		if (isprint(c) || isspace(c) || c == '\b'
  ------------------
  |  Branch (730:7): [True: 429k, False: 182]
  |  Branch (730:21): [True: 178, False: 4]
  |  Branch (730:35): [True: 3, False: 1]
  ------------------
  731|      1|		    || c == 0x8a) // XXX: apple magic fixme
  ------------------
  |  Branch (731:10): [True: 1, False: 0]
  ------------------
  732|   429k|			continue;
  733|      0|		size_t len = strlen(pat);
  734|      0|		file_magwarn(ms,
  735|      0|		    "non-ascii characters in regex \\%#o `%s'",
  736|      0|		    c, file_printable(ms, sbuf, sizeof(sbuf), pat, len));
  737|      0|		return -1;
  738|   429k|	}
  739|  38.7k|	return 0;
  740|      0|bounds:
  741|      0|	file_magwarn(ms, "bounds too large %ld in regex `%s'", l, pat);
  742|      0|	return -1;
  743|  38.7k|}
funcs.c:file_print_guid:
  969|    405|{
  970|    405|#ifndef WIN32
  971|    405|	return snprintf(str, len, "%.8X-%.4hX-%.4hX-%.2hhX%.2hhX-"
  972|    405|	    "%.2hhX%.2hhX%.2hhX%.2hhX%.2hhX%.2hhX",
  973|    405|	    g->data1, g->data2, g->data3, g->data4[0], g->data4[1],
  974|    405|	    g->data4[2], g->data4[3], g->data4[4], g->data4[5],
  975|    405|	    g->data4[6], g->data4[7]);
  976|       |#else
  977|       |	return snprintf(str, len, "%.8X-%.4hX-%.4hX-%.2hX%.2hX-"
  978|       |	    "%.2hX%.2hX%.2hX%.2hX%.2hX%.2hX",
  979|       |	    g->data1, g->data2, g->data3, g->data4[0], g->data4[1],
  980|       |	    g->data4[2], g->data4[3], g->data4[4], g->data4[5],
  981|       |	    g->data4[6], g->data4[7]);
  982|       |#endif
  983|    405|}

file_is_csv:
  137|  16.4k|{
  138|  16.4k|	const unsigned char *uc = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  16.4k|#define CAST(T, b)	((T)(b))
  ------------------
  139|  16.4k|	const unsigned char *ue = uc + b->flen;
  140|  16.4k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  16.4k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  16.4k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  16.4k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  141|       |
  142|  16.4k|	if (!looks_text)
  ------------------
  |  Branch (142:6): [True: 14.0k, False: 2.33k]
  ------------------
  143|  14.0k|		return 0;
  144|       |
  145|  2.33k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  2.33k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  2.33k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (145:6): [True: 0, False: 2.33k]
  ------------------
  146|      0|		return 0;
  147|       |
  148|  2.33k|	if (!csv_parse(uc, ue))
  ------------------
  |  Branch (148:6): [True: 2.32k, False: 11]
  ------------------
  149|  2.32k|		return 0;
  150|       |
  151|     11|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     11|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (151:6): [True: 0, False: 11]
  ------------------
  152|      0|		return 1;
  153|       |
  154|     11|	if (mime) {
  ------------------
  |  Branch (154:6): [True: 0, False: 11]
  ------------------
  155|      0|		if (file_printf(ms, "text/csv") == -1)
  ------------------
  |  Branch (155:7): [True: 0, False: 0]
  ------------------
  156|      0|			return -1;
  157|      0|		return 1;
  158|      0|	}
  159|       |
  160|     11|	if (file_printf(ms, "CSV %s%stext", code ? code : "",
  ------------------
  |  Branch (160:6): [True: 0, False: 11]
  |  Branch (160:38): [True: 11, False: 0]
  ------------------
  161|     11|	    code ? " " : "") == -1)
  ------------------
  |  Branch (161:6): [True: 11, False: 0]
  ------------------
  162|      0|		return -1;
  163|       |
  164|     11|	return 1;
  165|     11|}
is_csv.c:csv_parse:
   94|  2.33k|{
   95|  2.33k|	size_t nf = 0, tf = 0, nl = 0;
   96|       |
   97|   495M|	while (uc < ue) {
  ------------------
  |  Branch (97:9): [True: 495M, False: 2.14k]
  ------------------
   98|   495M|		switch (*uc++) {
   99|  3.61M|		case '"':
  ------------------
  |  Branch (99:3): [True: 3.61M, False: 491M]
  ------------------
  100|       |			// Eat until the matching quote
  101|  3.61M|			uc = eatquote(uc, ue);
  102|  3.61M|			break;
  103|  9.20M|		case ',':
  ------------------
  |  Branch (103:3): [True: 9.20M, False: 486M]
  ------------------
  104|  9.20M|			nf++;
  105|  9.20M|			break;
  106|    350|		case '\n':
  ------------------
  |  Branch (106:3): [True: 350, False: 495M]
  ------------------
  107|    350|			DPRINTF("nl=%zu nf=%zu tf=%zu\n", nl, nf, tf);
  108|    350|			nl++;
  109|    350|#if CSV_LINES
  110|    350|			if (nl == CSV_LINES)
  ------------------
  |  |   62|    350|#define CSV_LINES 10
  ------------------
  |  Branch (110:8): [True: 6, False: 344]
  ------------------
  111|      6|				return tf > 1 && tf == nf;
  ------------------
  |  Branch (111:12): [True: 3, False: 3]
  |  Branch (111:22): [True: 3, False: 0]
  ------------------
  112|    344|#endif
  113|    344|			if (tf == 0) {
  ------------------
  |  Branch (113:8): [True: 222, False: 122]
  ------------------
  114|       |				// First time and no fields, give up
  115|    222|				if (nf == 0) 
  ------------------
  |  Branch (115:9): [True: 146, False: 76]
  ------------------
  116|    146|					return 0;
  117|       |				// First time, set the number of fields
  118|     76|				tf = nf;
  119|    122|			} else if (tf != nf) {
  ------------------
  |  Branch (119:15): [True: 40, False: 82]
  ------------------
  120|       |				// Field number mismatch, we are done.
  121|     40|				return 0;
  122|     40|			}
  123|    158|			nf = 0;
  124|    158|			break;
  125|   482M|		default:
  ------------------
  |  Branch (125:3): [True: 482M, False: 12.8M]
  ------------------
  126|   482M|			break;
  127|   495M|		}
  128|   495M|	}
  129|  2.14k|	DPRINTF("tf=%zu>1 nl=%zu>=2\n", tf, nl);
  130|  2.14k|	return tf >= 1 && nl >= 2;
  ------------------
  |  Branch (130:9): [True: 30, False: 2.11k]
  |  Branch (130:20): [True: 8, False: 22]
  ------------------
  131|  2.33k|}
is_csv.c:eatquote:
   69|  3.61M|{
   70|  3.61M|	int quote = 0;
   71|       |
   72|   101M|	while (uc < ue) {
  ------------------
  |  Branch (72:9): [True: 101M, False: 214]
  ------------------
   73|   101M|		unsigned char c = *uc++;
   74|   101M|		if (c != '"') {
  ------------------
  |  Branch (74:7): [True: 97.9M, False: 3.73M]
  ------------------
   75|       |			// We already got one, done.
   76|  97.9M|			if (quote) {
  ------------------
  |  Branch (76:8): [True: 3.61M, False: 94.3M]
  ------------------
   77|  3.61M|				return --uc;
   78|  3.61M|			}
   79|  94.3M|			continue;
   80|  97.9M|		}
   81|  3.73M|		if (quote) {
  ------------------
  |  Branch (81:7): [True: 64.3k, False: 3.67M]
  ------------------
   82|       |			// quote-quote escapes
   83|  64.3k|			quote = 0;
   84|  64.3k|			continue;
   85|  64.3k|		}
   86|       |		// first quote
   87|  3.67M|		quote = 1;
   88|  3.67M|	}
   89|    214|	return ue;
   90|  3.61M|}

file_is_json:
  423|  16.4k|{
  424|  16.4k|	const unsigned char *uc = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  16.4k|#define CAST(T, b)	((T)(b))
  ------------------
  425|  16.4k|	const unsigned char *ue = uc + b->flen;
  426|  16.4k|	size_t st[JSON_MAX];
  427|  16.4k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  16.4k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  16.4k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  16.4k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  428|  16.4k|	int jt;
  429|       |
  430|       |
  431|  16.4k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  16.4k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  16.4k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (431:6): [True: 0, False: 16.4k]
  ------------------
  432|      0|		return 0;
  433|       |
  434|  16.4k|	memset(st, 0, sizeof(st));
  435|       |
  436|  16.4k|	if ((jt = json_parse(&uc, ue, st, 0)) == 0)
  ------------------
  |  Branch (436:6): [True: 16.3k, False: 50]
  ------------------
  437|  16.3k|		return 0;
  438|       |
  439|     50|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     50|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (439:6): [True: 0, False: 50]
  ------------------
  440|      0|		return 1;
  441|     50|	if (mime) {
  ------------------
  |  Branch (441:6): [True: 0, False: 50]
  ------------------
  442|      0|		if (file_printf(ms, "application/%s",
  ------------------
  |  Branch (442:7): [True: 0, False: 0]
  ------------------
  443|      0|		    jt == 1 ? "json" : "x-ndjson") == -1)
  ------------------
  |  Branch (443:7): [True: 0, False: 0]
  ------------------
  444|      0|			return -1;
  445|      0|		return 1;
  446|      0|	}
  447|     50|	if (file_printf(ms, "%sJSON text data",
  ------------------
  |  Branch (447:6): [True: 0, False: 50]
  ------------------
  448|     50|	    jt == 1 ? "" : "New Line Delimited ") == -1)
  ------------------
  |  Branch (448:6): [True: 29, False: 21]
  ------------------
  449|      0|		return -1;
  450|       |#if JSON_COUNT
  451|       |#define P(n) st[n], st[n] > 1 ? "s" : ""
  452|       |	if (file_printf(ms, " (%" SIZE_T_FORMAT "u object%s, %" SIZE_T_FORMAT
  453|       |	    "u array%s, %" SIZE_T_FORMAT "u string%s, %" SIZE_T_FORMAT
  454|       |	    "u constant%s, %" SIZE_T_FORMAT "u number%s, %" SIZE_T_FORMAT
  455|       |	    "u >1array%s)",
  456|       |	    P(JSON_OBJECT), P(JSON_ARRAY), P(JSON_STRING), P(JSON_CONSTANT),
  457|       |	    P(JSON_NUMBER), P(JSON_ARRAYN))
  458|       |	    == -1)
  459|       |		return -1;
  460|       |#endif
  461|     50|	return 1;
  462|     50|}
is_json.c:json_parse:
  348|  32.2k|{
  349|  32.2k|	const unsigned char *uc, *ouc;
  350|  32.2k|	int rv = 0;
  351|  32.2k|	int t;
  352|       |
  353|  32.2k|	ouc = uc = json_skip_space(*ucp, ue);
  354|  32.2k|	if (uc == ue)
  ------------------
  |  Branch (354:6): [True: 128, False: 32.0k]
  ------------------
  355|    128|		goto out;
  356|       |
  357|       |	// Avoid recursion
  358|  32.0k|	if (lvl > 500) {
  ------------------
  |  Branch (358:6): [True: 1, False: 32.0k]
  ------------------
  359|      1|		DPRINTF("Too many levels", uc, *ucp);
  ------------------
  |  |   52|      1|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1]
  |  |  ------------------
  ------------------
  360|      1|		return 0;
  361|      1|	}
  362|       |#if JSON_COUNT
  363|       |	/* bail quickly if not counting */
  364|       |	if (lvl > 1 && (st[JSON_OBJECT] || st[JSON_ARRAYN]))
  365|       |		return 1;
  366|       |#endif
  367|       |
  368|  32.0k|	DPRINTF("Parse general: ", uc, *ucp);
  ------------------
  |  |   52|  32.0k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 32.0k]
  |  |  ------------------
  ------------------
  369|  32.0k|	switch (*uc++) {
  370|    462|	case '"':
  ------------------
  |  Branch (370:2): [True: 462, False: 31.6k]
  ------------------
  371|    462|		rv = json_parse_string(&uc, ue, lvl + 1);
  372|    462|		t = JSON_STRING;
  ------------------
  |  |   60|    462|#define JSON_STRING	4
  ------------------
  373|    462|		break;
  374|  4.63k|	case '[':
  ------------------
  |  Branch (374:2): [True: 4.63k, False: 27.4k]
  ------------------
  375|  4.63k|		rv = json_parse_array(&uc, ue, st, lvl + 1);
  376|  4.63k|		t = JSON_ARRAY;
  ------------------
  |  |   56|  4.63k|#define JSON_ARRAY	0
  ------------------
  377|  4.63k|		break;
  378|  7.20k|	case '{': /* '}' */
  ------------------
  |  Branch (378:2): [True: 7.20k, False: 24.8k]
  ------------------
  379|  7.20k|		rv = json_parse_object(&uc, ue, st, lvl + 1);
  380|  7.20k|		t = JSON_OBJECT;
  ------------------
  |  |   59|  7.20k|#define JSON_OBJECT	3
  ------------------
  381|  7.20k|		break;
  382|    376|	case 't':
  ------------------
  |  Branch (382:2): [True: 376, False: 31.6k]
  ------------------
  383|    376|		rv = json_parse_const(&uc, ue, "true", sizeof("true"), lvl + 1);
  384|    376|		t = JSON_CONSTANT;
  ------------------
  |  |   57|    376|#define JSON_CONSTANT	1
  ------------------
  385|    376|		break;
  386|    316|	case 'f':
  ------------------
  |  Branch (386:2): [True: 316, False: 31.7k]
  ------------------
  387|    316|		rv = json_parse_const(&uc, ue, "false", sizeof("false"),
  388|    316|		    lvl + 1);
  389|    316|		t = JSON_CONSTANT;
  ------------------
  |  |   57|    316|#define JSON_CONSTANT	1
  ------------------
  390|    316|		break;
  391|    351|	case 'n':
  ------------------
  |  Branch (391:2): [True: 351, False: 31.7k]
  ------------------
  392|    351|		rv = json_parse_const(&uc, ue, "null", sizeof("null"), lvl + 1);
  393|    351|		t = JSON_CONSTANT;
  ------------------
  |  |   57|    351|#define JSON_CONSTANT	1
  ------------------
  394|    351|		break;
  395|  18.7k|	default:
  ------------------
  |  Branch (395:2): [True: 18.7k, False: 13.3k]
  ------------------
  396|  18.7k|		--uc;
  397|  18.7k|		rv = json_parse_number(&uc, ue, lvl + 1);
  398|  18.7k|		t = JSON_NUMBER;
  ------------------
  |  |   58|  18.7k|#define JSON_NUMBER	2
  ------------------
  399|  18.7k|		break;
  400|  32.0k|	}
  401|  32.0k|	if (rv)
  ------------------
  |  Branch (401:6): [True: 12.5k, False: 19.5k]
  ------------------
  402|  12.5k|		st[t]++;
  403|  32.0k|	uc = json_skip_space(uc, ue);
  404|  32.2k|out:
  405|  32.2k|	DPRINTF("End general: ", uc, *ucp);
  ------------------
  |  |   52|  32.2k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 32.2k]
  |  |  ------------------
  ------------------
  406|  32.2k|	*ucp = uc;
  407|  32.2k|	if (lvl == 0) {
  ------------------
  |  Branch (407:6): [True: 16.4k, False: 15.7k]
  ------------------
  408|  16.4k|		if (!rv)
  ------------------
  |  Branch (408:7): [True: 15.9k, False: 454]
  ------------------
  409|  15.9k|			return 0;
  410|    454|		if (uc == ue)
  ------------------
  |  Branch (410:7): [True: 126, False: 328]
  ------------------
  411|    126|			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 1 : 0;
  ------------------
  |  |   61|    126|#define JSON_ARRAYN	5
  ------------------
              			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 1 : 0;
  ------------------
  |  |   59|    117|#define JSON_OBJECT	3
  ------------------
  |  Branch (411:12): [True: 9, False: 117]
  |  Branch (411:31): [True: 20, False: 97]
  ------------------
  412|    328|		if (*ouc == *uc && json_parse(&uc, ue, st, 1))
  ------------------
  |  Branch (412:7): [True: 68, False: 260]
  |  Branch (412:22): [True: 56, False: 12]
  ------------------
  413|     56|			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 2 : 0;
  ------------------
  |  |   61|     56|#define JSON_ARRAYN	5
  ------------------
              			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 2 : 0;
  ------------------
  |  |   59|     39|#define JSON_OBJECT	3
  ------------------
  |  Branch (413:12): [True: 17, False: 39]
  |  Branch (413:31): [True: 4, False: 35]
  ------------------
  414|    272|		else
  415|    272|			return 0;
  416|    328|	}
  417|  15.7k|	return rv;
  418|  32.2k|}
is_json.c:json_skip_space:
  119|  95.4k|{
  120|  19.8M|	while (uc < ue && json_isspace(*uc))
  ------------------
  |  Branch (120:9): [True: 19.8M, False: 3.93k]
  |  Branch (120:20): [True: 19.7M, False: 91.5k]
  ------------------
  121|  19.7M|		uc++;
  122|  95.4k|	return uc;
  123|  95.4k|}
is_json.c:json_isspace:
   79|  19.8M|{
   80|  19.8M|	switch (uc) {
   81|  7.84M|	case ' ':
  ------------------
  |  Branch (81:2): [True: 7.84M, False: 11.9M]
  ------------------
   82|  16.0M|	case '\n':
  ------------------
  |  Branch (82:2): [True: 8.21M, False: 11.5M]
  ------------------
   83|  19.6M|	case '\r':
  ------------------
  |  Branch (83:2): [True: 3.60M, False: 16.2M]
  ------------------
   84|  19.7M|	case '\t':
  ------------------
  |  Branch (84:2): [True: 46.1k, False: 19.7M]
  ------------------
   85|  19.7M|		return 1;
   86|  91.5k|	default:
  ------------------
  |  Branch (86:2): [True: 91.5k, False: 19.7M]
  ------------------
   87|  91.5k|		return 0;
   88|  19.8M|	}
   89|  19.8M|}
is_json.c:json_parse_string:
  129|  8.69k|{
  130|  8.69k|	const unsigned char *uc = *ucp;
  131|  8.69k|	size_t i;
  132|       |
  133|  8.69k|	DPRINTF("Parse string: ", uc, *ucp);
  ------------------
  |  |   52|  8.69k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 8.69k]
  |  |  ------------------
  ------------------
  134|  47.7M|	while (uc < ue) {
  ------------------
  |  Branch (134:9): [True: 47.7M, False: 107]
  ------------------
  135|  47.7M|		switch (*uc++) {
  136|      5|		case '\0':
  ------------------
  |  Branch (136:3): [True: 5, False: 47.7M]
  ------------------
  137|      5|			goto out;
  138|  21.0M|		case '\\':
  ------------------
  |  Branch (138:3): [True: 21.0M, False: 26.6M]
  ------------------
  139|  21.0M|			if (uc == ue)
  ------------------
  |  Branch (139:8): [True: 13, False: 21.0M]
  ------------------
  140|     13|				goto out;
  141|  21.0M|			switch (*uc++) {
  142|      1|			case '\0':
  ------------------
  |  Branch (142:4): [True: 1, False: 21.0M]
  ------------------
  143|      1|				goto out;
  144|  3.53M|			case '"':
  ------------------
  |  Branch (144:4): [True: 3.53M, False: 17.5M]
  ------------------
  145|  15.2M|			case '\\':
  ------------------
  |  Branch (145:4): [True: 11.7M, False: 9.32M]
  ------------------
  146|  15.2M|			case '/':
  ------------------
  |  Branch (146:4): [True: 271, False: 21.0M]
  ------------------
  147|  16.7M|			case 'b':
  ------------------
  |  Branch (147:4): [True: 1.42M, False: 19.6M]
  ------------------
  148|  16.7M|			case 'f':
  ------------------
  |  Branch (148:4): [True: 264, False: 21.0M]
  ------------------
  149|  16.7M|			case 'n':
  ------------------
  |  Branch (149:4): [True: 263, False: 21.0M]
  ------------------
  150|  17.4M|			case 'r':
  ------------------
  |  Branch (150:4): [True: 714k, False: 20.3M]
  ------------------
  151|  21.0M|			case 't':
  ------------------
  |  Branch (151:4): [True: 3.64M, False: 17.4M]
  ------------------
  152|  21.0M|				continue;
  153|  1.20k|			case 'u':
  ------------------
  |  Branch (153:4): [True: 1.20k, False: 21.0M]
  ------------------
  154|  1.20k|				if (ue - uc < 4) {
  ------------------
  |  Branch (154:9): [True: 5, False: 1.19k]
  ------------------
  155|      5|					uc = ue;
  156|      5|					goto out;
  157|      5|				}
  158|  5.92k|				for (i = 0; i < 4; i++)
  ------------------
  |  Branch (158:17): [True: 4.75k, False: 1.16k]
  ------------------
  159|  4.75k|					if (!json_isxdigit(*uc++))
  ------------------
  |  Branch (159:10): [True: 28, False: 4.72k]
  ------------------
  160|     28|						goto out;
  161|  1.16k|				continue;
  162|  1.16k|			default:
  ------------------
  |  Branch (162:4): [True: 19, False: 21.0M]
  ------------------
  163|     19|				goto out;
  164|  21.0M|			}
  165|  8.51k|		case '"':
  ------------------
  |  Branch (165:3): [True: 8.51k, False: 47.7M]
  ------------------
  166|  8.51k|			DPRINTF("Good string: ", uc, *ucp);
  ------------------
  |  |   52|  8.51k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 8.51k]
  |  |  ------------------
  ------------------
  167|  8.51k|			*ucp = uc;
  168|  8.51k|			return 1;
  169|  26.6M|		default:
  ------------------
  |  Branch (169:3): [True: 26.6M, False: 21.0M]
  ------------------
  170|  26.6M|			continue;
  171|  47.7M|		}
  172|  47.7M|	}
  173|    178|out:
  174|    178|	DPRINTF("Bad string: ", uc, *ucp);
  ------------------
  |  |   52|    178|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 178]
  |  |  ------------------
  ------------------
  175|    178|	*ucp = uc;
  176|    178|	return 0;
  177|  8.69k|}
is_json.c:json_isxdigit:
  105|  4.75k|{
  106|  4.75k|	if (json_isdigit(uc))
  ------------------
  |  Branch (106:6): [True: 549, False: 4.20k]
  ------------------
  107|    549|		return 1;
  108|  4.20k|	switch (uc) {
  109|  1.49k|	case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
  ------------------
  |  Branch (109:2): [True: 5, False: 4.20k]
  |  Branch (109:12): [True: 305, False: 3.90k]
  |  Branch (109:22): [True: 9, False: 4.19k]
  |  Branch (109:32): [True: 221, False: 3.98k]
  |  Branch (109:42): [True: 603, False: 3.60k]
  |  Branch (109:52): [True: 351, False: 3.85k]
  ------------------
  110|  4.17k|	case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
  ------------------
  |  Branch (110:2): [True: 231, False: 3.97k]
  |  Branch (110:12): [True: 1.32k, False: 2.87k]
  |  Branch (110:22): [True: 926, False: 3.27k]
  |  Branch (110:32): [True: 6, False: 4.19k]
  |  Branch (110:42): [True: 185, False: 4.02k]
  |  Branch (110:52): [True: 7, False: 4.19k]
  ------------------
  111|  4.17k|		return 1;
  112|     28|	default:
  ------------------
  |  Branch (112:2): [True: 28, False: 4.17k]
  ------------------
  113|     28|		return 0;
  114|  4.20k|	}
  115|  4.20k|}
is_json.c:json_isdigit:
   93|  61.8M|{
   94|  61.8M|	switch (uc) {
   95|  58.2M|	case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (95:2): [True: 58.1M, False: 3.75M]
  |  Branch (95:12): [True: 26.9k, False: 61.8M]
  |  Branch (95:22): [True: 332, False: 61.8M]
  |  Branch (95:32): [True: 65.7k, False: 61.8M]
  |  Branch (95:42): [True: 66.8k, False: 61.8M]
  ------------------
   96|  61.8M|	case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (96:2): [True: 1.51M, False: 60.3M]
  |  Branch (96:12): [True: 199, False: 61.8M]
  |  Branch (96:22): [True: 2.04M, False: 59.8M]
  |  Branch (96:32): [True: 307, False: 61.8M]
  |  Branch (96:42): [True: 622, False: 61.8M]
  ------------------
   97|  61.8M|		return 1;
   98|  42.3k|	default:
  ------------------
  |  Branch (98:2): [True: 42.3k, False: 61.8M]
  ------------------
   99|  42.3k|		return 0;
  100|  61.8M|	}
  101|  61.8M|}
is_json.c:json_parse_array:
  182|  4.63k|{
  183|  4.63k|	const unsigned char *uc = *ucp;
  184|       |
  185|  4.63k|	DPRINTF("Parse array: ", uc, *ucp);
  ------------------
  |  |   52|  4.63k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 4.63k]
  |  |  ------------------
  ------------------
  186|  8.05k|	while (uc < ue) {
  ------------------
  |  Branch (186:9): [True: 7.99k, False: 54]
  ------------------
  187|  7.99k|		uc = json_skip_space(uc, ue);
  188|  7.99k|		if (uc == ue)
  ------------------
  |  Branch (188:7): [True: 13, False: 7.98k]
  ------------------
  189|     13|			goto out;
  190|  7.98k|		if (*uc == ']')
  ------------------
  |  Branch (190:7): [True: 460, False: 7.52k]
  ------------------
  191|    460|			goto done;
  192|  7.52k|		if (!json_parse(&uc, ue, st, lvl + 1))
  ------------------
  |  Branch (192:7): [True: 3.50k, False: 4.02k]
  ------------------
  193|  3.50k|			goto out;
  194|  4.02k|		if (uc == ue)
  ------------------
  |  Branch (194:7): [True: 55, False: 3.96k]
  ------------------
  195|     55|			goto out;
  196|  3.96k|		switch (*uc) {
  197|  3.41k|		case ',':
  ------------------
  |  Branch (197:3): [True: 3.41k, False: 554]
  ------------------
  198|  3.41k|			uc++;
  199|  3.41k|			continue;
  200|    540|		case ']':
  ------------------
  |  Branch (200:3): [True: 540, False: 3.42k]
  ------------------
  201|  1.00k|		done:
  202|  1.00k|			st[JSON_ARRAYN]++;
  ------------------
  |  |   61|  1.00k|#define JSON_ARRAYN	5
  ------------------
  203|  1.00k|			DPRINTF("Good array: ", uc, *ucp);
  ------------------
  |  |   52|  1.00k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.00k]
  |  |  ------------------
  ------------------
  204|  1.00k|			*ucp = uc + 1;
  205|  1.00k|			return 1;
  206|     14|		default:
  ------------------
  |  Branch (206:3): [True: 14, False: 3.95k]
  ------------------
  207|     14|			goto out;
  208|  3.96k|		}
  209|  3.96k|	}
  210|  3.63k|out:
  211|  3.63k|	DPRINTF("Bad array: ", uc,  *ucp);
  ------------------
  |  |   52|  3.63k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 3.63k]
  |  |  ------------------
  ------------------
  212|  3.63k|	*ucp = uc;
  213|  3.63k|	return 0;
  214|  4.63k|}
is_json.c:json_parse_object:
  219|  7.20k|{
  220|  7.20k|	const unsigned char *uc = *ucp;
  221|  7.20k|	DPRINTF("Parse object: ", uc, *ucp);
  ------------------
  |  |   52|  7.20k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 7.20k]
  |  |  ------------------
  ------------------
  222|  14.9k|	while (uc < ue) {
  ------------------
  |  Branch (222:9): [True: 14.9k, False: 7]
  ------------------
  223|  14.9k|		uc = json_skip_space(uc, ue);
  224|  14.9k|		if (uc == ue)
  ------------------
  |  Branch (224:7): [True: 13, False: 14.9k]
  ------------------
  225|     13|			goto out;
  226|  14.9k|		if (*uc == '}') {
  ------------------
  |  Branch (226:7): [True: 6.69k, False: 8.26k]
  ------------------
  227|  6.69k|			uc++;
  228|  6.69k|			goto done;
  229|  6.69k|		}
  230|  8.26k|		if (*uc++ != '"') {
  ------------------
  |  Branch (230:7): [True: 29, False: 8.23k]
  ------------------
  231|     29|			DPRINTF("not string", uc, *ucp);
  ------------------
  |  |   52|     29|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 29]
  |  |  ------------------
  ------------------
  232|     29|			goto out;
  233|     29|		}
  234|  8.23k|		DPRINTF("next field", uc, *ucp);
  ------------------
  |  |   52|  8.23k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 8.23k]
  |  |  ------------------
  ------------------
  235|  8.23k|		if (!json_parse_string(&uc, ue, lvl)) {
  ------------------
  |  Branch (235:7): [True: 5, False: 8.22k]
  ------------------
  236|      5|			DPRINTF("not string", uc, *ucp);
  ------------------
  |  |   52|      5|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 5]
  |  |  ------------------
  ------------------
  237|      5|			goto out;
  238|      5|		}
  239|  8.22k|		uc = json_skip_space(uc, ue);
  240|  8.22k|		if (uc == ue)
  ------------------
  |  Branch (240:7): [True: 13, False: 8.21k]
  ------------------
  241|     13|			goto out;
  242|  8.21k|		if (*uc++ != ':') {
  ------------------
  |  Branch (242:7): [True: 16, False: 8.19k]
  ------------------
  243|     16|			DPRINTF("not colon", uc, *ucp);
  ------------------
  |  |   52|     16|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 16]
  |  |  ------------------
  ------------------
  244|     16|			goto out;
  245|     16|		}
  246|  8.19k|		if (!json_parse(&uc, ue, st, lvl + 1)) {
  ------------------
  |  Branch (246:7): [True: 203, False: 7.99k]
  ------------------
  247|    203|			DPRINTF("not json", uc, *ucp);
  ------------------
  |  |   52|    203|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 203]
  |  |  ------------------
  ------------------
  248|    203|			goto out;
  249|    203|		}
  250|  7.99k|		if (uc == ue)
  ------------------
  |  Branch (250:7): [True: 2, False: 7.99k]
  ------------------
  251|      2|			goto out;
  252|  7.99k|		switch (*uc++) {
  253|  7.77k|		case ',':
  ------------------
  |  Branch (253:3): [True: 7.77k, False: 221]
  ------------------
  254|  7.77k|			continue;
  255|    220|		case '}': /* { */
  ------------------
  |  Branch (255:3): [True: 220, False: 7.77k]
  ------------------
  256|  6.91k|		done:
  257|  6.91k|			DPRINTF("Good object: ", uc, *ucp);
  ------------------
  |  |   52|  6.91k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 6.91k]
  |  |  ------------------
  ------------------
  258|  6.91k|			*ucp = uc;
  259|  6.91k|			return 1;
  260|      1|		default:
  ------------------
  |  Branch (260:3): [True: 1, False: 7.99k]
  ------------------
  261|      1|			DPRINTF("not more", uc, *ucp);
  ------------------
  |  |   52|      1|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1]
  |  |  ------------------
  ------------------
  262|      1|			*ucp = uc - 1;
  263|      1|			goto out;
  264|  7.99k|		}
  265|  7.99k|	}
  266|    289|out:
  267|    289|	DPRINTF("Bad object: ", uc, *ucp);
  ------------------
  |  |   52|    289|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 289]
  |  |  ------------------
  ------------------
  268|    289|	*ucp = uc;
  269|    289|	return 0;
  270|  7.20k|}
is_json.c:json_parse_const:
  328|  1.04k|{
  329|  1.04k|	const unsigned char *uc = *ucp;
  330|       |
  331|  1.04k|	DPRINTF("Parse const: ", uc, *ucp);
  ------------------
  |  |   52|  1.04k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.04k]
  |  |  ------------------
  ------------------
  332|  1.04k|	*ucp += --len - 1;
  333|  1.04k|	if (*ucp > ue)
  ------------------
  |  Branch (333:6): [True: 65, False: 978]
  ------------------
  334|     65|		*ucp = ue;
  335|  4.15k|	for (; uc < ue && --len;) {
  ------------------
  |  Branch (335:9): [True: 4.09k, False: 56]
  |  Branch (335:20): [True: 3.18k, False: 915]
  ------------------
  336|  3.18k|		if (*uc++ != *++str) {
  ------------------
  |  Branch (336:7): [True: 72, False: 3.11k]
  ------------------
  337|     72|			DPRINTF("Bad const: ", uc, *ucp);
  ------------------
  |  |   52|     72|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 72]
  |  |  ------------------
  ------------------
  338|     72|			return 0;
  339|     72|		}
  340|  3.18k|	}
  341|    971|	DPRINTF("Good const: ", uc, *ucp);
  ------------------
  |  |   52|    971|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 971]
  |  |  ------------------
  ------------------
  342|    971|	return 1;
  343|  1.04k|}
is_json.c:json_parse_number:
  276|  18.7k|{
  277|  18.7k|	const unsigned char *uc = *ucp;
  278|  18.7k|	int got = 0;
  279|       |
  280|  18.7k|	DPRINTF("Parse number: ", uc, *ucp);
  ------------------
  |  |   52|  18.7k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 18.7k]
  |  |  ------------------
  ------------------
  281|  18.7k|	if (uc == ue)
  ------------------
  |  Branch (281:6): [True: 0, False: 18.7k]
  ------------------
  282|      0|		return 0;
  283|  18.7k|	if (*uc == '-')
  ------------------
  |  Branch (283:6): [True: 1.38k, False: 17.3k]
  ------------------
  284|  1.38k|		uc++;
  285|       |
  286|  58.3M|	for (; uc < ue; uc++) {
  ------------------
  |  Branch (286:9): [True: 58.3M, False: 58]
  ------------------
  287|  58.3M|		if (!json_isdigit(*uc))
  ------------------
  |  Branch (287:7): [True: 18.6k, False: 58.3M]
  ------------------
  288|  18.6k|			break;
  289|  58.3M|		got = 1;
  290|  58.3M|	}
  291|  18.7k|	if (uc == ue)
  ------------------
  |  Branch (291:6): [True: 58, False: 18.6k]
  ------------------
  292|     58|		goto out;
  293|  18.6k|	if (*uc == '.')
  ------------------
  |  Branch (293:6): [True: 419, False: 18.2k]
  ------------------
  294|    419|		uc++;
  295|  1.19M|	for (; uc < ue; uc++) {
  ------------------
  |  Branch (295:9): [True: 1.19M, False: 24]
  ------------------
  296|  1.19M|		if (!json_isdigit(*uc))
  ------------------
  |  Branch (296:7): [True: 18.6k, False: 1.18M]
  ------------------
  297|  18.6k|			break;
  298|  1.18M|		got = 1;
  299|  1.18M|	}
  300|  18.6k|	if (uc == ue)
  ------------------
  |  Branch (300:6): [True: 24, False: 18.6k]
  ------------------
  301|     24|		goto out;
  302|  18.6k|	if (got && (*uc == 'e' || *uc == 'E')) {
  ------------------
  |  Branch (302:6): [True: 3.34k, False: 15.3k]
  |  Branch (302:14): [True: 395, False: 2.95k]
  |  Branch (302:28): [True: 521, False: 2.43k]
  ------------------
  303|    916|		uc++;
  304|    916|		got = 0;
  305|    916|		if (uc == ue)
  ------------------
  |  Branch (305:7): [True: 14, False: 902]
  ------------------
  306|     14|			goto out;
  307|    902|		if (*uc == '+' || *uc == '-')
  ------------------
  |  Branch (307:7): [True: 194, False: 708]
  |  Branch (307:21): [True: 333, False: 375]
  ------------------
  308|    527|			uc++;
  309|  2.32M|		for (; uc < ue; uc++) {
  ------------------
  |  Branch (309:10): [True: 2.32M, False: 30]
  ------------------
  310|  2.32M|			if (!json_isdigit(*uc))
  ------------------
  |  Branch (310:8): [True: 872, False: 2.32M]
  ------------------
  311|    872|				break;
  312|  2.32M|			got = 1;
  313|  2.32M|		}
  314|    902|	}
  315|  18.7k|out:
  316|  18.7k|	if (!got)
  ------------------
  |  Branch (316:6): [True: 15.3k, False: 3.35k]
  ------------------
  317|  15.3k|		DPRINTF("Bad number: ", uc, *ucp);
  ------------------
  |  |   52|  15.3k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 15.3k]
  |  |  ------------------
  ------------------
  318|  3.35k|	else
  319|  3.35k|		DPRINTF("Good number: ", uc, *ucp);
  ------------------
  |  |   52|  3.35k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 3.35k]
  |  |  ------------------
  ------------------
  320|  18.7k|	*ucp = uc;
  321|  18.7k|	return got;
  322|  18.6k|}

file_is_simh:
  158|  16.4k|{
  159|  16.4k|	const unsigned char *uc = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  16.4k|#define CAST(T, b)	((T)(b))
  ------------------
  160|  16.4k|	const unsigned char *ue = uc + b->flen;
  161|  16.4k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  16.4k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  16.4k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  16.4k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  162|       |
  163|  16.4k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  16.4k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  16.4k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (163:6): [True: 0, False: 16.4k]
  ------------------
  164|      0|		return 0;
  165|       |
  166|  16.4k|	if (!simh_parse(uc, ue))
  ------------------
  |  Branch (166:6): [True: 16.3k, False: 39]
  ------------------
  167|  16.3k|		return 0;
  168|       |
  169|     39|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     39|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (169:6): [True: 0, False: 39]
  ------------------
  170|      0|		return 1;
  171|       |
  172|     39|	if (mime) {
  ------------------
  |  Branch (172:6): [True: 0, False: 39]
  ------------------
  173|      0|		if (file_printf(ms, "application/SIMH-tape-data") == -1)
  ------------------
  |  Branch (173:7): [True: 0, False: 0]
  ------------------
  174|      0|			return -1;
  175|      0|		return 1;
  176|      0|	}
  177|       |
  178|     39|	if (file_printf(ms, "SIMH tape data") == -1)
  ------------------
  |  Branch (178:6): [True: 0, False: 39]
  ------------------
  179|      0|		return -1;
  180|       |
  181|     39|	return 1;
  182|     39|}
is_simh.c:simh_parse:
  114|  16.4k|{
  115|  16.4k|	uint32_t nbytes, cbytes;
  116|  16.4k|	const unsigned char *orig_uc = uc;
  117|  16.4k|	size_t nt = 0, nr = 0;
  118|  16.4k|	int err = 0;
  119|       |
  120|  16.4k|	(void)memcpy(simh_bo.s, "\01\02\03\04", 4);
  121|       |
  122|  87.7k|	while (ue - uc >= CAST(ptrdiff_t, sizeof(nbytes))) {
  ------------------
  |  |  460|  87.7k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (122:9): [True: 86.8k, False: 874]
  ------------------
  123|  86.8k|		nbytes = getlen(&uc, &err);
  124|  86.8k|		if (err)
  ------------------
  |  Branch (124:7): [True: 11.6k, False: 75.2k]
  ------------------
  125|  11.6k|			return 0;
  126|  75.2k|		if ((nt > 0 || nr > 0) && nbytes == 0xFFFFFFFF)
  ------------------
  |  Branch (126:8): [True: 5.75k, False: 69.4k]
  |  Branch (126:18): [True: 65.5k, False: 3.96k]
  |  Branch (126:29): [True: 3, False: 71.2k]
  ------------------
  127|       |			/* EOM after at least one record or tapemark */
  128|      3|			break;
  129|  75.2k|		if (nbytes == 0) {
  ------------------
  |  Branch (129:7): [True: 1.76k, False: 73.4k]
  ------------------
  130|  1.76k|			nt++;	/* count tapemarks */
  131|  1.76k|#if SIMH_TAPEMARKS
  132|  1.76k|			if (nt == SIMH_TAPEMARKS)
  ------------------
  |  |   65|  1.76k|#define SIMH_TAPEMARKS 10
  ------------------
  |  Branch (132:8): [True: 163, False: 1.60k]
  ------------------
  133|    163|				break;
  134|  1.60k|#endif
  135|  1.60k|			continue;
  136|  1.76k|		}
  137|       |		/* handle a data record */
  138|  73.4k|		uc += nbytes;
  139|  73.4k|		if (ue - uc < CAST(ptrdiff_t, sizeof(nbytes)))
  ------------------
  |  |  460|  73.4k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (139:7): [True: 3.49k, False: 69.9k]
  ------------------
  140|  3.49k|			break;
  141|  69.9k|		cbytes = getlen(&uc, &err);
  142|  69.9k|		if (err)
  ------------------
  |  Branch (142:7): [True: 88, False: 69.8k]
  ------------------
  143|     88|			return 0;
  144|  69.8k|		if (nbytes != cbytes)
  ------------------
  |  Branch (144:7): [True: 176, False: 69.6k]
  ------------------
  145|    176|			return 0;
  146|  69.6k|		nr++;
  147|  69.6k|	}
  148|  4.53k|	if (nt * sizeof(uint32_t) == CAST(size_t, uc - orig_uc))
  ------------------
  |  |  460|  4.53k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (148:6): [True: 1.02k, False: 3.50k]
  ------------------
  149|  1.02k|		return 0;	/* All examined data was tapemarks (0) */
  150|  3.50k|	if (nr == 0)		/* No records */
  ------------------
  |  Branch (150:6): [True: 3.46k, False: 39]
  ------------------
  151|  3.46k|		return 0;
  152|     39|	return 1;
  153|  3.50k|}
is_simh.c:getlen:
   95|   156k|{
   96|   156k|	uint32_t n;
   97|   156k|	memcpy(&n, *uc, sizeof(n));
   98|   156k|	*err = 0;
   99|   156k|	*uc += sizeof(n);
  100|   156k|	if (NEED_SWAP)
  ------------------
  |  |   75|   156k|#define NEED_SWAP	(simh_bo.u == CAST(uint32_t, 0x01020304))
  |  |  ------------------
  |  |  |  |  460|   156k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (75:19): [True: 0, False: 156k]
  |  |  ------------------
  ------------------
  101|      0|		n = swap4(n);
  102|   156k|	if (n == 0xffffffff)	/* check for End of Medium */
  ------------------
  |  Branch (102:6): [True: 43, False: 156k]
  ------------------
  103|     43|		return n;
  104|       |	/* Check bits 25 to 28 are not used */
  105|   156k|	*err = ((n & 0x00ffffff) != (n & 0x0fffffff));
  106|   156k|	n &= 0x00ffffff;	/* keep only the record len */
  107|   156k|	if (n & 1)
  ------------------
  |  Branch (107:6): [True: 12.1k, False: 144k]
  ------------------
  108|  12.1k|		n++;
  109|   156k|	return n;
  110|   156k|}

file_is_tar:
   64|  16.4k|{
   65|  16.4k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  16.4k|#define CAST(T, b)	((T)(b))
  ------------------
   66|  16.4k|	size_t nbytes = b->flen;
   67|       |	/*
   68|       |	 * Do the tar test first, because if the first file in the tar
   69|       |	 * archive starts with a dot, we can confuse it with an nroff file.
   70|       |	 */
   71|  16.4k|	int tar;
   72|  16.4k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  16.4k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  16.4k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  16.4k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
   73|       |
   74|  16.4k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  16.4k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  16.4k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (74:6): [True: 0, False: 16.4k]
  ------------------
   75|      0|		return 0;
   76|       |
   77|  16.4k|	tar = is_tar(buf, nbytes);
   78|  16.4k|	if (tar < 1 || tar > 3)
  ------------------
  |  Branch (78:6): [True: 16.3k, False: 18]
  |  Branch (78:17): [True: 0, False: 18]
  ------------------
   79|  16.3k|		return 0;
   80|       |
   81|     18|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     18|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (81:6): [True: 0, False: 18]
  ------------------
   82|      0|		return 1;
   83|       |
   84|     18|	if (file_printf(ms, "%s", mime ? "application/x-tar" :
  ------------------
  |  Branch (84:6): [True: 0, False: 18]
  |  Branch (84:28): [True: 0, False: 18]
  ------------------
   85|     18|	    tartype[tar - 1]) == -1)
   86|      0|		return -1;
   87|       |
   88|     18|	return 1;
   89|     18|}
is_tar.c:is_tar:
  100|  16.4k|{
  101|  16.4k|	static const char gpkg_match[] = "/gpkg-1";
  102|       |
  103|  16.4k|	const union record *header = RCAST(const union record *,
  ------------------
  |  |  461|  16.4k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  104|  16.4k|	    RCAST(const void *, buf));
  105|  16.4k|	size_t i;
  106|  16.4k|	int sum, recsum;
  107|  16.4k|	const unsigned char *p, *ep;
  108|  16.4k|	const char *nulp;
  109|       |
  110|  16.4k|	if (nbytes < sizeof(*header))
  ------------------
  |  Branch (110:6): [True: 12.3k, False: 4.01k]
  ------------------
  111|  12.3k|		return 0;
  112|       |
  113|       |	/* If the file looks like Gentoo GLEP 78 binary package (GPKG),
  114|       |	 * don't waste time on further checks and fall back to magic rules.
  115|       |	 */
  116|  4.01k|	nulp = CAST(const char *,
  ------------------
  |  |  460|  4.01k|#define CAST(T, b)	((T)(b))
  ------------------
  117|  4.01k|	    memchr(header->header.name, 0, sizeof(header->header.name)));
  118|  4.01k|	if (nulp != NULL && nulp >= header->header.name + sizeof(gpkg_match) &&
  ------------------
  |  Branch (118:6): [True: 3.58k, False: 429]
  |  Branch (118:22): [True: 2.35k, False: 1.23k]
  ------------------
  119|  2.35k|	    memcmp(nulp - sizeof(gpkg_match) + 1, gpkg_match,
  ------------------
  |  Branch (119:6): [True: 9, False: 2.34k]
  ------------------
  120|  2.35k|	    sizeof(gpkg_match)) == 0)
  121|      9|	    return 0;
  122|       |
  123|  4.00k|	recsum = from_oct(header->header.chksum, sizeof(header->header.chksum));
  124|       |
  125|  4.00k|	sum = 0;
  126|  4.00k|	p = header->charptr;
  127|  4.00k|	ep = header->charptr + sizeof(*header);
  128|  2.05M|	while (p < ep)
  ------------------
  |  Branch (128:9): [True: 2.05M, False: 4.00k]
  ------------------
  129|  2.05M|		sum += *p++;
  130|       |
  131|       |	/* Adjust checksum to count the "chksum" field as blanks. */
  132|  36.0k|	for (i = 0; i < sizeof(header->header.chksum); i++)
  ------------------
  |  Branch (132:14): [True: 32.0k, False: 4.00k]
  ------------------
  133|  32.0k|		sum -= header->header.chksum[i];
  134|  4.00k|	sum += ' ' * sizeof(header->header.chksum);
  135|       |
  136|  4.00k|	if (sum != recsum)
  ------------------
  |  Branch (136:6): [True: 3.98k, False: 18]
  ------------------
  137|  3.98k|		return 0;	/* Not a tar archive */
  138|       |
  139|     18|	if (strncmp(header->header.magic, GNUTMAGIC,
  ------------------
  |  |   73|     18|#define	GNUTMAGIC	"ustar  "	/* 7 chars and a null */
  ------------------
  |  Branch (139:6): [True: 1, False: 17]
  ------------------
  140|     18|	    sizeof(header->header.magic)) == 0)
  141|      1|		return 3;		/* GNU Unix Standard tar archive */
  142|       |
  143|     17|	if (strncmp(header->header.magic, TMAGIC,
  ------------------
  |  |   72|     17|#define	TMAGIC		"ustar"		/* 5 chars and a null */
  ------------------
  |  Branch (143:6): [True: 1, False: 16]
  ------------------
  144|     17|	    sizeof(header->header.magic)) == 0)
  145|      1|		return 2;		/* Unix Standard tar archive */
  146|       |
  147|     16|	return 1;			/* Old fashioned tar archive */
  148|     17|}
is_tar.c:from_oct:
  158|  4.00k|{
  159|  4.00k|	int	value;
  160|       |
  161|  4.73k|	while (digs > 0 && isspace(CAST(unsigned char, *where))) {	/* Skip spaces */
  ------------------
  |  Branch (161:9): [True: 4.65k, False: 79]
  |  Branch (161:21): [True: 724, False: 3.92k]
  ------------------
  162|    724|		where++;
  163|    724|		digs--;
  164|    724|	}
  165|  4.00k|	if (digs == 0)
  ------------------
  |  Branch (165:6): [True: 79, False: 3.92k]
  ------------------
  166|     79|		return -1;		/* All blank field */
  167|  3.92k|	value = 0;
  168|  4.47k|	while (digs > 0 && isodigit(*where)) {	/* Scan til non-octal */
  ------------------
  |  |   51|  4.42k|#define	isodigit(c)	( ((c) >= '0') && ((c) <= '7') )
  |  |  ------------------
  |  |  |  Branch (51:23): [True: 1.22k, False: 3.20k]
  |  |  |  Branch (51:39): [True: 547, False: 676]
  |  |  ------------------
  ------------------
  |  Branch (168:9): [True: 4.42k, False: 47]
  ------------------
  169|    547|		value = (value << 3) | (*where++ - '0');
  170|    547|		digs--;
  171|    547|	}
  172|       |
  173|  3.92k|	if (digs > 0 && *where && !isspace(CAST(unsigned char, *where)))
  ------------------
  |  Branch (173:6): [True: 3.88k, False: 47]
  |  Branch (173:18): [True: 1.60k, False: 2.27k]
  |  Branch (173:28): [True: 1.59k, False: 11]
  ------------------
  174|  1.59k|		return -1;			/* Ended on non-(space/NUL) */
  175|       |
  176|  2.33k|	return value;
  177|  3.92k|}

magic_getpath:
  256|      2|{
  257|      2|	if (magicfile != NULL)
  ------------------
  |  Branch (257:6): [True: 2, False: 0]
  ------------------
  258|      2|		return magicfile;
  259|       |
  260|      0|	magicfile = getenv("MAGIC");
  261|      0|	if (magicfile != NULL)
  ------------------
  |  Branch (261:6): [True: 0, False: 0]
  ------------------
  262|      0|		return magicfile;
  263|       |
  264|      0|	return action == FILE_LOAD ? get_default_magic() : MAGIC;
  ------------------
  |  |  195|      0|#define	FILE_LOAD	0
  ------------------
  |  Branch (264:9): [True: 0, False: 0]
  ------------------
  265|      0|}
magic_open:
  269|      2|{
  270|      2|	return file_ms_alloc(flags);
  271|      2|}
magic_load:
  323|      2|{
  324|      2|	if (ms == NULL)
  ------------------
  |  Branch (324:6): [True: 0, False: 2]
  ------------------
  325|      0|		return -1;
  326|      2|	return file_apprentice(ms, magicfile, FILE_LOAD);
  ------------------
  |  |  195|      2|#define	FILE_LOAD	0
  ------------------
  327|      2|}
magic_descriptor:
  426|  12.8k|{
  427|  12.8k|	if (ms == NULL)
  ------------------
  |  Branch (427:6): [True: 0, False: 12.8k]
  ------------------
  428|      0|		return NULL;
  429|  12.8k|	return file_or_fd(ms, NULL, fd);
  430|  12.8k|}
magic_setflags:
  617|      2|{
  618|      2|	if (ms == NULL)
  ------------------
  |  Branch (618:6): [True: 0, False: 2]
  ------------------
  619|      0|		return -1;
  620|       |#if !defined(HAVE_UTIME) && !defined(HAVE_UTIMES)
  621|       |	if (flags & MAGIC_PRESERVE_ATIME)
  622|       |		return -1;
  623|       |#endif
  624|      2|	ms->flags = flags;
  625|      2|	return 0;
  626|      2|}
magic.c:file_or_fd:
  445|  12.8k|{
  446|  12.8k|	int	rv = -1;
  447|  12.8k|	unsigned char *buf;
  448|  12.8k|	struct stat	sb;
  449|  12.8k|	ssize_t nbytes = 0;	/* number of bytes read from a datafile */
  450|  12.8k|	int	ispipe = 0;
  451|  12.8k|	int	okstat = 0;
  452|  12.8k|	off_t	pos = CAST(off_t, -1);
  ------------------
  |  |  460|  12.8k|#define CAST(T, b)	((T)(b))
  ------------------
  453|       |
  454|  12.8k|	if (file_reset(ms, 1) == -1)
  ------------------
  |  Branch (454:6): [True: 0, False: 12.8k]
  ------------------
  455|      0|		goto out;
  456|       |
  457|       |	/*
  458|       |	 * one extra for terminating '\0', and
  459|       |	 * some overlapping space for matches near EOF
  460|       |	 */
  461|  12.8k|#define SLOP (1 + sizeof(union VALUETYPE))
  462|  12.8k|	if ((buf = CAST(unsigned char *, malloc(ms->bytes_max + SLOP))) == NULL)
  ------------------
  |  |  460|  12.8k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (462:6): [True: 0, False: 12.8k]
  ------------------
  463|      0|		return NULL;
  464|       |
  465|  12.8k|	switch (file_fsmagic(ms, inname, &sb)) {
  466|      0|	case -1:		/* error */
  ------------------
  |  Branch (466:2): [True: 0, False: 12.8k]
  ------------------
  467|      0|		goto done;
  468|  12.8k|	case 0:			/* nothing found */
  ------------------
  |  Branch (468:2): [True: 12.8k, False: 0]
  ------------------
  469|  12.8k|		break;
  470|      0|	default:		/* matched it and printed type */
  ------------------
  |  Branch (470:2): [True: 0, False: 12.8k]
  ------------------
  471|      0|		rv = 0;
  472|      0|		goto done;
  473|  12.8k|	}
  474|       |
  475|       |#ifdef WIN32
  476|       |	/* Place stdin in binary mode, so EOF (Ctrl+Z) doesn't stop early. */
  477|       |	if (fd == STDIN_FILENO)
  478|       |		_setmode(STDIN_FILENO, O_BINARY);
  479|       |#endif
  480|  12.8k|	if (inname != NULL) {
  ------------------
  |  Branch (480:6): [True: 0, False: 12.8k]
  ------------------
  481|      0|		int flags = O_RDONLY|O_BINARY|O_NONBLOCK|O_CLOEXEC;
  ------------------
  |  |  740|      0|#define O_BINARY	0
  ------------------
  482|      0|		errno = 0;
  483|      0|		if ((fd = open(inname, flags)) < 0) {
  ------------------
  |  Branch (483:7): [True: 0, False: 0]
  ------------------
  484|      0|			okstat = stat(inname, &sb) == 0;
  485|       |#ifdef WIN32
  486|       |			/*
  487|       |			 * Can't stat, can't open.  It may have been opened in
  488|       |			 * fsmagic, so if the user doesn't have read permission,
  489|       |			 * allow it to say so; otherwise an error was probably
  490|       |			 * displayed in fsmagic.
  491|       |			 */
  492|       |			if (!okstat && errno == EACCES) {
  493|       |				sb.st_mode = S_IFBLK;
  494|       |				okstat = 1;
  495|       |			}
  496|       |#endif
  497|      0|			if (okstat &&
  ------------------
  |  Branch (497:8): [True: 0, False: 0]
  ------------------
  498|      0|			    unreadable_info(ms, sb.st_mode, inname) == -1)
  ------------------
  |  Branch (498:8): [True: 0, False: 0]
  ------------------
  499|      0|				goto done;
  500|      0|			rv = 0;
  501|      0|			goto done;
  502|      0|		}
  503|       |#if O_CLOEXEC == 0 && defined(F_SETFD)
  504|       |		(void)fcntl(fd, F_SETFD, FD_CLOEXEC);
  505|       |#endif
  506|      0|	}
  507|       |
  508|  12.8k|	if (fd != -1) {
  ------------------
  |  Branch (508:6): [True: 12.8k, False: 0]
  ------------------
  509|  12.8k|		okstat = fstat(fd, &sb) == 0;
  510|  12.8k|		if (okstat && S_ISFIFO(sb.st_mode))
  ------------------
  |  Branch (510:7): [True: 12.8k, False: 0]
  |  Branch (510:17): [True: 0, False: 12.8k]
  ------------------
  511|      0|			ispipe = 1;
  512|  12.8k|		if (inname == NULL)
  ------------------
  |  Branch (512:7): [True: 12.8k, False: 0]
  ------------------
  513|  12.8k|			pos = lseek(fd, CAST(off_t, 0), SEEK_CUR);
  ------------------
  |  |  460|  12.8k|#define CAST(T, b)	((T)(b))
  ------------------
  514|  12.8k|	}
  515|       |
  516|       |	/*
  517|       |	 * try looking at the first ms->bytes_max bytes
  518|       |	 */
  519|  12.8k|	if (ispipe) {
  ------------------
  |  Branch (519:6): [True: 0, False: 12.8k]
  ------------------
  520|      0|		if (fd != -1) {
  ------------------
  |  Branch (520:7): [True: 0, False: 0]
  ------------------
  521|      0|			ssize_t r = 0;
  522|       |
  523|      0|			while ((r = sread(fd, RCAST(void *, &buf[nbytes]),
  ------------------
  |  |  461|      0|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  |  Branch (523:11): [True: 0, False: 0]
  ------------------
  524|      0|			    CAST(size_t, ms->bytes_max - nbytes), 1)) > 0) {
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  525|      0|				nbytes += r;
  526|      0|				if (r < PIPE_BUF) break;
  ------------------
  |  Branch (526:9): [True: 0, False: 0]
  ------------------
  527|      0|			}
  528|      0|		}
  529|       |
  530|      0|		if (nbytes == 0 && inname) {
  ------------------
  |  Branch (530:7): [True: 0, False: 0]
  |  Branch (530:22): [True: 0, False: 0]
  ------------------
  531|       |			/* We can not read it, but we were able to stat it. */
  532|      0|			if (unreadable_info(ms, sb.st_mode, inname) == -1)
  ------------------
  |  Branch (532:8): [True: 0, False: 0]
  ------------------
  533|      0|				goto done;
  534|      0|			rv = 0;
  535|      0|			goto done;
  536|      0|		}
  537|       |
  538|  12.8k|	} else if (fd != -1) {
  ------------------
  |  Branch (538:13): [True: 12.8k, False: 0]
  ------------------
  539|       |		/* Windows refuses to read from a big console buffer. */
  540|  12.8k|		size_t howmany =
  541|       |#ifdef WIN32
  542|       |		    _isatty(fd) ? 8 * 1024 :
  543|       |#endif
  544|  12.8k|		    ms->bytes_max;
  545|  12.8k|		if ((nbytes = read(fd, RCAST(void *, buf), howmany)) == -1) {
  ------------------
  |  |  461|  12.8k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  |  Branch (545:7): [True: 0, False: 12.8k]
  ------------------
  546|      0|			if (inname == NULL && fd != STDIN_FILENO)
  ------------------
  |  Branch (546:8): [True: 0, False: 0]
  |  Branch (546:26): [True: 0, False: 0]
  ------------------
  547|      0|				file_error(ms, errno, "cannot read fd %d", fd);
  548|      0|			else
  549|      0|				file_error(ms, errno, "cannot read `%s'",
  550|      0|				    inname == NULL ? "/dev/stdin" : inname);
  ------------------
  |  Branch (550:9): [True: 0, False: 0]
  ------------------
  551|      0|			goto done;
  552|      0|		}
  553|  12.8k|	}
  554|       |
  555|  12.8k|	(void)memset(buf + nbytes, 0, SLOP); /* NUL terminate */
  ------------------
  |  |  461|  12.8k|#define SLOP (1 + sizeof(union VALUETYPE))
  ------------------
  556|  12.8k|	if (file_buffer(ms, fd, okstat ? &sb : NULL, inname, buf,
  ------------------
  |  Branch (556:6): [True: 137, False: 12.6k]
  |  Branch (556:26): [True: 12.8k, False: 0]
  ------------------
  557|  12.8k|	    CAST(size_t, nbytes)) == -1)
  ------------------
  |  |  460|  12.8k|#define CAST(T, b)	((T)(b))
  ------------------
  558|    137|		goto done;
  559|  12.6k|	rv = 0;
  560|  12.8k|done:
  561|  12.8k|	free(buf);
  562|  12.8k|	if (fd != -1) {
  ------------------
  |  Branch (562:6): [True: 12.8k, False: 0]
  ------------------
  563|  12.8k|		if (pos != CAST(off_t, -1))
  ------------------
  |  |  460|  12.8k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (563:7): [True: 12.8k, False: 0]
  ------------------
  564|  12.8k|			(void)lseek(fd, pos, SEEK_SET);
  565|  12.8k|		close_and_restore(ms, inname, fd, okstat ? &sb : NULL);
  ------------------
  |  Branch (565:37): [True: 12.8k, False: 0]
  ------------------
  566|  12.8k|	}
  567|  12.8k|out:
  568|  12.8k|	return rv == 0 ? file_getbuffer(ms) : NULL;
  ------------------
  |  Branch (568:9): [True: 12.6k, False: 137]
  ------------------
  569|  12.8k|}
magic.c:close_and_restore:
  371|  12.8k|{
  372|  12.8k|	if (fd == STDIN_FILENO || name == NULL)
  ------------------
  |  Branch (372:6): [True: 0, False: 12.8k]
  |  Branch (372:28): [True: 12.8k, False: 0]
  ------------------
  373|  12.8k|		return;
  374|       |
  375|      0|	if (sb == NULL || (ms->flags & MAGIC_PRESERVE_ATIME) == 0) {
  ------------------
  |  |   40|      0|#define	MAGIC_PRESERVE_ATIME	0x0000080 /* Restore access time on exit */
  ------------------
  |  Branch (375:6): [True: 0, False: 0]
  |  Branch (375:20): [True: 0, False: 0]
  ------------------
  376|      0|		(void) close(fd);
  377|      0|		return;
  378|      0|	}
  379|       |
  380|       |	/*
  381|       |	 * Try to restore access, modification times if read it.
  382|       |	 * This is really *bad* because it will modify the status
  383|       |	 * time of the file... And of course this will affect
  384|       |	 * backup programs
  385|       |	 */
  386|      0|#ifdef HAVE_FUTIMENS
  387|       |	/*
  388|       |	 * Use the descriptor we read from; name may now point
  389|       |	 * somewhere else (e.g. replaced by a symlink).
  390|       |	 */
  391|      0|	struct timespec tsbuf[2];
  392|      0|	(void)memset(tsbuf, 0, sizeof(tsbuf));
  393|      0|	tsbuf[0].tv_sec = sb->st_atime;
  394|      0|	tsbuf[1].tv_sec = sb->st_mtime;
  395|       |
  396|      0|	(void) futimens(fd, tsbuf); /* don't care if loses */
  397|      0|	(void) close(fd);
  398|       |#elif defined(HAVE_UTIMES)
  399|       |	struct timeval  utsbuf[2];
  400|       |	(void) close(fd);
  401|       |	(void)memset(utsbuf, 0, sizeof(utsbuf));
  402|       |	utsbuf[0].tv_sec = sb->st_atime;
  403|       |	utsbuf[1].tv_sec = sb->st_mtime;
  404|       |
  405|       |	(void) utimes(name, utsbuf); /* don't care if loses */
  406|       |#elif defined(HAVE_UTIME) && (defined(HAVE_UTIME_H) || defined(HAVE_SYS_UTIME_H))
  407|       |	struct utimbuf  utbuf;
  408|       |
  409|       |	(void) close(fd);
  410|       |	(void)memset(&utbuf, 0, sizeof(utbuf));
  411|       |	utbuf.actime = sb->st_atime;
  412|       |	utbuf.modtime = sb->st_mtime;
  413|       |	(void) utime(name, &utbuf); /* don't care if loses */
  414|       |#else
  415|       |	(void) close(fd);
  416|       |#endif
  417|      0|}

fmtcheck:
  236|  53.1k|{
  237|  53.1k|	const char	*f1p, *f2p;
  238|  53.1k|	EFT		f1t, f2t;
  239|       |
  240|  53.1k|	if (!f1) return f2;
  ------------------
  |  Branch (240:6): [True: 0, False: 53.1k]
  ------------------
  241|       |
  242|  53.1k|	f1p = f1;
  243|  53.1k|	f1t = FMTCHECK_START;
  244|  53.1k|	f2p = f2;
  245|  53.1k|	f2t = FMTCHECK_START;
  246|   106k|	while ((f1t = get_next_format(&f1p, f1t)) != FMTCHECK_DONE) {
  ------------------
  |  Branch (246:9): [True: 53.1k, False: 53.1k]
  ------------------
  247|  53.1k|		if (f1t == FMTCHECK_UNKNOWN)
  ------------------
  |  Branch (247:7): [True: 0, False: 53.1k]
  ------------------
  248|      0|			return f2;
  249|  53.1k|		f2t = get_next_format(&f2p, f2t);
  250|  53.1k|		if (f1t != f2t)
  ------------------
  |  Branch (250:7): [True: 0, False: 53.1k]
  ------------------
  251|      0|			return f2;
  252|  53.1k|	}
  253|  53.1k|	return f1;
  254|  53.1k|}
fmtcheck.c:get_next_format:
  190|   159k|{
  191|   159k|	int		infmt;
  192|   159k|	const char	*f;
  193|       |
  194|   159k|	if (eft == FMTCHECK_WIDTH) {
  ------------------
  |  Branch (194:6): [True: 0, False: 159k]
  ------------------
  195|      0|		(*pf)++;
  196|      0|		return get_next_format_from_width(pf);
  197|   159k|	} else if (eft == FMTCHECK_PRECISION) {
  ------------------
  |  Branch (197:13): [True: 0, False: 159k]
  ------------------
  198|      0|		(*pf)++;
  199|      0|		return get_next_format_from_precision(pf);
  200|      0|	}
  201|       |
  202|   159k|	f = *pf;
  203|   159k|	infmt = 0;
  204|   265k|	while (!infmt) {
  ------------------
  |  Branch (204:9): [True: 159k, False: 106k]
  ------------------
  205|   159k|		f = strchr(f, '%');
  206|   159k|		if (f == NULL)
  ------------------
  |  Branch (206:7): [True: 53.1k, False: 106k]
  ------------------
  207|  53.1k|			RETURN(pf,f,FMTCHECK_DONE);
  ------------------
  |  |   60|  53.1k|#define RETURN(pf,f,r) do { \
  |  |   61|  53.1k|			*(pf) = (f); \
  |  |   62|  53.1k|			return r; \
  |  |   63|  53.1k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  208|   106k|		f++;
  209|   106k|		if (!*f)
  ------------------
  |  Branch (209:7): [True: 0, False: 106k]
  ------------------
  210|      0|			RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  211|   106k|		if (*f != '%')
  ------------------
  |  Branch (211:7): [True: 106k, False: 0]
  ------------------
  212|   106k|			infmt = 1;
  213|      0|		else
  214|      0|			f++;
  215|   106k|	}
  216|       |
  217|       |	/* Eat any of the flags */
  218|   115k|	while (*f && (strchr("#0- +", *f)))
  ------------------
  |  Branch (218:9): [True: 115k, False: 0]
  |  Branch (218:15): [True: 9.25k, False: 106k]
  ------------------
  219|  9.25k|		f++;
  220|       |
  221|   106k|	if (*f == '*') {
  ------------------
  |  Branch (221:6): [True: 0, False: 106k]
  ------------------
  222|      0|		RETURN(pf,f,FMTCHECK_WIDTH);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  223|      0|	}
  224|       |	/* eat any width */
  225|   106k|	while (isdigit((unsigned char)*f)) f++;
  ------------------
  |  Branch (225:9): [True: 4.24k, False: 106k]
  ------------------
  226|   106k|	if (!*f) {
  ------------------
  |  Branch (226:6): [True: 0, False: 106k]
  ------------------
  227|      0|		RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  228|      0|	}
  229|       |
  230|   106k|	RETURN(pf,f,get_next_format_from_width(pf));
  ------------------
  |  |   60|   106k|#define RETURN(pf,f,r) do { \
  |  |   61|   106k|			*(pf) = (f); \
  |  |   62|   106k|			return r; \
  |  |   63|   106k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  231|       |	/*NOTREACHED*/
  232|   106k|}
fmtcheck.c:get_next_format_from_width:
  171|   106k|{
  172|   106k|	const char	*f;
  173|       |
  174|   106k|	f = *pf;
  175|   106k|	if (*f == '.') {
  ------------------
  |  Branch (175:6): [True: 4.27k, False: 102k]
  ------------------
  176|  4.27k|		f++;
  177|  4.27k|		if (*f == '*') {
  ------------------
  |  Branch (177:7): [True: 0, False: 4.27k]
  ------------------
  178|      0|			RETURN(pf,f,FMTCHECK_PRECISION);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  179|      0|		}
  180|       |		/* eat any precision (empty is allowed) */
  181|  4.93k|		while (isdigit((unsigned char)*f)) f++;
  ------------------
  |  Branch (181:10): [True: 4.93k, False: 4.27k]
  ------------------
  182|  4.27k|		if (!*f) RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (182:7): [True: 0, False: 4.27k]
  ------------------
  183|  4.27k|	}
  184|   106k|	RETURN(pf,f,get_next_format_from_precision(pf));
  ------------------
  |  |   60|   106k|#define RETURN(pf,f,r) do { \
  |  |   61|   106k|			*(pf) = (f); \
  |  |   62|   106k|			return r; \
  |  |   63|   106k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  185|       |	/*NOTREACHED*/
  186|   106k|}
fmtcheck.c:get_next_format_from_precision:
   67|   106k|{
   68|   106k|	int		sh, lg, quad, longdouble;
   69|   106k|	const char	*f;
   70|       |
   71|   106k|	sh = lg = quad = longdouble = 0;
   72|       |
   73|   106k|	f = *pf;
   74|   106k|	switch (*f) {
   75|      0|	case 'h':
  ------------------
  |  Branch (75:2): [True: 0, False: 106k]
  ------------------
   76|      0|		f++;
   77|      0|		sh = 1;
   78|      0|		break;
   79|  2.36k|	case 'l':
  ------------------
  |  Branch (79:2): [True: 2.36k, False: 103k]
  ------------------
   80|  2.36k|		f++;
   81|  2.36k|		if (!*f) RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (81:7): [True: 0, False: 2.36k]
  ------------------
   82|  2.36k|		if (*f == 'l') {
  ------------------
  |  Branch (82:7): [True: 2.36k, False: 0]
  ------------------
   83|  2.36k|			f++;
   84|  2.36k|			quad = 1;
   85|  2.36k|		} else {
   86|      0|			lg = 1;
   87|      0|		}
   88|  2.36k|		break;
   89|      0|	case 'q':
  ------------------
  |  Branch (89:2): [True: 0, False: 106k]
  ------------------
   90|      0|		f++;
   91|      0|		quad = 1;
   92|      0|		break;
   93|      0|	case 'L':
  ------------------
  |  Branch (93:2): [True: 0, False: 106k]
  ------------------
   94|      0|		f++;
   95|      0|		longdouble = 1;
   96|      0|		break;
   97|       |#ifdef WIN32
   98|       |	case 'I':
   99|       |		f++;
  100|       |		if (!*f) RETURN(pf,f,FMTCHECK_UNKNOWN);
  101|       |		if (*f == '3' && f[1] == '2') {
  102|       |			f += 2;
  103|       |		} else if (*f == '6' && f[1] == '4') {
  104|       |			f += 2;
  105|       |			quad = 1;
  106|       |		}
  107|       |#ifdef _WIN64
  108|       |		else {
  109|       |			quad = 1;
  110|       |		}
  111|       |#endif
  112|       |		break;
  113|       |#endif
  114|   103k|	default:
  ------------------
  |  Branch (114:2): [True: 103k, False: 2.36k]
  ------------------
  115|   103k|		break;
  116|   106k|	}
  117|   106k|	if (!*f) RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (117:6): [True: 0, False: 106k]
  ------------------
  118|   106k|	if (strchr("diouxX", *f)) {
  ------------------
  |  Branch (118:6): [True: 71.1k, False: 35.1k]
  ------------------
  119|  71.1k|		if (longdouble)
  ------------------
  |  Branch (119:7): [True: 0, False: 71.1k]
  ------------------
  120|      0|			RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  121|  71.1k|		if (lg)
  ------------------
  |  Branch (121:7): [True: 0, False: 71.1k]
  ------------------
  122|      0|			RETURN(pf,f,FMTCHECK_LONG);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  123|  71.1k|		if (quad)
  ------------------
  |  Branch (123:7): [True: 2.36k, False: 68.7k]
  ------------------
  124|  2.36k|			RETURN(pf,f,FMTCHECK_QUAD);
  ------------------
  |  |   60|  2.36k|#define RETURN(pf,f,r) do { \
  |  |   61|  2.36k|			*(pf) = (f); \
  |  |   62|  2.36k|			return r; \
  |  |   63|  2.36k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  125|  68.7k|		RETURN(pf,f,FMTCHECK_INT);
  ------------------
  |  |   60|  68.7k|#define RETURN(pf,f,r) do { \
  |  |   61|  68.7k|			*(pf) = (f); \
  |  |   62|  68.7k|			return r; \
  |  |   63|  68.7k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  126|  68.7k|	}
  127|  35.1k|	if (*f == 'n') {
  ------------------
  |  Branch (127:6): [True: 0, False: 35.1k]
  ------------------
  128|      0|		if (longdouble)
  ------------------
  |  Branch (128:7): [True: 0, False: 0]
  ------------------
  129|      0|			RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  130|      0|		if (sh)
  ------------------
  |  Branch (130:7): [True: 0, False: 0]
  ------------------
  131|      0|			RETURN(pf,f,FMTCHECK_SHORTPOINTER);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  132|      0|		if (lg)
  ------------------
  |  Branch (132:7): [True: 0, False: 0]
  ------------------
  133|      0|			RETURN(pf,f,FMTCHECK_LONGPOINTER);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  134|      0|		if (quad)
  ------------------
  |  Branch (134:7): [True: 0, False: 0]
  ------------------
  135|      0|			RETURN(pf,f,FMTCHECK_QUADPOINTER);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  136|      0|		RETURN(pf,f,FMTCHECK_INTPOINTER);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  137|      0|	}
  138|  35.1k|	if (strchr("DOU", *f)) {
  ------------------
  |  Branch (138:6): [True: 0, False: 35.1k]
  ------------------
  139|      0|		if (sh + lg + quad + longdouble)
  ------------------
  |  Branch (139:7): [True: 0, False: 0]
  ------------------
  140|      0|			RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  141|      0|		RETURN(pf,f,FMTCHECK_LONG);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  142|      0|	}
  143|  35.1k|	if (strchr("eEfg", *f)) {
  ------------------
  |  Branch (143:6): [True: 1.82k, False: 33.3k]
  ------------------
  144|  1.82k|		if (longdouble)
  ------------------
  |  Branch (144:7): [True: 0, False: 1.82k]
  ------------------
  145|      0|			RETURN(pf,f,FMTCHECK_LONGDOUBLE);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  146|  1.82k|		if (sh + lg + quad)
  ------------------
  |  Branch (146:7): [True: 0, False: 1.82k]
  ------------------
  147|      0|			RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  148|  1.82k|		RETURN(pf,f,FMTCHECK_DOUBLE);
  ------------------
  |  |   60|  1.82k|#define RETURN(pf,f,r) do { \
  |  |   61|  1.82k|			*(pf) = (f); \
  |  |   62|  1.82k|			return r; \
  |  |   63|  1.82k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  149|  1.82k|	}
  150|  33.3k|	if (*f == 'c') {
  ------------------
  |  Branch (150:6): [True: 641, False: 32.6k]
  ------------------
  151|    641|		if (sh + lg + quad + longdouble)
  ------------------
  |  Branch (151:7): [True: 0, False: 641]
  ------------------
  152|      0|			RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  153|    641|		RETURN(pf,f,FMTCHECK_INT);
  ------------------
  |  |   60|    641|#define RETURN(pf,f,r) do { \
  |  |   61|    641|			*(pf) = (f); \
  |  |   62|    641|			return r; \
  |  |   63|    641|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  154|    641|	}
  155|  32.6k|	if (*f == 's') {
  ------------------
  |  Branch (155:6): [True: 32.6k, False: 0]
  ------------------
  156|  32.6k|		if (sh + lg + quad + longdouble)
  ------------------
  |  Branch (156:7): [True: 0, False: 32.6k]
  ------------------
  157|      0|			RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  158|  32.6k|		RETURN(pf,f,FMTCHECK_STRING);
  ------------------
  |  |   60|  32.6k|#define RETURN(pf,f,r) do { \
  |  |   61|  32.6k|			*(pf) = (f); \
  |  |   62|  32.6k|			return r; \
  |  |   63|  32.6k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  159|  32.6k|	}
  160|      0|	if (*f == 'p') {
  ------------------
  |  Branch (160:6): [True: 0, False: 0]
  ------------------
  161|      0|		if (sh + lg + quad + longdouble)
  ------------------
  |  Branch (161:7): [True: 0, False: 0]
  ------------------
  162|      0|			RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  163|      0|		RETURN(pf,f,FMTCHECK_LONG);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  164|      0|	}
  165|      0|	RETURN(pf,f,FMTCHECK_UNKNOWN);
  ------------------
  |  |   60|      0|#define RETURN(pf,f,r) do { \
  |  |   61|      0|			*(pf) = (f); \
  |  |   62|      0|			return r; \
  |  |   63|      0|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  166|       |	/*NOTREACHED*/
  167|      0|}

file_fmtdatetime:
  311|  3.40k|{
  312|  3.40k|	char *pp;
  313|  3.40k|	time_t t;
  314|  3.40k|	struct tm *tm, tmz;
  315|       |
  316|  3.40k|	if (flags & FILE_T_WINDOWS) {
  ------------------
  |  |  549|  3.40k|#define FILE_T_WINDOWS	2
  ------------------
  |  Branch (316:6): [True: 1.75k, False: 1.65k]
  ------------------
  317|  1.75k|		struct timespec ts;
  318|  1.75k|		cdf_timestamp_to_timespec(&ts, CAST(cdf_timestamp_t, v));
  ------------------
  |  |  460|  1.75k|#define CAST(T, b)	((T)(b))
  ------------------
  319|  1.75k|		t = ts.tv_sec;
  320|  1.75k|	} else {
  321|       |		// XXX: perhaps detect and print something if overflow
  322|       |		// on 32 bit time_t?
  323|  1.65k|		t = CAST(time_t, v);
  ------------------
  |  |  460|  1.65k|#define CAST(T, b)	((T)(b))
  ------------------
  324|  1.65k|	}
  325|       |
  326|  3.40k|	if (t > MAX_CTIME)
  ------------------
  |  |  181|  3.40k|    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
  |  |  ------------------
  |  |  |  |  460|  6.81k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 3.40k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (326:6): [True: 127, False: 3.28k]
  ------------------
  327|    127|		goto out;
  328|       |
  329|  3.28k|	if (flags & FILE_T_LOCAL) {
  ------------------
  |  |  548|  3.28k|#define FILE_T_LOCAL	1
  ------------------
  |  Branch (329:6): [True: 428, False: 2.85k]
  ------------------
  330|    428|#ifdef HAVE_TZSET
  331|    428|		tzset();
  332|    428|#endif
  333|    428|		tm = localtime_r(&t, &tmz);
  334|  2.85k|	} else {
  335|  2.85k|		tm = gmtime_r(&t, &tmz);
  336|  2.85k|	}
  337|  3.28k|	if (tm == NULL)
  ------------------
  |  Branch (337:6): [True: 75, False: 3.20k]
  ------------------
  338|     75|		goto out;
  339|       |	/*
  340|       |	 * asctime_r() only fits a 4 character year in its 26 byte buffer;
  341|       |	 * MAX_CTIME does not cover negative times or the local timezone.
  342|       |	 */
  343|  3.20k|	if (tm->tm_year < -999 - 1900 || tm->tm_year > 9999 - 1900)
  ------------------
  |  Branch (343:6): [True: 248, False: 2.95k]
  |  Branch (343:35): [True: 0, False: 2.95k]
  ------------------
  344|    248|		goto out;
  345|  2.95k|	pp = asctime_r(tm, buf);
  346|       |
  347|  2.95k|	if (pp == NULL)
  ------------------
  |  Branch (347:6): [True: 0, False: 2.95k]
  ------------------
  348|      0|		goto out;
  349|  2.95k|	pp[strcspn(pp, "\n")] = '\0';
  350|  2.95k|	return pp;
  351|    450|out:
  352|    450|	strlcpy(buf, "*Invalid datetime*", bsize);
  353|    450|	return buf;
  354|  2.95k|}
file_fmtdate:
  362|    241|{
  363|    241|	struct tm tm;
  364|       |
  365|    241|	memset(&tm, 0, sizeof(tm));
  366|    241|	tm.tm_mday = v & 0x1f;
  367|    241|	tm.tm_mon = ((v >> 5) & 0xf) - 1;
  368|       |	// Sanity check because some OS's coredump with invalid values.
  369|       |	// Yes, Cygwin I am looking at you!
  370|    241|	if (tm.tm_mon < 0 || tm.tm_mon > 11)
  ------------------
  |  Branch (370:6): [True: 100, False: 141]
  |  Branch (370:23): [True: 70, False: 71]
  ------------------
  371|    170|		tm.tm_mon = 0;
  372|    241|	tm.tm_year = (v >> 9) + 80;
  373|       |
  374|    241|	if (strftime(buf, bsize, "%b %d %Y", &tm) == 0)
  ------------------
  |  Branch (374:6): [True: 0, False: 241]
  ------------------
  375|      0|		goto out;
  376|       |
  377|    241|	return buf;
  378|      0|out:
  379|      0|	strlcpy(buf, "*Invalid date*", bsize);
  380|      0|	return buf;
  381|    241|}
file_fmttime:
  385|    241|{
  386|    241|	struct tm tm;
  387|       |
  388|    241|	memset(&tm, 0, sizeof(tm));
  389|    241|	tm.tm_sec = (v & 0x1f) * 2;
  390|    241|	tm.tm_min = ((v >> 5) & 0x3f);
  391|    241|	tm.tm_hour = (v >> 11);
  392|       |
  393|    241|	if (strftime(buf, bsize, "%T", &tm) == 0)
  ------------------
  |  Branch (393:6): [True: 0, False: 241]
  ------------------
  394|      0|		goto out;
  395|       |
  396|    241|	return buf;
  397|      0|out:
  398|      0|	strlcpy(buf, "*Invalid time*", bsize);
  399|      0|	return buf;
  400|       |
  401|    241|}

file_trycdf:
  563|  16.4k|{
  564|  16.4k|	int fd = b->fd;
  565|  16.4k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  16.4k|#define CAST(T, b)	((T)(b))
  ------------------
  566|  16.4k|	size_t nbytes = b->flen;
  567|  16.4k|	cdf_info_t info;
  568|  16.4k|	cdf_header_t h;
  569|  16.4k|	cdf_sat_t sat, ssat;
  570|  16.4k|	cdf_stream_t sst, scn;
  571|  16.4k|	cdf_dir_t dir;
  572|  16.4k|	int i;
  573|  16.4k|	const char *expn = "";
  574|  16.4k|	const cdf_directory_t *root_storage;
  575|       |
  576|  16.4k|	scn.sst_tab = NULL;
  577|  16.4k|	info.i_fd = fd;
  578|  16.4k|	info.i_buf = buf;
  579|  16.4k|	info.i_len = nbytes;
  580|  16.4k|	if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))
  ------------------
  |  |   45|  16.4k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))
  ------------------
  |  |   46|  16.4k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (580:6): [True: 0, False: 16.4k]
  ------------------
  581|      0|		return 0;
  582|  16.4k|	if (cdf_read_header(&info, &h) == -1)
  ------------------
  |  Branch (582:6): [True: 14.6k, False: 1.76k]
  ------------------
  583|  14.6k|		return 0;
  584|       |#ifdef CDF_DEBUG
  585|       |	cdf_dump_header(&h);
  586|       |#endif
  587|       |
  588|  1.76k|	if ((i = cdf_read_sat(&info, &h, &sat)) == -1) {
  ------------------
  |  Branch (588:6): [True: 205, False: 1.55k]
  ------------------
  589|    205|		expn = "Can't read SAT";
  590|    205|		goto out0;
  591|    205|	}
  592|       |#ifdef CDF_DEBUG
  593|       |	cdf_dump_sat("SAT", &sat, CDF_SEC_SIZE(&h));
  594|       |#endif
  595|       |
  596|  1.55k|	if ((i = cdf_read_ssat(&info, &h, &sat, &ssat)) == -1) {
  ------------------
  |  Branch (596:6): [True: 282, False: 1.27k]
  ------------------
  597|    282|		expn = "Can't read SSAT";
  598|    282|		goto out1;
  599|    282|	}
  600|       |#ifdef CDF_DEBUG
  601|       |	cdf_dump_sat("SSAT", &ssat, CDF_SHORT_SEC_SIZE(&h));
  602|       |#endif
  603|       |
  604|  1.27k|	if ((i = cdf_read_dir(&info, &h, &sat, &dir)) == -1) {
  ------------------
  |  Branch (604:6): [True: 80, False: 1.19k]
  ------------------
  605|     80|		expn = "Can't read directory";
  606|     80|		goto out2;
  607|     80|	}
  608|       |
  609|  1.19k|	if ((i = cdf_read_short_stream(&info, &h, &sat, &dir, &sst,
  ------------------
  |  Branch (609:6): [True: 95, False: 1.10k]
  ------------------
  610|  1.19k|	    &root_storage)) == -1) {
  611|     95|		expn = "Cannot read short stream";
  612|     95|		goto out3;
  613|     95|	}
  614|       |#ifdef CDF_DEBUG
  615|       |	cdf_dump_dir(&info, &h, &sat, &ssat, &sst, &dir);
  616|       |#endif
  617|       |#ifdef notdef
  618|       |	if (root_storage) {
  619|       |		if (NOTMIME(ms)) {
  620|       |			char clsbuf[128];
  621|       |			if (file_printf(ms, "CLSID %s, ",
  622|       |			    format_clsid(clsbuf, sizeof(clsbuf),
  623|       |			    root_storage->d_storage_uuid)) == -1)
  624|       |				return -1;
  625|       |		}
  626|       |	}
  627|       |#endif
  628|       |
  629|  1.10k|	if (cdf_read_user_stream(&info, &h, &sat, &ssat, &sst, &dir,
  ------------------
  |  Branch (629:6): [True: 5, False: 1.09k]
  ------------------
  630|  1.10k|	    "FileHeader", &scn) != -1) {
  631|      5|#define HWP5_SIGNATURE "HWP Document File"
  632|      5|		if (scn.sst_len * scn.sst_ss >= sizeof(HWP5_SIGNATURE) - 1
  ------------------
  |  |  631|      5|#define HWP5_SIGNATURE "HWP Document File"
  ------------------
  |  Branch (632:7): [True: 4, False: 1]
  ------------------
  633|      4|		    && memcmp(scn.sst_tab, HWP5_SIGNATURE,
  ------------------
  |  |  631|      4|#define HWP5_SIGNATURE "HWP Document File"
  ------------------
  |  Branch (633:10): [True: 1, False: 3]
  ------------------
  634|      4|		    sizeof(HWP5_SIGNATURE) - 1) == 0) {
  ------------------
  |  |  631|      4|#define HWP5_SIGNATURE "HWP Document File"
  ------------------
  635|      1|		    if (NOTMIME(ms)) {
  ------------------
  |  |   42|      1|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|      1|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|      1|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      1|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 1, False: 0]
  |  |  ------------------
  ------------------
  636|      1|			if (file_printf(ms,
  ------------------
  |  Branch (636:8): [True: 0, False: 1]
  ------------------
  637|      1|			    "Hancom HWP (Hangul Word Processor) file, version 5.0") == -1)
  638|      0|			    return -1;
  639|      1|		    } else if (ms->flags & MAGIC_MIME_TYPE) {
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (639:18): [True: 0, False: 0]
  ------------------
  640|      0|			if (file_printf(ms, "application/x-hwp") == -1)
  ------------------
  |  Branch (640:8): [True: 0, False: 0]
  ------------------
  641|      0|			    return -1;
  642|      0|		    }
  643|      1|		    i = 1;
  644|      1|		    goto out5;
  645|      4|		} else {
  646|      4|		    cdf_zero_stream(&scn);
  647|      4|		}
  648|      5|	}
  649|       |
  650|  1.10k|	if ((i = cdf_read_summary_info(&info, &h, &sat, &ssat, &sst, &dir,
  ------------------
  |  Branch (650:6): [True: 322, False: 778]
  ------------------
  651|  1.10k|	    &scn)) == -1) {
  652|    322|		if (errno != ESRCH) {
  ------------------
  |  Branch (652:7): [True: 148, False: 174]
  ------------------
  653|    148|			expn = "Cannot read summary info";
  654|    148|		}
  655|    778|	} else {
  656|    778|		i = cdf_check_summary_info(ms, &info, &h,
  657|    778|		    &sat, &ssat, &sst, &dir, &scn, root_storage, &expn);
  658|    778|		cdf_zero_stream(&scn);
  659|    778|	}
  660|  1.10k|	if (i <= 0) {
  ------------------
  |  Branch (660:6): [True: 971, False: 129]
  ------------------
  661|    971|		if ((i = cdf_read_doc_summary_info(&info, &h, &sat, &ssat,
  ------------------
  |  Branch (661:7): [True: 885, False: 86]
  ------------------
  662|    971|		    &sst, &dir, &scn)) == -1) {
  663|    885|			if (errno != ESRCH) {
  ------------------
  |  Branch (663:8): [True: 26, False: 859]
  ------------------
  664|     26|				expn = "Cannot read summary info";
  665|     26|			}
  666|    885|		} else {
  667|     86|			i = cdf_check_summary_info(ms, &info, &h, &sat, &ssat,
  668|     86|			    &sst, &dir, &scn, root_storage, &expn);
  669|     86|		}
  670|    971|	}
  671|  1.10k|	if (i <= 0) {
  ------------------
  |  Branch (671:6): [True: 971, False: 129]
  ------------------
  672|    971|		i = cdf_file_dir_info(ms, &dir);
  673|    971|		if (i < 0)
  ------------------
  |  Branch (673:7): [True: 967, False: 4]
  ------------------
  674|    967|			expn = "Cannot read section info";
  675|    971|	}
  676|  1.10k|out5:
  677|  1.10k|	cdf_zero_stream(&scn);
  678|  1.10k|	cdf_zero_stream(&sst);
  679|  1.19k|out3:
  680|  1.19k|	free(dir.dir_tab);
  681|  1.27k|out2:
  682|  1.27k|	free(ssat.sat_tab);
  683|  1.55k|out1:
  684|  1.55k|	free(sat.sat_tab);
  685|  1.76k|out0:
  686|       |	/* If we handled it already, return */
  687|  1.76k|	if (i != -1)
  ------------------
  |  Branch (687:6): [True: 134, False: 1.62k]
  ------------------
  688|    134|		return i;
  689|       |	/* Provide a default handler */
  690|  1.62k|	if (NOTMIME(ms)) {
  ------------------
  |  |   42|  1.62k|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|  1.62k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  1.62k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  1.62k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 1.62k, False: 0]
  |  |  ------------------
  ------------------
  691|  1.62k|		if (file_printf(ms,
  ------------------
  |  Branch (691:7): [True: 0, False: 1.62k]
  ------------------
  692|  1.62k|		    "Composite Document File V2 Document") == -1)
  693|      0|			return -1;
  694|  1.62k|		if (*expn)
  ------------------
  |  Branch (694:7): [True: 1.62k, False: 0]
  ------------------
  695|  1.62k|			if (file_printf(ms, ", %s", expn) == -1)
  ------------------
  |  Branch (695:8): [True: 0, False: 1.62k]
  ------------------
  696|      0|				return -1;
  697|  1.62k|	} else if (ms->flags & MAGIC_MIME_TYPE) {
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (697:13): [True: 0, False: 0]
  ------------------
  698|       |		/* https://reposcope.com/mimetype/application/x-ole-storage */
  699|      0|		if (file_printf(ms, "application/x-ole-storage") == -1)
  ------------------
  |  Branch (699:7): [True: 0, False: 0]
  ------------------
  700|      0|			return -1;
  701|      0|	}
  702|  1.62k|	return 1;
  703|  1.62k|}
readcdf.c:cdf_check_summary_info:
  396|    864|{
  397|    864|	int i;
  398|    864|	const char *str = NULL;
  399|    864|	cdf_directory_t *d;
  400|    864|	char name[__arraycount(d->d_name) + 1];
  401|    864|	size_t j, k;
  402|       |
  403|       |#ifdef CDF_DEBUG
  404|       |	cdf_dump_summary_info(h, scn);
  405|       |#endif
  406|    864|	if ((i = cdf_file_summary_info(ms, h, scn, root_storage)) < 0) {
  ------------------
  |  Branch (406:6): [True: 735, False: 129]
  ------------------
  407|    735|	    *expn = "Can't expand summary_info";
  408|    735|	    return i;
  409|    735|	}
  410|    129|	if (i == 1)
  ------------------
  |  Branch (410:6): [True: 129, False: 0]
  ------------------
  411|    129|		return i;
  412|      0|	for (j = 0; str == NULL && j < dir->dir_len; j++) {
  ------------------
  |  Branch (412:14): [True: 0, False: 0]
  |  Branch (412:29): [True: 0, False: 0]
  ------------------
  413|      0|		d = &dir->dir_tab[j];
  414|      0|		for (k = 0; k < sizeof(name) - 1; k++)
  ------------------
  |  Branch (414:15): [True: 0, False: 0]
  ------------------
  415|      0|			name[k] = CAST(char, cdf_tole2(d->d_name[k]));
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  416|      0|		name[sizeof(name) - 1] = '\0';
  417|      0|		str = cdf_app_to_mime(name,
  418|      0|				      NOTMIME(ms) ? name2desc : name2mime);
  ------------------
  |  |   42|      0|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|      0|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      0|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  419|      0|	}
  420|      0|	if (NOTMIME(ms)) {
  ------------------
  |  |   42|      0|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|      0|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      0|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 0, False: 0]
  |  |  ------------------
  ------------------
  421|      0|		if (str != NULL) {
  ------------------
  |  Branch (421:7): [True: 0, False: 0]
  ------------------
  422|      0|			if (file_printf(ms, "%s", str) == -1)
  ------------------
  |  Branch (422:8): [True: 0, False: 0]
  ------------------
  423|      0|				return -1;
  424|      0|			i = 1;
  425|      0|		}
  426|      0|	} else if (ms->flags & MAGIC_MIME_TYPE) {
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (426:13): [True: 0, False: 0]
  ------------------
  427|      0|		if (str == NULL)
  ------------------
  |  Branch (427:7): [True: 0, False: 0]
  ------------------
  428|      0|			str = "vnd.ms-office";
  429|      0|		if (file_printf(ms, "application/%s", str) == -1)
  ------------------
  |  Branch (429:7): [True: 0, False: 0]
  ------------------
  430|      0|			return -1;
  431|      0|		i = 1;
  432|      0|	}
  433|      0|	if (i <= 0) {
  ------------------
  |  Branch (433:6): [True: 0, False: 0]
  ------------------
  434|      0|		i = cdf_file_catalog_info(ms, info, h, sat, ssat, sst,
  435|      0|					  dir, scn);
  436|      0|	}
  437|      0|	return i;
  438|      0|}
readcdf.c:cdf_file_summary_info:
  304|    864|{
  305|    864|	cdf_summary_info_header_t si;
  306|    864|	cdf_property_info_t *info;
  307|    864|	size_t count;
  308|    864|	int m;
  309|       |
  310|    864|	if (cdf_unpack_summary_info(sst, h, &si, &info, &count) == -1)
  ------------------
  |  Branch (310:6): [True: 607, False: 257]
  ------------------
  311|    607|		return -1;
  312|       |
  313|    257|	if (NOTMIME(ms)) {
  ------------------
  |  |   42|    257|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    257|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    257|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    257|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 257, False: 0]
  |  |  ------------------
  ------------------
  314|    257|		const char *str;
  315|       |
  316|    257|		if (file_printf(ms, "Composite Document File V2 Document")
  ------------------
  |  Branch (316:7): [True: 0, False: 257]
  ------------------
  317|    257|		    == -1)
  318|      0|			return -1;
  319|       |
  320|    257|		if (file_printf(ms, ", %s Endian",
  ------------------
  |  Branch (320:7): [True: 0, False: 257]
  ------------------
  321|    257|		    si.si_byte_order == 0xfffe ?  "Little" : "Big") == -1)
  ------------------
  |  Branch (321:7): [True: 2, False: 255]
  ------------------
  322|      0|			return -2;
  323|    257|		switch (si.si_os) {
  324|      8|		case 2:
  ------------------
  |  Branch (324:3): [True: 8, False: 249]
  ------------------
  325|      8|			if (file_printf(ms, ", Os: Windows, Version %d.%d",
  ------------------
  |  Branch (325:8): [True: 0, False: 8]
  ------------------
  326|      8|			    si.si_os_version & 0xff,
  327|      8|			    CAST(uint32_t, si.si_os_version) >> 8) == -1)
  ------------------
  |  |  460|      8|#define CAST(T, b)	((T)(b))
  ------------------
  328|      0|				return -2;
  329|      8|			break;
  330|     75|		case 1:
  ------------------
  |  Branch (330:3): [True: 75, False: 182]
  ------------------
  331|     75|			if (file_printf(ms, ", Os: MacOS, Version %d.%d",
  ------------------
  |  Branch (331:8): [True: 0, False: 75]
  ------------------
  332|     75|			    CAST(uint32_t, si.si_os_version) >> 8,
  ------------------
  |  |  460|     75|#define CAST(T, b)	((T)(b))
  ------------------
  333|     75|			    si.si_os_version & 0xff) == -1)
  334|      0|				return -2;
  335|     75|			break;
  336|    174|		default:
  ------------------
  |  Branch (336:3): [True: 174, False: 83]
  ------------------
  337|    174|			if (file_printf(ms, ", Os %d, Version: %d.%d", si.si_os,
  ------------------
  |  Branch (337:8): [True: 0, False: 174]
  ------------------
  338|    174|			    si.si_os_version & 0xff,
  339|    174|			    CAST(uint32_t, si.si_os_version) >> 8) == -1)
  ------------------
  |  |  460|    174|#define CAST(T, b)	((T)(b))
  ------------------
  340|      0|				return -2;
  341|    174|			break;
  342|    257|		}
  343|    257|		if (root_storage) {
  ------------------
  |  Branch (343:7): [True: 77, False: 180]
  ------------------
  344|     77|			str = cdf_clsid_to_mime(root_storage->d_storage_uuid,
  345|     77|			    clsid2desc);
  346|     77|			if (str) {
  ------------------
  |  Branch (346:8): [True: 0, False: 77]
  ------------------
  347|      0|				if (file_printf(ms, ", %s", str) == -1)
  ------------------
  |  Branch (347:9): [True: 0, False: 0]
  ------------------
  348|      0|					return -2;
  349|      0|			}
  350|     77|		}
  351|    257|	}
  352|       |
  353|    257|	m = cdf_file_property_info(ms, info, count, root_storage);
  354|    257|	free(info);
  355|       |
  356|    257|	return m == -1 ? -2 : m;
  ------------------
  |  Branch (356:9): [True: 128, False: 129]
  ------------------
  357|    257|}
readcdf.c:cdf_clsid_to_mime:
   97|     77|{
   98|     77|	size_t i;
   99|    154|	for (i = 0; cv[i].mime != NULL; i++) {
  ------------------
  |  Branch (99:14): [True: 77, False: 77]
  ------------------
  100|     77|		if (clsid[0] == cv[i].clsid[0] && clsid[1] == cv[i].clsid[1])
  ------------------
  |  Branch (100:7): [True: 0, False: 77]
  |  Branch (100:37): [True: 0, False: 0]
  ------------------
  101|      0|			return cv[i].mime;
  102|     77|	}
  103|       |#ifdef CDF_DEBUG
  104|       |	fprintf(stderr, "unknown mime %" PRIx64 ", %" PRIx64 "\n", clsid[0],
  105|       |	    clsid[1]);
  106|       |#endif
  107|     77|	return NULL;
  108|     77|}
readcdf.c:cdf_file_property_info:
  150|    257|{
  151|    257|	size_t i;
  152|    257|	cdf_timestamp_t tp;
  153|    257|	struct timespec ts;
  154|    257|	char buf[64];
  155|    257|	const char *str = NULL;
  156|    257|	const char *s, *e;
  157|    257|	int len;
  158|       |
  159|    257|	if (!NOTMIME(ms) && root_storage)
  ------------------
  |  |   42|    514|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    257|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    257|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    257|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (159:6): [True: 0, False: 257]
  |  Branch (159:22): [True: 0, False: 0]
  ------------------
  160|      0|		str = cdf_clsid_to_mime(root_storage->d_storage_uuid,
  161|      0|		    clsid2mime);
  162|       |
  163|  1.25k|	for (i = 0; i < count; i++) {
  ------------------
  |  Branch (163:14): [True: 1.12k, False: 129]
  ------------------
  164|  1.12k|		cdf_print_property_name(buf, sizeof(buf), info[i].pi_id);
  165|  1.12k|		switch (info[i].pi_type) {
  166|    146|		case CDF_NULL:
  ------------------
  |  |  199|    146|#define CDF_NULL		0x00000001
  ------------------
  |  Branch (166:3): [True: 146, False: 976]
  ------------------
  167|    146|			break;
  168|     62|		case CDF_SIGNED16:
  ------------------
  |  |  200|     62|#define CDF_SIGNED16		0x00000002
  ------------------
  |  Branch (168:3): [True: 62, False: 1.06k]
  ------------------
  169|     62|			if (NOTMIME(ms) && file_printf(ms, ", %s: %hd", buf,
  ------------------
  |  |   42|    124|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     62|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     62|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     62|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 62, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (169:23): [True: 0, False: 62]
  ------------------
  170|     62|			    info[i].pi_s16) == -1)
  ------------------
  |  |  188|     62|#define pi_s16	pi_val._pi_s16
  ------------------
  171|      0|				return -1;
  172|     62|			break;
  173|     62|		case CDF_SIGNED32:
  ------------------
  |  |  201|     23|#define CDF_SIGNED32		0x00000003
  ------------------
  |  Branch (173:3): [True: 23, False: 1.09k]
  ------------------
  174|     23|			if (NOTMIME(ms) && file_printf(ms, ", %s: %d", buf,
  ------------------
  |  |   42|     46|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     23|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     23|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     23|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 23, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (174:23): [True: 0, False: 23]
  ------------------
  175|     23|			    info[i].pi_s32) == -1)
  ------------------
  |  |  186|     23|#define pi_s32	pi_val._pi_s32
  ------------------
  176|      0|				return -1;
  177|     23|			break;
  178|     23|		case CDF_UNSIGNED32:
  ------------------
  |  |  216|     22|#define CDF_UNSIGNED32		0x00000013
  ------------------
  |  Branch (178:3): [True: 22, False: 1.10k]
  ------------------
  179|     22|			if (NOTMIME(ms) && file_printf(ms, ", %s: %u", buf,
  ------------------
  |  |   42|     44|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     22|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     22|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     22|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 22, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (179:23): [True: 0, False: 22]
  ------------------
  180|     22|			    info[i].pi_u32) == -1)
  ------------------
  |  |  185|     22|#define pi_u32	pi_val._pi_u32
  ------------------
  181|      0|				return -1;
  182|     22|			break;
  183|     29|		case CDF_FLOAT:
  ------------------
  |  |  202|     29|#define CDF_FLOAT		0x00000004
  ------------------
  |  Branch (183:3): [True: 29, False: 1.09k]
  ------------------
  184|     29|			if (NOTMIME(ms) && file_printf(ms, ", %s: %g", buf,
  ------------------
  |  |   42|     58|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     29|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     29|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     29|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 29, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (184:23): [True: 0, False: 29]
  ------------------
  185|     29|			    info[i].pi_f) == -1)
  ------------------
  |  |  189|     29|#define pi_f	pi_val._pi_f
  ------------------
  186|      0|				return -1;
  187|     29|			break;
  188|     29|		case CDF_DOUBLE:
  ------------------
  |  |  203|     25|#define CDF_DOUBLE		0x00000005
  ------------------
  |  Branch (188:3): [True: 25, False: 1.09k]
  ------------------
  189|     25|			if (NOTMIME(ms) && file_printf(ms, ", %s: %g", buf,
  ------------------
  |  |   42|     50|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|     25|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|     25|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|     25|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 25, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (189:23): [True: 0, False: 25]
  ------------------
  190|     25|			    info[i].pi_d) == -1)
  ------------------
  |  |  190|     25|#define pi_d	pi_val._pi_d
  ------------------
  191|      0|				return -1;
  192|     25|			break;
  193|    115|		case CDF_LENGTH32_STRING:
  ------------------
  |  |  227|    115|#define CDF_LENGTH32_STRING	0x0000001e
  ------------------
  |  Branch (193:3): [True: 115, False: 1.00k]
  ------------------
  194|    147|		case CDF_LENGTH32_WSTRING:
  ------------------
  |  |  228|    147|#define CDF_LENGTH32_WSTRING	0x0000001f
  ------------------
  |  Branch (194:3): [True: 32, False: 1.09k]
  ------------------
  195|    147|			len = info[i].pi_str.s_len;
  ------------------
  |  |  192|    147|#define pi_str	pi_val._pi_str
  ------------------
  196|    147|			if (len > 1) {
  ------------------
  |  Branch (196:8): [True: 143, False: 4]
  ------------------
  197|    143|				char vbuf[1024];
  198|    143|				size_t j, k = 1;
  199|       |
  200|    143|				if (info[i].pi_type == CDF_LENGTH32_WSTRING)
  ------------------
  |  |  228|    143|#define CDF_LENGTH32_WSTRING	0x0000001f
  ------------------
  |  Branch (200:9): [True: 32, False: 111]
  ------------------
  201|     32|				    k++;
  202|    143|				s = info[i].pi_str.s_buf;
  ------------------
  |  |  192|    143|#define pi_str	pi_val._pi_str
  ------------------
  203|    143|				e = info[i].pi_str.s_buf + len;
  ------------------
  |  |  192|    143|#define pi_str	pi_val._pi_str
  ------------------
  204|    583|				for (j = 0; s < e && j < sizeof(vbuf)
  ------------------
  |  Branch (204:17): [True: 574, False: 9]
  |  Branch (204:26): [True: 574, False: 0]
  ------------------
  205|    574|				    && len--; s += k) {
  ------------------
  |  Branch (205:12): [True: 574, False: 0]
  ------------------
  206|    574|					if (*s == '\0')
  ------------------
  |  Branch (206:10): [True: 134, False: 440]
  ------------------
  207|    134|						break;
  208|    440|					if (isprint(CAST(unsigned char, *s)))
  ------------------
  |  Branch (208:10): [True: 269, False: 171]
  ------------------
  209|    269|						vbuf[j++] = *s;
  210|    440|				}
  211|    143|				if (j == sizeof(vbuf))
  ------------------
  |  Branch (211:9): [True: 0, False: 143]
  ------------------
  212|      0|					--j;
  213|    143|				vbuf[j] = '\0';
  214|    143|				if (NOTMIME(ms)) {
  ------------------
  |  |   42|    143|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    143|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    143|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    143|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 143, False: 0]
  |  |  ------------------
  ------------------
  215|    143|					if (vbuf[0]) {
  ------------------
  |  Branch (215:10): [True: 114, False: 29]
  ------------------
  216|    114|						if (file_printf(ms, ", %s: %s",
  ------------------
  |  Branch (216:11): [True: 0, False: 114]
  ------------------
  217|    114|						    buf, vbuf) == -1)
  218|      0|							return -1;
  219|    114|					}
  220|    143|				} else if (str == NULL && info[i].pi_id ==
  ------------------
  |  Branch (220:16): [True: 0, False: 0]
  |  Branch (220:31): [True: 0, False: 0]
  ------------------
  221|      0|				    CDF_PROPERTY_NAME_OF_APPLICATION) {
  ------------------
  |  |  263|      0|#define CDF_PROPERTY_NAME_OF_APPLICATION	0x00000012
  ------------------
  222|      0|					str = cdf_app_to_mime(vbuf, app2mime);
  223|       |#ifdef CDF_DEBUG
  224|       |					fprintf(stderr, "Found property "
  225|       |					    "application name = \"%s\" "
  226|       |					    "(mime=%s)\n", vbuf, str);
  227|       |#endif
  228|      0|				}
  229|    143|			}
  230|    147|			break;
  231|    517|		case CDF_FILETIME:
  ------------------
  |  |  229|    517|#define CDF_FILETIME		0x00000040
  ------------------
  |  Branch (231:3): [True: 517, False: 605]
  ------------------
  232|    517|			tp = info[i].pi_tp;
  ------------------
  |  |  191|    517|#define pi_tp	pi_val._pi_tp
  ------------------
  233|    517|			if (tp != 0) {
  ------------------
  |  Branch (233:8): [True: 492, False: 25]
  ------------------
  234|    492|				char tbuf[64];
  235|    492|				if (tp < 1000000000000000LL) {
  ------------------
  |  Branch (235:9): [True: 172, False: 320]
  ------------------
  236|    172|					cdf_print_elapsed_time(tbuf,
  237|    172|					    sizeof(tbuf), tp);
  238|    172|					if (NOTMIME(ms) && file_printf(ms,
  ------------------
  |  |   42|    344|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    172|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    172|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    172|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 172, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (238:25): [True: 0, False: 172]
  ------------------
  239|    172|					    ", %s: %s", buf, tbuf) == -1)
  240|      0|						return -1;
  241|    320|				} else {
  242|    320|					char *c, *ec;
  243|    320|					cdf_timestamp_to_timespec(&ts, tp);
  244|    320|					c = cdf_ctime(&ts.tv_sec, tbuf);
  245|    320|					if (c != NULL &&
  ------------------
  |  Branch (245:10): [True: 320, False: 0]
  ------------------
  246|    320|					    (ec = strchr(c, '\n')) != NULL)
  ------------------
  |  Branch (246:10): [True: 320, False: 0]
  ------------------
  247|    320|						*ec = '\0';
  248|       |
  249|    320|					if (NOTMIME(ms) && file_printf(ms,
  ------------------
  |  |   42|    640|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|    320|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|    320|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|    320|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 320, False: 0]
  |  |  ------------------
  ------------------
  |  Branch (249:25): [True: 0, False: 320]
  ------------------
  250|    320|					    ", %s: %s", buf, c) == -1)
  251|      0|						return -1;
  252|    320|				}
  253|    492|			}
  254|    517|			break;
  255|    517|		case CDF_CLIPBOARD:
  ------------------
  |  |  236|     23|#define CDF_CLIPBOARD		0x00000047
  ------------------
  |  Branch (255:3): [True: 23, False: 1.09k]
  ------------------
  256|     23|			break;
  257|    128|		default:
  ------------------
  |  Branch (257:3): [True: 128, False: 994]
  ------------------
  258|    128|			return -1;
  259|  1.12k|		}
  260|  1.12k|	}
  261|    129|	if (ms->flags & MAGIC_MIME_TYPE) {
  ------------------
  |  |   37|    129|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (261:6): [True: 0, False: 129]
  ------------------
  262|      0|		if (str == NULL)
  ------------------
  |  Branch (262:7): [True: 0, False: 0]
  ------------------
  263|      0|			return 0;
  264|      0|		if (file_printf(ms, "application/%s", str) == -1)
  ------------------
  |  Branch (264:7): [True: 0, False: 0]
  ------------------
  265|      0|			return -1;
  266|      0|	}
  267|    129|	return 1;
  268|    129|}
readcdf.c:cdf_file_dir_info:
  519|    971|{
  520|    971|	size_t sd, i, j;
  521|    971|	uint16_t *dir_name;
  522|    971|	int dir_type;
  523|    971|	const char* section_name;
  524|       |
  525|  10.3k|	for (i = 0; i < dir->dir_len; i++) {
  ------------------
  |  Branch (525:14): [True: 9.39k, False: 967]
  ------------------
  526|  9.39k|		dir_name = dir->dir_tab[i].d_name;
  527|  9.39k|		dir_type = dir->dir_tab[i].d_type;
  528|       |
  529|  65.7k|		for (sd = 0; sd < __arraycount(sectioninfo); sd++) {
  ------------------
  |  |  138|  65.7k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (529:16): [True: 56.3k, False: 9.39k]
  ------------------
  530|  56.3k|			const struct sinfo *si = &sectioninfo[sd];
  531|   140k|			for (j = 0; si->sections[j]; j++) {
  ------------------
  |  Branch (531:16): [True: 84.5k, False: 56.3k]
  ------------------
  532|  84.5k|				if (si->sections[j] == NULL)
  ------------------
  |  Branch (532:9): [True: 0, False: 84.5k]
  ------------------
  533|      0|					continue;
  534|  84.5k|				section_name = si->sections[j];
  535|  84.5k|				if (si->types[j] != dir_type ||
  ------------------
  |  Branch (535:9): [True: 72.6k, False: 11.9k]
  ------------------
  536|  11.9k|				    cdf_namecmp(section_name, dir_name,
  ------------------
  |  Branch (536:9): [True: 11.9k, False: 4]
  ------------------
  537|  11.9k|					strlen(section_name) + 1) != 0)
  538|  84.5k|				    continue;
  539|       |#ifdef CDF_DEBUG
  540|       |				fprintf(stderr, "Matching directory %"
  541|       |				    SIZE_T_FORMAT
  542|       |				    "u with expected name \"%s\"\n",
  543|       |				    i, section_name);
  544|       |#endif
  545|      4|				if (NOTMIME(ms)) {
  ------------------
  |  |   42|      4|#define NOTMIME(ms) (((ms)->flags & MAGIC_MIME) == 0)
  |  |  ------------------
  |  |  |  |   44|      4|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|      4|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|      4|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (42:21): [True: 4, False: 0]
  |  |  ------------------
  ------------------
  546|      4|					if (file_printf(ms, "CDFV2 %s",
  ------------------
  |  Branch (546:10): [True: 0, False: 4]
  ------------------
  547|      4|					    si->name) == -1)
  548|      0|						return -1;
  549|      4|				} else if (ms->flags & MAGIC_MIME_TYPE) {
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (549:16): [True: 0, False: 0]
  ------------------
  550|      0|					if (file_printf(ms, "application/%s",
  ------------------
  |  Branch (550:10): [True: 0, False: 0]
  ------------------
  551|      0|					    si->mime) == -1)
  552|      0|						return -1;
  553|      0|				}
  554|      4|				return 1;
  555|      4|			}
  556|  56.3k|		}
  557|  9.39k|	}
  558|    967|	return -1;
  559|    971|}

file_tryelf:
 1897|  8.37k|{
 1898|  8.37k|	int fd = b->fd;
 1899|  8.37k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  8.37k|#define CAST(T, b)	((T)(b))
  ------------------
 1900|  8.37k|	size_t nbytes = b->flen;
 1901|  8.37k|	union {
 1902|  8.37k|		int32_t l;
 1903|  8.37k|		char c[sizeof(int32_t)];
 1904|  8.37k|	} u;
 1905|  8.37k|	int clazz;
 1906|  8.37k|	int swap;
 1907|  8.37k|	struct stat st;
 1908|  8.37k|	const struct stat *stp;
 1909|  8.37k|	off_t fsize;
 1910|  8.37k|	int flags = 0;
 1911|  8.37k|	Elf32_Ehdr elf32hdr;
 1912|  8.37k|	Elf64_Ehdr elf64hdr;
 1913|  8.37k|	uint16_t type, phnum, shnum, notecount;
 1914|       |
 1915|  8.37k|	if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))
  ------------------
  |  |   45|  8.37k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if (ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))
  ------------------
  |  |   46|  8.37k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (1915:6): [True: 0, False: 8.37k]
  ------------------
 1916|      0|		return 0;
 1917|       |	/*
 1918|       |	 * ELF executables have multiple section headers in arbitrary
 1919|       |	 * file locations and thus file(1) cannot determine it from easily.
 1920|       |	 * Instead we traverse thru all section headers until a symbol table
 1921|       |	 * one is found or else the binary is stripped.
 1922|       |	 * Return immediately if it's not ELF (so we avoid pipe2file unless
 1923|       |	 * needed).
 1924|       |	 */
 1925|  8.37k|	if (buf[EI_MAG0] != ELFMAG0
  ------------------
  |  |  157|  8.37k|#define	EI_MAG0		0		/* e_ident[] indexes */
  ------------------
              	if (buf[EI_MAG0] != ELFMAG0
  ------------------
  |  |  166|  16.7k|#define	ELFMAG0		0x7f		/* EI_MAG */
  ------------------
  |  Branch (1925:6): [True: 3.58k, False: 4.79k]
  ------------------
 1926|  4.79k|	    || (buf[EI_MAG1] != ELFMAG1 && buf[EI_MAG1] != OLFMAG1)
  ------------------
  |  |  158|  4.79k|#define	EI_MAG1		1
  ------------------
              	    || (buf[EI_MAG1] != ELFMAG1 && buf[EI_MAG1] != OLFMAG1)
  ------------------
  |  |  167|  9.58k|#define	ELFMAG1		'E'
  ------------------
              	    || (buf[EI_MAG1] != ELFMAG1 && buf[EI_MAG1] != OLFMAG1)
  ------------------
  |  |  158|  3.77k|#define	EI_MAG1		1
  ------------------
              	    || (buf[EI_MAG1] != ELFMAG1 && buf[EI_MAG1] != OLFMAG1)
  ------------------
  |  |  172|  3.77k|#define	OLFMAG1		'O'
  ------------------
  |  Branch (1926:10): [True: 3.77k, False: 1.01k]
  |  Branch (1926:37): [True: 21, False: 3.75k]
  ------------------
 1927|  4.76k|	    || buf[EI_MAG2] != ELFMAG2 || buf[EI_MAG3] != ELFMAG3)
  ------------------
  |  |  159|  4.76k|#define	EI_MAG2		2
  ------------------
              	    || buf[EI_MAG2] != ELFMAG2 || buf[EI_MAG3] != ELFMAG3)
  ------------------
  |  |  168|  13.1k|#define	ELFMAG2		'L'
  ------------------
              	    || buf[EI_MAG2] != ELFMAG2 || buf[EI_MAG3] != ELFMAG3)
  ------------------
  |  |  160|  4.75k|#define	EI_MAG3		3
  ------------------
              	    || buf[EI_MAG2] != ELFMAG2 || buf[EI_MAG3] != ELFMAG3)
  ------------------
  |  |  169|  4.75k|#define	ELFMAG3		'F'
  ------------------
  |  Branch (1927:9): [True: 10, False: 4.75k]
  |  Branch (1927:36): [True: 12, False: 4.74k]
  ------------------
 1928|  3.62k|		return 0;
 1929|       |
 1930|       |	/*
 1931|       |	 * If we cannot seek, it must be a pipe, socket or fifo.
 1932|       |	 */
 1933|  4.74k|	if((lseek(fd, CAST(off_t, 0), SEEK_SET) == CAST(off_t, -1))
  ------------------
  |  |  460|  4.74k|#define CAST(T, b)	((T)(b))
  ------------------
              	if((lseek(fd, CAST(off_t, 0), SEEK_SET) == CAST(off_t, -1))
  ------------------
  |  |  460|  4.74k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1933:5): [True: 0, False: 4.74k]
  ------------------
 1934|      0|	    && (errno == ESPIPE))
  ------------------
  |  Branch (1934:9): [True: 0, False: 0]
  ------------------
 1935|      0|		fd = file_pipe2file(ms, fd, buf, nbytes);
 1936|       |
 1937|  4.74k|	if (fd == -1) {
  ------------------
  |  Branch (1937:6): [True: 0, False: 4.74k]
  ------------------
 1938|      0|		file_badread(ms);
 1939|      0|		return -1;
 1940|      0|	}
 1941|       |
 1942|  4.74k|	stp = &b->st;
 1943|       |	/*
 1944|       |	 * b->st.st_size != 0 if previous fstat() succeeded,
 1945|       |	 * which is likely, we can avoid extra stat() call.
 1946|       |	 */
 1947|  4.74k|	if (b->st.st_size == 0) {
  ------------------
  |  Branch (1947:6): [True: 0, False: 4.74k]
  ------------------
 1948|      0|		stp = &st;
 1949|      0|		if (fstat(fd, &st) == -1) {
  ------------------
  |  Branch (1949:7): [True: 0, False: 0]
  ------------------
 1950|      0|			file_badread(ms);
 1951|      0|			return -1;
 1952|      0|		}
 1953|      0|	}
 1954|  4.74k|	if (S_ISREG(stp->st_mode) || stp->st_size != 0)
  ------------------
  |  Branch (1954:6): [True: 4.74k, False: 0]
  |  Branch (1954:31): [True: 0, False: 0]
  ------------------
 1955|  4.74k|		fsize = stp->st_size;
 1956|      0|	else
 1957|      0|		fsize = SIZE_UNKNOWN;
  ------------------
  |  |   65|      0|#define SIZE_UNKNOWN	CAST(off_t, -1)
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1958|       |
 1959|  4.74k|	clazz = buf[EI_CLASS];
  ------------------
  |  |  161|  4.74k|#define	EI_CLASS	4
  ------------------
 1960|       |
 1961|  4.74k|	switch (clazz) {
 1962|  3.04k|	case ELFCLASS32:
  ------------------
  |  |  153|  3.04k|#define	ELFCLASS32	1
  ------------------
  |  Branch (1962:2): [True: 3.04k, False: 1.70k]
  ------------------
 1963|  3.04k|#undef elf_getu
 1964|  3.04k|#define elf_getu(a, b)	elf_getu32(a, b)
 1965|  3.04k|#undef elfhdr
 1966|  3.04k|#define elfhdr elf32hdr
 1967|  3.04k|#include "elfclass.h"
  ------------------
  |  |    1|       |/*
  |  |    2|       | * Copyright (c) Christos Zoulas 2008.
  |  |    3|       | * All Rights Reserved.
  |  |    4|       | *
  |  |    5|       | * Redistribution and use in source and binary forms, with or without
  |  |    6|       | * modification, are permitted provided that the following conditions
  |  |    7|       | * are met:
  |  |    8|       | * 1. Redistributions of source code must retain the above copyright
  |  |    9|       | *    notice immediately at the beginning of the file, without modification,
  |  |   10|       | *    this list of conditions, and the following disclaimer.
  |  |   11|       | * 2. Redistributions in binary form must reproduce the above copyright
  |  |   12|       | *    notice, this list of conditions and the following disclaimer in the
  |  |   13|       | *    documentation and/or other materials provided with the distribution.
  |  |   14|       | *
  |  |   15|       | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  |  |   16|       | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  |  |   17|       | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  |  |   18|       | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
  |  |   19|       | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  |  |   20|       | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  |  |   21|       | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  |  |   22|       | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  |  |   23|       | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  |  |   24|       | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  |  |   25|       | * SUCH DAMAGE.
  |  |   26|       | */
  |  |   27|  3.04k|	if (nbytes <= sizeof(elfhdr))
  |  |  ------------------
  |  |  |  | 1966|  3.04k|#define elfhdr elf32hdr
  |  |  ------------------
  |  |  |  Branch (27:6): [True: 8, False: 3.03k]
  |  |  ------------------
  |  |   28|      8|		return 0;
  |  |   29|       |
  |  |   30|  3.03k|	u.l = 1;
  |  |   31|  3.03k|	(void)memcpy(&elfhdr, buf, sizeof elfhdr);
  |  |  ------------------
  |  |  |  | 1966|  3.03k|#define elfhdr elf32hdr
  |  |  ------------------
  |  |               	(void)memcpy(&elfhdr, buf, sizeof elfhdr);
  |  |  ------------------
  |  |  |  | 1966|  3.03k|#define elfhdr elf32hdr
  |  |  ------------------
  |  |   32|  3.03k|	swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[EI_DATA];
  |  |  ------------------
  |  |  |  | 1966|  3.03k|#define elfhdr elf32hdr
  |  |  ------------------
  |  |               	swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[EI_DATA];
  |  |  ------------------
  |  |  |  |  162|  3.03k|#define	EI_DATA		5
  |  |  ------------------
  |  |   33|       |
  |  |   34|  3.03k|	type = elf_getu16(swap, elfhdr.e_type);
  |  |  ------------------
  |  |  |  |  157|  3.03k|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   35|  3.03k|	notecount = ms->elf_notes_max;
  |  |   36|  3.03k|	switch (type) {
  |  |   37|      0|#ifdef ELFCORE
  |  |   38|  1.89k|	case ET_CORE:
  |  |  ------------------
  |  |  |  |  130|  1.89k|#define	ET_CORE		4
  |  |  ------------------
  |  |  |  Branch (38:2): [True: 1.89k, False: 1.14k]
  |  |  ------------------
  |  |   39|  1.89k|		phnum = elf_getu16(swap, elfhdr.e_phnum);
  |  |  ------------------
  |  |  |  |  157|  1.89k|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   40|  1.89k|		if (phnum > ms->elf_phnum_max)
  |  |  ------------------
  |  |  |  Branch (40:7): [True: 21, False: 1.86k]
  |  |  ------------------
  |  |   41|     21|			return toomany(ms, "program headers", phnum);
  |  |   42|  1.86k|		flags |= FLAGS_IS_CORE;
  |  |  ------------------
  |  |  |  |  361|  1.86k|#define FLAGS_IS_CORE			0x1000
  |  |  ------------------
  |  |   43|  1.86k|		if (dophn_core(ms, clazz, swap, fd,
  |  |  ------------------
  |  |  |  Branch (43:7): [True: 0, False: 1.86k]
  |  |  ------------------
  |  |   44|  1.86k|		    CAST(off_t, elf_getu(swap, elfhdr.e_phoff)), phnum,
  |  |  ------------------
  |  |  |  |  460|  1.86k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   45|  1.86k|		    CAST(size_t, elf_getu16(swap, elfhdr.e_phentsize)),
  |  |  ------------------
  |  |  |  |  460|  1.86k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   46|  1.86k|		    fsize, &flags, &notecount) == -1)
  |  |   47|      0|			return -1;
  |  |   48|  1.86k|		break;
  |  |   49|  1.86k|#endif
  |  |   50|  1.86k|	case ET_EXEC:
  |  |  ------------------
  |  |  |  |  128|  1.02k|#define	ET_EXEC		2
  |  |  ------------------
  |  |  |  Branch (50:2): [True: 1.02k, False: 2.01k]
  |  |  ------------------
  |  |   51|  1.12k|	case ET_DYN:
  |  |  ------------------
  |  |  |  |  129|  1.12k|#define	ET_DYN		3
  |  |  ------------------
  |  |  |  Branch (51:2): [True: 102, False: 2.93k]
  |  |  ------------------
  |  |   52|  1.12k|		phnum = elf_getu16(swap, elfhdr.e_phnum);
  |  |  ------------------
  |  |  |  |  157|  1.12k|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   53|  1.12k|		if (phnum > ms->elf_phnum_max)
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 18, False: 1.11k]
  |  |  ------------------
  |  |   54|     18|			return toomany(ms, "program", phnum);
  |  |   55|  1.11k|		shnum = elf_getu16(swap, elfhdr.e_shnum);
  |  |  ------------------
  |  |  |  |  157|  1.11k|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   56|  1.11k|		if (shnum > ms->elf_shnum_max)
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 11, False: 1.10k]
  |  |  ------------------
  |  |   57|     11|			return toomany(ms, "section", shnum);
  |  |   58|  1.10k|		if (dophn_exec(ms, clazz, swap, fd,
  |  |  ------------------
  |  |  |  Branch (58:7): [True: 1, False: 1.09k]
  |  |  ------------------
  |  |   59|  1.10k|		    CAST(off_t, elf_getu(swap, elfhdr.e_phoff)), phnum,
  |  |  ------------------
  |  |  |  |  460|  1.10k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   60|  1.10k|		    CAST(size_t, elf_getu16(swap, elfhdr.e_phentsize)),
  |  |  ------------------
  |  |  |  |  460|  1.10k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   61|  1.10k|		    fsize, shnum, &flags, &notecount) == -1)
  |  |   62|      1|			return -1;
  |  |   63|       |		/*FALLTHROUGH*/
  |  |   64|  1.11k|	case ET_REL:
  |  |  ------------------
  |  |  |  |  127|  1.11k|#define	ET_REL		1
  |  |  ------------------
  |  |  |  Branch (64:2): [True: 18, False: 3.02k]
  |  |  ------------------
  |  |   65|  1.11k|		shnum = elf_getu16(swap, elfhdr.e_shnum);
  |  |  ------------------
  |  |  |  |  157|  1.11k|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   66|  1.11k|		if (shnum > ms->elf_shnum_max)
  |  |  ------------------
  |  |  |  Branch (66:7): [True: 13, False: 1.10k]
  |  |  ------------------
  |  |   67|     13|			return toomany(ms, "section headers", shnum);
  |  |   68|  1.10k|		if (doshn(ms, clazz, swap, fd,
  |  |  ------------------
  |  |  |  Branch (68:7): [True: 60, False: 1.04k]
  |  |  ------------------
  |  |   69|  1.10k|		    CAST(off_t, elf_getu(swap, elfhdr.e_shoff)), shnum,
  |  |  ------------------
  |  |  |  |  460|  1.10k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   70|  1.10k|		    CAST(size_t, elf_getu16(swap, elfhdr.e_shentsize)),
  |  |  ------------------
  |  |  |  |  460|  1.10k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   71|  1.10k|		    fsize, elf_getu16(swap, elfhdr.e_machine),
  |  |  ------------------
  |  |  |  |  157|  1.10k|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   72|  1.10k|		    CAST(int, elf_getu16(swap, elfhdr.e_shstrndx)),
  |  |  ------------------
  |  |  |  |  460|  1.10k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   73|  1.10k|		    &flags, &notecount) == -1)
  |  |   74|     60|			return -1;
  |  |   75|  1.04k|		break;
  |  |   76|       |
  |  |   77|  1.04k|	default:
  |  |  ------------------
  |  |  |  Branch (77:2): [True: 1, False: 3.03k]
  |  |  ------------------
  |  |   78|      1|		break;
  |  |   79|  3.03k|	}
  |  |   80|  2.91k|	if (notecount == 0)
  |  |  ------------------
  |  |  |  Branch (80:6): [True: 26, False: 2.88k]
  |  |  ------------------
  |  |   81|     26|		return toomany(ms, "notes", ms->elf_notes_max);
  |  |   82|  2.88k|	return 1;
  ------------------
 1968|  1.69k|	case ELFCLASS64:
  ------------------
  |  |  154|  1.69k|#define	ELFCLASS64	2
  ------------------
  |  Branch (1968:2): [True: 1.69k, False: 3.05k]
  ------------------
 1969|  1.69k|#undef elf_getu
 1970|  1.69k|#define elf_getu(a, b)	elf_getu64(a, b)
 1971|  1.69k|#undef elfhdr
 1972|  1.69k|#define elfhdr elf64hdr
 1973|  1.69k|#include "elfclass.h"
  ------------------
  |  |    1|       |/*
  |  |    2|       | * Copyright (c) Christos Zoulas 2008.
  |  |    3|       | * All Rights Reserved.
  |  |    4|       | *
  |  |    5|       | * Redistribution and use in source and binary forms, with or without
  |  |    6|       | * modification, are permitted provided that the following conditions
  |  |    7|       | * are met:
  |  |    8|       | * 1. Redistributions of source code must retain the above copyright
  |  |    9|       | *    notice immediately at the beginning of the file, without modification,
  |  |   10|       | *    this list of conditions, and the following disclaimer.
  |  |   11|       | * 2. Redistributions in binary form must reproduce the above copyright
  |  |   12|       | *    notice, this list of conditions and the following disclaimer in the
  |  |   13|       | *    documentation and/or other materials provided with the distribution.
  |  |   14|       | *
  |  |   15|       | * THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
  |  |   16|       | * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  |  |   17|       | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  |  |   18|       | * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR
  |  |   19|       | * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  |  |   20|       | * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  |  |   21|       | * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  |  |   22|       | * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  |  |   23|       | * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  |  |   24|       | * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  |  |   25|       | * SUCH DAMAGE.
  |  |   26|       | */
  |  |   27|  1.69k|	if (nbytes <= sizeof(elfhdr))
  |  |  ------------------
  |  |  |  | 1972|  1.69k|#define elfhdr elf64hdr
  |  |  ------------------
  |  |  |  Branch (27:6): [True: 13, False: 1.68k]
  |  |  ------------------
  |  |   28|     13|		return 0;
  |  |   29|       |
  |  |   30|  1.68k|	u.l = 1;
  |  |   31|  1.68k|	(void)memcpy(&elfhdr, buf, sizeof elfhdr);
  |  |  ------------------
  |  |  |  | 1972|  1.68k|#define elfhdr elf64hdr
  |  |  ------------------
  |  |               	(void)memcpy(&elfhdr, buf, sizeof elfhdr);
  |  |  ------------------
  |  |  |  | 1972|  1.68k|#define elfhdr elf64hdr
  |  |  ------------------
  |  |   32|  1.68k|	swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[EI_DATA];
  |  |  ------------------
  |  |  |  | 1972|  1.68k|#define elfhdr elf64hdr
  |  |  ------------------
  |  |               	swap = (u.c[sizeof(int32_t) - 1] + 1) != elfhdr.e_ident[EI_DATA];
  |  |  ------------------
  |  |  |  |  162|  1.68k|#define	EI_DATA		5
  |  |  ------------------
  |  |   33|       |
  |  |   34|  1.68k|	type = elf_getu16(swap, elfhdr.e_type);
  |  |  ------------------
  |  |  |  |  157|  1.68k|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   35|  1.68k|	notecount = ms->elf_notes_max;
  |  |   36|  1.68k|	switch (type) {
  |  |   37|      0|#ifdef ELFCORE
  |  |   38|    619|	case ET_CORE:
  |  |  ------------------
  |  |  |  |  130|    619|#define	ET_CORE		4
  |  |  ------------------
  |  |  |  Branch (38:2): [True: 619, False: 1.06k]
  |  |  ------------------
  |  |   39|    619|		phnum = elf_getu16(swap, elfhdr.e_phnum);
  |  |  ------------------
  |  |  |  |  157|    619|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   40|    619|		if (phnum > ms->elf_phnum_max)
  |  |  ------------------
  |  |  |  Branch (40:7): [True: 12, False: 607]
  |  |  ------------------
  |  |   41|     12|			return toomany(ms, "program headers", phnum);
  |  |   42|    607|		flags |= FLAGS_IS_CORE;
  |  |  ------------------
  |  |  |  |  361|    607|#define FLAGS_IS_CORE			0x1000
  |  |  ------------------
  |  |   43|    607|		if (dophn_core(ms, clazz, swap, fd,
  |  |  ------------------
  |  |  |  Branch (43:7): [True: 0, False: 607]
  |  |  ------------------
  |  |   44|    607|		    CAST(off_t, elf_getu(swap, elfhdr.e_phoff)), phnum,
  |  |  ------------------
  |  |  |  |  460|    607|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   45|    607|		    CAST(size_t, elf_getu16(swap, elfhdr.e_phentsize)),
  |  |  ------------------
  |  |  |  |  460|    607|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   46|    607|		    fsize, &flags, &notecount) == -1)
  |  |   47|      0|			return -1;
  |  |   48|    607|		break;
  |  |   49|    607|#endif
  |  |   50|    607|	case ET_EXEC:
  |  |  ------------------
  |  |  |  |  128|    545|#define	ET_EXEC		2
  |  |  ------------------
  |  |  |  Branch (50:2): [True: 545, False: 1.13k]
  |  |  ------------------
  |  |   51|    968|	case ET_DYN:
  |  |  ------------------
  |  |  |  |  129|    968|#define	ET_DYN		3
  |  |  ------------------
  |  |  |  Branch (51:2): [True: 423, False: 1.25k]
  |  |  ------------------
  |  |   52|    968|		phnum = elf_getu16(swap, elfhdr.e_phnum);
  |  |  ------------------
  |  |  |  |  157|    968|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   53|    968|		if (phnum > ms->elf_phnum_max)
  |  |  ------------------
  |  |  |  Branch (53:7): [True: 16, False: 952]
  |  |  ------------------
  |  |   54|     16|			return toomany(ms, "program", phnum);
  |  |   55|    952|		shnum = elf_getu16(swap, elfhdr.e_shnum);
  |  |  ------------------
  |  |  |  |  157|    952|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   56|    952|		if (shnum > ms->elf_shnum_max)
  |  |  ------------------
  |  |  |  Branch (56:7): [True: 16, False: 936]
  |  |  ------------------
  |  |   57|     16|			return toomany(ms, "section", shnum);
  |  |   58|    936|		if (dophn_exec(ms, clazz, swap, fd,
  |  |  ------------------
  |  |  |  Branch (58:7): [True: 1, False: 935]
  |  |  ------------------
  |  |   59|    936|		    CAST(off_t, elf_getu(swap, elfhdr.e_phoff)), phnum,
  |  |  ------------------
  |  |  |  |  460|    936|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   60|    936|		    CAST(size_t, elf_getu16(swap, elfhdr.e_phentsize)),
  |  |  ------------------
  |  |  |  |  460|    936|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   61|    936|		    fsize, shnum, &flags, &notecount) == -1)
  |  |   62|      1|			return -1;
  |  |   63|       |		/*FALLTHROUGH*/
  |  |   64|  1.02k|	case ET_REL:
  |  |  ------------------
  |  |  |  |  127|  1.02k|#define	ET_REL		1
  |  |  ------------------
  |  |  |  Branch (64:2): [True: 91, False: 1.58k]
  |  |  ------------------
  |  |   65|  1.02k|		shnum = elf_getu16(swap, elfhdr.e_shnum);
  |  |  ------------------
  |  |  |  |  157|  1.02k|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   66|  1.02k|		if (shnum > ms->elf_shnum_max)
  |  |  ------------------
  |  |  |  Branch (66:7): [True: 1, False: 1.02k]
  |  |  ------------------
  |  |   67|      1|			return toomany(ms, "section headers", shnum);
  |  |   68|  1.02k|		if (doshn(ms, clazz, swap, fd,
  |  |  ------------------
  |  |  |  Branch (68:7): [True: 88, False: 937]
  |  |  ------------------
  |  |   69|  1.02k|		    CAST(off_t, elf_getu(swap, elfhdr.e_shoff)), shnum,
  |  |  ------------------
  |  |  |  |  460|  1.02k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   70|  1.02k|		    CAST(size_t, elf_getu16(swap, elfhdr.e_shentsize)),
  |  |  ------------------
  |  |  |  |  460|  1.02k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   71|  1.02k|		    fsize, elf_getu16(swap, elfhdr.e_machine),
  |  |  ------------------
  |  |  |  |  157|  1.02k|#define elf_getu16(swap, value) getu16(swap, value)
  |  |  ------------------
  |  |   72|  1.02k|		    CAST(int, elf_getu16(swap, elfhdr.e_shstrndx)),
  |  |  ------------------
  |  |  |  |  460|  1.02k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   73|  1.02k|		    &flags, &notecount) == -1)
  |  |   74|     88|			return -1;
  |  |   75|    937|		break;
  |  |   76|       |
  |  |   77|    937|	default:
  |  |  ------------------
  |  |  |  Branch (77:2): [True: 2, False: 1.67k]
  |  |  ------------------
  |  |   78|      2|		break;
  |  |   79|  1.68k|	}
  |  |   80|  1.54k|	if (notecount == 0)
  |  |  ------------------
  |  |  |  Branch (80:6): [True: 5, False: 1.54k]
  |  |  ------------------
  |  |   81|      5|		return toomany(ms, "notes", ms->elf_notes_max);
  |  |   82|  1.54k|	return 1;
  ------------------
 1974|      8|	default:
  ------------------
  |  Branch (1974:2): [True: 8, False: 4.73k]
  ------------------
 1975|      8|	    if (elf_printf(ms, ", unknown class %d", clazz) == -1)
  ------------------
  |  Branch (1975:10): [True: 0, False: 8]
  ------------------
 1976|      0|		    return -1;
 1977|      8|	    break;
 1978|  4.74k|	}
 1979|      8|	return 0;
 1980|  4.74k|}
readelf.c:getu16:
   94|  24.4k|{
   95|  24.4k|	union {
   96|  24.4k|		uint16_t ui;
   97|  24.4k|		char c[2];
   98|  24.4k|	} retval, tmpval;
   99|       |
  100|  24.4k|	if (swap) {
  ------------------
  |  Branch (100:6): [True: 7.00k, False: 17.4k]
  ------------------
  101|  7.00k|		tmpval.ui = value;
  102|       |
  103|  7.00k|		retval.c[0] = tmpval.c[1];
  104|  7.00k|		retval.c[1] = tmpval.c[0];
  105|       |
  106|  7.00k|		return retval.ui;
  107|  7.00k|	} else
  108|  17.4k|		return value;
  109|  24.4k|}
readelf.c:toomany:
   86|    139|{
   87|    139|	if (elf_printf(ms, ", too many %s (%u)", name, num) == -1)
  ------------------
  |  Branch (87:6): [True: 0, False: 139]
  ------------------
   88|      0|		return -1;
   89|    139|	return 1;
   90|    139|}
readelf.c:dophn_core:
  367|  2.47k|{
  368|  2.47k|	Elf32_Phdr ph32;
  369|  2.47k|	Elf64_Phdr ph64;
  370|  2.47k|	size_t offset, len;
  371|  2.47k|	unsigned char nbuf[NBUFSIZE];
  372|  2.47k|	ssize_t bufsize;
  373|  2.47k|	off_t ph_off = off, offs;
  374|  2.47k|	int ph_num = num;
  375|       |
  376|  2.47k|	if (ms->flags & MAGIC_MIME)
  ------------------
  |  |   44|  2.47k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  2.47k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  2.47k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (376:6): [True: 0, False: 2.47k]
  ------------------
  377|      0|		return 0;
  378|       |
  379|  2.47k|	if (num == 0) {
  ------------------
  |  Branch (379:6): [True: 2, False: 2.47k]
  ------------------
  380|      2|		if (elf_printf(ms, ", no program header") == -1)
  ------------------
  |  Branch (380:7): [True: 0, False: 2]
  ------------------
  381|      0|			return -1;
  382|      2|		return 0;
  383|      2|	}
  384|  2.47k|	if (size != xph_sizeof) {
  ------------------
  |  |  183|  2.47k|#define xph_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  2.47k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (183:21): [True: 1.86k, False: 606]
  |  |  ------------------
  |  |  184|  2.47k|			 ? sizeof(ph32)				\
  |  |  185|  2.47k|			 : sizeof(ph64))
  ------------------
  |  Branch (384:6): [True: 7, False: 2.46k]
  ------------------
  385|      7|		if (elf_printf(ms, ", corrupted program header size") == -1)
  ------------------
  |  Branch (385:7): [True: 0, False: 7]
  ------------------
  386|      0|			return -1;
  387|      7|		return 0;
  388|      7|	}
  389|       |
  390|       |	/*
  391|       |	 * Loop through all the program headers.
  392|       |	 */
  393|  19.8k|	for ( ; num; num--) {
  ------------------
  |  Branch (393:10): [True: 19.7k, False: 65]
  ------------------
  394|  19.7k|		if (pread(fd, xph_addr, xph_sizeof, off) <
  ------------------
  |  |  180|  19.7k|#define xph_addr	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  19.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (180:19): [True: 13.5k, False: 6.25k]
  |  |  ------------------
  |  |  181|  19.7k|			 ? CAST(void *, &ph32)			\
  |  |  ------------------
  |  |  |  |  460|  13.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  182|  19.7k|			 : CAST(void *, &ph64))
  |  |  ------------------
  |  |  |  |  460|  6.25k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              		if (pread(fd, xph_addr, xph_sizeof, off) <
  ------------------
  |  |  183|  19.7k|#define xph_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  19.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (183:21): [True: 13.5k, False: 6.25k]
  |  |  ------------------
  |  |  184|  19.7k|			 ? sizeof(ph32)				\
  |  |  185|  19.7k|			 : sizeof(ph64))
  ------------------
  |  Branch (394:7): [True: 2.38k, False: 17.3k]
  ------------------
  395|  19.7k|		    CAST(ssize_t, xph_sizeof)) {
  ------------------
  |  |  460|  39.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 13.5k, False: 6.25k]
  |  |  ------------------
  ------------------
  396|  2.38k|			if (elf_printf(ms, 
  ------------------
  |  Branch (396:8): [True: 0, False: 2.38k]
  ------------------
  397|  2.38k|			    ", can't read elf program headers at %jd",
  398|  2.38k|			    (intmax_t)off) == -1)
  399|      0|				return -1;
  400|  2.38k|			return 0;
  401|  2.38k|		}
  402|  17.3k|		off += size;
  403|       |
  404|  17.3k|		if (fsize != SIZE_UNKNOWN && xph_offset > fsize) {
  ------------------
  |  |   65|  17.3k|#define SIZE_UNKNOWN	CAST(off_t, -1)
  |  |  ------------------
  |  |  |  |  460|  34.7k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              		if (fsize != SIZE_UNKNOWN && xph_offset > fsize) {
  ------------------
  |  |  189|  17.3k|#define xph_offset	CAST(off_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  34.7k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 11.6k, False: 5.70k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  190|  17.3k|			 ? elf_getu32(swap, ph32.p_offset)	\
  |  |  191|  17.3k|			 : elf_getu64(swap, ph64.p_offset)))
  ------------------
  |  Branch (404:7): [True: 17.3k, False: 0]
  |  Branch (404:32): [True: 6.12k, False: 11.2k]
  ------------------
  405|       |			/* Perhaps warn here */
  406|  6.12k|			continue;
  407|  6.12k|		}
  408|       |
  409|  11.2k|		if (xph_type != PT_NOTE)
  ------------------
  |  |  186|  11.2k|#define xph_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  11.2k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (186:19): [True: 8.18k, False: 3.08k]
  |  |  ------------------
  |  |  187|  11.2k|			 ? elf_getu32(swap, ph32.p_type)	\
  |  |  ------------------
  |  |  |  |  158|  8.18k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  188|  11.2k|			 : elf_getu32(swap, ph64.p_type))
  |  |  ------------------
  |  |  |  |  158|  3.08k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
              		if (xph_type != PT_NOTE)
  ------------------
  |  |  201|  11.2k|#define	PT_NOTE		4
  ------------------
  |  Branch (409:7): [True: 4.21k, False: 7.05k]
  ------------------
  410|  4.21k|			continue;
  411|       |
  412|       |		/*
  413|       |		 * This is a PT_NOTE section; loop through all the notes
  414|       |		 * in the section.
  415|       |		 */
  416|  7.05k|		len = xph_filesz < sizeof(nbuf) ? xph_filesz : sizeof(nbuf);
  ------------------
  |  |  202|  7.05k|#define xph_filesz	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  14.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 5.58k, False: 1.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  203|  7.05k|			 ? elf_getu32(swap, ph32.p_filesz)	\
  |  |  204|  7.05k|			 : elf_getu64(swap, ph64.p_filesz)))
  ------------------
              		len = xph_filesz < sizeof(nbuf) ? xph_filesz : sizeof(nbuf);
  ------------------
  |  |  202|  1.22k|#define xph_filesz	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  2.44k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 743, False: 478]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  203|  7.05k|			 ? elf_getu32(swap, ph32.p_filesz)	\
  |  |  204|  7.05k|			 : elf_getu64(swap, ph64.p_filesz)))
  ------------------
  |  Branch (416:9): [True: 1.22k, False: 5.83k]
  ------------------
  417|  7.05k|		offs = xph_offset;
  ------------------
  |  |  189|  7.05k|#define xph_offset	CAST(off_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  14.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 5.58k, False: 1.46k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  190|  7.05k|			 ? elf_getu32(swap, ph32.p_offset)	\
  |  |  191|  7.05k|			 : elf_getu64(swap, ph64.p_offset)))
  ------------------
  418|  7.05k|		if ((bufsize = pread(fd, nbuf, len, offs)) == -1) {
  ------------------
  |  Branch (418:7): [True: 21, False: 7.03k]
  ------------------
  419|     21|			if (elf_printf(ms, " can't read note section at %jd",
  ------------------
  |  Branch (419:8): [True: 0, False: 21]
  ------------------
  420|     21|			    (intmax_t)offs) == -1)
  421|      0|				return -1;
  422|     21|			return 0;
  423|     21|		}
  424|  7.03k|		offset = 0;
  425|  32.9k|		for (;;) {
  426|  32.9k|			if (offset >= CAST(size_t, bufsize))
  ------------------
  |  |  460|  32.9k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (426:8): [True: 5.50k, False: 27.4k]
  ------------------
  427|  5.50k|				break;
  428|  27.4k|			offset = donote(ms, nbuf, offset, CAST(size_t, bufsize),
  ------------------
  |  |  460|  27.4k|#define CAST(T, b)	((T)(b))
  ------------------
  429|  27.4k|			    clazz, swap, 4, flags, notecount, fd, ph_off,
  430|  27.4k|			    ph_num, fsize);
  431|  27.4k|			if (offset == 0)
  ------------------
  |  Branch (431:8): [True: 1.52k, False: 25.9k]
  ------------------
  432|  1.52k|				break;
  433|       |
  434|  27.4k|		}
  435|  7.03k|	}
  436|     65|	return 0;
  437|  2.46k|}
readelf.c:donote:
 1235|  35.4k|{
 1236|  35.4k|	Elf32_Nhdr nh32;
 1237|  35.4k|	Elf64_Nhdr nh64;
 1238|  35.4k|	size_t noff, doff;
 1239|  35.4k|	uint32_t namesz, descsz;
 1240|  35.4k|	char buf[256];
 1241|  35.4k|	unsigned char *nbuf = CAST(unsigned char *, vbuf);
  ------------------
  |  |  460|  35.4k|#define CAST(T, b)	((T)(b))
  ------------------
 1242|       |
 1243|  35.4k|	if (*notecount == 0)
  ------------------
  |  Branch (1243:6): [True: 615, False: 34.8k]
  ------------------
 1244|    615|		return 0;
 1245|  34.8k|	--*notecount;
 1246|       |
 1247|  34.8k|	if (xnh_sizeof + offset > size) {
  ------------------
  |  |  211|  34.8k|#define xnh_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  34.8k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (211:21): [True: 28.6k, False: 6.19k]
  |  |  ------------------
  |  |  212|  34.8k|			 ? sizeof(nh32)				\
  |  |  213|  34.8k|			 : sizeof(nh64))
  ------------------
  |  Branch (1247:6): [True: 2.02k, False: 32.7k]
  ------------------
 1248|       |		/*
 1249|       |		 * We're out of note headers.
 1250|       |		 */
 1251|  2.02k|		return xnh_sizeof + offset;
  ------------------
  |  |  211|  2.02k|#define xnh_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  2.02k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (211:21): [True: 1.50k, False: 521]
  |  |  ------------------
  |  |  212|  2.02k|			 ? sizeof(nh32)				\
  |  |  213|  2.02k|			 : sizeof(nh64))
  ------------------
 1252|  2.02k|	}
 1253|       |	/*XXX: GCC */
 1254|  32.7k|	memset(&nh32, 0, sizeof(nh32));
 1255|  32.7k|	memset(&nh64, 0, sizeof(nh64));
 1256|       |
 1257|  32.7k|	memcpy(xnh_addr, &nbuf[offset], xnh_sizeof);
  ------------------
  |  |  208|  32.7k|#define xnh_addr	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  32.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (208:19): [True: 27.1k, False: 5.67k]
  |  |  ------------------
  |  |  209|  32.7k|			 ? CAST(void *, &nh32)			\
  |  |  ------------------
  |  |  |  |  460|  27.1k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  210|  32.7k|			 : CAST(void *, &nh64))
  |  |  ------------------
  |  |  |  |  460|  5.67k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	memcpy(xnh_addr, &nbuf[offset], xnh_sizeof);
  ------------------
  |  |  211|  32.7k|#define xnh_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  32.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (211:21): [True: 27.1k, False: 5.67k]
  |  |  ------------------
  |  |  212|  32.7k|			 ? sizeof(nh32)				\
  |  |  213|  32.7k|			 : sizeof(nh64))
  ------------------
 1258|  32.7k|	offset += xnh_sizeof;
  ------------------
  |  |  211|  32.7k|#define xnh_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  32.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (211:21): [True: 27.1k, False: 5.67k]
  |  |  ------------------
  |  |  212|  32.7k|			 ? sizeof(nh32)				\
  |  |  213|  32.7k|			 : sizeof(nh64))
  ------------------
 1259|       |
 1260|  32.7k|	namesz = xnh_namesz;
  ------------------
  |  |  217|  32.7k|#define xnh_namesz	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  32.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (217:21): [True: 27.1k, False: 5.67k]
  |  |  ------------------
  |  |  218|  32.7k|			 ? elf_getu32(swap, nh32.n_namesz)	\
  |  |  ------------------
  |  |  |  |  158|  27.1k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  219|  32.7k|			 : elf_getu32(swap, nh64.n_namesz))
  |  |  ------------------
  |  |  |  |  158|  5.67k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
 1261|  32.7k|	descsz = xnh_descsz;
  ------------------
  |  |  220|  32.7k|#define xnh_descsz	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  32.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (220:21): [True: 27.1k, False: 5.67k]
  |  |  ------------------
  |  |  221|  32.7k|			 ? elf_getu32(swap, nh32.n_descsz)	\
  |  |  ------------------
  |  |  |  |  158|  27.1k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  222|  32.7k|			 : elf_getu32(swap, nh64.n_descsz))
  |  |  ------------------
  |  |  |  |  158|  5.67k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
 1262|       |
 1263|  32.7k|	if ((namesz == 0) && (descsz == 0)) {
  ------------------
  |  Branch (1263:6): [True: 4.28k, False: 28.5k]
  |  Branch (1263:23): [True: 278, False: 4.00k]
  ------------------
 1264|       |		/*
 1265|       |		 * We're out of note headers.
 1266|       |		 */
 1267|    278|		return (offset >= size) ? offset : size;
  ------------------
  |  Branch (1267:10): [True: 35, False: 243]
  ------------------
 1268|    278|	}
 1269|       |
 1270|  32.5k|	if (namesz & 0x80000000) {
  ------------------
  |  Branch (1270:6): [True: 546, False: 31.9k]
  ------------------
 1271|    546|	    (void)elf_printf(ms, ", bad note name size %#lx",
 1272|    546|		CAST(unsigned long, namesz));
  ------------------
  |  |  460|    546|#define CAST(T, b)	((T)(b))
  ------------------
 1273|    546|	    return 0;
 1274|    546|	}
 1275|       |
 1276|  31.9k|	if (descsz & 0x80000000) {
  ------------------
  |  Branch (1276:6): [True: 1.22k, False: 30.7k]
  ------------------
 1277|  1.22k|		(void)elf_printf(ms, ", bad note description size %#lx",
 1278|  1.22k|		    CAST(unsigned long, descsz));
  ------------------
  |  |  460|  1.22k|#define CAST(T, b)	((T)(b))
  ------------------
 1279|  1.22k|		return 0;
 1280|  1.22k|	}
 1281|       |
 1282|  30.7k|	noff = offset;
 1283|  30.7k|	doff = ELF_ALIGN(offset + namesz);
  ------------------
  |  |   56|  30.7k|#define	ELF_ALIGN(a)	((((a) + align - 1) / align) * align)
  ------------------
 1284|       |
 1285|  30.7k|	if (offset + namesz > size) {
  ------------------
  |  Branch (1285:6): [True: 2.62k, False: 28.1k]
  ------------------
 1286|       |		/*
 1287|       |		 * We're past the end of the buffer.
 1288|       |		 */
 1289|  2.62k|		return doff;
 1290|  2.62k|	}
 1291|       |
 1292|  28.1k|	offset = ELF_ALIGN(doff + descsz);
  ------------------
  |  |   56|  28.1k|#define	ELF_ALIGN(a)	((((a) + align - 1) / align) * align)
  ------------------
 1293|  28.1k|	if (doff + descsz > size) {
  ------------------
  |  Branch (1293:6): [True: 1.57k, False: 26.5k]
  ------------------
 1294|       |		/*
 1295|       |		 * We're past the end of the buffer.
 1296|       |		 */
 1297|  1.57k|		return (offset >= size) ? offset : size;
  ------------------
  |  Branch (1297:10): [True: 1.07k, False: 501]
  ------------------
 1298|  1.57k|	}
 1299|       |
 1300|       |
 1301|  26.5k|	if ((*flags & FLAGS_DID_OS_NOTE) == 0) {
  ------------------
  |  |  352|  26.5k|#define FLAGS_DID_OS_NOTE		0x0008
  ------------------
  |  Branch (1301:6): [True: 25.8k, False: 724]
  ------------------
 1302|  25.8k|		if (do_os_note(ms, nbuf, xnh_type, swap,
  ------------------
  |  |  214|  25.8k|#define xnh_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  25.8k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (214:19): [True: 22.2k, False: 3.54k]
  |  |  ------------------
  |  |  215|  25.8k|			 ? elf_getu32(swap, nh32.n_type)	\
  |  |  ------------------
  |  |  |  |  158|  22.2k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  216|  25.8k|			 : elf_getu32(swap, nh64.n_type))
  |  |  ------------------
  |  |  |  |  158|  3.54k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
  |  Branch (1302:7): [True: 164, False: 25.6k]
  ------------------
 1303|  25.8k|		    namesz, descsz, noff, doff, flags))
 1304|    164|			return offset;
 1305|  25.8k|	}
 1306|       |
 1307|  26.3k|	if ((*flags & FLAGS_DID_BUILD_ID) == 0) {
  ------------------
  |  |  353|  26.3k|#define FLAGS_DID_BUILD_ID		0x0010
  ------------------
  |  Branch (1307:6): [True: 26.0k, False: 275]
  ------------------
 1308|  26.0k|		if (do_bid_note(ms, nbuf, xnh_type, swap,
  ------------------
  |  |  214|  26.0k|#define xnh_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  26.0k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (214:19): [True: 22.5k, False: 3.53k]
  |  |  ------------------
  |  |  215|  26.0k|			 ? elf_getu32(swap, nh32.n_type)	\
  |  |  ------------------
  |  |  |  |  158|  22.5k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  216|  26.0k|			 : elf_getu32(swap, nh64.n_type))
  |  |  ------------------
  |  |  |  |  158|  3.53k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
  |  Branch (1308:7): [True: 1.24k, False: 24.8k]
  ------------------
 1309|  26.0k|		    namesz, descsz, noff, doff, flags))
 1310|  1.24k|			return offset;
 1311|  26.0k|	}
 1312|       |
 1313|  25.1k|	if ((*flags & FLAGS_DID_NETBSD_PAX) == 0) {
  ------------------
  |  |  355|  25.1k|#define FLAGS_DID_NETBSD_PAX		0x0040
  ------------------
  |  Branch (1313:6): [True: 24.9k, False: 206]
  ------------------
 1314|  24.9k|		if (do_pax_note(ms, nbuf, xnh_type, swap,
  ------------------
  |  |  214|  24.9k|#define xnh_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  24.9k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (214:19): [True: 21.3k, False: 3.53k]
  |  |  ------------------
  |  |  215|  24.9k|			 ? elf_getu32(swap, nh32.n_type)	\
  |  |  ------------------
  |  |  |  |  158|  21.3k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  216|  24.9k|			 : elf_getu32(swap, nh64.n_type))
  |  |  ------------------
  |  |  |  |  158|  3.53k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
  |  Branch (1314:7): [True: 38, False: 24.8k]
  ------------------
 1315|  24.9k|		    namesz, descsz, noff, doff, flags))
 1316|     38|			return offset;
 1317|  24.9k|	}
 1318|  25.0k|	if ((*flags & FLAGS_DID_ANDROID_MEMTAG) == 0) {
  ------------------
  |  |  360|  25.0k|#define FLAGS_DID_ANDROID_MEMTAG	0x0800
  ------------------
  |  Branch (1318:6): [True: 24.7k, False: 370]
  ------------------
 1319|  24.7k|		if (do_memtag_note(ms, nbuf, xnh_type, swap,
  ------------------
  |  |  214|  24.7k|#define xnh_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  24.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (214:19): [True: 21.1k, False: 3.53k]
  |  |  ------------------
  |  |  215|  24.7k|			 ? elf_getu32(swap, nh32.n_type)	\
  |  |  ------------------
  |  |  |  |  158|  21.1k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  216|  24.7k|			 : elf_getu32(swap, nh64.n_type))
  |  |  ------------------
  |  |  |  |  158|  3.53k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
  |  Branch (1319:7): [True: 31, False: 24.6k]
  ------------------
 1320|  24.7k|		    namesz, descsz, noff, doff, flags))
 1321|     31|			return offset;
 1322|  24.7k|	}
 1323|       |
 1324|  25.0k|	if ((*flags & FLAGS_DID_CORE) == 0) {
  ------------------
  |  |  351|  25.0k|#define FLAGS_DID_CORE			0x0004
  ------------------
  |  Branch (1324:6): [True: 24.1k, False: 857]
  ------------------
 1325|  24.1k|		if (do_core_note(ms, nbuf, xnh_type, swap,
  ------------------
  |  |  214|  24.1k|#define xnh_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  24.1k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (214:19): [True: 20.6k, False: 3.53k]
  |  |  ------------------
  |  |  215|  24.1k|			 ? elf_getu32(swap, nh32.n_type)	\
  |  |  ------------------
  |  |  |  |  158|  20.6k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  216|  24.1k|			 : elf_getu32(swap, nh64.n_type))
  |  |  ------------------
  |  |  |  |  158|  3.53k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
  |  Branch (1325:7): [True: 100, False: 24.0k]
  ------------------
 1326|  24.1k|		    namesz, descsz, noff, doff, flags, size, clazz))
 1327|    100|			return offset;
 1328|  24.1k|	}
 1329|       |
 1330|  24.9k|	if ((*flags & FLAGS_DID_AUXV) == 0) {
  ------------------
  |  |  362|  24.9k|#define FLAGS_DID_AUXV			0x2000
  ------------------
  |  Branch (1330:6): [True: 23.7k, False: 1.17k]
  ------------------
 1331|  23.7k|		if (do_auxv_note(ms, nbuf, xnh_type, swap,
  ------------------
  |  |  214|  23.7k|#define xnh_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  23.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (214:19): [True: 20.2k, False: 3.52k]
  |  |  ------------------
  |  |  215|  23.7k|			 ? elf_getu32(swap, nh32.n_type)	\
  |  |  ------------------
  |  |  |  |  158|  20.2k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  216|  23.7k|			 : elf_getu32(swap, nh64.n_type))
  |  |  ------------------
  |  |  |  |  158|  3.52k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
  |  Branch (1331:7): [True: 731, False: 23.0k]
  ------------------
 1332|  23.7k|			namesz, descsz, noff, doff, flags, size, clazz,
 1333|  23.7k|			fd, ph_off, ph_num, fsize))
 1334|    731|			return offset;
 1335|  23.7k|	}
 1336|       |
 1337|  24.2k|	if (NAMEEQUALS(RCAST(char *, &nbuf[noff]), "NetBSD")) {
  ------------------
  |  |   67|  24.2k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 2.41k, False: 21.8k]
  |  |  |  Branch (67:29): [True: 1.26k, False: 1.14k]
  |  |  ------------------
  ------------------
 1338|  1.26k|		int descw, flag;
 1339|  1.26k|		const char *str, *tag;
 1340|  1.26k|		if (descsz > 100)
  ------------------
  |  Branch (1340:7): [True: 123, False: 1.14k]
  ------------------
 1341|    123|			descsz = 100;
 1342|  1.26k|		switch (xnh_type) {
  ------------------
  |  |  214|  1.26k|#define xnh_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  1.26k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (214:19): [True: 1.09k, False: 173]
  |  |  ------------------
  |  |  215|  1.26k|			 ? elf_getu32(swap, nh32.n_type)	\
  |  |  ------------------
  |  |  |  |  158|  1.09k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  216|  1.26k|			 : elf_getu32(swap, nh64.n_type))
  |  |  ------------------
  |  |  |  |  158|    173|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
 1343|    253|	    	case NT_NETBSD_VERSION:
  ------------------
  |  |  285|    253|#define	NT_NETBSD_VERSION	1
  ------------------
  |  Branch (1343:7): [True: 253, False: 1.01k]
  ------------------
 1344|    253|			return offset;
 1345|    211|		case NT_NETBSD_MARCH:
  ------------------
  |  |  346|    211|#define NT_NETBSD_MARCH		5
  ------------------
  |  Branch (1345:3): [True: 211, False: 1.05k]
  ------------------
 1346|    211|			flag = FLAGS_DID_NETBSD_MARCH;
  ------------------
  |  |  356|    211|#define FLAGS_DID_NETBSD_MARCH		0x0080
  ------------------
 1347|    211|			tag = "compiled for";
 1348|    211|			break;
 1349|    211|		case NT_NETBSD_CMODEL:
  ------------------
  |  |  356|    211|#define NT_NETBSD_CMODEL	6
  ------------------
  |  Branch (1349:3): [True: 211, False: 1.05k]
  ------------------
 1350|    211|			flag = FLAGS_DID_NETBSD_CMODEL;
  ------------------
  |  |  357|    211|#define FLAGS_DID_NETBSD_CMODEL		0x0100
  ------------------
 1351|    211|			tag = "compiler model";
 1352|    211|			break;
 1353|    204|		case NT_NETBSD_EMULATION:
  ------------------
  |  |  286|    204|#define	NT_NETBSD_EMULATION	2
  ------------------
  |  Branch (1353:3): [True: 204, False: 1.06k]
  ------------------
 1354|    204|			flag = FLAGS_DID_NETBSD_EMULATION;
  ------------------
  |  |  358|    204|#define FLAGS_DID_NETBSD_EMULATION	0x0200
  ------------------
 1355|    204|			tag = "emulation:";
 1356|    204|			break;
 1357|    389|		default:
  ------------------
  |  Branch (1357:3): [True: 389, False: 879]
  ------------------
 1358|    389|			if (*flags & FLAGS_DID_NETBSD_UNKNOWN)
  ------------------
  |  |  359|    389|#define FLAGS_DID_NETBSD_UNKNOWN	0x0400
  ------------------
  |  Branch (1358:8): [True: 305, False: 84]
  ------------------
 1359|    305|				return offset;
 1360|     84|			*flags |= FLAGS_DID_NETBSD_UNKNOWN;
  ------------------
  |  |  359|     84|#define FLAGS_DID_NETBSD_UNKNOWN	0x0400
  ------------------
 1361|     84|			if (elf_printf(ms, ", note=%u", xnh_type) == -1)
  ------------------
  |  |  214|     84|#define xnh_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|     84|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (214:19): [True: 67, False: 17]
  |  |  ------------------
  |  |  215|     84|			 ? elf_getu32(swap, nh32.n_type)	\
  |  |  ------------------
  |  |  |  |  158|     67|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  216|     84|			 : elf_getu32(swap, nh64.n_type))
  |  |  ------------------
  |  |  |  |  158|     17|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
  |  Branch (1361:8): [True: 0, False: 84]
  ------------------
 1362|      0|				return offset;
 1363|     84|			return offset;
 1364|  1.26k|		}
 1365|       |
 1366|    626|		if (*flags & flag)
  ------------------
  |  Branch (1366:7): [True: 588, False: 38]
  ------------------
 1367|    588|			return offset;
 1368|     38|		str = RCAST(const char *, &nbuf[doff]);
  ------------------
  |  |  461|     38|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1369|     38|		descw = CAST(int, descsz);
  ------------------
  |  |  460|     38|#define CAST(T, b)	((T)(b))
  ------------------
 1370|     38|		*flags |= flag;
 1371|     38|		elf_printf(ms, ", %s: %s", tag,
 1372|     38|		    file_copystr(buf, sizeof(buf), descw, str));
 1373|     38|		return offset;
 1374|    626|	}
 1375|       |
 1376|  22.9k|	return offset;
 1377|  24.2k|}
readelf.c:do_os_note:
  615|  25.8k|{
  616|  25.8k|	const char *name = RCAST(const char *, &nbuf[noff]);
  ------------------
  |  |  461|  25.8k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  617|       |
  618|  25.8k|	if (NAMEEQUALS(name, "SuSE") && type == NT_GNU_VERSION && descsz == 2) {
  ------------------
  |  |   67|  51.6k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 1.01k, False: 24.7k]
  |  |  |  Branch (67:29): [True: 553, False: 462]
  |  |  ------------------
  ------------------
              	if (NAMEEQUALS(name, "SuSE") && type == NT_GNU_VERSION && descsz == 2) {
  ------------------
  |  |  297|  26.3k|#define	NT_GNU_VERSION		1
  ------------------
  |  Branch (618:34): [True: 316, False: 237]
  |  Branch (618:60): [True: 2, False: 314]
  ------------------
  619|      2|		*flags |= FLAGS_DID_OS_NOTE;
  ------------------
  |  |  352|      2|#define FLAGS_DID_OS_NOTE		0x0008
  ------------------
  620|      2|		if (elf_printf(ms, ", for SuSE %d.%d", nbuf[doff],
  ------------------
  |  Branch (620:7): [True: 0, False: 2]
  ------------------
  621|      2|		    nbuf[doff + 1]) == -1)
  622|      0|		    return -1;
  623|      2|	    return 1;
  624|      2|	}
  625|       |
  626|  25.8k|	if (NAMEEQUALS(name, "GNU") && type == NT_GNU_VERSION && descsz == 16) {
  ------------------
  |  |   67|  51.6k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 14.8k, False: 10.9k]
  |  |  |  Branch (67:29): [True: 1.49k, False: 13.3k]
  |  |  ------------------
  ------------------
              	if (NAMEEQUALS(name, "GNU") && type == NT_GNU_VERSION && descsz == 16) {
  ------------------
  |  |  297|  27.3k|#define	NT_GNU_VERSION		1
  ------------------
  |  Branch (626:33): [True: 346, False: 1.14k]
  |  Branch (626:59): [True: 16, False: 330]
  ------------------
  627|     16|		uint32_t desc[4];
  628|     16|		memcpy(desc, &nbuf[doff], sizeof(desc));
  629|       |
  630|     16|		*flags |= FLAGS_DID_OS_NOTE;
  ------------------
  |  |  352|     16|#define FLAGS_DID_OS_NOTE		0x0008
  ------------------
  631|     16|		if (elf_printf(ms, ", for GNU/") == -1)
  ------------------
  |  Branch (631:7): [True: 0, False: 16]
  ------------------
  632|      0|			return -1;
  633|     16|		switch (elf_getu32(swap, desc[0])) {
  ------------------
  |  |  158|     16|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  634|      1|		case GNU_OS_LINUX:
  ------------------
  |  |  300|      1|#define	GNU_OS_LINUX	0
  ------------------
  |  Branch (634:3): [True: 1, False: 15]
  ------------------
  635|      1|			if (elf_printf(ms, "Linux") == -1)
  ------------------
  |  Branch (635:8): [True: 0, False: 1]
  ------------------
  636|      0|				return -1;
  637|      1|			break;
  638|      1|		case GNU_OS_HURD:
  ------------------
  |  |  301|      1|#define	GNU_OS_HURD	1
  ------------------
  |  Branch (638:3): [True: 1, False: 15]
  ------------------
  639|      1|			if (elf_printf(ms, "Hurd") == -1)
  ------------------
  |  Branch (639:8): [True: 0, False: 1]
  ------------------
  640|      0|				return -1;
  641|      1|			break;
  642|      1|		case GNU_OS_SOLARIS:
  ------------------
  |  |  302|      1|#define	GNU_OS_SOLARIS	2
  ------------------
  |  Branch (642:3): [True: 1, False: 15]
  ------------------
  643|      1|			if (elf_printf(ms, "Solaris") == -1)
  ------------------
  |  Branch (643:8): [True: 0, False: 1]
  ------------------
  644|      0|				return -1;
  645|      1|			break;
  646|      1|		case GNU_OS_KFREEBSD:
  ------------------
  |  |  303|      1|#define	GNU_OS_KFREEBSD	3
  ------------------
  |  Branch (646:3): [True: 1, False: 15]
  ------------------
  647|      1|			if (elf_printf(ms, "kFreeBSD") == -1)
  ------------------
  |  Branch (647:8): [True: 0, False: 1]
  ------------------
  648|      0|				return -1;
  649|      1|			break;
  650|      1|		case GNU_OS_KNETBSD:
  ------------------
  |  |  304|      1|#define	GNU_OS_KNETBSD	4
  ------------------
  |  Branch (650:3): [True: 1, False: 15]
  ------------------
  651|      1|			if (elf_printf(ms, "kNetBSD") == -1)
  ------------------
  |  Branch (651:8): [True: 0, False: 1]
  ------------------
  652|      0|				return -1;
  653|      1|			break;
  654|     11|		default:
  ------------------
  |  Branch (654:3): [True: 11, False: 5]
  ------------------
  655|     11|			if (elf_printf(ms, "<unknown>") == -1)
  ------------------
  |  Branch (655:8): [True: 0, False: 11]
  ------------------
  656|      0|				return -1;
  657|     16|		}
  658|     16|		if (elf_printf(ms, " %d.%d.%d", elf_getu32(swap, desc[1]),
  ------------------
  |  |  158|     16|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  |  Branch (658:7): [True: 0, False: 16]
  ------------------
  659|     16|		    elf_getu32(swap, desc[2]), elf_getu32(swap, desc[3])) == -1)
  ------------------
  |  |  158|     16|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
              		    elf_getu32(swap, desc[2]), elf_getu32(swap, desc[3])) == -1)
  ------------------
  |  |  158|     16|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  660|      0|			return -1;
  661|     16|		return 1;
  662|     16|	}
  663|       |
  664|  25.7k|	if (NAMEEQUALS(name, "NetBSD") &&
  ------------------
  |  |   67|  51.5k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 2.48k, False: 23.3k]
  |  |  |  Branch (67:29): [True: 1.34k, False: 1.14k]
  |  |  ------------------
  ------------------
  665|  1.34k|	    type == NT_NETBSD_VERSION && descsz == 4) {
  ------------------
  |  |  285|  27.1k|#define	NT_NETBSD_VERSION	1
  ------------------
  |  Branch (665:6): [True: 327, False: 1.01k]
  |  Branch (665:35): [True: 74, False: 253]
  ------------------
  666|     74|		*flags |= FLAGS_DID_OS_NOTE;
  ------------------
  |  |  352|     74|#define FLAGS_DID_OS_NOTE		0x0008
  ------------------
  667|     74|		if (do_note_netbsd_version(ms, swap, &nbuf[doff]) == -1)
  ------------------
  |  Branch (667:7): [True: 0, False: 74]
  ------------------
  668|      0|			return -1;
  669|     74|		return 1;
  670|     74|	}
  671|       |
  672|  25.7k|	if (NAMEEQUALS(name, "FreeBSD") &&
  ------------------
  |  |   67|  51.4k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 1.37k, False: 24.3k]
  |  |  |  Branch (67:29): [True: 522, False: 857]
  |  |  ------------------
  ------------------
  673|    522|	    type == NT_FREEBSD_VERSION && descsz == 4) {
  ------------------
  |  |  287|  26.2k|#define	NT_FREEBSD_VERSION	1
  ------------------
  |  Branch (673:6): [True: 292, False: 230]
  |  Branch (673:36): [True: 69, False: 223]
  ------------------
  674|     69|		*flags |= FLAGS_DID_OS_NOTE;
  ------------------
  |  |  352|     69|#define FLAGS_DID_OS_NOTE		0x0008
  ------------------
  675|     69|		if (do_note_freebsd_version(ms, swap, &nbuf[doff])
  ------------------
  |  Branch (675:7): [True: 0, False: 69]
  ------------------
  676|     69|		    == -1)
  677|      0|			return -1;
  678|     69|		return 1;
  679|     69|	}
  680|       |
  681|  25.6k|	if (NAMEEQUALS(name, "OpenBSD") &&
  ------------------
  |  |   67|  51.2k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 1.31k, False: 24.3k]
  |  |  |  Branch (67:29): [True: 346, False: 964]
  |  |  ------------------
  ------------------
  682|    346|	    type == NT_OPENBSD_VERSION && descsz == 4) {
  ------------------
  |  |  288|  25.9k|#define	NT_OPENBSD_VERSION	1
  ------------------
  |  Branch (682:6): [True: 72, False: 274]
  |  Branch (682:36): [True: 1, False: 71]
  ------------------
  683|      1|		*flags |= FLAGS_DID_OS_NOTE;
  ------------------
  |  |  352|      1|#define FLAGS_DID_OS_NOTE		0x0008
  ------------------
  684|      1|		if (elf_printf(ms, ", for OpenBSD") == -1)
  ------------------
  |  Branch (684:7): [True: 0, False: 1]
  ------------------
  685|      0|			return -1;
  686|       |		/* Content of note is always 0 */
  687|      1|		return 1;
  688|      1|	}
  689|       |
  690|  25.6k|	if (NAMEEQUALS(name, "DragonFly") &&
  ------------------
  |  |   67|  51.2k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 694, False: 24.9k]
  |  |  |  Branch (67:29): [True: 433, False: 261]
  |  |  ------------------
  ------------------
  691|    433|	    type == NT_DRAGONFLY_VERSION && descsz == 4) {
  ------------------
  |  |  289|  26.0k|#define	NT_DRAGONFLY_VERSION	1
  ------------------
  |  Branch (691:6): [True: 200, False: 233]
  |  Branch (691:38): [True: 2, False: 198]
  ------------------
  692|      2|		uint32_t desc;
  693|      2|		*flags |= FLAGS_DID_OS_NOTE;
  ------------------
  |  |  352|      2|#define FLAGS_DID_OS_NOTE		0x0008
  ------------------
  694|      2|		if (elf_printf(ms, ", for DragonFly") == -1)
  ------------------
  |  Branch (694:7): [True: 0, False: 2]
  ------------------
  695|      0|			return -1;
  696|      2|		memcpy(&desc, &nbuf[doff], sizeof(desc));
  697|      2|		desc = elf_getu32(swap, desc);
  ------------------
  |  |  158|      2|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  698|       |		/* __DragonFly_version: major * 100000 + minor * 100 + rev. */
  699|      2|		if (file_printf(ms, " %d.%d.%d", desc / 100000,
  ------------------
  |  Branch (699:7): [True: 0, False: 2]
  ------------------
  700|      2|		    (desc / 100) % 100, desc % 100) == -1)
  701|      0|			return -1;
  702|      2|		return 1;
  703|      2|	}
  704|       |
  705|  25.6k|	if (NAMEEQUALS(name, "Android") &&
  ------------------
  |  |   67|  51.2k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 1.30k, False: 24.3k]
  |  |  |  Branch (67:29): [True: 392, False: 917]
  |  |  ------------------
  ------------------
  706|    392|	    type == NT_ANDROID_VERSION && descsz >= 4) {
  ------------------
  |  |  377|  26.0k|#define NT_ANDROID_VERSION	1
  ------------------
  |  Branch (706:6): [True: 73, False: 319]
  |  Branch (706:36): [True: 4, False: 69]
  ------------------
  707|      4|		uint32_t api_level;
  708|      4|		*flags |= FLAGS_DID_OS_NOTE;
  ------------------
  |  |  352|      4|#define FLAGS_DID_OS_NOTE		0x0008
  ------------------
  709|      4|		memcpy(&api_level, &nbuf[doff], sizeof(api_level));
  710|      4|		api_level = elf_getu32(swap, api_level);
  ------------------
  |  |  158|      4|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  711|      4|		if (elf_printf(ms, ", for Android %d", api_level) == -1)
  ------------------
  |  Branch (711:7): [True: 0, False: 4]
  ------------------
  712|      0|			return -1;
  713|       |		/*
  714|       |		 * NDK r14 and later also include details of the NDK that
  715|       |		 * built the binary. OS binaries (or binaries built by older
  716|       |		 * NDKs) don't have this. The NDK release and build number
  717|       |		 * are both 64-byte strings.
  718|       |		 */
  719|      4|		if (descsz >= 4 + 64 + 64) {
  ------------------
  |  Branch (719:7): [True: 1, False: 3]
  ------------------
  720|      1|			if (elf_printf(ms, ", built by NDK %.64s (%.64s)",
  ------------------
  |  Branch (720:8): [True: 0, False: 1]
  ------------------
  721|      1|			    &nbuf[doff + 4], &nbuf[doff + 4 + 64]) == -1)
  722|      0|				return -1;
  723|      1|		}
  724|      4|	}
  725|       |
  726|  25.6k|	return 0;
  727|  25.6k|}
readelf.c:do_note_netbsd_version:
  442|     74|{
  443|     74|	uint32_t desc;
  444|     74|	memcpy(&desc, v, sizeof(desc));
  445|     74|	desc = elf_getu32(swap, desc);
  ------------------
  |  |  158|     74|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  446|       |
  447|     74|	if (elf_printf(ms, ", for NetBSD") == -1)
  ------------------
  |  Branch (447:6): [True: 0, False: 74]
  ------------------
  448|      0|		return -1;
  449|       |	/*
  450|       |	 * The version number used to be stuck as 199905, and was thus
  451|       |	 * basically content-free.  Newer versions of NetBSD have fixed
  452|       |	 * this and now use the encoding of __NetBSD_Version__:
  453|       |	 *
  454|       |	 *	MMmmrrpp00
  455|       |	 *
  456|       |	 * M = major version
  457|       |	 * m = minor version
  458|       |	 * r = release ["",A-Z,Z[A-Z] but numeric]
  459|       |	 * p = patchlevel
  460|       |	 */
  461|     74|	if (desc > 100000000U) {
  ------------------
  |  Branch (461:6): [True: 58, False: 16]
  ------------------
  462|     58|		uint32_t ver_patch = (desc / 100) % 100;
  463|     58|		uint32_t ver_rel = (desc / 10000) % 100;
  464|     58|		uint32_t ver_min = (desc / 1000000) % 100;
  465|     58|		uint32_t ver_maj = desc / 100000000;
  466|       |
  467|     58|		if (elf_printf(ms, " %u.%u", ver_maj, ver_min) == -1)
  ------------------
  |  Branch (467:7): [True: 0, False: 58]
  ------------------
  468|      0|			return -1;
  469|     58|		if (ver_maj >= 9) {
  ------------------
  |  Branch (469:7): [True: 22, False: 36]
  ------------------
  470|     22|			ver_patch += 100 * ver_rel;
  471|     22|			ver_rel = 0;
  472|     22|		}
  473|     58|		if (ver_rel == 0 && ver_patch != 0) {
  ------------------
  |  Branch (473:7): [True: 22, False: 36]
  |  Branch (473:23): [True: 21, False: 1]
  ------------------
  474|     21|			if (elf_printf(ms, ".%u", ver_patch) == -1)
  ------------------
  |  Branch (474:8): [True: 0, False: 21]
  ------------------
  475|      0|				return -1;
  476|     37|		} else if (ver_rel != 0) {
  ------------------
  |  Branch (476:14): [True: 36, False: 1]
  ------------------
  477|     94|			while (ver_rel > 26) {
  ------------------
  |  Branch (477:11): [True: 58, False: 36]
  ------------------
  478|     58|				if (elf_printf(ms, "Z") == -1)
  ------------------
  |  Branch (478:9): [True: 0, False: 58]
  ------------------
  479|      0|					return -1;
  480|     58|				ver_rel -= 26;
  481|     58|			}
  482|     36|			if (elf_printf(ms, "%c", 'A' + ver_rel - 1) == -1)
  ------------------
  |  Branch (482:8): [True: 0, False: 36]
  ------------------
  483|      0|				return -1;
  484|     36|		}
  485|     58|	}
  486|     74|	return 0;
  487|     74|}
readelf.c:do_note_freebsd_version:
  491|     69|{
  492|     69|	uint32_t desc;
  493|       |
  494|     69|	memcpy(&desc, v, sizeof(desc));
  495|     69|	desc = elf_getu32(swap, desc);
  ------------------
  |  |  158|     69|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  496|     69|	if (elf_printf(ms, ", for FreeBSD") == -1)
  ------------------
  |  Branch (496:6): [True: 0, False: 69]
  ------------------
  497|      0|		return -1;
  498|       |
  499|       |	/*
  500|       |	 * Contents is __FreeBSD_version, whose relation to OS
  501|       |	 * versions is defined by a huge table in the Porter's
  502|       |	 * Handbook.  This is the general scheme:
  503|       |	 *
  504|       |	 * Releases:
  505|       |	 * 	Mmp000 (before 4.10)
  506|       |	 * 	Mmi0p0 (before 5.0)
  507|       |	 * 	Mmm0p0
  508|       |	 *
  509|       |	 * Development branches:
  510|       |	 * 	Mmpxxx (before 4.6)
  511|       |	 * 	Mmp1xx (before 4.10)
  512|       |	 * 	Mmi1xx (before 5.0)
  513|       |	 * 	M000xx (pre-M.0)
  514|       |	 * 	Mmm1xx
  515|       |	 *
  516|       |	 * M = major version
  517|       |	 * m = minor version
  518|       |	 * i = minor version increment (491000 -> 4.10)
  519|       |	 * p = patchlevel
  520|       |	 * x = revision
  521|       |	 *
  522|       |	 * The first release of FreeBSD to use ELF by default
  523|       |	 * was version 3.0.
  524|       |	 */
  525|     69|	if (desc == 460002) {
  ------------------
  |  Branch (525:6): [True: 1, False: 68]
  ------------------
  526|      1|		if (elf_printf(ms, " 4.6.2") == -1)
  ------------------
  |  Branch (526:7): [True: 0, False: 1]
  ------------------
  527|      0|			return -1;
  528|     68|	} else if (desc < 460100) {
  ------------------
  |  Branch (528:13): [True: 24, False: 44]
  ------------------
  529|     24|		if (elf_printf(ms, " %d.%d", desc / 100000,
  ------------------
  |  Branch (529:7): [True: 0, False: 24]
  ------------------
  530|     24|		    desc / 10000 % 10) == -1)
  531|      0|			return -1;
  532|     24|		if (desc / 1000 % 10 > 0)
  ------------------
  |  Branch (532:7): [True: 16, False: 8]
  ------------------
  533|     16|			if (elf_printf(ms, ".%d", desc / 1000 % 10) == -1)
  ------------------
  |  Branch (533:8): [True: 0, False: 16]
  ------------------
  534|      0|				return -1;
  535|     24|		if ((desc % 1000 > 0) || (desc % 100000 == 0))
  ------------------
  |  Branch (535:7): [True: 22, False: 2]
  |  Branch (535:28): [True: 1, False: 1]
  ------------------
  536|     23|			if (elf_printf(ms, " (%d)", desc) == -1)
  ------------------
  |  Branch (536:8): [True: 0, False: 23]
  ------------------
  537|      0|				return -1;
  538|     44|	} else if (desc < 500000) {
  ------------------
  |  Branch (538:13): [True: 6, False: 38]
  ------------------
  539|      6|		if (elf_printf(ms, " %d.%d", desc / 100000,
  ------------------
  |  Branch (539:7): [True: 0, False: 6]
  ------------------
  540|      6|		    desc / 10000 % 10 + desc / 1000 % 10) == -1)
  541|      0|			return -1;
  542|      6|		if (desc / 100 % 10 > 0) {
  ------------------
  |  Branch (542:7): [True: 4, False: 2]
  ------------------
  543|      4|			if (elf_printf(ms, " (%d)", desc) == -1)
  ------------------
  |  Branch (543:8): [True: 0, False: 4]
  ------------------
  544|      0|				return -1;
  545|      4|		} else if (desc / 10 % 10 > 0) {
  ------------------
  |  Branch (545:14): [True: 1, False: 1]
  ------------------
  546|      1|			if (elf_printf(ms, ".%d", desc / 10 % 10) == -1)
  ------------------
  |  Branch (546:8): [True: 0, False: 1]
  ------------------
  547|      0|				return -1;
  548|      1|		}
  549|     38|	} else {
  550|     38|		if (elf_printf(ms, " %d.%d", desc / 100000,
  ------------------
  |  Branch (550:7): [True: 0, False: 38]
  ------------------
  551|     38|		    desc / 1000 % 100) == -1)
  552|      0|			return -1;
  553|     38|		if ((desc / 100 % 10 > 0) ||
  ------------------
  |  Branch (553:7): [True: 22, False: 16]
  ------------------
  554|     24|		    (desc % 100000 / 100 == 0)) {
  ------------------
  |  Branch (554:7): [True: 2, False: 14]
  ------------------
  555|     24|			if (elf_printf(ms, " (%d)", desc) == -1)
  ------------------
  |  Branch (555:8): [True: 0, False: 24]
  ------------------
  556|      0|				return -1;
  557|     24|		} else if (desc / 10 % 10 > 0) {
  ------------------
  |  Branch (557:14): [True: 12, False: 2]
  ------------------
  558|     12|			if (elf_printf(ms, ".%d", desc / 10 % 10) == -1)
  ------------------
  |  Branch (558:8): [True: 0, False: 12]
  ------------------
  559|      0|				return -1;
  560|     12|		}
  561|     38|	}
  562|     69|	return 0;
  563|     69|}
readelf.c:do_bid_note:
  570|  26.0k|{
  571|  26.0k|	if (NAMEEQUALS(RCAST(char *, &nbuf[noff]), "GNU") &&
  ------------------
  |  |   67|  52.1k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 15.2k, False: 10.8k]
  |  |  |  Branch (67:29): [True: 2.01k, False: 13.2k]
  |  |  ------------------
  ------------------
  572|  2.01k|	    type == NT_GNU_BUILD_ID && (descsz >= 4 && descsz <= 20)) {
  ------------------
  |  |  319|  28.1k|#define	NT_GNU_BUILD_ID		3
  ------------------
  |  Branch (572:6): [True: 809, False: 1.20k]
  |  Branch (572:34): [True: 768, False: 41]
  |  Branch (572:49): [True: 15, False: 753]
  ------------------
  573|     15|		uint8_t desc[20];
  574|     15|		const char *btype;
  575|     15|		uint32_t i;
  576|     15|		*flags |= FLAGS_DID_BUILD_ID;
  ------------------
  |  |  353|     15|#define FLAGS_DID_BUILD_ID		0x0010
  ------------------
  577|     15|		switch (descsz) {
  578|      1|		case 8:
  ------------------
  |  Branch (578:3): [True: 1, False: 14]
  ------------------
  579|      1|		    btype = "xxHash";
  580|      1|		    break;
  581|      9|		case 16:
  ------------------
  |  Branch (581:3): [True: 9, False: 6]
  ------------------
  582|      9|		    btype = "md5/uuid";
  583|      9|		    break;
  584|      1|		case 20:
  ------------------
  |  Branch (584:3): [True: 1, False: 14]
  ------------------
  585|      1|		    btype = "sha1";
  586|      1|		    break;
  587|      4|		default:
  ------------------
  |  Branch (587:3): [True: 4, False: 11]
  ------------------
  588|      4|		    btype = "unknown";
  589|      4|		    break;
  590|     15|		}
  591|     15|		if (elf_printf(ms, ", BuildID[%s]=", btype) == -1)
  ------------------
  |  Branch (591:7): [True: 0, False: 15]
  ------------------
  592|      0|			return -1;
  593|     15|		memcpy(desc, &nbuf[doff], descsz);
  594|    223|		for (i = 0; i < descsz; i++)
  ------------------
  |  Branch (594:15): [True: 208, False: 15]
  ------------------
  595|    208|		    if (elf_printf(ms, "%02x", desc[i]) == -1)
  ------------------
  |  Branch (595:11): [True: 0, False: 208]
  ------------------
  596|      0|			return -1;
  597|     15|		return 1;
  598|     15|	}
  599|  26.0k|	if (namesz == 4 && memcmp(RCAST(char *, &nbuf[noff]), "Go", 3) == 0 &&
  ------------------
  |  |  461|  15.2k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  |  Branch (599:6): [True: 15.2k, False: 10.8k]
  |  Branch (599:21): [True: 2.03k, False: 13.1k]
  ------------------
  600|  2.03k|	    type == NT_GO_BUILD_ID && descsz < 128) {
  ------------------
  |  |  365|  28.1k|#define NT_GO_BUILD_ID	4
  ------------------
  |  Branch (600:6): [True: 1.54k, False: 494]
  |  Branch (600:32): [True: 1.23k, False: 312]
  ------------------
  601|  1.23k|		char buf[256];
  602|  1.23k|		if (elf_printf(ms, ", Go BuildID=%s",
  ------------------
  |  Branch (602:7): [True: 0, False: 1.23k]
  ------------------
  603|  1.23k|		    file_copystr(buf, sizeof(buf), descsz,
  604|  1.23k|		    RCAST(const char *, &nbuf[doff]))) == -1)
  ------------------
  |  |  461|  1.23k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  605|      0|			return -1;
  606|  1.23k|		return 1;
  607|  1.23k|	}
  608|  24.8k|	return 0;
  609|  26.0k|}
readelf.c:do_pax_note:
  733|  24.9k|{
  734|  24.9k|	const char *name = RCAST(const char *, &nbuf[noff]);
  ------------------
  |  |  461|  24.9k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  735|       |
  736|  24.9k|	if (NAMEEQUALS(name, "PaX") && type == NT_NETBSD_PAX && descsz == 4) {
  ------------------
  |  |   67|  49.8k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 14.0k, False: 10.8k]
  |  |  |  Branch (67:29): [True: 1.14k, False: 12.9k]
  |  |  ------------------
  ------------------
              	if (NAMEEQUALS(name, "PaX") && type == NT_NETBSD_PAX && descsz == 4) {
  ------------------
  |  |  330|  26.0k|#define NT_NETBSD_PAX		3
  ------------------
  |  Branch (736:33): [True: 281, False: 860]
  |  Branch (736:58): [True: 38, False: 243]
  ------------------
  737|     38|		static const char *pax[] = {
  738|     38|		    "+mprotect",
  739|     38|		    "-mprotect",
  740|     38|		    "+segvguard",
  741|     38|		    "-segvguard",
  742|     38|		    "+ASLR",
  743|     38|		    "-ASLR",
  744|     38|		};
  745|     38|		uint32_t desc;
  746|     38|		size_t i;
  747|     38|		int did = 0;
  748|       |
  749|     38|		*flags |= FLAGS_DID_NETBSD_PAX;
  ------------------
  |  |  355|     38|#define FLAGS_DID_NETBSD_PAX		0x0040
  ------------------
  750|     38|		memcpy(&desc, &nbuf[doff], sizeof(desc));
  751|     38|		desc = elf_getu32(swap, desc);
  ------------------
  |  |  158|     38|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  752|       |
  753|     38|		if (desc && elf_printf(ms, ", PaX: ") == -1)
  ------------------
  |  Branch (753:7): [True: 37, False: 1]
  |  Branch (753:15): [True: 0, False: 37]
  ------------------
  754|      0|			return -1;
  755|       |
  756|    266|		for (i = 0; i < __arraycount(pax); i++) {
  ------------------
  |  |  138|    266|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (756:15): [True: 228, False: 38]
  ------------------
  757|    228|			if (((1 << CAST(int, i)) & desc) == 0)
  ------------------
  |  |  460|    228|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (757:8): [True: 126, False: 102]
  ------------------
  758|    126|				continue;
  759|    102|			if (elf_printf(ms, "%s%s", did++ ? "," : "",
  ------------------
  |  Branch (759:8): [True: 0, False: 102]
  |  Branch (759:31): [True: 70, False: 32]
  ------------------
  760|    102|			    pax[i]) == -1)
  761|      0|				return -1;
  762|    102|		}
  763|     38|		return 1;
  764|     38|	}
  765|  24.8k|	return 0;
  766|  24.9k|}
readelf.c:do_memtag_note:
  772|  24.7k|{
  773|  24.7k|	const char *name = RCAST(const char *, &nbuf[noff]);
  ------------------
  |  |  461|  24.7k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  774|       |
  775|  24.7k|	if (NAMEEQUALS(name, "Android") &&
  ------------------
  |  |   67|  49.4k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 1.18k, False: 23.5k]
  |  |  |  Branch (67:29): [True: 277, False: 905]
  |  |  ------------------
  ------------------
  776|    277|	    type == NT_ANDROID_MEMTAG && descsz == 4) {
  ------------------
  |  |  389|  24.9k|#define NT_ANDROID_MEMTAG	4
  ------------------
  |  Branch (776:6): [True: 98, False: 179]
  |  Branch (776:35): [True: 31, False: 67]
  ------------------
  777|     31|		static const char *memtag[] = {
  778|     31|		    "none",
  779|     31|		    "async",
  780|     31|		    "sync",
  781|     31|		    "heap",
  782|     31|		    "stack",
  783|     31|		};
  784|     31|		uint32_t desc;
  785|     31|		size_t i;
  786|     31|		int did = 0;
  787|       |
  788|     31|		*flags |= FLAGS_DID_ANDROID_MEMTAG;
  ------------------
  |  |  360|     31|#define FLAGS_DID_ANDROID_MEMTAG	0x0800
  ------------------
  789|     31|		memcpy(&desc, &nbuf[doff], sizeof(desc));
  790|     31|		desc = elf_getu32(swap, desc);
  ------------------
  |  |  158|     31|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  791|       |
  792|     31|		if (desc && elf_printf(ms, ", Android Memtag: ") == -1)
  ------------------
  |  Branch (792:7): [True: 30, False: 1]
  |  Branch (792:15): [True: 0, False: 30]
  ------------------
  793|      0|			return -1;
  794|       |
  795|    186|		for (i = 0; i < __arraycount(memtag); i++) {
  ------------------
  |  |  138|    186|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (795:15): [True: 155, False: 31]
  ------------------
  796|    155|			if (((1 << CAST(int, i)) & desc) == 0)
  ------------------
  |  |  460|    155|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (796:8): [True: 83, False: 72]
  ------------------
  797|     83|				continue;
  798|     72|			if (elf_printf(ms, "%s%s", did++ ? "," : "",
  ------------------
  |  Branch (798:8): [True: 0, False: 72]
  |  Branch (798:31): [True: 44, False: 28]
  ------------------
  799|     72|			    memtag[i]) == -1)
  800|      0|				return -1;
  801|     72|		}
  802|     31|		return 1;
  803|     31|	}
  804|  24.6k|	return 0;
  805|  24.7k|}
readelf.c:do_core_note:
  811|  24.1k|{
  812|  24.1k|#ifdef ELFCORE
  813|  24.1k|	char buf[256];
  814|  24.1k|	const char *name = RCAST(const char *, &nbuf[noff]);
  ------------------
  |  |  461|  24.1k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  815|       |
  816|  24.1k|	int os_style = -1;
  817|       |	/*
  818|       |	 * Sigh.  The 2.0.36 kernel in Debian 2.1, at
  819|       |	 * least, doesn't correctly implement name
  820|       |	 * sections, in core dumps, as specified by
  821|       |	 * the "Program Linking" section of "UNIX(R) System
  822|       |	 * V Release 4 Programmer's Guide: ANSI C and
  823|       |	 * Programming Support Tools", because my copy
  824|       |	 * clearly says "The first 'namesz' bytes in 'name'
  825|       |	 * contain a *null-terminated* [emphasis mine]
  826|       |	 * character representation of the entry's owner
  827|       |	 * or originator", but the 2.0.36 kernel code
  828|       |	 * doesn't include the terminating null in the
  829|       |	 * name....
  830|       |	 */
  831|  24.1k|	if ((namesz == 4 && memcmp(name, "CORE", 4) == 0) ||
  ------------------
  |  Branch (831:7): [True: 13.5k, False: 10.6k]
  |  Branch (831:22): [True: 1.83k, False: 11.6k]
  ------------------
  832|  22.3k|	    NAMEEQUALS(name, "CORE")) {
  ------------------
  |  |   67|  22.3k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 1.01k, False: 21.3k]
  |  |  |  Branch (67:29): [True: 212, False: 800]
  |  |  ------------------
  ------------------
  833|  2.05k|		os_style = OS_STYLE_SVR4;
  ------------------
  |  |  339|  2.05k|#define	OS_STYLE_SVR4		0
  ------------------
  834|  2.05k|	}
  835|       |
  836|  24.1k|	if (NAMEEQUALS(name, "FreeBSD")) {
  ------------------
  |  |   67|  24.1k|    (namesz == sizeof(v) && memcmp(n, v, namesz) == 0)
  |  |  ------------------
  |  |  |  Branch (67:6): [True: 1.14k, False: 23.0k]
  |  |  |  Branch (67:29): [True: 447, False: 699]
  |  |  ------------------
  ------------------
  837|    447|		os_style = OS_STYLE_FREEBSD;
  ------------------
  |  |  340|    447|#define	OS_STYLE_FREEBSD	1
  ------------------
  838|    447|	}
  839|       |
  840|  24.1k|	if ((namesz >= 11 && memcmp(name, "NetBSD-CORE", 11) == 0)) {
  ------------------
  |  Branch (840:7): [True: 2.13k, False: 22.0k]
  |  Branch (840:23): [True: 213, False: 1.92k]
  ------------------
  841|    213|		os_style = OS_STYLE_NETBSD;
  ------------------
  |  |  341|    213|#define	OS_STYLE_NETBSD		2
  ------------------
  842|    213|	}
  843|       |
  844|  24.1k|	if (os_style != -1 && (*flags & FLAGS_DID_CORE_STYLE) == 0) {
  ------------------
  |  |  354|  2.71k|#define FLAGS_DID_CORE_STYLE		0x0020
  ------------------
  |  Branch (844:6): [True: 2.71k, False: 21.4k]
  |  Branch (844:24): [True: 907, False: 1.80k]
  ------------------
  845|    907|		if (elf_printf(ms, ", %s-style", os_style_names[os_style])
  ------------------
  |  Branch (845:7): [True: 0, False: 907]
  ------------------
  846|    907|		    == -1)
  847|      0|			return -1;
  848|    907|		*flags |= FLAGS_DID_CORE_STYLE;
  ------------------
  |  |  354|    907|#define FLAGS_DID_CORE_STYLE		0x0020
  ------------------
  849|    907|		*flags |= os_style;
  850|    907|	}
  851|       |
  852|  24.1k|	switch (os_style) {
  853|    213|	case OS_STYLE_NETBSD:
  ------------------
  |  |  341|    213|#define	OS_STYLE_NETBSD		2
  ------------------
  |  Branch (853:2): [True: 213, False: 23.9k]
  ------------------
  854|    213|		if (type == NT_NETBSD_CORE_PROCINFO) {
  ------------------
  |  |  232|    213|#define	NT_NETBSD_CORE_PROCINFO		1
  ------------------
  |  Branch (854:7): [True: 5, False: 208]
  ------------------
  855|      5|			char sbuf[512];
  856|      5|			struct NetBSD_elfcore_procinfo pi;
  857|      5|			memset(&pi, 0, sizeof(pi));
  858|      5|			memcpy(&pi, nbuf + doff, MIN(descsz, sizeof(pi)));
  ------------------
  |  Branch (858:29): [True: 4, False: 1]
  ------------------
  859|       |
  860|      5|			if (elf_printf(ms, ", from '%.31s', pid=%u, uid=%u, "
  ------------------
  |  Branch (860:8): [True: 0, False: 5]
  ------------------
  861|      5|			    "gid=%u, nlwps=%u, lwp=%u (signal %u/code %u)",
  862|      5|			    file_printable(ms, sbuf, sizeof(sbuf),
  863|      5|			    RCAST(char *, pi.cpi_name), sizeof(pi.cpi_name)),
  ------------------
  |  |  461|      5|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  864|      5|			    elf_getu32(swap, CAST(uint32_t, pi.cpi_pid)),
  ------------------
  |  |  158|      5|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  865|      5|			    elf_getu32(swap, pi.cpi_euid),
  ------------------
  |  |  158|      5|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  866|      5|			    elf_getu32(swap, pi.cpi_egid),
  ------------------
  |  |  158|      5|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  867|      5|			    elf_getu32(swap, pi.cpi_nlwps),
  ------------------
  |  |  158|      5|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  868|      5|			    elf_getu32(swap, CAST(uint32_t, pi.cpi_siglwp)),
  ------------------
  |  |  158|      5|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  869|      5|			    elf_getu32(swap, pi.cpi_signo),
  ------------------
  |  |  158|      5|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  870|      5|			    elf_getu32(swap, pi.cpi_sigcode)) == -1)
  ------------------
  |  |  158|      5|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  871|      0|				return -1;
  872|       |
  873|      5|			*flags |= FLAGS_DID_CORE;
  ------------------
  |  |  351|      5|#define FLAGS_DID_CORE			0x0004
  ------------------
  874|      5|			return 1;
  875|      5|		}
  876|    208|		break;
  877|       |
  878|    447|	case OS_STYLE_FREEBSD:
  ------------------
  |  |  340|    447|#define	OS_STYLE_FREEBSD	1
  ------------------
  |  Branch (878:2): [True: 447, False: 23.7k]
  ------------------
  879|    447|		if (type == NT_PRPSINFO && *flags & FLAGS_IS_CORE) {
  ------------------
  |  |  277|    894|#define	NT_PRPSINFO	3
  ------------------
              		if (type == NT_PRPSINFO && *flags & FLAGS_IS_CORE) {
  ------------------
  |  |  361|     88|#define FLAGS_IS_CORE			0x1000
  ------------------
  |  Branch (879:7): [True: 88, False: 359]
  |  Branch (879:30): [True: 22, False: 66]
  ------------------
  880|     22|			size_t argoff, pidoff;
  881|       |
  882|     22|			if (clazz == ELFCLASS32)
  ------------------
  |  |  153|     22|#define	ELFCLASS32	1
  ------------------
  |  Branch (882:8): [True: 20, False: 2]
  ------------------
  883|     20|				argoff = 4 + 4 + 17;
  884|      2|			else
  885|      2|				argoff = 4 + 4 + 8 + 17;
  886|     22|			if (doff + argoff + 81 <= size) {
  ------------------
  |  Branch (886:8): [True: 8, False: 14]
  ------------------
  887|      8|				if (elf_printf(ms, ", from '%.80s'",
  ------------------
  |  Branch (887:9): [True: 0, False: 8]
  ------------------
  888|      8|				    nbuf + doff + argoff) == -1)
  889|      0|					return -1;
  890|      8|			}
  891|     22|			pidoff = argoff + 81 + 2;
  892|     22|			if (doff + pidoff + 4 <= size) {
  ------------------
  |  Branch (892:8): [True: 5, False: 17]
  ------------------
  893|      5|				if (elf_printf(ms, ", pid=%u",
  ------------------
  |  Branch (893:9): [True: 0, False: 5]
  ------------------
  894|      5|				    elf_getu32(swap, *RCAST(uint32_t *, (nbuf +
  ------------------
  |  |  158|      5|#define elf_getu32(swap, value) getu32(swap, value)
  ------------------
  895|      5|				    doff + pidoff)))) == -1)
  896|      0|					return -1;
  897|      5|			}
  898|     22|			*flags |= FLAGS_DID_CORE;
  ------------------
  |  |  351|     22|#define FLAGS_DID_CORE			0x0004
  ------------------
  899|     22|		}			    
  900|    447|		break;
  901|       |
  902|  23.5k|	default:
  ------------------
  |  Branch (902:2): [True: 23.5k, False: 660]
  ------------------
  903|  23.5k|		if (type == NT_PRPSINFO && *flags & FLAGS_IS_CORE) {
  ------------------
  |  |  277|  47.0k|#define	NT_PRPSINFO	3
  ------------------
              		if (type == NT_PRPSINFO && *flags & FLAGS_IS_CORE) {
  ------------------
  |  |  361|  2.79k|#define FLAGS_IS_CORE			0x1000
  ------------------
  |  Branch (903:7): [True: 2.79k, False: 20.7k]
  |  Branch (903:30): [True: 2.33k, False: 452]
  ------------------
  904|  2.33k|			size_t i, j;
  905|  2.33k|			unsigned char c;
  906|       |			/*
  907|       |			 * Extract the program name.  We assume
  908|       |			 * it to be 16 characters (that's what it
  909|       |			 * is in SunOS 5.x and Linux).
  910|       |			 *
  911|       |			 * Unfortunately, it's at a different offset
  912|       |			 * in various OSes, so try multiple offsets.
  913|       |			 * If the characters aren't all printable,
  914|       |			 * reject it.
  915|       |			 */
  916|  18.0k|			for (i = 0; i < NOFFSETS; i++) {
  ------------------
  |  |  308|  18.0k|#define NOFFSETS	(clazz == ELFCLASS32 ? NOFFSETS32 : NOFFSETS64)
  |  |  ------------------
  |  |  |  |  153|  18.0k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |               #define NOFFSETS	(clazz == ELFCLASS32 ? NOFFSETS32 : NOFFSETS64)
  |  |  ------------------
  |  |  |  |  305|  16.8k|#define	NOFFSETS32	__arraycount(prpsoffsets32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  16.8k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NOFFSETS	(clazz == ELFCLASS32 ? NOFFSETS32 : NOFFSETS64)
  |  |  ------------------
  |  |  |  |  306|  1.19k|#define NOFFSETS64	__arraycount(prpsoffsets64)
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|  1.19k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (308:19): [True: 16.8k, False: 1.19k]
  |  |  ------------------
  ------------------
  |  Branch (916:16): [True: 15.7k, False: 2.24k]
  ------------------
  917|  15.7k|				unsigned char *cname, *cp;
  918|  15.7k|				size_t reloffset = prpsoffsets(i);
  ------------------
  |  |  263|  15.7k|#define prpsoffsets(i)	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  15.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (263:25): [True: 14.7k, False: 999]
  |  |  ------------------
  |  |  264|  15.7k|			 ? prpsoffsets32[i]			\
  |  |  265|  15.7k|			 : prpsoffsets64[i])
  ------------------
  919|  15.7k|				size_t noffset = doff + reloffset;
  920|  15.7k|				size_t k;
  921|  18.1k|				for (j = 0; j < 16; j++, noffset++,
  ------------------
  |  Branch (921:17): [True: 18.1k, False: 25]
  ------------------
  922|  18.1k|				    reloffset++) {
  923|       |					/*
  924|       |					 * Make sure we're not past
  925|       |					 * the end of the buffer; if
  926|       |					 * we are, just give up.
  927|       |					 */
  928|  18.1k|					if (noffset >= size)
  ------------------
  |  Branch (928:10): [True: 2.83k, False: 15.3k]
  ------------------
  929|  2.83k|						goto tryanother;
  930|       |
  931|       |					/*
  932|       |					 * Make sure we're not past
  933|       |					 * the end of the contents;
  934|       |					 * if we are, this obviously
  935|       |					 * isn't the right offset.
  936|       |					 */
  937|  15.3k|					if (reloffset >= descsz)
  ------------------
  |  Branch (937:10): [True: 9.30k, False: 6.01k]
  ------------------
  938|  9.30k|						goto tryanother;
  939|       |
  940|  6.01k|					c = nbuf[noffset];
  941|  6.01k|					if (c == '\0') {
  ------------------
  |  Branch (941:10): [True: 918, False: 5.09k]
  ------------------
  942|       |						/*
  943|       |						 * A '\0' at the
  944|       |						 * beginning is
  945|       |						 * obviously wrong.
  946|       |						 * Any other '\0'
  947|       |						 * means we're done.
  948|       |						 */
  949|    918|						if (j == 0)
  ------------------
  |  Branch (949:11): [True: 848, False: 70]
  ------------------
  950|    848|							goto tryanother;
  951|     70|						else
  952|     70|							break;
  953|  5.09k|					} else {
  954|       |						/*
  955|       |						 * A nonprintable
  956|       |						 * character is also
  957|       |						 * wrong.
  958|       |						 */
  959|  5.09k|						if (!isprint(c) || isquote(c))
  ------------------
  |  |   58|  3.31k|#define isquote(c) (strchr("'\"`", (c)) != NULL)
  |  |  ------------------
  |  |  |  Branch (58:20): [True: 895, False: 2.41k]
  |  |  ------------------
  ------------------
  |  Branch (959:11): [True: 1.78k, False: 3.31k]
  ------------------
  960|  2.67k|							goto tryanother;
  961|  5.09k|					}
  962|  6.01k|				}
  963|       |				/*
  964|       |				 * Well, that worked.
  965|       |				 */
  966|       |
  967|       |				/*
  968|       |				 * Try next offsets, in case this match is
  969|       |				 * in the middle of a string.
  970|       |				 */
  971|    291|				for (k = i + 1 ; k < NOFFSETS; k++) {
  ------------------
  |  |  308|    291|#define NOFFSETS	(clazz == ELFCLASS32 ? NOFFSETS32 : NOFFSETS64)
  |  |  ------------------
  |  |  |  |  153|    291|#define	ELFCLASS32	1
  |  |  ------------------
  |  |               #define NOFFSETS	(clazz == ELFCLASS32 ? NOFFSETS32 : NOFFSETS64)
  |  |  ------------------
  |  |  |  |  305|    274|#define	NOFFSETS32	__arraycount(prpsoffsets32)
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|    274|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define NOFFSETS	(clazz == ELFCLASS32 ? NOFFSETS32 : NOFFSETS64)
  |  |  ------------------
  |  |  |  |  306|     17|#define NOFFSETS64	__arraycount(prpsoffsets64)
  |  |  |  |  ------------------
  |  |  |  |  |  |  138|     17|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (308:19): [True: 274, False: 17]
  |  |  ------------------
  ------------------
  |  Branch (971:22): [True: 196, False: 95]
  ------------------
  972|    196|					size_t no;
  973|    196|					int adjust = 1;
  974|    196|					if (prpsoffsets(k) >= prpsoffsets(i))
  ------------------
  |  |  263|    196|#define prpsoffsets(i)	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|    196|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (263:25): [True: 185, False: 11]
  |  |  ------------------
  |  |  264|    196|			 ? prpsoffsets32[i]			\
  |  |  265|    196|			 : prpsoffsets64[i])
  ------------------
              					if (prpsoffsets(k) >= prpsoffsets(i))
  ------------------
  |  |  263|    196|#define prpsoffsets(i)	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|    196|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (263:25): [True: 185, False: 11]
  |  |  ------------------
  |  |  264|    196|			 ? prpsoffsets32[i]			\
  |  |  265|    196|			 : prpsoffsets64[i])
  ------------------
  |  Branch (974:10): [True: 67, False: 129]
  ------------------
  975|     67|						continue;
  976|       |					/*
  977|       |					 * pr_fname == pr_psargs - 16 &&
  978|       |					 * non-nul-terminated fname (qemu)
  979|       |					 */
  980|    129|					if (prpsoffsets(k) ==
  ------------------
  |  |  263|    129|#define prpsoffsets(i)	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|    129|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (263:25): [True: 118, False: 11]
  |  |  ------------------
  |  |  264|    129|			 ? prpsoffsets32[i]			\
  |  |  265|    129|			 : prpsoffsets64[i])
  ------------------
  |  Branch (980:10): [True: 28, False: 101]
  ------------------
  981|    129|					    prpsoffsets(i) - 16 && j == 16)
  ------------------
  |  |  263|    129|#define prpsoffsets(i)	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|    129|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (263:25): [True: 118, False: 11]
  |  |  ------------------
  |  |  264|    129|			 ? prpsoffsets32[i]			\
  |  |  265|    129|			 : prpsoffsets64[i])
  ------------------
  |  Branch (981:33): [True: 11, False: 17]
  ------------------
  982|     11|						continue;
  983|    118|					for (no = doff + prpsoffsets(k);
  ------------------
  |  |  263|    118|#define prpsoffsets(i)	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|    118|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (263:25): [True: 107, False: 11]
  |  |  ------------------
  |  |  264|    118|			 ? prpsoffsets32[i]			\
  |  |  265|    118|			 : prpsoffsets64[i])
  ------------------
  984|  4.13k|					     no < doff + prpsoffsets(i); no++)
  ------------------
  |  |  263|  4.13k|#define prpsoffsets(i)	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  4.13k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (263:25): [True: 3.50k, False: 627]
  |  |  ------------------
  |  |  264|  4.13k|			 ? prpsoffsets32[i]			\
  |  |  265|  4.13k|			 : prpsoffsets64[i])
  ------------------
  |  Branch (984:11): [True: 4.01k, False: 118]
  ------------------
  985|  4.01k|						adjust = adjust
  ------------------
  |  Branch (985:16): [True: 1.12k, False: 2.89k]
  ------------------
  986|  4.01k|						         && isprint(nbuf[no]);
  ------------------
  |  Branch (986:19): [True: 1.03k, False: 95]
  ------------------
  987|    118|					if (adjust)
  ------------------
  |  Branch (987:10): [True: 23, False: 95]
  ------------------
  988|     23|						i = k;
  989|    118|				}
  990|       |
  991|     95|				cname = CAST(unsigned char *,
  ------------------
  |  |  460|    190|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 89, False: 6]
  |  |  ------------------
  ------------------
  992|     95|				    &nbuf[doff + prpsoffsets(i)]);
  993|  8.87k|				for (cp = cname; cp < nbuf + size && *cp
  ------------------
  |  Branch (993:22): [True: 8.85k, False: 18]
  |  Branch (993:42): [True: 8.78k, False: 71]
  ------------------
  994|  8.87k|				    && isprint(*cp); cp++)
  ------------------
  |  Branch (994:12): [True: 8.78k, False: 6]
  ------------------
  995|  8.78k|					continue;
  996|       |				/*
  997|       |				 * Linux apparently appends a space at the end
  998|       |				 * of the command line: remove it.
  999|       |				 */
 1000|    368|				while (cp > cname && isspace(cp[-1]))
  ------------------
  |  Branch (1000:12): [True: 359, False: 9]
  |  Branch (1000:26): [True: 273, False: 86]
  ------------------
 1001|    273|					cp--;
 1002|     95|				if (elf_printf(ms, ", from '%s'",
  ------------------
  |  Branch (1002:9): [True: 0, False: 95]
  ------------------
 1003|     95|				    file_copystr(buf, sizeof(buf),
 1004|     95|				    CAST(size_t, cp - cname),
  ------------------
  |  |  460|     95|#define CAST(T, b)	((T)(b))
  ------------------
 1005|     95|				    RCAST(char *, cname))) == -1)
  ------------------
  |  |  461|     95|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1006|      0|					return -1;
 1007|     95|				*flags |= FLAGS_DID_CORE;
  ------------------
  |  |  351|     95|#define FLAGS_DID_CORE			0x0004
  ------------------
 1008|     95|				return 1;
 1009|       |
 1010|  15.6k|			tryanother:
 1011|  15.6k|				;
 1012|  15.6k|			}
 1013|  2.33k|		}
 1014|  23.4k|		break;
 1015|  24.1k|	}
 1016|  24.0k|#endif
 1017|  24.0k|	return 0;
 1018|  24.1k|}
readelf.c:do_auxv_note:
 1095|  23.7k|{
 1096|  23.7k|#ifdef ELFCORE
 1097|  23.7k|	Aux32Info auxv32;
 1098|  23.7k|	Aux64Info auxv64;
 1099|  23.7k|	size_t elsize = xauxv_sizeof;
  ------------------
  |  |  253|  23.7k|#define xauxv_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  23.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (253:23): [True: 20.2k, False: 3.52k]
  |  |  ------------------
  |  |  254|  23.7k|			 ? sizeof(auxv32)			\
  |  |  255|  23.7k|			 : sizeof(auxv64))
  ------------------
 1100|  23.7k|	const char *tag;
 1101|  23.7k|	int is_string;
 1102|  23.7k|	size_t nval, off;
 1103|       |
 1104|  23.7k|	if ((*flags & (FLAGS_IS_CORE|FLAGS_DID_CORE_STYLE)) !=
  ------------------
  |  |  361|  23.7k|#define FLAGS_IS_CORE			0x1000
  ------------------
              	if ((*flags & (FLAGS_IS_CORE|FLAGS_DID_CORE_STYLE)) !=
  ------------------
  |  |  354|  23.7k|#define FLAGS_DID_CORE_STYLE		0x0020
  ------------------
  |  Branch (1104:6): [True: 20.8k, False: 2.91k]
  ------------------
 1105|  23.7k|	    (FLAGS_IS_CORE|FLAGS_DID_CORE_STYLE))
  ------------------
  |  |  361|  23.7k|#define FLAGS_IS_CORE			0x1000
  ------------------
              	    (FLAGS_IS_CORE|FLAGS_DID_CORE_STYLE))
  ------------------
  |  |  354|  23.7k|#define FLAGS_DID_CORE_STYLE		0x0020
  ------------------
 1106|  20.8k|		return 0;
 1107|       |
 1108|  2.91k|	switch (*flags & FLAGS_CORE_STYLE) {
  ------------------
  |  |  349|  2.91k|#define FLAGS_CORE_STYLE		0x0003
  ------------------
 1109|  1.57k|	case OS_STYLE_SVR4:
  ------------------
  |  |  339|  1.57k|#define	OS_STYLE_SVR4		0
  ------------------
  |  Branch (1109:2): [True: 1.57k, False: 1.33k]
  ------------------
 1110|  1.57k|		if (type != NT_AUXV)
  ------------------
  |  |  281|  1.57k|#define	NT_AUXV		6
  ------------------
  |  Branch (1110:7): [True: 840, False: 731]
  ------------------
 1111|    840|			return 0;
 1112|    731|		break;
 1113|       |#ifdef notyet
 1114|       |	case OS_STYLE_NETBSD:
 1115|       |		if (type != NT_NETBSD_CORE_AUXV)
 1116|       |			return 0;
 1117|       |		break;
 1118|       |	case OS_STYLE_FREEBSD:
 1119|       |		if (type != NT_FREEBSD_PROCSTAT_AUXV)
 1120|       |			return 0;
 1121|       |		break;
 1122|       |#endif
 1123|  1.33k|	default:
  ------------------
  |  Branch (1123:2): [True: 1.33k, False: 1.57k]
  ------------------
 1124|  1.33k|		return 0;
 1125|  2.91k|	}
 1126|       |
 1127|    731|	*flags |= FLAGS_DID_AUXV;
  ------------------
  |  |  362|    731|#define FLAGS_DID_AUXV			0x2000
  ------------------
 1128|       |
 1129|    731|	nval = 0;
 1130|  5.62k|	for (off = 0; off + elsize <= descsz; off += elsize) {
  ------------------
  |  Branch (1130:16): [True: 4.90k, False: 721]
  ------------------
 1131|  4.90k|		memcpy(xauxv_addr, &nbuf[doff + off], xauxv_sizeof);
  ------------------
  |  |  250|  4.90k|#define xauxv_addr	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  4.90k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (250:21): [True: 2.76k, False: 2.13k]
  |  |  ------------------
  |  |  251|  4.90k|			 ? CAST(void *, &auxv32)		\
  |  |  ------------------
  |  |  |  |  460|  2.76k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  252|  4.90k|			 : CAST(void *, &auxv64))
  |  |  ------------------
  |  |  |  |  460|  2.13k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              		memcpy(xauxv_addr, &nbuf[doff + off], xauxv_sizeof);
  ------------------
  |  |  253|  4.90k|#define xauxv_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  4.90k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (253:23): [True: 2.76k, False: 2.13k]
  |  |  ------------------
  |  |  254|  4.90k|			 ? sizeof(auxv32)			\
  |  |  255|  4.90k|			 : sizeof(auxv64))
  ------------------
 1132|       |		/* Limit processing to 50 vector entries to prevent DoS */
 1133|  4.90k|		if (nval++ >= 50) {
  ------------------
  |  Branch (1133:7): [True: 10, False: 4.89k]
  ------------------
 1134|     10|			file_error(ms, 0, "Too many ELF Auxv elements");
 1135|     10|			return 1;
 1136|     10|		}
 1137|       |
 1138|  4.89k|		switch(xauxv_type) {
  ------------------
  |  |  256|  4.89k|#define xauxv_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  4.89k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (256:21): [True: 2.76k, False: 2.13k]
  |  |  ------------------
  |  |  257|  4.89k|			 ? elf_getu32(swap, auxv32.a_type)	\
  |  |  ------------------
  |  |  |  |  158|  2.76k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  258|  4.89k|			 : elf_getu64(swap, auxv64.a_type))
  |  |  ------------------
  |  |  |  |  159|  2.13k|#define elf_getu64(swap, value) getu64(swap, value)
  |  |  ------------------
  ------------------
 1139|    649|		case AT_LINUX_EXECFN:
  ------------------
  |  |   90|    649|#define AT_LINUX_EXECFN 31   /* filename of program */
  ------------------
  |  Branch (1139:3): [True: 649, False: 4.24k]
  ------------------
 1140|    649|			is_string = 1;
 1141|    649|			tag = "execfn";
 1142|    649|			break;
 1143|  1.21k|		case AT_LINUX_PLATFORM:
  ------------------
  |  |   81|  1.21k|#define AT_LINUX_PLATFORM 15  /* string identifying CPU for optimizations */
  ------------------
  |  Branch (1143:3): [True: 1.21k, False: 3.67k]
  ------------------
 1144|  1.21k|			is_string = 1;
 1145|  1.21k|			tag = "platform";
 1146|  1.21k|			break;
 1147|     43|		case AT_LINUX_UID:
  ------------------
  |  |   77|     43|#define AT_LINUX_UID    11    /* real uid */
  ------------------
  |  Branch (1147:3): [True: 43, False: 4.85k]
  ------------------
 1148|     43|			is_string = 0;
 1149|     43|			tag = "real uid";
 1150|     43|			break;
 1151|     49|		case AT_LINUX_GID:
  ------------------
  |  |   79|     49|#define AT_LINUX_GID    13    /* real gid */
  ------------------
  |  Branch (1151:3): [True: 49, False: 4.84k]
  ------------------
 1152|     49|			is_string = 0;
 1153|     49|			tag = "real gid";
 1154|     49|			break;
 1155|     69|		case AT_LINUX_EUID:
  ------------------
  |  |   78|     69|#define AT_LINUX_EUID   12    /* effective uid */
  ------------------
  |  Branch (1155:3): [True: 69, False: 4.82k]
  ------------------
 1156|     69|			is_string = 0;
 1157|     69|			tag = "effective uid";
 1158|     69|			break;
 1159|     74|		case AT_LINUX_EGID:
  ------------------
  |  |   80|     74|#define AT_LINUX_EGID   14    /* effective gid */
  ------------------
  |  Branch (1159:3): [True: 74, False: 4.82k]
  ------------------
 1160|     74|			is_string = 0;
 1161|     74|			tag = "effective gid";
 1162|     74|			break;
 1163|  2.79k|		default:
  ------------------
  |  Branch (1163:3): [True: 2.79k, False: 2.10k]
  ------------------
 1164|  2.79k|			is_string = 0;
 1165|  2.79k|			tag = NULL;
 1166|  2.79k|			break;
 1167|  4.89k|		}
 1168|       |
 1169|  4.89k|		if (tag == NULL)
  ------------------
  |  Branch (1169:7): [True: 2.79k, False: 2.10k]
  ------------------
 1170|  2.79k|			continue;
 1171|       |
 1172|  2.10k|		if (is_string) {
  ------------------
  |  Branch (1172:7): [True: 1.86k, False: 235]
  ------------------
 1173|  1.86k|			char buf[256];
 1174|  1.86k|			ssize_t buflen;
 1175|  1.86k|			buflen = get_string_on_virtaddr(ms, swap, clazz, fd,
 1176|  1.86k|			    ph_off, ph_num, fsize, xauxv_val, buf, sizeof(buf));
  ------------------
  |  |  259|  1.86k|#define xauxv_val	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  1.86k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (259:20): [True: 1.09k, False: 769]
  |  |  ------------------
  |  |  260|  1.86k|			 ? elf_getu32(swap, auxv32.a_v)		\
  |  |  ------------------
  |  |  |  |  158|  1.09k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  261|  1.86k|			 : elf_getu64(swap, auxv64.a_v))
  |  |  ------------------
  |  |  |  |  159|    769|#define elf_getu64(swap, value) getu64(swap, value)
  |  |  ------------------
  ------------------
 1177|       |
 1178|  1.86k|			if (buflen == 0)
  ------------------
  |  Branch (1178:8): [True: 1.79k, False: 77]
  ------------------
 1179|  1.79k|				continue;
 1180|       |
 1181|     77|			if (elf_printf(ms, ", %s: '%s'", tag, buf) == -1)
  ------------------
  |  Branch (1181:8): [True: 0, False: 77]
  ------------------
 1182|      0|				return -1;
 1183|    235|		} else {
 1184|    235|			if (elf_printf(ms, ", %s: %d", tag,
  ------------------
  |  Branch (1184:8): [True: 0, False: 235]
  ------------------
 1185|    235|			    CAST(int, xauxv_val)) == -1)
  ------------------
  |  |  460|    470|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 203, False: 32]
  |  |  ------------------
  ------------------
 1186|      0|				return -1;
 1187|    235|		}
 1188|  2.10k|	}
 1189|    721|	return 1;
 1190|       |#else
 1191|       |	return 0;
 1192|       |#endif
 1193|    731|}
readelf.c:get_string_on_virtaddr:
 1058|  1.86k|{
 1059|  1.86k|	char *bptr;
 1060|  1.86k|	off_t offset;
 1061|       |
 1062|  1.86k|	if (buflen == 0)
  ------------------
  |  Branch (1062:6): [True: 0, False: 1.86k]
  ------------------
 1063|      0|		return 0;
 1064|       |
 1065|  1.86k|	offset = get_offset_from_virtaddr(ms, swap, clazz, fd, ph_off, ph_num,
 1066|  1.86k|	    fsize, virtaddr);
 1067|  1.86k|	if (offset < 0 ||
  ------------------
  |  Branch (1067:6): [True: 135, False: 1.73k]
  ------------------
 1068|  1.73k|	    (buflen = pread(fd, buf, CAST(size_t, buflen), offset)) <= 0) {
  ------------------
  |  |  460|  1.73k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1068:6): [True: 563, False: 1.17k]
  ------------------
 1069|    698|		(void)elf_printf(ms, ", can't read elf string at %jd",
 1070|    698|		    (intmax_t)offset);
 1071|    698|		return 0;
 1072|    698|	}
 1073|       |
 1074|  1.17k|	buf[buflen - 1] = '\0';
 1075|       |
 1076|       |	/* We expect only printable characters, so return if buffer contains
 1077|       |	 * non-printable character before the '\0' or just '\0'. */
 1078|  1.52k|	for (bptr = buf; *bptr && isprint(CAST(unsigned char, *bptr)); bptr++)
  ------------------
  |  Branch (1078:19): [True: 1.35k, False: 173]
  |  Branch (1078:28): [True: 358, False: 997]
  ------------------
 1079|    358|		continue;
 1080|  1.17k|	if (*bptr != '\0')
  ------------------
  |  Branch (1080:6): [True: 997, False: 173]
  ------------------
 1081|    997|		return 0;
 1082|       |
 1083|    173|	return bptr - buf;
 1084|  1.17k|}
readelf.c:get_offset_from_virtaddr:
 1023|  1.86k|{
 1024|  1.86k|	Elf32_Phdr ph32;
 1025|  1.86k|	Elf64_Phdr ph64;
 1026|       |
 1027|       |	/*
 1028|       |	 * Loop through all the program headers and find the header with
 1029|       |	 * virtual address in which the "virtaddr" belongs to.
 1030|       |	 */
 1031|  15.8k|	for ( ; num; num--) {
  ------------------
  |  Branch (1031:10): [True: 15.7k, False: 75]
  ------------------
 1032|  15.7k|		if (pread(fd, xph_addr, xph_sizeof, off) <
  ------------------
  |  |  180|  15.7k|#define xph_addr	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  15.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (180:19): [True: 9.12k, False: 6.65k]
  |  |  ------------------
  |  |  181|  15.7k|			 ? CAST(void *, &ph32)			\
  |  |  ------------------
  |  |  |  |  460|  9.12k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  182|  15.7k|			 : CAST(void *, &ph64))
  |  |  ------------------
  |  |  |  |  460|  6.65k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              		if (pread(fd, xph_addr, xph_sizeof, off) <
  ------------------
  |  |  183|  15.7k|#define xph_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  15.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (183:21): [True: 9.12k, False: 6.65k]
  |  |  ------------------
  |  |  184|  15.7k|			 ? sizeof(ph32)				\
  |  |  185|  15.7k|			 : sizeof(ph64))
  ------------------
  |  Branch (1032:7): [True: 876, False: 14.9k]
  ------------------
 1033|  15.7k|		    CAST(ssize_t, xph_sizeof)) {
  ------------------
  |  |  460|  31.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 9.12k, False: 6.65k]
  |  |  ------------------
  ------------------
 1034|    876|			if (elf_printf(ms,
  ------------------
  |  Branch (1034:8): [True: 0, False: 876]
  ------------------
 1035|    876|			    ", can't read elf program header at %jd",
 1036|    876|			    (intmax_t)off) == -1)
 1037|      0|				return -1;
 1038|    876|			return 0;
 1039|       |
 1040|    876|		}
 1041|  14.9k|		off += xph_sizeof;
  ------------------
  |  |  183|  14.9k|#define xph_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  14.9k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (183:21): [True: 8.63k, False: 6.27k]
  |  |  ------------------
  |  |  184|  14.9k|			 ? sizeof(ph32)				\
  |  |  185|  14.9k|			 : sizeof(ph64))
  ------------------
 1042|       |
 1043|  14.9k|		if (fsize != SIZE_UNKNOWN && xph_offset > fsize) {
  ------------------
  |  |   65|  14.9k|#define SIZE_UNKNOWN	CAST(off_t, -1)
  |  |  ------------------
  |  |  |  |  460|  29.8k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              		if (fsize != SIZE_UNKNOWN && xph_offset > fsize) {
  ------------------
  |  |  189|  14.9k|#define xph_offset	CAST(off_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  29.8k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 8.63k, False: 6.27k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  190|  14.9k|			 ? elf_getu32(swap, ph32.p_offset)	\
  |  |  191|  14.9k|			 : elf_getu64(swap, ph64.p_offset)))
  ------------------
  |  Branch (1043:7): [True: 14.9k, False: 0]
  |  Branch (1043:32): [True: 7.96k, False: 6.93k]
  ------------------
 1044|       |			/* Perhaps warn here */
 1045|  7.96k|			continue;
 1046|  7.96k|		}
 1047|       |
 1048|  6.93k|		if (virtaddr >= xph_vaddr && virtaddr < xph_vaddr + xph_filesz)
  ------------------
  |  |  197|  6.93k|#define xph_vaddr	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  27.7k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 2.96k, False: 444]
  |  |  |  |  |  Branch (460:25): [True: 3.08k, False: 438]
  |  |  |  |  |  Branch (460:25): [True: 3.41k, False: 3.52k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  198|  6.93k|			 ? CAST(off_t, (ph32.p_vaddr ? 		\
  |  |  199|  6.93k|			    elf_getu32(swap, ph32.p_vaddr) : 4))\
  |  |  200|  6.93k|			 : CAST(off_t, (ph64.p_vaddr ?		\
  |  |  201|  6.93k|			    elf_getu64(swap, ph64.p_vaddr) : 4))))
  ------------------
              		if (virtaddr >= xph_vaddr && virtaddr < xph_vaddr + xph_filesz)
  ------------------
  |  |  197|  4.58k|#define xph_vaddr	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  18.3k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 1.97k, False: 441]
  |  |  |  |  |  Branch (460:25): [True: 1.73k, False: 435]
  |  |  |  |  |  Branch (460:25): [True: 2.41k, False: 2.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  198|  4.58k|			 ? CAST(off_t, (ph32.p_vaddr ? 		\
  |  |  199|  4.58k|			    elf_getu32(swap, ph32.p_vaddr) : 4))\
  |  |  200|  4.58k|			 : CAST(off_t, (ph64.p_vaddr ?		\
  |  |  201|  4.58k|			    elf_getu64(swap, ph64.p_vaddr) : 4))))
  ------------------
              		if (virtaddr >= xph_vaddr && virtaddr < xph_vaddr + xph_filesz)
  ------------------
  |  |  202|  4.58k|#define xph_filesz	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  9.16k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 2.41k, False: 2.17k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1048:7): [True: 4.58k, False: 2.35k]
  |  Branch (1048:32): [True: 917, False: 3.66k]
  ------------------
 1049|    917|			return xph_offset + (virtaddr - xph_vaddr);
  ------------------
  |  |  189|    917|#define xph_offset	CAST(off_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  1.83k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 537, False: 380]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  190|    917|			 ? elf_getu32(swap, ph32.p_offset)	\
  |  |  191|    917|			 : elf_getu64(swap, ph64.p_offset)))
  ------------------
              			return xph_offset + (virtaddr - xph_vaddr);
  ------------------
  |  |  197|    917|#define xph_vaddr	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  3.66k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 415, False: 122]
  |  |  |  |  |  Branch (460:25): [True: 264, False: 116]
  |  |  |  |  |  Branch (460:25): [True: 537, False: 380]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  198|    917|			 ? CAST(off_t, (ph32.p_vaddr ? 		\
  |  |  199|    917|			    elf_getu32(swap, ph32.p_vaddr) : 4))\
  |  |  200|    917|			 : CAST(off_t, (ph64.p_vaddr ?		\
  |  |  201|    917|			    elf_getu64(swap, ph64.p_vaddr) : 4))))
  ------------------
 1050|  6.93k|	}
 1051|     75|	return 0;
 1052|  1.86k|}
readelf.c:getu32:
  113|   568k|{
  114|   568k|	union {
  115|   568k|		uint32_t ui;
  116|   568k|		char c[4];
  117|   568k|	} retval, tmpval;
  118|       |
  119|   568k|	if (swap) {
  ------------------
  |  Branch (119:6): [True: 132k, False: 436k]
  ------------------
  120|   132k|		tmpval.ui = value;
  121|       |
  122|   132k|		retval.c[0] = tmpval.c[3];
  123|   132k|		retval.c[1] = tmpval.c[2];
  124|   132k|		retval.c[2] = tmpval.c[1];
  125|   132k|		retval.c[3] = tmpval.c[0];
  126|       |
  127|   132k|		return retval.ui;
  128|   132k|	} else
  129|   436k|		return value;
  130|   568k|}
readelf.c:dophn_exec:
 1741|  2.03k|{
 1742|  2.03k|	Elf32_Phdr ph32;
 1743|  2.03k|	Elf64_Phdr ph64;
 1744|  2.03k|	const char *str;
 1745|  2.03k|	unsigned char nbuf[NBUFSIZE];
 1746|  2.03k|	char interp[NBUFSIZE];
 1747|  2.03k|	ssize_t bufsize;
 1748|  2.03k|	size_t offset, align, need = 0;
 1749|  2.03k|	int pie = 0, dynamic = 0;
 1750|       |
 1751|  2.03k|	if (num == 0) {
  ------------------
  |  Branch (1751:6): [True: 628, False: 1.40k]
  ------------------
 1752|    628|		if (elf_printf(ms, ", no program header") == -1)
  ------------------
  |  Branch (1752:7): [True: 0, False: 628]
  ------------------
 1753|      0|			return -1;
 1754|    628|		return 0;
 1755|    628|	}
 1756|  1.40k|	if (size != xph_sizeof) {
  ------------------
  |  |  183|  1.40k|#define xph_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  1.40k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (183:21): [True: 831, False: 577]
  |  |  ------------------
  |  |  184|  1.40k|			 ? sizeof(ph32)				\
  |  |  185|  1.40k|			 : sizeof(ph64))
  ------------------
  |  Branch (1756:6): [True: 447, False: 961]
  ------------------
 1757|    447|		if (elf_printf(ms, ", corrupted program header size") == -1)
  ------------------
  |  Branch (1757:7): [True: 0, False: 447]
  ------------------
 1758|      0|			return -1;
 1759|    447|		return 0;
 1760|    447|	}
 1761|       |
 1762|    961|	interp[0] = '\0';
 1763|  26.7k|  	for ( ; num; num--) {
  ------------------
  |  Branch (1763:12): [True: 26.6k, False: 84]
  ------------------
 1764|  26.6k|		int doread;
 1765|  26.6k|		if (pread(fd, xph_addr, xph_sizeof, off) <
  ------------------
  |  |  180|  26.6k|#define xph_addr	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  26.6k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (180:19): [True: 18.5k, False: 8.09k]
  |  |  ------------------
  |  |  181|  26.6k|			 ? CAST(void *, &ph32)			\
  |  |  ------------------
  |  |  |  |  460|  18.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  182|  26.6k|			 : CAST(void *, &ph64))
  |  |  ------------------
  |  |  |  |  460|  8.09k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              		if (pread(fd, xph_addr, xph_sizeof, off) <
  ------------------
  |  |  183|  26.6k|#define xph_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  26.6k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (183:21): [True: 18.5k, False: 8.09k]
  |  |  ------------------
  |  |  184|  26.6k|			 ? sizeof(ph32)				\
  |  |  185|  26.6k|			 : sizeof(ph64))
  ------------------
  |  Branch (1765:7): [True: 856, False: 25.7k]
  ------------------
 1766|  26.6k|		    CAST(ssize_t, xph_sizeof)) {
  ------------------
  |  |  460|  53.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 18.5k, False: 8.09k]
  |  |  ------------------
  ------------------
 1767|    856|			if (elf_printf(ms,
  ------------------
  |  Branch (1767:8): [True: 0, False: 856]
  ------------------
 1768|    856|			    ", can't read elf program headers at %jd",
 1769|    856|			    (intmax_t)off) == -1)
 1770|      0|				return -1;
 1771|    856|			return 0;
 1772|    856|		}
 1773|       |
 1774|  25.7k|		off += size;
 1775|  25.7k|		bufsize = 0;
 1776|  25.7k|		align = 4;
 1777|       |
 1778|       |		/* Things we can determine before we seek */
 1779|  25.7k|		switch (xph_type) {
  ------------------
  |  |  186|  25.7k|#define xph_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  25.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (186:19): [True: 18.0k, False: 7.74k]
  |  |  ------------------
  |  |  187|  25.7k|			 ? elf_getu32(swap, ph32.p_type)	\
  |  |  ------------------
  |  |  |  |  158|  18.0k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  188|  25.7k|			 : elf_getu32(swap, ph64.p_type))
  |  |  ------------------
  |  |  |  |  158|  7.74k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
 1780|  1.49k|		case PT_DYNAMIC:
  ------------------
  |  |  199|  1.49k|#define	PT_DYNAMIC	2
  ------------------
  |  Branch (1780:3): [True: 1.49k, False: 24.2k]
  ------------------
 1781|  1.49k|			doread = 1;
 1782|  1.49k|			break;
 1783|  4.97k|		case PT_NOTE:
  ------------------
  |  |  201|  4.97k|#define	PT_NOTE		4
  ------------------
  |  Branch (1783:3): [True: 4.97k, False: 20.8k]
  ------------------
 1784|  4.97k|			if (sh_num)	/* Did this through section headers */
  ------------------
  |  Branch (1784:8): [True: 341, False: 4.63k]
  ------------------
 1785|    341|				continue;
 1786|  4.63k|			if (((align = xph_align) & 0x80000000UL) != 0 ||
  ------------------
  |  |  192|  4.63k|#define xph_align	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  18.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 1.35k, False: 1.25k]
  |  |  |  |  |  Branch (460:25): [True: 1.53k, False: 495]
  |  |  |  |  |  Branch (460:25): [True: 2.61k, False: 2.02k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  193|  4.63k|			 ? CAST(off_t, (ph32.p_align ? 		\
  |  |  194|  4.63k|			    elf_getu32(swap, ph32.p_align) : 4))\
  |  |  195|  4.63k|			 : CAST(off_t, (ph64.p_align ?		\
  |  |  196|  4.63k|			    elf_getu64(swap, ph64.p_align) : 4))))
  ------------------
  |  Branch (1786:8): [True: 444, False: 4.19k]
  ------------------
 1787|  4.19k|			    align < 4) {
  ------------------
  |  Branch (1787:8): [True: 344, False: 3.84k]
  ------------------
 1788|    788|				if (elf_printf(ms,
  ------------------
  |  Branch (1788:9): [True: 0, False: 788]
  ------------------
 1789|    788|				    ", invalid note alignment %#lx",
 1790|    788|				    CAST(unsigned long, align)) == -1)
  ------------------
  |  |  460|    788|#define CAST(T, b)	((T)(b))
  ------------------
 1791|      0|					return -1;
 1792|    788|				align = 4;
 1793|    788|			}
 1794|       |			/*FALLTHROUGH*/
 1795|  5.42k|		case PT_INTERP:
  ------------------
  |  |  200|  5.42k|#define	PT_INTERP	3
  ------------------
  |  Branch (1795:3): [True: 789, False: 24.9k]
  ------------------
 1796|  5.42k|			doread = 1;
 1797|  5.42k|			break;
 1798|  18.5k|		default:
  ------------------
  |  Branch (1798:3): [True: 18.5k, False: 7.26k]
  ------------------
 1799|  18.5k|			doread = 0;
 1800|  18.5k|			if (fsize != SIZE_UNKNOWN && xph_offset > fsize) {
  ------------------
  |  |   65|  18.5k|#define SIZE_UNKNOWN	CAST(off_t, -1)
  |  |  ------------------
  |  |  |  |  460|  37.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              			if (fsize != SIZE_UNKNOWN && xph_offset > fsize) {
  ------------------
  |  |  189|  18.5k|#define xph_offset	CAST(off_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  37.0k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 13.0k, False: 5.43k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  190|  18.5k|			 ? elf_getu32(swap, ph32.p_offset)	\
  |  |  191|  18.5k|			 : elf_getu64(swap, ph64.p_offset)))
  ------------------
  |  Branch (1800:8): [True: 18.5k, False: 0]
  |  Branch (1800:33): [True: 10.3k, False: 8.16k]
  ------------------
 1801|       |				/* Maybe warn here? */
 1802|  10.3k|				continue;
 1803|  10.3k|			}
 1804|  8.16k|			break;
 1805|  25.7k|		}
 1806|       |
 1807|  15.0k|		if (doread) {
  ------------------
  |  Branch (1807:7): [True: 6.91k, False: 8.16k]
  ------------------
 1808|  6.91k|			size_t len = xph_filesz < sizeof(nbuf) ? xph_filesz
  ------------------
  |  |  202|  6.91k|#define xph_filesz	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  13.8k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 4.60k, False: 2.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  203|  6.91k|			 ? elf_getu32(swap, ph32.p_filesz)	\
  |  |  204|  6.91k|			 : elf_getu64(swap, ph64.p_filesz)))
  ------------------
              			size_t len = xph_filesz < sizeof(nbuf) ? xph_filesz
  ------------------
  |  |  202|  2.41k|#define xph_filesz	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  4.82k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 1.67k, False: 743]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  203|  6.91k|			 ? elf_getu32(swap, ph32.p_filesz)	\
  |  |  204|  6.91k|			 : elf_getu64(swap, ph64.p_filesz)))
  ------------------
  |  Branch (1808:17): [True: 2.41k, False: 4.50k]
  ------------------
 1809|  6.91k|			    : sizeof(nbuf);
 1810|  6.91k|			off_t offs = xph_offset;
  ------------------
  |  |  189|  6.91k|#define xph_offset	CAST(off_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  13.8k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 4.60k, False: 2.31k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  190|  6.91k|			 ? elf_getu32(swap, ph32.p_offset)	\
  |  |  191|  6.91k|			 : elf_getu64(swap, ph64.p_offset)))
  ------------------
 1811|  6.91k|			bufsize = pread(fd, nbuf, len, offs);
 1812|  6.91k|			if (bufsize == -1) {
  ------------------
  |  Branch (1812:8): [True: 21, False: 6.89k]
  ------------------
 1813|     21|				if (elf_printf(ms,
  ------------------
  |  Branch (1813:9): [True: 0, False: 21]
  ------------------
 1814|     21|				    ", can't read section at %jd",
 1815|     21|				    (intmax_t)offs) == -1)
 1816|      0|					return -1;
 1817|     21|				return 0;
 1818|     21|			}
 1819|  6.91k|		}
 1820|       |
 1821|       |		/* Things we can determine when we seek */
 1822|  15.0k|		switch (xph_type) {
  ------------------
  |  |  186|  15.0k|#define xph_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  15.0k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (186:19): [True: 9.15k, False: 5.90k]
  |  |  ------------------
  |  |  187|  15.0k|			 ? elf_getu32(swap, ph32.p_type)	\
  |  |  ------------------
  |  |  |  |  158|  9.15k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  188|  15.0k|			 : elf_getu32(swap, ph64.p_type))
  |  |  ------------------
  |  |  |  |  158|  5.90k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
 1823|  1.48k|		case PT_DYNAMIC:
  ------------------
  |  |  199|  1.48k|#define	PT_DYNAMIC	2
  ------------------
  |  Branch (1823:3): [True: 1.48k, False: 13.5k]
  ------------------
 1824|  1.48k|			dynamic = 1;
 1825|  1.48k|			offset = 0;
 1826|       |			// Let DF_1 determine if we are PIE or not.
 1827|  1.48k|			ms->mode &= ~0111;
 1828|  50.1k|			for (;;) {
 1829|  50.1k|				if (offset >= CAST(size_t, bufsize))
  ------------------
  |  |  460|  50.1k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1829:9): [True: 1.48k, False: 48.6k]
  ------------------
 1830|  1.48k|					break;
 1831|  48.6k|				offset = dodynamic(ms, nbuf, offset,
 1832|  48.6k|				    CAST(size_t, bufsize), clazz, swap,
  ------------------
  |  |  460|  48.6k|#define CAST(T, b)	((T)(b))
  ------------------
 1833|  48.6k|				    &pie, &need);
 1834|  48.6k|				if (offset == 0)
  ------------------
  |  Branch (1834:9): [True: 0, False: 48.6k]
  ------------------
 1835|      0|					break;
 1836|  48.6k|			}
 1837|  1.48k|			break;
 1838|       |
 1839|  48.6k|		case PT_INTERP:
  ------------------
  |  |  200|    789|#define	PT_INTERP	3
  ------------------
  |  Branch (1839:3): [True: 789, False: 14.2k]
  ------------------
 1840|    789|			need++;
 1841|    789|			if (ms->flags & MAGIC_MIME)
  ------------------
  |  |   44|    789|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|    789|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|    789|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (1841:8): [True: 0, False: 789]
  ------------------
 1842|      0|				continue;
 1843|    789|			if (bufsize && nbuf[0]) {
  ------------------
  |  Branch (1843:8): [True: 572, False: 217]
  |  Branch (1843:19): [True: 233, False: 339]
  ------------------
 1844|    233|				nbuf[bufsize - 1] = '\0';
 1845|    233|				str = RCAST(const char *, nbuf);
  ------------------
  |  |  461|    233|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1846|    233|			} else
 1847|    556|				str = "*empty*";
 1848|    789|			strlcpy(interp, str, sizeof(interp));
 1849|    789|			break;
 1850|  4.62k|		case PT_NOTE:
  ------------------
  |  |  201|  4.62k|#define	PT_NOTE		4
  ------------------
  |  Branch (1850:3): [True: 4.62k, False: 10.4k]
  ------------------
 1851|  4.62k|			if (ms->flags & MAGIC_MIME)
  ------------------
  |  |   44|  4.62k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  4.62k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  4.62k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (1851:8): [True: 0, False: 4.62k]
  ------------------
 1852|      0|				return 0;
 1853|       |			/*
 1854|       |			 * This is a PT_NOTE section; loop through all the notes
 1855|       |			 * in the section.
 1856|       |			 */
 1857|  4.62k|			offset = 0;
 1858|  8.62k|			for (;;) {
 1859|  8.62k|				if (offset >= CAST(size_t, bufsize))
  ------------------
  |  |  460|  8.62k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1859:9): [True: 3.96k, False: 4.66k]
  ------------------
 1860|  3.96k|					break;
 1861|  4.66k|				offset = donote(ms, nbuf, offset,
 1862|  4.66k|				    CAST(size_t, bufsize), clazz, swap, align,
  ------------------
  |  |  460|  4.66k|#define CAST(T, b)	((T)(b))
  ------------------
 1863|  4.66k|				    flags, notecount, fd, 0, 0, 0);
 1864|  4.66k|				if (offset == 0)
  ------------------
  |  Branch (1864:9): [True: 659, False: 4.00k]
  ------------------
 1865|    659|					break;
 1866|  4.66k|			}
 1867|  4.62k|			break;
 1868|  8.16k|		default:
  ------------------
  |  Branch (1868:3): [True: 8.16k, False: 6.89k]
  ------------------
 1869|  8.16k|			if (ms->flags & MAGIC_MIME)
  ------------------
  |  |   44|  8.16k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  8.16k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  8.16k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (1869:8): [True: 0, False: 8.16k]
  ------------------
 1870|      0|				continue;
 1871|  8.16k|			break;
 1872|  15.0k|		}
 1873|  15.0k|	}
 1874|     84|	if (ms->flags & MAGIC_MIME)
  ------------------
  |  |   44|     84|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|     84|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|     84|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (1874:6): [True: 0, False: 84]
  ------------------
 1875|      0|		return 0;
 1876|     84|	if (dynamic) {
  ------------------
  |  Branch (1876:6): [True: 22, False: 62]
  ------------------
 1877|     22|		if (pie && need == 0)
  ------------------
  |  Branch (1877:7): [True: 4, False: 18]
  |  Branch (1877:14): [True: 2, False: 2]
  ------------------
 1878|      2|			str = "static-pie";
 1879|     20|		else
 1880|     20|			str = "dynamically";
 1881|     62|	} else {
 1882|     62|		str = "statically";
 1883|     62|	}
 1884|     84|	if (elf_printf(ms, ", %s linked", str) == -1)
  ------------------
  |  Branch (1884:6): [True: 0, False: 84]
  ------------------
 1885|      0|		return -1;
 1886|     84|	if (interp[0])
  ------------------
  |  Branch (1886:6): [True: 10, False: 74]
  ------------------
 1887|     10|		if (elf_printf(ms, ", interpreter %s", file_printable(ms,
  ------------------
  |  Branch (1887:7): [True: 2, False: 8]
  ------------------
 1888|     10|		    RCAST(char *, nbuf), sizeof(nbuf),
  ------------------
  |  |  461|     10|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1889|     10|		    interp, sizeof(interp))) == -1)
 1890|      2|			return -1;
 1891|     82|	return 0;
 1892|     84|}
readelf.c:dodynamic:
 1198|  48.6k|{
 1199|  48.6k|	Elf32_Dyn dh32;
 1200|  48.6k|	Elf64_Dyn dh64;
 1201|  48.6k|	unsigned char *dbuf = CAST(unsigned char *, vbuf);
  ------------------
  |  |  460|  48.6k|#define CAST(T, b)	((T)(b))
  ------------------
 1202|       |
 1203|  48.6k|	if (xdh_sizeof + offset > size) {
  ------------------
  |  |  227|  48.6k|#define xdh_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  48.6k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (227:21): [True: 37.8k, False: 10.7k]
  |  |  ------------------
  |  |  228|  48.6k|			 ? sizeof(dh32)				\
  |  |  229|  48.6k|			 : sizeof(dh64))
  ------------------
  |  Branch (1203:6): [True: 904, False: 47.7k]
  ------------------
 1204|       |		/*
 1205|       |		 * We're out of note headers.
 1206|       |		 */
 1207|    904|		return xdh_sizeof + offset;
  ------------------
  |  |  227|    904|#define xdh_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|    904|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (227:21): [True: 720, False: 184]
  |  |  ------------------
  |  |  228|    904|			 ? sizeof(dh32)				\
  |  |  229|    904|			 : sizeof(dh64))
  ------------------
 1208|    904|	}
 1209|       |
 1210|  47.7k|	memcpy(xdh_addr, &dbuf[offset], xdh_sizeof);
  ------------------
  |  |  224|  47.7k|#define xdh_addr	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  47.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (224:19): [True: 37.1k, False: 10.5k]
  |  |  ------------------
  |  |  225|  47.7k|			 ? CAST(void *, &dh32)			\
  |  |  ------------------
  |  |  |  |  460|  37.1k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  226|  47.7k|			 : CAST(void *, &dh64))
  |  |  ------------------
  |  |  |  |  460|  10.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	memcpy(xdh_addr, &dbuf[offset], xdh_sizeof);
  ------------------
  |  |  227|  47.7k|#define xdh_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  47.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (227:21): [True: 37.1k, False: 10.5k]
  |  |  ------------------
  |  |  228|  47.7k|			 ? sizeof(dh32)				\
  |  |  229|  47.7k|			 : sizeof(dh64))
  ------------------
 1211|  47.7k|	offset += xdh_sizeof;
  ------------------
  |  |  227|  47.7k|#define xdh_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  47.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (227:21): [True: 37.1k, False: 10.5k]
  |  |  ------------------
  |  |  228|  47.7k|			 ? sizeof(dh32)				\
  |  |  229|  47.7k|			 : sizeof(dh64))
  ------------------
 1212|       |
 1213|  47.7k|	switch (xdh_tag) {
  ------------------
  |  |  230|  47.7k|#define xdh_tag		(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  47.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (230:19): [True: 37.1k, False: 10.5k]
  |  |  ------------------
  |  |  231|  47.7k|			 ? elf_getu32(swap, dh32.d_tag)		\
  |  |  ------------------
  |  |  |  |  158|  37.1k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  232|  47.7k|			 : elf_getu64(swap, dh64.d_tag))
  |  |  ------------------
  |  |  |  |  159|  10.5k|#define elf_getu64(swap, value) getu64(swap, value)
  |  |  ------------------
  ------------------
 1214|  2.39k|	case DT_FLAGS_1:
  ------------------
  |  |  531|  2.39k|#define DT_FLAGS_1	0x6ffffffb	/* ELF dynamic flags */
  ------------------
  |  Branch (1214:2): [True: 2.39k, False: 45.3k]
  ------------------
 1215|  2.39k|		if (xdh_val & DF_1_PIE) {
  ------------------
  |  |  233|  2.39k|#define xdh_val		(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  2.39k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (233:19): [True: 1.96k, False: 433]
  |  |  ------------------
  |  |  234|  2.39k|			 ? elf_getu32(swap, dh32.d_un.d_val)	\
  |  |  ------------------
  |  |  |  |  158|  1.96k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  235|  2.39k|			 : elf_getu64(swap, dh64.d_un.d_val))
  |  |  ------------------
  |  |  |  |  159|    433|#define elf_getu64(swap, value) getu64(swap, value)
  |  |  ------------------
  ------------------
              		if (xdh_val & DF_1_PIE) {
  ------------------
  |  |  574|  2.39k|#define	DF_1_PIE	0x08000000	/* Position Independent Executable */
  ------------------
  |  Branch (1215:7): [True: 1.88k, False: 517]
  ------------------
 1216|  1.88k|			*pie = 1;
 1217|  1.88k|			ms->mode |= 0111;
 1218|  1.88k|		} else
 1219|    517|			ms->mode &= ~0111;
 1220|  2.39k|		break;
 1221|  1.90k|	case DT_NEEDED:
  ------------------
  |  |  494|  1.90k|#define DT_NEEDED	1	/* Name of needed library (DT_STRTAB offset) */
  ------------------
  |  Branch (1221:2): [True: 1.90k, False: 45.8k]
  ------------------
 1222|  1.90k|		(*need)++;
 1223|  1.90k|		break;
 1224|  43.4k|	default:
  ------------------
  |  Branch (1224:2): [True: 43.4k, False: 4.29k]
  ------------------
 1225|  43.4k|		break;
 1226|  47.7k|	}
 1227|  47.7k|	return offset;
 1228|  47.7k|}
readelf.c:doshn:
 1433|  2.12k|{
 1434|  2.12k|	Elf32_Shdr sh32;
 1435|  2.12k|	Elf64_Shdr sh64;
 1436|  2.12k|	int stripped = 1, has_debug_info = 0;
 1437|  2.12k|	size_t nbadcap = 0;
 1438|  2.12k|	void *nbuf;
 1439|  2.12k|	off_t noff, coff, name_off, offs;
 1440|  2.12k|	uint64_t cap_hw1 = 0;	/* SunOS 5.x hardware capabilities */
 1441|  2.12k|	uint64_t cap_sf1 = 0;	/* SunOS 5.x software capabilities */
 1442|  2.12k|	char name[50];
 1443|  2.12k|	ssize_t namesize;
 1444|       |
 1445|  2.12k|	if (ms->flags & MAGIC_MIME)
  ------------------
  |  |   44|  2.12k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  2.12k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  2.12k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (1445:6): [True: 0, False: 2.12k]
  ------------------
 1446|      0|		return 0;
 1447|       |
 1448|  2.12k|	if (num == 0) {
  ------------------
  |  Branch (1448:6): [True: 550, False: 1.57k]
  ------------------
 1449|    550|		if (elf_printf(ms, ", no section header") == -1)
  ------------------
  |  Branch (1449:7): [True: 0, False: 550]
  ------------------
 1450|      0|			return -1;
 1451|    550|		return 0;
 1452|    550|	}
 1453|  1.57k|	if (size != xsh_sizeof) {
  ------------------
  |  |  164|  1.57k|#define xsh_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  1.57k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (164:21): [True: 834, False: 745]
  |  |  ------------------
  |  |  165|  1.57k|			 ? sizeof(sh32)				\
  |  |  166|  1.57k|			 : sizeof(sh64))
  ------------------
  |  Branch (1453:6): [True: 360, False: 1.21k]
  ------------------
 1454|    360|		if (elf_printf(ms, ", corrupted section header size") == -1)
  ------------------
  |  Branch (1454:7): [True: 0, False: 360]
  ------------------
 1455|      0|			return -1;
 1456|    360|		return 0;
 1457|    360|	}
 1458|       |
 1459|       |	/* Read offset of name section to be able to read section names later */
 1460|  1.21k|	offs = CAST(off_t, (off + size * strtab));
  ------------------
  |  |  460|  1.21k|#define CAST(T, b)	((T)(b))
  ------------------
 1461|  1.21k|	if (pread(fd, xsh_addr, xsh_sizeof, offs) < CAST(ssize_t, xsh_sizeof)) {
  ------------------
  |  |  161|  1.21k|#define xsh_addr	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  1.21k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (161:19): [True: 631, False: 588]
  |  |  ------------------
  |  |  162|  1.21k|			 ? CAST(void *, &sh32)			\
  |  |  ------------------
  |  |  |  |  460|    631|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  163|  1.21k|			 : CAST(void *, &sh64))
  |  |  ------------------
  |  |  |  |  460|    588|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	if (pread(fd, xsh_addr, xsh_sizeof, offs) < CAST(ssize_t, xsh_sizeof)) {
  ------------------
  |  |  164|  1.21k|#define xsh_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  1.21k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (164:21): [True: 631, False: 588]
  |  |  ------------------
  |  |  165|  1.21k|			 ? sizeof(sh32)				\
  |  |  166|  1.21k|			 : sizeof(sh64))
  ------------------
              	if (pread(fd, xsh_addr, xsh_sizeof, offs) < CAST(ssize_t, xsh_sizeof)) {
  ------------------
  |  |  460|  2.43k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 631, False: 588]
  |  |  ------------------
  ------------------
  |  Branch (1461:6): [True: 8, False: 1.21k]
  ------------------
 1462|      8|		if (elf_printf(ms, ", missing section headers at %jd",
  ------------------
  |  Branch (1462:7): [True: 0, False: 8]
  ------------------
 1463|      8|		    (intmax_t)offs) == -1)
 1464|      0|			return -1;
 1465|      8|		return 0;
 1466|      8|	}
 1467|  1.21k|	name_off = xsh_offset;
  ------------------
  |  |  170|  1.21k|#define xsh_offset	CAST(off_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  2.42k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 625, False: 586]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  1.21k|			 ? elf_getu32(swap, sh32.sh_offset)	\
  |  |  172|  1.21k|			 : elf_getu64(swap, sh64.sh_offset)))
  ------------------
 1468|       |
 1469|  1.21k|	if (fsize != SIZE_UNKNOWN && fsize < name_off) {
  ------------------
  |  |   65|  1.21k|#define SIZE_UNKNOWN	CAST(off_t, -1)
  |  |  ------------------
  |  |  |  |  460|  2.42k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1469:6): [True: 1.21k, False: 0]
  |  Branch (1469:31): [True: 24, False: 1.18k]
  ------------------
 1470|     24|		if (elf_printf(ms, ", too large section header offset %jd",
  ------------------
  |  Branch (1470:7): [True: 0, False: 24]
  ------------------
 1471|     24|		    (intmax_t)name_off) == -1)
 1472|      0|			return -1;
 1473|     24|		return 0;
 1474|     24|	}
 1475|       |
 1476|  52.4k|	for ( ; num; num--) {
  ------------------
  |  Branch (1476:10): [True: 52.2k, False: 237]
  ------------------
 1477|       |		/* Read the name of this section. */
 1478|  52.2k|		offs = name_off + xsh_name;
  ------------------
  |  |  176|  52.2k|#define xsh_name    	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  52.2k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (176:23): [True: 46.7k, False: 5.45k]
  |  |  ------------------
  |  |  177|  52.2k|			 ? elf_getu32(swap, sh32.sh_name)	\
  |  |  ------------------
  |  |  |  |  158|  46.7k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  178|  52.2k|			 : elf_getu32(swap, sh64.sh_name))
  |  |  ------------------
  |  |  |  |  158|  5.45k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
 1479|  52.2k|		if ((namesize = pread(fd, name, sizeof(name) - 1, offs))
  ------------------
  |  Branch (1479:7): [True: 56, False: 52.1k]
  ------------------
 1480|  52.2k|		    == -1) {
 1481|     56|			if (elf_printf(ms, 
  ------------------
  |  Branch (1481:8): [True: 0, False: 56]
  ------------------
 1482|     56|			    ", can't read name of elf section at %jd",
 1483|     56|			    (intmax_t)offs) == -1)
 1484|      0|				return -1;
 1485|     56|			return 0;
 1486|     56|		}
 1487|  52.1k|		name[namesize] = '\0';
 1488|  52.1k|		if (strcmp(name, ".debug_info") == 0) {
  ------------------
  |  Branch (1488:7): [True: 195, False: 51.9k]
  ------------------
 1489|    195|			has_debug_info = 1;
 1490|    195|			stripped = 0;
 1491|    195|		}
 1492|       |
 1493|  52.1k|		if (pread(fd, xsh_addr, xsh_sizeof, off) <
  ------------------
  |  |  161|  52.1k|#define xsh_addr	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  52.1k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (161:19): [True: 46.7k, False: 5.39k]
  |  |  ------------------
  |  |  162|  52.1k|			 ? CAST(void *, &sh32)			\
  |  |  ------------------
  |  |  |  |  460|  46.7k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  163|  52.1k|			 : CAST(void *, &sh64))
  |  |  ------------------
  |  |  |  |  460|  5.39k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              		if (pread(fd, xsh_addr, xsh_sizeof, off) <
  ------------------
  |  |  164|  52.1k|#define xsh_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  52.1k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (164:21): [True: 46.7k, False: 5.39k]
  |  |  ------------------
  |  |  165|  52.1k|			 ? sizeof(sh32)				\
  |  |  166|  52.1k|			 : sizeof(sh64))
  ------------------
  |  Branch (1493:7): [True: 610, False: 51.5k]
  ------------------
 1494|  52.1k|		    CAST(ssize_t, xsh_sizeof)) {
  ------------------
  |  |  460|   104k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 46.7k, False: 5.39k]
  |  |  ------------------
  ------------------
 1495|    610|			if (elf_printf(ms, ", can't read elf section at %jd",
  ------------------
  |  Branch (1495:8): [True: 0, False: 610]
  ------------------
 1496|    610|			    (intmax_t)off) == -1)
 1497|      0|				return -1;
 1498|    610|			return 0;
 1499|    610|		}
 1500|  51.5k|		off += size;
 1501|       |
 1502|       |		/* Things we can determine before we seek */
 1503|  51.5k|		switch (xsh_type) {
  ------------------
  |  |  173|  51.5k|#define xsh_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  51.5k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (173:19): [True: 46.3k, False: 5.18k]
  |  |  ------------------
  |  |  174|  51.5k|			 ? elf_getu32(swap, sh32.sh_type)	\
  |  |  ------------------
  |  |  |  |  158|  46.3k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  175|  51.5k|			 : elf_getu32(swap, sh64.sh_type))
  |  |  ------------------
  |  |  |  |  158|  5.18k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
 1504|    582|		case SHT_SYMTAB:
  ------------------
  |  |  141|    582|#define	SHT_SYMTAB	2
  ------------------
  |  Branch (1504:3): [True: 582, False: 50.9k]
  ------------------
 1505|       |#if 0
 1506|       |		case SHT_DYNSYM:
 1507|       |#endif
 1508|    582|			stripped = 0;
 1509|    582|			break;
 1510|  50.9k|		default:
  ------------------
  |  Branch (1510:3): [True: 50.9k, False: 582]
  ------------------
 1511|  50.9k|			if (fsize != SIZE_UNKNOWN && xsh_offset > fsize) {
  ------------------
  |  |   65|  50.9k|#define SIZE_UNKNOWN	CAST(off_t, -1)
  |  |  ------------------
  |  |  |  |  460|   101k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              			if (fsize != SIZE_UNKNOWN && xsh_offset > fsize) {
  ------------------
  |  |  170|  50.9k|#define xsh_offset	CAST(off_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|   101k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 45.8k, False: 5.14k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  50.9k|			 ? elf_getu32(swap, sh32.sh_offset)	\
  |  |  172|  50.9k|			 : elf_getu64(swap, sh64.sh_offset)))
  ------------------
  |  Branch (1511:8): [True: 50.9k, False: 0]
  |  Branch (1511:33): [True: 35.8k, False: 15.1k]
  ------------------
 1512|       |				/* Perhaps warn here */
 1513|  35.8k|				continue;
 1514|  35.8k|			}
 1515|  15.1k|			break;
 1516|  51.5k|		}
 1517|       |
 1518|       |
 1519|       |		/* Things we can determine when we seek */
 1520|  15.7k|		switch (xsh_type) {
  ------------------
  |  |  173|  15.7k|#define xsh_type	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  15.7k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (173:19): [True: 12.2k, False: 3.47k]
  |  |  ------------------
  |  |  174|  15.7k|			 ? elf_getu32(swap, sh32.sh_type)	\
  |  |  ------------------
  |  |  |  |  158|  12.2k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  175|  15.7k|			 : elf_getu32(swap, sh64.sh_type))
  |  |  ------------------
  |  |  |  |  158|  3.47k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  ------------------
 1521|  1.81k|		case SHT_NOTE:
  ------------------
  |  |  142|  1.81k|#define	SHT_NOTE	7
  ------------------
  |  Branch (1521:3): [True: 1.81k, False: 13.9k]
  ------------------
 1522|  1.81k|			if (CAST(uintmax_t, (xsh_size + xsh_offset)) >
  ------------------
  |  |  460|  7.27k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 882, False: 937]
  |  |  |  Branch (460:25): [True: 882, False: 937]
  |  |  ------------------
  ------------------
  |  Branch (1522:8): [True: 112, False: 1.70k]
  ------------------
 1523|  1.81k|			    CAST(uintmax_t, fsize)) {
  ------------------
  |  |  460|  1.81k|#define CAST(T, b)	((T)(b))
  ------------------
 1524|    112|				if (elf_printf(ms,
  ------------------
  |  Branch (1524:9): [True: 0, False: 112]
  ------------------
 1525|    112|				    ", note offset/size %#" INTMAX_T_FORMAT
 1526|    112|				    "x+%#" INTMAX_T_FORMAT "x exceeds"
 1527|    112|				    " file size %#" INTMAX_T_FORMAT "x",
 1528|    112|				    CAST(uintmax_t, xsh_offset),
  ------------------
  |  |  460|    224|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 52, False: 60]
  |  |  ------------------
  ------------------
 1529|    112|				    CAST(uintmax_t, xsh_size),
  ------------------
  |  |  460|    224|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 52, False: 60]
  |  |  ------------------
  ------------------
 1530|    112|				    CAST(uintmax_t, fsize)) == -1)
  ------------------
  |  |  460|    112|#define CAST(T, b)	((T)(b))
  ------------------
 1531|      0|					return -1;
 1532|    112|				return 0;
 1533|    112|			}
 1534|  1.70k|			if (xsh_size > ms->elf_shsize_max) {
  ------------------
  |  |  167|  1.70k|#define xsh_size	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  3.41k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 830, False: 877]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  1.70k|			 ? elf_getu32(swap, sh32.sh_size)	\
  |  |  169|  1.70k|			 : elf_getu64(swap, sh64.sh_size)))
  ------------------
  |  Branch (1534:8): [True: 40, False: 1.66k]
  ------------------
 1535|     40|				file_error(ms, errno, "Note section size too "
 1536|     40|				    "big (%ju > %zu)", (uintmax_t)xsh_size,
  ------------------
  |  |  167|     40|#define xsh_size	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|     80|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 40]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|     40|			 ? elf_getu32(swap, sh32.sh_size)	\
  |  |  169|     40|			 : elf_getu64(swap, sh64.sh_size)))
  ------------------
 1537|     40|				    ms->elf_shsize_max);
 1538|     40|				return -1;
 1539|     40|			}
 1540|  1.66k|			if ((nbuf = malloc(xsh_size)) == NULL) {
  ------------------
  |  |  167|  1.66k|#define xsh_size	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  3.33k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 830, False: 837]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  1.66k|			 ? elf_getu32(swap, sh32.sh_size)	\
  |  |  169|  1.66k|			 : elf_getu64(swap, sh64.sh_size)))
  ------------------
  |  Branch (1540:8): [True: 0, False: 1.66k]
  ------------------
 1541|      0|				file_error(ms, errno, "Cannot allocate memory"
 1542|      0|				    " for note");
 1543|      0|				return -1;
 1544|      0|			}
 1545|  1.66k|			offs = xsh_offset;
  ------------------
  |  |  170|  1.66k|#define xsh_offset	CAST(off_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  3.33k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 830, False: 837]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  1.66k|			 ? elf_getu32(swap, sh32.sh_offset)	\
  |  |  172|  1.66k|			 : elf_getu64(swap, sh64.sh_offset)))
  ------------------
 1546|  1.66k|			if (pread(fd, nbuf, xsh_size, offs) <
  ------------------
  |  |  167|  1.66k|#define xsh_size	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  3.33k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 830, False: 837]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  1.66k|			 ? elf_getu32(swap, sh32.sh_size)	\
  |  |  169|  1.66k|			 : elf_getu64(swap, sh64.sh_size)))
  ------------------
  |  Branch (1546:8): [True: 24, False: 1.64k]
  ------------------
 1547|  1.66k|			    CAST(ssize_t, xsh_size)) {
  ------------------
  |  |  460|  3.33k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 830, False: 837]
  |  |  ------------------
  ------------------
 1548|     24|				free(nbuf);
 1549|     24|				if (elf_printf(ms,
  ------------------
  |  Branch (1549:9): [True: 0, False: 24]
  ------------------
 1550|     24|				    ", can't read elf note at %jd",
 1551|     24|				    (intmax_t)offs) == -1)
 1552|      0|					return -1;
 1553|     24|				return 0;
 1554|     24|			}
 1555|       |
 1556|  1.64k|			noff = 0;
 1557|  4.72k|			for (;;) {
 1558|  4.72k|				if (noff >= CAST(off_t, xsh_size))
  ------------------
  |  |  460|  9.45k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 2.00k, False: 2.72k]
  |  |  ------------------
  ------------------
  |  Branch (1558:9): [True: 1.43k, False: 3.29k]
  ------------------
 1559|  1.43k|					break;
 1560|  3.29k|				noff = donote(ms, nbuf, CAST(size_t, noff),
  ------------------
  |  |  460|  3.29k|#define CAST(T, b)	((T)(b))
  ------------------
 1561|  3.29k|				    xsh_size, clazz, swap, 4, flags, notecount,
  ------------------
  |  |  167|  3.29k|#define xsh_size	CAST(size_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  6.58k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 1.19k, False: 2.10k]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  168|  3.29k|			 ? elf_getu32(swap, sh32.sh_size)	\
  |  |  169|  3.29k|			 : elf_getu64(swap, sh64.sh_size)))
  ------------------
 1562|  3.29k|				    fd, 0, 0, 0);
 1563|  3.29k|				if (noff == 0)
  ------------------
  |  Branch (1563:9): [True: 207, False: 3.08k]
  ------------------
 1564|    207|					break;
 1565|  3.29k|			}
 1566|  1.64k|			free(nbuf);
 1567|  1.64k|			break;
 1568|  2.58k|		case SHT_SUNW_cap:
  ------------------
  |  |  144|  2.58k|#define	SHT_SUNW_cap	0x6ffffff5	/* SunOS 5.x hw/sw capabilities */
  ------------------
  |  Branch (1568:3): [True: 2.58k, False: 13.1k]
  ------------------
 1569|  2.58k|			switch (mach) {
 1570|    208|			case EM_SPARC:
  ------------------
  |  |  133|    208|#define	EM_SPARC	2
  ------------------
  |  Branch (1570:4): [True: 208, False: 2.37k]
  ------------------
 1571|  1.03k|			case EM_SPARCV9:
  ------------------
  |  |  136|  1.03k|#define	EM_SPARCV9	43
  ------------------
  |  Branch (1571:4): [True: 830, False: 1.75k]
  ------------------
 1572|  1.32k|			case EM_IA_64:
  ------------------
  |  |  137|  1.32k|#define	EM_IA_64	50
  ------------------
  |  Branch (1572:4): [True: 286, False: 2.29k]
  ------------------
 1573|  1.90k|			case EM_386:
  ------------------
  |  |  134|  1.90k|#define	EM_386		3
  ------------------
  |  Branch (1573:4): [True: 576, False: 2.00k]
  ------------------
 1574|  2.34k|			case EM_AMD64:
  ------------------
  |  |  138|  2.34k|#define	EM_AMD64	62
  ------------------
  |  Branch (1574:4): [True: 449, False: 2.13k]
  ------------------
 1575|  2.34k|				break;
 1576|    232|			default:
  ------------------
  |  Branch (1576:4): [True: 232, False: 2.34k]
  ------------------
 1577|    232|				goto skip;
 1578|  2.58k|			}
 1579|       |
 1580|  2.34k|			if (nbadcap > 5)
  ------------------
  |  Branch (1580:8): [True: 646, False: 1.70k]
  ------------------
 1581|    646|				break;
 1582|  1.70k|			if (lseek(fd, xsh_offset, SEEK_SET)
  ------------------
  |  |  170|  1.70k|#define xsh_offset	CAST(off_t, (clazz == ELFCLASS32	\
  |  |  ------------------
  |  |  |  |  460|  3.40k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 895, False: 808]
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  171|  1.70k|			 ? elf_getu32(swap, sh32.sh_offset)	\
  |  |  172|  1.70k|			 : elf_getu64(swap, sh64.sh_offset)))
  ------------------
  |  Branch (1582:8): [True: 8, False: 1.69k]
  ------------------
 1583|  1.70k|			    == CAST(off_t, -1)) {
  ------------------
  |  |  460|  1.70k|#define CAST(T, b)	((T)(b))
  ------------------
 1584|      8|				file_badseek(ms);
 1585|      8|				return -1;
 1586|      8|			}
 1587|  1.69k|			coff = 0;
 1588|  7.84k|			for (;;) {
 1589|  7.84k|				Elf32_Cap cap32;
 1590|  7.84k|				Elf64_Cap cap64;
 1591|  7.84k|				cap32.c_un.c_val = 0;
 1592|  7.84k|				cap64.c_un.c_val = 0;
 1593|  7.84k|				char cbuf[/*CONSTCOND*/
 1594|  7.84k|				    MAX(sizeof(cap32), sizeof(cap64))];
 1595|  7.84k|				if ((coff += xcap_sizeof) >
  ------------------
  |  |  240|  7.84k|#define xcap_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  7.84k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (240:22): [True: 4.42k, False: 3.41k]
  |  |  ------------------
  |  |  241|  7.84k|			 ? sizeof(cap32)			\
  |  |  242|  7.84k|			 : sizeof(cap64))
  ------------------
  |  Branch (1595:9): [True: 631, False: 7.21k]
  ------------------
 1596|  7.84k|				    CAST(off_t, xsh_size))
  ------------------
  |  |  460|  15.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 4.42k, False: 3.41k]
  |  |  ------------------
  ------------------
 1597|    631|					break;
 1598|  7.21k|				if (read(fd, cbuf, CAST(size_t, xcap_sizeof)) !=
  ------------------
  |  |  460|  14.4k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 3.93k, False: 3.27k]
  |  |  ------------------
  ------------------
  |  Branch (1598:9): [True: 100, False: 7.11k]
  ------------------
 1599|  7.21k|				    CAST(ssize_t, xcap_sizeof)) {
  ------------------
  |  |  460|  14.4k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 3.93k, False: 3.27k]
  |  |  ------------------
  ------------------
 1600|    100|					file_badread(ms);
 1601|    100|					return -1;
 1602|    100|				}
 1603|  7.11k|				if (cbuf[0] == 'A') {
  ------------------
  |  Branch (1603:9): [True: 749, False: 6.36k]
  ------------------
 1604|       |#ifdef notyet
 1605|       |					char *p = cbuf + 1;
 1606|       |					uint32_t len, tag;
 1607|       |					memcpy(&len, p, sizeof(len));
 1608|       |					p += 4;
 1609|       |					len = getu32(swap, len);
 1610|       |					if (memcmp("gnu", p, 3) != 0) {
 1611|       |					    if (elf_printf(ms,
 1612|       |						", unknown capability %.3s", p)
 1613|       |						== -1)
 1614|       |						return -1;
 1615|       |					    break;
 1616|       |					}
 1617|       |					p += strlen(p) + 1;
 1618|       |					tag = *p++;
 1619|       |					memcpy(&len, p, sizeof(len));
 1620|       |					p += 4;
 1621|       |					len = getu32(swap, len);
 1622|       |					if (tag != 1) {
 1623|       |					    if (elf_printf(ms, ", unknown gnu"
 1624|       |						" capability tag %d", tag)
 1625|       |						== -1)
 1626|       |						return -1;
 1627|       |					    break;
 1628|       |					}
 1629|       |					// gnu attributes
 1630|       |#endif
 1631|    749|					break;
 1632|    749|				}
 1633|  6.36k|				memcpy(xcap_addr, cbuf, xcap_sizeof);
  ------------------
  |  |  237|  6.36k|#define xcap_addr	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  6.36k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (237:20): [True: 3.68k, False: 2.68k]
  |  |  ------------------
  |  |  238|  6.36k|			 ? CAST(void *, &cap32)			\
  |  |  ------------------
  |  |  |  |  460|  3.68k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  239|  6.36k|			 : CAST(void *, &cap64))
  |  |  ------------------
  |  |  |  |  460|  2.68k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              				memcpy(xcap_addr, cbuf, xcap_sizeof);
  ------------------
  |  |  240|  6.36k|#define xcap_sizeof	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  6.36k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (240:22): [True: 3.68k, False: 2.68k]
  |  |  ------------------
  |  |  241|  6.36k|			 ? sizeof(cap32)			\
  |  |  242|  6.36k|			 : sizeof(cap64))
  ------------------
 1634|  6.36k|				switch (xcap_tag) {
  ------------------
  |  |  243|  6.36k|#define xcap_tag	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  6.36k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (243:19): [True: 3.68k, False: 2.68k]
  |  |  ------------------
  |  |  244|  6.36k|			 ? elf_getu32(swap, cap32.c_tag)	\
  |  |  ------------------
  |  |  |  |  158|  3.68k|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  245|  6.36k|			 : elf_getu64(swap, cap64.c_tag))
  |  |  ------------------
  |  |  |  |  159|  2.68k|#define elf_getu64(swap, value) getu64(swap, value)
  |  |  ------------------
  ------------------
 1635|  2.88k|				case CA_SUNW_NULL:
  ------------------
  |  |  424|  2.88k|#define	CA_SUNW_NULL	0
  ------------------
  |  Branch (1635:5): [True: 2.88k, False: 3.47k]
  ------------------
 1636|  2.88k|					break;
 1637|  1.12k|				case CA_SUNW_HW_1:
  ------------------
  |  |  425|  1.12k|#define	CA_SUNW_HW_1	1
  ------------------
  |  Branch (1637:5): [True: 1.12k, False: 5.23k]
  ------------------
 1638|  1.12k|					cap_hw1 |= xcap_val;
  ------------------
  |  |  246|  1.12k|#define xcap_val	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  1.12k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (246:19): [True: 511, False: 618]
  |  |  ------------------
  |  |  247|  1.12k|			 ? elf_getu32(swap, cap32.c_un.c_val)	\
  |  |  ------------------
  |  |  |  |  158|    511|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  248|  1.12k|			 : elf_getu64(swap, cap64.c_un.c_val))
  |  |  ------------------
  |  |  |  |  159|    618|#define elf_getu64(swap, value) getu64(swap, value)
  |  |  ------------------
  ------------------
 1639|  1.12k|					break;
 1640|  1.24k|				case CA_SUNW_SF_1:
  ------------------
  |  |  426|  1.24k|#define	CA_SUNW_SF_1	2
  ------------------
  |  Branch (1640:5): [True: 1.24k, False: 5.11k]
  ------------------
 1641|  1.24k|					cap_sf1 |= xcap_val;
  ------------------
  |  |  246|  1.24k|#define xcap_val	(clazz == ELFCLASS32			\
  |  |  ------------------
  |  |  |  |  153|  1.24k|#define	ELFCLASS32	1
  |  |  ------------------
  |  |  |  Branch (246:19): [True: 691, False: 554]
  |  |  ------------------
  |  |  247|  1.24k|			 ? elf_getu32(swap, cap32.c_un.c_val)	\
  |  |  ------------------
  |  |  |  |  158|    691|#define elf_getu32(swap, value) getu32(swap, value)
  |  |  ------------------
  |  |  248|  1.24k|			 : elf_getu64(swap, cap64.c_un.c_val))
  |  |  ------------------
  |  |  |  |  159|    554|#define elf_getu64(swap, value) getu64(swap, value)
  |  |  ------------------
  ------------------
 1642|  1.24k|					break;
 1643|  1.10k|				default:
  ------------------
  |  Branch (1643:5): [True: 1.10k, False: 5.25k]
  ------------------
 1644|  1.10k|					if (elf_printf(ms,
  ------------------
  |  Branch (1644:10): [True: 0, False: 1.10k]
  ------------------
 1645|  1.10k|					    ", with unknown capability "
 1646|  1.10k|					    "%#" INT64_T_FORMAT "x = %#"
 1647|  1.10k|					    INT64_T_FORMAT "x",
 1648|  1.10k|					    CAST(unsigned long long, xcap_tag),
  ------------------
  |  |  460|  2.20k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 583, False: 520]
  |  |  ------------------
  ------------------
 1649|  1.10k|					    CAST(unsigned long long, xcap_val))
  ------------------
  |  |  460|  2.20k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (460:25): [True: 583, False: 520]
  |  |  ------------------
  ------------------
 1650|  1.10k|					    == -1)
 1651|      0|						return -1;
 1652|  1.10k|					if (nbadcap++ > 2)
  ------------------
  |  Branch (1652:10): [True: 215, False: 888]
  ------------------
 1653|    215|						goto skip;
 1654|    888|					break;
 1655|  6.36k|				}
 1656|  6.36k|			}
 1657|       |			/*FALLTHROUGH*/
 1658|  1.82k|		skip:
 1659|  13.1k|		default:
  ------------------
  |  Branch (1659:3): [True: 11.3k, False: 4.40k]
  ------------------
 1660|  13.1k|			break;
 1661|  15.7k|		}
 1662|  15.7k|	}
 1663|       |
 1664|    237|	if (has_debug_info) {
  ------------------
  |  Branch (1664:6): [True: 1, False: 236]
  ------------------
 1665|      1|		if (elf_printf(ms, ", with debug_info") == -1)
  ------------------
  |  Branch (1665:7): [True: 0, False: 1]
  ------------------
 1666|      0|			return -1;
 1667|      1|	}
 1668|    237|	if (elf_printf(ms, ", %sstripped", stripped ? "" : "not ") == -1)
  ------------------
  |  Branch (1668:6): [True: 0, False: 237]
  |  Branch (1668:37): [True: 234, False: 3]
  ------------------
 1669|      0|		return -1;
 1670|    237|	if (cap_hw1) {
  ------------------
  |  Branch (1670:6): [True: 89, False: 148]
  ------------------
 1671|     89|		const cap_desc_t *cdp;
 1672|     89|		switch (mach) {
 1673|      1|		case EM_SPARC:
  ------------------
  |  |  133|      1|#define	EM_SPARC	2
  ------------------
  |  Branch (1673:3): [True: 1, False: 88]
  ------------------
 1674|      1|		case EM_SPARC32PLUS:
  ------------------
  |  |  135|      1|#define	EM_SPARC32PLUS	18
  ------------------
  |  Branch (1674:3): [True: 0, False: 89]
  ------------------
 1675|     81|		case EM_SPARCV9:
  ------------------
  |  |  136|     81|#define	EM_SPARCV9	43
  ------------------
  |  Branch (1675:3): [True: 80, False: 9]
  ------------------
 1676|     81|			cdp = cap_desc_sparc;
 1677|     81|			break;
 1678|      4|		case EM_386:
  ------------------
  |  |  134|      4|#define	EM_386		3
  ------------------
  |  Branch (1678:3): [True: 4, False: 85]
  ------------------
 1679|      5|		case EM_IA_64:
  ------------------
  |  |  137|      5|#define	EM_IA_64	50
  ------------------
  |  Branch (1679:3): [True: 1, False: 88]
  ------------------
 1680|      8|		case EM_AMD64:
  ------------------
  |  |  138|      8|#define	EM_AMD64	62
  ------------------
  |  Branch (1680:3): [True: 3, False: 86]
  ------------------
 1681|      8|			cdp = cap_desc_386;
 1682|      8|			break;
 1683|      0|		default:
  ------------------
  |  Branch (1683:3): [True: 0, False: 89]
  ------------------
 1684|      0|			cdp = NULL;
 1685|      0|			break;
 1686|     89|		}
 1687|     89|		if (elf_printf(ms, ", uses") == -1)
  ------------------
  |  Branch (1687:7): [True: 0, False: 89]
  ------------------
 1688|      0|			return -1;
 1689|     89|		if (cdp) {
  ------------------
  |  Branch (1689:7): [True: 89, False: 0]
  ------------------
 1690|  1.18k|			while (cdp->cd_name) {
  ------------------
  |  Branch (1690:11): [True: 1.09k, False: 89]
  ------------------
 1691|  1.09k|				if (cap_hw1 & cdp->cd_mask) {
  ------------------
  |  Branch (1691:9): [True: 628, False: 463]
  ------------------
 1692|    628|					if (elf_printf(ms,
  ------------------
  |  Branch (1692:10): [True: 0, False: 628]
  ------------------
 1693|    628|					    " %s", cdp->cd_name) == -1)
 1694|      0|						return -1;
 1695|    628|					cap_hw1 &= ~cdp->cd_mask;
 1696|    628|				}
 1697|  1.09k|				++cdp;
 1698|  1.09k|			}
 1699|     89|			if (cap_hw1)
  ------------------
  |  Branch (1699:8): [True: 84, False: 5]
  ------------------
 1700|     84|				if (elf_printf(ms,
  ------------------
  |  Branch (1700:9): [True: 0, False: 84]
  ------------------
 1701|     84|				    " unknown hardware capability %#"
 1702|     84|				    INT64_T_FORMAT "x",
 1703|     84|				    CAST(unsigned long long, cap_hw1)) == -1)
  ------------------
  |  |  460|     84|#define CAST(T, b)	((T)(b))
  ------------------
 1704|      0|					return -1;
 1705|     89|		} else {
 1706|      0|			if (elf_printf(ms,
  ------------------
  |  Branch (1706:8): [True: 0, False: 0]
  ------------------
 1707|      0|			    " hardware capability %#" INT64_T_FORMAT "x",
 1708|      0|			    CAST(unsigned long long, cap_hw1)) == -1)
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 1709|      0|				return -1;
 1710|      0|		}
 1711|     89|	}
 1712|    237|	if (cap_sf1) {
  ------------------
  |  Branch (1712:6): [True: 111, False: 126]
  ------------------
 1713|    111|		if (cap_sf1 & SF1_SUNW_FPUSED) {
  ------------------
  |  |  430|    111|#define	SF1_SUNW_FPUSED	0x02
  ------------------
  |  Branch (1713:7): [True: 44, False: 67]
  ------------------
 1714|     44|			if (elf_printf(ms,
  ------------------
  |  Branch (1714:8): [True: 0, False: 44]
  ------------------
 1715|     44|			    (cap_sf1 & SF1_SUNW_FPKNWN)
  ------------------
  |  |  429|     44|#define	SF1_SUNW_FPKNWN	0x01
  ------------------
  |  Branch (1715:8): [True: 32, False: 12]
  ------------------
 1716|     44|			    ? ", uses frame pointer"
 1717|     44|			    : ", not known to use frame pointer") == -1)
 1718|      0|				return -1;
 1719|     44|		}
 1720|    111|		cap_sf1 &= ~SF1_SUNW_MASK;
  ------------------
  |  |  431|    111|#define	SF1_SUNW_MASK	0x03
  ------------------
 1721|    111|		if (cap_sf1)
  ------------------
  |  Branch (1721:7): [True: 110, False: 1]
  ------------------
 1722|    110|			if (elf_printf(ms,
  ------------------
  |  Branch (1722:8): [True: 0, False: 110]
  ------------------
 1723|    110|			    ", with unknown software capability %#"
 1724|    110|			    INT64_T_FORMAT "x",
 1725|    110|			    CAST(unsigned long long, cap_sf1)) == -1)
  ------------------
  |  |  460|    110|#define CAST(T, b)	((T)(b))
  ------------------
 1726|      0|				return -1;
 1727|    111|	}
 1728|    237|	return 0;
 1729|    237|}
readelf.c:getu64:
  134|  77.7k|{
  135|  77.7k|	union {
  136|  77.7k|		uint64_t ui;
  137|  77.7k|		char c[8];
  138|  77.7k|	} retval, tmpval;
  139|       |
  140|  77.7k|	if (swap) {
  ------------------
  |  Branch (140:6): [True: 34.8k, False: 42.9k]
  ------------------
  141|  34.8k|		tmpval.ui = value;
  142|       |
  143|  34.8k|		retval.c[0] = tmpval.c[7];
  144|  34.8k|		retval.c[1] = tmpval.c[6];
  145|  34.8k|		retval.c[2] = tmpval.c[5];
  146|  34.8k|		retval.c[3] = tmpval.c[4];
  147|  34.8k|		retval.c[4] = tmpval.c[3];
  148|  34.8k|		retval.c[5] = tmpval.c[2];
  149|  34.8k|		retval.c[6] = tmpval.c[1];
  150|  34.8k|		retval.c[7] = tmpval.c[0];
  151|       |
  152|  34.8k|		return retval.ui;
  153|  34.8k|	} else
  154|  42.9k|		return value;
  155|  77.7k|}
readelf.c:elf_printf:
   72|  16.4k|{
   73|  16.4k|	va_list ap;
   74|  16.4k|	int rv;
   75|       |
   76|  16.4k|	if (ms->flags & MAGIC_MIME)
  ------------------
  |  |   44|  16.4k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  16.4k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  16.4k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (76:6): [True: 0, False: 16.4k]
  ------------------
   77|      0|		return 1;
   78|       |
   79|  16.4k|	va_start(ap, fmt);
   80|  16.4k|	rv = file_vprintf(ms, fmt, ap);
   81|       |	va_end(ap);
   82|  16.4k|	return rv;
   83|  16.4k|}

file_softmagic:
  130|  18.8k|{
  131|  18.8k|	struct mlist *ml;
  132|  18.8k|	int rv = 0, printed_something = 0, need_separator = 0, firstline = 1;
  133|  18.8k|	uint16_t nc, ic;
  134|       |
  135|  18.8k|	if (name_count == NULL) {
  ------------------
  |  Branch (135:6): [True: 18.8k, False: 0]
  ------------------
  136|  18.8k|		nc = 0;
  137|  18.8k|		name_count = &nc;
  138|  18.8k|	}
  139|  18.8k|	if (indir_count == NULL) {
  ------------------
  |  Branch (139:6): [True: 18.8k, False: 0]
  ------------------
  140|  18.8k|		ic = 0;
  141|  18.8k|		indir_count = &ic;
  142|  18.8k|	}
  143|       |
  144|  37.5k|	for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next) {
  ------------------
  |  Branch (144:32): [True: 18.8k, False: 18.6k]
  ------------------
  145|  18.8k|		int ret = match(ms, ml->magic, ml->magic_rxcomp, ml->nmagic, b,
  146|  18.8k|		    0, mode, text, 0, indir_count, name_count,
  147|  18.8k|		    &printed_something, &need_separator, &firstline,
  148|  18.8k|		    NULL, NULL);
  149|  18.8k|		switch (ret) {
  150|    197|		case -1:
  ------------------
  |  Branch (150:3): [True: 197, False: 18.6k]
  ------------------
  151|    197|			return ret;
  152|  5.69k|		case 0:
  ------------------
  |  Branch (152:3): [True: 5.69k, False: 13.1k]
  ------------------
  153|  5.69k|			continue;
  154|  12.9k|		default:
  ------------------
  |  Branch (154:3): [True: 12.9k, False: 5.89k]
  ------------------
  155|  12.9k|			if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|  12.9k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (155:8): [True: 0, False: 12.9k]
  ------------------
  156|      0|				return ret;
  157|  12.9k|			rv = ret;
  158|  12.9k|			break;
  159|  18.8k|		}
  160|  18.8k|	}
  161|       |
  162|  18.6k|	return rv;
  163|  18.8k|}
softmagic.c:match:
  222|   103k|{
  223|   103k|	uint32_t magindex = 0;
  224|   103k|	unsigned int cont_level = 0;
  225|   103k|	int found_matchv = 0; /* if a match is found it is set to 1*/
  226|   103k|	int returnvalv = 0, e;
  227|   103k|	struct buffer bb;
  228|   103k|	int print = (ms->flags & MAGIC_NODESC) == 0;
  ------------------
  |  |   52|   103k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|   103k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|   103k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|   103k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   103k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|   103k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  229|       |
  230|   103k|	(void)memset(&bb, 0, sizeof(bb));
  231|       |	/*
  232|       |	 * returnval can be 0 if a match is found, but there was no
  233|       |	 * annotation to be printed.
  234|       |	 */
  235|   103k|	if (returnval == NULL)
  ------------------
  |  Branch (235:6): [True: 37.3k, False: 65.7k]
  ------------------
  236|  37.3k|		returnval = &returnvalv;
  237|   103k|	if (found_match == NULL)
  ------------------
  |  Branch (237:6): [True: 37.3k, False: 65.7k]
  ------------------
  238|  37.3k|		found_match = &found_matchv;
  239|       |
  240|   103k|	if (file_check_mem(ms, cont_level) == -1)
  ------------------
  |  Branch (240:6): [True: 0, False: 103k]
  ------------------
  241|      0|		return -1;
  242|       |
  243|   144M|	for (magindex = 0; magindex < nmagic; magindex++) {
  ------------------
  |  Branch (243:21): [True: 144M, False: 99.9k]
  ------------------
  244|   144M|		int flush = 0;
  245|   144M|		struct magic *m = &magic[magindex];
  246|   144M|		file_regex_t **m_rxcomp = &magic_rxcomp[magindex];
  247|       |
  248|   144M|		if (m->type != FILE_NAME)
  ------------------
  |  |  298|   144M|#define				FILE_NAME		45
  ------------------
  |  Branch (248:7): [True: 144M, False: 65.7k]
  ------------------
  249|   144M|		if ((IS_STRING(m->type) &&
  ------------------
  |  |  318|   288M|	((t) == FILE_STRING || \
  |  |  ------------------
  |  |  |  |  258|   288M|#define				FILE_STRING		5
  |  |  ------------------
  |  |  |  Branch (318:3): [True: 87.5M, False: 56.4M]
  |  |  ------------------
  |  |  319|   144M|	 (t) == FILE_PSTRING || \
  |  |  ------------------
  |  |  |  |  266|   200M|#define				FILE_PSTRING		13
  |  |  ------------------
  |  |  |  Branch (319:3): [True: 36.9k, False: 56.4M]
  |  |  ------------------
  |  |  320|   144M|	 (t) == FILE_BESTRING16 || \
  |  |  ------------------
  |  |  |  |  271|   200M|#define				FILE_BESTRING16		18
  |  |  ------------------
  |  |  |  Branch (320:3): [True: 0, False: 56.4M]
  |  |  ------------------
  |  |  321|   144M|	 (t) == FILE_LESTRING16 || \
  |  |  ------------------
  |  |  |  |  272|   200M|#define				FILE_LESTRING16		19
  |  |  ------------------
  |  |  |  Branch (321:3): [True: 73.9k, False: 56.3M]
  |  |  ------------------
  |  |  322|   144M|	 (t) == FILE_REGEX || \
  |  |  ------------------
  |  |  |  |  270|   200M|#define				FILE_REGEX		17
  |  |  ------------------
  |  |  |  Branch (322:3): [True: 2.94M, False: 53.3M]
  |  |  ------------------
  |  |  323|   144M|	 (t) == FILE_SEARCH || \
  |  |  ------------------
  |  |  |  |  273|   197M|#define				FILE_SEARCH		20
  |  |  ------------------
  |  |  |  Branch (323:3): [True: 9.83M, False: 43.5M]
  |  |  ------------------
  |  |  324|   144M|	 (t) == FILE_INDIRECT || \
  |  |  ------------------
  |  |  |  |  294|   187M|#define				FILE_INDIRECT		41
  |  |  ------------------
  |  |  |  Branch (324:3): [True: 0, False: 43.5M]
  |  |  ------------------
  |  |  325|   144M|	 (t) == FILE_NAME || \
  |  |  ------------------
  |  |  |  |  298|   187M|#define				FILE_NAME		45
  |  |  ------------------
  |  |  |  Branch (325:3): [True: 0, False: 43.5M]
  |  |  ------------------
  |  |  326|   144M|	 (t) == FILE_USE || \
  |  |  ------------------
  |  |  |  |  299|   187M|#define				FILE_USE		46
  |  |  ------------------
  |  |  |  Branch (326:3): [True: 0, False: 43.5M]
  |  |  ------------------
  |  |  327|   288M|	 (t) == FILE_OCTAL)
  |  |  ------------------
  |  |  |  |  314|  43.5M|#define				FILE_OCTAL		61
  |  |  ------------------
  |  |  |  Branch (327:3): [True: 0, False: 43.5M]
  |  |  ------------------
  ------------------
  250|   100M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  251|   100M|		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  390|  14.9M|#define str_flags _u._s._flags
  ------------------
              		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  250|  14.9M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  410|  14.9M|#define STRING_BINTEST				BIT(6)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  14.9M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  409|  14.9M|#define STRING_TEXTTEST				BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  14.9M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  410|  14.9M|#define STRING_BINTEST				BIT(6)
  |  |  ------------------
  |  |  |  |  403|  14.9M|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (251:10): [True: 14.9M, False: 85.5M]
  |  Branch (251:18): [True: 596k, False: 14.3M]
  ------------------
  252|  99.8M|		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  390|  85.5M|#define str_flags _u._s._flags
  ------------------
              		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  250|  85.5M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  410|  85.5M|#define STRING_BINTEST				BIT(6)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  85.5M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  409|  85.5M|#define STRING_TEXTTEST				BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  85.5M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  409|  85.5M|#define STRING_TEXTTEST				BIT(5)
  |  |  ------------------
  |  |  |  |  403|  85.5M|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (252:10): [True: 85.5M, False: 14.3M]
  |  Branch (252:19): [True: 4.52M, False: 81.0M]
  ------------------
  253|   138M|		    (m->flag & mode) != mode) {
  ------------------
  |  Branch (253:7): [True: 18.6M, False: 120M]
  ------------------
  254|   143M|flush:
  255|       |			/* Skip sub-tests */
  256|   647M|			while (magindex < nmagic - 1 &&
  ------------------
  |  Branch (256:11): [True: 647M, False: 5.54k]
  ------------------
  257|   647M|			    magic[magindex + 1].cont_level != 0) {
  ------------------
  |  Branch (257:8): [True: 504M, False: 143M]
  ------------------
  258|   504M|				magindex++;
  259|   504M|			}
  260|   143M|			cont_level = 0;
  261|   143M|			continue; /* Skip to next top-level test*/
  262|  23.7M|		}
  263|       |
  264|   120M|		if (msetoffset(ms, m, &bb, b, offset, cont_level) == -1) {
  ------------------
  |  Branch (264:7): [True: 91.7k, False: 120M]
  ------------------
  265|  91.7k|			if (b->elen == FILE_BADSIZE)
  ------------------
  |  |  183|  91.7k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  91.7k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (265:8): [True: 0, False: 91.7k]
  ------------------
  266|      0|				continue;
  267|  91.7k|			else
  268|  91.7k|				goto flush;
  269|  91.7k|		}
  270|   120M|		ms->line = m->lineno;
  271|       |
  272|       |		/* if main entry matches, print it... */
  273|   120M|		switch (mget(ms, m, b, &bb, offset, cont_level,
  274|   120M|		    mode, text, flip, indir_count, name_count,
  275|   120M|		    printed_something, need_separator, firstline, returnval,
  276|   120M|		    found_match))
  277|   120M|		{
  278|     61|		case -1:
  ------------------
  |  Branch (278:3): [True: 61, False: 120M]
  ------------------
  279|     61|			return -1;
  280|  17.3M|		case 0:
  ------------------
  |  Branch (280:3): [True: 17.3M, False: 102M]
  ------------------
  281|  17.3M|			flush = m->reln != '!';
  282|  17.3M|			break;
  283|   102M|		default:
  ------------------
  |  Branch (283:3): [True: 102M, False: 17.3M]
  ------------------
  284|   102M|			if (m->type == FILE_INDIRECT) {
  ------------------
  |  |  294|   102M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (284:8): [True: 0, False: 102M]
  ------------------
  285|      0|				*found_match = 1;
  286|      0|				*returnval = 1;
  287|      0|			}
  288|       |
  289|   102M|			switch (magiccheck(ms, m, m_rxcomp)) {
  290|      0|			case -1:
  ------------------
  |  Branch (290:4): [True: 0, False: 102M]
  ------------------
  291|      0|				return -1;
  292|   102M|			case 0:
  ------------------
  |  Branch (292:4): [True: 102M, False: 472k]
  ------------------
  293|   102M|				flush++;
  294|   102M|				break;
  295|   472k|			default:
  ------------------
  |  Branch (295:4): [True: 472k, False: 102M]
  ------------------
  296|   472k|				flush = 0;
  297|   472k|				break;
  298|   102M|			}
  299|   102M|			break;
  300|   120M|		}
  301|   120M|		if (flush) {
  ------------------
  |  Branch (301:7): [True: 119M, False: 472k]
  ------------------
  302|       |			/*
  303|       |			 * main entry didn't match,
  304|       |			 * flush its continuations
  305|       |			 */
  306|   119M|			goto flush;
  307|   119M|		}
  308|       |
  309|   472k|		if ((e = handle_annotation(ms, m, *firstline)) != 0)
  ------------------
  |  Branch (309:7): [True: 0, False: 472k]
  ------------------
  310|      0|		{
  311|      0|			*found_match = 1;
  312|      0|			*need_separator = 1;
  313|      0|			*printed_something = 1;
  314|      0|			*returnval = 1;
  315|      0|			*firstline = 0;
  316|      0|			return e;
  317|      0|		}
  318|       |
  319|       |		/*
  320|       |		 * If we are going to print something, we'll need to print
  321|       |		 * a blank before we print something else.
  322|       |		 */
  323|   472k|		if (*m->desc) {
  ------------------
  |  Branch (323:7): [True: 30.5k, False: 442k]
  ------------------
  324|  30.5k|			*found_match = 1;
  325|  30.5k|			if (print) {
  ------------------
  |  Branch (325:8): [True: 30.5k, False: 0]
  ------------------
  326|  30.5k|				*returnval = 1;
  327|  30.5k|				*need_separator = 1;
  328|  30.5k|				*printed_something = 1;
  329|  30.5k|				if (print_sep(ms, *firstline) == -1)
  ------------------
  |  Branch (329:9): [True: 0, False: 30.5k]
  ------------------
  330|      0|					return -1;
  331|  30.5k|				if (mprint(ms, m) == -1)
  ------------------
  |  Branch (331:9): [True: 0, False: 30.5k]
  ------------------
  332|      0|					return -1;
  333|  30.5k|			}
  334|  30.5k|		}
  335|       |
  336|   472k|		switch (moffset(ms, m, bb.flen, offset,
  337|   472k|		    &ms->c.li[cont_level].off)) {
  338|  26.1k|		case -1:
  ------------------
  |  Branch (338:3): [True: 26.1k, False: 446k]
  ------------------
  339|  26.1k|		case 0:
  ------------------
  |  Branch (339:3): [True: 0, False: 472k]
  ------------------
  340|  26.1k|			goto flush;
  341|   446k|		default:
  ------------------
  |  Branch (341:3): [True: 446k, False: 26.1k]
  ------------------
  342|   446k|			break;
  343|   472k|		}
  344|       |
  345|       |		/* and any continuations that match */
  346|   446k|		if (file_check_mem(ms, ++cont_level) == -1)
  ------------------
  |  Branch (346:7): [True: 0, False: 446k]
  ------------------
  347|      0|			return -1;
  348|       |
  349|  7.32M|		while (magindex + 1 < nmagic &&
  ------------------
  |  Branch (349:10): [True: 7.22M, False: 94.3k]
  ------------------
  350|  7.22M|		    magic[magindex + 1].cont_level != 0) {
  ------------------
  |  Branch (350:7): [True: 6.87M, False: 348k]
  ------------------
  351|  6.87M|			m = &magic[++magindex];
  352|  6.87M|			m_rxcomp = &magic_rxcomp[magindex];
  353|  6.87M|			ms->line = m->lineno; /* for messages */
  354|       |
  355|  6.87M|			if (cont_level < m->cont_level)
  ------------------
  |  Branch (355:8): [True: 5.03M, False: 1.84M]
  ------------------
  356|  5.03M|				continue;
  357|  1.84M|			if (cont_level > m->cont_level) {
  ------------------
  |  Branch (357:8): [True: 145k, False: 1.70M]
  ------------------
  358|       |				/*
  359|       |				 * We're at the end of the level
  360|       |				 * "cont_level" continuations.
  361|       |				 */
  362|   145k|				cont_level = m->cont_level;
  363|   145k|			}
  364|  1.84M|			if (msetoffset(ms, m, &bb, b, offset, cont_level)
  ------------------
  |  Branch (364:8): [True: 116, False: 1.84M]
  ------------------
  365|  1.84M|			    == -1) {
  366|    116|				if (b->elen == FILE_BADSIZE)
  ------------------
  |  |  183|    116|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|    116|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (366:9): [True: 0, False: 116]
  ------------------
  367|      0|					continue;
  368|    116|				else
  369|    116|					goto flush;
  370|    116|			}
  371|  1.84M|			if (m->flag & OFFADD) {
  ------------------
  |  |  235|  1.84M|#define OFFADD		0x02	/* if '>&' or '>...(&' appears */
  ------------------
  |  Branch (371:8): [True: 120k, False: 1.72M]
  ------------------
  372|   120k|				if (cont_level == 0) {
  ------------------
  |  Branch (372:9): [True: 0, False: 120k]
  ------------------
  373|      0|					if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (373:10): [True: 0, False: 0]
  ------------------
  374|      0|						fprintf(stderr,
  375|      0|						    "direct *zero*"
  376|      0|						    " cont_level\n");
  377|      0|					return 0;
  378|      0|				}
  379|   120k|				ms->offset +=
  380|   120k|				    ms->c.li[cont_level - 1].off;
  381|   120k|			}
  382|       |
  383|  1.84M|#ifdef ENABLE_CONDITIONALS
  384|  1.84M|			if (m->cond == COND_ELSE ||
  ------------------
  |  |  371|  3.69M|#define				COND_ELSE	3
  ------------------
  |  Branch (384:8): [True: 0, False: 1.84M]
  ------------------
  385|  1.84M|			    m->cond == COND_ELIF) {
  ------------------
  |  |  370|  1.84M|#define				COND_ELIF	2
  ------------------
  |  Branch (385:8): [True: 0, False: 1.84M]
  ------------------
  386|      0|				if (ms->c.li[cont_level].last_match == 1)
  ------------------
  |  Branch (386:9): [True: 0, False: 0]
  ------------------
  387|      0|					continue;
  388|      0|			}
  389|  1.84M|#endif
  390|  1.84M|			switch (mget(ms, m, b, &bb, offset,
  391|  1.84M|			    cont_level, mode, text, flip, indir_count,
  392|  1.84M|			    name_count, printed_something, need_separator,
  393|  1.84M|			    firstline, returnval, found_match)) {
  394|  3.14k|			case -1:
  ------------------
  |  Branch (394:4): [True: 3.14k, False: 1.84M]
  ------------------
  395|  3.14k|				return -1;
  396|   111k|			case 0:
  ------------------
  |  Branch (396:4): [True: 111k, False: 1.73M]
  ------------------
  397|   111k|				if (m->reln != '!')
  ------------------
  |  Branch (397:9): [True: 108k, False: 2.79k]
  ------------------
  398|   108k|					continue;
  399|  2.79k|				flush = 1;
  400|  2.79k|				break;
  401|  1.73M|			default:
  ------------------
  |  Branch (401:4): [True: 1.73M, False: 114k]
  ------------------
  402|  1.73M|				if (m->type == FILE_INDIRECT) {
  ------------------
  |  |  294|  1.73M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (402:9): [True: 14.4k, False: 1.71M]
  ------------------
  403|  14.4k|					*found_match = 1;
  404|  14.4k|					*returnval = 1;
  405|  14.4k|				}
  406|  1.73M|				flush = 0;
  407|  1.73M|				break;
  408|  1.84M|			}
  409|       |
  410|  1.73M|			switch (flush ? 1 : magiccheck(ms, m, m_rxcomp)) {
  ------------------
  |  Branch (410:12): [True: 2.79k, False: 1.73M]
  ------------------
  411|      0|			case -1:
  ------------------
  |  Branch (411:4): [True: 0, False: 1.73M]
  ------------------
  412|      0|				return -1;
  413|  1.30M|			case 0:
  ------------------
  |  Branch (413:4): [True: 1.30M, False: 432k]
  ------------------
  414|  1.30M|#ifdef ENABLE_CONDITIONALS
  415|  1.30M|				ms->c.li[cont_level].last_match = 0;
  416|  1.30M|#endif
  417|  1.30M|				break;
  418|   432k|			default:
  ------------------
  |  Branch (418:4): [True: 432k, False: 1.30M]
  ------------------
  419|   432k|#ifdef ENABLE_CONDITIONALS
  420|   432k|				ms->c.li[cont_level].last_match = 1;
  421|   432k|#endif
  422|   432k|				if (m->type == FILE_CLEAR)
  ------------------
  |  |  300|   432k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (422:9): [True: 3.52k, False: 429k]
  ------------------
  423|  3.52k|					ms->c.li[cont_level].got_match = 0;
  424|   429k|				else if (ms->c.li[cont_level].got_match) {
  ------------------
  |  Branch (424:14): [True: 101k, False: 327k]
  ------------------
  425|   101k|					if (m->type == FILE_DEFAULT)
  ------------------
  |  |  256|   101k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (425:10): [True: 2.55k, False: 99.0k]
  ------------------
  426|  2.55k|						break;
  427|   101k|				} else
  428|   327k|					ms->c.li[cont_level].got_match = 1;
  429|       |
  430|   430k|				if ((e = handle_annotation(ms, m, *firstline))
  ------------------
  |  Branch (430:9): [True: 0, False: 430k]
  ------------------
  431|   430k|				    != 0) {
  432|      0|					*found_match = 1;
  433|      0|					*need_separator = 1;
  434|      0|					*printed_something = 1;
  435|      0|					*returnval = 1;
  436|      0|					*firstline = 0;
  437|      0|					return e;
  438|      0|				}
  439|   430k|				if (*m->desc) {
  ------------------
  |  Branch (439:9): [True: 132k, False: 297k]
  ------------------
  440|   132k|					*found_match = 1;
  441|   132k|				}
  442|   430k|				if (print && *m->desc) {
  ------------------
  |  Branch (442:9): [True: 430k, False: 0]
  |  Branch (442:18): [True: 132k, False: 297k]
  ------------------
  443|   132k|					*returnval = 1;
  444|       |					/*
  445|       |					 * This continuation matched.  Print
  446|       |					 * its message, with a blank before it
  447|       |					 * if the previous item printed and
  448|       |					 * this item isn't empty.
  449|       |					 */
  450|       |					/*
  451|       |					 * If we are going to print something,
  452|       |					 * make sure that we have a separator
  453|       |					 * first.
  454|       |					 */
  455|   132k|					if (!*printed_something) {
  ------------------
  |  Branch (455:10): [True: 24.4k, False: 107k]
  ------------------
  456|  24.4k|						*printed_something = 1;
  457|  24.4k|						if (print_sep(ms, *firstline)
  ------------------
  |  Branch (457:11): [True: 0, False: 24.4k]
  ------------------
  458|  24.4k|						    == -1)
  459|      0|							return -1;
  460|  24.4k|					}
  461|       |					/* space if previous printed */
  462|   132k|					if (*need_separator
  ------------------
  |  Branch (462:10): [True: 124k, False: 7.83k]
  ------------------
  463|   124k|					    && (m->flag & NOSPACE) == 0) {
  ------------------
  |  |  238|   124k|#define NOSPACE		0x10	/* suppress space character before output */
  ------------------
  |  Branch (463:13): [True: 52.8k, False: 71.5k]
  ------------------
  464|  52.8k|						if (file_printf(ms, " ") == -1)
  ------------------
  |  Branch (464:11): [True: 0, False: 52.8k]
  ------------------
  465|      0|							return -1;
  466|  52.8k|					}
  467|   132k|					if (mprint(ms, m) == -1)
  ------------------
  |  Branch (467:10): [True: 0, False: 132k]
  ------------------
  468|      0|						return -1;
  469|   132k|					*need_separator = 1;
  470|   132k|				}
  471|       |
  472|   430k|				switch (moffset(ms, m, bb.flen, offset,
  473|   430k|				    &ms->c.li[cont_level].off)) {
  474|  6.44k|				case -1:
  ------------------
  |  Branch (474:5): [True: 6.44k, False: 423k]
  ------------------
  475|  6.44k|				case 0:
  ------------------
  |  Branch (475:5): [True: 0, False: 430k]
  ------------------
  476|  6.44k|					cont_level--;
  477|  6.44k|					break;
  478|   423k|				default:
  ------------------
  |  Branch (478:5): [True: 423k, False: 6.44k]
  ------------------
  479|   423k|					break;
  480|   430k|				}
  481|       |
  482|       |				/*
  483|       |				 * If we see any continuations
  484|       |				 * at a higher level,
  485|       |				 * process them.
  486|       |				 */
  487|   430k|				if (file_check_mem(ms, ++cont_level) == -1)
  ------------------
  |  Branch (487:9): [True: 0, False: 430k]
  ------------------
  488|      0|					return -1;
  489|   430k|				break;
  490|  1.73M|			}
  491|  1.73M|		}
  492|   443k|		if (*printed_something) {
  ------------------
  |  Branch (492:7): [True: 115k, False: 327k]
  ------------------
  493|   115k|			*firstline = 0;
  494|   115k|		}
  495|   443k|		if (*found_match) {
  ------------------
  |  Branch (495:7): [True: 303k, False: 139k]
  ------------------
  496|   303k|			if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|   303k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (496:8): [True: 0, False: 303k]
  ------------------
  497|      0|				return *returnval;
  498|       |			// So that we print a separator
  499|   303k|			*printed_something = 0;
  500|   303k|			*firstline = 0;
  501|   303k|		}
  502|   443k|		cont_level = 0;
  503|   443k|	}
  504|  99.9k|	return *returnval;
  505|   103k|}
softmagic.c:msetoffset:
 1571|   122M|{
 1572|   122M|	int32_t offset;
 1573|   122M|	if (m->flag & OFFNEGATIVE) {
  ------------------
  |  |  242|   122M|#define OFFNEGATIVE	0x80	/* relative to the end of file */
  ------------------
  |  Branch (1573:6): [True: 361k, False: 121M]
  ------------------
 1574|   361k|		offset = -m->offset;
 1575|   361k|		if (cont_level > 0) {
  ------------------
  |  Branch (1575:7): [True: 16.6k, False: 344k]
  ------------------
 1576|  16.6k|			if (m->flag & (OFFADD|INDIROFFADD))
  ------------------
  |  |  235|  16.6k|#define OFFADD		0x02	/* if '>&' or '>...(&' appears */
  ------------------
              			if (m->flag & (OFFADD|INDIROFFADD))
  ------------------
  |  |  236|  16.6k|#define INDIROFFADD	0x04	/* if '>&(' appears */
  ------------------
  |  Branch (1576:8): [True: 11.2k, False: 5.39k]
  ------------------
 1577|  11.2k|				goto normal;
 1578|       |#if 0
 1579|       |			file_error(ms, 0, "negative offset %d at continuation"
 1580|       |			    "level %u", m->offset, cont_level);
 1581|       |			return -1;
 1582|       |#endif
 1583|  16.6k|		}
 1584|   350k|		if (buffer_fill(b) == -1)
  ------------------
  |  Branch (1584:7): [True: 0, False: 350k]
  ------------------
 1585|      0|			return -1;
 1586|   350k|		if (o != 0) {
  ------------------
  |  Branch (1586:7): [True: 38, False: 349k]
  ------------------
 1587|       |			// Not yet!
 1588|     38|			file_magerror(ms, "non zero offset %" SIZE_T_FORMAT
 1589|     38|			    "u at level %u", o, cont_level);
 1590|     38|			return -1;
 1591|     38|		}
 1592|   349k|		if (b->fd == -1) {
  ------------------
  |  Branch (1592:7): [True: 113k, False: 236k]
  ------------------
 1593|   113k|			if (CAST(size_t, m->offset) > b->flen)
  ------------------
  |  |  460|   113k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1593:8): [True: 18.0k, False: 95.2k]
  ------------------
 1594|  18.0k|				return -1;
 1595|  95.2k|			ms->eoffset = ms->offset =
 1596|  95.2k|			    CAST(int32_t, b->flen - m->offset);
  ------------------
  |  |  460|  95.2k|#define CAST(T, b)	((T)(b))
  ------------------
 1597|   236k|		} else {
 1598|   236k|			if (CAST(size_t, m->offset) > b->elen)
  ------------------
  |  |  460|   236k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1598:8): [True: 73.7k, False: 162k]
  ------------------
 1599|  73.7k|				return -1;
 1600|   162k|			buffer_init(bb, -1, NULL, b->ebuf, b->elen);
 1601|   162k|			ms->eoffset = ms->offset =
 1602|   162k|			    CAST(int32_t, b->elen - m->offset);
  ------------------
  |  |  460|   162k|#define CAST(T, b)	((T)(b))
  ------------------
 1603|   162k|		}
 1604|   121M|	} else {
 1605|   121M|		offset = m->offset;
 1606|   121M|		if ((m->flag & OFFPOSITIVE) || cont_level == 0) {
  ------------------
  |  |  243|   121M|#define OFFPOSITIVE	0x100	/* relative to the beginning of file */
  ------------------
  |  Branch (1606:7): [True: 87, False: 121M]
  |  Branch (1606:34): [True: 120M, False: 1.82M]
  ------------------
 1607|   120M|normal:
 1608|       |			// XXX: Pass real fd, then who frees bb?
 1609|   120M|			buffer_init(bb, -1, NULL, b->fbuf, b->flen);
 1610|   120M|			ms->offset = offset;
 1611|   120M|			ms->eoffset = 0;
 1612|   120M|		} else {
 1613|  1.82M|			ms->offset = ms->eoffset + offset;
 1614|  1.82M|		}
 1615|   121M|	}
 1616|   122M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   122M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1616:6): [True: 0, False: 122M]
  ------------------
 1617|       |		fprintf(stderr, "bb=[%p,%" SIZE_T_FORMAT "u,%"
 1618|      0|		    SIZE_T_FORMAT "u], %d [b=%p,%"
 1619|      0|		    SIZE_T_FORMAT "u,%" SIZE_T_FORMAT "u], [o=%#x, c=%d]\n",
 1620|      0|		    bb->fbuf, bb->flen, bb->elen, ms->offset, b->fbuf,
 1621|      0|		    b->flen, b->elen, offset, cont_level);
 1622|      0|	}
 1623|   122M|	return 0;
 1624|   122M|}
softmagic.c:mget:
 1654|   122M|{
 1655|   122M|	uint32_t eoffset, offset = ms->offset;
 1656|   122M|	struct buffer sbb;
 1657|   122M|	intmax_t lhs;
 1658|   122M|	file_pushbuf_t *pb;
 1659|   122M|	int rv, oneed_separator, in_type, nfound_match;
 1660|   122M|	char *rbuf;
 1661|   122M|	union VALUETYPE *p = &ms->ms_value;
 1662|   122M|	struct mlist ml, *mlp;
 1663|   122M|	struct cont c;
 1664|   122M|	const unsigned char *s = CAST(const unsigned char *, bb->fbuf);
  ------------------
  |  |  460|   122M|#define CAST(T, b)	((T)(b))
  ------------------
 1665|   122M|	size_t nbytes = bb->flen;
 1666|       |
 1667|   122M|	if (*indir_count >= ms->indir_max) {
  ------------------
  |  Branch (1667:6): [True: 57, False: 122M]
  ------------------
 1668|     57|		file_error(ms, 0, "indirect count (%hu) exceeded",
 1669|     57|		    *indir_count);
 1670|     57|		return -1;
 1671|     57|	}
 1672|       |
 1673|   122M|	if (*name_count >= ms->name_max) {
  ------------------
  |  Branch (1673:6): [True: 4, False: 122M]
  ------------------
 1674|      4|		file_error(ms, 0, "name use count (%hu) exceeded",
 1675|      4|		    *name_count);
 1676|      4|		return -1;
 1677|      4|	}
 1678|       |
 1679|       |
 1680|   122M|	if (mcopy(ms, p, m->type, m->flag & INDIR, s,
  ------------------
  |  |  234|   122M|#define INDIR		0x01	/* if '(...)' appears */
  ------------------
  |  Branch (1680:6): [True: 0, False: 122M]
  ------------------
 1681|   122M|	    CAST(uint32_t, offset + o), CAST(uint32_t, nbytes), m) == -1)
  ------------------
  |  |  460|   122M|#define CAST(T, b)	((T)(b))
  ------------------
              	    CAST(uint32_t, offset + o), CAST(uint32_t, nbytes), m) == -1)
  ------------------
  |  |  460|   122M|#define CAST(T, b)	((T)(b))
  ------------------
 1682|      0|		return -1;
 1683|       |
 1684|   122M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   122M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1684:6): [True: 0, False: 122M]
  ------------------
 1685|      0|		fprintf(stderr, "mget(type=%d, flag=%#x, offset=%u, o=%"
 1686|      0|		    SIZE_T_FORMAT "u, " "nbytes=%" SIZE_T_FORMAT
 1687|      0|		    "u, il=%hu, nc=%hu)\n",
 1688|      0|		    m->type, m->flag, offset, o, nbytes,
 1689|      0|		    *indir_count, *name_count);
 1690|      0|		mdebug(offset, RCAST(char *, RCAST(void *, p)),
  ------------------
  |  |  461|      0|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1691|      0|		    sizeof(union VALUETYPE));
 1692|      0|#ifndef COMPILE_ONLY
 1693|      0|		file_mdump(m);
 1694|      0|#endif
 1695|      0|	}
 1696|       |
 1697|   122M|	if (m->flag & INDIR) {
  ------------------
  |  |  234|   122M|#define INDIR		0x01	/* if '(...)' appears */
  ------------------
  |  Branch (1697:6): [True: 873k, False: 121M]
  ------------------
 1698|   873k|		intmax_t off = m->in_offset;
 1699|   873k|		const int sgn = m->in_op & FILE_OPSIGNED;
  ------------------
  |  |  363|   873k|#define				FILE_OPSIGNED	0x20
  ------------------
 1700|   873k|		if (m->in_op & FILE_OPINDIRECT) {
  ------------------
  |  |  365|   873k|#define				FILE_OPINDIRECT	0x80
  ------------------
  |  Branch (1700:7): [True: 1.14k, False: 872k]
  ------------------
 1701|  1.14k|			uint8_t *hb;
 1702|  1.14k|			uint16_t hs;
 1703|  1.14k|			uint32_t hl;
 1704|  1.14k|			int op;
 1705|       |
 1706|  1.14k|			if (offset_oob(nbytes, offset + off, 0))
  ------------------
  |  Branch (1706:8): [True: 205, False: 941]
  ------------------
 1707|    205|				return 0;
 1708|    941|			hb = CCAST(uint8_t *, s + offset + off);
  ------------------
  |  |  462|    941|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1709|    941|			switch (op = cvt_flip(m->in_type, flip)) {
 1710|      0|			case FILE_BYTE:
  ------------------
  |  |  254|      0|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1710:4): [True: 0, False: 941]
  ------------------
 1711|      0|				if (offset_oob(nbytes, offset + off, 1))
  ------------------
  |  Branch (1711:9): [True: 0, False: 0]
  ------------------
 1712|      0|					return 0;
 1713|      0|				off = SEXT(sgn,8,hb[0]);
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1714|      0|				break;
 1715|      0|			case FILE_SHORT:
  ------------------
  |  |  255|      0|#define				FILE_SHORT		2
  ------------------
  |  Branch (1715:4): [True: 0, False: 941]
  ------------------
 1716|      0|				if (offset_oob(nbytes, offset + off, 2))
  ------------------
  |  Branch (1716:9): [True: 0, False: 0]
  ------------------
 1717|      0|					return 0;
 1718|      0|				memcpy(&hs, hb, sizeof(hs));
 1719|      0|				off = SEXT(sgn,16,hs);
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1720|      0|				break;
 1721|      0|			case FILE_BESHORT:
  ------------------
  |  |  260|      0|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1721:4): [True: 0, False: 941]
  ------------------
 1722|      0|				if (offset_oob(nbytes, offset + off, 2))
  ------------------
  |  Branch (1722:9): [True: 0, False: 0]
  ------------------
 1723|      0|					return 0;
 1724|      0|				off = SEXT(sgn,16,BE16(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1725|      0|				break;
 1726|      0|			case FILE_LESHORT:
  ------------------
  |  |  263|      0|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1726:4): [True: 0, False: 941]
  ------------------
 1727|      0|				if (offset_oob(nbytes, offset + off, 2))
  ------------------
  |  Branch (1727:9): [True: 0, False: 0]
  ------------------
 1728|      0|					return 0;
 1729|      0|				off = SEXT(sgn,16,LE16(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1730|      0|				break;
 1731|      0|			case FILE_LONG:
  ------------------
  |  |  257|      0|#define				FILE_LONG		4
  ------------------
  |  Branch (1731:4): [True: 0, False: 941]
  ------------------
 1732|      0|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1732:9): [True: 0, False: 0]
  ------------------
 1733|      0|					return 0;
 1734|      0|				memcpy(&hl, hb, sizeof(hl));
 1735|      0|				off = SEXT(sgn,32,hl);
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1736|      0|				break;
 1737|      0|			case FILE_BELONG:
  ------------------
  |  |  261|      0|#define				FILE_BELONG		8
  ------------------
  |  Branch (1737:4): [True: 0, False: 941]
  ------------------
 1738|      0|			case FILE_BEID3:
  ------------------
  |  |  292|      0|#define				FILE_BEID3		39
  ------------------
  |  Branch (1738:4): [True: 0, False: 941]
  ------------------
 1739|      0|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1739:9): [True: 0, False: 0]
  ------------------
 1740|      0|					return 0;
 1741|      0|				off = SEXT(sgn,32,BE32(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1742|      0|				break;
 1743|      0|			case FILE_LEID3:
  ------------------
  |  |  293|      0|#define				FILE_LEID3		40
  ------------------
  |  Branch (1743:4): [True: 0, False: 941]
  ------------------
 1744|    941|			case FILE_LELONG:
  ------------------
  |  |  264|    941|#define				FILE_LELONG		11
  ------------------
  |  Branch (1744:4): [True: 941, False: 0]
  ------------------
 1745|    941|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1745:9): [True: 223, False: 718]
  ------------------
 1746|    223|					return 0;
 1747|    718|				off = SEXT(sgn,32,LE32(hb));
  ------------------
  |  |  108|    718|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 718]
  |  |  ------------------
  |  |  109|    718|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    718|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    718|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1748|    718|				break;
 1749|      0|			case FILE_MELONG:
  ------------------
  |  |  276|      0|#define				FILE_MELONG		23
  ------------------
  |  Branch (1749:4): [True: 0, False: 941]
  ------------------
 1750|      0|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1750:9): [True: 0, False: 0]
  ------------------
 1751|      0|					return 0;
 1752|      0|				off = SEXT(sgn,32,ME32(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1753|      0|				break;
 1754|      0|			case FILE_BEQUAD:
  ------------------
  |  |  279|      0|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1754:4): [True: 0, False: 941]
  ------------------
 1755|      0|				if (offset_oob(nbytes, offset + off, 8))
  ------------------
  |  Branch (1755:9): [True: 0, False: 0]
  ------------------
 1756|      0|					return 0;
 1757|      0|				off = SEXT(sgn,64,BE64(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1758|      0|				break;
 1759|      0|			case FILE_LEQUAD:
  ------------------
  |  |  278|      0|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1759:4): [True: 0, False: 941]
  ------------------
 1760|      0|				if (offset_oob(nbytes, offset + off, 8))
  ------------------
  |  Branch (1760:9): [True: 0, False: 0]
  ------------------
 1761|      0|					return 0;
 1762|      0|				off = SEXT(sgn,64,LE64(hb));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1763|      0|				break;
 1764|      0|			case FILE_OCTAL:
  ------------------
  |  |  314|      0|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1764:4): [True: 0, False: 941]
  ------------------
 1765|      0|				if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1765:9): [True: 0, False: 0]
  ------------------
 1766|      0|					return 0;
 1767|      0|				p->s[sizeof(p->s) - 1] = '\0';
 1768|      0|				off = SEXT(sgn,64,strtoull(p->s, NULL, 8));
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1769|      0|				break;
 1770|      0|			default:
  ------------------
  |  Branch (1770:4): [True: 0, False: 941]
  ------------------
 1771|      0|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1771:9): [True: 0, False: 0]
  ------------------
 1772|      0|					fprintf(stderr, "bad op=%d\n", op);
 1773|      0|				return 0;
 1774|    941|			}
 1775|    718|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    718|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1775:8): [True: 0, False: 718]
  ------------------
 1776|      0|				fprintf(stderr, "indirect offs=%jd\n", off);
 1777|    718|		}
 1778|   872k|		switch (in_type = cvt_flip(m->in_type, flip)) {
 1779|  32.2k|		case FILE_BYTE:
  ------------------
  |  |  254|  32.2k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1779:3): [True: 32.2k, False: 840k]
  ------------------
 1780|  32.2k|			if (offset_oob(nbytes, offset, 1))
  ------------------
  |  Branch (1780:8): [True: 37, False: 32.2k]
  ------------------
 1781|     37|				return 0;
 1782|  32.2k|			if (do_ops(ms, m, &offset, SEXT(sgn,8,p->b), off))
  ------------------
  |  |  108|  32.2k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 32.2k]
  |  |  ------------------
  |  |  109|  32.2k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  32.2k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  32.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1782:8): [True: 0, False: 32.2k]
  ------------------
 1783|      0|				return 0;
 1784|  32.2k|			break;
 1785|  32.2k|		case FILE_BESHORT:
  ------------------
  |  |  260|  27.2k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1785:3): [True: 27.2k, False: 845k]
  ------------------
 1786|  27.2k|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1786:8): [True: 250, False: 26.9k]
  ------------------
 1787|    250|				return 0;
 1788|  26.9k|			if (do_ops(ms, m, &offset, SEXT(sgn,16,BE16(p->hs)), off))
  ------------------
  |  |  108|  26.9k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 26.9k]
  |  |  ------------------
  |  |  109|  26.9k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  26.9k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  26.9k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1788:8): [True: 0, False: 26.9k]
  ------------------
 1789|      0|				return 0;
 1790|  26.9k|			break;
 1791|  26.9k|		case FILE_LESHORT:
  ------------------
  |  |  263|  11.6k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1791:3): [True: 11.6k, False: 861k]
  ------------------
 1792|  11.6k|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1792:8): [True: 1.02k, False: 10.5k]
  ------------------
 1793|  1.02k|				return 0;
 1794|  10.5k|			if (do_ops(ms, m, &offset, SEXT(sgn,16,LE16(p->hs)), off))
  ------------------
  |  |  108|  10.5k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 10.5k]
  |  |  ------------------
  |  |  109|  10.5k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  10.5k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  10.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1794:8): [True: 0, False: 10.5k]
  ------------------
 1795|      0|				return 0;
 1796|  10.5k|			break;
 1797|  10.5k|		case FILE_SHORT:
  ------------------
  |  |  255|      0|#define				FILE_SHORT		2
  ------------------
  |  Branch (1797:3): [True: 0, False: 872k]
  ------------------
 1798|      0|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1798:8): [True: 0, False: 0]
  ------------------
 1799|      0|				return 0;
 1800|      0|			if (do_ops(ms, m, &offset, SEXT(sgn,16,p->h), off))
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1800:8): [True: 0, False: 0]
  ------------------
 1801|      0|				return 0;
 1802|      0|			break;
 1803|  7.54k|		case FILE_BELONG:
  ------------------
  |  |  261|  7.54k|#define				FILE_BELONG		8
  ------------------
  |  Branch (1803:3): [True: 7.54k, False: 865k]
  ------------------
 1804|  7.72k|		case FILE_BEID3:
  ------------------
  |  |  292|  7.72k|#define				FILE_BEID3		39
  ------------------
  |  Branch (1804:3): [True: 181, False: 872k]
  ------------------
 1805|  7.72k|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1805:8): [True: 156, False: 7.56k]
  ------------------
 1806|    156|				return 0;
 1807|  7.56k|			lhs = BE32(p->hl);
  ------------------
  |  |   95|  7.56k|#define BE32(p) ( \
  |  |   96|  7.56k|    (CAST(uint32_t, (p)[0])<<24)| \
  |  |  ------------------
  |  |  |  |  460|  7.56k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   97|  7.56k|    (CAST(uint32_t, (p)[1])<<16)| \
  |  |  ------------------
  |  |  |  |  460|  7.56k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   98|  7.56k|    (CAST(uint32_t, (p)[2])<<8)| \
  |  |  ------------------
  |  |  |  |  460|  7.56k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   99|  7.56k|    (CAST(uint32_t, (p)[3])))
  |  |  ------------------
  |  |  |  |  460|  7.56k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1808|  7.56k|			if (in_type == FILE_BEID3)
  ------------------
  |  |  292|  7.56k|#define				FILE_BEID3		39
  ------------------
  |  Branch (1808:8): [True: 139, False: 7.42k]
  ------------------
 1809|    139|				lhs = cvt_id3(ms, CAST(uint32_t, lhs));
  ------------------
  |  |  460|    139|#define CAST(T, b)	((T)(b))
  ------------------
 1810|  7.56k|			if (do_ops(ms, m, &offset, SEXT(sgn,32,lhs), off))
  ------------------
  |  |  108|  7.56k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 7.56k]
  |  |  ------------------
  |  |  109|  7.56k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  7.56k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  7.56k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1810:8): [True: 536, False: 7.03k]
  ------------------
 1811|    536|				return 0;
 1812|  7.03k|			break;
 1813|   789k|		case FILE_LELONG:
  ------------------
  |  |  264|   789k|#define				FILE_LELONG		11
  ------------------
  |  Branch (1813:3): [True: 789k, False: 83.5k]
  ------------------
 1814|   789k|		case FILE_LEID3:
  ------------------
  |  |  293|   789k|#define				FILE_LEID3		40
  ------------------
  |  Branch (1814:3): [True: 0, False: 872k]
  ------------------
 1815|   789k|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1815:8): [True: 299k, False: 489k]
  ------------------
 1816|   299k|				return 0;
 1817|   489k|			lhs = LE32(p->hl);
  ------------------
  |  |   90|   489k|#define LE32(p) ( \
  |  |   91|   489k|    (CAST(uint32_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  460|   489k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   92|   489k|    (CAST(uint32_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  460|   489k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   93|   489k|    (CAST(uint32_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  460|   489k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   94|   489k|    (CAST(uint32_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  460|   489k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1818|   489k|			if (in_type == FILE_LEID3)
  ------------------
  |  |  293|   489k|#define				FILE_LEID3		40
  ------------------
  |  Branch (1818:8): [True: 0, False: 489k]
  ------------------
 1819|      0|				lhs = cvt_id3(ms, CAST(uint32_t, lhs));
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 1820|   489k|			if (do_ops(ms, m, &offset, SEXT(sgn,32,lhs), off))
  ------------------
  |  |  108|   489k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 489k]
  |  |  ------------------
  |  |  109|   489k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|   489k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|   489k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1820:8): [True: 7.83k, False: 481k]
  ------------------
 1821|  7.83k|				return 0;
 1822|   481k|			break;
 1823|   481k|		case FILE_MELONG:
  ------------------
  |  |  276|      0|#define				FILE_MELONG		23
  ------------------
  |  Branch (1823:3): [True: 0, False: 872k]
  ------------------
 1824|      0|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1824:8): [True: 0, False: 0]
  ------------------
 1825|      0|				return 0;
 1826|      0|			if (do_ops(ms, m, &offset, SEXT(sgn,32,ME32(p->hl)), off))
  ------------------
  |  |  108|      0|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 0]
  |  |  ------------------
  |  |  109|      0|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|      0|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1826:8): [True: 0, False: 0]
  ------------------
 1827|      0|				return 0;
 1828|      0|			break;
 1829|  3.88k|		case FILE_LONG:
  ------------------
  |  |  257|  3.88k|#define				FILE_LONG		4
  ------------------
  |  Branch (1829:3): [True: 3.88k, False: 868k]
  ------------------
 1830|  3.88k|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1830:8): [True: 438, False: 3.45k]
  ------------------
 1831|    438|				return 0;
 1832|  3.45k|			if (do_ops(ms, m, &offset, SEXT(sgn,32,p->l), off))
  ------------------
  |  |  108|  3.45k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 3.45k]
  |  |  ------------------
  |  |  109|  3.45k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  3.45k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  3.45k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1832:8): [True: 150, False: 3.30k]
  ------------------
 1833|    150|				return 0;
 1834|  3.30k|			break;
 1835|  3.30k|		case FILE_LEQUAD:
  ------------------
  |  |  278|    166|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1835:3): [True: 166, False: 872k]
  ------------------
 1836|    166|			if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1836:8): [True: 0, False: 166]
  ------------------
 1837|      0|				return 0;
 1838|    166|			if (do_ops(ms, m, &offset, SEXT(sgn,64,LE64(p->hq)), off))	
  ------------------
  |  |  108|    166|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 166]
  |  |  ------------------
  |  |  109|    166|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    166|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    166|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1838:8): [True: 83, False: 83]
  ------------------
 1839|     83|				return 0;
 1840|     83|			break;
 1841|    333|		case FILE_BEQUAD:
  ------------------
  |  |  279|    333|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1841:3): [True: 333, False: 872k]
  ------------------
 1842|    333|			if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1842:8): [True: 0, False: 333]
  ------------------
 1843|      0|				return 0;
 1844|    333|			if (do_ops(ms, m, &offset, SEXT(sgn,64,BE64(p->hq)), off))
  ------------------
  |  |  108|    333|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 333]
  |  |  ------------------
  |  |  109|    333|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    333|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    333|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1844:8): [True: 209, False: 124]
  ------------------
 1845|    209|				return 0;
 1846|    124|			break;
 1847|    269|		case FILE_OCTAL:
  ------------------
  |  |  314|    269|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1847:3): [True: 269, False: 872k]
  ------------------
 1848|    269|			if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1848:8): [True: 98, False: 171]
  ------------------
 1849|     98|				return 0;
 1850|    171|			p->s[sizeof(p->s) - 1] = '\0';
 1851|    171|			if(do_ops(ms, m, &offset,
  ------------------
  |  Branch (1851:7): [True: 66, False: 105]
  ------------------
 1852|    171|			    SEXT(sgn,64,strtoull(p->s, NULL, 8)), off))
  ------------------
  |  |  108|    171|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 171]
  |  |  ------------------
  |  |  109|    171|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    171|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    171|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1853|     66|				return 0;
 1854|    105|			break;
 1855|    105|		default:
  ------------------
  |  Branch (1855:3): [True: 0, False: 872k]
  ------------------
 1856|      0|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1856:8): [True: 0, False: 0]
  ------------------
 1857|      0|				fprintf(stderr, "bad in_type=%d\n", in_type);
 1858|      0|			return 0;
 1859|   872k|		}
 1860|       |
 1861|   562k|		if (m->flag & INDIROFFADD) {
  ------------------
  |  |  236|   562k|#define INDIROFFADD	0x04	/* if '>&(' appears */
  ------------------
  |  Branch (1861:7): [True: 2.04k, False: 560k]
  ------------------
 1862|  2.04k|			if (cont_level == 0) {
  ------------------
  |  Branch (1862:8): [True: 0, False: 2.04k]
  ------------------
 1863|      0|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1863:9): [True: 0, False: 0]
  ------------------
 1864|      0|					fprintf(stderr,
 1865|      0|					    "indirect *zero* cont_level\n");
 1866|      0|				return 0;
 1867|      0|			}
 1868|  2.04k|			offset += ms->c.li[cont_level - 1].off;
 1869|  2.04k|			if (offset == 0) {
  ------------------
  |  Branch (1869:8): [True: 76, False: 1.96k]
  ------------------
 1870|     76|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|     76|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1870:9): [True: 0, False: 76]
  ------------------
 1871|      0|					fprintf(stderr,
 1872|      0|					    "indirect *zero* offset\n");
 1873|     76|				return 0;
 1874|     76|			}
 1875|  1.96k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  1.96k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1875:8): [True: 0, False: 1.96k]
  ------------------
 1876|      0|				fprintf(stderr, "indirect +offs=%u\n", offset);
 1877|  1.96k|		}
 1878|   562k|		if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1)
  ------------------
  |  Branch (1878:7): [True: 0, False: 562k]
  ------------------
 1879|      0|			return -1;
 1880|   562k|		ms->offset = offset;
 1881|       |
 1882|   562k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   562k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1882:7): [True: 0, False: 562k]
  ------------------
 1883|      0|			mdebug(offset, RCAST(char *, RCAST(void *, p)),
  ------------------
  |  |  461|      0|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1884|      0|			    sizeof(union VALUETYPE));
 1885|      0|#ifndef COMPILE_ONLY
 1886|      0|			file_mdump(m);
 1887|      0|#endif
 1888|      0|		}
 1889|   562k|	}
 1890|       |
 1891|       |	/* Verify we have enough data to match magic type */
 1892|   121M|	switch (m->type) {
 1893|  2.11M|	case FILE_BYTE:
  ------------------
  |  |  254|  2.11M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1893:2): [True: 2.11M, False: 119M]
  ------------------
 1894|  2.11M|		if (offset_oob(nbytes, offset, 1))
  ------------------
  |  Branch (1894:7): [True: 193k, False: 1.92M]
  ------------------
 1895|   193k|			return 0;
 1896|  1.92M|		break;
 1897|       |
 1898|  2.27M|	case FILE_SHORT:
  ------------------
  |  |  255|  2.27M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1898:2): [True: 2.27M, False: 119M]
  ------------------
 1899|  7.23M|	case FILE_BESHORT:
  ------------------
  |  |  260|  7.23M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1899:2): [True: 4.95M, False: 116M]
  ------------------
 1900|  12.1M|	case FILE_LESHORT:
  ------------------
  |  |  263|  12.1M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1900:2): [True: 4.87M, False: 116M]
  ------------------
 1901|  12.1M|		if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1901:7): [True: 966k, False: 11.1M]
  ------------------
 1902|   966k|			return 0;
 1903|  11.1M|		break;
 1904|       |
 1905|  11.1M|	case FILE_LONG:
  ------------------
  |  |  257|  1.79M|#define				FILE_LONG		4
  ------------------
  |  Branch (1905:2): [True: 1.79M, False: 120M]
  ------------------
 1906|  16.9M|	case FILE_BELONG:
  ------------------
  |  |  261|  16.9M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1906:2): [True: 15.1M, False: 106M]
  ------------------
 1907|  24.8M|	case FILE_LELONG:
  ------------------
  |  |  264|  24.8M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1907:2): [True: 7.88M, False: 113M]
  ------------------
 1908|  24.8M|	case FILE_MELONG:
  ------------------
  |  |  276|  24.8M|#define				FILE_MELONG		23
  ------------------
  |  Branch (1908:2): [True: 35, False: 121M]
  ------------------
 1909|  24.8M|	case FILE_DATE:
  ------------------
  |  |  259|  24.8M|#define				FILE_DATE		6
  ------------------
  |  Branch (1909:2): [True: 0, False: 121M]
  ------------------
 1910|  24.8M|	case FILE_BEDATE:
  ------------------
  |  |  262|  24.8M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1910:2): [True: 532, False: 121M]
  ------------------
 1911|  24.8M|	case FILE_LEDATE:
  ------------------
  |  |  265|  24.8M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1911:2): [True: 444, False: 121M]
  ------------------
 1912|  24.8M|	case FILE_MEDATE:
  ------------------
  |  |  274|  24.8M|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1912:2): [True: 99, False: 121M]
  ------------------
 1913|  24.8M|	case FILE_LDATE:
  ------------------
  |  |  267|  24.8M|#define				FILE_LDATE		14
  ------------------
  |  Branch (1913:2): [True: 0, False: 121M]
  ------------------
 1914|  24.8M|	case FILE_BELDATE:
  ------------------
  |  |  268|  24.8M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1914:2): [True: 281, False: 121M]
  ------------------
 1915|  24.8M|	case FILE_LELDATE:
  ------------------
  |  |  269|  24.8M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1915:2): [True: 65, False: 121M]
  ------------------
 1916|  24.8M|	case FILE_MELDATE:
  ------------------
  |  |  275|  24.8M|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1916:2): [True: 0, False: 121M]
  ------------------
 1917|  24.8M|	case FILE_FLOAT:
  ------------------
  |  |  286|  24.8M|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1917:2): [True: 0, False: 121M]
  ------------------
 1918|  24.8M|	case FILE_BEFLOAT:
  ------------------
  |  |  287|  24.8M|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1918:2): [True: 0, False: 121M]
  ------------------
 1919|  24.8M|	case FILE_LEFLOAT:
  ------------------
  |  |  288|  24.8M|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1919:2): [True: 4.56k, False: 121M]
  ------------------
 1920|  24.8M|		if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1920:7): [True: 2.26M, False: 22.5M]
  ------------------
 1921|  2.26M|			return 0;
 1922|  22.5M|		break;
 1923|       |
 1924|  22.5M|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1924:2): [True: 0, False: 121M]
  ------------------
 1925|    230|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|    230|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1925:2): [True: 230, False: 121M]
  ------------------
 1926|  1.31k|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|  1.31k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1926:2): [True: 1.08k, False: 121M]
  ------------------
 1927|  1.31k|		if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1927:7): [True: 592, False: 720]
  ------------------
 1928|    592|			return 0;
 1929|    720|		break;
 1930|       |
 1931|    720|	case FILE_LEGUID:
  ------------------
  |  |  303|      0|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1931:2): [True: 0, False: 121M]
  ------------------
 1932|    135|	case FILE_BEGUID:
  ------------------
  |  |  304|    135|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1932:2): [True: 135, False: 121M]
  ------------------
 1933|   224k|	case FILE_GUID:
  ------------------
  |  |  302|   224k|#define				FILE_GUID		49
  ------------------
  |  Branch (1933:2): [True: 224k, False: 121M]
  ------------------
 1934|   224k|		if (offset_oob(nbytes, offset, 16))
  ------------------
  |  Branch (1934:7): [True: 24.1k, False: 200k]
  ------------------
 1935|  24.1k|			return 0;
 1936|   200k|		break;
 1937|       |
 1938|  77.9M|	case FILE_STRING:
  ------------------
  |  |  258|  77.9M|#define				FILE_STRING		5
  ------------------
  |  Branch (1938:2): [True: 77.9M, False: 43.8M]
  ------------------
 1939|  77.9M|	case FILE_PSTRING:
  ------------------
  |  |  266|  77.9M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1939:2): [True: 36.2k, False: 121M]
  ------------------
 1940|  79.2M|	case FILE_SEARCH:
  ------------------
  |  |  273|  79.2M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1940:2): [True: 1.21M, False: 120M]
  ------------------
 1941|  79.2M|	case FILE_OCTAL:
  ------------------
  |  |  314|  79.2M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1941:2): [True: 0, False: 121M]
  ------------------
 1942|  79.2M|		if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1942:7): [True: 13.6M, False: 65.5M]
  ------------------
 1943|  13.6M|			return 0;
 1944|  65.5M|		break;
 1945|       |
 1946|  65.5M|	case FILE_REGEX:
  ------------------
  |  |  270|   509k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1946:2): [True: 509k, False: 121M]
  ------------------
 1947|   509k|		if (nbytes < offset)
  ------------------
  |  Branch (1947:7): [True: 1.08k, False: 508k]
  ------------------
 1948|  1.08k|			return 0;
 1949|   508k|		break;
 1950|       |
 1951|   508k|	case FILE_INDIRECT:
  ------------------
  |  |  294|  21.2k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (1951:2): [True: 21.2k, False: 121M]
  ------------------
 1952|  21.2k|		if (m->str_flags & INDIRECT_RELATIVE)
  ------------------
  |  |  390|  21.2k|#define str_flags _u._s._flags
  ------------------
              		if (m->str_flags & INDIRECT_RELATIVE)
  ------------------
  |  |  443|  21.2k|#define	INDIRECT_RELATIVE			BIT(0)
  |  |  ------------------
  |  |  |  |  403|  21.2k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (1952:7): [True: 12.5k, False: 8.75k]
  ------------------
 1953|  12.5k|			offset += CAST(uint32_t, o);
  ------------------
  |  |  460|  12.5k|#define CAST(T, b)	((T)(b))
  ------------------
 1954|  21.2k|		if (offset == 0)
  ------------------
  |  Branch (1954:7): [True: 1.14k, False: 20.1k]
  ------------------
 1955|  1.14k|			return 0;
 1956|       |
 1957|  20.1k|		if (nbytes < offset)
  ------------------
  |  Branch (1957:7): [True: 1.62k, False: 18.4k]
  ------------------
 1958|  1.62k|			return 0;
 1959|       |
 1960|  18.4k|		if ((pb = file_push_buffer(ms)) == NULL)
  ------------------
  |  Branch (1960:7): [True: 1, False: 18.4k]
  ------------------
 1961|      1|			return -1;
 1962|       |
 1963|  18.4k|		(*indir_count)++;
 1964|  18.4k|		sbb = *b;
 1965|  18.4k|		sbb.fbuf = s + offset;
 1966|  18.4k|		sbb.flen = nbytes - offset;
 1967|  18.4k|		sbb.ebuf = NULL;
 1968|  18.4k|		sbb.elen = 0;
 1969|  18.4k|		rv = -1;
 1970|  20.6k|		for (mlp = ms->mlist[0]->next; mlp != ms->mlist[0];
  ------------------
  |  Branch (1970:34): [True: 18.4k, False: 2.18k]
  ------------------
 1971|  18.4k|		    mlp = mlp->next)
 1972|  18.4k|		{
 1973|  18.4k|			if ((rv = match(ms, mlp->magic, mlp->magic_rxcomp,
  ------------------
  |  Branch (1973:8): [True: 16.3k, False: 2.18k]
  ------------------
 1974|  18.4k|			    mlp->nmagic, &sbb, 0, BINTEST, text, 0, indir_count,
  ------------------
  |  |  239|  18.4k|#define BINTEST		0x20	/* test is for a binary type (set only
  ------------------
 1975|  18.4k|			    name_count, printed_something, need_separator,
 1976|  18.4k|			    firstline, NULL, NULL)) != 0)
 1977|  16.3k|				break;
 1978|  18.4k|		}
 1979|  18.4k|		buffer_fini(&sbb);
 1980|       |
 1981|  18.4k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  18.4k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1981:7): [True: 0, False: 18.4k]
  ------------------
 1982|      0|			fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv);
 1983|       |
 1984|  18.4k|		rbuf = file_pop_buffer(ms, pb);
 1985|  18.4k|		if (rbuf == NULL && ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  495|  3.09k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (1985:7): [True: 3.09k, False: 15.3k]
  |  Branch (1985:23): [True: 1.71k, False: 1.37k]
  ------------------
 1986|  1.71k|			return -1;
 1987|       |
 1988|  16.7k|		if (rv == 1) {
  ------------------
  |  Branch (1988:7): [True: 14.5k, False: 2.18k]
  ------------------
 1989|  14.5k|			if ((ms->flags & MAGIC_NODESC) == 0 &&
  ------------------
  |  |   52|  14.5k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  14.5k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  14.5k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  14.5k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  14.5k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  14.5k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  |  Branch (1989:8): [True: 14.5k, False: 0]
  ------------------
 1990|  14.5k|			    file_printf(ms, F(ms, m->desc, "%u"), offset) == -1)
  ------------------
  |  |  167|  14.5k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (1990:8): [True: 0, False: 14.5k]
  ------------------
 1991|      0|				goto out;
 1992|  14.5k|			if (rbuf && file_printf(ms, "%s", rbuf) == -1) {
  ------------------
  |  Branch (1992:8): [True: 14.5k, False: 0]
  |  Branch (1992:16): [True: 133, False: 14.4k]
  ------------------
 1993|    133|out:				free(rbuf);
 1994|    133|				return -1;
 1995|    133|			}
 1996|  14.5k|		}
 1997|  16.6k|		free(rbuf);
 1998|  16.6k|		return rv;
 1999|       |
 2000|  75.3k|	case FILE_USE:
  ------------------
  |  |  299|  75.3k|#define				FILE_USE		46
  ------------------
  |  Branch (2000:2): [True: 75.3k, False: 121M]
  ------------------
 2001|  75.3k|		if (nbytes < offset)
  ------------------
  |  Branch (2001:7): [True: 9.52k, False: 65.7k]
  ------------------
 2002|  9.52k|			return 0;
 2003|  65.7k|		rbuf = m->value.s;
 2004|  65.7k|		if (*rbuf == '^') {
  ------------------
  |  Branch (2004:7): [True: 538, False: 65.2k]
  ------------------
 2005|    538|			rbuf++;
 2006|    538|			flip = !flip;
 2007|    538|		}
 2008|  65.7k|		if (file_magicfind(ms, rbuf, &ml) == -1) {
  ------------------
  |  Branch (2008:7): [True: 0, False: 65.7k]
  ------------------
 2009|      0|			file_error(ms, 0, "cannot find entry `%s'", rbuf);
 2010|      0|			return -1;
 2011|      0|		}
 2012|  65.7k|		if (save_cont(ms, &c) == -1) {
  ------------------
  |  Branch (2012:7): [True: 0, False: 65.7k]
  ------------------
 2013|      0|			file_error(ms, errno, "can't allocate continuation");
 2014|      0|			return -1;
 2015|      0|		}
 2016|       |
 2017|  65.7k|		oneed_separator = *need_separator;
 2018|  65.7k|		if (m->flag & NOSPACE)
  ------------------
  |  |  238|  65.7k|#define NOSPACE		0x10	/* suppress space character before output */
  ------------------
  |  Branch (2018:7): [True: 10.2k, False: 55.5k]
  ------------------
 2019|  10.2k|			*need_separator = 0;
 2020|       |
 2021|  65.7k|		nfound_match = 0;
 2022|  65.7k|		(*name_count)++;
 2023|  65.7k|		eoffset = ms->eoffset;
 2024|  65.7k|		rv = match(ms, ml.magic, ml.magic_rxcomp, ml.nmagic, b,
 2025|  65.7k|		    offset + o, mode, text, flip, indir_count, name_count,
 2026|  65.7k|		    printed_something, need_separator, firstline, returnval,
 2027|  65.7k|		    &nfound_match);
 2028|  65.7k|		ms->ms_value.q = nfound_match;
 2029|  65.7k|		(*name_count)--;
 2030|  65.7k|		*found_match |= nfound_match;
 2031|       |
 2032|  65.7k|		restore_cont(ms, &c);
 2033|       |
 2034|  65.7k|		if (rv != 1)
  ------------------
  |  Branch (2034:7): [True: 6.14k, False: 59.6k]
  ------------------
 2035|  6.14k|		    *need_separator = oneed_separator;
 2036|  65.7k|		ms->offset = offset;
 2037|  65.7k|		ms->eoffset = eoffset;
 2038|  65.7k|		return rv ? rv : *found_match;
  ------------------
  |  Branch (2038:10): [True: 60.9k, False: 4.84k]
  ------------------
 2039|       |
 2040|  65.7k|	case FILE_NAME:
  ------------------
  |  |  298|  65.7k|#define				FILE_NAME		45
  ------------------
  |  Branch (2040:2): [True: 65.7k, False: 121M]
  ------------------
 2041|  65.7k|		if (ms->flags & MAGIC_NODESC)
  ------------------
  |  |   52|  65.7k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  65.7k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  65.7k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  65.7k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  65.7k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  65.7k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  |  Branch (2041:7): [True: 0, False: 65.7k]
  ------------------
 2042|      0|			return 1;
 2043|  65.7k|		if (file_printf(ms, "%s", m->desc) == -1)
  ------------------
  |  Branch (2043:7): [True: 0, False: 65.7k]
  ------------------
 2044|      0|			return -1;
 2045|  65.7k|		return 1;
 2046|   443k|	case FILE_DER:
  ------------------
  |  |  301|   443k|#define				FILE_DER		48
  ------------------
  |  Branch (2046:2): [True: 443k, False: 121M]
  ------------------
 2047|   455k|	case FILE_DEFAULT:	/* nothing to check */
  ------------------
  |  |  256|   455k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (2047:2): [True: 11.9k, False: 121M]
  ------------------
 2048|   458k|	case FILE_CLEAR:
  ------------------
  |  |  300|   458k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (2048:2): [True: 3.52k, False: 121M]
  ------------------
 2049|  2.64M|	default:
  ------------------
  |  Branch (2049:2): [True: 2.18M, False: 119M]
  ------------------
 2050|  2.64M|		break;
 2051|   121M|	}
 2052|   104M|	if (!mconvert(ms, m, flip))
  ------------------
  |  Branch (2052:6): [True: 90, False: 104M]
  ------------------
 2053|     90|		return 0;
 2054|   104M|	return 1;
 2055|   104M|}
softmagic.c:mcopy:
 1380|   122M|{
 1381|   122M|	size_t size = sizeof(*p);
 1382|       |	/*
 1383|       |	 * Note: FILE_SEARCH and FILE_REGEX do not actually copy
 1384|       |	 * anything, but setup pointers into the source
 1385|       |	 */
 1386|   122M|	if (indir == 0) {
  ------------------
  |  Branch (1386:6): [True: 121M, False: 873k]
  ------------------
 1387|   121M|		switch (type) {
 1388|   443k|		case FILE_DER:
  ------------------
  |  |  301|   443k|#define				FILE_DER		48
  ------------------
  |  Branch (1388:3): [True: 443k, False: 121M]
  ------------------
 1389|  1.65M|		case FILE_SEARCH:
  ------------------
  |  |  273|  1.65M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1389:3): [True: 1.21M, False: 120M]
  ------------------
 1390|  1.65M|			if (offset > nbytes)
  ------------------
  |  Branch (1390:8): [True: 72.5k, False: 1.58M]
  ------------------
 1391|  72.5k|				offset = CAST(uint32_t, nbytes);
  ------------------
  |  |  460|  72.5k|#define CAST(T, b)	((T)(b))
  ------------------
 1392|  1.65M|			ms->search.s = RCAST(const char *, s) + offset;
  ------------------
  |  |  461|  1.65M|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1393|  1.65M|			ms->search.s_len = nbytes - offset;
 1394|  1.65M|			ms->search.offset = offset;
 1395|  1.65M|			return 0;
 1396|       |
 1397|   509k|		case FILE_REGEX: {
  ------------------
  |  |  270|   509k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1397:3): [True: 509k, False: 121M]
  ------------------
 1398|   509k|			const char *b;
 1399|   509k|			const char *c;
 1400|   509k|			const char *last;	/* end of search region */
 1401|   509k|			const char *buf;	/* start of search region */
 1402|   509k|			const char *end;
 1403|   509k|			size_t lines, linecnt, bytecnt;
 1404|       |
 1405|   509k|			if (s == NULL || nbytes < offset) {
  ------------------
  |  Branch (1405:8): [True: 0, False: 509k]
  |  Branch (1405:21): [True: 1.12k, False: 508k]
  ------------------
 1406|  1.12k|				ms->search.s_len = 0;
 1407|  1.12k|				ms->search.s = NULL;
 1408|  1.12k|				return 0;
 1409|  1.12k|			}
 1410|       |
 1411|   508k|			if (m->str_flags & REGEX_LINE_COUNT) {
  ------------------
  |  |  390|   508k|#define str_flags _u._s._flags
  ------------------
              			if (m->str_flags & REGEX_LINE_COUNT) {
  ------------------
  |  |  417|   508k|#define REGEX_LINE_COUNT			BIT(11)
  |  |  ------------------
  |  |  |  |  403|   508k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (1411:8): [True: 64.8k, False: 443k]
  ------------------
 1412|  64.8k|				linecnt = m->str_range;
  ------------------
  |  |  389|  64.8k|#define str_range _u._s._count
  ------------------
 1413|  64.8k|				bytecnt = linecnt * 80;
 1414|   443k|			} else {
 1415|   443k|				linecnt = 0;
 1416|   443k|				bytecnt = m->str_range;
  ------------------
  |  |  389|   443k|#define str_range _u._s._count
  ------------------
 1417|   443k|			}
 1418|       |
 1419|   508k|			if (bytecnt == 0 || bytecnt > nbytes - offset)
  ------------------
  |  Branch (1419:8): [True: 231k, False: 276k]
  |  Branch (1419:24): [True: 213k, False: 62.9k]
  ------------------
 1420|   445k|				bytecnt = nbytes - offset;
 1421|   508k|			if (bytecnt > ms->regex_max)
  ------------------
  |  Branch (1421:8): [True: 39.0k, False: 469k]
  ------------------
 1422|  39.0k|				bytecnt = ms->regex_max;
 1423|       |
 1424|   508k|			buf = RCAST(const char *, s) + offset;
  ------------------
  |  |  461|   508k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1425|   508k|			end = last = RCAST(const char *, s) + bytecnt + offset;
  ------------------
  |  |  461|   508k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1426|       |			/* mget() guarantees buf <= last */
 1427|   734k|			for (lines = linecnt, b = buf; lines && b < end &&
  ------------------
  |  Branch (1427:35): [True: 288k, False: 445k]
  |  Branch (1427:44): [True: 285k, False: 3.39k]
  ------------------
 1428|   285k|			     ((b = CAST(const char *,
  ------------------
  |  |  460|   285k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1428:10): [True: 115k, False: 169k]
  ------------------
 1429|   285k|				 memchr(c = b, '\n', CAST(size_t, (end - b)))))
 1430|   169k|			     || (b = CAST(const char *,
  ------------------
  |  |  460|   169k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1430:12): [True: 110k, False: 59.3k]
  ------------------
 1431|   169k|				 memchr(c, '\r', CAST(size_t, (end - c))))));
 1432|   508k|			     lines--, b++) {
 1433|   225k|				if (b < end - 1 && b[0] == '\r' && b[1] == '\n')
  ------------------
  |  Branch (1433:9): [True: 223k, False: 2.65k]
  |  Branch (1433:24): [True: 109k, False: 113k]
  |  Branch (1433:40): [True: 0, False: 109k]
  ------------------
 1434|      0|					b++;
 1435|   225k|				if (b < end - 1 && b[0] == '\n')
  ------------------
  |  Branch (1435:9): [True: 223k, False: 2.65k]
  |  Branch (1435:24): [True: 113k, False: 109k]
  ------------------
 1436|   113k|					b++;
 1437|   225k|				last = b;
 1438|   225k|			}
 1439|   508k|			if (lines)
  ------------------
  |  Branch (1439:8): [True: 62.7k, False: 445k]
  ------------------
 1440|  62.7k|				last = end;
 1441|       |
 1442|   508k|			ms->search.s = buf;
 1443|   508k|			ms->search.s_len = last - buf;
 1444|   508k|			ms->search.offset = offset;
 1445|   508k|			ms->search.rm_len = 0;
 1446|   508k|			return 0;
 1447|   509k|		}
 1448|    216|		case FILE_BESTRING16:
  ------------------
  |  |  271|    216|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1448:3): [True: 216, False: 121M]
  ------------------
 1449|  69.9k|		case FILE_LESTRING16: {
  ------------------
  |  |  272|  69.9k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1449:3): [True: 69.6k, False: 121M]
  ------------------
 1450|  69.9k|			const unsigned char *src = s + offset;
 1451|  69.9k|			const unsigned char *esrc = s + nbytes;
 1452|  69.9k|			char *dst = p->s;
 1453|  69.9k|			char *edst = &p->s[sizeof(p->s) - 1];
 1454|       |
 1455|  69.9k|			if (type == FILE_BESTRING16)
  ------------------
  |  |  271|  69.9k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1455:8): [True: 216, False: 69.6k]
  ------------------
 1456|    216|				src++;
 1457|       |
 1458|       |			/* check that offset is within range */
 1459|  69.9k|			if (offset >= nbytes)
  ------------------
  |  Branch (1459:8): [True: 1.53k, False: 68.3k]
  ------------------
 1460|  1.53k|				break;
 1461|  3.84M|			for (/*EMPTY*/; src < esrc; src += 2, dst++) {
  ------------------
  |  Branch (1461:20): [True: 3.80M, False: 46.9k]
  ------------------
 1462|  3.80M|				if (dst < edst)
  ------------------
  |  Branch (1462:9): [True: 3.78M, False: 21.3k]
  ------------------
 1463|  3.78M|					*dst = *src;
 1464|  21.3k|				else
 1465|  21.3k|					break;
 1466|  3.78M|				if (*dst == '\0') {
  ------------------
  |  Branch (1466:9): [True: 1.93M, False: 1.84M]
  ------------------
 1467|  1.93M|					if (type == FILE_BESTRING16 ?
  ------------------
  |  |  271|  1.93M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1467:10): [True: 9.17k, False: 1.92M]
  |  Branch (1467:10): [True: 787k, False: 1.14M]
  ------------------
 1468|  9.17k|					    *(src - 1) != '\0' :
 1469|  1.93M|					    ((src + 1 < esrc) &&
  ------------------
  |  Branch (1469:11): [True: 1.92M, False: 3.29k]
  ------------------
 1470|  1.92M|					    *(src + 1) != '\0'))
  ------------------
  |  Branch (1470:10): [True: 786k, False: 1.13M]
  ------------------
 1471|   787k|						*dst = ' ';
 1472|  1.93M|				}
 1473|  3.78M|			}
 1474|  68.3k|			*edst = '\0';
 1475|  68.3k|			*dst = '\0';
 1476|  68.3k|			return 0;
 1477|  69.9k|		}
 1478|  77.9M|		case FILE_STRING:	/* XXX - these two should not need */
  ------------------
  |  |  258|  77.9M|#define				FILE_STRING		5
  ------------------
  |  Branch (1478:3): [True: 77.9M, False: 43.8M]
  ------------------
 1479|  77.9M|		case FILE_PSTRING:	/* to copy anything, but do anyway. */
  ------------------
  |  |  266|  77.9M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1479:3): [True: 36.2k, False: 121M]
  ------------------
 1480|  77.9M|			if (m->str_range != 0 && m->str_range < sizeof(*p))
  ------------------
  |  |  389|  77.9M|#define str_range _u._s._count
  ------------------
              			if (m->str_range != 0 && m->str_range < sizeof(*p))
  ------------------
  |  |  389|  68.8k|#define str_range _u._s._count
  ------------------
  |  Branch (1480:8): [True: 68.8k, False: 77.9M]
  |  Branch (1480:29): [True: 68.8k, False: 0]
  ------------------
 1481|  68.8k|				size = m->str_range;
  ------------------
  |  |  389|  68.8k|#define str_range _u._s._count
  ------------------
 1482|  77.9M|			break;
 1483|  41.5M|		default:
  ------------------
  |  Branch (1483:3): [True: 41.5M, False: 80.2M]
  ------------------
 1484|  41.5M|			break;
 1485|   121M|		}
 1486|   121M|	}
 1487|       |
 1488|   120M|	if (type == FILE_OFFSET) {
  ------------------
  |  |  305|   120M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1488:6): [True: 4.16k, False: 120M]
  ------------------
 1489|  4.16k|		(void)memset(p, '\0', sizeof(*p));
 1490|  4.16k|		p->q = offset;
 1491|  4.16k|		return 0;
 1492|  4.16k|	}
 1493|       |
 1494|   120M|	if (offset >= nbytes) {
  ------------------
  |  Branch (1494:6): [True: 7.73M, False: 112M]
  ------------------
 1495|  7.73M|		(void)memset(p, '\0', sizeof(*p));
 1496|  7.73M|		return 0;
 1497|  7.73M|	}
 1498|   112M|	if (nbytes - offset < size)
  ------------------
  |  Branch (1498:6): [True: 70.4M, False: 42.2M]
  ------------------
 1499|  70.4M|		nbytes = nbytes - offset;
 1500|  42.2M|	else
 1501|  42.2M|		nbytes = size;
 1502|       |
 1503|   112M|	(void)memcpy(p, s + offset, nbytes);
 1504|       |
 1505|       |	/*
 1506|       |	 * the usefulness of padding with zeroes eludes me, it
 1507|       |	 * might even cause problems
 1508|       |	 */
 1509|   112M|	if (nbytes < sizeof(*p))
  ------------------
  |  Branch (1509:6): [True: 70.5M, False: 42.1M]
  ------------------
 1510|  70.5M|		(void)memset(RCAST(char *, RCAST(void *, p)) + nbytes, '\0',
  ------------------
  |  |  461|  70.5M|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1511|  70.5M|		    sizeof(*p) - nbytes);
 1512|   112M|	return 0;
 1513|   120M|}
softmagic.c:offset_oob:
  114|   119M| {
  115|   119M|	if (o < 0)
  ------------------
  |  Branch (115:6): [True: 0, False: 119M]
  ------------------
  116|      0|		return 1;
  117|   119M|        if ((uintmax_t)o > n)
  ------------------
  |  Branch (117:13): [True: 6.61M, False: 112M]
  ------------------
  118|  6.61M|		return 1;
  119|   112M|        return i > n - (uintmax_t)o;
  120|   119M|}
softmagic.c:cvt_flip:
 1028|   105M|{
 1029|   105M|	if (flip == 0)
  ------------------
  |  Branch (1029:6): [True: 105M, False: 15.5k]
  ------------------
 1030|   105M|		return type;
 1031|  15.5k|	switch (type) {
 1032|     35|	case FILE_BESHORT:
  ------------------
  |  |  260|     35|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1032:2): [True: 35, False: 15.4k]
  ------------------
 1033|     35|		return FILE_LESHORT;
  ------------------
  |  |  263|     35|#define				FILE_LESHORT		10
  ------------------
 1034|  2.00k|	case FILE_BELONG:
  ------------------
  |  |  261|  2.00k|#define				FILE_BELONG		8
  ------------------
  |  Branch (1034:2): [True: 2.00k, False: 13.5k]
  ------------------
 1035|  2.00k|		return FILE_LELONG;
  ------------------
  |  |  264|  2.00k|#define				FILE_LELONG		11
  ------------------
 1036|     44|	case FILE_BEDATE:
  ------------------
  |  |  262|     44|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1036:2): [True: 44, False: 15.4k]
  ------------------
 1037|     44|		return FILE_LEDATE;
  ------------------
  |  |  265|     44|#define				FILE_LEDATE		12
  ------------------
 1038|      0|	case FILE_BELDATE:
  ------------------
  |  |  268|      0|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1038:2): [True: 0, False: 15.5k]
  ------------------
 1039|      0|		return FILE_LELDATE;
  ------------------
  |  |  269|      0|#define				FILE_LELDATE		16
  ------------------
 1040|     60|	case FILE_BEQUAD:
  ------------------
  |  |  279|     60|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1040:2): [True: 60, False: 15.4k]
  ------------------
 1041|     60|		return FILE_LEQUAD;
  ------------------
  |  |  278|     60|#define				FILE_LEQUAD		25
  ------------------
 1042|    132|	case FILE_BEQDATE:
  ------------------
  |  |  282|    132|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1042:2): [True: 132, False: 15.3k]
  ------------------
 1043|    132|		return FILE_LEQDATE;
  ------------------
  |  |  281|    132|#define				FILE_LEQDATE		28
  ------------------
 1044|      0|	case FILE_BEQLDATE:
  ------------------
  |  |  285|      0|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1044:2): [True: 0, False: 15.5k]
  ------------------
 1045|      0|		return FILE_LEQLDATE;
  ------------------
  |  |  284|      0|#define				FILE_LEQLDATE		31
  ------------------
 1046|      0|	case FILE_BEQWDATE:
  ------------------
  |  |  297|      0|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1046:2): [True: 0, False: 15.5k]
  ------------------
 1047|      0|		return FILE_LEQWDATE;
  ------------------
  |  |  296|      0|#define				FILE_LEQWDATE		43
  ------------------
 1048|  11.8k|	case FILE_LESHORT:
  ------------------
  |  |  263|  11.8k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1048:2): [True: 11.8k, False: 3.63k]
  ------------------
 1049|  11.8k|		return FILE_BESHORT;
  ------------------
  |  |  260|  11.8k|#define				FILE_BESHORT		7
  ------------------
 1050|    237|	case FILE_LELONG:
  ------------------
  |  |  264|    237|#define				FILE_LELONG		11
  ------------------
  |  Branch (1050:2): [True: 237, False: 15.2k]
  ------------------
 1051|    237|		return FILE_BELONG;
  ------------------
  |  |  261|    237|#define				FILE_BELONG		8
  ------------------
 1052|     34|	case FILE_LEDATE:
  ------------------
  |  |  265|     34|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1052:2): [True: 34, False: 15.4k]
  ------------------
 1053|     34|		return FILE_BEDATE;
  ------------------
  |  |  262|     34|#define				FILE_BEDATE		9
  ------------------
 1054|      0|	case FILE_LELDATE:
  ------------------
  |  |  269|      0|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1054:2): [True: 0, False: 15.5k]
  ------------------
 1055|      0|		return FILE_BELDATE;
  ------------------
  |  |  268|      0|#define				FILE_BELDATE		15
  ------------------
 1056|     80|	case FILE_LEQUAD:
  ------------------
  |  |  278|     80|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1056:2): [True: 80, False: 15.4k]
  ------------------
 1057|     80|		return FILE_BEQUAD;
  ------------------
  |  |  279|     80|#define				FILE_BEQUAD		26
  ------------------
 1058|      0|	case FILE_LEQDATE:
  ------------------
  |  |  281|      0|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1058:2): [True: 0, False: 15.5k]
  ------------------
 1059|      0|		return FILE_BEQDATE;
  ------------------
  |  |  282|      0|#define				FILE_BEQDATE		29
  ------------------
 1060|      0|	case FILE_LEQLDATE:
  ------------------
  |  |  284|      0|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1060:2): [True: 0, False: 15.5k]
  ------------------
 1061|      0|		return FILE_BEQLDATE;
  ------------------
  |  |  285|      0|#define				FILE_BEQLDATE		32
  ------------------
 1062|      0|	case FILE_LEQWDATE:
  ------------------
  |  |  296|      0|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1062:2): [True: 0, False: 15.5k]
  ------------------
 1063|      0|		return FILE_BEQWDATE;
  ------------------
  |  |  297|      0|#define				FILE_BEQWDATE		44
  ------------------
 1064|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1064:2): [True: 0, False: 15.5k]
  ------------------
 1065|      0|		return FILE_LEFLOAT;
  ------------------
  |  |  288|      0|#define				FILE_LEFLOAT		35
  ------------------
 1066|      0|	case FILE_LEFLOAT:
  ------------------
  |  |  288|      0|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1066:2): [True: 0, False: 15.5k]
  ------------------
 1067|      0|		return FILE_BEFLOAT;
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
 1068|      0|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1068:2): [True: 0, False: 15.5k]
  ------------------
 1069|      0|		return FILE_LEDOUBLE;
  ------------------
  |  |  291|      0|#define				FILE_LEDOUBLE		38
  ------------------
 1070|      0|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|      0|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1070:2): [True: 0, False: 15.5k]
  ------------------
 1071|      0|		return FILE_BEDOUBLE;
  ------------------
  |  |  290|      0|#define				FILE_BEDOUBLE		37
  ------------------
 1072|      0|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1072:2): [True: 0, False: 15.5k]
  ------------------
 1073|      0|		return FILE_LEMSDOSDATE;
  ------------------
  |  |  309|      0|#define				FILE_LEMSDOSDATE	56
  ------------------
 1074|      0|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|      0|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1074:2): [True: 0, False: 15.5k]
  ------------------
 1075|      0|		return FILE_BEMSDOSDATE;
  ------------------
  |  |  310|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
 1076|      0|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1076:2): [True: 0, False: 15.5k]
  ------------------
 1077|      0|		return FILE_LEMSDOSTIME;
  ------------------
  |  |  312|      0|#define				FILE_LEMSDOSTIME	59
  ------------------
 1078|      0|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|      0|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1078:2): [True: 0, False: 15.5k]
  ------------------
 1079|      0|		return FILE_BEMSDOSTIME;
  ------------------
  |  |  313|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
 1080|  1.00k|	default:
  ------------------
  |  Branch (1080:2): [True: 1.00k, False: 14.5k]
  ------------------
 1081|  1.00k|		return type;
 1082|  15.5k|	}
 1083|  15.5k|}
softmagic.c:do_ops:
 1518|   571k|{
 1519|   571k|	intmax_t offset;
 1520|       |	// On purpose not INTMAX_MAX
 1521|   571k|	if (lhs >= UINT_MAX || lhs <= INT_MIN ||
  ------------------
  |  Branch (1521:6): [True: 8.01k, False: 563k]
  |  Branch (1521:25): [True: 158, False: 562k]
  ------------------
 1522|   562k|	    off >= UINT_MAX || off <= INT_MIN) {
  ------------------
  |  Branch (1522:6): [True: 194, False: 562k]
  |  Branch (1522:25): [True: 0, False: 562k]
  ------------------
 1523|  8.36k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  8.36k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1523:7): [True: 0, False: 8.36k]
  ------------------
 1524|      0|			fprintf(stderr, "lhs/off overflow %jd %jd\n", lhs, off);
 1525|  8.36k|		return 1;
 1526|  8.36k|	}
 1527|       |	   
 1528|   562k|	if (off) {
  ------------------
  |  Branch (1528:6): [True: 94.2k, False: 468k]
  ------------------
 1529|  94.2k|		switch (m->in_op & FILE_OPS_MASK) {
  ------------------
  |  |  360|  94.2k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  ------------------
  |  Branch (1529:11): [True: 94.2k, False: 0]
  ------------------
 1530|     34|		case FILE_OPAND:
  ------------------
  |  |  352|     34|#define				FILE_OPAND	0
  ------------------
  |  Branch (1530:3): [True: 34, False: 94.2k]
  ------------------
 1531|     34|			offset = lhs & off;
 1532|     34|			break;
 1533|      0|		case FILE_OPOR:
  ------------------
  |  |  353|      0|#define				FILE_OPOR	1
  ------------------
  |  Branch (1533:3): [True: 0, False: 94.2k]
  ------------------
 1534|      0|			offset = lhs | off;
 1535|      0|			break;
 1536|      0|		case FILE_OPXOR:
  ------------------
  |  |  354|      0|#define				FILE_OPXOR	2
  ------------------
  |  Branch (1536:3): [True: 0, False: 94.2k]
  ------------------
 1537|      0|			offset = lhs ^ off;
 1538|      0|			break;
 1539|  82.7k|		case FILE_OPADD:
  ------------------
  |  |  355|  82.7k|#define				FILE_OPADD	3
  ------------------
  |  Branch (1539:3): [True: 82.7k, False: 11.4k]
  ------------------
 1540|  82.7k|			offset = lhs + off;
 1541|  82.7k|			break;
 1542|    688|		case FILE_OPMINUS:
  ------------------
  |  |  356|    688|#define				FILE_OPMINUS	4
  ------------------
  |  Branch (1542:3): [True: 688, False: 93.6k]
  ------------------
 1543|    688|			offset = lhs - off;
 1544|    688|			break;
 1545|  10.6k|		case FILE_OPMULTIPLY:
  ------------------
  |  |  357|  10.6k|#define				FILE_OPMULTIPLY	5
  ------------------
  |  Branch (1545:3): [True: 10.6k, False: 83.5k]
  ------------------
 1546|  10.6k|			offset = lhs * off;
 1547|  10.6k|			break;
 1548|     74|		case FILE_OPDIVIDE:
  ------------------
  |  |  358|     74|#define				FILE_OPDIVIDE	6
  ------------------
  |  Branch (1548:3): [True: 74, False: 94.2k]
  ------------------
 1549|     74|			offset = lhs / off;
 1550|     74|			break;
 1551|      0|		case FILE_OPMODULO:
  ------------------
  |  |  359|      0|#define				FILE_OPMODULO	7
  ------------------
  |  Branch (1551:3): [True: 0, False: 94.2k]
  ------------------
 1552|      0|			offset = lhs % off;
 1553|      0|			break;
 1554|  94.2k|		}
 1555|  94.2k|	} else
 1556|   468k|		offset = lhs;
 1557|   562k|	if (m->in_op & FILE_OPINVERSE)
  ------------------
  |  |  364|   562k|#define				FILE_OPINVERSE	0x40
  ------------------
  |  Branch (1557:6): [True: 0, False: 562k]
  ------------------
 1558|      0|		offset = ~offset;
 1559|   562k|	if (offset >= UINT_MAX) {
  ------------------
  |  Branch (1559:6): [True: 509, False: 562k]
  ------------------
 1560|    509|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    509|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1560:7): [True: 0, False: 509]
  ------------------
 1561|      0|			fprintf(stderr, "offset overflow %jd\n", offset);
 1562|    509|		return 1;
 1563|    509|	}
 1564|   562k|	*rv = CAST(uint32_t, offset);
  ------------------
  |  |  460|   562k|#define CAST(T, b)	((T)(b))
  ------------------
 1565|   562k|	return 0;
 1566|   562k|}
softmagic.c:cvt_id3:
 1016|    139|{
 1017|    139|	v = ((((v >>  0) & 0x7f) <<  0) |
 1018|    139|	     (((v >>  8) & 0x7f) <<  7) |
 1019|    139|	     (((v >> 16) & 0x7f) << 14) |
 1020|    139|	     (((v >> 24) & 0x7f) << 21));
 1021|    139|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    139|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1021:6): [True: 0, False: 139]
  ------------------
 1022|      0|		fprintf(stderr, "id3 offs=%u\n", v);
 1023|    139|	return v;
 1024|    139|}
softmagic.c:file_fmtcheck:
  172|   165k|{
  173|   165k|	const char *ptr;
  174|       |
  175|   165k|	if (strchr(desc, '%') == NULL)
  ------------------
  |  Branch (175:6): [True: 112k, False: 53.1k]
  ------------------
  176|   112k|		return desc;
  177|       |
  178|  53.1k|	ptr = fmtcheck(desc, def);
  179|  53.1k|	if (ptr == def)
  ------------------
  |  Branch (179:6): [True: 0, False: 53.1k]
  ------------------
  180|      0|		file_magerror(ms,
  181|      0|		    "%s, %" SIZE_T_FORMAT "u: format `%s' does not match"
  182|      0|		    " with `%s'", file, line, desc, def);
  183|  53.1k|	return ptr;
  184|   165k|}
softmagic.c:save_cont:
 1628|  65.7k|{
 1629|  65.7k|	size_t len;
 1630|  65.7k|	*c = ms->c;
 1631|  65.7k|	len = c->len * sizeof(*c->li);
 1632|  65.7k|	ms->c.li = CAST(struct level_info *, malloc(len));
  ------------------
  |  |  460|  65.7k|#define CAST(T, b)	((T)(b))
  ------------------
 1633|  65.7k|	if (ms->c.li == NULL) {
  ------------------
  |  Branch (1633:6): [True: 0, False: 65.7k]
  ------------------
 1634|      0|		ms->c = *c;
 1635|      0|		return -1;
 1636|      0|	}
 1637|  65.7k|	memcpy(ms->c.li, c->li, len);
 1638|  65.7k|	return 0;
 1639|  65.7k|}
softmagic.c:restore_cont:
 1643|  65.7k|{
 1644|  65.7k|	free(ms->c.li);
 1645|  65.7k|	ms->c = *c;
 1646|  65.7k|}
softmagic.c:mconvert:
 1205|   104M|{
 1206|   104M|	union VALUETYPE *p = &ms->ms_value;
 1207|       |
 1208|   104M|	switch (cvt_flip(m->type, flip)) {
 1209|  1.92M|	case FILE_BYTE:
  ------------------
  |  |  254|  1.92M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1209:2): [True: 1.92M, False: 102M]
  ------------------
 1210|  1.92M|		if (cvt_8(p, m) == -1)
  ------------------
  |  Branch (1210:7): [True: 0, False: 1.92M]
  ------------------
 1211|      0|			goto out;
 1212|  1.92M|		return 1;
 1213|  1.91M|	case FILE_SHORT:
  ------------------
  |  |  255|  1.91M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1213:2): [True: 1.91M, False: 102M]
  ------------------
 1214|  1.91M|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|  1.91M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (1214:2): [True: 0, False: 104M]
  ------------------
 1215|  1.91M|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|  1.91M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (1215:2): [True: 0, False: 104M]
  ------------------
 1216|  1.91M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1216:7): [True: 0, False: 1.91M]
  ------------------
 1217|      0|			goto out;
 1218|  1.91M|		return 1;
 1219|  1.66M|	case FILE_LONG:
  ------------------
  |  |  257|  1.66M|#define				FILE_LONG		4
  ------------------
  |  Branch (1219:2): [True: 1.66M, False: 102M]
  ------------------
 1220|  1.66M|	case FILE_DATE:
  ------------------
  |  |  259|  1.66M|#define				FILE_DATE		6
  ------------------
  |  Branch (1220:2): [True: 0, False: 104M]
  ------------------
 1221|  1.66M|	case FILE_LDATE:
  ------------------
  |  |  267|  1.66M|#define				FILE_LDATE		14
  ------------------
  |  Branch (1221:2): [True: 0, False: 104M]
  ------------------
 1222|  1.66M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1222:7): [True: 0, False: 1.66M]
  ------------------
 1223|      0|			goto out;
 1224|  1.66M|		return 1;
 1225|  71.5k|	case FILE_QUAD:
  ------------------
  |  |  277|  71.5k|#define				FILE_QUAD		24
  ------------------
  |  Branch (1225:2): [True: 71.5k, False: 104M]
  ------------------
 1226|  71.5k|	case FILE_QDATE:
  ------------------
  |  |  280|  71.5k|#define				FILE_QDATE		27
  ------------------
  |  Branch (1226:2): [True: 0, False: 104M]
  ------------------
 1227|  71.5k|	case FILE_QLDATE:
  ------------------
  |  |  283|  71.5k|#define				FILE_QLDATE		30
  ------------------
  |  Branch (1227:2): [True: 0, False: 104M]
  ------------------
 1228|  71.8k|	case FILE_QWDATE:
  ------------------
  |  |  295|  71.8k|#define				FILE_QWDATE		42
  ------------------
  |  Branch (1228:2): [True: 313, False: 104M]
  ------------------
 1229|  76.0k|	case FILE_OFFSET:
  ------------------
  |  |  305|  76.0k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1229:2): [True: 4.16k, False: 104M]
  ------------------
 1230|  76.0k|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1230:7): [True: 0, False: 76.0k]
  ------------------
 1231|      0|			goto out;
 1232|  76.0k|		return 1;
 1233|  64.7M|	case FILE_STRING:
  ------------------
  |  |  258|  64.7M|#define				FILE_STRING		5
  ------------------
  |  Branch (1233:2): [True: 64.7M, False: 39.7M]
  ------------------
 1234|  64.7M|	case FILE_BESTRING16:
  ------------------
  |  |  271|  64.7M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1234:2): [True: 216, False: 104M]
  ------------------
 1235|  64.8M|	case FILE_LESTRING16:
  ------------------
  |  |  272|  64.8M|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1235:2): [True: 69.6k, False: 104M]
  ------------------
 1236|  64.8M|	case FILE_OCTAL: {
  ------------------
  |  |  314|  64.8M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1236:2): [True: 0, False: 104M]
  ------------------
 1237|       |		/* Null terminate and eat *trailing* return */
 1238|  64.8M|		p->s[sizeof(p->s) - 1] = '\0';
 1239|  64.8M|		return 1;
 1240|  64.8M|	}
 1241|  27.1k|	case FILE_PSTRING: {
  ------------------
  |  |  266|  27.1k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1241:2): [True: 27.1k, False: 104M]
  ------------------
 1242|  27.1k|		char *ptr1, *ptr2;
 1243|  27.1k|		size_t len, sz = file_pstring_length_size(ms, m);
 1244|  27.1k|		if (sz == FILE_BADSIZE)
  ------------------
  |  |  183|  27.1k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  27.1k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1244:7): [True: 0, False: 27.1k]
  ------------------
 1245|      0|			return 0;
 1246|  27.1k|		ptr1 = p->s;
 1247|  27.1k|		ptr2 = ptr1 + sz;
 1248|  27.1k|		len = file_pstring_get_length(ms, m, ptr1);
 1249|  27.1k|		if (len == FILE_BADSIZE)
  ------------------
  |  |  183|  27.1k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  27.1k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1249:7): [True: 90, False: 27.0k]
  ------------------
 1250|     90|			return 0;
 1251|  27.0k|		sz = sizeof(p->s) - sz; /* maximum length of string */
 1252|  27.0k|		if (len >= sz) {
  ------------------
  |  Branch (1252:7): [True: 16.3k, False: 10.6k]
  ------------------
 1253|       |			/*
 1254|       |			 * The size of the pascal string length (sz)
 1255|       |			 * is 1, 2, or 4. We need at least 1 byte for NUL
 1256|       |			 * termination, but we've already truncated the
 1257|       |			 * string by p->s, so we need to deduct sz.
 1258|       |			 * Because we can use one of the bytes of the length
 1259|       |			 * after we shifted as NUL termination.
 1260|       |			 */
 1261|  16.3k|			len = sz;
 1262|  16.3k|		}
 1263|  2.46M|		while (len--)
  ------------------
  |  Branch (1263:10): [True: 2.43M, False: 27.0k]
  ------------------
 1264|  2.43M|			*ptr1++ = *ptr2++;
 1265|  27.0k|		*ptr1 = '\0';
 1266|  27.0k|		return 1;
 1267|  27.1k|	}
 1268|  4.65M|	case FILE_BESHORT:
  ------------------
  |  |  260|  4.65M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1268:2): [True: 4.65M, False: 99.8M]
  ------------------
 1269|  4.65M|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|  4.65M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1269:2): [True: 0, False: 104M]
  ------------------
 1270|  4.65M|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|  4.65M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1270:2): [True: 0, False: 104M]
  ------------------
 1271|  4.65M|		p->h = CAST(short, BE16(p->hs));
  ------------------
  |  |  460|  4.65M|#define CAST(T, b)	((T)(b))
  ------------------
 1272|  4.65M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1272:7): [True: 0, False: 4.65M]
  ------------------
 1273|      0|			goto out;
 1274|  4.65M|		return 1;
 1275|  13.9M|	case FILE_BELONG:
  ------------------
  |  |  261|  13.9M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1275:2): [True: 13.9M, False: 90.5M]
  ------------------
 1276|  13.9M|	case FILE_BEDATE:
  ------------------
  |  |  262|  13.9M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1276:2): [True: 414, False: 104M]
  ------------------
 1277|  13.9M|	case FILE_BELDATE:
  ------------------
  |  |  268|  13.9M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1277:2): [True: 242, False: 104M]
  ------------------
 1278|  13.9M|		p->l = CAST(int32_t, BE32(p->hl));
  ------------------
  |  |  460|  13.9M|#define CAST(T, b)	((T)(b))
  ------------------
 1279|  13.9M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1279:7): [True: 0, False: 13.9M]
  ------------------
 1280|      0|			goto out;
 1281|  13.9M|		return 1;
 1282|  1.10M|	case FILE_BEQUAD:
  ------------------
  |  |  279|  1.10M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1282:2): [True: 1.10M, False: 103M]
  ------------------
 1283|  1.10M|	case FILE_BEQDATE:
  ------------------
  |  |  282|  1.10M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1283:2): [True: 132, False: 104M]
  ------------------
 1284|  1.10M|	case FILE_BEQLDATE:
  ------------------
  |  |  285|  1.10M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1284:2): [True: 263, False: 104M]
  ------------------
 1285|  1.10M|	case FILE_BEQWDATE:
  ------------------
  |  |  297|  1.10M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1285:2): [True: 0, False: 104M]
  ------------------
 1286|  1.10M|		p->q = CAST(uint64_t, BE64(p->hq));
  ------------------
  |  |  460|  1.10M|#define CAST(T, b)	((T)(b))
  ------------------
 1287|  1.10M|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1287:7): [True: 0, False: 1.10M]
  ------------------
 1288|      0|			goto out;
 1289|  1.10M|		return 1;
 1290|  4.56M|	case FILE_LESHORT:
  ------------------
  |  |  263|  4.56M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1290:2): [True: 4.56M, False: 99.9M]
  ------------------
 1291|  4.56M|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|  4.56M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1291:2): [True: 241, False: 104M]
  ------------------
 1292|  4.56M|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|  4.56M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1292:2): [True: 241, False: 104M]
  ------------------
 1293|  4.56M|		p->h = CAST(short, LE16(p->hs));
  ------------------
  |  |  460|  4.56M|#define CAST(T, b)	((T)(b))
  ------------------
 1294|  4.56M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1294:7): [True: 0, False: 4.56M]
  ------------------
 1295|      0|			goto out;
 1296|  4.56M|		return 1;
 1297|  6.96M|	case FILE_LELONG:
  ------------------
  |  |  264|  6.96M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1297:2): [True: 6.96M, False: 97.5M]
  ------------------
 1298|  6.96M|	case FILE_LEDATE:
  ------------------
  |  |  265|  6.96M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1298:2): [True: 444, False: 104M]
  ------------------
 1299|  6.96M|	case FILE_LELDATE:
  ------------------
  |  |  269|  6.96M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1299:2): [True: 34, False: 104M]
  ------------------
 1300|  6.96M|		p->l = CAST(int32_t, LE32(p->hl));
  ------------------
  |  |  460|  6.96M|#define CAST(T, b)	((T)(b))
  ------------------
 1301|  6.96M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1301:7): [True: 0, False: 6.96M]
  ------------------
 1302|      0|			goto out;
 1303|  6.96M|		return 1;
 1304|   928k|	case FILE_LEQUAD:
  ------------------
  |  |  278|   928k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1304:2): [True: 928k, False: 103M]
  ------------------
 1305|   928k|	case FILE_LEQDATE:
  ------------------
  |  |  281|   928k|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1305:2): [True: 132, False: 104M]
  ------------------
 1306|   928k|	case FILE_LEQLDATE:
  ------------------
  |  |  284|   928k|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1306:2): [True: 10, False: 104M]
  ------------------
 1307|   930k|	case FILE_LEQWDATE:
  ------------------
  |  |  296|   930k|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1307:2): [True: 1.76k, False: 104M]
  ------------------
 1308|   930k|		p->q = CAST(uint64_t, LE64(p->hq));
  ------------------
  |  |  460|   930k|#define CAST(T, b)	((T)(b))
  ------------------
 1309|   930k|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1309:7): [True: 0, False: 930k]
  ------------------
 1310|      0|			goto out;
 1311|   930k|		return 1;
 1312|     35|	case FILE_MELONG:
  ------------------
  |  |  276|     35|#define				FILE_MELONG		23
  ------------------
  |  Branch (1312:2): [True: 35, False: 104M]
  ------------------
 1313|    134|	case FILE_MEDATE:
  ------------------
  |  |  274|    134|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1313:2): [True: 99, False: 104M]
  ------------------
 1314|    134|	case FILE_MELDATE:
  ------------------
  |  |  275|    134|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1314:2): [True: 0, False: 104M]
  ------------------
 1315|    134|		p->l = CAST(int32_t, ME32(p->hl));
  ------------------
  |  |  460|    134|#define CAST(T, b)	((T)(b))
  ------------------
 1316|    134|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1316:7): [True: 0, False: 134]
  ------------------
 1317|      0|			goto out;
 1318|    134|		return 1;
 1319|      0|	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1319:2): [True: 0, False: 104M]
  ------------------
 1320|      0|		if (cvt_float(p, m) == -1)
  ------------------
  |  Branch (1320:7): [True: 0, False: 0]
  ------------------
 1321|      0|			goto out;
 1322|      0|		return 1;
 1323|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1323:2): [True: 0, False: 104M]
  ------------------
 1324|      0|		p->l = BE32(p->hl);
  ------------------
  |  |   95|      0|#define BE32(p) ( \
  |  |   96|      0|    (CAST(uint32_t, (p)[0])<<24)| \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   97|      0|    (CAST(uint32_t, (p)[1])<<16)| \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   98|      0|    (CAST(uint32_t, (p)[2])<<8)| \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   99|      0|    (CAST(uint32_t, (p)[3])))
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1325|      0|		if (cvt_float(p, m) == -1)
  ------------------
  |  Branch (1325:7): [True: 0, False: 0]
  ------------------
 1326|      0|			goto out;
 1327|      0|		return 1;
 1328|  4.56k|	case FILE_LEFLOAT:
  ------------------
  |  |  288|  4.56k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1328:2): [True: 4.56k, False: 104M]
  ------------------
 1329|  4.56k|		p->l = LE32(p->hl);
  ------------------
  |  |   90|  4.56k|#define LE32(p) ( \
  |  |   91|  4.56k|    (CAST(uint32_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  460|  4.56k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   92|  4.56k|    (CAST(uint32_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  460|  4.56k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   93|  4.56k|    (CAST(uint32_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  460|  4.56k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   94|  4.56k|    (CAST(uint32_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  460|  4.56k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1330|  4.56k|		if (cvt_float(p, m) == -1)
  ------------------
  |  Branch (1330:7): [True: 0, False: 4.56k]
  ------------------
 1331|      0|			goto out;
 1332|  4.56k|		return 1;
 1333|      0|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1333:2): [True: 0, False: 104M]
  ------------------
 1334|      0|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1334:7): [True: 0, False: 0]
  ------------------
 1335|      0|			goto out;
 1336|      0|		return 1;
 1337|    134|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|    134|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1337:2): [True: 134, False: 104M]
  ------------------
 1338|    134|		p->q = BE64(p->hq);
  ------------------
  |  |   72|    134|#define BE64(p) ( \
  |  |   73|    134|    (CAST(uint64_t, (p)[0])<<56)| \
  |  |  ------------------
  |  |  |  |  460|    134|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   74|    134|    (CAST(uint64_t, (p)[1])<<48)| \
  |  |  ------------------
  |  |  |  |  460|    134|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   75|    134|    (CAST(uint64_t, (p)[2])<<40)| \
  |  |  ------------------
  |  |  |  |  460|    134|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   76|    134|    (CAST(uint64_t, (p)[3])<<32)| \
  |  |  ------------------
  |  |  |  |  460|    134|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   77|    134|    (CAST(uint64_t, (p)[4])<<24)| \
  |  |  ------------------
  |  |  |  |  460|    134|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   78|    134|    (CAST(uint64_t, (p)[5])<<16)| \
  |  |  ------------------
  |  |  |  |  460|    134|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   79|    134|    (CAST(uint64_t, (p)[6])<<8)| \
  |  |  ------------------
  |  |  |  |  460|    134|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   80|    134|    (CAST(uint64_t, (p)[7])))
  |  |  ------------------
  |  |  |  |  460|    134|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1339|    134|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1339:7): [True: 0, False: 134]
  ------------------
 1340|      0|			goto out;
 1341|    134|		return 1;
 1342|    586|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|    586|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1342:2): [True: 586, False: 104M]
  ------------------
 1343|    586|		p->q = LE64(p->hq);
  ------------------
  |  |   81|    586|#define LE64(p) ( \
  |  |   82|    586|    (CAST(uint64_t, (p)[7])<<56)| \
  |  |  ------------------
  |  |  |  |  460|    586|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   83|    586|    (CAST(uint64_t, (p)[6])<<48)| \
  |  |  ------------------
  |  |  |  |  460|    586|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   84|    586|    (CAST(uint64_t, (p)[5])<<40)| \
  |  |  ------------------
  |  |  |  |  460|    586|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   85|    586|    (CAST(uint64_t, (p)[4])<<32)| \
  |  |  ------------------
  |  |  |  |  460|    586|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   86|    586|    (CAST(uint64_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  460|    586|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   87|    586|    (CAST(uint64_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  460|    586|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   88|    586|    (CAST(uint64_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  460|    586|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   89|    586|    (CAST(uint64_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  460|    586|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1344|    586|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1344:7): [True: 0, False: 586]
  ------------------
 1345|      0|			goto out;
 1346|    586|		return 1;
 1347|   508k|	case FILE_REGEX:
  ------------------
  |  |  270|   508k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1347:2): [True: 508k, False: 104M]
  ------------------
 1348|  1.24M|	case FILE_SEARCH:
  ------------------
  |  |  273|  1.24M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1348:2): [True: 733k, False: 103M]
  ------------------
 1349|  1.25M|	case FILE_DEFAULT:
  ------------------
  |  |  256|  1.25M|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (1349:2): [True: 11.9k, False: 104M]
  ------------------
 1350|  1.25M|	case FILE_CLEAR:
  ------------------
  |  |  300|  1.25M|#define				FILE_CLEAR		47
  ------------------
  |  Branch (1350:2): [True: 3.52k, False: 104M]
  ------------------
 1351|  1.25M|	case FILE_NAME:
  ------------------
  |  |  298|  1.25M|#define				FILE_NAME		45
  ------------------
  |  Branch (1351:2): [True: 0, False: 104M]
  ------------------
 1352|  1.25M|	case FILE_USE:
  ------------------
  |  |  299|  1.25M|#define				FILE_USE		46
  ------------------
  |  Branch (1352:2): [True: 0, False: 104M]
  ------------------
 1353|  1.70M|	case FILE_DER:
  ------------------
  |  |  301|  1.70M|#define				FILE_DER		48
  ------------------
  |  Branch (1353:2): [True: 443k, False: 104M]
  ------------------
 1354|  1.90M|	case FILE_GUID:
  ------------------
  |  |  302|  1.90M|#define				FILE_GUID		49
  ------------------
  |  Branch (1354:2): [True: 200k, False: 104M]
  ------------------
 1355|  1.90M|	case FILE_LEGUID:
  ------------------
  |  |  303|  1.90M|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1355:2): [True: 0, False: 104M]
  ------------------
 1356|  1.90M|	case FILE_BEGUID:
  ------------------
  |  |  304|  1.90M|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1356:2): [True: 66, False: 104M]
  ------------------
 1357|  1.90M|		return 1;
 1358|      0|	default:
  ------------------
  |  Branch (1358:2): [True: 0, False: 104M]
  ------------------
 1359|      0|		file_magerror(ms, "invalid type %d in mconvert()", m->type);
 1360|      0|		return 0;
 1361|   104M|	}
 1362|      0|out:
 1363|      0|	file_magerror(ms, "zerodivide/overflow/underflow in mconvert()");
 1364|      0|	return 0;
 1365|   104M|}
softmagic.c:cvt_8:
 1139|  1.92M|{
 1140|  1.92M|	DO_CVT(m, b, 8);
  ------------------
  |  | 1131|  1.92M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  1.92M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 852k, False: 1.07M]
  |  |  ------------------
  |  | 1132|   852k|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|   852k|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|   852k|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 106k, False: 745k]
  |  |  |  |  ------------------
  |  |  |  | 1095|   852k|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   106k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 106k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  88.8k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  88.8k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 88.8k, False: 17.9k]
  |  |  |  |  ------------------
  |  |  |  | 1097|  88.8k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  88.8k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  88.8k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 106k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 106k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 0, False: 106k]
  |  |  |  |  ------------------
  |  |  |  | 1106|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			break; \
  |  |  |  | 1108|  17.2k|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  17.2k|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 17.2k, False: 89.5k]
  |  |  |  |  ------------------
  |  |  |  | 1109|  17.2k|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  17.2k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|  17.2k|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 106k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    367|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    367|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 367, False: 106k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    367|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    367|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    367|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 367]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    367|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    367|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    367|		return -1; \
  |  |  |  |  |  | 1090|    367|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    367|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 367]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    367|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    367|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    367|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    367|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    367|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 367]
  |  |  |  |  ------------------
  |  |  |  | 1117|    367|				return -1; \
  |  |  |  | 1118|    367|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    367|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    367|			break; \
  |  |  |  | 1120|    367|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    366|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 366, False: 106k]
  |  |  |  |  ------------------
  |  |  |  | 1121|    366|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    366|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    366|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 366]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    366|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    366|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    366|		return -1; \
  |  |  |  |  |  | 1090|    366|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    366|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 366]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    366|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    366|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    366|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    366|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    366|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 366]
  |  |  |  |  ------------------
  |  |  |  | 1123|    366|				return -1; \
  |  |  |  | 1124|    366|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    366|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    366|			break; \
  |  |  |  | 1126|   106k|		} \
  |  |  |  | 1127|   852k|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|   852k|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 852k]
  |  |  |  |  ------------------
  |  |  |  | 1128|   852k|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  1.07M|	} else { \
  |  | 1134|  1.07M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  1.07M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.07M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 50.2k, False: 1.02M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.07M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|  50.2k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 50.2k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  41.2k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  41.2k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 41.2k, False: 9.06k]
  |  |  |  |  ------------------
  |  |  |  | 1097|  41.2k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  41.2k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  41.2k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 50.2k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 50.2k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 0, False: 50.2k]
  |  |  |  |  ------------------
  |  |  |  | 1106|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			break; \
  |  |  |  | 1108|  9.00k|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  9.00k|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 9.00k, False: 41.2k]
  |  |  |  |  ------------------
  |  |  |  | 1109|  9.00k|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  9.00k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|  9.00k|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 50.2k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|     68|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|     68|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 68, False: 50.2k]
  |  |  |  |  ------------------
  |  |  |  | 1115|     68|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     68|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 68]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|     68|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     68|		return -1; \
  |  |  |  |  |  | 1090|     68|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 68]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|     68|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|     68|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|     68|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 68]
  |  |  |  |  ------------------
  |  |  |  | 1117|     68|				return -1; \
  |  |  |  | 1118|     68|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|     68|			break; \
  |  |  |  | 1120|     68|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 0, False: 50.2k]
  |  |  |  |  ------------------
  |  |  |  | 1121|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|      0|		return -1; \
  |  |  |  |  |  | 1090|      0|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|      0|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1123|      0|				return -1; \
  |  |  |  | 1124|      0|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|      0|			break; \
  |  |  |  | 1126|  50.2k|		} \
  |  |  |  | 1127|  1.07M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.07M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.07M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.07M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  1.07M|	}
  ------------------
 1141|  1.92M|	return 0;
 1142|  1.92M|}
softmagic.c:cvt_16:
 1146|  11.1M|{
 1147|  11.1M|	DO_CVT(m, h, 16);
  ------------------
  |  | 1131|  11.1M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  11.1M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 1.41M, False: 9.72M]
  |  |  ------------------
  |  | 1132|  1.41M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  1.41M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.41M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 142k, False: 1.27M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.41M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   142k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 142k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   141k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   141k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 141k, False: 781]
  |  |  |  |  ------------------
  |  |  |  | 1097|   141k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   141k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   141k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 142k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 142k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     70|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|     70|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 70, False: 142k]
  |  |  |  |  ------------------
  |  |  |  | 1106|     70|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     70|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     70|			break; \
  |  |  |  | 1108|    216|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|    216|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 216, False: 141k]
  |  |  |  |  ------------------
  |  |  |  | 1109|    216|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    216|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|    216|			break; \
  |  |  |  | 1111|     69|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|     69|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 69, False: 142k]
  |  |  |  |  ------------------
  |  |  |  | 1112|     69|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     69|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|     69|			break; \
  |  |  |  | 1114|    360|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    360|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 360, False: 141k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    360|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    360|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    360|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 360]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    360|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    360|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    360|		return -1; \
  |  |  |  |  |  | 1090|    360|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    360|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 360]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    360|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    360|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    360|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    360|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    360|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 360]
  |  |  |  |  ------------------
  |  |  |  | 1117|    360|				return -1; \
  |  |  |  | 1118|    360|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    360|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    360|			break; \
  |  |  |  | 1120|    360|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|     66|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 66, False: 142k]
  |  |  |  |  ------------------
  |  |  |  | 1121|     66|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     66|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 66]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|     66|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     66|		return -1; \
  |  |  |  |  |  | 1090|     66|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 66]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|     66|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|     66|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|     66|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 66]
  |  |  |  |  ------------------
  |  |  |  | 1123|     66|				return -1; \
  |  |  |  | 1124|     66|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|     66|			break; \
  |  |  |  | 1126|   142k|		} \
  |  |  |  | 1127|  1.41M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.41M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.41M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.41M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  9.72M|	} else { \
  |  | 1134|  9.72M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  9.72M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  9.72M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 520k, False: 9.20M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  9.72M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   520k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 520k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   490k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   490k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 490k, False: 29.6k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   490k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   490k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   490k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 520k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 520k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     74|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|     74|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 74, False: 520k]
  |  |  |  |  ------------------
  |  |  |  | 1106|     74|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     74|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     74|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 520k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 520k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|     63|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|     63|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 63, False: 520k]
  |  |  |  |  ------------------
  |  |  |  | 1115|     63|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     63|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     63|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 63]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|     63|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     63|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     63|		return -1; \
  |  |  |  |  |  | 1090|     63|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     63|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 63]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|     63|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     63|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|     63|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|     63|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     63|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 63]
  |  |  |  |  ------------------
  |  |  |  | 1117|     63|				return -1; \
  |  |  |  | 1118|     63|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     63|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|     63|			break; \
  |  |  |  | 1120|  29.5k|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|  29.5k|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 29.5k, False: 490k]
  |  |  |  |  ------------------
  |  |  |  | 1121|  29.5k|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  29.5k|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  29.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 29.5k]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|  29.5k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  29.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|  29.5k|		return -1; \
  |  |  |  |  |  | 1090|  29.5k|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  29.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 29.5k]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|  29.5k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  29.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|  29.5k|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|  29.5k|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  29.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 29.5k]
  |  |  |  |  ------------------
  |  |  |  | 1123|  29.5k|				return -1; \
  |  |  |  | 1124|  29.5k|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  29.5k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|  29.5k|			break; \
  |  |  |  | 1126|   520k|		} \
  |  |  |  | 1127|  9.72M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  9.72M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 9.72M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  9.72M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  9.72M|	}
  ------------------
 1148|  11.1M|	return 0;
 1149|  11.1M|}
softmagic.c:cvt_32:
 1153|  22.5M|{
 1154|  22.5M|	DO_CVT(m, l, 32);
  ------------------
  |  | 1131|  22.5M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  22.5M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 3.30M, False: 19.2M]
  |  |  ------------------
  |  | 1132|  3.30M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  3.30M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  3.30M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 501k, False: 2.80M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  3.30M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   501k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 501k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   500k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   500k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 500k, False: 1.19k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   500k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   500k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   500k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 501k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|    105|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|    105|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 105, False: 501k]
  |  |  |  |  ------------------
  |  |  |  | 1103|    105|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    105|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|    105|			break; \
  |  |  |  | 1105|    134|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|    134|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 134, False: 501k]
  |  |  |  |  ------------------
  |  |  |  | 1106|    134|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    134|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|    134|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 501k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 501k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    601|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    601|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 601, False: 500k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    601|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    601|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    601|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    601|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    601|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    601|		return -1; \
  |  |  |  |  |  | 1090|    601|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    601|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 601]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    601|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    601|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    601|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    601|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    601|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 601]
  |  |  |  |  ------------------
  |  |  |  | 1117|    601|				return -1; \
  |  |  |  | 1118|    601|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    601|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    601|			break; \
  |  |  |  | 1120|    601|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    357|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 357, False: 501k]
  |  |  |  |  ------------------
  |  |  |  | 1121|    357|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    357|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    357|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    357|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    357|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    357|		return -1; \
  |  |  |  |  |  | 1090|    357|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    357|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 357]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    357|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    357|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    357|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    357|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    357|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 357]
  |  |  |  |  ------------------
  |  |  |  | 1123|    357|				return -1; \
  |  |  |  | 1124|    357|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    357|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    357|			break; \
  |  |  |  | 1126|   501k|		} \
  |  |  |  | 1127|  3.30M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  3.30M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 3.30M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  3.30M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  19.2M|	} else { \
  |  | 1134|  19.2M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  19.2M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  19.2M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 3.38M, False: 15.8M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  19.2M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|  3.38M|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 3.38M, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  3.38M|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  3.38M|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 3.38M, False: 350]
  |  |  |  |  ------------------
  |  |  |  | 1097|  3.38M|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  3.38M|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  3.38M|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 3.38M]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 3.38M]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     34|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|     34|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 34, False: 3.38M]
  |  |  |  |  ------------------
  |  |  |  | 1106|     34|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     34|			break; \
  |  |  |  | 1108|    124|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|    124|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 124, False: 3.38M]
  |  |  |  |  ------------------
  |  |  |  | 1109|    124|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    124|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|    124|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 3.38M]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|      0|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|      0|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 0, False: 3.38M]
  |  |  |  |  ------------------
  |  |  |  | 1115|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|      0|		return -1; \
  |  |  |  |  |  | 1090|      0|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|      0|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1117|      0|				return -1; \
  |  |  |  | 1118|      0|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|      0|			break; \
  |  |  |  | 1120|    192|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    192|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 192, False: 3.38M]
  |  |  |  |  ------------------
  |  |  |  | 1121|    192|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    192|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    192|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    384|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 68, False: 124]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    192|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     68|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    260|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 68]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    192|		return -1; \
  |  |  |  |  |  | 1090|    192|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    192|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 192]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    192|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    192|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    192|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    192|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    192|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 192]
  |  |  |  |  ------------------
  |  |  |  | 1123|    192|				return -1; \
  |  |  |  | 1124|    192|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    192|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    192|			break; \
  |  |  |  | 1126|  3.38M|		} \
  |  |  |  | 1127|  19.2M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  19.2M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 19.2M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  19.2M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  19.2M|	}
  ------------------
 1155|  22.5M|	return 0;
 1156|  22.5M|}
softmagic.c:cvt_64:
 1160|  2.11M|{
 1161|  2.11M|	DO_CVT(m, q, 64);
  ------------------
  |  | 1131|  2.11M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  2.11M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 799k, False: 1.31M]
  |  |  ------------------
  |  | 1132|   799k|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|   799k|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|   799k|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 242k, False: 556k]
  |  |  |  |  ------------------
  |  |  |  | 1095|   799k|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   242k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 242k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   242k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   242k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 242k, False: 66]
  |  |  |  |  ------------------
  |  |  |  | 1097|   242k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   242k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   242k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 242k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 242k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     66|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|     66|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 66, False: 242k]
  |  |  |  |  ------------------
  |  |  |  | 1106|     66|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     66|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 242k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 242k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|      0|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|      0|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 0, False: 242k]
  |  |  |  |  ------------------
  |  |  |  | 1115|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|      0|		return -1; \
  |  |  |  |  |  | 1090|      0|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|      0|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1117|      0|				return -1; \
  |  |  |  | 1118|      0|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|      0|			break; \
  |  |  |  | 1120|      0|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 0, False: 242k]
  |  |  |  |  ------------------
  |  |  |  | 1121|      0|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|      0|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|      0|		return -1; \
  |  |  |  |  |  | 1090|      0|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|      0|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|      0|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1123|      0|				return -1; \
  |  |  |  | 1124|      0|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|      0|			break; \
  |  |  |  | 1126|   242k|		} \
  |  |  |  | 1127|   799k|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|   799k|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 799k]
  |  |  |  |  ------------------
  |  |  |  | 1128|   799k|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  1.31M|	} else { \
  |  | 1134|  1.31M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  1.31M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.31M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 35.6k, False: 1.28M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.31M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|  35.6k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 35.6k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  34.4k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  34.4k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 34.4k, False: 1.15k]
  |  |  |  |  ------------------
  |  |  |  | 1097|  34.4k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  34.4k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  34.4k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 35.6k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|      0|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|      0|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 0, False: 35.6k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|      0|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|      0|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 0, False: 35.6k]
  |  |  |  |  ------------------
  |  |  |  | 1106|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 35.6k]
  |  |  |  |  ------------------
  |  |  |  | 1109|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|      0|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 35.6k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    263|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    263|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 263, False: 35.3k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    263|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    263|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    263|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 263]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    263|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    263|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    263|		return -1; \
  |  |  |  |  |  | 1090|    263|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    263|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    526|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 66, False: 197]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    263|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    329|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 66]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    263|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    263|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    263|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 263]
  |  |  |  |  ------------------
  |  |  |  | 1117|    263|				return -1; \
  |  |  |  | 1118|    263|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    263|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    263|			break; \
  |  |  |  | 1120|    896|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    896|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 896, False: 34.7k]
  |  |  |  |  ------------------
  |  |  |  | 1121|    896|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    896|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    896|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 896]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    896|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    896|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    896|		return -1; \
  |  |  |  |  |  | 1090|    896|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    896|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  1.79k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 896]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    896|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    896|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    896|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    896|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    896|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 896]
  |  |  |  |  ------------------
  |  |  |  | 1123|    896|				return -1; \
  |  |  |  | 1124|    896|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    896|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    896|			break; \
  |  |  |  | 1126|  35.6k|		} \
  |  |  |  | 1127|  1.31M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.31M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.31M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.31M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  1.31M|	}
  ------------------
 1162|  2.11M|	return 0;
 1163|  2.11M|}
softmagic.c:cvt_float:
 1186|  4.56k|{
 1187|  4.56k|	DO_CVT2(f, float);
  ------------------
  |  | 1166|  4.56k|	if (m->num_mask) \
  |  |  ------------------
  |  |  |  |  388|  4.56k|#define num_mask _u._mask
  |  |  ------------------
  |  |  |  Branch (1166:6): [True: 0, False: 4.56k]
  |  |  ------------------
  |  | 1167|  4.56k|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  ------------------
  |  |  |  |  360|      0|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  ------------------
  |  |  |  Branch (1167:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1168|      0|		case FILE_OPADD: \
  |  |  ------------------
  |  |  |  |  355|      0|#define				FILE_OPADD	3
  |  |  ------------------
  |  |  |  Branch (1168:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1169|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1170|      0|			break; \
  |  | 1171|      0|		case FILE_OPMINUS: \
  |  |  ------------------
  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  ------------------
  |  |  |  Branch (1171:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1172|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1173|      0|			break; \
  |  | 1174|      0|		case FILE_OPMULTIPLY: \
  |  |  ------------------
  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  ------------------
  |  |  |  Branch (1174:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1175|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1176|      0|			break; \
  |  | 1177|      0|		case FILE_OPDIVIDE: \
  |  |  ------------------
  |  |  |  |  358|      0|#define				FILE_OPDIVIDE	6
  |  |  ------------------
  |  |  |  Branch (1177:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1178|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (1178:8): [True: 0, False: 0]
  |  |  ------------------
  |  | 1179|      0|				return -1; \
  |  | 1180|      0|			p->fld /= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1181|      0|			break; \
  |  | 1182|      0|		} \
  ------------------
 1188|  4.56k|	return 0;
 1189|  4.56k|}
softmagic.c:cvt_double:
 1193|    720|{
 1194|    720|	DO_CVT2(d, double);
  ------------------
  |  | 1166|    720|	if (m->num_mask) \
  |  |  ------------------
  |  |  |  |  388|    720|#define num_mask _u._mask
  |  |  ------------------
  |  |  |  Branch (1166:6): [True: 0, False: 720]
  |  |  ------------------
  |  | 1167|    720|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  ------------------
  |  |  |  |  360|      0|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  ------------------
  |  |  |  Branch (1167:11): [True: 0, False: 0]
  |  |  ------------------
  |  | 1168|      0|		case FILE_OPADD: \
  |  |  ------------------
  |  |  |  |  355|      0|#define				FILE_OPADD	3
  |  |  ------------------
  |  |  |  Branch (1168:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1169|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1170|      0|			break; \
  |  | 1171|      0|		case FILE_OPMINUS: \
  |  |  ------------------
  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  ------------------
  |  |  |  Branch (1171:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1172|      0|			p->fld -= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1173|      0|			break; \
  |  | 1174|      0|		case FILE_OPMULTIPLY: \
  |  |  ------------------
  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  ------------------
  |  |  |  Branch (1174:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1175|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1176|      0|			break; \
  |  | 1177|      0|		case FILE_OPDIVIDE: \
  |  |  ------------------
  |  |  |  |  358|      0|#define				FILE_OPDIVIDE	6
  |  |  ------------------
  |  |  |  Branch (1177:3): [True: 0, False: 0]
  |  |  ------------------
  |  | 1178|      0|			if (CAST(type, m->num_mask) == 0) \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (1178:8): [True: 0, False: 0]
  |  |  ------------------
  |  | 1179|      0|				return -1; \
  |  | 1180|      0|			p->fld /= CAST(type, m->num_mask); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  | 1181|      0|			break; \
  |  | 1182|      0|		} \
  ------------------
 1195|    720|	return 0;
 1196|    720|}
softmagic.c:magiccheck:
 2171|   104M|{
 2172|   104M|	uint64_t l = m->value.q;
 2173|   104M|	uint64_t v;
 2174|   104M|	float fl, fv;
 2175|   104M|	double dl, dv;
 2176|   104M|	int matched;
 2177|   104M|	union VALUETYPE *p = &ms->ms_value;
 2178|       |
 2179|   104M|	switch (m->type) {
 2180|  1.92M|	case FILE_BYTE:
  ------------------
  |  |  254|  1.92M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (2180:2): [True: 1.92M, False: 102M]
  ------------------
 2181|  1.92M|		v = p->b;
 2182|  1.92M|		break;
 2183|       |
 2184|  1.91M|	case FILE_SHORT:
  ------------------
  |  |  255|  1.91M|#define				FILE_SHORT		2
  ------------------
  |  Branch (2184:2): [True: 1.91M, False: 102M]
  ------------------
 2185|  6.56M|	case FILE_BESHORT:
  ------------------
  |  |  260|  6.56M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (2185:2): [True: 4.64M, False: 100M]
  ------------------
 2186|  11.1M|	case FILE_LESHORT:
  ------------------
  |  |  263|  11.1M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (2186:2): [True: 4.58M, False: 100M]
  ------------------
 2187|  11.1M|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|  11.1M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (2187:2): [True: 0, False: 104M]
  ------------------
 2188|  11.1M|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|  11.1M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (2188:2): [True: 241, False: 104M]
  ------------------
 2189|  11.1M|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|  11.1M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (2189:2): [True: 0, False: 104M]
  ------------------
 2190|  11.1M|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|  11.1M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (2190:2): [True: 0, False: 104M]
  ------------------
 2191|  11.1M|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|  11.1M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (2191:2): [True: 241, False: 104M]
  ------------------
 2192|  11.1M|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|  11.1M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (2192:2): [True: 0, False: 104M]
  ------------------
 2193|  11.1M|		v = p->h;
 2194|  11.1M|		break;
 2195|       |
 2196|  1.66M|	case FILE_LONG:
  ------------------
  |  |  257|  1.66M|#define				FILE_LONG		4
  ------------------
  |  Branch (2196:2): [True: 1.66M, False: 102M]
  ------------------
 2197|  15.6M|	case FILE_BELONG:
  ------------------
  |  |  261|  15.6M|#define				FILE_BELONG		8
  ------------------
  |  Branch (2197:2): [True: 13.9M, False: 90.7M]
  ------------------
 2198|  22.5M|	case FILE_LELONG:
  ------------------
  |  |  264|  22.5M|#define				FILE_LELONG		11
  ------------------
  |  Branch (2198:2): [True: 6.96M, False: 97.6M]
  ------------------
 2199|  22.5M|	case FILE_MELONG:
  ------------------
  |  |  276|  22.5M|#define				FILE_MELONG		23
  ------------------
  |  Branch (2199:2): [True: 35, False: 104M]
  ------------------
 2200|  22.5M|	case FILE_DATE:
  ------------------
  |  |  259|  22.5M|#define				FILE_DATE		6
  ------------------
  |  Branch (2200:2): [True: 0, False: 104M]
  ------------------
 2201|  22.5M|	case FILE_BEDATE:
  ------------------
  |  |  262|  22.5M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (2201:2): [True: 424, False: 104M]
  ------------------
 2202|  22.5M|	case FILE_LEDATE:
  ------------------
  |  |  265|  22.5M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (2202:2): [True: 434, False: 104M]
  ------------------
 2203|  22.5M|	case FILE_MEDATE:
  ------------------
  |  |  274|  22.5M|#define				FILE_MEDATE		21
  ------------------
  |  Branch (2203:2): [True: 99, False: 104M]
  ------------------
 2204|  22.5M|	case FILE_LDATE:
  ------------------
  |  |  267|  22.5M|#define				FILE_LDATE		14
  ------------------
  |  Branch (2204:2): [True: 0, False: 104M]
  ------------------
 2205|  22.5M|	case FILE_BELDATE:
  ------------------
  |  |  268|  22.5M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (2205:2): [True: 242, False: 104M]
  ------------------
 2206|  22.5M|	case FILE_LELDATE:
  ------------------
  |  |  269|  22.5M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (2206:2): [True: 34, False: 104M]
  ------------------
 2207|  22.5M|	case FILE_MELDATE:
  ------------------
  |  |  275|  22.5M|#define				FILE_MELDATE		22
  ------------------
  |  Branch (2207:2): [True: 0, False: 104M]
  ------------------
 2208|  22.5M|		v = p->l;
 2209|  22.5M|		break;
 2210|       |
 2211|  71.5k|	case FILE_QUAD:
  ------------------
  |  |  277|  71.5k|#define				FILE_QUAD		24
  ------------------
  |  Branch (2211:2): [True: 71.5k, False: 104M]
  ------------------
 2212|   999k|	case FILE_LEQUAD:
  ------------------
  |  |  278|   999k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (2212:2): [True: 928k, False: 103M]
  ------------------
 2213|  2.10M|	case FILE_BEQUAD:
  ------------------
  |  |  279|  2.10M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (2213:2): [True: 1.10M, False: 103M]
  ------------------
 2214|  2.10M|	case FILE_QDATE:
  ------------------
  |  |  280|  2.10M|#define				FILE_QDATE		27
  ------------------
  |  Branch (2214:2): [True: 0, False: 104M]
  ------------------
 2215|  2.10M|	case FILE_BEQDATE:
  ------------------
  |  |  282|  2.10M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (2215:2): [True: 264, False: 104M]
  ------------------
 2216|  2.10M|	case FILE_LEQDATE:
  ------------------
  |  |  281|  2.10M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (2216:2): [True: 0, False: 104M]
  ------------------
 2217|  2.10M|	case FILE_QLDATE:
  ------------------
  |  |  283|  2.10M|#define				FILE_QLDATE		30
  ------------------
  |  Branch (2217:2): [True: 0, False: 104M]
  ------------------
 2218|  2.10M|	case FILE_BEQLDATE:
  ------------------
  |  |  285|  2.10M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (2218:2): [True: 263, False: 104M]
  ------------------
 2219|  2.10M|	case FILE_LEQLDATE:
  ------------------
  |  |  284|  2.10M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (2219:2): [True: 10, False: 104M]
  ------------------
 2220|  2.10M|	case FILE_QWDATE:
  ------------------
  |  |  295|  2.10M|#define				FILE_QWDATE		42
  ------------------
  |  Branch (2220:2): [True: 313, False: 104M]
  ------------------
 2221|  2.10M|	case FILE_BEQWDATE:
  ------------------
  |  |  297|  2.10M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (2221:2): [True: 0, False: 104M]
  ------------------
 2222|  2.11M|	case FILE_LEQWDATE:
  ------------------
  |  |  296|  2.11M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (2222:2): [True: 1.76k, False: 104M]
  ------------------
 2223|  2.11M|	case FILE_OFFSET:
  ------------------
  |  |  305|  2.11M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (2223:2): [True: 4.16k, False: 104M]
  ------------------
 2224|  2.11M|		v = p->q;
 2225|  2.11M|		break;
 2226|       |
 2227|      0|	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (2227:2): [True: 0, False: 104M]
  ------------------
 2228|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (2228:2): [True: 0, False: 104M]
  ------------------
 2229|  4.56k|	case FILE_LEFLOAT:
  ------------------
  |  |  288|  4.56k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (2229:2): [True: 4.56k, False: 104M]
  ------------------
 2230|  4.56k|		fl = m->value.f;
 2231|  4.56k|		fv = p->f;
 2232|  4.56k|		switch (m->reln) {
 2233|    390|		case 'x':
  ------------------
  |  Branch (2233:3): [True: 390, False: 4.17k]
  ------------------
 2234|    390|			matched = 1;
 2235|    390|			break;
 2236|       |
 2237|      0|		case '!':
  ------------------
  |  Branch (2237:3): [True: 0, False: 4.56k]
  ------------------
 2238|      0|			matched = isunordered(fl, fv) ? 1 : fv != fl;
  ------------------
  |  Branch (2238:14): [True: 0, False: 0]
  ------------------
 2239|      0|			break;
 2240|       |
 2241|      0|		case '=':
  ------------------
  |  Branch (2241:3): [True: 0, False: 4.56k]
  ------------------
 2242|      0|			matched = isunordered(fl, fv) ? 0 : fv == fl;
  ------------------
  |  Branch (2242:14): [True: 0, False: 0]
  ------------------
 2243|      0|			break;
 2244|       |
 2245|  4.17k|		case '>':
  ------------------
  |  Branch (2245:3): [True: 4.17k, False: 390]
  ------------------
 2246|  4.17k|			matched = isgreater(fv, fl);
 2247|  4.17k|			break;
 2248|       |
 2249|      0|		case '<':
  ------------------
  |  Branch (2249:3): [True: 0, False: 4.56k]
  ------------------
 2250|      0|			matched = isless(fv, fl);
 2251|      0|			break;
 2252|       |
 2253|      0|		default:
  ------------------
  |  Branch (2253:3): [True: 0, False: 4.56k]
  ------------------
 2254|      0|			file_magerror(ms, "cannot happen with float: "
 2255|      0|			    "invalid relation `%c'", m->reln);
 2256|      0|			return -1;
 2257|  4.56k|		}
 2258|  4.56k|		return matched;
 2259|       |
 2260|      0|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (2260:2): [True: 0, False: 104M]
  ------------------
 2261|    134|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|    134|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (2261:2): [True: 134, False: 104M]
  ------------------
 2262|    720|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|    720|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (2262:2): [True: 586, False: 104M]
  ------------------
 2263|    720|		dl = m->value.d;
 2264|    720|		dv = p->d;
 2265|    720|		switch (m->reln) {
 2266|    520|		case 'x':
  ------------------
  |  Branch (2266:3): [True: 520, False: 200]
  ------------------
 2267|    520|			matched = 1;
 2268|    520|			break;
 2269|       |
 2270|      0|		case '!':
  ------------------
  |  Branch (2270:3): [True: 0, False: 720]
  ------------------
 2271|      0|			matched = isunordered(dv, dl) ? 1 : dv != dl;
  ------------------
  |  Branch (2271:14): [True: 0, False: 0]
  ------------------
 2272|      0|			break;
 2273|       |
 2274|    200|		case '=':
  ------------------
  |  Branch (2274:3): [True: 200, False: 520]
  ------------------
 2275|    200|			matched = isunordered(dv, dl) ? 0 : dv == dl;
  ------------------
  |  Branch (2275:14): [True: 82, False: 118]
  ------------------
 2276|    200|			break;
 2277|       |
 2278|      0|		case '>':
  ------------------
  |  Branch (2278:3): [True: 0, False: 720]
  ------------------
 2279|      0|			matched = isgreater(dv, dl);
 2280|      0|			break;
 2281|       |
 2282|      0|		case '<':
  ------------------
  |  Branch (2282:3): [True: 0, False: 720]
  ------------------
 2283|      0|			matched = isless(dv, dl);
 2284|      0|			break;
 2285|       |
 2286|      0|		default:
  ------------------
  |  Branch (2286:3): [True: 0, False: 720]
  ------------------
 2287|      0|			file_magerror(ms, "cannot happen with double: "
 2288|      0|			    "invalid relation `%c'", m->reln);
 2289|      0|			return -1;
 2290|    720|		}
 2291|    720|		return matched;
 2292|       |
 2293|  11.9k|	case FILE_DEFAULT:
  ------------------
  |  |  256|  11.9k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (2293:2): [True: 11.9k, False: 104M]
  ------------------
 2294|  15.4k|	case FILE_CLEAR:
  ------------------
  |  |  300|  15.4k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (2294:2): [True: 3.52k, False: 104M]
  ------------------
 2295|  15.4k|		l = 0;
 2296|  15.4k|		v = 0;
 2297|  15.4k|		break;
 2298|       |
 2299|  64.7M|	case FILE_STRING:
  ------------------
  |  |  258|  64.7M|#define				FILE_STRING		5
  ------------------
  |  Branch (2299:2): [True: 64.7M, False: 39.8M]
  ------------------
 2300|  64.7M|	case FILE_PSTRING:
  ------------------
  |  |  266|  64.7M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (2300:2): [True: 27.0k, False: 104M]
  ------------------
 2301|  64.7M|	case FILE_OCTAL:
  ------------------
  |  |  314|  64.7M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (2301:2): [True: 0, False: 104M]
  ------------------
 2302|  64.7M|		l = 0;
 2303|  64.7M|		v = file_strncmp(m->value.s, p->s, CAST(size_t, m->vallen),
  ------------------
  |  |  460|  64.7M|#define CAST(T, b)	((T)(b))
  ------------------
 2304|  64.7M|		    sizeof(p->s), m->str_flags);
  ------------------
  |  |  390|  64.7M|#define str_flags _u._s._flags
  ------------------
 2305|  64.7M|		break;
 2306|       |
 2307|    216|	case FILE_BESTRING16:
  ------------------
  |  |  271|    216|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (2307:2): [True: 216, False: 104M]
  ------------------
 2308|  69.9k|	case FILE_LESTRING16:
  ------------------
  |  |  272|  69.9k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (2308:2): [True: 69.6k, False: 104M]
  ------------------
 2309|  69.9k|		l = 0;
 2310|  69.9k|		v = file_strncmp16(m->value.s, p->s, CAST(size_t, m->vallen),
  ------------------
  |  |  460|  69.9k|#define CAST(T, b)	((T)(b))
  ------------------
 2311|  69.9k|		    sizeof(p->s), m->str_flags);
  ------------------
  |  |  390|  69.9k|#define str_flags _u._s._flags
  ------------------
 2312|  69.9k|		break;
 2313|       |
 2314|   733k|	case FILE_SEARCH: { /* search ms->search.s for the string m->value.s */
  ------------------
  |  |  273|   733k|#define				FILE_SEARCH		20
  ------------------
  |  Branch (2314:2): [True: 733k, False: 103M]
  ------------------
 2315|   733k|		size_t slen;
 2316|   733k|		size_t idx;
 2317|       |
 2318|   733k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (2318:7): [True: 0, False: 733k]
  ------------------
 2319|      0|			return 0;
 2320|       |
 2321|   733k|		slen = MIN(m->vallen, sizeof(m->value.s));
  ------------------
  |  Branch (2321:10): [True: 733k, False: 0]
  ------------------
 2322|   733k|		l = 0;
 2323|   733k|		v = 0;
 2324|   733k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   733k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2324:7): [True: 0, False: 733k]
  ------------------
 2325|      0|			size_t xlen = ms->search.s_len > 100 ? 100
  ------------------
  |  Branch (2325:18): [True: 0, False: 0]
  ------------------
 2326|      0|			    : ms->search.s_len;
 2327|       |
 2328|      0|			fprintf(stderr, "search: [");
 2329|      0|			file_showstr(stderr, ms->search.s, xlen);
 2330|      0|			fprintf(stderr, "%s] for [", ms->search.s_len == xlen
  ------------------
  |  Branch (2330:33): [True: 0, False: 0]
  ------------------
 2331|      0|			    ? "" : "...");
 2332|      0|			file_showstr(stderr, m->value.s, slen);
 2333|      0|		}
 2334|   733k|#ifdef HAVE_MEMMEM
 2335|   733k|		if (slen > 0 && m->str_flags == 0) {
  ------------------
  |  |  390|   733k|#define str_flags _u._s._flags
  ------------------
  |  Branch (2335:7): [True: 733k, False: 0]
  |  Branch (2335:19): [True: 348k, False: 385k]
  ------------------
 2336|   348k|			const char *found;
 2337|   348k|			idx = m->str_range + slen;
  ------------------
  |  |  389|   348k|#define str_range _u._s._count
  ------------------
 2338|   348k|			if (m->str_range == 0 || ms->search.s_len < idx)
  ------------------
  |  |  389|   348k|#define str_range _u._s._count
  ------------------
  |  Branch (2338:8): [True: 4.77k, False: 343k]
  |  Branch (2338:29): [True: 114k, False: 229k]
  ------------------
 2339|   119k|				idx = ms->search.s_len;
 2340|   348k|			found = CAST(const char *, memmem(ms->search.s, idx,
  ------------------
  |  |  460|   348k|#define CAST(T, b)	((T)(b))
  ------------------
 2341|   348k|			    m->value.s, slen));
 2342|   348k|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   348k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2342:8): [True: 0, False: 348k]
  ------------------
 2343|      0|				fprintf(stderr, "] %sfound\n",
 2344|      0|				    found ? "" : "not ");
  ------------------
  |  Branch (2344:9): [True: 0, False: 0]
  ------------------
 2345|      0|			}
 2346|   348k|			if (!found) {
  ------------------
  |  Branch (2346:8): [True: 346k, False: 2.40k]
  ------------------
 2347|   346k|				v = 1;
 2348|   346k|				break;
 2349|   346k|			}
 2350|  2.40k|			idx = found - ms->search.s;
 2351|  2.40k|			ms->search.offset += idx;
 2352|  2.40k|			ms->search.rm_len = ms->search.s_len - idx;
 2353|  2.40k|			break;
 2354|   348k|		}
 2355|   385k|#endif
 2356|       |
 2357|  3.92G|		for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
  ------------------
  |  |  389|  3.92G|#define str_range _u._s._count
  ------------------
              		for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
  ------------------
  |  |  389|  3.92G|#define str_range _u._s._count
  ------------------
  |  Branch (2357:17): [True: 0, False: 3.92G]
  |  Branch (2357:38): [True: 3.92G, False: 200k]
  ------------------
 2358|  3.92G|			if (slen + idx > ms->search.s_len) {
  ------------------
  |  Branch (2358:8): [True: 183k, False: 3.92G]
  ------------------
 2359|   183k|				v = 1;
 2360|   183k|				break;
 2361|   183k|			}
 2362|       |
 2363|  3.92G|			v = file_strncmp(m->value.s, ms->search.s + idx, slen,
 2364|  3.92G|			    ms->search.s_len - idx, m->str_flags);
  ------------------
  |  |  390|  3.92G|#define str_flags _u._s._flags
  ------------------
 2365|  3.92G|			if (v == 0) {	/* found match */
  ------------------
  |  Branch (2365:8): [True: 746, False: 3.92G]
  ------------------
 2366|    746|				ms->search.offset += idx;
 2367|    746|				ms->search.rm_len = ms->search.s_len - idx;
 2368|    746|				break;
 2369|    746|			}
 2370|  3.92G|		}
 2371|   385k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   385k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2371:7): [True: 0, False: 385k]
  ------------------
 2372|      0|			fprintf(stderr, "] %sfound\n", v == 0 ? "" : "not ");
  ------------------
  |  Branch (2372:35): [True: 0, False: 0]
  ------------------
 2373|      0|		}
 2374|   385k|		break;
 2375|   733k|	}
 2376|   508k|	case FILE_REGEX: {
  ------------------
  |  |  270|   508k|#define				FILE_REGEX		17
  ------------------
  |  Branch (2376:2): [True: 508k, False: 104M]
  ------------------
 2377|   508k|		int rc;
 2378|   508k|		file_regex_t *rx = *m_cache;
 2379|   508k|		const char *search;
 2380|   508k|		regmatch_t pmatch;
 2381|   508k|		size_t slen = ms->search.s_len;
 2382|   508k|		char *copy;
 2383|       |
 2384|   508k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (2384:7): [True: 34, False: 508k]
  ------------------
 2385|     34|			return 0;
 2386|       |
 2387|   508k|		if (rx == NULL) {
  ------------------
  |  Branch (2387:7): [True: 171, False: 508k]
  ------------------
 2388|    171|			rx = *m_cache = alloc_regex(ms, m);
 2389|    171|			if (rx == NULL)
  ------------------
  |  Branch (2389:8): [True: 0, False: 171]
  ------------------
 2390|      0|				return -1;
 2391|    171|		}
 2392|   508k|		l = 0;
 2393|   508k|		if (slen != 0) {
  ------------------
  |  Branch (2393:7): [True: 504k, False: 4.20k]
  ------------------
 2394|   504k|		    copy = CAST(char *, malloc(slen));
  ------------------
  |  |  460|   504k|#define CAST(T, b)	((T)(b))
  ------------------
 2395|   504k|		    if (copy == NULL)  {
  ------------------
  |  Branch (2395:11): [True: 0, False: 504k]
  ------------------
 2396|      0|			file_error(ms, errno,
 2397|      0|			    "can't allocate %" SIZE_T_FORMAT "u bytes",
 2398|      0|			    slen);
 2399|      0|			return -1;
 2400|      0|		    }
 2401|   504k|		    memcpy(copy, ms->search.s, slen);
 2402|   504k|		    copy[--slen] = '\0';
 2403|   504k|		    search = copy;
 2404|   504k|		} else {
 2405|  4.20k|		    search = CCAST(char *, "");
  ------------------
  |  |  462|  4.20k|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2406|  4.20k|		    copy = NULL;
 2407|  4.20k|		}
 2408|   508k|		rc = file_regexec(ms, rx, RCAST(const char *, search),
  ------------------
  |  |  461|   508k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2409|   508k|		    1, &pmatch, 0);
 2410|   508k|		free(copy);
 2411|   508k|		switch (rc) {
 2412|  4.21k|		case 0:
  ------------------
  |  Branch (2412:3): [True: 4.21k, False: 504k]
  ------------------
 2413|       |			/* Sanity check */
 2414|  4.21k|			if (pmatch.rm_so < 0 || pmatch.rm_eo < 0 ||
  ------------------
  |  Branch (2414:8): [True: 0, False: 4.21k]
  |  Branch (2414:28): [True: 0, False: 4.21k]
  ------------------
 2415|  4.21k|			    pmatch.rm_eo < pmatch.rm_so ||
  ------------------
  |  Branch (2415:8): [True: 0, False: 4.21k]
  ------------------
 2416|  4.21k|			    CAST(size_t, pmatch.rm_eo) > slen) {
  ------------------
  |  |  460|  4.21k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (2416:8): [True: 0, False: 4.21k]
  ------------------
 2417|      0|				v = 1;
 2418|      0|				break;
 2419|      0|			}
 2420|       |
 2421|  4.21k|			ms->search.s += CAST(int, pmatch.rm_so);
  ------------------
  |  |  460|  4.21k|#define CAST(T, b)	((T)(b))
  ------------------
 2422|  4.21k|			ms->search.offset += CAST(size_t, pmatch.rm_so);
  ------------------
  |  |  460|  4.21k|#define CAST(T, b)	((T)(b))
  ------------------
 2423|  4.21k|			ms->search.rm_len = CAST(size_t,
  ------------------
  |  |  460|  4.21k|#define CAST(T, b)	((T)(b))
  ------------------
 2424|  4.21k|			    pmatch.rm_eo - pmatch.rm_so);
 2425|  4.21k|			v = 0;
 2426|  4.21k|			break;
 2427|       |
 2428|   504k|		case REG_NOMATCH:
  ------------------
  |  Branch (2428:3): [True: 504k, False: 4.21k]
  ------------------
 2429|   504k|			v = 1;
 2430|   504k|			break;
 2431|       |
 2432|      0|		default:
  ------------------
  |  Branch (2432:3): [True: 0, False: 508k]
  ------------------
 2433|      0|			return -1;
 2434|   508k|		}
 2435|   508k|		break;
 2436|   508k|	}
 2437|   508k|	case FILE_USE:
  ------------------
  |  |  299|  59.6k|#define				FILE_USE		46
  ------------------
  |  Branch (2437:2): [True: 59.6k, False: 104M]
  ------------------
 2438|  59.6k|		return ms->ms_value.q != 0;
 2439|  65.7k|	case FILE_NAME:
  ------------------
  |  |  298|  65.7k|#define				FILE_NAME		45
  ------------------
  |  Branch (2439:2): [True: 65.7k, False: 104M]
  ------------------
 2440|  80.2k|	case FILE_INDIRECT:
  ------------------
  |  |  294|  80.2k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (2440:2): [True: 14.4k, False: 104M]
  ------------------
 2441|  80.2k|		return 1;
 2442|   443k|	case FILE_DER:
  ------------------
  |  |  301|   443k|#define				FILE_DER		48
  ------------------
  |  Branch (2442:2): [True: 443k, False: 104M]
  ------------------
 2443|   443k|		matched = der_cmp(ms, m);
 2444|   443k|		if (matched == -1) {
  ------------------
  |  Branch (2444:7): [True: 153k, False: 289k]
  ------------------
 2445|   153k|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   153k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2445:8): [True: 0, False: 153k]
  ------------------
 2446|      0|				(void) fprintf(stderr,
 2447|      0|				    "EOF comparing DER entries\n");
 2448|      0|			}
 2449|   153k|			return 0;
 2450|   153k|		}
 2451|   289k|		return matched;
 2452|     66|	case FILE_BEGUID:
  ------------------
  |  |  304|     66|#define				FILE_BEGUID		51
  ------------------
  |  Branch (2452:2): [True: 66, False: 104M]
  ------------------
 2453|     66|	case FILE_LEGUID:
  ------------------
  |  |  303|     66|#define				FILE_LEGUID		50
  ------------------
  |  Branch (2453:2): [True: 0, False: 104M]
  ------------------
 2454|   200k|	case FILE_GUID:
  ------------------
  |  |  302|   200k|#define				FILE_GUID		49
  ------------------
  |  Branch (2454:2): [True: 200k, False: 104M]
  ------------------
 2455|   200k|		l = 0;
 2456|   200k|		v = memcmp(m->value.guid, p->guid, sizeof(p->guid));
 2457|   200k|		break;
 2458|      0|	default:
  ------------------
  |  Branch (2458:2): [True: 0, False: 104M]
  ------------------
 2459|      0|		file_magerror(ms, "invalid type %d in magiccheck()", m->type);
 2460|      0|		return -1;
 2461|   104M|	}
 2462|       |
 2463|   104M|	v = file_signextend(ms, m, v);
 2464|       |
 2465|   104M|	switch (m->reln) {
 2466|   109k|	case 'x':
  ------------------
  |  Branch (2466:2): [True: 109k, False: 103M]
  ------------------
 2467|   109k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   109k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2467:7): [True: 0, False: 109k]
  ------------------
 2468|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT
 2469|      0|			    "u == *any* = 1", CAST(unsigned long long, v));
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2470|   109k|		matched = 1;
 2471|   109k|		break;
 2472|       |
 2473|  67.9k|	case '!':
  ------------------
  |  Branch (2473:2): [True: 67.9k, False: 103M]
  ------------------
 2474|  67.9k|		matched = v != l;
 2475|  67.9k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  67.9k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2475:7): [True: 0, False: 67.9k]
  ------------------
 2476|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT "u != %"
 2477|      0|			    INT64_T_FORMAT "u = %d",
 2478|      0|			    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2479|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2480|  67.9k|		break;
 2481|       |
 2482|   103M|	case '=':
  ------------------
  |  Branch (2482:2): [True: 103M, False: 860k]
  ------------------
 2483|   103M|		matched = v == l;
 2484|   103M|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   103M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2484:7): [True: 0, False: 103M]
  ------------------
 2485|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT "u == %"
 2486|      0|			    INT64_T_FORMAT "u = %d",
 2487|      0|			    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2488|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2489|   103M|		break;
 2490|       |
 2491|   277k|	case '>':
  ------------------
  |  Branch (2491:2): [True: 277k, False: 103M]
  ------------------
 2492|   277k|		if (m->flag & UNSIGNED) {
  ------------------
  |  |  237|   277k|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (2492:7): [True: 199k, False: 78.3k]
  ------------------
 2493|   199k|			matched = v > l;
 2494|   199k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   199k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2494:8): [True: 0, False: 199k]
  ------------------
 2495|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2496|      0|				    "u > %" INT64_T_FORMAT "u = %d",
 2497|      0|				    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2498|      0|				    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2499|   199k|		}
 2500|  78.3k|		else {
 2501|  78.3k|			matched = CAST(int64_t, v) > CAST(int64_t, l);
  ------------------
  |  |  460|  78.3k|#define CAST(T, b)	((T)(b))
  ------------------
              			matched = CAST(int64_t, v) > CAST(int64_t, l);
  ------------------
  |  |  460|  78.3k|#define CAST(T, b)	((T)(b))
  ------------------
 2502|  78.3k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  78.3k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2502:8): [True: 0, False: 78.3k]
  ------------------
 2503|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2504|      0|				    "d > %" INT64_T_FORMAT "d = %d",
 2505|      0|				    CAST(long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2506|      0|				    CAST(long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2507|  78.3k|		}
 2508|   277k|		break;
 2509|       |
 2510|   364k|	case '<':
  ------------------
  |  Branch (2510:2): [True: 364k, False: 103M]
  ------------------
 2511|   364k|		if (m->flag & UNSIGNED) {
  ------------------
  |  |  237|   364k|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (2511:7): [True: 309k, False: 54.9k]
  ------------------
 2512|   309k|			matched = v < l;
 2513|   309k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   309k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2513:8): [True: 0, False: 309k]
  ------------------
 2514|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2515|      0|				    "u < %" INT64_T_FORMAT "u = %d",
 2516|      0|				    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2517|      0|				    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2518|   309k|		}
 2519|  54.9k|		else {
 2520|  54.9k|			matched = CAST(int64_t, v) < CAST(int64_t, l);
  ------------------
  |  |  460|  54.9k|#define CAST(T, b)	((T)(b))
  ------------------
              			matched = CAST(int64_t, v) < CAST(int64_t, l);
  ------------------
  |  |  460|  54.9k|#define CAST(T, b)	((T)(b))
  ------------------
 2521|  54.9k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  54.9k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2521:8): [True: 0, False: 54.9k]
  ------------------
 2522|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2523|      0|				    "d < %" INT64_T_FORMAT "d = %d",
 2524|      0|				     CAST(long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2525|      0|				     CAST(long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2526|  54.9k|		}
 2527|   364k|		break;
 2528|       |
 2529|  39.3k|	case '&':
  ------------------
  |  Branch (2529:2): [True: 39.3k, False: 104M]
  ------------------
 2530|  39.3k|		matched = (v & l) == l;
 2531|  39.3k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  39.3k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2531:7): [True: 0, False: 39.3k]
  ------------------
 2532|      0|			(void) fprintf(stderr, "((%" INT64_T_FORMAT "x & %"
 2533|      0|			    INT64_T_FORMAT "x) == %" INT64_T_FORMAT
 2534|      0|			    "x) = %d", CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2535|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2536|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2537|      0|			    matched);
 2538|  39.3k|		break;
 2539|       |
 2540|  1.92k|	case '^':
  ------------------
  |  Branch (2540:2): [True: 1.92k, False: 104M]
  ------------------
 2541|  1.92k|		matched = (v & l) != l;
 2542|  1.92k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  1.92k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2542:7): [True: 0, False: 1.92k]
  ------------------
 2543|      0|			(void) fprintf(stderr, "((%" INT64_T_FORMAT "x & %"
 2544|      0|			    INT64_T_FORMAT "x) != %" INT64_T_FORMAT
 2545|      0|			    "x) = %d", CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2546|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2547|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2548|  1.92k|		break;
 2549|       |
 2550|      0|	default:
  ------------------
  |  Branch (2550:2): [True: 0, False: 104M]
  ------------------
 2551|      0|		file_magerror(ms, "cannot happen: invalid relation `%c'",
 2552|      0|		    m->reln);
 2553|      0|		return -1;
 2554|   104M|	}
 2555|   104M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   104M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2555:6): [True: 0, False: 104M]
  ------------------
 2556|      0|		(void) fprintf(stderr, " strength=%zu\n",
 2557|      0|		    file_magic_strength(m, 1));
 2558|      0|	}
 2559|       |
 2560|   104M|	return matched;
 2561|   104M|}
softmagic.c:file_strncmp:
 2060|  3.98G|{
 2061|       |	/*
 2062|       |	 * Convert the source args to unsigned here so that (1) the
 2063|       |	 * compare will be unsigned as it is in strncmp() and (2) so
 2064|       |	 * the ctype functions will work correctly without extra
 2065|       |	 * casting.
 2066|       |	 */
 2067|  3.98G|	const unsigned char *a = RCAST(const unsigned char *, s1);
  ------------------
  |  |  461|  3.98G|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2068|  3.98G|	const unsigned char *b = RCAST(const unsigned char *, s2);
  ------------------
  |  |  461|  3.98G|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2069|  3.98G|	uint32_t ws = flags & (STRING_COMPACT_WHITESPACE |
  ------------------
  |  |  404|  3.98G|#define STRING_COMPACT_WHITESPACE		BIT(0)
  |  |  ------------------
  |  |  |  |  403|  3.98G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
 2070|  3.98G|	    STRING_COMPACT_OPTIONAL_WHITESPACE);
  ------------------
  |  |  405|  3.98G|#define STRING_COMPACT_OPTIONAL_WHITESPACE	BIT(1)
  |  |  ------------------
  |  |  |  |  403|  3.98G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
 2071|  3.98G|	const unsigned char *be = b + maxlen;
 2072|  3.98G|	const unsigned char *eb = ws ? be : b + len;
  ------------------
  |  Branch (2072:28): [True: 63.9M, False: 3.92G]
  ------------------
 2073|  3.98G|	uint64_t v;
 2074|       |
 2075|       |	/*
 2076|       |	 * What we want here is v = strncmp(s1, s2, len),
 2077|       |	 * but ignoring any nulls.
 2078|       |	 */
 2079|  3.98G|	v = 0;
 2080|  3.98G|	len++;
 2081|  3.98G|	if (0L == flags) { /* normal string: do it fast */
  ------------------
  |  Branch (2081:6): [True: 61.5M, False: 3.92G]
  ------------------
 2082|  62.5M|		while (--len > 0)
  ------------------
  |  Branch (2082:10): [True: 62.4M, False: 52.8k]
  ------------------
 2083|  62.4M|			if ((v = *b++ - *a++) != '\0')
  ------------------
  |  Branch (2083:8): [True: 61.4M, False: 974k]
  ------------------
 2084|  61.4M|				break;
 2085|  61.5M|	}
 2086|  3.92G|	else { /* combine the others */
 2087|  3.93G|		while (--len > 0) {
  ------------------
  |  Branch (2087:10): [True: 3.93G, False: 35.2k]
  ------------------
 2088|  3.93G|			if (b >= eb) {
  ------------------
  |  Branch (2088:8): [True: 306k, False: 3.93G]
  ------------------
 2089|   306k|				v = 1;
 2090|   306k|				break;
 2091|   306k|			}
 2092|  3.93G|			if ((flags & STRING_IGNORE_LOWERCASE) &&
  ------------------
  |  |  406|  3.93G|#define STRING_IGNORE_LOWERCASE			BIT(2)
  |  |  ------------------
  |  |  |  |  403|  3.93G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2092:8): [True: 63.4M, False: 3.87G]
  ------------------
 2093|  3.93G|			    islower(*a)) {
  ------------------
  |  Branch (2093:8): [True: 3.37M, False: 60.0M]
  ------------------
 2094|  3.37M|				if ((v = tolower(*b++) - *a++) != '\0')
  ------------------
  |  Branch (2094:9): [True: 3.35M, False: 28.2k]
  |  Branch (2094:14): [True: 0, False: 0]
  |  Branch (2094:14): [Folded, False: 0]
  |  Branch (2094:14): [Folded, False: 3.37M]
  ------------------
 2095|  3.35M|					break;
 2096|  3.37M|			}
 2097|  3.93G|			else if ((flags & STRING_IGNORE_UPPERCASE) &&
  ------------------
  |  |  407|  3.93G|#define STRING_IGNORE_UPPERCASE			BIT(3)
  |  |  ------------------
  |  |  |  |  403|  3.93G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2097:13): [True: 18.0k, False: 3.93G]
  ------------------
 2098|  3.93G|			    isupper(*a)) {
  ------------------
  |  Branch (2098:8): [True: 17.2k, False: 818]
  ------------------
 2099|  17.2k|				if ((v = toupper(*b++) - *a++) != '\0')
  ------------------
  |  Branch (2099:9): [True: 17.0k, False: 169]
  |  Branch (2099:14): [True: 0, False: 0]
  |  Branch (2099:14): [Folded, False: 0]
  |  Branch (2099:14): [Folded, False: 17.2k]
  ------------------
 2100|  17.0k|					break;
 2101|  17.2k|			}
 2102|  3.93G|			else if ((flags & STRING_COMPACT_WHITESPACE) &&
  ------------------
  |  |  404|  3.93G|#define STRING_COMPACT_WHITESPACE		BIT(0)
  |  |  ------------------
  |  |  |  |  403|  3.93G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2102:13): [True: 48.0M, False: 3.88G]
  ------------------
 2103|  3.93G|			    isspace(*a)) {
  ------------------
  |  Branch (2103:8): [True: 1.77M, False: 46.2M]
  ------------------
 2104|  1.77M|				a++;
 2105|  1.77M|				if (isspace(*b)) {
  ------------------
  |  Branch (2105:9): [True: 316k, False: 1.45M]
  ------------------
 2106|   316k|					b++;
 2107|   316k|					if (!isspace(*a))
  ------------------
  |  Branch (2107:10): [True: 316k, False: 0]
  ------------------
 2108|  11.6G|						while (b < eb && isspace(*b))
  ------------------
  |  Branch (2108:14): [True: 11.6G, False: 306k]
  |  Branch (2108:24): [True: 11.6G, False: 9.93k]
  ------------------
 2109|  11.6G|							b++;
 2110|   316k|				}
 2111|  1.45M|				else {
 2112|  1.45M|					v = 1;
 2113|  1.45M|					break;
 2114|  1.45M|				}
 2115|  1.77M|			}
 2116|  3.93G|			else if ((flags & STRING_COMPACT_OPTIONAL_WHITESPACE) &&
  ------------------
  |  |  405|  3.93G|#define STRING_COMPACT_OPTIONAL_WHITESPACE	BIT(1)
  |  |  ------------------
  |  |  |  |  403|  3.93G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2116:13): [True: 15.9M, False: 3.91G]
  ------------------
 2117|  3.93G|			    isspace(*a)) {
  ------------------
  |  Branch (2117:8): [True: 1.80k, False: 15.9M]
  ------------------
 2118|  1.80k|				a++;
 2119|  10.2k|				while (b < eb && isspace(*b))
  ------------------
  |  Branch (2119:12): [True: 10.1k, False: 63]
  |  Branch (2119:22): [True: 8.40k, False: 1.73k]
  ------------------
 2120|  8.40k|					b++;
 2121|  1.80k|			}
 2122|  3.93G|			else {
 2123|  3.93G|				if ((v = *b++ - *a++) != '\0')
  ------------------
  |  Branch (2123:9): [True: 3.92G, False: 10.0M]
  ------------------
 2124|  3.92G|					break;
 2125|  3.93G|			}
 2126|  3.93G|		}
 2127|  3.92G|		if (len == 0 && v == 0 && (flags & STRING_FULL_WORD)) {
  ------------------
  |  |  422|  35.2k|#define	STRING_FULL_WORD			BIT(14)
  |  |  ------------------
  |  |  |  |  403|  35.2k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2127:7): [True: 35.2k, False: 3.92G]
  |  Branch (2127:19): [True: 35.2k, False: 0]
  |  Branch (2127:29): [True: 102, False: 35.1k]
  ------------------
 2128|    102|			if (b < be && *b && !isspace(*b))
  ------------------
  |  Branch (2128:8): [True: 102, False: 0]
  |  Branch (2128:18): [True: 68, False: 34]
  |  Branch (2128:24): [True: 34, False: 34]
  ------------------
 2129|     34|				v = 1;
 2130|    102|		}
 2131|  3.92G|	}
 2132|  3.98G|	return v;
 2133|  3.98G|}
softmagic.c:file_strncmp16:
 2138|  69.9k|{
 2139|       |	/*
 2140|       |	 * XXX - The 16-bit string compare probably needs to be done
 2141|       |	 * differently, especially if the flags are to be supported.
 2142|       |	 * At the moment, I am unsure.
 2143|       |	 */
 2144|  69.9k|	flags = 0;
 2145|  69.9k|	return file_strncmp(a, b, len, maxlen, flags);
 2146|  69.9k|}
softmagic.c:alloc_regex:
 2150|    171|{
 2151|    171|	int rc;
 2152|    171|	file_regex_t *rx = CAST(file_regex_t *, malloc(sizeof(*rx)));
  ------------------
  |  |  460|    171|#define CAST(T, b)	((T)(b))
  ------------------
 2153|       |
 2154|    171|	if (rx == NULL) {
  ------------------
  |  Branch (2154:6): [True: 0, False: 171]
  ------------------
 2155|      0|		file_error(ms, errno, "can't allocate %" SIZE_T_FORMAT
 2156|      0|		    "u bytes", sizeof(*rx));
 2157|      0|		return NULL;
 2158|      0|	}
 2159|       |
 2160|    171|	rc = file_regcomp(ms, rx, m->value.s, REG_EXTENDED | REG_NEWLINE |
 2161|    171|	    REGEX_ICASE(m));
  ------------------
  |  |  440|    171|#define	REGEX_ICASE(m) (((m)->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)
  |  |  ------------------
  |  |  |  |  390|    171|#define str_flags _u._s._flags
  |  |  ------------------
  |  |               #define	REGEX_ICASE(m) (((m)->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)
  |  |  ------------------
  |  |  |  |  439|    171|#define STRING_IGNORE_CASE		(STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|    171|#define STRING_IGNORE_LOWERCASE			BIT(2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  403|    171|#define BIT(A)   (1 << (A))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define STRING_IGNORE_CASE		(STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  407|    171|#define STRING_IGNORE_UPPERCASE			BIT(3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  403|    171|#define BIT(A)   (1 << (A))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (440:25): [True: 20, False: 151]
  |  |  ------------------
  ------------------
 2162|    171|	if (rc == 0)
  ------------------
  |  Branch (2162:6): [True: 171, False: 0]
  ------------------
 2163|    171|		return rx;
 2164|       |
 2165|      0|	free(rx);
 2166|       |	return NULL;
 2167|    171|}
softmagic.c:handle_annotation:
 2565|   902k|{
 2566|   902k|	if ((ms->flags & MAGIC_APPLE) && m->apple[0]) {
  ------------------
  |  |   45|   902k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
  |  Branch (2566:6): [True: 0, False: 902k]
  |  Branch (2566:35): [True: 0, False: 0]
  ------------------
 2567|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2567:7): [True: 0, False: 0]
  |  Branch (2567:21): [True: 0, False: 0]
  ------------------
 2568|      0|			return 1;
 2569|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2569:7): [True: 0, False: 0]
  ------------------
 2570|      0|			return -1;
 2571|      0|		if (file_printf(ms, "%.8s", m->apple) == -1)
  ------------------
  |  Branch (2571:7): [True: 0, False: 0]
  ------------------
 2572|      0|			return -1;
 2573|      0|		return 1;
 2574|      0|	}
 2575|   902k|	if ((ms->flags & MAGIC_EXTENSION) && m->ext[0]) {
  ------------------
  |  |   46|   902k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (2575:6): [True: 0, False: 902k]
  |  Branch (2575:39): [True: 0, False: 0]
  ------------------
 2576|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2576:7): [True: 0, False: 0]
  |  Branch (2576:21): [True: 0, False: 0]
  ------------------
 2577|      0|			return 1;
 2578|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2578:7): [True: 0, False: 0]
  ------------------
 2579|      0|			return -1;
 2580|      0|		if (file_printf(ms, "%s", m->ext) == -1)
  ------------------
  |  Branch (2580:7): [True: 0, False: 0]
  ------------------
 2581|      0|			return -1;
 2582|      0|		return 1;
 2583|      0|	}
 2584|   902k|	if ((ms->flags & MAGIC_MIME_TYPE) && m->mimetype[0]) {
  ------------------
  |  |   37|   902k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (2584:6): [True: 0, False: 902k]
  |  Branch (2584:39): [True: 0, False: 0]
  ------------------
 2585|      0|		char buf[1024];
 2586|      0|		const char *p;
 2587|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2587:7): [True: 0, False: 0]
  |  Branch (2587:21): [True: 0, False: 0]
  ------------------
 2588|      0|			return 1;
 2589|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2589:7): [True: 0, False: 0]
  ------------------
 2590|      0|			return -1;
 2591|      0|		if (varexpand(ms, buf, sizeof(buf), m->mimetype) == -1)
  ------------------
  |  Branch (2591:7): [True: 0, False: 0]
  ------------------
 2592|      0|			p = m->mimetype;
 2593|      0|		else
 2594|      0|			p = buf;
 2595|      0|		if (file_printf(ms, "%s", p) == -1)
  ------------------
  |  Branch (2595:7): [True: 0, False: 0]
  ------------------
 2596|      0|			return -1;
 2597|      0|		return 1;
 2598|      0|	}
 2599|   902k|	return 0;
 2600|   902k|}
softmagic.c:varexpand:
  549|   162k|{
  550|   162k|	const char *ptr, *sptr, *e, *t, *ee, *et;
  551|   162k|	size_t l;
  552|       |
  553|   163k|	for (sptr = str; (ptr = strstr(sptr, "${")) != NULL;) {
  ------------------
  |  Branch (553:19): [True: 507, False: 162k]
  ------------------
  554|    507|		l = CAST(size_t, ptr - sptr);
  ------------------
  |  |  460|    507|#define CAST(T, b)	((T)(b))
  ------------------
  555|    507|		if (l >= len)
  ------------------
  |  Branch (555:7): [True: 0, False: 507]
  ------------------
  556|      0|			return -1;
  557|    507|		memcpy(buf, sptr, l);
  558|    507|		buf += l;
  559|    507|		len -= l;
  560|    507|		ptr += 2;
  561|    507|		if (!*ptr || ptr[1] != '?')
  ------------------
  |  Branch (561:7): [True: 0, False: 507]
  |  Branch (561:16): [True: 0, False: 507]
  ------------------
  562|      0|			return -1;
  563|  7.60k|		for (et = t = ptr + 2; *et && *et != ':'; et++)
  ------------------
  |  Branch (563:26): [True: 7.60k, False: 0]
  |  Branch (563:33): [True: 7.09k, False: 507]
  ------------------
  564|  7.09k|			continue;
  565|    507|		if (*et != ':')
  ------------------
  |  Branch (565:7): [True: 0, False: 507]
  ------------------
  566|      0|			return -1;
  567|  7.09k|		for (ee = e = et + 1; *ee && *ee != '}'; ee++)
  ------------------
  |  Branch (567:25): [True: 7.09k, False: 0]
  |  Branch (567:32): [True: 6.59k, False: 507]
  ------------------
  568|  6.59k|			continue;
  569|    507|		if (*ee != '}')
  ------------------
  |  Branch (569:7): [True: 0, False: 507]
  ------------------
  570|      0|			return -1;
  571|    507|		switch (*ptr) {
  572|    507|		case 'x':
  ------------------
  |  Branch (572:3): [True: 507, False: 0]
  ------------------
  573|    507|			if (ms->mode & 0111) {
  ------------------
  |  Branch (573:8): [True: 1, False: 506]
  ------------------
  574|      1|				ptr = t;
  575|      1|				l = et - t;
  576|    506|			} else {
  577|    506|				ptr = e;
  578|    506|				l = ee - e;
  579|    506|			}
  580|    507|			break;
  581|      0|		default:
  ------------------
  |  Branch (581:3): [True: 0, False: 507]
  ------------------
  582|      0|			return -1;
  583|    507|		}
  584|    507|		if (l >= len)
  ------------------
  |  Branch (584:7): [True: 0, False: 507]
  ------------------
  585|      0|			return -1;
  586|    507|		memcpy(buf, ptr, l);
  587|    507|		buf += l;
  588|    507|		len -= l;
  589|    507|		sptr = ee + 1;
  590|    507|	}
  591|       |
  592|   162k|	l = strlen(sptr);
  593|   162k|	if (l >= len)
  ------------------
  |  Branch (593:6): [True: 0, False: 162k]
  ------------------
  594|      0|		return -1;
  595|       |
  596|   162k|	memcpy(buf, sptr, l);
  597|   162k|	buf[l] = '\0';
  598|   162k|	return 0;
  599|   162k|}
softmagic.c:print_sep:
 2604|  55.0k|{
 2605|  55.0k|	if (firstline)
  ------------------
  |  Branch (2605:6): [True: 14.8k, False: 40.1k]
  ------------------
 2606|  14.8k|		return 0;
 2607|       |	/*
 2608|       |	 * we found another match
 2609|       |	 * put a newline and '-' to do some simple formatting
 2610|       |	 */
 2611|  40.1k|	return file_separator(ms);
 2612|  55.0k|}
softmagic.c:mprint:
  604|   162k|{
  605|   162k|	uint64_t v;
  606|   162k|	float vf;
  607|   162k|	double vd;
  608|   162k| 	char buf[128], tbuf[26], sbuf[512], ebuf[512];
  609|   162k|	const char *desc;
  610|   162k|	union VALUETYPE *p = &ms->ms_value;
  611|       |
  612|   162k|	if (varexpand(ms, ebuf, sizeof(ebuf), m->desc) == -1)
  ------------------
  |  Branch (612:6): [True: 0, False: 162k]
  ------------------
  613|      0|		desc = m->desc;
  614|   162k|	else
  615|   162k|		desc = ebuf;
  616|       |
  617|   162k|#define	PRINTER(value, format, stype, utype)	\
  618|   162k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  619|   162k|	switch (check_fmt(ms, desc)) { \
  620|   162k|	case -1: \
  621|   162k|		return -1; \
  622|   162k|	case 1: \
  623|   162k|		if (m->flag & UNSIGNED) { \
  624|   162k|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  625|   162k|			    CAST(utype, v)); \
  626|   162k|		} else { \
  627|   162k|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  628|   162k|			    CAST(stype, v)); \
  629|   162k|		} \
  630|   162k|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  631|   162k|			return -1; \
  632|   162k|		break; \
  633|   162k|	default: \
  634|   162k|		if (m->flag & UNSIGNED) { \
  635|   162k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  636|   162k|			   CAST(utype, v)) == -1) \
  637|   162k|			   return -1; \
  638|   162k|		} else { \
  639|   162k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  640|   162k|			   CAST(stype, v)) == -1) \
  641|   162k|			   return -1; \
  642|   162k|		} \
  643|   162k|		break; \
  644|   162k|	} \
  645|   162k|	break
  646|       |
  647|   162k|  	switch (m->type) {
  648|  26.4k|  	case FILE_BYTE:
  ------------------
  |  |  254|  26.4k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (648:4): [True: 26.4k, False: 136k]
  ------------------
  649|  26.4k|		PRINTER(p->b, "", int8_t, uint8_t);
  ------------------
  |  |  618|  26.4k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  26.4k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  26.4k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 26.4k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 26.4k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (623:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  624|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  625|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  629|      0|		} \
  |  |  630|      0|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  |  |  ------------------
  |  |  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (630:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  631|      0|			return -1; \
  |  |  632|      0|		break; \
  |  |  633|  26.4k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 26.4k, False: 0]
  |  |  ------------------
  |  |  634|  26.4k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  26.4k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 10.8k, False: 15.6k]
  |  |  ------------------
  |  |  635|  10.8k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  10.8k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 10.8k]
  |  |  ------------------
  |  |  636|  10.8k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  10.8k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  10.8k|			   return -1; \
  |  |  638|  15.6k|		} else { \
  |  |  639|  15.6k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  15.6k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 15.6k]
  |  |  ------------------
  |  |  640|  15.6k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  15.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  15.6k|			   return -1; \
  |  |  642|  15.6k|		} \
  |  |  643|  26.4k|		break; \
  |  |  644|  26.4k|	} \
  |  |  645|  26.4k|	break
  ------------------
  650|       |
  651|  26.4k|  	case FILE_SHORT:
  ------------------
  |  |  255|  2.65k|#define				FILE_SHORT		2
  ------------------
  |  Branch (651:4): [True: 2.65k, False: 160k]
  ------------------
  652|  13.4k|  	case FILE_BESHORT:
  ------------------
  |  |  260|  13.4k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (652:4): [True: 10.8k, False: 152k]
  ------------------
  653|  33.1k|  	case FILE_LESHORT:
  ------------------
  |  |  263|  33.1k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (653:4): [True: 19.7k, False: 143k]
  ------------------
  654|  33.1k|		PRINTER(p->h, "", int16_t, uint16_t);
  ------------------
  |  |  618|  33.1k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  33.1k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  33.1k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 33.1k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 33.1k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (623:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  624|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  625|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  629|      0|		} \
  |  |  630|      0|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  |  |  ------------------
  |  |  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (630:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  631|      0|			return -1; \
  |  |  632|      0|		break; \
  |  |  633|  33.1k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 33.1k, False: 0]
  |  |  ------------------
  |  |  634|  33.1k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  33.1k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 20.6k, False: 12.5k]
  |  |  ------------------
  |  |  635|  20.6k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  20.6k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 20.6k]
  |  |  ------------------
  |  |  636|  20.6k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  20.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  20.6k|			   return -1; \
  |  |  638|  20.6k|		} else { \
  |  |  639|  12.5k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  12.5k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 12.5k]
  |  |  ------------------
  |  |  640|  12.5k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  12.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  12.5k|			   return -1; \
  |  |  642|  12.5k|		} \
  |  |  643|  33.1k|		break; \
  |  |  644|  33.1k|	} \
  |  |  645|  33.1k|	break
  ------------------
  655|       |
  656|  33.1k|  	case FILE_LONG:
  ------------------
  |  |  257|    330|#define				FILE_LONG		4
  ------------------
  |  Branch (656:4): [True: 330, False: 162k]
  ------------------
  657|  21.7k|  	case FILE_BELONG:
  ------------------
  |  |  261|  21.7k|#define				FILE_BELONG		8
  ------------------
  |  Branch (657:4): [True: 21.3k, False: 141k]
  ------------------
  658|  33.8k|  	case FILE_LELONG:
  ------------------
  |  |  264|  33.8k|#define				FILE_LELONG		11
  ------------------
  |  Branch (658:4): [True: 12.1k, False: 150k]
  ------------------
  659|  33.9k|  	case FILE_MELONG:
  ------------------
  |  |  276|  33.9k|#define				FILE_MELONG		23
  ------------------
  |  Branch (659:4): [True: 35, False: 162k]
  ------------------
  660|  33.9k|		PRINTER(p->l, "", int32_t, uint32_t);
  ------------------
  |  |  618|  33.9k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  33.9k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  33.9k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 33.9k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 33.9k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (623:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  624|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  625|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  629|      0|		} \
  |  |  630|      0|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  |  |  ------------------
  |  |  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (630:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  631|      0|			return -1; \
  |  |  632|      0|		break; \
  |  |  633|  33.9k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 33.9k, False: 0]
  |  |  ------------------
  |  |  634|  33.9k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  33.9k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 8.45k, False: 25.4k]
  |  |  ------------------
  |  |  635|  8.45k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  8.45k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 8.45k]
  |  |  ------------------
  |  |  636|  8.45k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  8.45k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  8.45k|			   return -1; \
  |  |  638|  25.4k|		} else { \
  |  |  639|  25.4k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  25.4k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 25.4k]
  |  |  ------------------
  |  |  640|  25.4k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  25.4k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  25.4k|			   return -1; \
  |  |  642|  25.4k|		} \
  |  |  643|  33.9k|		break; \
  |  |  644|  33.9k|	} \
  |  |  645|  33.9k|	break
  ------------------
  661|       |
  662|  33.9k|  	case FILE_QUAD:
  ------------------
  |  |  277|    241|#define				FILE_QUAD		24
  ------------------
  |  Branch (662:4): [True: 241, False: 162k]
  ------------------
  663|  1.44k|  	case FILE_BEQUAD:
  ------------------
  |  |  279|  1.44k|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (663:4): [True: 1.20k, False: 161k]
  ------------------
  664|  1.75k|  	case FILE_LEQUAD:
  ------------------
  |  |  278|  1.75k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (664:4): [True: 306, False: 162k]
  ------------------
  665|  1.96k|	case FILE_OFFSET:
  ------------------
  |  |  305|  1.96k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (665:2): [True: 212, False: 162k]
  ------------------
  666|  1.96k|		PRINTER(p->q, INT64_T_FORMAT, long long, unsigned long long);
  ------------------
  |  |  618|  1.96k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  1.96k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  1.96k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 1.96k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 1.96k]
  |  |  ------------------
  |  |  623|      0|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|      0|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (623:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  624|      0|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  |  |  625|      0|			    CAST(utype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  626|      0|		} else { \
  |  |  627|      0|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  |  |  628|      0|			    CAST(stype, v)); \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  629|      0|		} \
  |  |  630|      0|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  |  |  ------------------
  |  |  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (630:7): [True: 0, False: 0]
  |  |  ------------------
  |  |  631|      0|			return -1; \
  |  |  632|      0|		break; \
  |  |  633|  1.96k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 1.96k, False: 0]
  |  |  ------------------
  |  |  634|  1.96k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  1.96k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 1.34k, False: 624]
  |  |  ------------------
  |  |  635|  1.34k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  1.34k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 1.34k]
  |  |  ------------------
  |  |  636|  1.34k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  1.34k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  1.34k|			   return -1; \
  |  |  638|  1.34k|		} else { \
  |  |  639|    624|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|    624|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 624]
  |  |  ------------------
  |  |  640|    624|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|    624|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|    624|			   return -1; \
  |  |  642|    624|		} \
  |  |  643|  1.96k|		break; \
  |  |  644|  1.96k|	} \
  |  |  645|  1.96k|	break
  ------------------
  667|       |
  668|  46.4k|  	case FILE_STRING:
  ------------------
  |  |  258|  46.4k|#define				FILE_STRING		5
  ------------------
  |  Branch (668:4): [True: 46.4k, False: 116k]
  ------------------
  669|  48.0k|  	case FILE_PSTRING:
  ------------------
  |  |  266|  48.0k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (669:4): [True: 1.62k, False: 161k]
  ------------------
  670|  48.2k|  	case FILE_BESTRING16:
  ------------------
  |  |  271|  48.2k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (670:4): [True: 216, False: 162k]
  ------------------
  671|  48.7k|  	case FILE_LESTRING16:
  ------------------
  |  |  272|  48.7k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (671:4): [True: 463, False: 162k]
  ------------------
  672|  48.7k|		if (m->reln == '=' || m->reln == '!') {
  ------------------
  |  Branch (672:7): [True: 24.7k, False: 24.0k]
  |  Branch (672:25): [True: 308, False: 23.7k]
  ------------------
  673|  25.0k|			if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  25.0k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (673:8): [True: 0, False: 25.0k]
  ------------------
  674|  25.0k|			    file_printable(ms, sbuf, sizeof(sbuf), m->value.s,
  675|  25.0k|			    sizeof(m->value.s))) == -1)
  676|      0|				return -1;
  677|  25.0k|		}
  678|  23.7k|		else {
  679|  23.7k|			char *str = p->s;
  680|       |
  681|       |			/* compute t before we mangle the string? */
  682|       |
  683|  23.7k|			if (*m->value.s == '\0')
  ------------------
  |  Branch (683:8): [True: 23.5k, False: 154]
  ------------------
  684|  23.5k|				str[strcspn(str, "\r\n")] = '\0';
  685|       |
  686|  23.7k|			if (m->str_flags & STRING_TRIM)
  ------------------
  |  |  390|  23.7k|#define str_flags _u._s._flags
  ------------------
              			if (m->str_flags & STRING_TRIM)
  ------------------
  |  |  421|  23.7k|#define	STRING_TRIM				BIT(13)
  |  |  ------------------
  |  |  |  |  403|  23.7k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (686:8): [True: 404, False: 23.3k]
  ------------------
  687|    404|				str = file_strtrim(str);
  688|       |
  689|  23.7k|			if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  23.7k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (689:8): [True: 0, False: 23.7k]
  ------------------
  690|  23.7k|			    file_printable(ms, sbuf, sizeof(sbuf), str,
  691|  23.7k|				sizeof(p->s) - (str - p->s))) == -1)
  692|      0|				return -1;
  693|       |
  694|  23.7k|			if (m->type == FILE_PSTRING) {
  ------------------
  |  |  266|  23.7k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (694:8): [True: 1.62k, False: 22.1k]
  ------------------
  695|  1.62k|				size_t l = file_pstring_length_size(ms, m);
  696|  1.62k|				if (l == FILE_BADSIZE)
  ------------------
  |  |  183|  1.62k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  1.62k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (696:9): [True: 0, False: 1.62k]
  ------------------
  697|      0|					return -1;
  698|  1.62k|			}
  699|  23.7k|		}
  700|  48.7k|		break;
  701|       |
  702|  48.7k|	case FILE_DATE:
  ------------------
  |  |  259|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (702:2): [True: 0, False: 162k]
  ------------------
  703|    365|	case FILE_BEDATE:
  ------------------
  |  |  262|    365|#define				FILE_BEDATE		9
  ------------------
  |  Branch (703:2): [True: 365, False: 162k]
  ------------------
  704|    744|	case FILE_LEDATE:
  ------------------
  |  |  265|    744|#define				FILE_LEDATE		12
  ------------------
  |  Branch (704:2): [True: 379, False: 162k]
  ------------------
  705|    843|	case FILE_MEDATE:
  ------------------
  |  |  274|    843|#define				FILE_MEDATE		21
  ------------------
  |  Branch (705:2): [True: 99, False: 162k]
  ------------------
  706|    843|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    843|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (706:7): [True: 0, False: 843]
  ------------------
  707|    843|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->l, 0)) == -1)
  708|      0|			return -1;
  709|    843|		break;
  710|       |
  711|    843|	case FILE_LDATE:
  ------------------
  |  |  267|      0|#define				FILE_LDATE		14
  ------------------
  |  Branch (711:2): [True: 0, False: 162k]
  ------------------
  712|    242|	case FILE_BELDATE:
  ------------------
  |  |  268|    242|#define				FILE_BELDATE		15
  ------------------
  |  Branch (712:2): [True: 242, False: 162k]
  ------------------
  713|    276|	case FILE_LELDATE:
  ------------------
  |  |  269|    276|#define				FILE_LELDATE		16
  ------------------
  |  Branch (713:2): [True: 34, False: 162k]
  ------------------
  714|    276|	case FILE_MELDATE:
  ------------------
  |  |  275|    276|#define				FILE_MELDATE		22
  ------------------
  |  Branch (714:2): [True: 0, False: 162k]
  ------------------
  715|    276|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    276|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (715:7): [True: 0, False: 276]
  ------------------
  716|    276|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->l, FILE_T_LOCAL))
  ------------------
  |  |  548|    276|#define FILE_T_LOCAL	1
  ------------------
  717|    276|			== -1)
  718|      0|			return -1;
  719|    276|		break;
  720|       |
  721|    276|	case FILE_QDATE:
  ------------------
  |  |  280|      0|#define				FILE_QDATE		27
  ------------------
  |  Branch (721:2): [True: 0, False: 162k]
  ------------------
  722|    264|	case FILE_BEQDATE:
  ------------------
  |  |  282|    264|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (722:2): [True: 264, False: 162k]
  ------------------
  723|    264|	case FILE_LEQDATE:
  ------------------
  |  |  281|    264|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (723:2): [True: 0, False: 162k]
  ------------------
  724|    264|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    264|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (724:7): [True: 0, False: 264]
  ------------------
  725|    264|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, 0)) == -1)
  726|      0|			return -1;
  727|    264|		break;
  728|       |
  729|    264|	case FILE_QLDATE:
  ------------------
  |  |  283|      0|#define				FILE_QLDATE		30
  ------------------
  |  Branch (729:2): [True: 0, False: 162k]
  ------------------
  730|    263|	case FILE_BEQLDATE:
  ------------------
  |  |  285|    263|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (730:2): [True: 263, False: 162k]
  ------------------
  731|    273|	case FILE_LEQLDATE:
  ------------------
  |  |  284|    273|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (731:2): [True: 10, False: 162k]
  ------------------
  732|    273|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    273|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (732:7): [True: 0, False: 273]
  ------------------
  733|    273|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, FILE_T_LOCAL)) == -1)
  ------------------
  |  |  548|    273|#define FILE_T_LOCAL	1
  ------------------
  734|      0|			return -1;
  735|    273|		break;
  736|       |
  737|    313|	case FILE_QWDATE:
  ------------------
  |  |  295|    313|#define				FILE_QWDATE		42
  ------------------
  |  Branch (737:2): [True: 313, False: 162k]
  ------------------
  738|    313|	case FILE_BEQWDATE:
  ------------------
  |  |  297|    313|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (738:2): [True: 0, False: 162k]
  ------------------
  739|  1.75k|	case FILE_LEQWDATE:
  ------------------
  |  |  296|  1.75k|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (739:2): [True: 1.43k, False: 161k]
  ------------------
  740|  1.75k|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  1.75k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (740:7): [True: 0, False: 1.75k]
  ------------------
  741|  1.75k|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, FILE_T_WINDOWS))
  ------------------
  |  |  549|  1.75k|#define FILE_T_WINDOWS	2
  ------------------
  742|  1.75k|		    == -1)
  743|      0|			return -1;
  744|  1.75k|		break;
  745|       |
  746|  1.75k|	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (746:2): [True: 0, False: 162k]
  ------------------
  747|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (747:2): [True: 0, False: 162k]
  ------------------
  748|    520|	case FILE_LEFLOAT:
  ------------------
  |  |  288|    520|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (748:2): [True: 520, False: 162k]
  ------------------
  749|    520|		vf = p->f;
  750|    520|		switch (check_fmt(ms, desc)) {
  751|      0|		case -1:
  ------------------
  |  Branch (751:3): [True: 0, False: 520]
  ------------------
  752|      0|			return -1;
  753|      0|		case 1:
  ------------------
  |  Branch (753:3): [True: 0, False: 520]
  ------------------
  754|      0|			(void)snprintf(buf, sizeof(buf), "%g", vf);
  755|      0|			if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (755:8): [True: 0, False: 0]
  ------------------
  756|      0|				return -1;
  757|      0|			break;
  758|    520|		default:
  ------------------
  |  Branch (758:3): [True: 520, False: 0]
  ------------------
  759|    520|			if (file_printf(ms, F(ms, desc, "%g"), vf) == -1)
  ------------------
  |  |  167|    520|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (759:8): [True: 0, False: 520]
  ------------------
  760|      0|				return -1;
  761|    520|			break;
  762|    520|		}
  763|    520|  		break;
  764|       |
  765|    520|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (765:2): [True: 0, False: 162k]
  ------------------
  766|      0|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (766:2): [True: 0, False: 162k]
  ------------------
  767|    520|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|    520|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (767:2): [True: 520, False: 162k]
  ------------------
  768|    520|		vd = p->d;
  769|    520|		switch (check_fmt(ms, desc)) {
  770|      0|		case -1:
  ------------------
  |  Branch (770:3): [True: 0, False: 520]
  ------------------
  771|      0|			return -1;
  772|      0|		case 1:
  ------------------
  |  Branch (772:3): [True: 0, False: 520]
  ------------------
  773|      0|			(void)snprintf(buf, sizeof(buf), "%g", vd);
  774|      0|			if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (774:8): [True: 0, False: 0]
  ------------------
  775|      0|				return -1;
  776|      0|			break;
  777|    520|		default:
  ------------------
  |  Branch (777:3): [True: 520, False: 0]
  ------------------
  778|    520|			if (file_printf(ms, F(ms, desc, "%g"), vd) == -1)
  ------------------
  |  |  167|    520|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (778:8): [True: 0, False: 520]
  ------------------
  779|      0|				return -1;
  780|    520|			break;
  781|    520|		}
  782|    520|  		break;
  783|       |
  784|    520|	case FILE_SEARCH:
  ------------------
  |  |  273|    323|#define				FILE_SEARCH		20
  ------------------
  |  Branch (784:2): [True: 323, False: 162k]
  ------------------
  785|  1.23k|	case FILE_REGEX: {
  ------------------
  |  |  270|  1.23k|#define				FILE_REGEX		17
  ------------------
  |  Branch (785:2): [True: 912, False: 161k]
  ------------------
  786|  1.23k|		char *cp, *scp;
  787|  1.23k|		int rval;
  788|       |
  789|  1.23k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (789:7): [True: 0, False: 1.23k]
  ------------------
  790|      0|			break;
  791|       |
  792|  1.23k|		cp = strndup(RCAST(const char *, ms->search.s),
  ------------------
  |  |  461|  1.23k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  793|  1.23k|		    ms->search.rm_len);
  794|  1.23k|		if (cp == NULL) {
  ------------------
  |  Branch (794:7): [True: 0, False: 1.23k]
  ------------------
  795|      0|			file_oomem(ms, ms->search.rm_len);
  796|      0|			return -1;
  797|      0|		}
  798|  1.23k|		scp = (m->str_flags & STRING_TRIM) ? file_strtrim(cp) : cp;
  ------------------
  |  |  390|  1.23k|#define str_flags _u._s._flags
  ------------------
              		scp = (m->str_flags & STRING_TRIM) ? file_strtrim(cp) : cp;
  ------------------
  |  |  421|  1.23k|#define	STRING_TRIM				BIT(13)
  |  |  ------------------
  |  |  |  |  403|  1.23k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (798:9): [True: 34, False: 1.20k]
  ------------------
  799|       |
  800|  1.23k|		rval = file_printf(ms, F(ms, desc, "%s"), file_printable(ms,
  ------------------
  |  |  167|  1.23k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  801|  1.23k|		    sbuf, sizeof(sbuf), scp, ms->search.rm_len));
  802|  1.23k|		free(cp);
  803|       |
  804|  1.23k|		if (rval == -1)
  ------------------
  |  Branch (804:7): [True: 0, False: 1.23k]
  ------------------
  805|      0|			return -1;
  806|  1.23k|		break;
  807|  1.23k|	}
  808|       |
  809|  1.97k|	case FILE_DEFAULT:
  ------------------
  |  |  256|  1.97k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (809:2): [True: 1.97k, False: 160k]
  ------------------
  810|  2.43k|	case FILE_CLEAR:
  ------------------
  |  |  300|  2.43k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (810:2): [True: 468, False: 162k]
  ------------------
  811|  2.43k|	  	if (file_printf(ms, "%s", m->desc) == -1)
  ------------------
  |  Branch (811:9): [True: 0, False: 2.43k]
  ------------------
  812|      0|			return -1;
  813|  2.43k|		break;
  814|       |
  815|  3.82k|	case FILE_INDIRECT:
  ------------------
  |  |  294|  3.82k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (815:2): [True: 3.82k, False: 159k]
  ------------------
  816|  3.91k|	case FILE_USE:
  ------------------
  |  |  299|  3.91k|#define				FILE_USE		46
  ------------------
  |  Branch (816:2): [True: 90, False: 162k]
  ------------------
  817|  9.31k|	case FILE_NAME:
  ------------------
  |  |  298|  9.31k|#define				FILE_NAME		45
  ------------------
  |  Branch (817:2): [True: 5.40k, False: 157k]
  ------------------
  818|  9.31k|		break;
  819|    228|	case FILE_DER:
  ------------------
  |  |  301|    228|#define				FILE_DER		48
  ------------------
  |  Branch (819:2): [True: 228, False: 162k]
  ------------------
  820|    228|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    228|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (820:7): [True: 0, False: 228]
  ------------------
  821|    228|		    file_printable(ms, sbuf, sizeof(sbuf), ms->ms_value.s,
  822|    228|			sizeof(ms->ms_value.s))) == -1)
  823|      0|			return -1;
  824|    228|		break;
  825|    339|	case FILE_GUID:
  ------------------
  |  |  302|    339|#define				FILE_GUID		49
  ------------------
  |  Branch (825:2): [True: 339, False: 162k]
  ------------------
  826|    339|	case FILE_LEGUID:
  ------------------
  |  |  303|    339|#define				FILE_LEGUID		50
  ------------------
  |  Branch (826:2): [True: 0, False: 162k]
  ------------------
  827|    339|		(void) file_print_leguid(buf, sizeof(buf), ms->ms_value.guid);
  828|    339|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|    339|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (828:7): [True: 0, False: 339]
  ------------------
  829|      0|			return -1;
  830|    339|		break;
  831|    339|	case FILE_BEGUID:
  ------------------
  |  |  304|     66|#define				FILE_BEGUID		51
  ------------------
  |  Branch (831:2): [True: 66, False: 162k]
  ------------------
  832|     66|		(void) file_print_beguid(buf, sizeof(buf), ms->ms_value.guid);
  833|     66|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|     66|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (833:7): [True: 0, False: 66]
  ------------------
  834|      0|			return -1;
  835|     66|		break;
  836|     66|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|      0|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (836:2): [True: 0, False: 162k]
  ------------------
  837|      0|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (837:2): [True: 0, False: 162k]
  ------------------
  838|    241|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|    241|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (838:2): [True: 241, False: 162k]
  ------------------
  839|    241|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    241|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (839:7): [True: 0, False: 241]
  ------------------
  840|    241|		    file_fmtdate(tbuf, sizeof(tbuf), p->h)) == -1)
  841|      0|			return -1;
  842|    241|		break;
  843|    241|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|      0|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (843:2): [True: 0, False: 162k]
  ------------------
  844|      0|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (844:2): [True: 0, False: 162k]
  ------------------
  845|    241|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|    241|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (845:2): [True: 241, False: 162k]
  ------------------
  846|    241|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    241|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (846:7): [True: 0, False: 241]
  ------------------
  847|    241|		    file_fmttime(tbuf, sizeof(tbuf), p->h)) == -1)
  848|      0|			return -1;
  849|    241|		break;
  850|    241|	case FILE_OCTAL:
  ------------------
  |  |  314|      0|#define				FILE_OCTAL		61
  ------------------
  |  Branch (850:2): [True: 0, False: 162k]
  ------------------
  851|      0|		file_fmtnum(buf, sizeof(buf), m->value.s, 8);
  852|      0|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|      0|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (852:7): [True: 0, False: 0]
  ------------------
  853|      0|			return -1;
  854|      0|		break;
  855|      0|	default:
  ------------------
  |  Branch (855:2): [True: 0, False: 162k]
  ------------------
  856|      0|		file_magerror(ms, "invalid m->type (%d) in mprint()", m->type);
  857|      0|		return -1;
  858|   162k|	}
  859|   162k|	return 0;
  860|   162k|}
softmagic.c:check_fmt:
  509|  96.6k|{
  510|  96.6k|	file_regex_t rx;
  511|  96.6k|	int rc;
  512|  96.6k|        const char* pat = "%[-0-9\\.]*s";
  513|       |
  514|  96.6k|	if (strchr(fmt, '%') == NULL)
  ------------------
  |  Branch (514:6): [True: 59.8k, False: 36.8k]
  ------------------
  515|  59.8k|		return 0;
  516|       |
  517|  36.8k|	rc = file_regcomp(ms, &rx, pat, REG_EXTENDED|REG_NOSUB);
  518|  36.8k|	if (rc != 0)
  ------------------
  |  Branch (518:6): [True: 0, False: 36.8k]
  ------------------
  519|      0|		return -1;
  520|  36.8k|	rc = !file_regexec(ms, &rx, fmt, 0, 0, 0);
  521|  36.8k|	file_regfree(&rx);
  522|  36.8k|	return rc;
  523|  36.8k|}
softmagic.c:moffset:
  865|   902k|{
  866|   902k|	int32_t o;
  867|   902k|	size_t vlen;
  868|       |
  869|   902k|  	switch (m->type) {
  870|   281k|  	case FILE_BYTE:
  ------------------
  |  |  254|   281k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (870:4): [True: 281k, False: 621k]
  ------------------
  871|   281k|		o = CAST(int32_t, (ms->offset + sizeof(char)));
  ------------------
  |  |  460|   281k|#define CAST(T, b)	((T)(b))
  ------------------
  872|   281k|		break;
  873|       |
  874|  20.1k|  	case FILE_SHORT:
  ------------------
  |  |  255|  20.1k|#define				FILE_SHORT		2
  ------------------
  |  Branch (874:4): [True: 20.1k, False: 882k]
  ------------------
  875|  81.2k|  	case FILE_BESHORT:
  ------------------
  |  |  260|  81.2k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (875:4): [True: 61.1k, False: 841k]
  ------------------
  876|   153k|  	case FILE_LESHORT:
  ------------------
  |  |  263|   153k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (876:4): [True: 72.5k, False: 830k]
  ------------------
  877|   153k|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|   153k|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (877:2): [True: 0, False: 902k]
  ------------------
  878|   154k|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|   154k|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (878:2): [True: 241, False: 902k]
  ------------------
  879|   154k|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|   154k|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (879:2): [True: 0, False: 902k]
  ------------------
  880|   154k|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|   154k|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (880:2): [True: 0, False: 902k]
  ------------------
  881|   154k|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|   154k|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (881:2): [True: 241, False: 902k]
  ------------------
  882|   154k|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|   154k|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (882:2): [True: 0, False: 902k]
  ------------------
  883|   154k|		o = CAST(int32_t, (ms->offset + sizeof(short)));
  ------------------
  |  |  460|   154k|#define CAST(T, b)	((T)(b))
  ------------------
  884|   154k|		break;
  885|       |
  886|  4.69k|  	case FILE_LONG:
  ------------------
  |  |  257|  4.69k|#define				FILE_LONG		4
  ------------------
  |  Branch (886:4): [True: 4.69k, False: 898k]
  ------------------
  887|  97.3k|  	case FILE_BELONG:
  ------------------
  |  |  261|  97.3k|#define				FILE_BELONG		8
  ------------------
  |  Branch (887:4): [True: 92.6k, False: 810k]
  ------------------
  888|   148k|  	case FILE_LELONG:
  ------------------
  |  |  264|   148k|#define				FILE_LELONG		11
  ------------------
  |  Branch (888:4): [True: 50.7k, False: 852k]
  ------------------
  889|   148k|  	case FILE_MELONG:
  ------------------
  |  |  276|   148k|#define				FILE_MELONG		23
  ------------------
  |  Branch (889:4): [True: 35, False: 902k]
  ------------------
  890|   148k|		o = CAST(int32_t, (ms->offset + sizeof(int32_t)));
  ------------------
  |  |  460|   148k|#define CAST(T, b)	((T)(b))
  ------------------
  891|   148k|		break;
  892|       |
  893|  30.1k|  	case FILE_QUAD:
  ------------------
  |  |  277|  30.1k|#define				FILE_QUAD		24
  ------------------
  |  Branch (893:4): [True: 30.1k, False: 872k]
  ------------------
  894|  37.1k|  	case FILE_BEQUAD:
  ------------------
  |  |  279|  37.1k|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (894:4): [True: 6.98k, False: 895k]
  ------------------
  895|  38.2k|  	case FILE_LEQUAD:
  ------------------
  |  |  278|  38.2k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (895:4): [True: 1.12k, False: 901k]
  ------------------
  896|  38.2k|		o = CAST(int32_t, (ms->offset + sizeof(int64_t)));
  ------------------
  |  |  460|  38.2k|#define CAST(T, b)	((T)(b))
  ------------------
  897|  38.2k|		break;
  898|       |
  899|  98.5k|  	case FILE_STRING:
  ------------------
  |  |  258|  98.5k|#define				FILE_STRING		5
  ------------------
  |  Branch (899:4): [True: 98.5k, False: 804k]
  ------------------
  900|   100k|  	case FILE_PSTRING:
  ------------------
  |  |  266|   100k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (900:4): [True: 1.63k, False: 901k]
  ------------------
  901|   100k|  	case FILE_BESTRING16:
  ------------------
  |  |  271|   100k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (901:4): [True: 216, False: 902k]
  ------------------
  902|   100k|  	case FILE_LESTRING16:
  ------------------
  |  |  272|   100k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (902:4): [True: 463, False: 902k]
  ------------------
  903|   100k|	case FILE_OCTAL:
  ------------------
  |  |  314|   100k|#define				FILE_OCTAL		61
  ------------------
  |  Branch (903:2): [True: 0, False: 902k]
  ------------------
  904|   100k|		if (m->reln == '=' || m->reln == '!') {
  ------------------
  |  Branch (904:7): [True: 35.9k, False: 64.9k]
  |  Branch (904:25): [True: 2.11k, False: 62.8k]
  ------------------
  905|  38.0k|			o = ms->offset + m->vallen;
  906|  62.8k|		} else {
  907|  62.8k|			union VALUETYPE *p = &ms->ms_value;
  908|       |
  909|  62.8k|			if (*m->value.s == '\0')
  ------------------
  |  Branch (909:8): [True: 53.5k, False: 9.31k]
  ------------------
  910|  53.5k|				p->s[strcspn(p->s, "\r\n")] = '\0';
  911|  62.8k|			o = CAST(uint32_t, (ms->offset + strlen(p->s)));
  ------------------
  |  |  460|  62.8k|#define CAST(T, b)	((T)(b))
  ------------------
  912|  62.8k|			if (m->type == FILE_PSTRING) {
  ------------------
  |  |  266|  62.8k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (912:8): [True: 1.63k, False: 61.2k]
  ------------------
  913|  1.63k|				size_t l = file_pstring_length_size(ms, m);
  914|  1.63k|				if (l == FILE_BADSIZE)
  ------------------
  |  |  183|  1.63k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  1.63k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (914:9): [True: 0, False: 1.63k]
  ------------------
  915|      0|					return -1;
  916|  1.63k|				o += CAST(uint32_t, l);
  ------------------
  |  |  460|  1.63k|#define CAST(T, b)	((T)(b))
  ------------------
  917|  1.63k|			}
  918|  62.8k|		}
  919|   100k|		break;
  920|       |
  921|   100k|	case FILE_DATE:
  ------------------
  |  |  259|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (921:2): [True: 0, False: 902k]
  ------------------
  922|    365|	case FILE_BEDATE:
  ------------------
  |  |  262|    365|#define				FILE_BEDATE		9
  ------------------
  |  Branch (922:2): [True: 365, False: 902k]
  ------------------
  923|    744|	case FILE_LEDATE:
  ------------------
  |  |  265|    744|#define				FILE_LEDATE		12
  ------------------
  |  Branch (923:2): [True: 379, False: 902k]
  ------------------
  924|    843|	case FILE_MEDATE:
  ------------------
  |  |  274|    843|#define				FILE_MEDATE		21
  ------------------
  |  Branch (924:2): [True: 99, False: 902k]
  ------------------
  925|    843|		o = CAST(int32_t, (ms->offset + sizeof(uint32_t)));
  ------------------
  |  |  460|    843|#define CAST(T, b)	((T)(b))
  ------------------
  926|    843|		break;
  927|       |
  928|      0|	case FILE_LDATE:
  ------------------
  |  |  267|      0|#define				FILE_LDATE		14
  ------------------
  |  Branch (928:2): [True: 0, False: 902k]
  ------------------
  929|    242|	case FILE_BELDATE:
  ------------------
  |  |  268|    242|#define				FILE_BELDATE		15
  ------------------
  |  Branch (929:2): [True: 242, False: 902k]
  ------------------
  930|    276|	case FILE_LELDATE:
  ------------------
  |  |  269|    276|#define				FILE_LELDATE		16
  ------------------
  |  Branch (930:2): [True: 34, False: 902k]
  ------------------
  931|    276|	case FILE_MELDATE:
  ------------------
  |  |  275|    276|#define				FILE_MELDATE		22
  ------------------
  |  Branch (931:2): [True: 0, False: 902k]
  ------------------
  932|    276|		o = CAST(int32_t, (ms->offset + sizeof(uint32_t)));
  ------------------
  |  |  460|    276|#define CAST(T, b)	((T)(b))
  ------------------
  933|    276|		break;
  934|       |
  935|      0|	case FILE_QDATE:
  ------------------
  |  |  280|      0|#define				FILE_QDATE		27
  ------------------
  |  Branch (935:2): [True: 0, False: 902k]
  ------------------
  936|    264|	case FILE_BEQDATE:
  ------------------
  |  |  282|    264|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (936:2): [True: 264, False: 902k]
  ------------------
  937|    264|	case FILE_LEQDATE:
  ------------------
  |  |  281|    264|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (937:2): [True: 0, False: 902k]
  ------------------
  938|    264|		o = CAST(int32_t, (ms->offset + sizeof(uint64_t)));
  ------------------
  |  |  460|    264|#define CAST(T, b)	((T)(b))
  ------------------
  939|    264|		break;
  940|       |
  941|      0|	case FILE_QLDATE:
  ------------------
  |  |  283|      0|#define				FILE_QLDATE		30
  ------------------
  |  Branch (941:2): [True: 0, False: 902k]
  ------------------
  942|    263|	case FILE_BEQLDATE:
  ------------------
  |  |  285|    263|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (942:2): [True: 263, False: 902k]
  ------------------
  943|    273|	case FILE_LEQLDATE:
  ------------------
  |  |  284|    273|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (943:2): [True: 10, False: 902k]
  ------------------
  944|    273|		o = CAST(int32_t, (ms->offset + sizeof(uint64_t)));
  ------------------
  |  |  460|    273|#define CAST(T, b)	((T)(b))
  ------------------
  945|    273|		break;
  946|       |
  947|      0|  	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (947:4): [True: 0, False: 902k]
  ------------------
  948|      0|  	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (948:4): [True: 0, False: 902k]
  ------------------
  949|    520|  	case FILE_LEFLOAT:
  ------------------
  |  |  288|    520|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (949:4): [True: 520, False: 902k]
  ------------------
  950|    520|		o = CAST(int32_t, (ms->offset + sizeof(float)));
  ------------------
  |  |  460|    520|#define CAST(T, b)	((T)(b))
  ------------------
  951|    520|		break;
  952|       |
  953|      0|  	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (953:4): [True: 0, False: 902k]
  ------------------
  954|      0|  	case FILE_BEDOUBLE:
  ------------------
  |  |  290|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (954:4): [True: 0, False: 902k]
  ------------------
  955|    520|  	case FILE_LEDOUBLE:
  ------------------
  |  |  291|    520|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (955:4): [True: 520, False: 902k]
  ------------------
  956|    520|		o = CAST(int32_t, (ms->offset + sizeof(double)));
  ------------------
  |  |  460|    520|#define CAST(T, b)	((T)(b))
  ------------------
  957|    520|		break;
  958|       |
  959|  1.99k|	case FILE_REGEX:
  ------------------
  |  |  270|  1.99k|#define				FILE_REGEX		17
  ------------------
  |  Branch (959:2): [True: 1.99k, False: 900k]
  ------------------
  960|       |		/* Why is regex and search different? */
  961|  1.99k|		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ?
  ------------------
  |  |  390|  1.99k|#define str_flags _u._s._flags
  ------------------
              		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ?
  ------------------
  |  |  408|  1.99k|#define REGEX_OFFSET_START			BIT(4)
  |  |  ------------------
  |  |  |  |  403|  1.99k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (961:10): [True: 1.79k, False: 200]
  ------------------
  962|  1.79k|		    ms->search.rm_len : 0;
  963|  1.99k|		o = CAST(int32_t, ms->search.offset + vlen - offset);
  ------------------
  |  |  460|  1.99k|#define CAST(T, b)	((T)(b))
  ------------------
  964|  1.99k|		break;
  965|       |
  966|  8.06k|	case FILE_SEARCH:
  ------------------
  |  |  273|  8.06k|#define				FILE_SEARCH		20
  ------------------
  |  Branch (966:2): [True: 8.06k, False: 894k]
  ------------------
  967|  8.06k|		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ? m->vallen : 0;
  ------------------
  |  |  390|  8.06k|#define str_flags _u._s._flags
  ------------------
              		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ? m->vallen : 0;
  ------------------
  |  |  408|  8.06k|#define REGEX_OFFSET_START			BIT(4)
  |  |  ------------------
  |  |  |  |  403|  8.06k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (967:10): [True: 7.80k, False: 262]
  ------------------
  968|  8.06k|		o = CAST(int32_t, ms->search.offset + vlen - offset);
  ------------------
  |  |  460|  8.06k|#define CAST(T, b)	((T)(b))
  ------------------
  969|  8.06k|		break;
  970|       |
  971|  3.52k|	case FILE_CLEAR:
  ------------------
  |  |  300|  3.52k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (971:2): [True: 3.52k, False: 899k]
  ------------------
  972|  12.9k|	case FILE_DEFAULT:
  ------------------
  |  |  256|  12.9k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (972:2): [True: 9.41k, False: 893k]
  ------------------
  973|  27.3k|	case FILE_INDIRECT:
  ------------------
  |  |  294|  27.3k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (973:2): [True: 14.4k, False: 888k]
  ------------------
  974|  27.6k|	case FILE_OFFSET:
  ------------------
  |  |  305|  27.6k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (974:2): [True: 269, False: 902k]
  ------------------
  975|  65.3k|	case FILE_USE:
  ------------------
  |  |  299|  65.3k|#define				FILE_USE		46
  ------------------
  |  Branch (975:2): [True: 37.6k, False: 865k]
  ------------------
  976|  65.3k|		o = ms->offset;
  977|  65.3k|		break;
  978|       |
  979|  33.5k|	case FILE_DER:
  ------------------
  |  |  301|  33.5k|#define				FILE_DER		48
  ------------------
  |  Branch (979:2): [True: 33.5k, False: 869k]
  ------------------
  980|  33.5k|		o = der_offs(ms, m, nbytes);
  981|  33.5k|		if (o == -1 || CAST(size_t, o) > nbytes) {
  ------------------
  |  |  460|  33.5k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (981:7): [True: 0, False: 33.5k]
  |  Branch (981:18): [True: 0, False: 33.5k]
  ------------------
  982|      0|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (982:8): [True: 0, False: 0]
  ------------------
  983|      0|				(void)fprintf(stderr,
  984|      0|				    "Bad DER offset %d nbytes=%"
  985|      0|				    SIZE_T_FORMAT "u", o, nbytes);
  986|      0|			}
  987|      0|			*op = 0;
  988|      0|			return 0;
  989|      0|		}
  990|  33.5k|		break;
  991|       |
  992|  33.5k|	case FILE_BEGUID:
  ------------------
  |  |  304|     66|#define				FILE_BEGUID		51
  ------------------
  |  Branch (992:2): [True: 66, False: 902k]
  ------------------
  993|     66|	case FILE_LEGUID:
  ------------------
  |  |  303|     66|#define				FILE_LEGUID		50
  ------------------
  |  Branch (993:2): [True: 0, False: 902k]
  ------------------
  994|    405|	case FILE_GUID:
  ------------------
  |  |  302|    405|#define				FILE_GUID		49
  ------------------
  |  Branch (994:2): [True: 339, False: 902k]
  ------------------
  995|    405|		o = CAST(int32_t, (ms->offset + 2 * sizeof(uint64_t)));
  ------------------
  |  |  460|    405|#define CAST(T, b)	((T)(b))
  ------------------
  996|    405|		break;
  997|       |
  998|  67.5k|	default:
  ------------------
  |  Branch (998:2): [True: 67.5k, False: 835k]
  ------------------
  999|  67.5k|		o = 0;
 1000|  67.5k|		break;
 1001|   902k|	}
 1002|       |
 1003|   902k|	if (CAST(size_t, o) > nbytes) {
  ------------------
  |  |  460|   902k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1003:6): [True: 32.6k, False: 870k]
  ------------------
 1004|       |#if 0
 1005|       |		file_error(ms, 0, "Offset out of range %" SIZE_T_FORMAT
 1006|       |		    "u > %" SIZE_T_FORMAT "u", (size_t)o, nbytes);
 1007|       |#endif
 1008|  32.6k|		return -1;
 1009|  32.6k|	}
 1010|   870k|	*op = o;
 1011|   870k|	return 1;
 1012|   902k|}

_ZN19FuzzerTemporaryFileC2EPKhm:
   70|  12.8k|            : filename_(fuzzer_get_tmpfile(data, size)) {}
magic_fuzzer_fd.cc:_ZL18fuzzer_get_tmpfilePKhm:
   29|  12.8k|static char* fuzzer_get_tmpfile(const uint8_t* data, size_t size) {
   30|  12.8k|    char* filename_buffer = strdup("/tmp/generate_temporary_file.XXXXXX");
   31|  12.8k|    if (!filename_buffer) {
  ------------------
  |  Branch (31:9): [True: 0, False: 12.8k]
  ------------------
   32|      0|        perror("Failed to allocate file name buffer.");
   33|      0|        abort();
   34|      0|    }
   35|  12.8k|    const int file_descriptor = mkstemp(filename_buffer);
   36|  12.8k|    if (file_descriptor < 0) {
  ------------------
  |  Branch (36:9): [True: 0, False: 12.8k]
  ------------------
   37|      0|        perror("Failed to make temporary file.");
   38|      0|        abort();
   39|      0|    }
   40|  12.8k|    FILE* file = fdopen(file_descriptor, "wb");
   41|  12.8k|    if (!file) {
  ------------------
  |  Branch (41:9): [True: 0, False: 12.8k]
  ------------------
   42|      0|        perror("Failed to open file descriptor.");
   43|      0|        close(file_descriptor);
   44|      0|        abort();
   45|      0|    }
   46|  12.8k|    const size_t bytes_written = fwrite(data, sizeof(uint8_t), size, file);
   47|  12.8k|    if (bytes_written < size) {
  ------------------
  |  Branch (47:9): [True: 0, False: 12.8k]
  ------------------
   48|      0|        close(file_descriptor);
   49|      0|        fprintf(stderr, "Failed to write all bytes to file (%zu out of %zu)",
   50|      0|                bytes_written, size);
   51|      0|        abort();
   52|      0|    }
   53|  12.8k|    fclose(file);
   54|  12.8k|    return filename_buffer;
   55|  12.8k|}
_ZNK19FuzzerTemporaryFile8filenameEv:
   74|  12.8k|        const char* filename() const { return filename_; }
_ZN19FuzzerTemporaryFileD2Ev:
   72|  12.8k|        ~FuzzerTemporaryFile() { fuzzer_release_tmpfile(filename_); }
magic_fuzzer_fd.cc:_ZL22fuzzer_release_tmpfilePc:
   57|  12.8k|static void fuzzer_release_tmpfile(char* filename) {
   58|  12.8k|    if (unlink(filename) != 0) {
  ------------------
  |  Branch (58:9): [True: 0, False: 12.8k]
  ------------------
   59|      0|        perror("WARNING: Failed to delete temporary file.");
   60|      0|    }
   61|  12.8k|    free(filename);
   62|  12.8k|}

LLVMFuzzerInitialize:
   42|      2|extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) {
   43|      2|  char* exe_path = (*argv)[0];
   44|       |  // dirname() can modify its argument.
   45|      2|  char* exe_path_copy = strdup(exe_path);
   46|      2|  char* dir = dirname(exe_path_copy);
   47|      2|  env = new Environment(dir);
   48|      2|  free(exe_path_copy);
   49|      2|  return 0;
   50|      2|}
LLVMFuzzerTestOneInput:
   52|  12.8k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   53|  12.8k|  FuzzerTemporaryFile ftf (data, size);
   54|       |  int fd = open(ftf.filename(), O_RDONLY);
   55|  12.8k|  magic_descriptor(env->magic, fd);
   56|  12.8k|  close(fd);
   57|  12.8k|  return 0;
   58|  12.8k|}
_ZN11EnvironmentC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   28|      2|  Environment(std::string data_dir) {
   29|      2|    magic = magic_open(MAGIC_COMPRESS|MAGIC_CONTINUE|MAGIC_NO_COMPRESS_FORK);
  ------------------
  |  |   35|      2|#define	MAGIC_COMPRESS		0x0000004 /* Check inside compressed files */
  ------------------
                  magic = magic_open(MAGIC_COMPRESS|MAGIC_CONTINUE|MAGIC_NO_COMPRESS_FORK);
  ------------------
  |  |   38|      2|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
                  magic = magic_open(MAGIC_COMPRESS|MAGIC_CONTINUE|MAGIC_NO_COMPRESS_FORK);
  ------------------
  |  |   50|      2|#define MAGIC_NO_COMPRESS_FORK	0x4000000 /* Don't allow decompression that
  ------------------
   30|      2|    std::string magic_path = data_dir + "/magic";
   31|      2|    if (magic_load(magic, magic_path.c_str())) {
  ------------------
  |  Branch (31:9): [True: 0, False: 2]
  ------------------
   32|       |      fprintf(stderr, "error loading magic file: %s\n", magic_error(magic));
   33|      0|      exit(1);
   34|      0|    }
   35|      2|  }

