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;
  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|		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 = ms->fnamebuf;
  759|       |
  760|      4|	while (fn) {
  ------------------
  |  Branch (760:9): [True: 2, False: 2]
  ------------------
  761|      2|		p = CCAST(char *, strchr(fn, PATHSEP));
  ------------------
  |  |  462|      2|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  762|      2|		if (p)
  ------------------
  |  Branch (762:7): [True: 0, False: 2]
  ------------------
  763|      0|			*p++ = '\0';
  764|      2|		if (*fn == '\0')
  ------------------
  |  Branch (764:7): [True: 0, False: 2]
  ------------------
  765|      0|			break;
  766|      2|		fileerr = apprentice_1(ms, fn, action);
  767|      2|		errs = MAX(errs, fileerr);
  ------------------
  |  Branch (767:10): [True: 0, False: 2]
  ------------------
  768|      2|		fn = p;
  769|      2|	}
  770|       |
  771|      2|	if (errs == -1) {
  ------------------
  |  Branch (771:6): [True: 0, False: 2]
  ------------------
  772|      0|		for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  479|      0|#define MAGIC_SETS	2
  ------------------
  |  Branch (772:15): [True: 0, False: 0]
  ------------------
  773|      0|			mlist_free(ms->mlist[i]);
  774|      0|			ms->mlist[i] = NULL;
  775|      0|		}
  776|      0|		file_error(ms, 0, "could not find any valid magic files!");
  777|      0|		return -1;
  778|      0|	}
  779|       |
  780|       |#if 0
  781|       |	/*
  782|       |	 * Always leave the database loaded
  783|       |	 */
  784|       |	if (action == FILE_LOAD)
  785|       |		return 0;
  786|       |
  787|       |	for (i = 0; i < MAGIC_SETS; i++) {
  788|       |		mlist_free(ms->mlist[i]);
  789|       |		ms->mlist[i] = NULL;
  790|       |	}
  791|       |#endif
  792|       |
  793|      2|	switch (action) {
  794|      2|	case FILE_LOAD:
  ------------------
  |  |  195|      2|#define	FILE_LOAD	0
  ------------------
  |  Branch (794:2): [True: 2, False: 0]
  ------------------
  795|      2|	case FILE_COMPILE:
  ------------------
  |  |  197|      2|#define FILE_COMPILE	2
  ------------------
  |  Branch (795:2): [True: 0, False: 2]
  ------------------
  796|      2|	case FILE_CHECK:
  ------------------
  |  |  196|      2|#define FILE_CHECK	1
  ------------------
  |  Branch (796:2): [True: 0, False: 2]
  ------------------
  797|      2|	case FILE_LIST:
  ------------------
  |  |  198|      2|#define FILE_LIST	3
  ------------------
  |  Branch (797:2): [True: 0, False: 2]
  ------------------
  798|      2|		return 0;
  799|      0|	default:
  ------------------
  |  Branch (799:2): [True: 0, False: 2]
  ------------------
  800|      0|		file_error(ms, 0, "Invalid action %d", action);
  801|      0|		return -1;
  802|      2|	}
  803|      2|}
file_signextend:
 1659|   142M|{
 1660|   142M|	if (!(m->flag & UNSIGNED)) {
  ------------------
  |  |  237|   142M|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (1660:6): [True: 133M, False: 8.49M]
  ------------------
 1661|   133M|		switch(m->type) {
 1662|       |		/*
 1663|       |		 * Do not remove the casts below.  They are
 1664|       |		 * vital.  When later compared with the data,
 1665|       |		 * the sign extension must have happened.
 1666|       |		 */
 1667|  1.31M|		case FILE_BYTE:
  ------------------
  |  |  254|  1.31M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1667:3): [True: 1.31M, False: 132M]
  ------------------
 1668|  1.31M|			v = CAST(signed char,  v);
  ------------------
  |  |  460|  1.31M|#define CAST(T, b)	((T)(b))
  ------------------
 1669|  1.31M|			break;
 1670|  2.49M|		case FILE_SHORT:
  ------------------
  |  |  255|  2.49M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1670:3): [True: 2.49M, False: 131M]
  ------------------
 1671|  7.83M|		case FILE_BESHORT:
  ------------------
  |  |  260|  7.83M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1671:3): [True: 5.33M, False: 128M]
  ------------------
 1672|  12.3M|		case FILE_LESHORT:
  ------------------
  |  |  263|  12.3M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1672:3): [True: 4.53M, False: 129M]
  ------------------
 1673|  12.3M|			v = CAST(short, v);
  ------------------
  |  |  460|  12.3M|#define CAST(T, b)	((T)(b))
  ------------------
 1674|  12.3M|			break;
 1675|      0|		case FILE_DATE:
  ------------------
  |  |  259|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (1675:3): [True: 0, False: 133M]
  ------------------
 1676|    569|		case FILE_BEDATE:
  ------------------
  |  |  262|    569|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1676:3): [True: 569, False: 133M]
  ------------------
 1677|    763|		case FILE_LEDATE:
  ------------------
  |  |  265|    763|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1677:3): [True: 194, False: 133M]
  ------------------
 1678|    904|		case FILE_MEDATE:
  ------------------
  |  |  274|    904|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1678:3): [True: 141, False: 133M]
  ------------------
 1679|    904|		case FILE_LDATE:
  ------------------
  |  |  267|    904|#define				FILE_LDATE		14
  ------------------
  |  Branch (1679:3): [True: 0, False: 133M]
  ------------------
 1680|  1.40k|		case FILE_BELDATE:
  ------------------
  |  |  268|  1.40k|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1680:3): [True: 504, False: 133M]
  ------------------
 1681|  1.49k|		case FILE_LELDATE:
  ------------------
  |  |  269|  1.49k|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1681:3): [True: 84, False: 133M]
  ------------------
 1682|  1.49k|		case FILE_MELDATE:
  ------------------
  |  |  275|  1.49k|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1682:3): [True: 0, False: 133M]
  ------------------
 1683|  2.13M|		case FILE_LONG:
  ------------------
  |  |  257|  2.13M|#define				FILE_LONG		4
  ------------------
  |  Branch (1683:3): [True: 2.12M, False: 131M]
  ------------------
 1684|  19.0M|		case FILE_BELONG:
  ------------------
  |  |  261|  19.0M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1684:3): [True: 16.8M, False: 117M]
  ------------------
 1685|  25.6M|		case FILE_LELONG:
  ------------------
  |  |  264|  25.6M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1685:3): [True: 6.59M, False: 127M]
  ------------------
 1686|  25.6M|		case FILE_MELONG:
  ------------------
  |  |  276|  25.6M|#define				FILE_MELONG		23
  ------------------
  |  Branch (1686:3): [True: 74, False: 133M]
  ------------------
 1687|  25.6M|		case FILE_FLOAT:
  ------------------
  |  |  286|  25.6M|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1687:3): [True: 0, False: 133M]
  ------------------
 1688|  25.6M|		case FILE_BEFLOAT:
  ------------------
  |  |  287|  25.6M|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1688:3): [True: 0, False: 133M]
  ------------------
 1689|  25.6M|		case FILE_LEFLOAT:
  ------------------
  |  |  288|  25.6M|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1689:3): [True: 0, False: 133M]
  ------------------
 1690|  25.6M|		case FILE_MSDOSDATE:
  ------------------
  |  |  308|  25.6M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (1690:3): [True: 0, False: 133M]
  ------------------
 1691|  25.6M|		case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|  25.6M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1691:3): [True: 0, False: 133M]
  ------------------
 1692|  25.6M|		case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|  25.6M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1692:3): [True: 313, False: 133M]
  ------------------
 1693|  25.6M|		case FILE_MSDOSTIME:
  ------------------
  |  |  311|  25.6M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (1693:3): [True: 0, False: 133M]
  ------------------
 1694|  25.6M|		case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|  25.6M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1694:3): [True: 0, False: 133M]
  ------------------
 1695|  25.6M|		case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|  25.6M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1695:3): [True: 313, False: 133M]
  ------------------
 1696|  25.6M|			v = CAST(int32_t, v);
  ------------------
  |  |  460|  25.6M|#define CAST(T, b)	((T)(b))
  ------------------
 1697|  25.6M|			break;
 1698|  94.1k|		case FILE_QUAD:
  ------------------
  |  |  277|  94.1k|#define				FILE_QUAD		24
  ------------------
  |  Branch (1698:3): [True: 94.1k, False: 133M]
  ------------------
 1699|  1.16M|		case FILE_BEQUAD:
  ------------------
  |  |  279|  1.16M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1699:3): [True: 1.06M, False: 132M]
  ------------------
 1700|  1.76M|		case FILE_LEQUAD:
  ------------------
  |  |  278|  1.76M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1700:3): [True: 601k, False: 133M]
  ------------------
 1701|  1.76M|		case FILE_QDATE:
  ------------------
  |  |  280|  1.76M|#define				FILE_QDATE		27
  ------------------
  |  Branch (1701:3): [True: 0, False: 133M]
  ------------------
 1702|  1.76M|		case FILE_QLDATE:
  ------------------
  |  |  283|  1.76M|#define				FILE_QLDATE		30
  ------------------
  |  Branch (1702:3): [True: 0, False: 133M]
  ------------------
 1703|  1.76M|		case FILE_QWDATE:
  ------------------
  |  |  295|  1.76M|#define				FILE_QWDATE		42
  ------------------
  |  Branch (1703:3): [True: 206, False: 133M]
  ------------------
 1704|  1.76M|		case FILE_BEQDATE:
  ------------------
  |  |  282|  1.76M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1704:3): [True: 1.45k, False: 133M]
  ------------------
 1705|  1.76M|		case FILE_BEQLDATE:
  ------------------
  |  |  285|  1.76M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1705:3): [True: 240, False: 133M]
  ------------------
 1706|  1.76M|		case FILE_BEQWDATE:
  ------------------
  |  |  297|  1.76M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1706:3): [True: 0, False: 133M]
  ------------------
 1707|  1.76M|		case FILE_LEQDATE:
  ------------------
  |  |  281|  1.76M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1707:3): [True: 39, False: 133M]
  ------------------
 1708|  1.76M|		case FILE_LEQLDATE:
  ------------------
  |  |  284|  1.76M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1708:3): [True: 253, False: 133M]
  ------------------
 1709|  1.76M|		case FILE_LEQWDATE:
  ------------------
  |  |  296|  1.76M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1709:3): [True: 2.19k, False: 133M]
  ------------------
 1710|  1.76M|		case FILE_DOUBLE:
  ------------------
  |  |  289|  1.76M|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1710:3): [True: 0, False: 133M]
  ------------------
 1711|  1.76M|		case FILE_BEDOUBLE:
  ------------------
  |  |  290|  1.76M|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1711:3): [True: 0, False: 133M]
  ------------------
 1712|  1.76M|		case FILE_LEDOUBLE:
  ------------------
  |  |  291|  1.76M|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1712:3): [True: 0, False: 133M]
  ------------------
 1713|  1.77M|		case FILE_OFFSET:
  ------------------
  |  |  305|  1.77M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1713:3): [True: 5.30k, False: 133M]
  ------------------
 1714|  1.77M|		case FILE_BEVARINT:
  ------------------
  |  |  306|  1.77M|#define				FILE_BEVARINT		53
  ------------------
  |  Branch (1714:3): [True: 0, False: 133M]
  ------------------
 1715|  1.77M|		case FILE_LEVARINT:
  ------------------
  |  |  307|  1.77M|#define				FILE_LEVARINT		54
  ------------------
  |  Branch (1715:3): [True: 0, False: 133M]
  ------------------
 1716|  1.77M|			v = CAST(int64_t, v);
  ------------------
  |  |  460|  1.77M|#define CAST(T, b)	((T)(b))
  ------------------
 1717|  1.77M|			break;
 1718|  90.8M|		case FILE_STRING:
  ------------------
  |  |  258|  90.8M|#define				FILE_STRING		5
  ------------------
  |  Branch (1718:3): [True: 90.8M, False: 43.0M]
  ------------------
 1719|  90.8M|		case FILE_PSTRING:
  ------------------
  |  |  266|  90.8M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1719:3): [True: 40.4k, False: 133M]
  ------------------
 1720|  90.8M|		case FILE_BESTRING16:
  ------------------
  |  |  271|  90.8M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1720:3): [True: 138, False: 133M]
  ------------------
 1721|  90.9M|		case FILE_LESTRING16:
  ------------------
  |  |  272|  90.9M|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1721:3): [True: 93.2k, False: 133M]
  ------------------
 1722|  91.5M|		case FILE_REGEX:
  ------------------
  |  |  270|  91.5M|#define				FILE_REGEX		17
  ------------------
  |  Branch (1722:3): [True: 593k, False: 133M]
  ------------------
 1723|  92.4M|		case FILE_SEARCH:
  ------------------
  |  |  273|  92.4M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1723:3): [True: 931k, False: 132M]
  ------------------
 1724|  92.4M|		case FILE_DEFAULT:
  ------------------
  |  |  256|  92.4M|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (1724:3): [True: 8.77k, False: 133M]
  ------------------
 1725|  92.4M|		case FILE_INDIRECT:
  ------------------
  |  |  294|  92.4M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (1725:3): [True: 0, False: 133M]
  ------------------
 1726|  92.4M|		case FILE_NAME:
  ------------------
  |  |  298|  92.4M|#define				FILE_NAME		45
  ------------------
  |  Branch (1726:3): [True: 0, False: 133M]
  ------------------
 1727|  92.4M|		case FILE_USE:
  ------------------
  |  |  299|  92.4M|#define				FILE_USE		46
  ------------------
  |  Branch (1727:3): [True: 0, False: 133M]
  ------------------
 1728|  92.4M|		case FILE_CLEAR:
  ------------------
  |  |  300|  92.4M|#define				FILE_CLEAR		47
  ------------------
  |  Branch (1728:3): [True: 1.86k, False: 133M]
  ------------------
 1729|  92.4M|		case FILE_DER:
  ------------------
  |  |  301|  92.4M|#define				FILE_DER		48
  ------------------
  |  Branch (1729:3): [True: 0, False: 133M]
  ------------------
 1730|  92.8M|		case FILE_GUID:
  ------------------
  |  |  302|  92.8M|#define				FILE_GUID		49
  ------------------
  |  Branch (1730:3): [True: 349k, False: 133M]
  ------------------
 1731|  92.8M|		case FILE_LEGUID:
  ------------------
  |  |  303|  92.8M|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1731:3): [True: 0, False: 133M]
  ------------------
 1732|  92.8M|		case FILE_BEGUID:
  ------------------
  |  |  304|  92.8M|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1732:3): [True: 36, False: 133M]
  ------------------
 1733|  92.8M|		case FILE_OCTAL:
  ------------------
  |  |  314|  92.8M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1733:3): [True: 0, False: 133M]
  ------------------
 1734|  92.8M|			break;
 1735|      0|		default:
  ------------------
  |  Branch (1735:3): [True: 0, False: 133M]
  ------------------
 1736|      0|			if (ms->flags & MAGIC_CHECK)
  ------------------
  |  |   39|      0|#define	MAGIC_CHECK		0x0000040 /* Print warnings to stderr */
  ------------------
  |  Branch (1736:8): [True: 0, False: 0]
  ------------------
 1737|      0|			    file_magwarn(ms, "cannot happen: m->type=%d\n",
 1738|      0|				    m->type);
 1739|      0|			return FILE_BADSIZE;
  ------------------
  |  |  183|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1740|   133M|		}
 1741|   133M|	}
 1742|   142M|	return v;
 1743|   142M|}
file_pstring_length_size:
 3636|  48.6k|{
 3637|  48.6k|	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  390|  48.6k|#define str_flags _u._s._flags
  ------------------
              	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  419|  48.6k|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  411|  48.6k|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  48.6k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  414|  48.6k|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  48.6k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  413|  48.6k|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  48.6k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  416|  48.6k|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  48.6k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  415|  48.6k|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  48.6k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3638|  38.3k|	case PSTRING_1_LE:
  ------------------
  |  |  412|  38.3k|#define PSTRING_1_LE				BIT(7)
  |  |  ------------------
  |  |  |  |  403|  38.3k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3638:2): [True: 38.3k, False: 10.2k]
  ------------------
 3639|  38.3k|		return 1;
 3640|    426|	case PSTRING_2_LE:
  ------------------
  |  |  414|    426|#define PSTRING_2_LE				BIT(9)
  |  |  ------------------
  |  |  |  |  403|    426|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3640:2): [True: 426, False: 48.2k]
  ------------------
 3641|  9.36k|	case PSTRING_2_BE:
  ------------------
  |  |  413|  9.36k|#define PSTRING_2_BE				BIT(8)
  |  |  ------------------
  |  |  |  |  403|  9.36k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3641:2): [True: 8.93k, False: 39.7k]
  ------------------
 3642|  9.36k|		return 2;
 3643|    639|	case PSTRING_4_LE:
  ------------------
  |  |  416|    639|#define PSTRING_4_LE				BIT(11)
  |  |  ------------------
  |  |  |  |  403|    639|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3643:2): [True: 639, False: 48.0k]
  ------------------
 3644|    921|	case PSTRING_4_BE:
  ------------------
  |  |  415|    921|#define PSTRING_4_BE				BIT(10)
  |  |  ------------------
  |  |  |  |  403|    921|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3644:2): [True: 282, False: 48.3k]
  ------------------
 3645|    921|		return 4;
 3646|      0|	default:
  ------------------
  |  Branch (3646:2): [True: 0, False: 48.6k]
  ------------------
 3647|      0|		file_error(ms, 0, "corrupt magic file "
 3648|      0|		    "(bad pascal string length %d)",
 3649|      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))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3650|      0|		return FILE_BADSIZE;
  ------------------
  |  |  183|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 3651|  48.6k|	}
 3652|  48.6k|}
file_pstring_get_length:
 3657|  40.5k|{
 3658|  40.5k|	size_t len = 0;
 3659|  40.5k|	const unsigned char *s = RCAST(const unsigned char *, ss);
  ------------------
  |  |  461|  40.5k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 3660|  40.5k|	unsigned int s3, s2, s1, s0;
 3661|       |
 3662|  40.5k|	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  390|  40.5k|#define str_flags _u._s._flags
  ------------------
              	switch (m->str_flags & PSTRING_LEN) {
  ------------------
  |  |  419|  40.5k|    (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  411|  40.5k|#define PSTRING_1_BE				BIT(7)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  40.5k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  414|  40.5k|#define PSTRING_2_LE				BIT(9)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  40.5k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  413|  40.5k|#define PSTRING_2_BE				BIT(8)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  40.5k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  416|  40.5k|#define PSTRING_4_LE				BIT(11)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  40.5k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |                   (PSTRING_1_BE|PSTRING_2_LE|PSTRING_2_BE|PSTRING_4_LE|PSTRING_4_BE)
  |  |  ------------------
  |  |  |  |  415|  40.5k|#define PSTRING_4_BE				BIT(10)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  40.5k|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3663|  37.7k|	case PSTRING_1_LE:
  ------------------
  |  |  412|  37.7k|#define PSTRING_1_LE				BIT(7)
  |  |  ------------------
  |  |  |  |  403|  37.7k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3663:2): [True: 37.7k, False: 2.73k]
  ------------------
 3664|  37.7k|		len = *s;
 3665|  37.7k|		break;
 3666|    142|	case PSTRING_2_LE:
  ------------------
  |  |  414|    142|#define PSTRING_2_LE				BIT(9)
  |  |  ------------------
  |  |  |  |  403|    142|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3666:2): [True: 142, False: 40.3k]
  ------------------
 3667|    142|		s0 = s[0];
 3668|    142|		s1 = s[1];
 3669|    142|		len = (s1 << 8) | s0;
 3670|    142|		break;
 3671|  2.28k|	case PSTRING_2_BE:
  ------------------
  |  |  413|  2.28k|#define PSTRING_2_BE				BIT(8)
  |  |  ------------------
  |  |  |  |  403|  2.28k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3671:2): [True: 2.28k, False: 38.2k]
  ------------------
 3672|  2.28k|		s0 = s[0];
 3673|  2.28k|		s1 = s[1];
 3674|  2.28k|		len = (s0 << 8) | s1;
 3675|  2.28k|		break;
 3676|    213|	case PSTRING_4_LE:
  ------------------
  |  |  416|    213|#define PSTRING_4_LE				BIT(11)
  |  |  ------------------
  |  |  |  |  403|    213|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3676:2): [True: 213, False: 40.2k]
  ------------------
 3677|    213|		s0 = s[0];
 3678|    213|		s1 = s[1];
 3679|    213|		s2 = s[2];
 3680|    213|		s3 = s[3];
 3681|    213|		len = (s3 << 24) | (s2 << 16) | (s1 << 8) | s0;
 3682|    213|		break;
 3683|     94|	case PSTRING_4_BE:
  ------------------
  |  |  415|     94|#define PSTRING_4_BE				BIT(10)
  |  |  ------------------
  |  |  |  |  403|     94|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3683:2): [True: 94, False: 40.4k]
  ------------------
 3684|     94|		s0 = s[0];
 3685|     94|		s1 = s[1];
 3686|     94|		s2 = s[2];
 3687|     94|		s3 = s[3];
 3688|     94|		len = (s0 << 24) | (s1 << 16) | (s2 << 8) | s3;
 3689|     94|		break;
 3690|      0|	default:
  ------------------
  |  Branch (3690:2): [True: 0, False: 40.5k]
  ------------------
 3691|      0|		file_error(ms, 0, "corrupt magic file "
 3692|      0|		    "(bad pascal string length %d)",
 3693|      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))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 3694|      0|		return FILE_BADSIZE;
  ------------------
  |  |  183|      0|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 3695|  40.5k|	}
 3696|       |
 3697|  40.5k|	if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF) {
  ------------------
  |  |  390|  40.5k|#define str_flags _u._s._flags
  ------------------
              	if (m->str_flags & PSTRING_LENGTH_INCLUDES_ITSELF) {
  ------------------
  |  |  420|  40.5k|#define PSTRING_LENGTH_INCLUDES_ITSELF		BIT(12)
  |  |  ------------------
  |  |  |  |  403|  40.5k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (3697:6): [True: 2.26k, False: 38.2k]
  ------------------
 3698|  2.26k|		size_t l = file_pstring_length_size(ms, m);
 3699|  2.26k|		if (l == FILE_BADSIZE)
  ------------------
  |  |  183|  2.26k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  2.26k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (3699:7): [True: 0, False: 2.26k]
  ------------------
 3700|      0|			return l;
 3701|  2.26k|		len -= l;
 3702|  2.26k|	}
 3703|       |
 3704|  40.5k|	return len;
 3705|  40.5k|}
file_magicfind:
 3709|  51.4k|{
 3710|  51.4k|	uint32_t i, j;
 3711|  51.4k|	struct mlist *mlist, *ml;
 3712|       |
 3713|  51.4k|	mlist = ms->mlist[1];
 3714|       |
 3715|  51.4k|	for (ml = mlist->next; ml != mlist; ml = ml->next) {
  ------------------
  |  Branch (3715:25): [True: 51.4k, False: 0]
  ------------------
 3716|  51.4k|		struct magic *ma = ml->magic;
 3717|   141M|		for (i = 0; i < ml->nmagic; i++) {
  ------------------
  |  Branch (3717:15): [True: 141M, False: 0]
  ------------------
 3718|   141M|			if (ma[i].type != FILE_NAME)
  ------------------
  |  |  298|   141M|#define				FILE_NAME		45
  ------------------
  |  Branch (3718:8): [True: 134M, False: 6.88M]
  ------------------
 3719|   134M|				continue;
 3720|  6.88M|			if (strcmp(ma[i].value.s, name) == 0) {
  ------------------
  |  Branch (3720:8): [True: 51.4k, False: 6.83M]
  ------------------
 3721|  51.4k|				v->magic = &ma[i];
 3722|  51.4k|				v->magic_rxcomp = &(ml->magic_rxcomp[i]);
 3723|  1.01M|				for (j = i + 1; j < ml->nmagic; j++)
  ------------------
  |  Branch (3723:21): [True: 1.01M, False: 68]
  ------------------
 3724|  1.01M|				    if (ma[j].cont_level == 0)
  ------------------
  |  Branch (3724:13): [True: 51.3k, False: 959k]
  ------------------
 3725|  51.3k|					    break;
 3726|  51.4k|				v->nmagic = j - i;
 3727|  51.4k|				return 0;
 3728|  51.4k|			}
 3729|  6.88M|		}
 3730|  51.4k|	}
 3731|      0|	return -1;
 3732|  51.4k|}
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:
 3532|      2|{
 3533|      2|	const char *p, *q;
 3534|      2|	char *buf;
 3535|       |
 3536|      2|	if (strip) {
  ------------------
  |  Branch (3536:6): [True: 0, False: 2]
  ------------------
 3537|      0|		if ((p = strrchr(fn, '/')) != NULL)
  ------------------
  |  Branch (3537:7): [True: 0, False: 0]
  ------------------
 3538|      0|			fn = ++p;
 3539|      0|	}
 3540|       |
 3541|     94|	for (q = fn; *q; q++)
  ------------------
  |  Branch (3541:15): [True: 92, False: 2]
  ------------------
 3542|     92|		continue;
 3543|       |	/* Look for .mgc */
 3544|      6|	for (p = ext + sizeof(ext) - 1; p >= ext && q >= fn; p--, q--)
  ------------------
  |  Branch (3544:34): [True: 6, False: 0]
  |  Branch (3544:46): [True: 6, False: 0]
  ------------------
 3545|      6|		if (*p != *q)
  ------------------
  |  Branch (3545:7): [True: 2, False: 4]
  ------------------
 3546|      2|			break;
 3547|       |
 3548|       |	/* Did not find .mgc, restore q */
 3549|      2|	if (p >= ext)
  ------------------
  |  Branch (3549:6): [True: 2, False: 0]
  ------------------
 3550|     94|		for (q = fn; *q; q++)
  ------------------
  |  Branch (3550:16): [True: 92, False: 2]
  ------------------
 3551|     92|			continue;
 3552|       |
 3553|      2|	q++;
 3554|       |	/* Compatibility with old code that looked in .mime */
 3555|      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 (3555:6): [True: 0, False: 2]
  ------------------
 3556|      0|		if (asprintf(&buf, "%.*s.mime%s", CAST(int, q - fn), fn, ext)
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3556:7): [True: 0, False: 0]
  ------------------
 3557|      0|		    < 0)
 3558|      0|			return NULL;
 3559|      0|		if (access(buf, R_OK) != -1) {
  ------------------
  |  Branch (3559:7): [True: 0, False: 0]
  ------------------
 3560|      0|			ms->flags &= MAGIC_MIME_TYPE;
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
 3561|      0|			return buf;
 3562|      0|		}
 3563|      0|		free(buf);
 3564|      0|	}
 3565|      2|	if (asprintf(&buf, "%.*s%s", CAST(int, q - fn), fn, ext) < 0)
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3565:6): [True: 0, False: 2]
  ------------------
 3566|      0|		return NULL;
 3567|       |
 3568|       |	/* Compatibility with old code that looked in .mime */
 3569|      2|	if (strstr(fn, ".mime") != NULL)
  ------------------
  |  Branch (3569:6): [True: 0, False: 2]
  ------------------
 3570|      0|		ms->flags &= MAGIC_MIME_TYPE;
  ------------------
  |  |   37|      0|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
 3571|      2|	return buf;
 3572|      2|}
apprentice.c:apprentice_map:
 3329|      2|{
 3330|      2|	int fd;
 3331|      2|	struct stat st;
 3332|      2|	char *dbname = NULL;
 3333|      2|	struct magic_map *map;
 3334|      2|	struct magic_map *rv = NULL;
 3335|       |
 3336|      2|	fd = -1;
 3337|      2|	if ((map = CAST(struct magic_map *, calloc(1, sizeof(*map)))) == NULL) {
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3337:6): [True: 0, False: 2]
  ------------------
 3338|      0|		file_oomem(ms, sizeof(*map));
 3339|      0|		goto error;
 3340|      0|	}
 3341|      2|	map->type = MAP_TYPE_USER;	/* unspecified */
  ------------------
  |  |   83|      2|#define MAP_TYPE_USER	0
  ------------------
 3342|       |
 3343|      2|	dbname = mkdbname(ms, fn, 0);
 3344|      2|	if (dbname == NULL)
  ------------------
  |  Branch (3344:6): [True: 0, False: 2]
  ------------------
 3345|      0|		goto error;
 3346|       |
 3347|      2|	if ((fd = open(dbname, O_RDONLY|O_BINARY)) == -1)
  ------------------
  |  |  739|      2|#define O_BINARY	0
  ------------------
  |  Branch (3347:6): [True: 0, False: 2]
  ------------------
 3348|      0|		goto error;
 3349|       |
 3350|      2|	if (fstat(fd, &st) == -1) {
  ------------------
  |  Branch (3350:6): [True: 0, False: 2]
  ------------------
 3351|      0|		file_error(ms, errno, "cannot stat `%s'", dbname);
 3352|      0|		goto error;
 3353|      0|	}
 3354|      2|	if (st.st_size < 8 || st.st_size > maxoff_t()) {
  ------------------
  |  Branch (3354:6): [True: 0, False: 2]
  |  Branch (3354:24): [True: 0, False: 2]
  ------------------
 3355|      0|		file_error(ms, 0, "file `%s' is too %s", dbname,
 3356|      0|		    st.st_size < 8 ? "small" : "large");
  ------------------
  |  Branch (3356:7): [True: 0, False: 0]
  ------------------
 3357|      0|		goto error;
 3358|      0|	}
 3359|       |
 3360|      2|	map->len = CAST(size_t, st.st_size);
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3361|      2|#ifdef QUICK
 3362|      2|	map->type = MAP_TYPE_MMAP;
  ------------------
  |  |   85|      2|#define MAP_TYPE_MMAP	2
  ------------------
 3363|      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 (3363:6): [True: 0, False: 2]
  ------------------
 3364|      2|	    MAP_PRIVATE|MAP_FILE, fd, CAST(off_t, 0))) == MAP_FAILED) {
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3365|      0|		file_error(ms, errno, "cannot map `%s'", dbname);
 3366|      0|		goto error;
 3367|      0|	}
 3368|       |#else
 3369|       |	map->type = MAP_TYPE_MALLOC;
 3370|       |	if ((map->p = CAST(void *, malloc(map->len))) == NULL) {
 3371|       |		file_oomem(ms, map->len);
 3372|       |		goto error;
 3373|       |	}
 3374|       |	if (read(fd, map->p, map->len) != (ssize_t)map->len) {
 3375|       |		file_badread(ms);
 3376|       |		goto error;
 3377|       |	}
 3378|       |#endif
 3379|      2|	(void)close(fd);
 3380|      2|	fd = -1;
 3381|       |
 3382|      2|	if (check_buffer(ms, map, dbname) != 0) {
  ------------------
  |  Branch (3382:6): [True: 0, False: 2]
  ------------------
 3383|      0|		goto error;
 3384|      0|	}
 3385|      2|#ifdef QUICK
 3386|      2|	if (mprotect(map->p, CAST(size_t, st.st_size), PROT_READ) == -1) {
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (3386:6): [True: 0, False: 2]
  ------------------
 3387|      0|		file_error(ms, errno, "cannot mprotect `%s'", dbname);
 3388|      0|		goto error;
 3389|      0|	}
 3390|      2|#endif
 3391|       |
 3392|      2|	free(dbname);
 3393|      2|	return map;
 3394|       |
 3395|      0|error:
 3396|      0|	if (fd != -1)
  ------------------
  |  Branch (3396:6): [True: 0, False: 0]
  ------------------
 3397|      0|		(void)close(fd);
 3398|      0|	apprentice_unmap(map);
 3399|      0|	free(dbname);
 3400|      0|	return rv;
 3401|      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:
 3405|      2|{
 3406|      2|	uint32_t *ptr;
 3407|      2|	uint32_t entries, nentries;
 3408|      2|	uint32_t version;
 3409|      2|	int i, needsbyteswap;
 3410|       |
 3411|      2|	entries = CAST(uint32_t, map->len / sizeof(struct magic));
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3412|      2|	if (entries < MAGIC_SETS) {
  ------------------
  |  |  479|      2|#define MAGIC_SETS	2
  ------------------
  |  Branch (3412:6): [True: 0, False: 2]
  ------------------
 3413|      0|		file_error(ms, 0, "Too few magic entries %u in `%s'",
 3414|      0|		    entries, dbname);
 3415|      0|		return -1;
 3416|      0|	}
 3417|      2|	if ((entries * sizeof(struct magic)) != map->len) {
  ------------------
  |  Branch (3417:6): [True: 0, False: 2]
  ------------------
 3418|      0|		file_error(ms, 0, "Size of `%s' %" SIZE_T_FORMAT "u is not "
 3419|      0|		    "a multiple of %" SIZE_T_FORMAT "u",
 3420|      0|		    dbname, map->len, sizeof(struct magic));
 3421|      0|		return -1;
 3422|      0|	}
 3423|       |
 3424|      2|	ptr = CAST(uint32_t *, map->p);
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3425|      2|	if (*ptr != MAGICNO) {
  ------------------
  |  |  189|      2|#define MAGICNO		0xF11E041C
  ------------------
  |  Branch (3425:6): [True: 0, False: 2]
  ------------------
 3426|      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 (3426:7): [True: 0, False: 0]
  ------------------
 3427|      0|			file_error(ms, 0, "bad magic in `%s'", dbname);
 3428|      0|			return -1;
 3429|      0|		}
 3430|      0|		needsbyteswap = 1;
 3431|      0|	} else
 3432|      2|		needsbyteswap = 0;
 3433|      2|	if (needsbyteswap)
  ------------------
  |  Branch (3433:6): [True: 0, False: 2]
  ------------------
 3434|      0|		version = file_swap4(ptr[1]);
  ------------------
  |  |   38|      0|#define file_swap4(x)	bswap_32(x)
  ------------------
 3435|      2|	else
 3436|      2|		version = ptr[1];
 3437|      2|	if (version != VERSIONNO) {
  ------------------
  |  |  190|      2|#define VERSIONNO	21
  ------------------
  |  Branch (3437:6): [True: 0, False: 2]
  ------------------
 3438|      0|		file_error(ms, 0, "File %s supports only version %d magic "
 3439|      0|		    "files. `%s' is version %d", VERSION,
  ------------------
  |  |  432|      0|#define VERSION "5.48"
  ------------------
 3440|      0|		    VERSIONNO, dbname, version);
  ------------------
  |  |  190|      0|#define VERSIONNO	21
  ------------------
 3441|      0|		return -1;
 3442|      0|	}
 3443|      2|	map->magic[0] = CAST(struct magic *, map->p) + 1;
  ------------------
  |  |  460|      2|#define CAST(T, b)	((T)(b))
  ------------------
 3444|      2|	nentries = 0;
 3445|      6|	for (i = 0; i < MAGIC_SETS; i++) {
  ------------------
  |  |  479|      6|#define MAGIC_SETS	2
  ------------------
  |  Branch (3445:14): [True: 4, False: 2]
  ------------------
 3446|      4|		if (needsbyteswap)
  ------------------
  |  Branch (3446:7): [True: 0, False: 4]
  ------------------
 3447|      0|			map->nmagic[i] = file_swap4(ptr[i + 2]);
  ------------------
  |  |   38|      0|#define file_swap4(x)	bswap_32(x)
  ------------------
 3448|      4|		else
 3449|      4|			map->nmagic[i] = ptr[i + 2];
 3450|      4|		if (map->nmagic[i] > entries) {
  ------------------
  |  Branch (3450:7): [True: 0, False: 4]
  ------------------
 3451|      0|			file_error(ms, 0, "nmagic[%u] too large in `%s'", i,
 3452|      0|			    dbname);
 3453|      0|			return -1;
 3454|      0|		}
 3455|      4|		if (i != MAGIC_SETS - 1)
  ------------------
  |  |  479|      4|#define MAGIC_SETS	2
  ------------------
  |  Branch (3455:7): [True: 2, False: 2]
  ------------------
 3456|      2|			map->magic[i + 1] = map->magic[i] + map->nmagic[i];
 3457|      4|		nentries += map->nmagic[i];
 3458|      4|	}
 3459|      2|	if (entries != nentries + 1) {
  ------------------
  |  Branch (3459:6): [True: 0, False: 2]
  ------------------
 3460|      0|		file_error(ms, 0, "Inconsistent entries in `%s' %u != %u",
 3461|      0|		    dbname, entries, nentries + 1);
 3462|      0|		return -1;
 3463|      0|	}
 3464|      2|	if (needsbyteswap)
  ------------------
  |  Branch (3464:6): [True: 0, False: 2]
  ------------------
 3465|      0|		for (i = 0; i < MAGIC_SETS; i++)
  ------------------
  |  |  479|      0|#define MAGIC_SETS	2
  ------------------
  |  Branch (3465:15): [True: 0, False: 0]
  ------------------
 3466|      0|			byteswap(map->magic[i], map->nmagic[i]);
 3467|      2|	return 0;
 3468|      2|}

file_ascmagic:
   72|  12.2k|{
   73|  12.2k|	file_unichar_t *ubuf = NULL;
   74|  12.2k|	size_t ulen = 0;
   75|  12.2k|	int rv = 1;
   76|  12.2k|	struct buffer bb;
   77|       |
   78|  12.2k|	const char *code = NULL;
   79|  12.2k|	const char *code_mime = NULL;
   80|  12.2k|	const char *type = NULL;
   81|       |
   82|  12.2k|	bb = *b;
   83|  12.2k|	bb.flen = trim_nuls(CAST(const unsigned char *, b->fbuf), b->flen);
  ------------------
  |  |  460|  12.2k|#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|  12.2k|	if ((bb.flen & 1) && !(b->flen & 1))
  ------------------
  |  Branch (88:6): [True: 5.42k, False: 6.84k]
  |  Branch (88:23): [True: 1.27k, False: 4.14k]
  ------------------
   89|  1.27k|		bb.flen++;
   90|       |
   91|       |	/* If file doesn't look like any sort of text, give up. */
   92|  12.2k|	if (file_encoding(ms, &bb, &ubuf, &ulen, &code, &code_mime,
  ------------------
  |  Branch (92:6): [True: 9.73k, False: 2.53k]
  ------------------
   93|  12.2k|	    &type) == 0)
   94|  9.73k|		rv = 0;
   95|  2.53k|        else
   96|  2.53k|		rv = file_ascmagic_with_encoding(ms, &bb,
   97|  2.53k|		    ubuf, ulen, code, type, text);
   98|       |
   99|  12.2k|	free(ubuf);
  100|       |
  101|  12.2k|	return rv;
  102|  12.2k|}
file_ascmagic_with_encoding:
  108|  2.53k|{
  109|  2.53k|	struct buffer bb;
  110|  2.53k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  2.53k|#define CAST(T, b)	((T)(b))
  ------------------
  111|  2.53k|	size_t nbytes = b->flen;
  112|  2.53k|	unsigned char *utf8_buf = NULL, *utf8_end;
  113|  2.53k|	size_t mlen, i, len;
  114|  2.53k|	int rv = -1;
  115|  2.53k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  2.53k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  2.53k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  2.53k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  116|  2.53k|	int need_separator = 0;
  117|       |
  118|  2.53k|	const char *subtype = NULL;
  119|       |
  120|  2.53k|	int has_escapes = 0;
  121|  2.53k|	int has_backspace = 0;
  122|  2.53k|	int seen_cr = 0;
  123|       |
  124|  2.53k|	size_t n_crlf = 0;
  125|  2.53k|	size_t n_lf = 0;
  126|  2.53k|	size_t n_cr = 0;
  127|  2.53k|	size_t n_nel = 0;
  128|  2.53k|	int executable = 0;
  129|       |
  130|  2.53k|	size_t last_line_end = CAST(size_t, -1);
  ------------------
  |  |  460|  2.53k|#define CAST(T, b)	((T)(b))
  ------------------
  131|  2.53k|	size_t has_long_lines = 0;
  132|       |
  133|  2.53k|	nbytes = trim_nuls(buf, nbytes);
  134|       |
  135|       |	/* If we have fewer than 2 bytes, give up. */
  136|  2.53k|	if (nbytes <= 1) {
  ------------------
  |  Branch (136:6): [True: 28, False: 2.50k]
  ------------------
  137|     28|		rv = 0;
  138|     28|		goto done;
  139|     28|	}
  140|       |
  141|  2.50k|	if (ulen > 0 && (ms->flags & MAGIC_NO_CHECK_SOFT) == 0) {
  ------------------
  |  |   56|  2.41k|#define	MAGIC_NO_CHECK_SOFT	0x0004000 /* Don't check magic entries */
  ------------------
  |  Branch (141:6): [True: 2.41k, False: 85]
  |  Branch (141:18): [True: 2.41k, 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.41k|		if (ulen > SIZE_MAX / 6) {
  ------------------
  |  Branch (145:7): [True: 0, False: 2.41k]
  ------------------
  146|      0|			goto done;
  147|      0|		}
  148|  2.41k|		mlen = ulen * 6;
  149|  2.41k|		if ((utf8_buf = CAST(unsigned char *, malloc(mlen))) == NULL) {
  ------------------
  |  |  460|  2.41k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (149:7): [True: 0, False: 2.41k]
  ------------------
  150|      0|			file_oomem(ms, mlen);
  151|      0|			goto done;
  152|      0|		}
  153|  2.41k|		if ((utf8_end = encode_utf8(utf8_buf, mlen, ubuf, ulen))
  ------------------
  |  Branch (153:7): [True: 28, False: 2.39k]
  ------------------
  154|  2.41k|		    == NULL) {
  155|     28|			rv = 0;
  156|     28|			goto done;
  157|     28|		}
  158|  2.39k|		buffer_init(&bb, b->fd, &b->st, utf8_buf,
  159|  2.39k|		    CAST(size_t, utf8_end - utf8_buf));
  ------------------
  |  |  460|  2.39k|#define CAST(T, b)	((T)(b))
  ------------------
  160|       |
  161|  2.39k|		if ((rv = file_softmagic(ms, &bb, NULL, NULL,
  ------------------
  |  Branch (161:7): [True: 2.27k, False: 113]
  ------------------
  162|  2.39k|		    TEXTTEST, text)) == 0)
  ------------------
  |  |  241|  2.39k|#define TEXTTEST	0x40	/* for passing to file_softmagic */
  ------------------
  163|  2.27k|			rv = -1;
  164|    113|		else
  165|    113|			need_separator = 1;
  166|  2.39k|		buffer_fini(&bb);
  167|  2.39k|		if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   45|  2.39k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              		if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   46|  2.39k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (167:7): [True: 0, False: 2.39k]
  ------------------
  168|      0|			rv = rv == -1 ? 0 : 1;
  ------------------
  |  Branch (168:9): [True: 0, False: 0]
  ------------------
  169|      0|			goto done;
  170|      0|		}
  171|  2.39k|	}
  172|       |
  173|  2.47k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   45|  2.47k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION))) {
  ------------------
  |  |   46|  2.47k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (173:6): [True: 0, False: 2.47k]
  ------------------
  174|      0|		rv = 0;
  175|      0|		goto done;
  176|      0|	}
  177|       |
  178|       |	/* Now try to discover other details about the file. */
  179|  19.2M|	for (i = 0; i < ulen; i++) {
  ------------------
  |  Branch (179:14): [True: 19.2M, False: 2.47k]
  ------------------
  180|  19.2M|		if (ubuf[i] == '\n') {
  ------------------
  |  Branch (180:7): [True: 1.05M, False: 18.2M]
  ------------------
  181|  1.05M|			if (seen_cr)
  ------------------
  |  Branch (181:8): [True: 167k, False: 884k]
  ------------------
  182|   167k|				n_crlf++;
  183|   884k|			else
  184|   884k|				n_lf++;
  185|  1.05M|			last_line_end = i;
  186|  18.2M|		} else if (seen_cr)
  ------------------
  |  Branch (186:14): [True: 943k, False: 17.2M]
  ------------------
  187|   943k|			n_cr++;
  188|       |
  189|  19.2M|		seen_cr = (ubuf[i] == '\r');
  190|  19.2M|		if (seen_cr)
  ------------------
  |  Branch (190:7): [True: 1.11M, False: 18.1M]
  ------------------
  191|  1.11M|			last_line_end = i;
  192|       |
  193|  19.2M|		if (ubuf[i] == 0x85) { /* X3.64/ECMA-43 "next line" character */
  ------------------
  |  Branch (193:7): [True: 637k, False: 18.6M]
  ------------------
  194|   637k|			n_nel++;
  195|   637k|			last_line_end = i;
  196|   637k|		}
  197|       |
  198|       |		/* If this line is _longer_ than MAXLINELEN, remember it. */
  199|  19.2M|		if (i > last_line_end + MAXLINELEN) {
  ------------------
  |  |   49|  19.2M|#define MAXLINELEN 300	/* longest sane line length */
  ------------------
  |  Branch (199:7): [True: 15.3M, False: 3.88M]
  ------------------
  200|  15.3M|			size_t ll = i - last_line_end;
  201|  15.3M|			if (ll > has_long_lines)
  ------------------
  |  Branch (201:8): [True: 15.3M, False: 27.6k]
  ------------------
  202|  15.3M|				has_long_lines = ll;
  203|  15.3M|		}
  204|       |
  205|  19.2M|		if (ubuf[i] == '\033')
  ------------------
  |  Branch (205:7): [True: 2.87k, False: 19.2M]
  ------------------
  206|  2.87k|			has_escapes = 1;
  207|  19.2M|		if (ubuf[i] == '\b')
  ------------------
  |  Branch (207:7): [True: 140k, False: 19.1M]
  ------------------
  208|   140k|			has_backspace = 1;
  209|  19.2M|	}
  210|       |
  211|  2.47k|	if (seen_cr && n_cr == 0 && n_crlf == 0)
  ------------------
  |  Branch (211:6): [True: 66, False: 2.41k]
  |  Branch (211:17): [True: 24, False: 42]
  |  Branch (211:30): [True: 14, False: 10]
  ------------------
  212|     14|		n_cr++;
  213|       |
  214|  2.47k|	if (strcmp(type, "binary") == 0) {
  ------------------
  |  Branch (214:6): [True: 0, False: 2.47k]
  ------------------
  215|      0|		rv = 0;
  216|      0|		goto done;
  217|      0|	}
  218|  2.47k|	len = file_printedlen(ms);
  219|  2.47k|	if (mime) {
  ------------------
  |  Branch (219:6): [True: 0, False: 2.47k]
  ------------------
  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.47k|	} else {
  237|  2.47k|		if (len) {
  ------------------
  |  Branch (237:7): [True: 893, False: 1.58k]
  ------------------
  238|    893|			switch (file_replace(ms, " text$", ", ")) {
  239|    862|			case 0:
  ------------------
  |  Branch (239:4): [True: 862, False: 31]
  ------------------
  240|    862|				switch (file_replace(ms, " text executable$",
  241|    862|				    ", ")) {
  242|    800|				case 0:
  ------------------
  |  Branch (242:5): [True: 800, False: 62]
  ------------------
  243|    800|					if (file_printf(ms, ", ") == -1)
  ------------------
  |  Branch (243:10): [True: 0, False: 800]
  ------------------
  244|      0|						goto done;
  245|    800|					break;
  246|    800|				case -1:
  ------------------
  |  Branch (246:5): [True: 0, False: 862]
  ------------------
  247|      0|					goto done;
  248|     62|				default:
  ------------------
  |  Branch (248:5): [True: 62, False: 800]
  ------------------
  249|     62|					executable = 1;
  250|     62|					break;
  251|    862|				}
  252|    862|				break;
  253|    862|			case -1:
  ------------------
  |  Branch (253:4): [True: 0, False: 893]
  ------------------
  254|      0|				goto done;
  255|     31|			default:
  ------------------
  |  Branch (255:4): [True: 31, False: 862]
  ------------------
  256|     31|				break;
  257|    893|			}
  258|    893|		}
  259|       |
  260|  2.47k|		if (file_printf(ms, "%s", code) == -1)
  ------------------
  |  Branch (260:7): [True: 0, False: 2.47k]
  ------------------
  261|      0|			goto done;
  262|       |
  263|  2.47k|		if (subtype) {
  ------------------
  |  Branch (263:7): [True: 0, False: 2.47k]
  ------------------
  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.47k|		if (file_printf(ms, " %s", type) == -1)
  ------------------
  |  Branch (268:7): [True: 0, False: 2.47k]
  ------------------
  269|      0|			goto done;
  270|       |
  271|  2.47k|		if (executable)
  ------------------
  |  Branch (271:7): [True: 62, False: 2.41k]
  ------------------
  272|     62|			if (file_printf(ms, " executable") == -1)
  ------------------
  |  Branch (272:8): [True: 0, False: 62]
  ------------------
  273|      0|				goto done;
  274|       |
  275|  2.47k|		if (has_long_lines)
  ------------------
  |  Branch (275:7): [True: 358, False: 2.11k]
  ------------------
  276|    358|			if (file_printf(ms, ", with very long lines (%"
  ------------------
  |  Branch (276:8): [True: 0, False: 358]
  ------------------
  277|    358|			    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.47k|		if ((n_crlf == 0 && n_cr == 0 && n_nel == 0 && n_lf == 0) ||
  ------------------
  |  Branch (284:8): [True: 2.43k, False: 38]
  |  Branch (284:23): [True: 2.33k, False: 99]
  |  Branch (284:36): [True: 2.27k, False: 65]
  |  Branch (284:50): [True: 2.12k, False: 146]
  ------------------
  285|  2.33k|		    (n_crlf != 0 || n_cr != 0 || n_nel != 0)) {
  ------------------
  |  Branch (285:8): [True: 38, False: 310]
  |  Branch (285:23): [True: 99, False: 211]
  |  Branch (285:36): [True: 65, False: 146]
  ------------------
  286|  2.33k|			if (file_printf(ms, ", with") == -1)
  ------------------
  |  Branch (286:8): [True: 0, False: 2.33k]
  ------------------
  287|      0|				goto done;
  288|       |
  289|  2.33k|			if (n_crlf == 0 && n_cr == 0 &&
  ------------------
  |  Branch (289:8): [True: 2.29k, False: 38]
  |  Branch (289:23): [True: 2.19k, False: 99]
  ------------------
  290|  2.19k|			    n_nel == 0 && n_lf == 0) {
  ------------------
  |  Branch (290:8): [True: 2.12k, False: 65]
  |  Branch (290:22): [True: 2.12k, False: 0]
  ------------------
  291|  2.12k|				if (file_printf(ms, " no") == -1)
  ------------------
  |  Branch (291:9): [True: 0, False: 2.12k]
  ------------------
  292|      0|					goto done;
  293|  2.12k|			} else {
  294|    202|				if (n_crlf) {
  ------------------
  |  Branch (294:9): [True: 38, False: 164]
  ------------------
  295|     38|					if (file_printf(ms, " CRLF") == -1)
  ------------------
  |  Branch (295:10): [True: 0, False: 38]
  ------------------
  296|      0|						goto done;
  297|     38|					if (n_cr || n_lf || n_nel)
  ------------------
  |  Branch (297:10): [True: 6, False: 32]
  |  Branch (297:18): [True: 3, False: 29]
  |  Branch (297:26): [True: 3, False: 26]
  ------------------
  298|     12|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (298:11): [True: 0, False: 12]
  ------------------
  299|      0|							goto done;
  300|     38|				}
  301|    202|				if (n_cr) {
  ------------------
  |  Branch (301:9): [True: 105, False: 97]
  ------------------
  302|    105|					if (file_printf(ms, " CR") == -1)
  ------------------
  |  Branch (302:10): [True: 0, False: 105]
  ------------------
  303|      0|						goto done;
  304|    105|					if (n_lf || n_nel)
  ------------------
  |  Branch (304:10): [True: 9, False: 96]
  |  Branch (304:18): [True: 3, False: 93]
  ------------------
  305|     12|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (305:11): [True: 0, False: 12]
  ------------------
  306|      0|							goto done;
  307|    105|				}
  308|    202|				if (n_lf) {
  ------------------
  |  Branch (308:9): [True: 26, False: 176]
  ------------------
  309|     26|					if (file_printf(ms, " LF") == -1)
  ------------------
  |  Branch (309:10): [True: 0, False: 26]
  ------------------
  310|      0|						goto done;
  311|     26|					if (n_nel)
  ------------------
  |  Branch (311:10): [True: 14, False: 12]
  ------------------
  312|     14|						if (file_printf(ms, ",") == -1)
  ------------------
  |  Branch (312:11): [True: 0, False: 14]
  ------------------
  313|      0|							goto done;
  314|     26|				}
  315|    202|				if (n_nel)
  ------------------
  |  Branch (315:9): [True: 71, False: 131]
  ------------------
  316|     71|					if (file_printf(ms, " NEL") == -1)
  ------------------
  |  Branch (316:10): [True: 0, False: 71]
  ------------------
  317|      0|						goto done;
  318|    202|			}
  319|       |
  320|  2.33k|			if (file_printf(ms, " line terminators") == -1)
  ------------------
  |  Branch (320:8): [True: 0, False: 2.33k]
  ------------------
  321|      0|				goto done;
  322|  2.33k|		}
  323|       |
  324|  2.47k|		if (has_escapes)
  ------------------
  |  Branch (324:7): [True: 26, False: 2.45k]
  ------------------
  325|     26|			if (file_printf(ms, ", with escape sequences") == -1)
  ------------------
  |  Branch (325:8): [True: 0, False: 26]
  ------------------
  326|      0|				goto done;
  327|  2.47k|		if (has_backspace)
  ------------------
  |  Branch (327:7): [True: 70, False: 2.40k]
  ------------------
  328|     70|			if (file_printf(ms, ", with overstriking") == -1)
  ------------------
  |  Branch (328:8): [True: 0, False: 70]
  ------------------
  329|      0|				goto done;
  330|  2.47k|	}
  331|  2.47k|	rv = 1;
  332|  2.53k|done:
  333|  2.53k|	free(utf8_buf);
  334|       |
  335|  2.53k|	return rv;
  336|  2.47k|}
ascmagic.c:trim_nuls:
   63|  14.8k|{
   64|   266M|	while (nbytes > 1 && buf[nbytes - 1] == '\0')
  ------------------
  |  Branch (64:9): [True: 266M, False: 279]
  |  Branch (64:23): [True: 266M, False: 14.5k]
  ------------------
   65|   266M|		nbytes--;
   66|       |
   67|  14.8k|	return nbytes;
   68|  14.8k|}
ascmagic.c:encode_utf8:
  344|  2.41k|{
  345|  2.41k|	size_t i;
  346|  2.41k|	unsigned char *end = buf + len;
  347|       |
  348|  19.2M|	for (i = 0; i < ulen; i++) {
  ------------------
  |  Branch (348:14): [True: 19.2M, False: 2.39k]
  ------------------
  349|  19.2M|		if (ubuf[i] <= 0x7f) {
  ------------------
  |  Branch (349:7): [True: 12.9M, False: 6.34M]
  ------------------
  350|  12.9M|			if (end - buf < 1)
  ------------------
  |  Branch (350:8): [True: 0, False: 12.9M]
  ------------------
  351|      0|				return NULL;
  352|  12.9M|			*buf++ = CAST(unsigned char, ubuf[i]);
  ------------------
  |  |  460|  12.9M|#define CAST(T, b)	((T)(b))
  ------------------
  353|  12.9M|			continue;
  354|  12.9M|		} 
  355|  6.34M|		if (ubuf[i] <= 0x7ff) {
  ------------------
  |  Branch (355:7): [True: 5.93M, False: 413k]
  ------------------
  356|  5.93M|			if (end - buf < 2)
  ------------------
  |  Branch (356:8): [True: 0, False: 5.93M]
  ------------------
  357|      0|				return NULL;
  358|  5.93M|			*buf++ = CAST(unsigned char, (ubuf[i] >> 6) + 0xc0);
  ------------------
  |  |  460|  5.93M|#define CAST(T, b)	((T)(b))
  ------------------
  359|  5.93M|			goto out1;
  360|  5.93M|		}
  361|   413k|		if (ubuf[i] <= 0xffff) {
  ------------------
  |  Branch (361:7): [True: 315k, False: 98.2k]
  ------------------
  362|   315k|			if (end - buf < 3)
  ------------------
  |  Branch (362:8): [True: 0, False: 315k]
  ------------------
  363|      0|				return NULL;
  364|   315k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 12) + 0xe0);
  ------------------
  |  |  460|   315k|#define CAST(T, b)	((T)(b))
  ------------------
  365|   315k|			goto out2;
  366|   315k|		}
  367|  98.2k|		if (ubuf[i] <= 0x1fffff) {
  ------------------
  |  Branch (367:7): [True: 20.1k, False: 78.0k]
  ------------------
  368|  20.1k|			if (end - buf < 4)
  ------------------
  |  Branch (368:8): [True: 0, False: 20.1k]
  ------------------
  369|      0|				return NULL;
  370|  20.1k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 18) + 0xf0);
  ------------------
  |  |  460|  20.1k|#define CAST(T, b)	((T)(b))
  ------------------
  371|  20.1k|			goto out3;
  372|  20.1k|		}
  373|  78.0k|		if (ubuf[i] <= 0x3ffffff) {
  ------------------
  |  Branch (373:7): [True: 32.1k, False: 45.8k]
  ------------------
  374|  32.1k|			if (end - buf < 5)
  ------------------
  |  Branch (374:8): [True: 0, False: 32.1k]
  ------------------
  375|      0|				return NULL;
  376|  32.1k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 24) + 0xf8);
  ------------------
  |  |  460|  32.1k|#define CAST(T, b)	((T)(b))
  ------------------
  377|  32.1k|			goto out4;
  378|  32.1k|		} 
  379|  45.8k|		if (ubuf[i] <= 0x7fffffff) {
  ------------------
  |  Branch (379:7): [True: 45.8k, False: 28]
  ------------------
  380|  45.8k|			if (end - buf < 6)
  ------------------
  |  Branch (380:8): [True: 0, False: 45.8k]
  ------------------
  381|      0|				return NULL;
  382|  45.8k|			*buf++ = CAST(unsigned char, (ubuf[i] >> 30) + 0xfc);
  ------------------
  |  |  460|  45.8k|#define CAST(T, b)	((T)(b))
  ------------------
  383|  45.8k|			goto out5;
  384|  45.8k|		} 
  385|       |		/* Invalid character */
  386|     28|		return NULL;
  387|  45.8k|	out5:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 24) & 0x3f) + 0x80);
  ------------------
  |  |  460|  45.8k|#define CAST(T, b)	((T)(b))
  ------------------
  388|  78.0k|	out4:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 18) & 0x3f) + 0x80);
  ------------------
  |  |  460|  78.0k|#define CAST(T, b)	((T)(b))
  ------------------
  389|  98.1k|	out3:	*buf++ = CAST(unsigned char, ((ubuf[i] >> 12) & 0x3f) + 0x80);
  ------------------
  |  |  460|  98.1k|#define CAST(T, b)	((T)(b))
  ------------------
  390|   413k|	out2:	*buf++ = CAST(unsigned char, ((ubuf[i] >>  6) & 0x3f) + 0x80);
  ------------------
  |  |  460|   413k|#define CAST(T, b)	((T)(b))
  ------------------
  391|  6.34M|	out1:	*buf++ = CAST(unsigned char, ((ubuf[i] >>  0) & 0x3f) + 0x80);
  ------------------
  |  |  460|  6.34M|#define CAST(T, b)	((T)(b))
  ------------------
  392|  6.34M|	}
  393|       |
  394|  2.39k|	return buf;
  395|  2.41k|}

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

cdf_swap_header:
  230|  4.06k|{
  231|  4.06k|	size_t i;
  232|       |
  233|  4.06k|	h->h_magic = CDF_TOLE8(h->h_magic);
  ------------------
  |  |   82|  4.06k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  234|  4.06k|	h->h_uuid[0] = CDF_TOLE8(h->h_uuid[0]);
  ------------------
  |  |   82|  4.06k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  235|  4.06k|	h->h_uuid[1] = CDF_TOLE8(h->h_uuid[1]);
  ------------------
  |  |   82|  4.06k|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  236|  4.06k|	h->h_revision = CDF_TOLE2(h->h_revision);
  ------------------
  |  |   86|  4.06k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  237|  4.06k|	h->h_version = CDF_TOLE2(h->h_version);
  ------------------
  |  |   86|  4.06k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  238|  4.06k|	h->h_byte_order = CDF_TOLE2(h->h_byte_order);
  ------------------
  |  |   86|  4.06k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  239|  4.06k|	h->h_sec_size_p2 = CDF_TOLE2(h->h_sec_size_p2);
  ------------------
  |  |   86|  4.06k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  240|  4.06k|	h->h_short_sec_size_p2 = CDF_TOLE2(h->h_short_sec_size_p2);
  ------------------
  |  |   86|  4.06k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  241|  4.06k|	h->h_num_sectors_in_sat = CDF_TOLE4(h->h_num_sectors_in_sat);
  ------------------
  |  |   84|  4.06k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  242|  4.06k|	h->h_secid_first_directory = CDF_TOLE4(h->h_secid_first_directory);
  ------------------
  |  |   84|  4.06k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  243|  4.06k|	h->h_min_size_standard_stream =
  244|  4.06k|	    CDF_TOLE4(h->h_min_size_standard_stream);
  ------------------
  |  |   84|  4.06k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  245|  4.06k|	h->h_secid_first_sector_in_short_sat =
  246|  4.06k|	    CDF_TOLE4(CAST(uint32_t, h->h_secid_first_sector_in_short_sat));
  ------------------
  |  |   84|  4.06k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  247|  4.06k|	h->h_num_sectors_in_short_sat =
  248|  4.06k|	    CDF_TOLE4(h->h_num_sectors_in_short_sat);
  ------------------
  |  |   84|  4.06k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  249|  4.06k|	h->h_secid_first_sector_in_master_sat =
  250|  4.06k|	    CDF_TOLE4(CAST(uint32_t, h->h_secid_first_sector_in_master_sat));
  ------------------
  |  |   84|  4.06k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  251|  4.06k|	h->h_num_sectors_in_master_sat =
  252|  4.06k|	    CDF_TOLE4(h->h_num_sectors_in_master_sat);
  ------------------
  |  |   84|  4.06k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.12k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.06k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  253|   446k|	for (i = 0; i < __arraycount(h->h_master_sat); i++) {
  ------------------
  |  |  138|   446k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (253:14): [True: 442k, False: 4.06k]
  ------------------
  254|   442k|		h->h_master_sat[i] =
  255|   442k|		    CDF_TOLE4(CAST(uint32_t, h->h_master_sat[i]));
  ------------------
  |  |   84|   442k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|   885k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 442k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  256|   442k|	}
  257|  4.06k|}
cdf_unpack_header:
  261|  4.06k|{
  262|  4.06k|	size_t i;
  263|  4.06k|	size_t len = 0;
  264|       |
  265|  4.06k|	CDF_UNPACK(h->h_magic);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  266|  4.06k|	CDF_UNPACKA(h->h_uuid);
  ------------------
  |  |  208|  4.06k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  267|  4.06k|	CDF_UNPACK(h->h_revision);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  268|  4.06k|	CDF_UNPACK(h->h_version);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  269|  4.06k|	CDF_UNPACK(h->h_byte_order);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  270|  4.06k|	CDF_UNPACK(h->h_sec_size_p2);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  271|  4.06k|	CDF_UNPACK(h->h_short_sec_size_p2);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  272|  4.06k|	CDF_UNPACKA(h->h_unused0);
  ------------------
  |  |  208|  4.06k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  273|  4.06k|	CDF_UNPACK(h->h_num_sectors_in_sat);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  274|  4.06k|	CDF_UNPACK(h->h_secid_first_directory);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  275|  4.06k|	CDF_UNPACKA(h->h_unused1);
  ------------------
  |  |  208|  4.06k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  276|  4.06k|	CDF_UNPACK(h->h_min_size_standard_stream);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  277|  4.06k|	CDF_UNPACK(h->h_secid_first_sector_in_short_sat);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  278|  4.06k|	CDF_UNPACK(h->h_num_sectors_in_short_sat);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  279|  4.06k|	CDF_UNPACK(h->h_secid_first_sector_in_master_sat);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  280|  4.06k|	CDF_UNPACK(h->h_num_sectors_in_master_sat);
  ------------------
  |  |  206|  4.06k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  281|   446k|	for (i = 0; i < __arraycount(h->h_master_sat); i++)
  ------------------
  |  |  138|   446k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (281:14): [True: 442k, False: 4.06k]
  ------------------
  282|   442k|		CDF_UNPACK(h->h_master_sat[i]);
  ------------------
  |  |  206|   442k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  283|  4.06k|}
cdf_swap_class:
  304|    993|{
  305|    993|	d->cl_dword = CDF_TOLE4(d->cl_dword);
  ------------------
  |  |   84|    993|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  306|    993|	d->cl_word[0] = CDF_TOLE2(d->cl_word[0]);
  ------------------
  |  |   86|    993|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  307|    993|	d->cl_word[1] = CDF_TOLE2(d->cl_word[1]);
  ------------------
  |  |   86|    993|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  308|    993|}
cdf_unpack_dir:
  312|  17.2k|{
  313|  17.2k|	size_t len = 0;
  314|       |
  315|  17.2k|	CDF_UNPACKA(d->d_name);
  ------------------
  |  |  208|  17.2k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  316|  17.2k|	CDF_UNPACK(d->d_namelen);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  317|  17.2k|	CDF_UNPACK(d->d_type);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  318|  17.2k|	CDF_UNPACK(d->d_color);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  319|  17.2k|	CDF_UNPACK(d->d_left_child);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  320|  17.2k|	CDF_UNPACK(d->d_right_child);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  321|  17.2k|	CDF_UNPACK(d->d_storage);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  322|  17.2k|	CDF_UNPACKA(d->d_storage_uuid);
  ------------------
  |  |  208|  17.2k|    (void)memcpy((a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  323|  17.2k|	CDF_UNPACK(d->d_flags);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  324|  17.2k|	CDF_UNPACK(d->d_created);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  325|  17.2k|	CDF_UNPACK(d->d_modified);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  326|  17.2k|	CDF_UNPACK(d->d_stream_first_sector);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  327|  17.2k|	CDF_UNPACK(d->d_size);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  328|  17.2k|	CDF_UNPACK(d->d_unused0);
  ------------------
  |  |  206|  17.2k|    (void)memcpy(&(a), &buf[len], sizeof(a)), len += sizeof(a)
  ------------------
  329|  17.2k|}
cdf_zero_stream:
  333|  4.82k|{
  334|  4.82k|	scn->sst_len = 0;
  335|  4.82k|	scn->sst_dirlen = 0;
  336|  4.82k|	scn->sst_ss = 0;
  337|  4.82k|	free(scn->sst_tab);
  338|       |	scn->sst_tab = NULL;
  339|  4.82k|	return -1;
  340|  4.82k|}
cdf_read_header:
  396|  12.2k|{
  397|  12.2k|	char buf[512];
  398|       |
  399|  12.2k|	(void)memcpy(cdf_bo.s, "\01\02\03\04", 4);
  400|  12.2k|	if (cdf_read(info, CAST(off_t, 0), buf, sizeof(buf)) == -1)
  ------------------
  |  |  460|  12.2k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (400:6): [True: 8.20k, False: 4.06k]
  ------------------
  401|  8.20k|		return -1;
  402|  4.06k|	cdf_unpack_header(h, buf);
  403|  4.06k|	cdf_swap_header(h);
  404|  4.06k|	if (h->h_magic != CDF_MAGIC) {
  ------------------
  |  |   62|  4.06k|#define CDF_MAGIC	0xE11AB1A1E011CFD0LL
  ------------------
  |  Branch (404:6): [True: 2.12k, False: 1.94k]
  ------------------
  405|  2.12k|		DPRINTF(("Bad magic %#" INT64_T_FORMAT "x != %#"
  406|  2.12k|		    INT64_T_FORMAT "x\n",
  407|  2.12k|		    (unsigned long long)h->h_magic,
  408|  2.12k|		    (unsigned long long)CDF_MAGIC));
  409|  2.12k|		goto out;
  410|  2.12k|	}
  411|  1.94k|	if (h->h_sec_size_p2 > 20) {
  ------------------
  |  Branch (411:6): [True: 16, False: 1.92k]
  ------------------
  412|     16|		DPRINTF(("Bad sector size %hu\n", h->h_sec_size_p2));
  413|     16|		goto out;
  414|     16|	}
  415|  1.92k|	if (h->h_short_sec_size_p2 > 20) {
  ------------------
  |  Branch (415:6): [True: 2, False: 1.92k]
  ------------------
  416|      2|		DPRINTF(("Bad short sector size %hu\n",
  417|      2|		    h->h_short_sec_size_p2));
  418|      2|		goto out;
  419|      2|	}
  420|  1.92k|	return 0;
  421|  2.13k|out:
  422|  2.13k|	errno = EFTYPE;
  ------------------
  |  |   59|  2.13k|#define EFTYPE EINVAL
  ------------------
  423|  2.13k|	return -1;
  424|  1.92k|}
cdf_read_sector:
  430|   666k|{
  431|   666k|	size_t ss = CDF_SEC_SIZE(h);
  ------------------
  |  |   81|   666k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|   666k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  432|   666k|	size_t pos;
  433|       |
  434|   666k|	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |   63|   666k|#define SIZE_T_MAX CAST(size_t, ~0ULL)
  |  |  ------------------
  |  |  |  |  460|   666k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |  460|   666k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (434:6): [True: 0, False: 666k]
  ------------------
  435|      0|		return -1;
  436|       |
  437|   666k|	pos = CDF_SEC_POS(h, id);
  ------------------
  |  |   82|   666k|#define CDF_SEC_POS(h, secid) (CDF_SEC_SIZE(h) + (secid) * CDF_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   81|   666k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   666k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define CDF_SEC_POS(h, secid) (CDF_SEC_SIZE(h) + (secid) * CDF_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   81|   666k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   666k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  438|   666k|	assert(ss == len);
  ------------------
  |  Branch (438:2): [True: 0, False: 666k]
  |  Branch (438:2): [True: 666k, False: 0]
  ------------------
  439|   666k|	return cdf_read(info, CAST(off_t, pos), RCAST(char *, buf) + offs, len);
  ------------------
  |  |  460|   666k|#define CAST(T, b)	((T)(b))
  ------------------
              	return cdf_read(info, CAST(off_t, pos), RCAST(char *, buf) + offs, len);
  ------------------
  |  |  461|   666k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  440|   666k|}
cdf_read_short_sector:
  445|    393|{
  446|    393|	size_t ss = CDF_SHORT_SEC_SIZE(h);
  ------------------
  |  |   83|    393|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|    393|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  447|    393|	size_t pos;
  448|       |
  449|    393|	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |   63|    393|#define SIZE_T_MAX CAST(size_t, ~0ULL)
  |  |  ------------------
  |  |  |  |  460|    393|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
              	if (SIZE_T_MAX / ss < CAST(size_t, id))
  ------------------
  |  |  460|    393|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (449:6): [True: 0, False: 393]
  ------------------
  450|      0|		return -1;
  451|       |
  452|    393|	pos = CDF_SHORT_SEC_POS(h, id);
  ------------------
  |  |   84|    393|#define CDF_SHORT_SEC_POS(h, secid) ((secid) * CDF_SHORT_SEC_SIZE(h))
  |  |  ------------------
  |  |  |  |   83|    393|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    393|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  453|    393|	assert(ss == len);
  ------------------
  |  Branch (453:2): [True: 0, False: 393]
  |  Branch (453:2): [True: 393, False: 0]
  ------------------
  454|    393|	if (pos + len > CDF_SEC_SIZE(h) * sst->sst_len) {
  ------------------
  |  |   81|    393|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|    393|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (454:6): [True: 18, False: 375]
  ------------------
  455|     18|		DPRINTF(("Out of bounds read %" SIZE_T_FORMAT "u > %"
  456|     18|		    SIZE_T_FORMAT "u\n",
  457|     18|		    pos + len, CDF_SEC_SIZE(h) * sst->sst_len));
  458|     18|		goto out;
  459|     18|	}
  460|    375|	(void)memcpy(RCAST(char *, buf) + offs,
  ------------------
  |  |  461|    375|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  461|    375|	    RCAST(const char *, sst->sst_tab) + pos, len);
  ------------------
  |  |  461|    375|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  462|    375|	return len;
  463|     18|out:
  464|     18|	errno = EFTYPE;
  ------------------
  |  |   59|     18|#define EFTYPE EINVAL
  ------------------
  465|     18|	return -1;
  466|    393|}
cdf_read_sat:
  473|  1.92k|{
  474|  1.92k|	size_t i, j, k;
  475|  1.92k|	size_t ss = CDF_SEC_SIZE(h);
  ------------------
  |  |   81|  1.92k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|  1.92k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  476|  1.92k|	cdf_secid_t *msa, mid, sec;
  477|  1.92k|	size_t nsatpersec = (ss / sizeof(mid)) - 1;
  478|       |
  479|   121k|	for (i = 0; i < __arraycount(h->h_master_sat); i++)
  ------------------
  |  |  138|   121k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (479:14): [True: 120k, False: 890]
  ------------------
  480|   120k|		if (h->h_master_sat[i] == CDF_SECID_FREE)
  ------------------
  |  |   55|   120k|#define CDF_SECID_FREE					-1
  ------------------
  |  Branch (480:7): [True: 1.03k, False: 119k]
  ------------------
  481|  1.03k|			break;
  482|       |
  483|  1.92k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  484|  1.92k|	if ((nsatpersec > 0 &&
  ------------------
  |  Branch (484:7): [True: 1.81k, False: 114]
  ------------------
  485|  1.81k|	    h->h_num_sectors_in_master_sat > CDF_SEC_LIMIT / nsatpersec) ||
  ------------------
  |  |  483|  1.81k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  ------------------
  |  Branch (485:6): [True: 21, False: 1.78k]
  ------------------
  486|  1.90k|	    i > CDF_SEC_LIMIT) {
  ------------------
  |  |  483|  1.90k|#define CDF_SEC_LIMIT (UINT32_MAX / (64 * ss))
  ------------------
  |  Branch (486:6): [True: 1, False: 1.90k]
  ------------------
  487|     22|		DPRINTF(("Number of sectors in master SAT too big %u %"
  488|     22|		    SIZE_T_FORMAT "u\n", h->h_num_sectors_in_master_sat, i));
  489|     22|		errno = EFTYPE;
  ------------------
  |  |   59|     22|#define EFTYPE EINVAL
  ------------------
  490|     22|		return -1;
  491|     22|	}
  492|       |
  493|  1.90k|	sat->sat_len = h->h_num_sectors_in_master_sat * nsatpersec + i;
  494|  1.90k|#define CDF_SAT_LIMIT	(16 * 1024 * 1024)
  495|  1.90k|	if (ss != 0 && sat->sat_len > CDF_SAT_LIMIT / ss) {
  ------------------
  |  |  494|  1.90k|#define CDF_SAT_LIMIT	(16 * 1024 * 1024)
  ------------------
  |  Branch (495:6): [True: 1.90k, False: 0]
  |  Branch (495:17): [True: 26, False: 1.87k]
  ------------------
  496|     26|		errno = EFTYPE;
  ------------------
  |  |   59|     26|#define EFTYPE EINVAL
  ------------------
  497|     26|		return -1;
  498|     26|	}
  499|  1.87k|	DPRINTF(("sat_len = %" SIZE_T_FORMAT "u ss = %" SIZE_T_FORMAT "u\n",
  500|  1.87k|	    sat->sat_len, ss));
  501|  1.87k|	if ((sat->sat_tab = CAST(cdf_secid_t *, CDF_CALLOC(sat->sat_len, ss)))
  ------------------
  |  |  460|  1.87k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (501:6): [True: 0, False: 1.87k]
  ------------------
  502|  1.87k|	    == NULL)
  503|      0|		return -1;
  504|       |
  505|  24.0k|	for (i = 0; i < __arraycount(h->h_master_sat); i++) {
  ------------------
  |  |  138|  24.0k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (505:14): [True: 23.8k, False: 151]
  ------------------
  506|  23.8k|		if (h->h_master_sat[i] < 0)
  ------------------
  |  Branch (506:7): [True: 1.70k, False: 22.1k]
  ------------------
  507|  1.70k|			break;
  508|  22.1k|		if (cdf_read_sector(info, sat->sat_tab, ss * i, ss, h,
  ------------------
  |  Branch (508:7): [True: 18, False: 22.1k]
  ------------------
  509|  22.1k|		    h->h_master_sat[i]) != CAST(ssize_t, ss)) {
  ------------------
  |  |  460|  22.1k|#define CAST(T, b)	((T)(b))
  ------------------
  510|     18|			DPRINTF(("Reading sector %d", h->h_master_sat[i]));
  511|     18|			goto out1;
  512|     18|		}
  513|  22.1k|	}
  514|       |
  515|  1.85k|	if ((msa = CAST(cdf_secid_t *, CDF_CALLOC(1, ss))) == NULL)
  ------------------
  |  |  460|  1.85k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (515:6): [True: 0, False: 1.85k]
  ------------------
  516|      0|		goto out1;
  517|       |
  518|  1.85k|	mid = h->h_secid_first_sector_in_master_sat;
  519|   109k|	for (j = 0; j < h->h_num_sectors_in_master_sat; j++) {
  ------------------
  |  Branch (519:14): [True: 108k, False: 1.28k]
  ------------------
  520|   108k|		if (mid < 0)
  ------------------
  |  Branch (520:7): [True: 331, False: 108k]
  ------------------
  521|    331|			goto out;
  522|   108k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|   108k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (522:7): [True: 9, False: 108k]
  ------------------
  523|      9|			DPRINTF(("Reading master sector loop limit"));
  524|      9|			goto out3;
  525|      9|		}
  526|   108k|		if (cdf_read_sector(info, msa, 0, ss, h, mid) !=
  ------------------
  |  Branch (526:7): [True: 56, False: 107k]
  ------------------
  527|   108k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  460|   108k|#define CAST(T, b)	((T)(b))
  ------------------
  528|     56|			DPRINTF(("Reading master sector %d", mid));
  529|     56|			goto out2;
  530|     56|		}
  531|   631k|		for (k = 0; k < nsatpersec; k++, i++) {
  ------------------
  |  Branch (531:15): [True: 523k, False: 107k]
  ------------------
  532|   523k|			sec = CDF_TOLE4(CAST(uint32_t, msa[k]));
  ------------------
  |  |   84|   523k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.04M|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 523k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  533|   523k|			if (sec < 0)
  ------------------
  |  Branch (533:8): [True: 142, False: 523k]
  ------------------
  534|    142|				goto out;
  535|   523k|			if (i >= sat->sat_len) {
  ------------------
  |  Branch (535:8): [True: 0, False: 523k]
  ------------------
  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|   523k|			if (cdf_read_sector(info, sat->sat_tab, ss * i, ss, h,
  ------------------
  |  Branch (541:8): [True: 32, False: 523k]
  ------------------
  542|   523k|			    sec) != CAST(ssize_t, ss)) {
  ------------------
  |  |  460|   523k|#define CAST(T, b)	((T)(b))
  ------------------
  543|     32|				DPRINTF(("Reading sector %d",
  544|     32|				    CDF_TOLE4(msa[k])));
  545|     32|				goto out2;
  546|     32|			}
  547|   523k|		}
  548|   107k|		mid = CDF_TOLE4(CAST(uint32_t, msa[nsatpersec]));
  ------------------
  |  |   84|   107k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|   215k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 107k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  549|   107k|	}
  550|  1.76k|out:
  551|  1.76k|	sat->sat_len = i;
  552|  1.76k|	free(msa);
  553|  1.76k|	return 0;
  554|      9|out3:
  555|      9|	errno = EFTYPE;
  ------------------
  |  |   59|      9|#define EFTYPE EINVAL
  ------------------
  556|     97|out2:
  557|     97|	free(msa);
  558|    115|out1:
  559|    115|	free(sat->sat_tab);
  560|    115|	return -1;
  561|     97|}
cdf_count_chain:
  565|  5.03k|{
  566|  5.03k|	size_t i, j;
  567|  5.03k|	cdf_secid_t maxsector;
  568|       |
  569|  5.03k|	if (size == 0 || sat->sat_len > SIZE_MAX / size)
  ------------------
  |  Branch (569:6): [True: 0, False: 5.03k]
  |  Branch (569:19): [True: 0, False: 5.03k]
  ------------------
  570|      0|		goto out;
  571|  5.03k|	maxsector = CAST(cdf_secid_t, (sat->sat_len * size) /
  ------------------
  |  |  460|  5.03k|#define CAST(T, b)	((T)(b))
  ------------------
  572|  5.03k|	    sizeof(maxsector));
  573|       |
  574|  5.03k|	DPRINTF(("Chain:"));
  575|  5.03k|	if (sid == CDF_SECID_END_OF_CHAIN) {
  ------------------
  |  |   56|  5.03k|#define CDF_SECID_END_OF_CHAIN				-2
  ------------------
  |  Branch (575:6): [True: 45, False: 4.98k]
  ------------------
  576|       |		/* 0-length chain. */
  577|     45|		DPRINTF((" empty\n"));
  578|     45|		return 0;
  579|     45|	}
  580|       |
  581|   363k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (581:18): [True: 359k, False: 4.61k]
  ------------------
  582|   359k|		DPRINTF((" %d", sid));
  583|   359k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|   359k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (583:7): [True: 33, False: 359k]
  ------------------
  584|     33|			DPRINTF(("Counting chain loop limit"));
  585|     33|			goto out;
  586|     33|		}
  587|   359k|		if (i >= CDF_MEMORY_LIMIT / size) {
  ------------------
  |  |   52|   359k|#define CDF_MEMORY_LIMIT				(16 * 1024 * 1024)
  ------------------
  |  Branch (587:7): [True: 5, False: 359k]
  ------------------
  588|      5|			DPRINTF(("Counting chain size limit"));
  589|      5|			goto out;
  590|      5|		}
  591|   359k|		if (sid >= maxsector) {
  ------------------
  |  Branch (591:7): [True: 337, False: 358k]
  ------------------
  592|    337|			DPRINTF(("Sector %d >= %d\n", sid, maxsector));
  593|    337|			goto out;
  594|    337|		}
  595|   358k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|   358k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|   717k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 358k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  596|   358k|	}
  597|  4.61k|	if (i == 0) {
  ------------------
  |  Branch (597:6): [True: 234, False: 4.37k]
  ------------------
  598|    234|		DPRINTF((" none, sid: %d\n", sid));
  599|    234|		goto out;
  600|       |
  601|    234|	}
  602|  4.37k|	DPRINTF(("\n"));
  603|  4.37k|	return i;
  604|    609|out:
  605|    609|	errno = EFTYPE;
  ------------------
  |  |   59|    609|#define EFTYPE EINVAL
  ------------------
  606|    609|	return CAST(size_t, -1);
  ------------------
  |  |  460|    609|#define CAST(T, b)	((T)(b))
  ------------------
  607|  4.61k|}
cdf_read_long_sector_chain:
  612|  1.48k|{
  613|  1.48k|	size_t ss = CDF_SEC_SIZE(h), i, j;
  ------------------
  |  |   81|  1.48k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|  1.48k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  614|  1.48k|	ssize_t nr;
  615|  1.48k|	scn->sst_tab = NULL;
  616|  1.48k|	scn->sst_len = cdf_count_chain(sat, sid, ss);
  617|  1.48k|	scn->sst_dirlen = MAX(h->h_min_size_standard_stream, len);
  ------------------
  |  Branch (617:20): [True: 438, False: 1.04k]
  ------------------
  618|  1.48k|	scn->sst_ss = ss;
  619|       |
  620|  1.48k|	if (sid == CDF_SECID_END_OF_CHAIN || len == 0)
  ------------------
  |  |   56|  2.97k|#define CDF_SECID_END_OF_CHAIN				-2
  ------------------
  |  Branch (620:6): [True: 3, False: 1.48k]
  |  Branch (620:39): [True: 90, False: 1.39k]
  ------------------
  621|     93|		return cdf_zero_stream(scn);
  622|       |
  623|  1.39k|	if (scn->sst_len == CAST(size_t, -1))
  ------------------
  |  |  460|  1.39k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (623:6): [True: 128, False: 1.26k]
  ------------------
  624|    128|		goto out;
  625|       |
  626|  1.26k|	scn->sst_tab = CDF_CALLOC(scn->sst_len, ss);
  ------------------
  |  |   96|  1.26k|#define CDF_CALLOC(n, u) cdf_calloc(__FILE__, __LINE__, (n), (u))
  ------------------
  627|  1.26k|	if (scn->sst_tab == NULL)
  ------------------
  |  Branch (627:6): [True: 0, False: 1.26k]
  ------------------
  628|      0|		return cdf_zero_stream(scn);
  629|       |
  630|  5.23k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (630:18): [True: 3.99k, False: 1.23k]
  ------------------
  631|  3.99k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  3.99k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (631:7): [True: 0, False: 3.99k]
  ------------------
  632|      0|			DPRINTF(("Read long sector chain loop limit"));
  633|      0|			goto out;
  634|      0|		}
  635|  3.99k|		if (i >= scn->sst_len) {
  ------------------
  |  Branch (635:7): [True: 0, False: 3.99k]
  ------------------
  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.99k|		if ((nr = cdf_read_sector(info, scn->sst_tab, i * ss, ss, h,
  ------------------
  |  Branch (641:7): [True: 30, False: 3.96k]
  ------------------
  642|  3.99k|		    sid)) != CAST(ssize_t, ss)) {
  ------------------
  |  |  460|  3.99k|#define CAST(T, b)	((T)(b))
  ------------------
  643|     30|			if (i == scn->sst_len - 1 && nr > 0) {
  ------------------
  |  Branch (643:8): [True: 16, False: 14]
  |  Branch (643:33): [True: 0, False: 16]
  ------------------
  644|       |				/* Last sector might be truncated */
  645|      0|				return 0;
  646|      0|			}
  647|     30|			DPRINTF(("Reading long sector chain %d", sid));
  648|     30|			goto out;
  649|     30|		}
  650|  3.96k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|  3.96k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  7.93k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 3.96k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  651|  3.96k|	}
  652|  1.23k|	return 0;
  653|    158|out:
  654|    158|	errno = EFTYPE;
  ------------------
  |  |   59|    158|#define EFTYPE EINVAL
  ------------------
  655|    158|	return cdf_zero_stream(scn);
  656|  1.26k|}
cdf_read_short_sector_chain:
  662|    245|{
  663|    245|	size_t ss = CDF_SHORT_SEC_SIZE(h), i, j;
  ------------------
  |  |   83|    245|#define CDF_SHORT_SEC_SIZE(h)	CAST(size_t, 1 << (h)->h_short_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|    245|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  664|    245|	scn->sst_tab = NULL;
  665|    245|	scn->sst_len = cdf_count_chain(ssat, sid, CDF_SEC_SIZE(h));
  ------------------
  |  |   81|    245|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|    245|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  666|    245|	scn->sst_dirlen = len;
  667|    245|	scn->sst_ss = ss;
  668|       |
  669|    245|	if (scn->sst_len == CAST(size_t, -1))
  ------------------
  |  |  460|    245|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (669:6): [True: 113, False: 132]
  ------------------
  670|    113|		goto out;
  671|       |
  672|    132|	scn->sst_tab = CDF_CALLOC(scn->sst_len, ss);
  ------------------
  |  |   96|    132|#define CDF_CALLOC(n, u) cdf_calloc(__FILE__, __LINE__, (n), (u))
  ------------------
  673|    132|	if (scn->sst_tab == NULL)
  ------------------
  |  Branch (673:6): [True: 0, False: 132]
  ------------------
  674|      0|		return cdf_zero_stream(scn);
  675|       |
  676|    507|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (676:18): [True: 393, False: 114]
  ------------------
  677|    393|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|    393|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (677:7): [True: 0, False: 393]
  ------------------
  678|      0|			DPRINTF(("Read short sector chain loop limit"));
  679|      0|			goto out;
  680|      0|		}
  681|    393|		if (i >= scn->sst_len) {
  ------------------
  |  Branch (681:7): [True: 0, False: 393]
  ------------------
  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|    393|		if (cdf_read_short_sector(sst, scn->sst_tab, i * ss, ss, h,
  ------------------
  |  Branch (687:7): [True: 18, False: 375]
  ------------------
  688|    393|		    sid) != CAST(ssize_t, ss)) {
  ------------------
  |  |  460|    393|#define CAST(T, b)	((T)(b))
  ------------------
  689|     18|			DPRINTF(("Reading short sector chain %d", sid));
  690|     18|			goto out;
  691|     18|		}
  692|    375|		sid = CDF_TOLE4(CAST(uint32_t, ssat->sat_tab[sid]));
  ------------------
  |  |   84|    375|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|    750|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 375]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  693|    375|	}
  694|    114|	return 0;
  695|    131|out:
  696|    131|	errno = EFTYPE;
  ------------------
  |  |   59|    131|#define EFTYPE EINVAL
  ------------------
  697|    131|	return cdf_zero_stream(scn);
  698|    132|}
cdf_read_sector_chain:
  704|  1.27k|{
  705|       |
  706|  1.27k|	if (len < h->h_min_size_standard_stream && sst->sst_tab != NULL)
  ------------------
  |  Branch (706:6): [True: 410, False: 868]
  |  Branch (706:45): [True: 245, False: 165]
  ------------------
  707|    245|		return cdf_read_short_sector_chain(h, ssat, sst, sid, len,
  708|    245|		    scn);
  709|  1.03k|	else
  710|  1.03k|		return cdf_read_long_sector_chain(info, h, sat, sid, len, scn);
  711|  1.27k|}
cdf_read_dir:
  716|  1.53k|{
  717|  1.53k|	size_t i, j;
  718|  1.53k|	size_t ss = CDF_SEC_SIZE(h), ns, nd;
  ------------------
  |  |   81|  1.53k|#define CDF_SEC_SIZE(h) CAST(size_t, 1 << (h)->h_sec_size_p2)
  |  |  ------------------
  |  |  |  |  460|  1.53k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  719|  1.53k|	char *buf;
  720|  1.53k|	cdf_secid_t sid = h->h_secid_first_directory;
  721|       |
  722|  1.53k|	ns = cdf_count_chain(sat, sid, ss);
  723|  1.53k|	if (ns == CAST(size_t, -1))
  ------------------
  |  |  460|  1.53k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (723:6): [True: 89, False: 1.44k]
  ------------------
  724|     89|		return -1;
  725|       |
  726|  1.44k|	nd = ss / CDF_DIRECTORY_SIZE;
  ------------------
  |  |  118|  1.44k|#define CDF_DIRECTORY_SIZE	128
  ------------------
  727|  1.44k|	if (nd != 0 && ns > CDF_MEMORY_LIMIT / nd / sizeof(dir->dir_tab[0])) {
  ------------------
  |  |   52|  1.40k|#define CDF_MEMORY_LIMIT				(16 * 1024 * 1024)
  ------------------
  |  Branch (727:6): [True: 1.40k, False: 41]
  |  Branch (727:17): [True: 0, False: 1.40k]
  ------------------
  728|      0|		DPRINTF(("Directory size limit"));
  729|      0|		errno = EFTYPE;
  ------------------
  |  |   59|      0|#define EFTYPE EINVAL
  ------------------
  730|      0|		return -1;
  731|      0|	}
  732|       |
  733|  1.44k|	dir->dir_len = ns * nd;
  734|  1.44k|	dir->dir_tab = CAST(cdf_directory_t *,
  ------------------
  |  |  460|  1.44k|#define CAST(T, b)	((T)(b))
  ------------------
  735|  1.44k|	    CDF_CALLOC(dir->dir_len, sizeof(dir->dir_tab[0])));
  736|  1.44k|	if (dir->dir_tab == NULL)
  ------------------
  |  Branch (736:6): [True: 0, False: 1.44k]
  ------------------
  737|      0|		return -1;
  738|       |
  739|  1.44k|	if ((buf = CAST(char *, CDF_MALLOC(ss))) == NULL) {
  ------------------
  |  |  460|  1.44k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (739:6): [True: 0, False: 1.44k]
  ------------------
  740|      0|		free(dir->dir_tab);
  741|      0|		return -1;
  742|      0|	}
  743|       |
  744|  6.30k|	for (j = i = 0; i < ns; i++, j++) {
  ------------------
  |  Branch (744:18): [True: 4.86k, False: 1.43k]
  ------------------
  745|  4.86k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  4.86k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (745:7): [True: 0, False: 4.86k]
  ------------------
  746|      0|			DPRINTF(("Read dir loop limit"));
  747|      0|			goto out;
  748|      0|		}
  749|  4.86k|		if (cdf_read_sector(info, buf, 0, ss, h, sid) !=
  ------------------
  |  Branch (749:7): [True: 13, False: 4.85k]
  ------------------
  750|  4.86k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  460|  4.86k|#define CAST(T, b)	((T)(b))
  ------------------
  751|     13|			DPRINTF(("Reading directory sector %d", sid));
  752|     13|			goto out;
  753|     13|		}
  754|  22.1k|		for (j = 0; j < nd; j++) {
  ------------------
  |  Branch (754:15): [True: 17.2k, False: 4.85k]
  ------------------
  755|  17.2k|			cdf_unpack_dir(&dir->dir_tab[i * nd + j],
  756|  17.2k|			    &buf[j * CDF_DIRECTORY_SIZE]);
  ------------------
  |  |  118|  17.2k|#define CDF_DIRECTORY_SIZE	128
  ------------------
  757|  17.2k|		}
  758|  4.85k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|  4.85k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  9.71k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.85k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  759|  4.85k|	}
  760|  1.43k|	if (NEED_SWAP)
  ------------------
  |  |   79|  1.43k|#define NEED_SWAP	(cdf_bo.u == CAST(uint32_t, 0x01020304))
  |  |  ------------------
  |  |  |  |  460|  1.43k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  |  Branch (79:19): [True: 0, False: 1.43k]
  |  |  ------------------
  ------------------
  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.43k|	free(buf);
  764|  1.43k|	return 0;
  765|     13|out:
  766|     13|	free(dir->dir_tab);
  767|     13|	free(buf);
  768|     13|	errno = EFTYPE;
  ------------------
  |  |   59|     13|#define EFTYPE EINVAL
  ------------------
  769|     13|	return -1;
  770|  1.44k|}
cdf_read_ssat:
  776|  1.76k|{
  777|  1.76k|	size_t i, j;
  778|  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))
  |  |  ------------------
  ------------------
  779|  1.76k|	cdf_secid_t sid = h->h_secid_first_sector_in_short_sat;
  780|       |
  781|  1.76k|	ssat->sat_tab = NULL;
  782|  1.76k|	ssat->sat_len = cdf_count_chain(sat, sid, ss);
  783|  1.76k|	if (ssat->sat_len == CAST(size_t, -1))
  ------------------
  |  |  460|  1.76k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (783:6): [True: 221, False: 1.54k]
  ------------------
  784|    221|		goto out;
  785|       |
  786|  1.54k|	ssat->sat_tab = CAST(cdf_secid_t *, CDF_CALLOC(ssat->sat_len, ss));
  ------------------
  |  |  460|  1.54k|#define CAST(T, b)	((T)(b))
  ------------------
  787|  1.54k|	if (ssat->sat_tab == NULL)
  ------------------
  |  Branch (787:6): [True: 0, False: 1.54k]
  ------------------
  788|      0|		goto out1;
  789|       |
  790|  5.83k|	for (j = i = 0; sid >= 0; i++, j++) {
  ------------------
  |  Branch (790:18): [True: 4.29k, False: 1.53k]
  ------------------
  791|  4.29k|		if (j >= CDF_LOOP_LIMIT) {
  ------------------
  |  |   50|  4.29k|#define CDF_LOOP_LIMIT					10000
  ------------------
  |  Branch (791:7): [True: 0, False: 4.29k]
  ------------------
  792|      0|			DPRINTF(("Read short sat sector loop limit"));
  793|      0|			goto out;
  794|      0|		}
  795|  4.29k|		if (i >= ssat->sat_len) {
  ------------------
  |  Branch (795:7): [True: 0, False: 4.29k]
  ------------------
  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|  4.29k|		if (cdf_read_sector(info, ssat->sat_tab, i * ss, ss, h, sid) !=
  ------------------
  |  Branch (801:7): [True: 2, False: 4.29k]
  ------------------
  802|  4.29k|		    CAST(ssize_t, ss)) {
  ------------------
  |  |  460|  4.29k|#define CAST(T, b)	((T)(b))
  ------------------
  803|      2|			DPRINTF(("Reading short sat sector %d", sid));
  804|      2|			goto out1;
  805|      2|		}
  806|  4.29k|		sid = CDF_TOLE4(CAST(uint32_t, sat->sat_tab[sid]));
  ------------------
  |  |   84|  4.29k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  8.58k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 4.29k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  807|  4.29k|	}
  808|  1.53k|	return 0;
  809|    221|out:
  810|    221|	errno = EFTYPE;
  ------------------
  |  |   59|    221|#define EFTYPE EINVAL
  ------------------
  811|    223|out1:
  812|    223|	free(ssat->sat_tab);
  813|    223|	return -1;
  814|    221|}
cdf_read_short_stream:
  820|  1.43k|{
  821|  1.43k|	size_t i;
  822|  1.43k|	const cdf_directory_t *d;
  823|       |
  824|  1.43k|	*root = NULL;
  825|  11.4k|	for (i = 0; i < dir->dir_len; i++)
  ------------------
  |  Branch (825:14): [True: 10.6k, False: 812]
  ------------------
  826|  10.6k|		if (dir->dir_tab[i].d_type == CDF_DIR_TYPE_ROOT_STORAGE)
  ------------------
  |  |  102|  10.6k|#define CDF_DIR_TYPE_ROOT_STORAGE	5
  ------------------
  |  Branch (826:7): [True: 624, False: 10.0k]
  ------------------
  827|    624|			break;
  828|       |
  829|       |	/* If the it is not there, just fake it; some docs don't have it */
  830|  1.43k|	if (i == dir->dir_len) {
  ------------------
  |  Branch (830:6): [True: 812, False: 624]
  ------------------
  831|    812|		DPRINTF(("Cannot find root storage dir\n"));
  832|    812|		goto out;
  833|    812|	}
  834|    624|	d = &dir->dir_tab[i];
  835|    624|	*root = d;
  836|       |
  837|       |	/* If the it is not there, just fake it; some docs don't have it */
  838|    624|	if (d->d_stream_first_sector < 0) {
  ------------------
  |  Branch (838:6): [True: 170, False: 454]
  ------------------
  839|    170|		DPRINTF(("No first secror in dir\n"));
  840|    170|		goto out;
  841|    170|	}
  842|       |
  843|    454|	return cdf_read_long_sector_chain(info, h, sat,
  844|    454|	    d->d_stream_first_sector, d->d_size, scn);
  845|    982|out:
  846|       |	scn->sst_tab = NULL;
  847|    982|	(void)cdf_zero_stream(scn);
  848|    982|	return 0;
  849|    624|}
cdf_namecmp:
  853|  15.2k|{
  854|  42.4k|	for (; l--; d++, s++)
  ------------------
  |  Branch (854:9): [True: 41.1k, False: 1.28k]
  ------------------
  855|  41.1k|		if (*d != CDF_TOLE2(*s))
  ------------------
  |  |   86|  41.1k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  82.3k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 41.1k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (855:7): [True: 13.9k, False: 27.2k]
  ------------------
  856|  13.9k|			return CAST(unsigned char, *d) - CDF_TOLE2(*s);
  ------------------
  |  |  460|  13.9k|#define CAST(T, b)	((T)(b))
  ------------------
              			return CAST(unsigned char, *d) - CDF_TOLE2(*s);
  ------------------
  |  |   86|  13.9k|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  27.8k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 13.9k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  857|  1.28k|	return 0;
  858|  15.2k|}
cdf_read_doc_summary_info:
  864|  1.09k|{
  865|  1.09k|	return cdf_read_user_stream(info, h, sat, ssat, sst, dir,
  866|  1.09k|	    "\05DocumentSummaryInformation", scn);
  867|  1.09k|}
cdf_read_summary_info:
  873|  1.29k|{
  874|  1.29k|	return cdf_read_user_stream(info, h, sat, ssat, sst, dir,
  875|  1.29k|	    "\05SummaryInformation", scn);
  876|  1.29k|}
cdf_read_user_stream:
  882|  3.67k|{
  883|  3.67k|	const cdf_directory_t *d;
  884|  3.67k|	int i = cdf_find_stream(dir, name, CDF_DIR_TYPE_USER_STREAM);
  ------------------
  |  |   99|  3.67k|#define CDF_DIR_TYPE_USER_STREAM	2
  ------------------
  885|       |
  886|  3.67k|	if (i <= 0) {
  ------------------
  |  Branch (886:6): [True: 2.39k, False: 1.27k]
  ------------------
  887|  2.39k|		memset(scn, 0, sizeof(*scn));
  888|  2.39k|		return -1;
  889|  2.39k|	}
  890|       |
  891|  1.27k|	d = &dir->dir_tab[i - 1];
  892|  1.27k|	return cdf_read_sector_chain(info, h, sat, ssat, sst,
  893|  1.27k|	    d->d_stream_first_sector, d->d_size, scn);
  894|  3.67k|}
cdf_find_stream:
  898|  3.67k|{
  899|  3.67k|	size_t i, name_len = strlen(name) + 1;
  900|       |
  901|  30.5k|	for (i = 1; i <= dir->dir_len; i++)
  ------------------
  |  Branch (901:14): [True: 28.1k, False: 2.39k]
  ------------------
  902|  28.1k|		if (dir->dir_tab[i-1].d_type == type &&
  ------------------
  |  Branch (902:7): [True: 4.22k, False: 23.9k]
  ------------------
  903|  4.22k|		    cdf_namecmp(name, dir->dir_tab[i-1].d_name, name_len)
  ------------------
  |  Branch (903:7): [True: 1.27k, False: 2.94k]
  ------------------
  904|  4.22k|		    == 0)
  905|  1.27k|			break;
  906|  3.67k|	if (i <= dir->dir_len)
  ------------------
  |  Branch (906:6): [True: 1.27k, False: 2.39k]
  ------------------
  907|  1.27k|		return CAST(int, i);
  ------------------
  |  |  460|  1.27k|#define CAST(T, b)	((T)(b))
  ------------------
  908|       |
  909|  2.39k|	DPRINTF(("Cannot find type %d `%s'\n", type, name));
  910|  2.39k|	errno = ESRCH;
  911|  2.39k|	return 0;
  912|  3.67k|}
cdf_read_property_info:
 1011|    993|{
 1012|    993|	const cdf_section_header_t *shp;
 1013|    993|	cdf_section_header_t sh;
 1014|    993|	const uint8_t *p, *q, *e;
 1015|    993|	size_t i, o4, nelements, j, slen, left;
 1016|    993|	cdf_property_info_t *inp;
 1017|       |
 1018|    993|	if (offs > UINT32_MAX / 4) {
  ------------------
  |  Branch (1018:6): [True: 19, False: 974]
  ------------------
 1019|     19|		errno = EFTYPE;
  ------------------
  |  |   59|     19|#define EFTYPE EINVAL
  ------------------
 1020|     19|		goto out;
 1021|     19|	}
 1022|    974|	shp = CAST(const cdf_section_header_t *,
  ------------------
  |  |  460|    974|#define CAST(T, b)	((T)(b))
  ------------------
 1023|    974|	    cdf_offset(sst->sst_tab, offs));
 1024|    974|	if (cdf_check_stream_offset(sst, h, shp, sizeof(*shp), __LINE__) == -1)
  ------------------
  |  Branch (1024:6): [True: 63, False: 911]
  ------------------
 1025|     63|		goto out;
 1026|    911|	sh.sh_len = CDF_TOLE4(shp->sh_len);
  ------------------
  |  |   84|    911|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.82k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 911]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1027|    911|	if (sh.sh_len > CDF_SHLEN_LIMIT) {
  ------------------
  |  |  914|    911|#define CDF_SHLEN_LIMIT (UINT32_MAX / 64)
  ------------------
  |  Branch (1027:6): [True: 26, False: 885]
  ------------------
 1028|     26|		errno = EFTYPE;
  ------------------
  |  |   59|     26|#define EFTYPE EINVAL
  ------------------
 1029|     26|		goto out;
 1030|     26|	}
 1031|       |
 1032|    885|	if (cdf_check_stream_offset(sst, h, shp, sh.sh_len, __LINE__) == -1)
  ------------------
  |  Branch (1032:6): [True: 34, False: 851]
  ------------------
 1033|     34|		goto out;
 1034|       |
 1035|    851|	sh.sh_properties = CDF_TOLE4(shp->sh_properties);
  ------------------
  |  |   84|    851|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.70k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 851]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1036|    851|	DPRINTF(("section len: %u properties %u\n", sh.sh_len,
 1037|    851|	    sh.sh_properties));
 1038|    851|	if (sh.sh_properties > CDF_PROP_LIMIT)
  ------------------
  |  |  915|    851|#define CDF_PROP_LIMIT (UINT32_MAX / (64 * sizeof(cdf_property_info_t)))
  ------------------
  |  Branch (1038:6): [True: 17, False: 834]
  ------------------
 1039|     17|		goto out;
 1040|    834|	inp = cdf_grow_info(info, maxcount, sh.sh_properties);
 1041|    834|	if (inp == NULL)
  ------------------
  |  Branch (1041:6): [True: 0, False: 834]
  ------------------
 1042|      0|		goto out;
 1043|    834|	inp += *count;
 1044|    834|	*count += sh.sh_properties;
 1045|    834|	p = CAST(const uint8_t *, cdf_offset(sst->sst_tab, offs + sizeof(sh)));
  ------------------
  |  |  460|    834|#define CAST(T, b)	((T)(b))
  ------------------
 1046|    834|	e = CAST(const uint8_t *, cdf_offset(shp, sh.sh_len));
  ------------------
  |  |  460|    834|#define CAST(T, b)	((T)(b))
  ------------------
 1047|    834|	if (p >= e || cdf_check_stream_offset(sst, h, e, 0, __LINE__) == -1)
  ------------------
  |  Branch (1047:6): [True: 9, False: 825]
  |  Branch (1047:16): [True: 0, False: 825]
  ------------------
 1048|      9|		goto out;
 1049|       |
 1050|  7.43k|	for (i = 0; i < sh.sh_properties; i++) {
  ------------------
  |  Branch (1050:14): [True: 7.01k, False: 419]
  ------------------
 1051|  7.01k|		if ((q = cdf_get_property_info_pos(sst, h, p, e, i)) == NULL)
  ------------------
  |  Branch (1051:7): [True: 277, False: 6.74k]
  ------------------
 1052|    277|			goto out;
 1053|  6.74k|		inp[i].pi_id = CDF_GETUINT32(p, i << 1);
  ------------------
  |  |   92|  6.74k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1054|  6.74k|		left = CAST(size_t, e - q);
  ------------------
  |  |  460|  6.74k|#define CAST(T, b)	((T)(b))
  ------------------
 1055|  6.74k|		if (left < sizeof(uint32_t)) {
  ------------------
  |  Branch (1055:7): [True: 7, False: 6.73k]
  ------------------
 1056|      7|			DPRINTF(("short info (no type)_\n"));
 1057|      7|			goto out;
 1058|      7|		}
 1059|  6.73k|		inp[i].pi_type = CDF_GETUINT32(q, 0);
  ------------------
  |  |   92|  6.73k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1060|  6.73k|		DPRINTF(("%" SIZE_T_FORMAT "u) id=%#x type=%#x offs=%#tx,%#x\n",
 1061|  6.73k|		    i, inp[i].pi_id, inp[i].pi_type, q - p, offs));
 1062|  6.73k|		if (inp[i].pi_type & CDF_VECTOR) {
  ------------------
  |  |  238|  6.73k|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (1062:7): [True: 1.35k, False: 5.37k]
  ------------------
 1063|  1.35k|			if (left < sizeof(uint32_t) * 2) {
  ------------------
  |  Branch (1063:8): [True: 6, False: 1.35k]
  ------------------
 1064|      6|				DPRINTF(("missing CDF_VECTOR length\n"));
 1065|      6|				goto out;
 1066|      6|			}
 1067|  1.35k|			nelements = CDF_GETUINT32(q, 1);
  ------------------
  |  |   92|  1.35k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1068|  1.35k|			if (nelements > CDF_ELEMENT_LIMIT || nelements == 0) {
  ------------------
  |  |   51|  2.70k|#define CDF_ELEMENT_LIMIT				100000
  ------------------
  |  Branch (1068:8): [True: 43, False: 1.30k]
  |  Branch (1068:41): [True: 4, False: 1.30k]
  ------------------
 1069|     47|				DPRINTF(("CDF_VECTOR with nelements == %"
 1070|     47|				    SIZE_T_FORMAT "u\n", nelements));
 1071|     47|				goto out;
 1072|     47|			}
 1073|  1.30k|			slen = 2;
 1074|  5.37k|		} else {
 1075|  5.37k|			nelements = 1;
 1076|  5.37k|			slen = 1;
 1077|  5.37k|		}
 1078|  6.68k|		o4 = slen * sizeof(uint32_t);
 1079|  6.68k|		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  239|  6.68k|#define CDF_ARRAY		0x00002000
  ------------------
              		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  240|  6.68k|#define CDF_BYREF		0x00004000
  ------------------
              		if (inp[i].pi_type & (CDF_ARRAY|CDF_BYREF|CDF_RESERVED))
  ------------------
  |  |  241|  6.68k|#define CDF_RESERVED		0x00008000
  ------------------
  |  Branch (1079:7): [True: 1.64k, False: 5.03k]
  ------------------
 1080|  1.64k|			goto unknown;
 1081|  5.03k|		switch (inp[i].pi_type & CDF_TYPEMASK) {
  ------------------
  |  |  244|  5.03k|#define CDF_TYPEMASK		0x00000fff
  ------------------
 1082|    399|		case CDF_NULL:
  ------------------
  |  |  199|    399|#define CDF_NULL		0x00000001
  ------------------
  |  Branch (1082:3): [True: 399, False: 4.63k]
  ------------------
 1083|  1.31k|		case CDF_EMPTY:
  ------------------
  |  |  198|  1.31k|#define CDF_EMPTY		0x00000000
  ------------------
  |  Branch (1083:3): [True: 916, False: 4.11k]
  ------------------
 1084|  1.31k|			break;
 1085|    435|		case CDF_SIGNED16:
  ------------------
  |  |  200|    435|#define CDF_SIGNED16		0x00000002
  ------------------
  |  Branch (1085:3): [True: 435, False: 4.59k]
  ------------------
 1086|    435|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int16_t)))
  ------------------
  |  Branch (1086:8): [True: 158, False: 277]
  ------------------
 1087|    158|				goto unknown;
 1088|    277|			break;
 1089|    288|		case CDF_SIGNED32:
  ------------------
  |  |  201|    288|#define CDF_SIGNED32		0x00000003
  ------------------
  |  Branch (1089:3): [True: 288, False: 4.74k]
  ------------------
 1090|    376|		case CDF_BOOL:
  ------------------
  |  |  209|    376|#define CDF_BOOL		0x0000000b
  ------------------
  |  Branch (1090:3): [True: 88, False: 4.94k]
  ------------------
 1091|    522|		case CDF_UNSIGNED32:
  ------------------
  |  |  216|    522|#define CDF_UNSIGNED32		0x00000013
  ------------------
  |  Branch (1091:3): [True: 146, False: 4.88k]
  ------------------
 1092|    900|		case CDF_FLOAT:
  ------------------
  |  |  202|    900|#define CDF_FLOAT		0x00000004
  ------------------
  |  Branch (1092:3): [True: 378, False: 4.65k]
  ------------------
 1093|    900|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int32_t)))
  ------------------
  |  Branch (1093:8): [True: 208, False: 692]
  ------------------
 1094|    208|				goto unknown;
 1095|    692|			break;
 1096|    692|		case CDF_SIGNED64:
  ------------------
  |  |  217|     77|#define CDF_SIGNED64		0x00000014
  ------------------
  |  Branch (1096:3): [True: 77, False: 4.95k]
  ------------------
 1097|    157|		case CDF_UNSIGNED64:
  ------------------
  |  |  218|    157|#define CDF_UNSIGNED64		0x00000015
  ------------------
  |  Branch (1097:3): [True: 80, False: 4.95k]
  ------------------
 1098|    371|		case CDF_DOUBLE:
  ------------------
  |  |  203|    371|#define CDF_DOUBLE		0x00000005
  ------------------
  |  Branch (1098:3): [True: 214, False: 4.81k]
  ------------------
 1099|  1.07k|		case CDF_FILETIME:
  ------------------
  |  |  229|  1.07k|#define CDF_FILETIME		0x00000040
  ------------------
  |  Branch (1099:3): [True: 704, False: 4.32k]
  ------------------
 1100|  1.07k|			if (!cdf_copy_info(&inp[i], &q[o4], e, sizeof(int64_t)))
  ------------------
  |  Branch (1100:8): [True: 254, False: 821]
  ------------------
 1101|    254|				goto unknown;
 1102|    821|			break;
 1103|    821|		case CDF_LENGTH32_STRING:
  ------------------
  |  |  227|    373|#define CDF_LENGTH32_STRING	0x0000001e
  ------------------
  |  Branch (1103:3): [True: 373, False: 4.66k]
  ------------------
 1104|    543|		case CDF_LENGTH32_WSTRING:
  ------------------
  |  |  228|    543|#define CDF_LENGTH32_WSTRING	0x0000001f
  ------------------
  |  Branch (1104:3): [True: 170, False: 4.86k]
  ------------------
 1105|    543|			if (nelements > 1) {
  ------------------
  |  Branch (1105:8): [True: 90, False: 453]
  ------------------
 1106|     90|				size_t nelem = inp - *info;
 1107|     90|				inp = cdf_grow_info(info, maxcount, nelements);
 1108|     90|				if (inp == NULL)
  ------------------
  |  Branch (1108:9): [True: 5, False: 85]
  ------------------
 1109|      5|					goto out;
 1110|     85|				inp += nelem;
 1111|     85|			}
 1112|   166k|			for (j = 0; j < nelements && i < sh.sh_properties;
  ------------------
  |  Branch (1112:16): [True: 166k, False: 470]
  |  Branch (1112:33): [True: 166k, False: 4]
  ------------------
 1113|   166k|			    j++, i++)
 1114|   166k|			{
 1115|   166k|				uint32_t l;
 1116|       |
 1117|   166k|				if (o4 + sizeof(uint32_t) > left)
  ------------------
  |  Branch (1117:9): [True: 9, False: 166k]
  ------------------
 1118|      9|					goto out;
 1119|       |
 1120|   166k|				l = CDF_GETUINT32(q, slen);
  ------------------
  |  |   92|   166k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
 1121|   166k|				o4 += sizeof(uint32_t);
 1122|   166k|				if (o4 + l > left)
  ------------------
  |  Branch (1122:9): [True: 55, False: 166k]
  ------------------
 1123|     55|					goto out;
 1124|       |
 1125|   166k|				inp[i].pi_str.s_len = l;
  ------------------
  |  |  192|   166k|#define pi_str	pi_val._pi_str
  ------------------
 1126|   166k|				inp[i].pi_str.s_buf = CAST(const char *,
  ------------------
  |  |  192|   166k|#define pi_str	pi_val._pi_str
  ------------------
              				inp[i].pi_str.s_buf = CAST(const char *,
  ------------------
  |  |  460|   166k|#define CAST(T, b)	((T)(b))
  ------------------
 1127|   166k|				    CAST(const void *, &q[o4]));
 1128|       |
 1129|   166k|				DPRINTF(("o=%" SIZE_T_FORMAT "u l=%d(%"
 1130|   166k|				    SIZE_T_FORMAT "u), t=%" SIZE_T_FORMAT
 1131|   166k|				    "u s=%.*s\n", o4, l,
 1132|   166k|				    CDF_ROUND(l, sizeof(l)),
 1133|   166k|				    left, (int)l, inp[i].pi_str.s_buf));
 1134|       |
 1135|   166k|				if (l & 1)
  ------------------
  |  Branch (1135:9): [True: 201, False: 165k]
  ------------------
 1136|    201|					l++;
 1137|       |
 1138|   166k|				slen += l >> 1;
 1139|   166k|				o4 = slen * sizeof(uint32_t);
 1140|   166k|			}
 1141|    474|			i--;
 1142|    474|			break;
 1143|    221|		case CDF_CLIPBOARD:
  ------------------
  |  |  236|    221|#define CDF_CLIPBOARD		0x00000047
  ------------------
  |  Branch (1143:3): [True: 221, False: 4.81k]
  ------------------
 1144|    221|			if (inp[i].pi_type & CDF_VECTOR)
  ------------------
  |  |  238|    221|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (1144:8): [True: 104, False: 117]
  ------------------
 1145|    104|				goto unknown;
 1146|    117|			break;
 1147|    544|		default:
  ------------------
  |  Branch (1147:3): [True: 544, False: 4.48k]
  ------------------
 1148|  2.91k|		unknown:
 1149|  2.91k|			memset(&inp[i].pi_val, 0, sizeof(inp[i].pi_val));
 1150|  2.91k|			DPRINTF(("Don't know how to deal with %#x\n",
 1151|  2.91k|			    inp[i].pi_type));
 1152|  2.91k|			break;
 1153|  5.03k|		}
 1154|  5.03k|	}
 1155|    419|	return 0;
 1156|    574|out:
 1157|    574|	free(*info);
 1158|    574|	*info = NULL;
 1159|    574|	*count = 0;
 1160|    574|	*maxcount = 0;
 1161|    574|	errno = EFTYPE;
  ------------------
  |  |   59|    574|#define EFTYPE EINVAL
  ------------------
 1162|    574|	return -1;
 1163|    825|}
cdf_unpack_summary_info:
 1168|  1.00k|{
 1169|  1.00k|	size_t maxcount;
 1170|  1.00k|	const cdf_summary_info_header_t *si =
 1171|  1.00k|	    CAST(const cdf_summary_info_header_t *, sst->sst_tab);
  ------------------
  |  |  460|  1.00k|#define CAST(T, b)	((T)(b))
  ------------------
 1172|  1.00k|	const cdf_section_declaration_t *sd =
 1173|  1.00k|	    CAST(const cdf_section_declaration_t *, RCAST(const void *,
  ------------------
  |  |  460|  1.00k|#define CAST(T, b)	((T)(b))
  ------------------
 1174|  1.00k|	    RCAST(const char *, sst->sst_tab)
 1175|  1.00k|	    + CDF_SECTION_DECLARATION_OFFSET));
 1176|       |
 1177|  1.00k|	if (cdf_check_stream_offset(sst, h, si, sizeof(*si), __LINE__) == -1 ||
  ------------------
  |  Branch (1177:6): [True: 11, False: 997]
  ------------------
 1178|    997|	    cdf_check_stream_offset(sst, h, sd, sizeof(*sd), __LINE__) == -1)
  ------------------
  |  Branch (1178:6): [True: 4, False: 993]
  ------------------
 1179|     15|		return -1;
 1180|    993|	ssi->si_byte_order = CDF_TOLE2(si->si_byte_order);
  ------------------
  |  |   86|    993|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1181|    993|	ssi->si_os_version = CDF_TOLE2(si->si_os_version);
  ------------------
  |  |   86|    993|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1182|    993|	ssi->si_os = CDF_TOLE2(si->si_os);
  ------------------
  |  |   86|    993|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1183|    993|	ssi->si_class = si->si_class;
 1184|    993|	cdf_swap_class(&ssi->si_class);
 1185|    993|	ssi->si_count = CDF_TOLE4(si->si_count);
  ------------------
  |  |   84|    993|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1186|    993|	*count = 0;
 1187|    993|	maxcount = 0;
 1188|    993|	*info = NULL;
 1189|    993|	if (cdf_read_property_info(sst, h, CDF_TOLE4(sd->sd_offset), info,
  ------------------
  |  |   84|    993|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.98k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 993]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (1189:6): [True: 574, False: 419]
  ------------------
 1190|    993|	    count, &maxcount) == -1)
 1191|    574|		return -1;
 1192|    419|	return 0;
 1193|    993|}
cdf_print_property_name:
 1312|  1.43k|{
 1313|  1.43k|	size_t i;
 1314|       |
 1315|  26.0k|	for (i = 0; i < __arraycount(vn); i++)
  ------------------
  |  |  138|  26.0k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (1315:14): [True: 24.9k, False: 1.10k]
  ------------------
 1316|  24.9k|		if (vn[i].v == p)
  ------------------
  |  Branch (1316:7): [True: 333, False: 24.6k]
  ------------------
 1317|    333|			return snprintf(buf, bufsiz, "%s", vn[i].n);
 1318|  1.10k|	return snprintf(buf, bufsiz, "%#x", p);
 1319|  1.43k|}
cdf_print_elapsed_time:
 1323|    290|{
 1324|    290|	int len = 0;
 1325|    290|	int days, hours, mins, secs;
 1326|       |
 1327|    290|	ts /= CDF_TIME_PREC;
  ------------------
  |  |   91|    290|#define CDF_TIME_PREC	10000000
  ------------------
 1328|    290|	secs = CAST(int, ts % 60);
  ------------------
  |  |  460|    290|#define CAST(T, b)	((T)(b))
  ------------------
 1329|    290|	ts /= 60;
 1330|    290|	mins = CAST(int, ts % 60);
  ------------------
  |  |  460|    290|#define CAST(T, b)	((T)(b))
  ------------------
 1331|    290|	ts /= 60;
 1332|    290|	hours = CAST(int, ts % 24);
  ------------------
  |  |  460|    290|#define CAST(T, b)	((T)(b))
  ------------------
 1333|    290|	ts /= 24;
 1334|    290|	days = CAST(int, ts);
  ------------------
  |  |  460|    290|#define CAST(T, b)	((T)(b))
  ------------------
 1335|       |
 1336|    290|	if (days) {
  ------------------
  |  Branch (1336:6): [True: 146, False: 144]
  ------------------
 1337|    146|		len += snprintf(buf + len, bufsiz - len, "%dd+", days);
 1338|    146|		if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  460|    146|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1338:7): [True: 0, False: 146]
  ------------------
 1339|      0|			return len;
 1340|    146|	}
 1341|       |
 1342|    290|	if (days || hours) {
  ------------------
  |  Branch (1342:6): [True: 146, False: 144]
  |  Branch (1342:14): [True: 68, False: 76]
  ------------------
 1343|    214|		len += snprintf(buf + len, bufsiz - len, "%.2d:", hours);
 1344|    214|		if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  460|    214|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1344:7): [True: 0, False: 214]
  ------------------
 1345|      0|			return len;
 1346|    214|	}
 1347|       |
 1348|    290|	len += snprintf(buf + len, bufsiz - len, "%.2d:", mins);
 1349|    290|	if (CAST(size_t, len) >= bufsiz)
  ------------------
  |  |  460|    290|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1349:6): [True: 0, False: 290]
  ------------------
 1350|      0|		return len;
 1351|       |
 1352|    290|	len += snprintf(buf + len, bufsiz - len, "%.2d", secs);
 1353|    290|	return len;
 1354|    290|}
cdf.c:cdf_read:
  371|   678k|{
  372|   678k|	size_t siz = CAST(size_t, off + len);
  ------------------
  |  |  460|   678k|#define CAST(T, b)	((T)(b))
  ------------------
  373|       |
  374|   678k|	if (CAST(off_t, off + len) != CAST(off_t, siz))
  ------------------
  |  |  460|   678k|#define CAST(T, b)	((T)(b))
  ------------------
              	if (CAST(off_t, off + len) != CAST(off_t, siz))
  ------------------
  |  |  460|   678k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (374:6): [True: 0, False: 678k]
  ------------------
  375|      0|		goto out;
  376|       |
  377|   678k|	if (info->i_buf != NULL && info->i_len >= siz) {
  ------------------
  |  Branch (377:6): [True: 678k, False: 0]
  |  Branch (377:29): [True: 670k, False: 8.35k]
  ------------------
  378|   670k|		(void)memcpy(buf, &info->i_buf[off], len);
  379|   670k|		return CAST(ssize_t, len);
  ------------------
  |  |  460|   670k|#define CAST(T, b)	((T)(b))
  ------------------
  380|   670k|	}
  381|       |
  382|  8.35k|	if (info->i_fd == -1)
  ------------------
  |  Branch (382:6): [True: 8.35k, False: 0]
  ------------------
  383|  8.35k|		goto out;
  384|       |
  385|      0|	if (pread(info->i_fd, buf, len, off) != CAST(ssize_t, len))
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (385:6): [True: 0, False: 0]
  ------------------
  386|      0|		return -1;
  387|       |
  388|      0|	return CAST(ssize_t, len);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  389|  8.35k|out:
  390|  8.35k|	errno = EINVAL;
  391|  8.35k|	return -1;
  392|      0|}
cdf.c:cdf_calloc:
  125|  8.12k|{
  126|  8.12k|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u %"
  127|  8.12k|	    SIZE_T_FORMAT "u\n", file, line, __func__, n, u));
  128|  8.12k|	if (n == 0)
  ------------------
  |  Branch (128:6): [True: 84, False: 8.03k]
  ------------------
  129|     84|	    n++;
  130|  8.12k|	return calloc(n, u);
  131|  8.12k|}
cdf.c:cdf_malloc:
  103|  1.44k|{
  104|  1.44k|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u\n",
  105|  1.44k|	    file, line, __func__, n));
  106|  1.44k|	if (n == 0)
  ------------------
  |  Branch (106:6): [True: 0, False: 1.44k]
  ------------------
  107|      0|	    n++;
  108|  1.44k|	return malloc(n);
  109|  1.44k|}
cdf.c:cdf_offset:
  919|  9.38k|{
  920|  9.38k|	return CAST(const void *, CAST(const uint8_t *, p) + l);
  ------------------
  |  |  460|  9.38k|#define CAST(T, b)	((T)(b))
  ------------------
  921|  9.38k|}
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: 124]
  ------------------
  360|  11.5k|		return 0;
  361|    124|	DPRINTF(("%d: offset begin %p < end %p || %" SIZE_T_FORMAT "u"
  362|    124|	    " > %" SIZE_T_FORMAT "u [%" SIZE_T_FORMAT "u %"
  363|    124|	    SIZE_T_FORMAT "u]\n", line, b, e, (size_t)(e - b),
  364|    124|	    ss * sst->sst_len, ss, sst->sst_len));
  365|    124|	errno = EFTYPE;
  ------------------
  |  |   59|    124|#define EFTYPE EINVAL
  ------------------
  366|    124|	return -1;
  367|  11.7k|}
cdf.c:cdf_grow_info:
  956|    924|{
  957|    924|	cdf_property_info_t *inp;
  958|    924|	size_t newcount = *maxcount + incr;
  959|       |
  960|    924|	if (newcount > CDF_PROP_LIMIT) {
  ------------------
  |  |  915|    924|#define CDF_PROP_LIMIT (UINT32_MAX / (64 * sizeof(cdf_property_info_t)))
  ------------------
  |  Branch (960:6): [True: 5, False: 919]
  ------------------
  961|      5|		DPRINTF(("exceeded property limit %" SIZE_T_FORMAT "u > %"
  962|      5|		    SIZE_T_FORMAT "u\n", newcount, CDF_PROP_LIMIT));
  963|      5|		goto out;
  964|      5|	}
  965|    919|	inp = CAST(cdf_property_info_t *,
  ------------------
  |  |  460|    919|#define CAST(T, b)	((T)(b))
  ------------------
  966|    919|	    CDF_REALLOC(*info, newcount * sizeof(*inp)));
  967|    919|	if (inp == NULL)
  ------------------
  |  Branch (967:6): [True: 0, False: 919]
  ------------------
  968|      0|		goto out;
  969|       |
  970|    919|	*info = inp;
  971|    919|	*maxcount = newcount;
  972|    919|	return inp;
  973|      5|out:
  974|      5|	free(*info);
  975|      5|	*maxcount = 0;
  976|      5|	*info = NULL;
  977|       |	return NULL;
  978|    919|}
cdf.c:cdf_realloc:
  115|    919|{
  116|    919|	DPRINTF(("%s,%" SIZE_T_FORMAT "u: %s %" SIZE_T_FORMAT "u\n",
  117|    919|	    file, line, __func__, n));
  118|    919|	return realloc(p, n);
  119|    919|}
cdf.c:cdf_get_property_info_pos:
  926|  7.01k|{
  927|  7.01k|	size_t tail = (i << 1) + 1;
  928|  7.01k|	size_t ofs;
  929|       |
  930|  7.01k|	if (p >= e) {
  ------------------
  |  Branch (930:6): [True: 0, False: 7.01k]
  ------------------
  931|      0|		DPRINTF(("Past end %p < %p\n", e, p));
  932|      0|		return NULL;
  933|      0|	}
  934|       |
  935|  7.01k|	if (cdf_check_stream_offset(sst, h, p, (tail + 1) * sizeof(uint32_t),
  ------------------
  |  Branch (935:6): [True: 12, False: 7.00k]
  ------------------
  936|  7.01k|	    __LINE__) == -1)
  937|     12|		return NULL;
  938|       |
  939|  7.00k|	ofs = CDF_GETUINT32(p, tail);
  ------------------
  |  |   92|  7.00k|#define CDF_GETUINT32(x, y)	cdf_getuint32(x, y)
  ------------------
  940|  7.00k|	if (ofs < 2 * sizeof(uint32_t)) {
  ------------------
  |  Branch (940:6): [True: 26, False: 6.98k]
  ------------------
  941|     26|		DPRINTF(("Offset too small %zu\n", ofs));
  942|     26|		return NULL;
  943|     26|	}
  944|       |
  945|  6.98k|	ofs -= 2 * sizeof(uint32_t);
  946|  6.98k|	if (ofs > CAST(size_t, e - p)) {
  ------------------
  |  |  460|  6.98k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (946:6): [True: 239, False: 6.74k]
  ------------------
  947|    239|		DPRINTF(("Offset too big %zu %td\n", ofs, e - p));
  948|    239|		return NULL;
  949|    239|	}
  950|       |
  951|  6.74k|	return CAST(const uint8_t *, cdf_offset(CAST(const void *, p), ofs));
  ------------------
  |  |  460|  6.74k|#define CAST(T, b)	((T)(b))
  ------------------
  952|  6.98k|}
cdf.c:cdf_getuint32:
  199|   188k|{
  200|   188k|	uint32_t rv;
  201|   188k|	(void)memcpy(&rv, p + offs * sizeof(uint32_t), sizeof(rv));
  202|   188k|	return CDF_TOLE4(rv);
  ------------------
  |  |   84|   188k|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|   376k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 188k]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  203|   188k|}
cdf.c:cdf_copy_info:
  983|  2.41k|{
  984|  2.41k|	if (inp->pi_type & CDF_VECTOR)
  ------------------
  |  |  238|  2.41k|#define CDF_VECTOR		0x00001000
  ------------------
  |  Branch (984:6): [True: 392, False: 2.01k]
  ------------------
  985|    392|		return 0;
  986|       |
  987|  2.01k|	if (CAST(size_t, CAST(const char *, e) - CAST(const char *, p)) < len)
  ------------------
  |  |  460|  2.01k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (987:6): [True: 228, False: 1.79k]
  ------------------
  988|    228|		return 0;
  989|       |
  990|  1.79k|	(void)memcpy(&inp->pi_val, p, len);
  991|       |
  992|  1.79k|	switch (len) {
  993|    277|	case 2:
  ------------------
  |  Branch (993:2): [True: 277, False: 1.51k]
  ------------------
  994|    277|		inp->pi_u16 = CDF_TOLE2(inp->pi_u16);
  ------------------
  |  |  187|    277|#define pi_u16	pi_val._pi_u16
  ------------------
              		inp->pi_u16 = CDF_TOLE2(inp->pi_u16);
  ------------------
  |  |   86|    277|    (CAST(uint16_t, NEED_SWAP ? _cdf_tole2(x) : CAST(uint16_t, x)))
  |  |  ------------------
  |  |  |  |  460|    554|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 277]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  995|    277|		break;
  996|    692|	case 4:
  ------------------
  |  Branch (996:2): [True: 692, False: 1.09k]
  ------------------
  997|    692|		inp->pi_u32 = CDF_TOLE4(inp->pi_u32);
  ------------------
  |  |  185|    692|#define pi_u32	pi_val._pi_u32
  ------------------
              		inp->pi_u32 = CDF_TOLE4(inp->pi_u32);
  ------------------
  |  |   84|    692|    (CAST(uint32_t, NEED_SWAP ? _cdf_tole4(x) : CAST(uint32_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.38k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 692]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  998|    692|		break;
  999|    821|	case 8:
  ------------------
  |  Branch (999:2): [True: 821, False: 969]
  ------------------
 1000|    821|		inp->pi_u64 = CDF_TOLE8(inp->pi_u64);
  ------------------
  |  |  183|    821|#define pi_u64	pi_val._pi_u64
  ------------------
              		inp->pi_u64 = CDF_TOLE8(inp->pi_u64);
  ------------------
  |  |   82|    821|    (CAST(uint64_t, NEED_SWAP ? _cdf_tole8(x) : CAST(uint64_t, x)))
  |  |  ------------------
  |  |  |  |  460|  1.64k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 0, False: 821]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
 1001|    821|		break;
 1002|      0|	default:
  ------------------
  |  Branch (1002:2): [True: 0, False: 1.79k]
  ------------------
 1003|      0|		abort();
 1004|  1.79k|	}
 1005|  1.79k|	return 1;
 1006|  1.79k|}
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.15k|{
  101|  2.15k|	struct tm tm;
  102|  2.15k|#ifdef HAVE_STRUCT_TM_TM_ZONE
  103|  2.15k|	file_private char UTC[] = "UTC";
  ------------------
  |  |  116|  2.15k|#define file_private static
  ------------------
  104|  2.15k|#endif
  105|  2.15k|	int rdays;
  106|       |
  107|       |	/* Unit is 100's of nanoseconds */
  108|  2.15k|	ts->tv_nsec = (t % CDF_TIME_PREC) * 100;
  ------------------
  |  |   91|  2.15k|#define CDF_TIME_PREC	10000000
  ------------------
  109|       |
  110|  2.15k|	t /= CDF_TIME_PREC;
  ------------------
  |  |   91|  2.15k|#define CDF_TIME_PREC	10000000
  ------------------
  111|  2.15k|	tm.tm_sec = CAST(int, t % 60);
  ------------------
  |  |  460|  2.15k|#define CAST(T, b)	((T)(b))
  ------------------
  112|  2.15k|	t /= 60;
  113|       |
  114|  2.15k|	tm.tm_min = CAST(int, t % 60);
  ------------------
  |  |  460|  2.15k|#define CAST(T, b)	((T)(b))
  ------------------
  115|  2.15k|	t /= 60;
  116|       |
  117|  2.15k|	tm.tm_hour = CAST(int, t % 24);
  ------------------
  |  |  460|  2.15k|#define CAST(T, b)	((T)(b))
  ------------------
  118|  2.15k|	t /= 24;
  119|       |
  120|       |	/* XXX: Approx */
  121|  2.15k|	tm.tm_year = CAST(int, CDF_BASE_YEAR + (t / 365));
  ------------------
  |  |  460|  2.15k|#define CAST(T, b)	((T)(b))
  ------------------
  122|       |
  123|  2.15k|	if (tm.tm_year > 9999)
  ------------------
  |  Branch (123:6): [True: 402, False: 1.75k]
  ------------------
  124|    402|		goto out;
  125|       |
  126|  1.75k|	rdays = cdf_getdays(tm.tm_year);
  127|  1.75k|	t -= rdays - 1;
  128|  1.75k|	tm.tm_mday = cdf_getday(tm.tm_year, CAST(int, t));
  ------------------
  |  |  460|  1.75k|#define CAST(T, b)	((T)(b))
  ------------------
  129|  1.75k|	tm.tm_mon = cdf_getmonth(tm.tm_year, CAST(int, t));
  ------------------
  |  |  460|  1.75k|#define CAST(T, b)	((T)(b))
  ------------------
  130|  1.75k|	tm.tm_wday = 0;
  131|  1.75k|	tm.tm_yday = 0;
  132|  1.75k|	tm.tm_isdst = 0;
  133|  1.75k|#ifdef HAVE_STRUCT_TM_TM_GMTOFF
  134|  1.75k|	tm.tm_gmtoff = 0;
  135|  1.75k|#endif
  136|  1.75k|#ifdef HAVE_STRUCT_TM_TM_ZONE
  137|  1.75k|	tm.tm_zone = UTC;
  138|  1.75k|#endif
  139|  1.75k|	tm.tm_year -= 1900;
  140|  1.75k|	ts->tv_sec = mktime(&tm);
  141|  1.75k|	if (ts->tv_sec == -1)
  ------------------
  |  Branch (141:6): [True: 41, False: 1.70k]
  ------------------
  142|     41|		goto out;
  143|  1.70k|	return 0;
  144|    443|out:
  145|    443|	errno = EINVAL;
  146|    443|	return -1;
  147|  1.75k|}
cdf_ctime:
  174|    208|{
  175|    208|	char *ptr = *sec > MAX_CTIME ? NULL : ctime_r(sec, buf);
  ------------------
  |  |  181|    208|    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
  |  |  ------------------
  |  |  |  |  460|    416|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 208, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (175:14): [True: 25, False: 183]
  ------------------
  176|    208|	if (ptr != NULL)
  ------------------
  |  Branch (176:6): [True: 183, False: 25]
  ------------------
  177|    183|		return buf;
  178|       |#ifdef WIN32
  179|       |	(void)snprintf(buf, 26, "*Bad* 0x%16.16I64x\n",
  180|       |	    CAST(long long, *sec));
  181|       |#else
  182|     25|	(void)snprintf(buf, 26, "*Bad* %#16.16" INT64_T_FORMAT "x\n",
  183|     25|	    CAST(long long, *sec));
  ------------------
  |  |  460|     25|#define CAST(T, b)	((T)(b))
  ------------------
  184|     25|#endif
  185|     25|	return buf;
  186|    208|}
cdf_time.c:cdf_getdays:
   53|  1.75k|{
   54|  1.75k|	int days = 0;
   55|  1.75k|	int y;
   56|       |
   57|  1.29M|	for (y = CDF_BASE_YEAR; y < year; y++)
  ------------------
  |  |   90|  1.75k|#define CDF_BASE_YEAR	1601
  ------------------
  |  Branch (57:26): [True: 1.28M, False: 1.75k]
  ------------------
   58|  1.28M|		days += isleap(y) + 365;
  ------------------
  |  |   41|  1.28M|#define isleap(y) ((((y) % 4) == 0) && \
  |  |  ------------------
  |  |  |  Branch (41:20): [True: 321k, False: 967k]
  |  |  ------------------
  |  |   42|  1.28M|    ((((y) % 100) != 0) || (((y) % 400) == 0)))
  |  |  ------------------
  |  |  |  Branch (42:6): [True: 309k, False: 12.3k]
  |  |  |  Branch (42:28): [True: 2.73k, False: 9.62k]
  |  |  ------------------
  ------------------
   59|       |
   60|  1.75k|	return days;
   61|  1.75k|}
cdf_time.c:cdf_getday:
   68|  1.75k|{
   69|  1.75k|	size_t m;
   70|       |
   71|  7.47k|	for (m = 0; m < __arraycount(mdays); m++) {
  ------------------
  |  |  138|  7.47k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (71:14): [True: 7.37k, False: 101]
  ------------------
   72|  7.37k|		int sub = mdays[m] + (m == 1 && isleap(year));
  ------------------
  |  |   41|    848|#define isleap(y) ((((y) % 4) == 0) && \
  |  |  ------------------
  |  |  |  Branch (41:20): [True: 403, False: 445]
  |  |  ------------------
  |  |   42|    848|    ((((y) % 100) != 0) || (((y) % 400) == 0)))
  |  |  ------------------
  |  |  |  Branch (42:6): [True: 191, False: 212]
  |  |  |  Branch (42:28): [True: 94, False: 118]
  |  |  ------------------
  ------------------
  |  Branch (72:25): [True: 848, False: 6.52k]
  ------------------
   73|  7.37k|		if (days < sub)
  ------------------
  |  Branch (73:7): [True: 1.64k, False: 5.72k]
  ------------------
   74|  1.64k|			return days;
   75|  5.72k|		days -= sub;
   76|  5.72k|	}
   77|    101|	return days;
   78|  1.75k|}
cdf_time.c:cdf_getmonth:
   85|  1.75k|{
   86|  1.75k|	size_t m;
   87|       |
   88|  7.33k|	for (m = 0; m < __arraycount(mdays); m++) {
  ------------------
  |  |  138|  7.33k|#define __arraycount(a) (sizeof(a) / sizeof(a[0]))
  ------------------
  |  Branch (88:14): [True: 7.33k, False: 0]
  ------------------
   89|  7.33k|		days -= mdays[m];
   90|  7.33k|		if (m == 1 && isleap(year))
  ------------------
  |  |   41|    848|#define isleap(y) ((((y) % 4) == 0) && \
  |  |  ------------------
  |  |  |  Branch (41:20): [True: 403, False: 445]
  |  |  ------------------
  |  |   42|    848|    ((((y) % 100) != 0) || (((y) % 400) == 0)))
  |  |  ------------------
  |  |  |  Branch (42:6): [True: 191, False: 212]
  |  |  |  Branch (42:28): [True: 94, False: 118]
  |  |  ------------------
  ------------------
  |  Branch (90:7): [True: 848, False: 6.48k]
  ------------------
   91|    285|			days--;
   92|  7.33k|		if (days <= 0)
  ------------------
  |  Branch (92:7): [True: 1.75k, False: 5.58k]
  ------------------
   93|  1.75k|			return CAST(int, m);
  ------------------
  |  |  460|  1.75k|#define CAST(T, b)	((T)(b))
  ------------------
   94|  7.33k|	}
   95|      0|	return CAST(int, m);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
   96|  1.75k|}

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

der_offs:
  265|  34.8k|{
  266|  34.8k|	const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
  ------------------
  |  |  461|  34.8k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  267|  34.8k|	size_t offs = 0, len = ms->search.s_len ? ms->search.s_len : nbytes;
  ------------------
  |  Branch (267:25): [True: 34.8k, False: 0]
  ------------------
  268|       |
  269|  34.8k|	if (gettag(b, &offs, len) == DER_BAD) {
  ------------------
  |  |   62|  34.8k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  34.8k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (269:6): [True: 0, False: 34.8k]
  ------------------
  270|      0|		DPRINTF(("%s: bad tag 1\n", __func__));
  271|      0|		return -1;
  272|      0|	}
  273|  34.8k|	DPRINTF(("%s1: %u %" SIZE_T_FORMAT "u %d\n", __func__, ms->offset,
  274|  34.8k|	    offs, m->offset));
  275|       |
  276|  34.8k|	uint32_t tlen = getlength(b, &offs, len);
  277|  34.8k|	if (tlen == DER_BAD) {
  ------------------
  |  |   62|  34.8k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  34.8k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (277:6): [True: 0, False: 34.8k]
  ------------------
  278|      0|		DPRINTF(("%s: bad tag 2\n", __func__));
  279|      0|		return -1;
  280|      0|	}
  281|  34.8k|	DPRINTF(("%s2: %u %" SIZE_T_FORMAT "u %u\n", __func__, ms->offset,
  282|  34.8k|	    offs, tlen));
  283|       |
  284|  34.8k|	offs += ms->offset + m->offset;
  285|  34.8k|	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|  34.8k|	if (m->cont_level != 0) {
  ------------------
  |  Branch (292:6): [True: 4.15k, False: 30.6k]
  ------------------
  293|  4.15k|		if (offs + tlen > nbytes)
  ------------------
  |  Branch (293:7): [True: 0, False: 4.15k]
  ------------------
  294|      0|			return -1;
  295|  4.15k|		ms->c.li[m->cont_level - 1].off = CAST(int, offs + tlen);
  ------------------
  |  |  460|  4.15k|#define CAST(T, b)	((T)(b))
  ------------------
  296|  4.15k|		DPRINTF(("cont_level[%u] = %d\n", m->cont_level - 1,
  297|  4.15k|		    ms->c.li[m->cont_level - 1].off));
  298|  4.15k|	}
  299|  34.8k|	return CAST(int32_t, offs);
  ------------------
  |  |  460|  34.8k|#define CAST(T, b)	((T)(b))
  ------------------
  300|  34.8k|}
der_cmp:
  304|   567k|{
  305|   567k|	const uint8_t *b = RCAST(const uint8_t *, ms->search.s);
  ------------------
  |  |  461|   567k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  306|   567k|	const char *s = m->value.s;
  307|   567k|	size_t offs = 0, len = ms->search.s_len;
  308|   567k|	uint32_t tag, tlen;
  309|   567k|	char buf[128];
  310|       |
  311|   567k|	DPRINTF(("%s: compare %zu bytes\n", __func__, len));
  312|       |
  313|   567k|	tag = gettag(b, &offs, len);
  314|   567k|	if (tag == DER_BAD) {
  ------------------
  |  |   62|   567k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|   567k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (314:6): [True: 4.94k, False: 562k]
  ------------------
  315|  4.94k|		DPRINTF(("%s: bad tag 1\n", __func__));
  316|  4.94k|		return -1;
  317|  4.94k|	}
  318|       |
  319|   562k|	DPRINTF(("%s1: %d %" SIZE_T_FORMAT "u %d\n", __func__, ms->offset,
  320|   562k|	    offs, m->offset));
  321|       |
  322|   562k|	tlen = getlength(b, &offs, len);
  323|   562k|	if (tlen == DER_BAD) {
  ------------------
  |  |   62|   562k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|   562k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (323:6): [True: 189k, False: 373k]
  ------------------
  324|   189k|		DPRINTF(("%s: bad tag 2\n", __func__));
  325|   189k|		return -1;
  326|   189k|	}
  327|       |
  328|   373k|	der_tag(buf, sizeof(buf), tag);
  329|   373k|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   373k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (329:6): [True: 0, False: 373k]
  ------------------
  330|      0|		fprintf(stderr, "%s: tag %p got=%s exp=%s\n", __func__, b,
  331|      0|		    buf, s);
  332|   373k|	size_t slen = strlen(buf);
  333|       |
  334|   373k|	if (strncmp(buf, s, slen) != 0) {
  ------------------
  |  Branch (334:6): [True: 333k, False: 40.1k]
  ------------------
  335|   333k|		DPRINTF(("%s: no string match %s != %s\n", __func__, buf, s));
  336|   333k|		return 0;
  337|   333k|	}
  338|       |
  339|  40.1k|	s += slen;
  340|       |
  341|  41.9k|again:
  342|  41.9k|	switch (*s) {
  343|  33.8k|	case '\0':
  ------------------
  |  Branch (343:2): [True: 33.8k, False: 8.03k]
  ------------------
  344|  33.8k|		DPRINTF(("%s: EOF match\n", __func__));
  345|  33.8k|		return 1;
  346|  1.93k|	case '=':
  ------------------
  |  Branch (346:2): [True: 1.93k, False: 39.9k]
  ------------------
  347|  1.93k|		s++;
  348|  1.93k|		goto val;
  349|  6.10k|	default:
  ------------------
  |  Branch (349:2): [True: 6.10k, False: 35.8k]
  ------------------
  350|  6.10k|		if (!isdigit(CAST(unsigned char, *s))) {
  ------------------
  |  Branch (350:7): [True: 0, False: 6.10k]
  ------------------
  351|      0|			DPRINTF(("%s: no digit %c\n", __func__, *s));
  352|      0|			return 0;
  353|      0|		}
  354|       |
  355|  6.10k|		slen = 0;
  356|  6.10k|		do
  357|  9.62k|			slen = slen * 10 + *s - '0';
  358|  6.10k|		while (isdigit(CAST(unsigned char, *++s)));
  ------------------
  |  Branch (358:10): [True: 3.52k, False: 6.10k]
  ------------------
  359|  6.10k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  6.10k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (359:7): [True: 0, False: 6.10k]
  ------------------
  360|      0|			fprintf(stderr, "%s: len %" SIZE_T_FORMAT "u %u\n",
  361|      0|			    __func__, slen, tlen);
  362|  6.10k|		if (tlen != slen) {
  ------------------
  |  Branch (362:7): [True: 4.35k, False: 1.74k]
  ------------------
  363|  4.35k|			DPRINTF(("%s: len %u != %zu\n", __func__, tlen, slen));
  364|  4.35k|			return 0;
  365|  4.35k|		}
  366|  1.74k|		goto again;
  367|  41.9k|	}
  368|  1.93k|val:
  369|  1.93k|	DPRINTF(("%s: before data %" SIZE_T_FORMAT "u %u\n", __func__, offs,
  370|  1.93k|	    tlen));
  371|  1.93k|	der_data(buf, sizeof(buf), tag, b + offs, tlen);
  372|  1.93k|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  1.93k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (372:6): [True: 0, False: 1.93k]
  ------------------
  373|      0|		fprintf(stderr, "%s: data %s %s\n", __func__, buf, s);
  374|  1.93k|	if (strcmp(buf, s) != 0 && strcmp("x", s) != 0) {
  ------------------
  |  Branch (374:6): [True: 1.29k, False: 636]
  |  Branch (374:29): [True: 1.00k, False: 289]
  ------------------
  375|  1.00k|		DPRINTF(("%s: no string match %s != %s\n", __func__, buf, s));
  376|  1.00k|		return 0;
  377|  1.00k|	}
  378|    925|	strlcpy(ms->ms_value.s, buf, sizeof(ms->ms_value.s));
  379|    925|	DPRINTF(("%s: complete match\n", __func__));
  380|    925|	return 1;
  381|  1.93k|}
der.c:gettag:
  150|   602k|{
  151|   602k|	uint32_t tag;
  152|       |
  153|   602k|	if (c == NULL || *p >= l)
  ------------------
  |  Branch (153:6): [True: 0, False: 602k]
  |  Branch (153:19): [True: 1.49k, False: 600k]
  ------------------
  154|  1.49k|		return DER_BAD;
  ------------------
  |  |   62|  1.49k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  1.49k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  155|       |
  156|   600k|	tag = c[(*p)++] & 0x1f;
  157|       |
  158|   600k|	if (tag != 0x1f)
  ------------------
  |  Branch (158:6): [True: 524k, False: 76.6k]
  ------------------
  159|   524k|		return tag;
  160|       |
  161|  76.6k|	if (*p >= l)
  ------------------
  |  Branch (161:6): [True: 382, False: 76.2k]
  ------------------
  162|    382|		return DER_BAD;
  ------------------
  |  |   62|    382|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|    382|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  163|       |
  164|  1.72G|	while (c[*p] >= 0x80) {
  ------------------
  |  Branch (164:9): [True: 1.72G, False: 73.5k]
  ------------------
  165|  1.72G|		tag = tag * 128 + c[(*p)++] - 0x80;
  166|  1.72G|		if (*p >= l)
  ------------------
  |  Branch (166:7): [True: 2.67k, False: 1.72G]
  ------------------
  167|  2.67k|			return DER_BAD;
  ------------------
  |  |   62|  2.67k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  2.67k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  168|  1.72G|	}
  169|  73.5k|	return tag;
  170|  76.2k|}
der.c:getlength:
  183|   597k|{
  184|   597k|	uint8_t digits, i;
  185|   597k|	size_t len;
  186|   597k|	int is_onebyte_result;
  187|       |
  188|   597k|	if (*p >= l) {
  ------------------
  |  Branch (188:6): [True: 3.15k, False: 594k]
  ------------------
  189|  3.15k|		DPRINTF(("%s:[1] %zu >= %zu\n", __func__, *p, l));
  190|  3.15k|		return DER_BAD;
  ------------------
  |  |   62|  3.15k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  3.15k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  191|  3.15k|	}
  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|   594k|	is_onebyte_result = (c[*p] & 0x80) == 0;
  199|   594k|	digits = c[(*p)++] & 0x7f;
  200|   594k|	if (*p + digits >= l) {
  ------------------
  |  Branch (200:6): [True: 132k, False: 461k]
  ------------------
  201|   132k|		DPRINTF(("%s:[2] %zu + %u >= %zu\n", __func__, *p, digits, l));
  202|   132k|		return DER_BAD;
  ------------------
  |  |   62|   132k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|   132k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  203|   132k|	}
  204|       |
  205|   461k|	if (is_onebyte_result)
  ------------------
  |  Branch (205:6): [True: 353k, False: 107k]
  ------------------
  206|   353k|		return digits;
  207|       |
  208|       |	/*
  209|       |	 * Decode len. We've already verified that we're allowed to read
  210|       |	 * `digits` bytes.
  211|       |	 */
  212|   107k|	len = 0;
  213|  9.37M|	for (i = 0; i < digits; i++)
  ------------------
  |  Branch (213:14): [True: 9.27M, False: 107k]
  ------------------
  214|  9.27M|		len = (len << 8) | c[(*p)++];
  215|       |
  216|   107k|	if (len > UINT32_MAX - *p || *p + len > l) {
  ------------------
  |  Branch (216:6): [True: 48.7k, False: 58.8k]
  |  Branch (216:31): [True: 4.28k, False: 54.6k]
  ------------------
  217|  53.0k|		DPRINTF(("%s:[3] bad len %zu + %zu >= %zu\n",
  218|  53.0k|		    __func__, *p, len, l));
  219|  53.0k|		return DER_BAD;
  ------------------
  |  |   62|  53.0k|#define DER_BAD	CAST(uint32_t, -1)
  |  |  ------------------
  |  |  |  |  460|  53.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  220|  53.0k|	}
  221|  54.6k|	return CAST(uint32_t, len);
  ------------------
  |  |  460|  54.6k|#define CAST(T, b)	((T)(b))
  ------------------
  222|   107k|}
der.c:der_tag:
  226|   373k|{
  227|   373k|	if (tag < DER_TAG_LAST)
  ------------------
  |  |  115|   373k|#define	DER_TAG_LAST			0x25
  ------------------
  |  Branch (227:6): [True: 326k, False: 46.6k]
  ------------------
  228|   326k|		strlcpy(buf, der__tag[tag], len);
  229|  46.6k|	else
  230|  46.6k|		snprintf(buf, len, "%#x", tag);
  231|   373k|	return buf;
  232|   373k|}
der.c:der_data:
  237|  1.93k|{
  238|  1.93k|	uint32_t i;
  239|  1.93k|	const uint8_t *d = CAST(const uint8_t *, q);
  ------------------
  |  |  460|  1.93k|#define CAST(T, b)	((T)(b))
  ------------------
  240|  1.93k|	switch (tag) {
  241|    103|	case DER_TAG_PRINTABLE_STRING:
  ------------------
  |  |   97|    103|#define	DER_TAG_PRINTABLE_STRING	0x13
  ------------------
  |  Branch (241:2): [True: 103, False: 1.82k]
  ------------------
  242|    185|	case DER_TAG_UTF8_STRING:
  ------------------
  |  |   90|    185|#define	DER_TAG_UTF8_STRING		0x0c
  ------------------
  |  Branch (242:2): [True: 82, False: 1.84k]
  ------------------
  243|    185|	case DER_TAG_IA5_STRING:
  ------------------
  |  |  100|    185|#define	DER_TAG_IA5_STRING		0x16
  ------------------
  |  Branch (243:2): [True: 0, False: 1.93k]
  ------------------
  244|    185|		return snprintf(buf, blen, "%.*s", len, RCAST(const char *, q));
  ------------------
  |  |  461|    185|#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.93k]
  ------------------
  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.74k|	default:
  ------------------
  |  Branch (251:2): [True: 1.74k, False: 185]
  ------------------
  252|  1.74k|		break;
  253|  1.93k|	}
  254|       |
  255|  7.41k|	for (i = 0; i < len; i++) {
  ------------------
  |  Branch (255:14): [True: 5.67k, False: 1.74k]
  ------------------
  256|  5.67k|		uint32_t z = i << 1;
  257|  5.67k|		if (z < blen - 2)
  ------------------
  |  Branch (257:7): [True: 5.43k, False: 234]
  ------------------
  258|  5.43k|			snprintf(buf + z, blen - z, "%.2x", d[i]);
  259|  5.67k|	}
  260|  1.74k|	return len * 2;
  261|  1.93k|}

file_encoding:
   78|  28.3k|{
   79|  28.3k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  28.3k|#define CAST(T, b)	((T)(b))
  ------------------
   80|  28.3k|	size_t nbytes = b->flen;
   81|  28.3k|	size_t mlen;
   82|  28.3k|	int rv = 1, ucs_type;
   83|  28.3k|	file_unichar_t *udefbuf;
   84|  28.3k|	size_t udeflen;
   85|       |
   86|  28.3k|	if (buf == NULL)
  ------------------
  |  Branch (86:6): [True: 0, False: 28.3k]
  ------------------
   87|      0|		return 0;
   88|  28.3k|	if (ubuf == NULL)
  ------------------
  |  Branch (88:6): [True: 16.0k, False: 12.2k]
  ------------------
   89|  16.0k|		ubuf = &udefbuf;
   90|  28.3k|	if (ulen == NULL)
  ------------------
  |  Branch (90:6): [True: 16.0k, False: 12.2k]
  ------------------
   91|  16.0k|		ulen = &udeflen;
   92|       |
   93|  28.3k|	*type = "text";
   94|  28.3k|	*ulen = 0;
   95|  28.3k|	*code = "unknown";
   96|  28.3k|	*code_mime = "binary";
   97|       |
   98|  28.3k|	if (nbytes > ms->encoding_max)
  ------------------
  |  Branch (98:6): [True: 2.37k, False: 25.9k]
  ------------------
   99|  2.37k|		nbytes = ms->encoding_max;
  100|       |
  101|  28.3k|	mlen = (nbytes + 1) * sizeof((*ubuf)[0]);
  102|  28.3k|	*ubuf = CAST(file_unichar_t *, calloc(CAST(size_t, 1), mlen));
  ------------------
  |  |  460|  28.3k|#define CAST(T, b)	((T)(b))
  ------------------
  103|  28.3k|	if (*ubuf == NULL) {
  ------------------
  |  Branch (103:6): [True: 0, False: 28.3k]
  ------------------
  104|      0|		file_oomem(ms, mlen);
  105|      0|		goto done;
  106|      0|	}
  107|  28.3k|	if (looks_ascii(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (107:6): [True: 2.02k, False: 26.3k]
  ------------------
  108|  2.02k|		if (looks_utf7(buf, nbytes, *ubuf, ulen) > 0) {
  ------------------
  |  Branch (108:7): [True: 12, False: 2.01k]
  ------------------
  109|     12|			DPRINTF(("utf-7 %" SIZE_T_FORMAT "u\n", *ulen));
  110|     12|			*code = "Unicode text, UTF-7";
  111|     12|			*code_mime = "utf-7";
  112|  2.01k|		} else {
  113|  2.01k|			DPRINTF(("ascii %" SIZE_T_FORMAT "u\n", *ulen));
  114|  2.01k|			*code = "ASCII";
  115|  2.01k|			*code_mime = "us-ascii";
  116|  2.01k|		}
  117|  26.3k|	} else if (looks_utf8_with_BOM(buf, nbytes, *ubuf, ulen) > 0) {
  ------------------
  |  Branch (117:13): [True: 9, False: 26.3k]
  ------------------
  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|  26.3k|	} else if (file_looks_utf8(buf, nbytes, *ubuf, ulen) > 1) {
  ------------------
  |  Branch (121:13): [True: 180, False: 26.1k]
  ------------------
  122|    180|		DPRINTF(("utf8 %" SIZE_T_FORMAT "u\n", *ulen));
  123|    180|		*code = "Unicode text, UTF-8";
  124|    180|		*code_mime = "utf-8";
  125|  26.1k|	} else if ((ucs_type = looks_ucs32(buf, nbytes, *ubuf, ulen)) != 0) {
  ------------------
  |  Branch (125:13): [True: 374, False: 25.7k]
  ------------------
  126|    374|		if (ucs_type == 1) {
  ------------------
  |  Branch (126:7): [True: 158, False: 216]
  ------------------
  127|    158|			*code = "Unicode text, UTF-32, little-endian";
  128|    158|			*code_mime = "utf-32le";
  129|    216|		} else {
  130|    216|			*code = "Unicode text, UTF-32, big-endian";
  131|    216|			*code_mime = "utf-32be";
  132|    216|		}
  133|    374|		DPRINTF(("ucs32 %" SIZE_T_FORMAT "u\n", *ulen));
  134|  25.7k|	} else if ((ucs_type = looks_ucs16(buf, nbytes, *ubuf, ulen)) != 0) {
  ------------------
  |  Branch (134:13): [True: 410, False: 25.3k]
  ------------------
  135|    410|		if (ucs_type == 1) {
  ------------------
  |  Branch (135:7): [True: 239, False: 171]
  ------------------
  136|    239|			*code = "Unicode text, UTF-16, little-endian";
  137|    239|			*code_mime = "utf-16le";
  138|    239|		} else {
  139|    171|			*code = "Unicode text, UTF-16, big-endian";
  140|    171|			*code_mime = "utf-16be";
  141|    171|		}
  142|    410|		DPRINTF(("ucs16 %" SIZE_T_FORMAT "u\n", *ulen));
  143|  25.3k|	} else if (looks_latin1(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (143:13): [True: 1.10k, False: 24.2k]
  ------------------
  144|  1.10k|		DPRINTF(("latin1 %" SIZE_T_FORMAT "u\n", *ulen));
  145|  1.10k|		*code = "ISO-8859";
  146|  1.10k|		*code_mime = "iso-8859-1";
  147|  24.2k|	} else if (looks_extended(buf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (147:13): [True: 534, False: 23.7k]
  ------------------
  148|    534|		DPRINTF(("extended %" SIZE_T_FORMAT "u\n", *ulen));
  149|    534|		*code = "Non-ISO extended-ASCII";
  150|    534|		*code_mime = "unknown-8bit";
  151|  23.7k|	} else {
  152|  23.7k|		unsigned char *nbuf;
  153|       |
  154|  23.7k|		mlen = (nbytes + 1) * sizeof(nbuf[0]);
  155|  23.7k|		if ((nbuf = CAST(unsigned char *, malloc(mlen))) == NULL) {
  ------------------
  |  |  460|  23.7k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (155:7): [True: 0, False: 23.7k]
  ------------------
  156|      0|			file_oomem(ms, mlen);
  157|      0|			goto done;
  158|      0|		}
  159|  23.7k|		from_ebcdic(buf, nbytes, nbuf);
  160|       |
  161|  23.7k|		if (looks_ascii(nbuf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (161:7): [True: 100, False: 23.6k]
  ------------------
  162|    100|			DPRINTF(("ebcdic %" SIZE_T_FORMAT "u\n", *ulen));
  163|    100|			*code = "EBCDIC";
  164|    100|			*code_mime = "ebcdic";
  165|  23.6k|		} else if (looks_latin1(nbuf, nbytes, *ubuf, ulen)) {
  ------------------
  |  Branch (165:14): [True: 95, False: 23.5k]
  ------------------
  166|     95|			DPRINTF(("ebcdic/international %" SIZE_T_FORMAT "u\n",
  167|     95|			    *ulen));
  168|     95|			*code = "International EBCDIC";
  169|     95|			*code_mime = "ebcdic";
  170|  23.5k|		} else { /* Doesn't look like text at all */
  171|  23.5k|			DPRINTF(("binary\n"));
  172|  23.5k|			rv = 0;
  173|  23.5k|			*type = "binary";
  174|  23.5k|		}
  175|  23.7k|		free(nbuf);
  176|  23.7k|	}
  177|       |
  178|  28.3k| done:
  179|  28.3k|	if (ubuf == &udefbuf)
  ------------------
  |  Branch (179:6): [True: 16.0k, False: 12.2k]
  ------------------
  180|  16.0k|		free(udefbuf);
  181|       |
  182|  28.3k|	return rv;
  183|  28.3k|}
file_looks_utf8:
  358|  26.3k|{
  359|  26.3k|	size_t i;
  360|  26.3k|	int n;
  361|  26.3k|	file_unichar_t c;
  362|  26.3k|	int gotone = 0, ctrl = 0;
  363|       |
  364|  26.3k|	if (ubuf)
  ------------------
  |  Branch (364:6): [True: 26.3k, False: 0]
  ------------------
  365|  26.3k|		*ulen = 0;
  366|       |
  367|  37.5M|	for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (367:14): [True: 37.5M, False: 2.22k]
  ------------------
  368|  37.5M|		if ((buf[i] & 0x80) == 0) {	   /* 0xxxxxxx is plain ASCII */
  ------------------
  |  Branch (368:7): [True: 37.3M, False: 168k]
  ------------------
  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|  37.3M|			if (text_chars[buf[i]] != T)
  ------------------
  |  |  238|  37.3M|#define T 1   /* character appears in plain ASCII text */
  ------------------
  |  Branch (374:8): [True: 31.0M, False: 6.29M]
  ------------------
  375|  31.0M|				ctrl = 1;
  376|       |
  377|  37.3M|			if (ubuf)
  ------------------
  |  Branch (377:8): [True: 37.3M, False: 0]
  ------------------
  378|  37.3M|				ubuf[(*ulen)++] = buf[i];
  379|  37.3M|		} else if ((buf[i] & 0x40) == 0) { /* 10xxxxxx never 1st byte */
  ------------------
  |  Branch (379:14): [True: 14.8k, False: 153k]
  ------------------
  380|  14.8k|			return -1;
  381|   153k|		} else {			   /* 11xxxxxx begins UTF-8 */
  382|   153k|			int following;
  383|   153k|			uint8_t x = first[buf[i]];
  384|   153k|			const struct accept_range *ar =
  385|   153k|			    &accept_ranges[(unsigned int)x >> 4];
  386|   153k|			if (x == XX)
  ------------------
  |  |  306|   153k|#define	XX 0xF1 // invalid: size 1
  ------------------
  |  Branch (386:8): [True: 3.35k, False: 150k]
  ------------------
  387|  3.35k|				return -1;
  388|       |
  389|   150k|			if ((buf[i] & 0x20) == 0) {		/* 110xxxxx */
  ------------------
  |  Branch (389:8): [True: 125k, False: 25.1k]
  ------------------
  390|   125k|				c = buf[i] & 0x1f;
  391|   125k|				following = 1;
  392|   125k|			} else if ((buf[i] & 0x10) == 0) {	/* 1110xxxx */
  ------------------
  |  Branch (392:15): [True: 23.1k, False: 1.98k]
  ------------------
  393|  23.1k|				c = buf[i] & 0x0f;
  394|  23.1k|				following = 2;
  395|  23.1k|			} else if ((buf[i] & 0x08) == 0) {	/* 11110xxx */
  ------------------
  |  Branch (395:15): [True: 1.98k, False: 0]
  ------------------
  396|  1.98k|				c = buf[i] & 0x07;
  397|  1.98k|				following = 3;
  398|  1.98k|			} 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|   320k|			for (n = 0; n < following; n++) {
  ------------------
  |  Branch (407:16): [True: 176k, False: 144k]
  ------------------
  408|   176k|				i++;
  409|   176k|				if (i >= nbytes)
  ------------------
  |  Branch (409:9): [True: 240, False: 176k]
  ------------------
  410|    240|					goto done;
  411|       |
  412|   176k|				if (n == 0 &&
  ------------------
  |  Branch (412:9): [True: 150k, False: 26.0k]
  ------------------
  413|   150k|				     (buf[i] < ar->lo || buf[i] > ar->hi))
  ------------------
  |  Branch (413:11): [True: 956, False: 149k]
  |  Branch (413:30): [True: 4.66k, False: 144k]
  ------------------
  414|  5.61k|					return -1;
  415|       |
  416|   170k|				if ((buf[i] & 0x80) == 0 || (buf[i] & 0x40))
  ------------------
  |  Branch (416:9): [True: 93, False: 170k]
  |  Branch (416:33): [True: 37, False: 170k]
  ------------------
  417|    130|					return -1;
  418|       |
  419|   170k|				c = (c << 6) + (buf[i] & 0x3f);
  420|   170k|			}
  421|       |
  422|   144k|			if (ubuf)
  ------------------
  |  Branch (422:8): [True: 144k, False: 0]
  ------------------
  423|   144k|				ubuf[(*ulen)++] = c;
  424|   144k|			gotone = 1;
  425|   144k|		}
  426|  37.5M|	}
  427|  2.46k|done:
  428|  2.46k|	return ctrl ? 0 : (gotone ? 2 : 1);
  ------------------
  |  Branch (428:9): [True: 2.15k, False: 306]
  |  Branch (428:21): [True: 180, False: 126]
  ------------------
  429|  26.3k|}
encoding.c:looks_ascii:
  271|  52.0k|    size_t *ulen) \
  272|  52.0k|{ \
  273|  52.0k|	size_t i; \
  274|  52.0k|\
  275|  52.0k|	*ulen = 0; \
  276|  52.0k|\
  277|  22.5M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 22.5M, False: 2.12k]
  ------------------
  278|  22.5M|		int t = text_chars[buf[i]]; \
  279|  22.5M|\
  280|  22.5M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 49.9k, False: 22.4M]
  ------------------
  281|  22.5M|			return 0; \
  282|  22.5M|\
  283|  22.5M|		ubuf[(*ulen)++] = buf[i]; \
  284|  22.4M|	} \
  285|  52.0k|	return 1; \
  286|  52.0k|}
encoding.c:looks_latin1:
  271|  48.9k|    size_t *ulen) \
  272|  48.9k|{ \
  273|  48.9k|	size_t i; \
  274|  48.9k|\
  275|  48.9k|	*ulen = 0; \
  276|  48.9k|\
  277|  13.1M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 13.1M, False: 1.19k]
  ------------------
  278|  13.1M|		int t = text_chars[buf[i]]; \
  279|  13.1M|\
  280|  35.8M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 9.63M, False: 3.48M]
  |  Branch (280:7): [True: 47.7k, False: 9.58M]
  ------------------
  281|  13.1M|			return 0; \
  282|  13.1M|\
  283|  13.1M|		ubuf[(*ulen)++] = buf[i]; \
  284|  13.0M|	} \
  285|  48.9k|	return 1; \
  286|  48.9k|}
encoding.c:looks_extended:
  271|  24.2k|    size_t *ulen) \
  272|  24.2k|{ \
  273|  24.2k|	size_t i; \
  274|  24.2k|\
  275|  24.2k|	*ulen = 0; \
  276|  24.2k|\
  277|  2.55M|	for (i = 0; i < nbytes; i++) { \
  ------------------
  |  Branch (277:14): [True: 2.55M, False: 534]
  ------------------
  278|  2.55M|		int t = text_chars[buf[i]]; \
  279|  2.55M|\
  280|  9.32M|		if (COND) \
  ------------------
  |  Branch (280:7): [True: 1.15M, False: 1.40M]
  |  Branch (280:7): [True: 497k, False: 654k]
  |  Branch (280:7): [True: 23.7k, False: 473k]
  ------------------
  281|  2.55M|			return 0; \
  282|  2.55M|\
  283|  2.55M|		ubuf[(*ulen)++] = buf[i]; \
  284|  2.53M|	} \
  285|  24.2k|	return 1; \
  286|  24.2k|}
encoding.c:looks_utf8_with_BOM:
  439|  26.3k|{
  440|  26.3k|	if (nbytes > 3 && buf[0] == 0xef && buf[1] == 0xbb && buf[2] == 0xbf)
  ------------------
  |  Branch (440:6): [True: 24.9k, False: 1.41k]
  |  Branch (440:20): [True: 131, False: 24.7k]
  |  Branch (440:38): [True: 122, False: 9]
  |  Branch (440:56): [True: 83, False: 39]
  ------------------
  441|     83|		return file_looks_utf8(buf + 3, nbytes - 3, ubuf, ulen);
  442|  26.2k|	else
  443|  26.2k|		return -1;
  444|  26.3k|}
encoding.c:looks_utf7:
  449|  2.02k|{
  450|  2.02k|	if (nbytes > 4 && buf[0] == '+' && buf[1] == '/' && buf[2] == 'v')
  ------------------
  |  Branch (450:6): [True: 1.18k, False: 847]
  |  Branch (450:20): [True: 61, False: 1.11k]
  |  Branch (450:37): [True: 40, False: 21]
  |  Branch (450:54): [True: 15, False: 25]
  ------------------
  451|     15|		switch (buf[3]) {
  452|      3|		case '8':
  ------------------
  |  Branch (452:3): [True: 3, False: 12]
  ------------------
  453|      6|		case '9':
  ------------------
  |  Branch (453:3): [True: 3, False: 12]
  ------------------
  454|      9|		case '+':
  ------------------
  |  Branch (454:3): [True: 3, False: 12]
  ------------------
  455|     12|		case '/':
  ------------------
  |  Branch (455:3): [True: 3, False: 12]
  ------------------
  456|     12|			if (ubuf)
  ------------------
  |  Branch (456:8): [True: 12, False: 0]
  ------------------
  457|     12|				*ulen = 0;
  458|     12|			return 1;
  459|      3|		default:
  ------------------
  |  Branch (459:3): [True: 3, False: 12]
  ------------------
  460|      3|			return -1;
  461|     15|		}
  462|  2.01k|	else
  463|  2.01k|		return -1;
  464|  2.02k|}
encoding.c:looks_ucs16:
  475|  25.7k|{
  476|  25.7k|	int bigend;
  477|  25.7k|	uint32_t hi;
  478|  25.7k|	size_t i;
  479|       |
  480|  25.7k|	if (nbytes < 2)
  ------------------
  |  Branch (480:6): [True: 92, False: 25.6k]
  ------------------
  481|     92|		return 0;
  482|       |
  483|  25.6k|	if (bf[0] == 0xff && bf[1] == 0xfe)
  ------------------
  |  Branch (483:6): [True: 1.25k, False: 24.4k]
  |  Branch (483:23): [True: 328, False: 928]
  ------------------
  484|    328|		bigend = 0;
  485|  25.3k|	else if (bf[0] == 0xfe && bf[1] == 0xff)
  ------------------
  |  Branch (485:11): [True: 277, False: 25.0k]
  |  Branch (485:28): [True: 206, False: 71]
  ------------------
  486|    206|		bigend = 1;
  487|  25.1k|	else
  488|  25.1k|		return 0;
  489|       |
  490|    534|	*ulen = 0;
  491|    534|	hi = 0;
  492|       |
  493|  1.32M|	for (i = 2; i + 1 < nbytes; i += 2) {
  ------------------
  |  Branch (493:14): [True: 1.32M, False: 410]
  ------------------
  494|  1.32M|		uint32_t uc;
  495|       |
  496|  1.32M|		if (bigend)
  ------------------
  |  Branch (496:7): [True: 489k, False: 834k]
  ------------------
  497|   489k|			uc = CAST(uint32_t,
  ------------------
  |  |  460|   489k|#define CAST(T, b)	((T)(b))
  ------------------
  498|  1.32M|			    bf[i + 1] | (CAST(file_unichar_t, bf[i]) << 8));
  499|   834k|		else
  500|   834k|			uc = CAST(uint32_t,
  ------------------
  |  |  460|   834k|#define CAST(T, b)	((T)(b))
  ------------------
  501|  1.32M|			    bf[i] | (CAST(file_unichar_t, bf[i + 1]) << 8));
  502|       |
  503|  1.32M|		uc &= 0xffff;
  504|       |
  505|  1.32M|		switch (uc) {
  506|      5|		case 0xfffe:
  ------------------
  |  Branch (506:3): [True: 5, False: 1.32M]
  ------------------
  507|     21|		case 0xffff:
  ------------------
  |  Branch (507:3): [True: 16, False: 1.32M]
  ------------------
  508|     21|			return 0;
  509|  1.32M|		default:
  ------------------
  |  Branch (509:3): [True: 1.32M, False: 21]
  ------------------
  510|  1.32M|			if (UCS16_NOCHAR(uc))
  ------------------
  |  |  466|  1.32M|#define UCS16_NOCHAR(c) ((c) >= 0xfdd0 && (c) <= 0xfdef)
  |  |  ------------------
  |  |  |  Branch (466:26): [True: 77.4k, False: 1.24M]
  |  |  |  Branch (466:43): [True: 15, False: 77.3k]
  |  |  ------------------
  ------------------
  511|     15|				return 0;
  512|  1.32M|			break;
  513|  1.32M|		}
  514|  1.32M|		if (hi) {
  ------------------
  |  Branch (514:7): [True: 17.0k, False: 1.30M]
  ------------------
  515|  17.0k|			if (!UCS16_LOSURR(uc))
  ------------------
  |  |  468|  17.0k|#define UCS16_LOSURR(c) ((c) >= 0xdc00 && (c) <= 0xdfff)
  |  |  ------------------
  |  |  |  Branch (468:26): [True: 16.9k, False: 31]
  |  |  |  Branch (468:43): [True: 16.9k, False: 9]
  |  |  ------------------
  ------------------
  516|     40|				return 0;
  517|  16.9k|			uc = 0x10000 + 0x400 * (hi - 1) + (uc - 0xdc00);
  518|  16.9k|			hi = 0;
  519|  16.9k|		}
  520|  1.32M|		if (NOTTEXT(uc))
  ------------------
  |  |  470|  1.32M|    ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  460|   619k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |                   ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  238|  1.94M|#define T 1   /* character appears in plain ASCII text */
  |  |  ------------------
  |  |  |  Branch (470:6): [True: 619k, False: 705k]
  |  |  |  Branch (470:19): [True: 556k, False: 62.8k]
  |  |  |  Branch (470:57): [True: 41, False: 556k]
  |  |  ------------------
  ------------------
  521|     41|			return 0;
  522|  1.32M|		ubf[(*ulen)++] = uc;
  523|  1.32M|		if (UCS16_HISURR(uc))
  ------------------
  |  |  467|  1.32M|#define UCS16_HISURR(c) ((c) >= 0xd800 && (c) <= 0xdbff)
  |  |  ------------------
  |  |  |  Branch (467:26): [True: 114k, False: 1.20M]
  |  |  |  Branch (467:43): [True: 17.0k, False: 97.5k]
  |  |  ------------------
  ------------------
  524|  17.0k|			hi = uc - 0xd800 + 1;
  525|  1.32M|		if (UCS16_LOSURR(uc))
  ------------------
  |  |  468|  1.32M|#define UCS16_LOSURR(c) ((c) >= 0xdc00 && (c) <= 0xdfff)
  |  |  ------------------
  |  |  |  Branch (468:26): [True: 97.5k, False: 1.22M]
  |  |  |  Branch (468:43): [True: 7, False: 97.5k]
  |  |  ------------------
  ------------------
  526|      7|			return 0;
  527|  1.32M|	}
  528|       |
  529|    410|	return 1 + bigend;
  530|    534|}
encoding.c:looks_ucs32:
  536|  26.1k|{
  537|  26.1k|	int bigend;
  538|  26.1k|	file_unichar_t uc;
  539|  26.1k|	size_t i;
  540|       |
  541|  26.1k|	if (nbytes < 4)
  ------------------
  |  Branch (541:6): [True: 1.34k, False: 24.7k]
  ------------------
  542|  1.34k|		return 0;
  543|       |
  544|  24.7k|	if (bf[0] == 0xff && bf[1] == 0xfe && bf[2] == 0 && bf[3] == 0)
  ------------------
  |  Branch (544:6): [True: 1.31k, False: 23.4k]
  |  Branch (544:23): [True: 455, False: 860]
  |  Branch (544:40): [True: 206, False: 249]
  |  Branch (544:54): [True: 168, False: 38]
  ------------------
  545|    168|		bigend = 0;
  546|  24.6k|	else if (bf[0] == 0 && bf[1] == 0 && bf[2] == 0xfe && bf[3] == 0xff)
  ------------------
  |  Branch (546:11): [True: 1.23k, False: 23.3k]
  |  Branch (546:25): [True: 727, False: 508]
  |  Branch (546:39): [True: 247, False: 480]
  |  Branch (546:56): [True: 224, False: 23]
  ------------------
  547|    224|		bigend = 1;
  548|  24.3k|	else
  549|  24.3k|		return 0;
  550|       |
  551|    392|	*ulen = 0;
  552|       |
  553|   351k|	for (i = 4; i + 3 < nbytes; i += 4) {
  ------------------
  |  Branch (553:14): [True: 350k, False: 374]
  ------------------
  554|       |		/* XXX fix to properly handle chars > 65536 */
  555|       |
  556|   350k|		if (bigend)
  ------------------
  |  Branch (556:7): [True: 59.9k, False: 291k]
  ------------------
  557|  59.9k|			ubf[(*ulen)++] = CAST(file_unichar_t, bf[i + 3])
  ------------------
  |  |  460|  59.9k|#define CAST(T, b)	((T)(b))
  ------------------
  558|  59.9k|			    | (CAST(file_unichar_t, bf[i + 2]) << 8)
  ------------------
  |  |  460|  59.9k|#define CAST(T, b)	((T)(b))
  ------------------
  559|  59.9k|			    | (CAST(file_unichar_t, bf[i + 1]) << 16)
  ------------------
  |  |  460|  59.9k|#define CAST(T, b)	((T)(b))
  ------------------
  560|  59.9k|			    | (CAST(file_unichar_t, bf[i]) << 24);
  ------------------
  |  |  460|  59.9k|#define CAST(T, b)	((T)(b))
  ------------------
  561|   291k|		else
  562|   291k|			ubf[(*ulen)++] = CAST(file_unichar_t, bf[i + 0])
  ------------------
  |  |  460|   291k|#define CAST(T, b)	((T)(b))
  ------------------
  563|   291k|			    | (CAST(file_unichar_t, bf[i + 1]) << 8) 
  ------------------
  |  |  460|   291k|#define CAST(T, b)	((T)(b))
  ------------------
  564|   291k|			    | (CAST(file_unichar_t, bf[i + 2]) << 16)
  ------------------
  |  |  460|   291k|#define CAST(T, b)	((T)(b))
  ------------------
  565|   291k|			    | (CAST(file_unichar_t, bf[i + 3]) << 24);
  ------------------
  |  |  460|   291k|#define CAST(T, b)	((T)(b))
  ------------------
  566|       |
  567|   350k|		uc = ubf[*ulen - 1];
  568|   350k|		if (uc == 0xfffe || NOTTEXT(uc))
  ------------------
  |  |  470|   350k|    ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  460|  38.8k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |                   ((C) < 128 && text_chars[CAST(size_t, (C))] != T && (C) != '\0')
  |  |  ------------------
  |  |  |  |  238|   389k|#define T 1   /* character appears in plain ASCII text */
  |  |  ------------------
  |  |  |  Branch (470:6): [True: 38.8k, False: 312k]
  |  |  |  Branch (470:19): [True: 38.8k, False: 21]
  |  |  |  Branch (470:57): [True: 11, False: 38.8k]
  |  |  ------------------
  ------------------
  |  Branch (568:7): [True: 7, False: 350k]
  ------------------
  569|     18|			return 0;
  570|   350k|	}
  571|       |
  572|    374|	return 1 + bigend;
  573|    392|}
encoding.c:from_ebcdic:
  660|  23.7k|{
  661|  23.7k|	size_t i;
  662|       |
  663|   181M|	for (i = 0; i < nbytes; i++) {
  ------------------
  |  Branch (663:14): [True: 181M, False: 23.7k]
  ------------------
  664|   181M|		out[i] = ebcdic_to_ascii[buf[i]];
  665|   181M|	}
  666|  23.7k|}

file_bigendian:
   57|     65|{
   58|     65|	union {
   59|     65|		unsigned short x;
   60|     65|		unsigned char s[sizeof(unsigned short)];
   61|     65|	} u;
   62|       |
   63|     65|	u.x = 1;
   64|     65|	return u.s[0] != 1;
   65|     65|}
file_checkfmt:
  111|   306k|{
  112|   306k|	const char *p;
  113|  2.27M|	for (p = fmt; *p; p++) {
  ------------------
  |  Branch (113:16): [True: 1.97M, False: 306k]
  ------------------
  114|  1.97M|		if (*p != '%')
  ------------------
  |  Branch (114:7): [True: 1.81M, False: 155k]
  ------------------
  115|  1.81M|			continue;
  116|   155k|		if (*++p == '%')
  ------------------
  |  Branch (116:7): [True: 0, False: 155k]
  ------------------
  117|      0|			continue;
  118|   155k|		if (*p == '\0') {
  ------------------
  |  Branch (118:7): [True: 0, False: 155k]
  ------------------
  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|   170k|		while (*p != '\0' && strchr("#0.'+- ", *p) != NULL)
  ------------------
  |  Branch (124:10): [True: 170k, False: 0]
  |  Branch (124:24): [True: 14.3k, False: 155k]
  ------------------
  125|  14.3k|			p++;
  126|   155k|		if (*p == '*') {
  ------------------
  |  Branch (126:7): [True: 0, False: 155k]
  ------------------
  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|   155k|		if (!file_checkfield(msg, mlen, "width", &p))
  ------------------
  |  Branch (132:7): [True: 0, False: 155k]
  ------------------
  133|      0|			return -1;
  134|       |
  135|   155k|		if (*p == '.') {
  ------------------
  |  Branch (135:7): [True: 2.43k, False: 153k]
  ------------------
  136|  2.43k|			p++;
  137|  2.43k|			if (!file_checkfield(msg, mlen, "precision", &p))
  ------------------
  |  Branch (137:8): [True: 0, False: 2.43k]
  ------------------
  138|      0|				return -1;
  139|  2.43k|		}
  140|       |
  141|   155k|		if (!isalpha((unsigned char)*p)) {
  ------------------
  |  Branch (141:7): [True: 0, False: 155k]
  ------------------
  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|   155k|	}
  147|   306k|	return 0;
  148|   306k|}
file_vprintf:
  155|   308k|{
  156|   308k|	int len;
  157|   308k|	char *buf, *newstr;
  158|   308k|	char tbuf[1024];
  159|       |
  160|   308k|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  495|   308k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (160:6): [True: 1.53k, False: 306k]
  ------------------
  161|  1.53k|		return 0;
  162|       |
  163|   306k|	if (file_checkfmt(tbuf, sizeof(tbuf), fmt)) {
  ------------------
  |  Branch (163:6): [True: 0, False: 306k]
  ------------------
  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|   306k|	len = vasprintf(&buf, fmt, ap);
  170|   306k|	if (len < 0 || (size_t)len > 1024 || len + ms->o.blen > 1024 * 1024) {
  ------------------
  |  Branch (170:6): [True: 0, False: 306k]
  |  Branch (170:17): [True: 137, False: 306k]
  |  Branch (170:39): [True: 0, False: 306k]
  ------------------
  171|    137|		size_t blen = ms->o.blen;
  172|    137|		free(buf);
  173|    137|		file_clearbuf(ms);
  174|    137|		file_error(ms, 0, "Output buffer space exceeded %d+%"
  175|    137|		    SIZE_T_FORMAT "u", len, blen);
  176|    137|		return -1;
  177|    137|	}
  178|       |
  179|   306k|	if (ms->o.buf != NULL) {
  ------------------
  |  Branch (179:6): [True: 268k, False: 38.3k]
  ------------------
  180|   268k|		len = asprintf(&newstr, "%s%s", ms->o.buf, buf);
  181|   268k|		free(buf);
  182|   268k|		if (len < 0)
  ------------------
  |  Branch (182:7): [True: 0, False: 268k]
  ------------------
  183|      0|			goto out;
  184|   268k|		free(ms->o.buf);
  185|   268k|		buf = newstr;
  186|   268k|	}
  187|   306k|	ms->o.buf = buf;
  188|   306k|	ms->o.blen = len;
  189|   306k|	return 0;
  190|      0|out:
  191|      0|	file_clearbuf(ms);
  192|       |	file_error(ms, errno, "vasprintf failed");
  193|      0|	return -1;
  194|   306k|}
file_printf:
  198|   307k|{
  199|   307k|	int rv;
  200|   307k|	va_list ap;
  201|       |
  202|   307k|	va_start(ap, fmt);
  203|   307k|	rv = file_vprintf(ms, fmt, ap);
  204|       |	va_end(ap);
  205|   307k|	return rv;
  206|   307k|}
file_error:
  236|    397|{
  237|    397|	va_list va;
  238|    397|	va_start(va, f);
  239|    397|	file_error_core(ms, error, f, va, 0);
  240|       |	va_end(va);
  241|    397|}
file_magerror:
  249|     37|{
  250|     37|	va_list va;
  251|     37|	va_start(va, f);
  252|     37|	file_error_core(ms, 0, f, va, ms->line);
  253|       |	va_end(va);
  254|     37|}
file_separator:
  280|  32.9k|{
  281|  32.9k|	return file_printf(ms, FILE_SEPARATOR);
  ------------------
  |  |  276|  32.9k|#define FILE_SEPARATOR "\n- "
  ------------------
  282|  32.9k|}
file_default:
  315|  9.82k|{
  316|  9.82k|	if (ms->flags & MAGIC_MIME) {
  ------------------
  |  |   44|  9.82k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  9.82k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  9.82k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  |  Branch (316:6): [True: 0, False: 9.82k]
  ------------------
  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|  9.82k|	if (ms->flags & MAGIC_APPLE) {
  ------------------
  |  |   45|  9.82k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
  |  Branch (323:6): [True: 0, False: 9.82k]
  ------------------
  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|  9.82k|	if (ms->flags & MAGIC_EXTENSION) {
  ------------------
  |  |   46|  9.82k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (329:6): [True: 0, False: 9.82k]
  ------------------
  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|  9.82k|	return 0;
  335|  9.82k|}
file_buffer:
  348|  16.1k|{
  349|  16.1k|	int m = 0, rv = 0, looks_text = 0;
  350|  16.1k|	const char *code = NULL;
  351|  16.1k|	const char *code_mime = "binary";
  352|  16.1k|	const char *def = "data";
  353|  16.1k|	const char *ftype = NULL;
  354|  16.1k|	char *rbuf = NULL;
  355|  16.1k|	struct buffer b;
  356|       |
  357|  16.1k|	buffer_init(&b, fd, st, buf, nb);
  358|  16.1k|	ms->mode = b.st.st_mode;
  359|       |
  360|  16.1k|	if (nb == 0) {
  ------------------
  |  Branch (360:6): [True: 23, False: 16.0k]
  ------------------
  361|     23|		def = "empty";
  362|     23|		goto simple;
  363|  16.0k|	} else if (nb == 1) {
  ------------------
  |  Branch (363:13): [True: 12, False: 16.0k]
  ------------------
  364|     12|		def = "very short file (no magic)";
  365|     12|		goto simple;
  366|     12|	}
  367|       |
  368|  16.0k|	if ((ms->flags & MAGIC_NO_CHECK_ENCODING) == 0) {
  ------------------
  |  |   63|  16.0k|#define MAGIC_NO_CHECK_ENCODING 0x0200000 /* Don't check text encodings */
  ------------------
  |  Branch (368:6): [True: 16.0k, False: 0]
  ------------------
  369|  16.0k|		looks_text = file_encoding(ms, &b, NULL, 0,
  370|  16.0k|		    &code, &code_mime, &ftype);
  371|  16.0k|	}
  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|  16.0k|#if HAVE_FORK
  389|       |	/* try compression stuff */
  390|  16.0k|	if ((ms->flags & MAGIC_NO_CHECK_COMPRESS) == 0) {
  ------------------
  |  |   54|  16.0k|#define	MAGIC_NO_CHECK_COMPRESS	0x0001000 /* Don't check for compressed files */
  ------------------
  |  Branch (390:6): [True: 16.0k, False: 0]
  ------------------
  391|  16.0k|		m = file_zmagic(ms, &b, inname);
  392|  16.0k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  16.0k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (392:7): [True: 0, False: 16.0k]
  ------------------
  393|      0|			(void)fprintf(stderr, "[try zmagic %d]\n", m);
  394|  16.0k|		if (m) {
  ------------------
  |  Branch (394:7): [True: 3.81k, False: 12.2k]
  ------------------
  395|  3.81k|			goto done_encoding;
  396|  3.81k|		}
  397|  16.0k|	}
  398|  12.2k|#endif
  399|       |	/* Check if we have a tar file */
  400|  12.2k|	if ((ms->flags & MAGIC_NO_CHECK_TAR) == 0) {
  ------------------
  |  |   55|  12.2k|#define	MAGIC_NO_CHECK_TAR	0x0002000 /* Don't check for tar files */
  ------------------
  |  Branch (400:6): [True: 12.2k, False: 0]
  ------------------
  401|  12.2k|		m = file_is_tar(ms, &b);
  402|  12.2k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  12.2k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (402:7): [True: 0, False: 12.2k]
  ------------------
  403|      0|			(void)fprintf(stderr, "[try tar %d]\n", m);
  404|  12.2k|		if (m) {
  ------------------
  |  Branch (404:7): [True: 42, False: 12.2k]
  ------------------
  405|     42|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (405:8): [True: 0, False: 42]
  ------------------
  406|      0|				goto done;
  407|     42|		}
  408|  12.2k|	}
  409|       |
  410|       |	/* Check if we have a JSON file */
  411|  12.2k|	if ((ms->flags & MAGIC_NO_CHECK_JSON) == 0) {
  ------------------
  |  |   64|  12.2k|#define MAGIC_NO_CHECK_JSON	0x0400000 /* Don't check for JSON files */
  ------------------
  |  Branch (411:6): [True: 12.2k, False: 0]
  ------------------
  412|  12.2k|		m = file_is_json(ms, &b);
  413|  12.2k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  12.2k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (413:7): [True: 0, False: 12.2k]
  ------------------
  414|      0|			(void)fprintf(stderr, "[try json %d]\n", m);
  415|  12.2k|		if (m) {
  ------------------
  |  Branch (415:7): [True: 34, False: 12.2k]
  ------------------
  416|     34|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (416:8): [True: 0, False: 34]
  ------------------
  417|      0|				goto done;
  418|     34|		}
  419|  12.2k|	}
  420|       |
  421|       |	/* Check if we have a CSV file */
  422|  12.2k|	if ((ms->flags & MAGIC_NO_CHECK_CSV) == 0) {
  ------------------
  |  |   61|  12.2k|#define MAGIC_NO_CHECK_CSV	0x0080000 /* Don't check for CSV files */
  ------------------
  |  Branch (422:6): [True: 12.2k, False: 0]
  ------------------
  423|  12.2k|		m = file_is_csv(ms, &b, looks_text, code);
  424|  12.2k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  12.2k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (424:7): [True: 0, False: 12.2k]
  ------------------
  425|      0|			(void)fprintf(stderr, "[try csv %d]\n", m);
  426|  12.2k|		if (m) {
  ------------------
  |  Branch (426:7): [True: 9, False: 12.2k]
  ------------------
  427|      9|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (427:8): [True: 0, False: 9]
  ------------------
  428|      0|				goto done;
  429|      9|		}
  430|  12.2k|	}
  431|       |
  432|       |	/* Check if we have a SIMH tape file */
  433|  12.2k|	if ((ms->flags & MAGIC_NO_CHECK_SIMH) == 0) {
  ------------------
  |  |   65|  12.2k|#define MAGIC_NO_CHECK_SIMH	0x0800000 /* Don't check for SIMH tape files */
  ------------------
  |  Branch (433:6): [True: 12.2k, False: 0]
  ------------------
  434|  12.2k|		m = file_is_simh(ms, &b);
  435|  12.2k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  12.2k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (435:7): [True: 0, False: 12.2k]
  ------------------
  436|      0|			(void)fprintf(stderr, "[try simh %d]\n", m);
  437|  12.2k|		if (m) {
  ------------------
  |  Branch (437:7): [True: 31, False: 12.2k]
  ------------------
  438|     31|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (438:8): [True: 0, False: 31]
  ------------------
  439|      0|				goto done;
  440|     31|		}
  441|  12.2k|	}
  442|       |
  443|       |	/* Check if we have a CDF file */
  444|  12.2k|	if ((ms->flags & MAGIC_NO_CHECK_CDF) == 0) {
  ------------------
  |  |   60|  12.2k|#define	MAGIC_NO_CHECK_CDF	0x0040000 /* Don't check for cdf files */
  ------------------
  |  Branch (444:6): [True: 12.2k, False: 0]
  ------------------
  445|  12.2k|		m = file_trycdf(ms, &b);
  446|  12.2k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  12.2k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (446:7): [True: 0, False: 12.2k]
  ------------------
  447|      0|			(void)fprintf(stderr, "[try cdf %d]\n", m);
  448|  12.2k|		if (m) {
  ------------------
  |  Branch (448:7): [True: 1.92k, False: 10.3k]
  ------------------
  449|  1.92k|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (449:8): [True: 0, False: 1.92k]
  ------------------
  450|      0|				goto done;
  451|  1.92k|		}
  452|  12.2k|	}
  453|  12.2k|#ifdef BUILTIN_ELF
  454|  12.2k|	if ((ms->flags & MAGIC_NO_CHECK_ELF) == 0 && nb > 5 && fd != -1) {
  ------------------
  |  |   58|  12.2k|#define	MAGIC_NO_CHECK_ELF	0x0010000 /* Don't check for elf details */
  ------------------
  |  Branch (454:6): [True: 12.2k, False: 0]
  |  Branch (454:47): [True: 10.5k, False: 1.76k]
  |  Branch (454:57): [True: 0, False: 10.5k]
  ------------------
  455|      0|		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|      0|		if ((pb = file_push_buffer(ms)) == NULL)
  ------------------
  |  Branch (466:7): [True: 0, False: 0]
  ------------------
  467|      0|			return -1;
  468|       |
  469|      0|		rv = file_tryelf(ms, &b);
  470|      0|		rbuf = file_pop_buffer(ms, pb);
  471|      0|		if (rv == -1) {
  ------------------
  |  Branch (471:7): [True: 0, False: 0]
  ------------------
  472|      0|			free(rbuf);
  473|      0|			rbuf = NULL;
  474|      0|		}
  475|      0|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (475:7): [True: 0, False: 0]
  ------------------
  476|      0|			(void)fprintf(stderr, "[try elf %d]\n", m);
  477|      0|	}
  478|  12.2k|#endif
  479|       |
  480|       |	/* try soft magic tests */
  481|  12.2k|	if ((ms->flags & MAGIC_NO_CHECK_SOFT) == 0) {
  ------------------
  |  |   56|  12.2k|#define	MAGIC_NO_CHECK_SOFT	0x0004000 /* Don't check magic entries */
  ------------------
  |  Branch (481:6): [True: 12.2k, False: 0]
  ------------------
  482|  12.2k|		m = file_softmagic(ms, &b, NULL, NULL, BINTEST, looks_text);
  ------------------
  |  |  239|  12.2k|#define BINTEST		0x20	/* test is for a binary type (set only
  ------------------
  483|  12.2k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  12.2k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (483:7): [True: 0, False: 12.2k]
  ------------------
  484|      0|			(void)fprintf(stderr, "[try softmagic %d]\n", m);
  485|  12.2k|		if (m == 1 && rbuf) {
  ------------------
  |  Branch (485:7): [True: 8.63k, False: 3.63k]
  |  Branch (485:17): [True: 0, False: 8.63k]
  ------------------
  486|      0|			if (file_printf(ms, "%s", rbuf) == -1)
  ------------------
  |  Branch (486:8): [True: 0, False: 0]
  ------------------
  487|      0|				goto done;
  488|      0|		}
  489|  12.2k|		if (m) {
  ------------------
  |  Branch (489:7): [True: 9.02k, False: 3.24k]
  ------------------
  490|  9.02k|			if (checkdone(ms, &rv))
  ------------------
  |  Branch (490:8): [True: 0, False: 9.02k]
  ------------------
  491|      0|				goto done;
  492|  9.02k|		}
  493|  12.2k|	}
  494|       |
  495|       |	/* try text properties */
  496|  12.2k|	if ((ms->flags & MAGIC_NO_CHECK_TEXT) == 0) {
  ------------------
  |  |   59|  12.2k|#define	MAGIC_NO_CHECK_TEXT	0x0020000 /* Don't check for text files */
  ------------------
  |  Branch (496:6): [True: 12.2k, False: 0]
  ------------------
  497|       |
  498|  12.2k|		m = file_ascmagic(ms, &b, looks_text);
  499|  12.2k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  12.2k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (499:7): [True: 0, False: 12.2k]
  ------------------
  500|      0|			(void)fprintf(stderr, "[try ascmagic %d]\n", m);
  501|  12.2k|		if (m) {
  ------------------
  |  Branch (501:7): [True: 2.47k, False: 9.79k]
  ------------------
  502|  2.47k|			goto done;
  503|  2.47k|		}
  504|  12.2k|	}
  505|       |
  506|  9.82k|simple:
  507|       |	/* give up */
  508|  9.82k|	if (m == 0) {
  ------------------
  |  Branch (508:6): [True: 9.82k, False: 0]
  ------------------
  509|  9.82k|		m = 1;
  510|  9.82k|		rv = file_default(ms, nb);
  511|  9.82k|		if (rv == 0)
  ------------------
  |  Branch (511:7): [True: 9.82k, False: 0]
  ------------------
  512|  9.82k|			if (file_printf(ms, "%s", def) == -1)
  ------------------
  |  Branch (512:8): [True: 0, False: 9.82k]
  ------------------
  513|      0|				rv = -1;
  514|  9.82k|	}
  515|  12.3k| done:
  516|  12.3k|	trim_separator(ms);
  517|  12.3k|	if ((ms->flags & MAGIC_MIME_ENCODING) != 0) {
  ------------------
  |  |   43|  12.3k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (517:6): [True: 0, False: 12.3k]
  ------------------
  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|  12.3k|#if HAVE_FORK
  525|  16.1k| done_encoding:
  526|  16.1k|#endif
  527|  16.1k|	free(rbuf);
  528|  16.1k|	buffer_fini(&b);
  529|  16.1k|	if (rv)
  ------------------
  |  Branch (529:6): [True: 0, False: 16.1k]
  ------------------
  530|      0|		return rv;
  531|       |
  532|  16.1k|	return m;
  533|  16.1k|}
file_reset:
  538|  8.25k|{
  539|  8.25k|	if (checkloaded && ms->mlist[0] == NULL) {
  ------------------
  |  Branch (539:6): [True: 8.25k, False: 2]
  |  Branch (539:21): [True: 0, False: 8.25k]
  ------------------
  540|      0|		file_error(ms, 0, "no magic files loaded");
  541|      0|		return -1;
  542|      0|	}
  543|  8.25k|	file_clearbuf(ms);
  544|  8.25k|	if (ms->o.pbuf) {
  ------------------
  |  Branch (544:6): [True: 7.82k, False: 434]
  ------------------
  545|  7.82k|		free(ms->o.pbuf);
  546|  7.82k|		ms->o.pbuf = NULL;
  547|  7.82k|	}
  548|  8.25k|	ms->event_flags &= ~EVENT_HAD_ERR;
  ------------------
  |  |  495|  8.25k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  549|  8.25k|	ms->error = -1;
  550|  8.25k|	return 0;
  551|  8.25k|}
file_getbuffer:
  563|  7.92k|{
  564|  7.92k|	char *pbuf, *op, *np;
  565|  7.92k|	size_t psize, len;
  566|       |
  567|  7.92k|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  495|  7.92k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (567:6): [True: 106, False: 7.82k]
  ------------------
  568|    106|		return NULL;
  569|       |
  570|  7.82k|	if (ms->flags & MAGIC_RAW)
  ------------------
  |  |   41|  7.82k|#define	MAGIC_RAW		0x0000100 /* Don't convert unprintable chars */
  ------------------
  |  Branch (570:6): [True: 0, False: 7.82k]
  ------------------
  571|      0|		return ms->o.buf;
  572|       |
  573|  7.82k|	if (ms->o.buf == NULL)
  ------------------
  |  Branch (573:6): [True: 0, False: 7.82k]
  ------------------
  574|      0|		return NULL;
  575|       |
  576|       |	/* * 4 is for octal representation, + 1 is for NUL */
  577|  7.82k|	len = strlen(ms->o.buf);
  578|  7.82k|	if (len > (SIZE_MAX - 1) / 4) {
  ------------------
  |  Branch (578:6): [True: 0, False: 7.82k]
  ------------------
  579|      0|		file_oomem(ms, len);
  580|      0|		return NULL;
  581|      0|	}
  582|  7.82k|	psize = len * 4 + 1;
  583|  7.82k|	if ((pbuf = CAST(char *, realloc(ms->o.pbuf, psize))) == NULL) {
  ------------------
  |  |  460|  7.82k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (583:6): [True: 0, False: 7.82k]
  ------------------
  584|      0|		file_oomem(ms, psize);
  585|      0|		return NULL;
  586|      0|	}
  587|  7.82k|	ms->o.pbuf = pbuf;
  588|       |
  589|  7.82k|#if defined(HAVE_WCHAR_H) && defined(HAVE_MBRTOWC) && defined(HAVE_WCWIDTH)
  590|  7.82k|	{
  591|  7.82k|		mbstate_t state;
  592|  7.82k|		wchar_t nextchar;
  593|  7.82k|		int mb_conv = 1;
  594|  7.82k|		size_t bytesconsumed;
  595|  7.82k|		char *eop;
  596|  7.82k|		(void)memset(&state, 0, sizeof(mbstate_t));
  597|       |
  598|  7.82k|		np = ms->o.pbuf;
  599|  7.82k|		op = ms->o.buf;
  600|  7.82k|		eop = op + len;
  601|       |
  602|  2.36M|		while (op < eop) {
  ------------------
  |  Branch (602:10): [True: 2.35M, False: 7.79k]
  ------------------
  603|  2.35M|			bytesconsumed = mbrtowc(&nextchar, op,
  604|  2.35M|			    CAST(size_t, eop - op), &state);
  ------------------
  |  |  460|  2.35M|#define CAST(T, b)	((T)(b))
  ------------------
  605|  2.35M|			if (bytesconsumed == CAST(size_t, -1) ||
  ------------------
  |  |  460|  4.71M|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (605:8): [True: 30, False: 2.35M]
  ------------------
  606|  2.35M|			    bytesconsumed == CAST(size_t, -2)) {
  ------------------
  |  |  460|  2.35M|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (606:8): [True: 0, False: 2.35M]
  ------------------
  607|     30|				mb_conv = 0;
  608|     30|				break;
  609|     30|			}
  610|       |
  611|  2.35M|			if (iswprint(nextchar)) {
  ------------------
  |  Branch (611:8): [True: 2.33M, False: 21.3k]
  ------------------
  612|  2.33M|				(void)memcpy(np, op, bytesconsumed);
  613|  2.33M|				op += bytesconsumed;
  614|  2.33M|				np += bytesconsumed;
  615|  2.33M|			} else {
  616|  42.6k|				while (bytesconsumed-- > 0)
  ------------------
  |  Branch (616:12): [True: 21.3k, False: 21.3k]
  ------------------
  617|  21.3k|					OCTALIFY(np, op);
  ------------------
  |  |  555|  21.3k|	(void)(*(n)++ = '\\', \
  |  |  556|  21.3k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 6) & 3) + '0', \
  |  |  ------------------
  |  |  |  |  460|  21.3k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  557|  21.3k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 3) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  460|  21.3k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  558|  21.3k|	*(n)++ = ((CAST(uint32_t, *(o)) >> 0) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  460|  21.3k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  559|  21.3k|	(o)++)
  ------------------
  618|  21.3k|			}
  619|  2.35M|		}
  620|  7.82k|		*np = '\0';
  621|       |
  622|       |		/* Parsing succeeded as a multi-byte sequence */
  623|  7.82k|		if (mb_conv != 0)
  ------------------
  |  Branch (623:7): [True: 7.79k, False: 30]
  ------------------
  624|  7.79k|			return ms->o.pbuf;
  625|  7.82k|	}
  626|     30|#endif
  627|       |
  628|  10.5k|	for (np = ms->o.pbuf, op = ms->o.buf; *op;) {
  ------------------
  |  Branch (628:40): [True: 10.5k, False: 30]
  ------------------
  629|  10.5k|		if (isprint(CAST(unsigned char, *op))) {
  ------------------
  |  Branch (629:7): [True: 10.0k, False: 452]
  ------------------
  630|  10.0k|			*np++ = *op++;
  631|  10.0k|		} else {
  632|    452|			OCTALIFY(np, op);
  ------------------
  |  |  555|    452|	(void)(*(n)++ = '\\', \
  |  |  556|    452|	*(n)++ = ((CAST(uint32_t, *(o)) >> 6) & 3) + '0', \
  |  |  ------------------
  |  |  |  |  460|    452|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  557|    452|	*(n)++ = ((CAST(uint32_t, *(o)) >> 3) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  460|    452|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  558|    452|	*(n)++ = ((CAST(uint32_t, *(o)) >> 0) & 7) + '0', \
  |  |  ------------------
  |  |  |  |  460|    452|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  559|    452|	(o)++)
  ------------------
  633|    452|		}
  634|  10.5k|	}
  635|     30|	*np = '\0';
  636|     30|	return ms->o.pbuf;
  637|  7.82k|}
file_check_mem:
  641|  1.06M|{
  642|  1.06M|	size_t len;
  643|       |
  644|  1.06M|	if (level >= ms->c.len) {
  ------------------
  |  Branch (644:6): [True: 1, False: 1.06M]
  ------------------
  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|  1.06M|	ms->c.li[level].got_match = 0;
  655|  1.06M|#ifdef ENABLE_CONDITIONALS
  656|  1.06M|	ms->c.li[level].last_match = 0;
  657|  1.06M|	ms->c.li[level].last_cond = COND_NONE;
  ------------------
  |  |  368|  1.06M|#define				COND_NONE	0
  ------------------
  658|  1.06M|#endif /* ENABLE_CONDITIONALS */
  659|  1.06M|	return 0;
  660|  1.06M|}
file_printedlen:
  664|  2.47k|{
  665|  2.47k|	return ms->o.blen;
  666|  2.47k|}
file_replace:
  670|  1.75k|{
  671|  1.75k|	file_regex_t rx;
  672|  1.75k|	int nm;
  673|  1.75k|	regmatch_t rm;
  674|       |
  675|  1.75k|	nm = file_regcomp(ms, &rx, pat, REG_EXTENDED);
  676|  1.75k|	if (nm != 0)
  ------------------
  |  Branch (676:6): [True: 0, False: 1.75k]
  ------------------
  677|      0|		return -1;
  678|       |
  679|  1.84k|	while (file_regexec(ms, &rx, ms->o.buf, 1, &rm, 0) == 0) {
  ------------------
  |  Branch (679:9): [True: 93, False: 1.75k]
  ------------------
  680|     93|		ms->o.buf[rm.rm_so] = '\0';
  681|     93|		if (file_printf(ms, "%s%s", rep,
  ------------------
  |  Branch (681:7): [True: 0, False: 93]
  ------------------
  682|     93|		    rm.rm_eo != 0 ? ms->o.buf + rm.rm_eo : "") == -1)
  ------------------
  |  Branch (682:7): [True: 93, False: 0]
  ------------------
  683|      0|			goto out;
  684|     93|		nm++;
  685|     93|	}
  686|  1.75k|out:
  687|  1.75k|	file_regfree(&rx);
  688|  1.75k|	return nm;
  689|  1.75k|}
file_regcomp:
  748|  43.5k|{
  749|  43.5k|	if (check_regex(ms, pat) == -1)
  ------------------
  |  Branch (749:6): [True: 0, False: 43.5k]
  ------------------
  750|      0|		return -1;
  751|       |
  752|  43.5k|#ifdef USE_C_LOCALE
  753|  43.5k|	locale_t old = uselocale(ms->c_lc_ctype);
  754|  43.5k|	assert(old != NULL);
  ------------------
  |  Branch (754:2): [True: 0, False: 43.5k]
  |  Branch (754:2): [True: 43.5k, False: 0]
  ------------------
  755|       |#else
  756|       |	char old[1024];
  757|       |	strlcpy(old, setlocale(LC_CTYPE, NULL), sizeof(old));
  758|       |	(void)setlocale(LC_CTYPE, "C");
  759|       |#endif
  760|  43.5k|	int rc;
  761|  43.5k|	rc = regcomp(rx, pat, flags);
  762|       |
  763|  43.5k|#ifdef USE_C_LOCALE
  764|  43.5k|	uselocale(old);
  765|       |#else
  766|       |	(void)setlocale(LC_CTYPE, old);
  767|       |#endif
  768|  43.5k|	if (rc > 0 && (ms->flags & MAGIC_CHECK)) {
  ------------------
  |  |   39|      0|#define	MAGIC_CHECK		0x0000040 /* Print warnings to stderr */
  ------------------
  |  Branch (768:6): [True: 0, False: 43.5k]
  |  Branch (768:16): [True: 0, False: 0]
  ------------------
  769|      0|		char errmsg[512], buf[512];
  770|       |
  771|      0|		(void)regerror(rc, rx, errmsg, sizeof(errmsg));
  772|      0|		file_magerror(ms, "regex error %d for `%s', (%s)", rc, 
  773|      0|		    file_printable(ms, buf, sizeof(buf), pat, strlen(pat)),
  774|      0|		    errmsg);
  775|      0|	}
  776|  43.5k|	return rc;
  777|  43.5k|}
file_regexec:
  783|   636k|{
  784|   636k|#ifdef USE_C_LOCALE
  785|   636k|	locale_t old = uselocale(ms->c_lc_ctype);
  786|   636k|	assert(old != NULL);
  ------------------
  |  Branch (786:2): [True: 0, False: 636k]
  |  Branch (786:2): [True: 636k, False: 0]
  ------------------
  787|       |#else
  788|       |	char old[1024];
  789|       |	strlcpy(old, setlocale(LC_CTYPE, NULL), sizeof(old));
  790|       |	(void)setlocale(LC_CTYPE, "C");
  791|       |#endif
  792|   636k|	int rc;
  793|       |	/* XXX: force initialization because glibc does not always do this */
  794|   636k|	if (nmatch != 0)
  ------------------
  |  Branch (794:6): [True: 595k, False: 41.5k]
  ------------------
  795|   595k|		memset(pmatch, 0, nmatch * sizeof(*pmatch));
  796|   636k|	rc = regexec(rx, str, nmatch, pmatch, eflags);
  797|   636k|#ifdef USE_C_LOCALE
  798|   636k|	uselocale(old);
  799|       |#else
  800|       |	(void)setlocale(LC_CTYPE, old);
  801|       |#endif
  802|   636k|	return rc;
  803|   636k|}
file_regfree:
  807|  43.3k|{
  808|  43.3k|	regfree(rx);
  809|  43.3k|}
file_push_buffer:
  813|  39.1k|{
  814|  39.1k|	file_pushbuf_t *pb;
  815|       |
  816|  39.1k|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  495|  39.1k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (816:6): [True: 334, False: 38.8k]
  ------------------
  817|    334|		return NULL;
  818|       |
  819|  38.8k|	if ((pb = (CAST(file_pushbuf_t *, malloc(sizeof(*pb))))) == NULL)
  ------------------
  |  |  460|  38.8k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (819:6): [True: 0, False: 38.8k]
  ------------------
  820|      0|		return NULL;
  821|       |
  822|  38.8k|	pb->buf = ms->o.buf;
  823|  38.8k|	pb->blen = ms->o.blen;
  824|  38.8k|	pb->offset = ms->offset;
  825|       |
  826|  38.8k|	ms->o.buf = NULL;
  827|  38.8k|	ms->o.blen = 0;
  828|  38.8k|	ms->offset = 0;
  829|       |
  830|  38.8k|	return pb;
  831|  38.8k|}
file_pop_buffer:
  835|  38.8k|{
  836|  38.8k|	char *rbuf;
  837|       |
  838|  38.8k|	if (ms->event_flags & EVENT_HAD_ERR) {
  ------------------
  |  |  495|  38.8k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (838:6): [True: 11.4k, False: 27.3k]
  ------------------
  839|  11.4k|		free(pb->buf);
  840|  11.4k|		free(pb);
  841|  11.4k|		return NULL;
  842|  11.4k|	}
  843|       |
  844|  27.3k|	rbuf = ms->o.buf;
  845|       |
  846|  27.3k|	ms->o.buf = pb->buf;
  847|  27.3k|	ms->o.blen = pb->blen;
  848|  27.3k|	ms->offset = pb->offset;
  849|       |
  850|  27.3k|	free(pb);
  851|  27.3k|	return rbuf;
  852|  38.8k|}
file_printable:
  860|  26.8k|{
  861|  26.8k|	char *ptr, *eptr = buf + bufsiz - 1;
  862|  26.8k|	const unsigned char *s = RCAST(const unsigned char *, str);
  ------------------
  |  |  461|  26.8k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  863|  26.8k|	const unsigned char *es = s + slen;
  864|       |
  865|   507k|	for (ptr = buf;  ptr < eptr && s < es && *s; s++) {
  ------------------
  |  Branch (865:19): [True: 507k, False: 113]
  |  Branch (865:33): [True: 506k, False: 853]
  |  Branch (865:43): [True: 480k, False: 25.7k]
  ------------------
  866|   480k|		if ((ms->flags & MAGIC_RAW) != 0 || isprint(*s)) {
  ------------------
  |  |   41|   480k|#define	MAGIC_RAW		0x0000100 /* Don't convert unprintable chars */
  ------------------
  |  Branch (866:7): [True: 0, False: 480k]
  |  Branch (866:39): [True: 138k, False: 341k]
  ------------------
  867|   138k|			*ptr++ = *s;
  868|   138k|			continue;
  869|   138k|		}
  870|   341k|		if (ptr >= eptr - 3)
  ------------------
  |  Branch (870:7): [True: 114, False: 341k]
  ------------------
  871|    114|			break;
  872|   341k|		*ptr++ = '\\';
  873|   341k|		*ptr++ = ((CAST(unsigned int, *s) >> 6) & 7) + '0';
  ------------------
  |  |  460|   341k|#define CAST(T, b)	((T)(b))
  ------------------
  874|   341k|		*ptr++ = ((CAST(unsigned int, *s) >> 3) & 7) + '0';
  ------------------
  |  |  460|   341k|#define CAST(T, b)	((T)(b))
  ------------------
  875|   341k|		*ptr++ = ((CAST(unsigned int, *s) >> 0) & 7) + '0';
  ------------------
  |  |  460|   341k|#define CAST(T, b)	((T)(b))
  ------------------
  876|   341k|	}
  877|  26.8k|	*ptr = '\0';
  878|  26.8k|	return buf;
  879|  26.8k|}
file_print_leguid:
  979|    183|{
  980|    183|	const struct guid *g = CAST(const struct guid *,
  ------------------
  |  |  460|    183|#define CAST(T, b)	((T)(b))
  ------------------
  981|    183|	    CAST(const void *, guid));
  982|    183|	return file_print_guid(str, len, g);
  983|    183|}
file_print_beguid:
  987|     36|{
  988|     36|	const struct guid *g = CAST(const struct guid *,
  ------------------
  |  |  460|     36|#define CAST(T, b)	((T)(b))
  ------------------
  989|     36|	    CAST(const void *, guid));
  990|     36|	struct guid gg = *g;
  991|     36|	gg.data1 = file_swap4(gg.data1);
  ------------------
  |  |   38|     36|#define file_swap4(x)	bswap_32(x)
  ------------------
  992|     36|	gg.data2 = file_swap2(gg.data2);
  ------------------
  |  |   37|     36|#define file_swap2(x)	bswap_16(x)
  ------------------
  993|       |	gg.data3 = file_swap2(gg.data3);
  ------------------
  |  |   37|     36|#define file_swap2(x)	bswap_16(x)
  ------------------
  994|     36|	return file_print_guid(str, len, &gg);
  995|     36|}
file_pipe_closexec:
  999|  13.2k|{
 1000|       |#ifdef __MINGW32__
 1001|       |	return 0;
 1002|       |#elif defined(HAVE_PIPE2)
 1003|  13.2k|	return pipe2(fds, O_CLOEXEC);
 1004|       |#elif !defined(HAVE_PIPE)
 1005|       |	/*
 1006|       |	 * No pipe(2) at all -- e.g. AmigaOS clib2. Only the external
 1007|       |	 * decompressor path needs pipes, so report failure and let the
 1008|       |	 * caller fall back rather than failing to link.
 1009|       |	 */
 1010|       |	(void)fds;
 1011|       |	return -1;
 1012|       |#else
 1013|       |	if (pipe(fds) == -1)
 1014|       |		return -1;
 1015|       |# ifdef F_SETFD
 1016|       |	(void)fcntl(fds[0], F_SETFD, FD_CLOEXEC);
 1017|       |	(void)fcntl(fds[1], F_SETFD, FD_CLOEXEC);
 1018|       |# endif
 1019|       |	return 0;
 1020|       |#endif
 1021|  13.2k|}
file_clear_closexec:
 1024|  13.2k|file_clear_closexec(int fd) {
 1025|  13.2k|#ifdef F_SETFD
 1026|  13.2k|	return fcntl(fd, F_SETFD, 0);
 1027|       |#else
 1028|       |	return 0;
 1029|       |#endif
 1030|  13.2k|}
file_strtrim:
 1034|    364|{
 1035|    364|	char *last;
 1036|       |
 1037|    364|	while (isspace(CAST(unsigned char, *str)))
  ------------------
  |  Branch (1037:9): [True: 337, False: 364]
  ------------------
 1038|    337|		str++;
 1039|    364|	last = str;
 1040|  3.51k|	while (*last)
  ------------------
  |  Branch (1040:9): [True: 3.15k, False: 364]
  ------------------
 1041|  3.15k|		last++;
 1042|    364|	if (last == str)
  ------------------
  |  Branch (1042:6): [True: 79, False: 285]
  ------------------
 1043|     79|		return str;
 1044|    285|	--last;
 1045|    285|	while (isspace(CAST(unsigned char, *last)))
  ------------------
  |  Branch (1045:9): [True: 468, False: 285]
  ------------------
 1046|    468|		last--;
 1047|    285|	*++last = '\0';
 1048|    285|	return str;
 1049|    364|}
funcs.c:file_checkfield:
   89|   158k|{
   90|   158k|	const char *p = *pp;
   91|   158k|	int fw = 0;
   92|       |
   93|   169k|	while (*p && isdigit((unsigned char)*p)) {
  ------------------
  |  Branch (93:9): [True: 169k, False: 0]
  |  Branch (93:15): [True: 11.7k, False: 158k]
  ------------------
   94|  11.7k|		fw = fw * 10 + (*p++ - '0');
   95|  11.7k|		if (fw > 1024)
  ------------------
  |  Branch (95:7): [True: 0, False: 11.7k]
  ------------------
   96|      0|			break;
   97|  11.7k|	}
   98|       |
   99|   158k|	*pp = p;
  100|       |
  101|   158k|	if (fw < 1024)
  ------------------
  |  Branch (101:6): [True: 158k, False: 0]
  ------------------
  102|   158k|		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|   158k|}
funcs.c:file_clearbuf:
   81|  8.42k|{
   82|  8.42k|	free(ms->o.buf);
   83|       |	ms->o.buf = NULL;
   84|  8.42k|	ms->o.blen = 0;
   85|  8.42k|}
funcs.c:file_error_core:
  216|    434|{
  217|       |	/* Only the first error is ok */
  218|    434|	if (ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  495|    434|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (218:6): [True: 3, False: 431]
  ------------------
  219|      3|		return;
  220|    431|	if (lineno != 0) {
  ------------------
  |  Branch (220:6): [True: 34, False: 397]
  ------------------
  221|     34|		file_clearbuf(ms);
  222|     34|		(void)file_printf(ms, "line %" SIZE_T_FORMAT "u:", lineno);
  223|     34|	}
  224|    431|	if (ms->o.buf && *ms->o.buf)
  ------------------
  |  Branch (224:6): [True: 37, False: 394]
  |  Branch (224:19): [True: 37, False: 0]
  ------------------
  225|     37|		(void)file_printf(ms, " ");
  226|    431|	(void)file_vprintf(ms, f, va);
  227|    431|	if (error > 0)
  ------------------
  |  Branch (227:6): [True: 0, False: 431]
  ------------------
  228|      0|		(void)file_printf(ms, " (%s)", strerror(error));
  229|    431|	ms->event_flags |= EVENT_HAD_ERR;
  ------------------
  |  |  495|    431|#define 		EVENT_HAD_ERR		0x01
  ------------------
  230|    431|	ms->error = error;
  231|    431|}
funcs.c:checkdone:
  305|  11.0k|{
  306|  11.0k|	if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|  11.0k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (306:6): [True: 0, False: 11.0k]
  ------------------
  307|      0|		return 1;
  308|  11.0k|	if (file_separator(ms) == -1)
  ------------------
  |  Branch (308:6): [True: 0, False: 11.0k]
  ------------------
  309|      0|		*rv = -1;
  310|  11.0k|	return 0;
  311|  11.0k|}
funcs.c:trim_separator:
  286|  12.3k|{
  287|  12.3k|	size_t l;
  288|       |
  289|  12.3k|	if (ms->o.buf == NULL)
  ------------------
  |  Branch (289:6): [True: 0, False: 12.3k]
  ------------------
  290|      0|		return;
  291|       |
  292|  12.3k|	l = strlen(ms->o.buf);
  293|  12.3k|	if (l < sizeof(FILE_SEPARATOR))
  ------------------
  |  |  276|  12.3k|#define FILE_SEPARATOR "\n- "
  ------------------
  |  Branch (293:6): [True: 0, False: 12.3k]
  ------------------
  294|      0|		return;
  295|       |
  296|  12.3k|	l -= sizeof(FILE_SEPARATOR) - 1;
  ------------------
  |  |  276|  12.3k|#define FILE_SEPARATOR "\n- "
  ------------------
  297|  12.3k|	if (strcmp(ms->o.buf + l, FILE_SEPARATOR) != 0)
  ------------------
  |  |  276|  12.3k|#define FILE_SEPARATOR "\n- "
  ------------------
  |  Branch (297:6): [True: 12.3k, False: 0]
  ------------------
  298|  12.3k|		return;
  299|       |
  300|      0|	ms->o.buf[l] = '\0';
  301|      0|}
funcs.c:check_regex:
  693|  43.5k|{
  694|  43.5k|	char sbuf[512];
  695|  43.5k|	unsigned char oc = '\0';
  696|  43.5k|	const char *p;
  697|  43.5k|	unsigned long l;
  698|  43.5k|	static const char wild[] = "?*+{";
  699|       |
  700|   525k|	for (p = pat; *p; p++) {
  ------------------
  |  Branch (700:16): [True: 482k, False: 43.5k]
  ------------------
  701|   482k|		unsigned char c = *p;
  702|       |		// Avoid repetition of wild characters
  703|   482k|		if (strchr(wild, oc) != NULL && strchr(wild, c) != NULL) {
  ------------------
  |  Branch (703:7): [True: 85.3k, False: 396k]
  |  Branch (703:35): [True: 0, False: 85.3k]
  ------------------
  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|   482k|		if (c == '{') {
  ------------------
  |  Branch (711:7): [True: 101, False: 482k]
  ------------------
  712|    101|			char *ep, *eep;
  713|       |
  714|    101|			if (oc == '}') {
  ------------------
  |  Branch (714:8): [True: 0, False: 101]
  ------------------
  715|      0|				file_magwarn(ms, "cascading repetition "
  716|      0|				    "operators in regex `%s'", pat);
  717|      0|				return -1;
  718|      0|			}
  719|    101|			errno = 0;
  720|    101|			l = strtoul(p + 1, &ep, 10);
  721|    101|			if (ep != p + 1 && l > 1000)
  ------------------
  |  Branch (721:8): [True: 77, False: 24]
  |  Branch (721:23): [True: 0, False: 77]
  ------------------
  722|      0|				goto bounds;
  723|    101|			if (*ep == ',') {
  ------------------
  |  Branch (723:8): [True: 28, False: 73]
  ------------------
  724|     28|				l = strtoul(ep + 1, &eep, 10);
  725|     28|				if (eep != ep + 1 && l > 1000)
  ------------------
  |  Branch (725:9): [True: 28, False: 0]
  |  Branch (725:26): [True: 0, False: 28]
  ------------------
  726|      0|					goto bounds;
  727|     28|			}
  728|    101|		}
  729|   482k|		oc = c;
  730|   482k|		if (isprint(c) || isspace(c) || c == '\b'
  ------------------
  |  Branch (730:7): [True: 481k, False: 189]
  |  Branch (730:21): [True: 185, 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|   482k|			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|   482k|	}
  739|  43.5k|	return 0;
  740|      0|bounds:
  741|      0|	file_magwarn(ms, "bounds too large %ld in regex `%s'", l, pat);
  742|      0|	return -1;
  743|  43.5k|}
funcs.c:file_print_guid:
  961|    219|{
  962|    219|#ifndef WIN32
  963|    219|	return snprintf(str, len, "%.8X-%.4hX-%.4hX-%.2hhX%.2hhX-"
  964|    219|	    "%.2hhX%.2hhX%.2hhX%.2hhX%.2hhX%.2hhX",
  965|    219|	    g->data1, g->data2, g->data3, g->data4[0], g->data4[1],
  966|    219|	    g->data4[2], g->data4[3], g->data4[4], g->data4[5],
  967|    219|	    g->data4[6], g->data4[7]);
  968|       |#else
  969|       |	return snprintf(str, len, "%.8X-%.4hX-%.4hX-%.2hX%.2hX-"
  970|       |	    "%.2hX%.2hX%.2hX%.2hX%.2hX%.2hX",
  971|       |	    g->data1, g->data2, g->data3, g->data4[0], g->data4[1],
  972|       |	    g->data4[2], g->data4[3], g->data4[4], g->data4[5],
  973|       |	    g->data4[6], g->data4[7]);
  974|       |#endif
  975|    219|}

file_is_csv:
  137|  12.2k|{
  138|  12.2k|	const unsigned char *uc = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  12.2k|#define CAST(T, b)	((T)(b))
  ------------------
  139|  12.2k|	const unsigned char *ue = uc + b->flen;
  140|  12.2k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  12.2k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  12.2k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  12.2k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  141|       |
  142|  12.2k|	if (!looks_text)
  ------------------
  |  Branch (142:6): [True: 10.0k, False: 2.26k]
  ------------------
  143|  10.0k|		return 0;
  144|       |
  145|  2.26k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  2.26k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  2.26k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (145:6): [True: 0, False: 2.26k]
  ------------------
  146|      0|		return 0;
  147|       |
  148|  2.26k|	if (!csv_parse(uc, ue))
  ------------------
  |  Branch (148:6): [True: 2.25k, False: 9]
  ------------------
  149|  2.25k|		return 0;
  150|       |
  151|      9|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|      9|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (151:6): [True: 0, False: 9]
  ------------------
  152|      0|		return 1;
  153|       |
  154|      9|	if (mime) {
  ------------------
  |  Branch (154:6): [True: 0, False: 9]
  ------------------
  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|      9|	if (file_printf(ms, "CSV %s%stext", code ? code : "",
  ------------------
  |  Branch (160:6): [True: 0, False: 9]
  |  Branch (160:38): [True: 9, False: 0]
  ------------------
  161|      9|	    code ? " " : "") == -1)
  ------------------
  |  Branch (161:6): [True: 9, False: 0]
  ------------------
  162|      0|		return -1;
  163|       |
  164|      9|	return 1;
  165|      9|}
is_csv.c:csv_parse:
   94|  2.26k|{
   95|  2.26k|	size_t nf = 0, tf = 0, nl = 0;
   96|       |
   97|   470M|	while (uc < ue) {
  ------------------
  |  Branch (97:9): [True: 470M, False: 2.07k]
  ------------------
   98|   470M|		switch (*uc++) {
   99|  8.15M|		case '"':
  ------------------
  |  Branch (99:3): [True: 8.15M, False: 462M]
  ------------------
  100|       |			// Eat until the matching quote
  101|  8.15M|			uc = eatquote(uc, ue);
  102|  8.15M|			break;
  103|  37.5M|		case ',':
  ------------------
  |  Branch (103:3): [True: 37.5M, False: 433M]
  ------------------
  104|  37.5M|			nf++;
  105|  37.5M|			break;
  106|    403|		case '\n':
  ------------------
  |  Branch (106:3): [True: 403, False: 470M]
  ------------------
  107|    403|			DPRINTF("nl=%zu nf=%zu tf=%zu\n", nl, nf, tf);
  108|    403|			nl++;
  109|    403|#if CSV_LINES
  110|    403|			if (nl == CSV_LINES)
  ------------------
  |  |   62|    403|#define CSV_LINES 10
  ------------------
  |  Branch (110:8): [True: 14, False: 389]
  ------------------
  111|     14|				return tf > 1 && tf == nf;
  ------------------
  |  Branch (111:12): [True: 11, False: 3]
  |  Branch (111:22): [True: 1, False: 10]
  ------------------
  112|    389|#endif
  113|    389|			if (tf == 0) {
  ------------------
  |  Branch (113:8): [True: 214, False: 175]
  ------------------
  114|       |				// First time and no fields, give up
  115|    214|				if (nf == 0) 
  ------------------
  |  Branch (115:9): [True: 135, False: 79]
  ------------------
  116|    135|					return 0;
  117|       |				// First time, set the number of fields
  118|     79|				tf = nf;
  119|    175|			} else if (tf != nf) {
  ------------------
  |  Branch (119:15): [True: 39, False: 136]
  ------------------
  120|       |				// Field number mismatch, we are done.
  121|     39|				return 0;
  122|     39|			}
  123|    215|			nf = 0;
  124|    215|			break;
  125|   424M|		default:
  ------------------
  |  Branch (125:3): [True: 424M, False: 45.6M]
  ------------------
  126|   424M|			break;
  127|   470M|		}
  128|   470M|	}
  129|  2.07k|	DPRINTF("tf=%zu>1 nl=%zu>=2\n", tf, nl);
  130|  2.07k|	return tf >= 1 && nl >= 2;
  ------------------
  |  Branch (130:9): [True: 26, False: 2.04k]
  |  Branch (130:20): [True: 8, False: 18]
  ------------------
  131|  2.26k|}
is_csv.c:eatquote:
   69|  8.15M|{
   70|  8.15M|	int quote = 0;
   71|       |
   72|   123M|	while (uc < ue) {
  ------------------
  |  Branch (72:9): [True: 123M, False: 202]
  ------------------
   73|   123M|		unsigned char c = *uc++;
   74|   123M|		if (c != '"') {
  ------------------
  |  Branch (74:7): [True: 114M, False: 8.23M]
  ------------------
   75|       |			// We already got one, done.
   76|   114M|			if (quote) {
  ------------------
  |  Branch (76:8): [True: 8.15M, False: 106M]
  ------------------
   77|  8.15M|				return --uc;
   78|  8.15M|			}
   79|   106M|			continue;
   80|   114M|		}
   81|  8.23M|		if (quote) {
  ------------------
  |  Branch (81:7): [True: 38.2k, False: 8.19M]
  ------------------
   82|       |			// quote-quote escapes
   83|  38.2k|			quote = 0;
   84|  38.2k|			continue;
   85|  38.2k|		}
   86|       |		// first quote
   87|  8.19M|		quote = 1;
   88|  8.19M|	}
   89|    202|	return ue;
   90|  8.15M|}

file_is_json:
  423|  12.2k|{
  424|  12.2k|	const unsigned char *uc = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  12.2k|#define CAST(T, b)	((T)(b))
  ------------------
  425|  12.2k|	const unsigned char *ue = uc + b->flen;
  426|  12.2k|	size_t st[JSON_MAX];
  427|  12.2k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  12.2k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  12.2k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  12.2k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
  428|  12.2k|	int jt;
  429|       |
  430|       |
  431|  12.2k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  12.2k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  12.2k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (431:6): [True: 0, False: 12.2k]
  ------------------
  432|      0|		return 0;
  433|       |
  434|  12.2k|	memset(st, 0, sizeof(st));
  435|       |
  436|  12.2k|	if ((jt = json_parse(&uc, ue, st, 0)) == 0)
  ------------------
  |  Branch (436:6): [True: 12.2k, False: 34]
  ------------------
  437|  12.2k|		return 0;
  438|       |
  439|     34|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     34|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (439:6): [True: 0, False: 34]
  ------------------
  440|      0|		return 1;
  441|     34|	if (mime) {
  ------------------
  |  Branch (441:6): [True: 0, False: 34]
  ------------------
  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|     34|	if (file_printf(ms, "%sJSON text data",
  ------------------
  |  Branch (447:6): [True: 0, False: 34]
  ------------------
  448|     34|	    jt == 1 ? "" : "New Line Delimited ") == -1)
  ------------------
  |  Branch (448:6): [True: 25, False: 9]
  ------------------
  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|     34|	return 1;
  462|     34|}
is_json.c:json_parse:
  348|  11.7M|{
  349|  11.7M|	const unsigned char *uc, *ouc;
  350|  11.7M|	int rv = 0;
  351|  11.7M|	int t;
  352|       |
  353|  11.7M|	ouc = uc = json_skip_space(*ucp, ue);
  354|  11.7M|	if (uc == ue)
  ------------------
  |  Branch (354:6): [True: 98, False: 11.7M]
  ------------------
  355|     98|		goto out;
  356|       |
  357|       |	// Avoid recursion
  358|  11.7M|	if (lvl > 500) {
  ------------------
  |  Branch (358:6): [True: 10, False: 11.7M]
  ------------------
  359|     10|		DPRINTF("Too many levels", uc, *ucp);
  ------------------
  |  |   52|     10|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 10]
  |  |  ------------------
  ------------------
  360|     10|		return 0;
  361|     10|	}
  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|  11.7M|	DPRINTF("Parse general: ", uc, *ucp);
  ------------------
  |  |   52|  11.7M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 11.7M]
  |  |  ------------------
  ------------------
  369|  11.7M|	switch (*uc++) {
  370|  3.13M|	case '"':
  ------------------
  |  Branch (370:2): [True: 3.13M, False: 8.61M]
  ------------------
  371|  3.13M|		rv = json_parse_string(&uc, ue, lvl + 1);
  372|  3.13M|		t = JSON_STRING;
  ------------------
  |  |   60|  3.13M|#define JSON_STRING	4
  ------------------
  373|  3.13M|		break;
  374|  1.46M|	case '[':
  ------------------
  |  Branch (374:2): [True: 1.46M, False: 10.2M]
  ------------------
  375|  1.46M|		rv = json_parse_array(&uc, ue, st, lvl + 1);
  376|  1.46M|		t = JSON_ARRAY;
  ------------------
  |  |   56|  1.46M|#define JSON_ARRAY	0
  ------------------
  377|  1.46M|		break;
  378|   104k|	case '{': /* '}' */
  ------------------
  |  Branch (378:2): [True: 104k, False: 11.6M]
  ------------------
  379|   104k|		rv = json_parse_object(&uc, ue, st, lvl + 1);
  380|   104k|		t = JSON_OBJECT;
  ------------------
  |  |   59|   104k|#define JSON_OBJECT	3
  ------------------
  381|   104k|		break;
  382|    366|	case 't':
  ------------------
  |  Branch (382:2): [True: 366, False: 11.7M]
  ------------------
  383|    366|		rv = json_parse_const(&uc, ue, "true", sizeof("true"), lvl + 1);
  384|    366|		t = JSON_CONSTANT;
  ------------------
  |  |   57|    366|#define JSON_CONSTANT	1
  ------------------
  385|    366|		break;
  386|    286|	case 'f':
  ------------------
  |  Branch (386:2): [True: 286, False: 11.7M]
  ------------------
  387|    286|		rv = json_parse_const(&uc, ue, "false", sizeof("false"),
  388|    286|		    lvl + 1);
  389|    286|		t = JSON_CONSTANT;
  ------------------
  |  |   57|    286|#define JSON_CONSTANT	1
  ------------------
  390|    286|		break;
  391|  2.38M|	case 'n':
  ------------------
  |  Branch (391:2): [True: 2.38M, False: 9.36M]
  ------------------
  392|  2.38M|		rv = json_parse_const(&uc, ue, "null", sizeof("null"), lvl + 1);
  393|  2.38M|		t = JSON_CONSTANT;
  ------------------
  |  |   57|  2.38M|#define JSON_CONSTANT	1
  ------------------
  394|  2.38M|		break;
  395|  4.65M|	default:
  ------------------
  |  Branch (395:2): [True: 4.65M, False: 7.09M]
  ------------------
  396|  4.65M|		--uc;
  397|  4.65M|		rv = json_parse_number(&uc, ue, lvl + 1);
  398|  4.65M|		t = JSON_NUMBER;
  ------------------
  |  |   58|  4.65M|#define JSON_NUMBER	2
  ------------------
  399|  4.65M|		break;
  400|  11.7M|	}
  401|  11.7M|	if (rv)
  ------------------
  |  Branch (401:6): [True: 11.7M, False: 17.8k]
  ------------------
  402|  11.7M|		st[t]++;
  403|  11.7M|	uc = json_skip_space(uc, ue);
  404|  11.7M|out:
  405|  11.7M|	DPRINTF("End general: ", uc, *ucp);
  ------------------
  |  |   52|  11.7M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 11.7M]
  |  |  ------------------
  ------------------
  406|  11.7M|	*ucp = uc;
  407|  11.7M|	if (lvl == 0) {
  ------------------
  |  Branch (407:6): [True: 12.2k, False: 11.7M]
  ------------------
  408|  12.2k|		if (!rv)
  ------------------
  |  Branch (408:7): [True: 11.9k, False: 365]
  ------------------
  409|  11.9k|			return 0;
  410|    365|		if (uc == ue)
  ------------------
  |  Branch (410:7): [True: 120, False: 245]
  ------------------
  411|    120|			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 1 : 0;
  ------------------
  |  |   61|    120|#define JSON_ARRAYN	5
  ------------------
              			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 1 : 0;
  ------------------
  |  |   59|    106|#define JSON_OBJECT	3
  ------------------
  |  Branch (411:12): [True: 14, False: 106]
  |  Branch (411:31): [True: 11, False: 95]
  ------------------
  412|    245|		if (*ouc == *uc && json_parse(&uc, ue, st, 1))
  ------------------
  |  Branch (412:7): [True: 60, False: 185]
  |  Branch (412:22): [True: 42, False: 18]
  ------------------
  413|     42|			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 2 : 0;
  ------------------
  |  |   61|     42|#define JSON_ARRAYN	5
  ------------------
              			return (st[JSON_ARRAYN] || st[JSON_OBJECT]) ? 2 : 0;
  ------------------
  |  |   59|     36|#define JSON_OBJECT	3
  ------------------
  |  Branch (413:12): [True: 6, False: 36]
  |  Branch (413:31): [True: 3, False: 33]
  ------------------
  414|    203|		else
  415|    203|			return 0;
  416|    245|	}
  417|  11.7M|	return rv;
  418|  11.7M|}
is_json.c:json_skip_space:
  119|  36.9M|{
  120|  49.4M|	while (uc < ue && json_isspace(*uc))
  ------------------
  |  Branch (120:9): [True: 49.4M, False: 3.76k]
  |  Branch (120:20): [True: 12.4M, False: 36.9M]
  ------------------
  121|  12.4M|		uc++;
  122|  36.9M|	return uc;
  123|  36.9M|}
is_json.c:json_isspace:
   79|  49.4M|{
   80|  49.4M|	switch (uc) {
   81|   249k|	case ' ':
  ------------------
  |  Branch (81:2): [True: 249k, False: 49.1M]
  ------------------
   82|  1.18M|	case '\n':
  ------------------
  |  Branch (82:2): [True: 935k, False: 48.4M]
  ------------------
   83|  10.6M|	case '\r':
  ------------------
  |  Branch (83:2): [True: 9.48M, False: 39.9M]
  ------------------
   84|  12.4M|	case '\t':
  ------------------
  |  Branch (84:2): [True: 1.81M, False: 47.5M]
  ------------------
   85|  12.4M|		return 1;
   86|  36.9M|	default:
  ------------------
  |  Branch (86:2): [True: 36.9M, False: 12.4M]
  ------------------
   87|  36.9M|		return 0;
   88|  49.4M|	}
   89|  49.4M|}
is_json.c:json_parse_string:
  129|  3.25M|{
  130|  3.25M|	const unsigned char *uc = *ucp;
  131|  3.25M|	size_t i;
  132|       |
  133|  3.25M|	DPRINTF("Parse string: ", uc, *ucp);
  ------------------
  |  |   52|  3.25M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 3.25M]
  |  |  ------------------
  ------------------
  134|  77.5M|	while (uc < ue) {
  ------------------
  |  Branch (134:9): [True: 77.5M, False: 119]
  ------------------
  135|  77.5M|		switch (*uc++) {
  136|      6|		case '\0':
  ------------------
  |  Branch (136:3): [True: 6, False: 77.5M]
  ------------------
  137|      6|			goto out;
  138|  45.1M|		case '\\':
  ------------------
  |  Branch (138:3): [True: 45.1M, False: 32.3M]
  ------------------
  139|  45.1M|			if (uc == ue)
  ------------------
  |  Branch (139:8): [True: 21, False: 45.1M]
  ------------------
  140|     21|				goto out;
  141|  45.1M|			switch (*uc++) {
  142|      0|			case '\0':
  ------------------
  |  Branch (142:4): [True: 0, False: 45.1M]
  ------------------
  143|      0|				goto out;
  144|  3.01M|			case '"':
  ------------------
  |  Branch (144:4): [True: 3.01M, False: 42.1M]
  ------------------
  145|  10.1M|			case '\\':
  ------------------
  |  Branch (145:4): [True: 7.08M, False: 38.0M]
  ------------------
  146|  18.2M|			case '/':
  ------------------
  |  Branch (146:4): [True: 8.16M, False: 36.9M]
  ------------------
  147|  20.9M|			case 'b':
  ------------------
  |  Branch (147:4): [True: 2.69M, False: 42.4M]
  ------------------
  148|  26.4M|			case 'f':
  ------------------
  |  Branch (148:4): [True: 5.46M, False: 39.6M]
  ------------------
  149|  32.1M|			case 'n':
  ------------------
  |  Branch (149:4): [True: 5.71M, False: 39.4M]
  ------------------
  150|  34.9M|			case 'r':
  ------------------
  |  Branch (150:4): [True: 2.76M, False: 42.3M]
  ------------------
  151|  43.8M|			case 't':
  ------------------
  |  Branch (151:4): [True: 8.93M, False: 36.2M]
  ------------------
  152|  43.8M|				continue;
  153|  1.29M|			case 'u':
  ------------------
  |  Branch (153:4): [True: 1.29M, False: 43.8M]
  ------------------
  154|  1.29M|				if (ue - uc < 4) {
  ------------------
  |  Branch (154:9): [True: 8, False: 1.29M]
  ------------------
  155|      8|					uc = ue;
  156|      8|					goto out;
  157|      8|				}
  158|  6.49M|				for (i = 0; i < 4; i++)
  ------------------
  |  Branch (158:17): [True: 5.19M, False: 1.29M]
  ------------------
  159|  5.19M|					if (!json_isxdigit(*uc++))
  ------------------
  |  Branch (159:10): [True: 24, False: 5.19M]
  ------------------
  160|     24|						goto out;
  161|  1.29M|				continue;
  162|  1.29M|			default:
  ------------------
  |  Branch (162:4): [True: 6, False: 45.1M]
  ------------------
  163|      6|				goto out;
  164|  45.1M|			}
  165|  3.25M|		case '"':
  ------------------
  |  Branch (165:3): [True: 3.25M, False: 74.2M]
  ------------------
  166|  3.25M|			DPRINTF("Good string: ", uc, *ucp);
  ------------------
  |  |   52|  3.25M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 3.25M]
  |  |  ------------------
  ------------------
  167|  3.25M|			*ucp = uc;
  168|  3.25M|			return 1;
  169|  29.1M|		default:
  ------------------
  |  Branch (169:3): [True: 29.1M, False: 48.4M]
  ------------------
  170|  29.1M|			continue;
  171|  77.5M|		}
  172|  77.5M|	}
  173|    184|out:
  174|    184|	DPRINTF("Bad string: ", uc, *ucp);
  ------------------
  |  |   52|    184|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 184]
  |  |  ------------------
  ------------------
  175|    184|	*ucp = uc;
  176|    184|	return 0;
  177|  3.25M|}
is_json.c:json_isxdigit:
  105|  5.19M|{
  106|  5.19M|	if (json_isdigit(uc))
  ------------------
  |  Branch (106:6): [True: 1.29M, False: 3.90M]
  ------------------
  107|  1.29M|		return 1;
  108|  3.90M|	switch (uc) {
  109|  1.30M|	case 'a': case 'b': case 'c': case 'd': case 'e': case 'f':
  ------------------
  |  Branch (109:2): [True: 444k, False: 3.45M]
  |  Branch (109:12): [True: 545, False: 3.89M]
  |  Branch (109:22): [True: 4.45k, False: 3.89M]
  |  Branch (109:32): [True: 447k, False: 3.45M]
  |  Branch (109:42): [True: 11.7k, False: 3.88M]
  |  Branch (109:52): [True: 398k, False: 3.50M]
  ------------------
  110|  3.90M|	case 'A': case 'B': case 'C': case 'D': case 'E': case 'F':
  ------------------
  |  Branch (110:2): [True: 848k, False: 3.05M]
  |  Branch (110:12): [True: 3.98k, False: 3.89M]
  |  Branch (110:22): [True: 1.73M, False: 2.16M]
  |  Branch (110:32): [True: 726, False: 3.89M]
  |  Branch (110:42): [True: 3.60k, False: 3.89M]
  |  Branch (110:52): [True: 386, False: 3.89M]
  ------------------
  111|  3.90M|		return 1;
  112|     24|	default:
  ------------------
  |  Branch (112:2): [True: 24, False: 3.90M]
  ------------------
  113|     24|		return 0;
  114|  3.90M|	}
  115|  3.90M|}
is_json.c:json_isdigit:
   93|  61.0M|{
   94|  61.0M|	switch (uc) {
   95|  43.2M|	case '0': case '1': case '2': case '3': case '4':
  ------------------
  |  Branch (95:2): [True: 34.3M, False: 26.6M]
  |  Branch (95:12): [True: 6.01M, False: 54.9M]
  |  Branch (95:22): [True: 2.89M, False: 58.1M]
  |  Branch (95:32): [True: 18.1k, False: 60.9M]
  |  Branch (95:42): [True: 32, False: 61.0M]
  ------------------
   96|  44.8M|	case '5': case '6': case '7': case '8': case '9':
  ------------------
  |  Branch (96:2): [True: 65.0k, False: 60.9M]
  |  Branch (96:12): [True: 352k, False: 60.6M]
  |  Branch (96:22): [True: 1.16M, False: 59.8M]
  |  Branch (96:32): [True: 23, False: 61.0M]
  |  Branch (96:42): [True: 11.1k, False: 60.9M]
  ------------------
   97|  44.8M|		return 1;
   98|  16.1M|	default:
  ------------------
  |  Branch (98:2): [True: 16.1M, False: 44.8M]
  ------------------
   99|  16.1M|		return 0;
  100|  61.0M|	}
  101|  61.0M|}
is_json.c:json_parse_array:
  182|  1.46M|{
  183|  1.46M|	const unsigned char *uc = *ucp;
  184|       |
  185|  1.46M|	DPRINTF("Parse array: ", uc, *ucp);
  ------------------
  |  |   52|  1.46M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.46M]
  |  |  ------------------
  ------------------
  186|  13.0M|	while (uc < ue) {
  ------------------
  |  Branch (186:9): [True: 13.0M, False: 42]
  ------------------
  187|  13.0M|		uc = json_skip_space(uc, ue);
  188|  13.0M|		if (uc == ue)
  ------------------
  |  Branch (188:7): [True: 15, False: 13.0M]
  ------------------
  189|     15|			goto out;
  190|  13.0M|		if (*uc == ']')
  ------------------
  |  Branch (190:7): [True: 1.46M, False: 11.6M]
  ------------------
  191|  1.46M|			goto done;
  192|  11.6M|		if (!json_parse(&uc, ue, st, lvl + 1))
  ------------------
  |  Branch (192:7): [True: 5.68k, False: 11.6M]
  ------------------
  193|  5.68k|			goto out;
  194|  11.6M|		if (uc == ue)
  ------------------
  |  Branch (194:7): [True: 48, False: 11.6M]
  ------------------
  195|     48|			goto out;
  196|  11.6M|		switch (*uc) {
  197|  11.6M|		case ',':
  ------------------
  |  Branch (197:3): [True: 11.6M, False: 393]
  ------------------
  198|  11.6M|			uc++;
  199|  11.6M|			continue;
  200|    379|		case ']':
  ------------------
  |  Branch (200:3): [True: 379, False: 11.6M]
  ------------------
  201|  1.46M|		done:
  202|  1.46M|			st[JSON_ARRAYN]++;
  ------------------
  |  |   61|  1.46M|#define JSON_ARRAYN	5
  ------------------
  203|  1.46M|			DPRINTF("Good array: ", uc, *ucp);
  ------------------
  |  |   52|  1.46M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 1.46M]
  |  |  ------------------
  ------------------
  204|  1.46M|			*ucp = uc + 1;
  205|  1.46M|			return 1;
  206|     14|		default:
  ------------------
  |  Branch (206:3): [True: 14, False: 11.6M]
  ------------------
  207|     14|			goto out;
  208|  11.6M|		}
  209|  11.6M|	}
  210|  5.80k|out:
  211|  5.80k|	DPRINTF("Bad array: ", uc,  *ucp);
  ------------------
  |  |   52|  5.80k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 5.80k]
  |  |  ------------------
  ------------------
  212|  5.80k|	*ucp = uc;
  213|  5.80k|	return 0;
  214|  1.46M|}
is_json.c:json_parse_object:
  219|   104k|{
  220|   104k|	const unsigned char *uc = *ucp;
  221|   104k|	DPRINTF("Parse object: ", uc, *ucp);
  ------------------
  |  |   52|   104k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 104k]
  |  |  ------------------
  ------------------
  222|   227k|	while (uc < ue) {
  ------------------
  |  Branch (222:9): [True: 227k, False: 7]
  ------------------
  223|   227k|		uc = json_skip_space(uc, ue);
  224|   227k|		if (uc == ue)
  ------------------
  |  Branch (224:7): [True: 14, False: 227k]
  ------------------
  225|     14|			goto out;
  226|   227k|		if (*uc == '}') {
  ------------------
  |  Branch (226:7): [True: 104k, False: 123k]
  ------------------
  227|   104k|			uc++;
  228|   104k|			goto done;
  229|   104k|		}
  230|   123k|		if (*uc++ != '"') {
  ------------------
  |  Branch (230:7): [True: 29, False: 123k]
  ------------------
  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|   123k|		DPRINTF("next field", uc, *ucp);
  ------------------
  |  |   52|   123k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 123k]
  |  |  ------------------
  ------------------
  235|   123k|		if (!json_parse_string(&uc, ue, lvl)) {
  ------------------
  |  Branch (235:7): [True: 5, False: 123k]
  ------------------
  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|   123k|		uc = json_skip_space(uc, ue);
  240|   123k|		if (uc == ue)
  ------------------
  |  Branch (240:7): [True: 14, False: 123k]
  ------------------
  241|     14|			goto out;
  242|   123k|		if (*uc++ != ':') {
  ------------------
  |  Branch (242:7): [True: 25, False: 123k]
  ------------------
  243|     25|			DPRINTF("not colon", uc, *ucp);
  ------------------
  |  |   52|     25|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 25]
  |  |  ------------------
  ------------------
  244|     25|			goto out;
  245|     25|		}
  246|   123k|		if (!json_parse(&uc, ue, st, lvl + 1)) {
  ------------------
  |  Branch (246:7): [True: 379, False: 122k]
  ------------------
  247|    379|			DPRINTF("not json", uc, *ucp);
  ------------------
  |  |   52|    379|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 379]
  |  |  ------------------
  ------------------
  248|    379|			goto out;
  249|    379|		}
  250|   122k|		if (uc == ue)
  ------------------
  |  Branch (250:7): [True: 3, False: 122k]
  ------------------
  251|      3|			goto out;
  252|   122k|		switch (*uc++) {
  253|   122k|		case ',':
  ------------------
  |  Branch (253:3): [True: 122k, False: 199]
  ------------------
  254|   122k|			continue;
  255|    196|		case '}': /* { */
  ------------------
  |  Branch (255:3): [True: 196, False: 122k]
  ------------------
  256|   104k|		done:
  257|   104k|			DPRINTF("Good object: ", uc, *ucp);
  ------------------
  |  |   52|   104k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 104k]
  |  |  ------------------
  ------------------
  258|   104k|			*ucp = uc;
  259|   104k|			return 1;
  260|      3|		default:
  ------------------
  |  Branch (260:3): [True: 3, False: 122k]
  ------------------
  261|      3|			DPRINTF("not more", uc, *ucp);
  ------------------
  |  |   52|      3|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 3]
  |  |  ------------------
  ------------------
  262|      3|			*ucp = uc - 1;
  263|      3|			goto out;
  264|   122k|		}
  265|   122k|	}
  266|    479|out:
  267|    479|	DPRINTF("Bad object: ", uc, *ucp);
  ------------------
  |  |   52|    479|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 479]
  |  |  ------------------
  ------------------
  268|    479|	*ucp = uc;
  269|    479|	return 0;
  270|   104k|}
is_json.c:json_parse_const:
  328|  2.38M|{
  329|  2.38M|	const unsigned char *uc = *ucp;
  330|       |
  331|  2.38M|	DPRINTF("Parse const: ", uc, *ucp);
  ------------------
  |  |   52|  2.38M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 2.38M]
  |  |  ------------------
  ------------------
  332|  2.38M|	*ucp += --len - 1;
  333|  2.38M|	if (*ucp > ue)
  ------------------
  |  Branch (333:6): [True: 54, False: 2.38M]
  ------------------
  334|     54|		*ucp = ue;
  335|  9.54M|	for (; uc < ue && --len;) {
  ------------------
  |  Branch (335:9): [True: 9.54M, False: 51]
  |  Branch (335:20): [True: 7.15M, False: 2.38M]
  ------------------
  336|  7.15M|		if (*uc++ != *++str) {
  ------------------
  |  Branch (336:7): [True: 85, False: 7.15M]
  ------------------
  337|     85|			DPRINTF("Bad const: ", uc, *ucp);
  ------------------
  |  |   52|     85|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 85]
  |  |  ------------------
  ------------------
  338|     85|			return 0;
  339|     85|		}
  340|  7.15M|	}
  341|  2.38M|	DPRINTF("Good const: ", uc, *ucp);
  ------------------
  |  |   52|  2.38M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 2.38M]
  |  |  ------------------
  ------------------
  342|  2.38M|	return 1;
  343|  2.38M|}
is_json.c:json_parse_number:
  276|  4.65M|{
  277|  4.65M|	const unsigned char *uc = *ucp;
  278|  4.65M|	int got = 0;
  279|       |
  280|  4.65M|	DPRINTF("Parse number: ", uc, *ucp);
  ------------------
  |  |   52|  4.65M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 4.65M]
  |  |  ------------------
  ------------------
  281|  4.65M|	if (uc == ue)
  ------------------
  |  Branch (281:6): [True: 0, False: 4.65M]
  ------------------
  282|      0|		return 0;
  283|  4.65M|	if (*uc == '-')
  ------------------
  |  Branch (283:6): [True: 602k, False: 4.05M]
  ------------------
  284|   602k|		uc++;
  285|       |
  286|  38.5M|	for (; uc < ue; uc++) {
  ------------------
  |  Branch (286:9): [True: 38.5M, False: 61]
  ------------------
  287|  38.5M|		if (!json_isdigit(*uc))
  ------------------
  |  Branch (287:7): [True: 4.65M, False: 33.8M]
  ------------------
  288|  4.65M|			break;
  289|  33.8M|		got = 1;
  290|  33.8M|	}
  291|  4.65M|	if (uc == ue)
  ------------------
  |  Branch (291:6): [True: 61, False: 4.65M]
  ------------------
  292|     61|		goto out;
  293|  4.65M|	if (*uc == '.')
  ------------------
  |  Branch (293:6): [True: 1.32M, False: 3.33M]
  ------------------
  294|  1.32M|		uc++;
  295|  11.3M|	for (; uc < ue; uc++) {
  ------------------
  |  Branch (295:9): [True: 11.3M, False: 25]
  ------------------
  296|  11.3M|		if (!json_isdigit(*uc))
  ------------------
  |  Branch (296:7): [True: 4.65M, False: 6.72M]
  ------------------
  297|  4.65M|			break;
  298|  6.72M|		got = 1;
  299|  6.72M|	}
  300|  4.65M|	if (uc == ue)
  ------------------
  |  Branch (300:6): [True: 25, False: 4.65M]
  ------------------
  301|     25|		goto out;
  302|  4.65M|	if (got && (*uc == 'e' || *uc == 'E')) {
  ------------------
  |  Branch (302:6): [True: 4.64M, False: 11.2k]
  |  Branch (302:14): [True: 2.92M, False: 1.72M]
  |  Branch (302:28): [True: 11.3k, False: 1.71M]
  ------------------
  303|  2.93M|		uc++;
  304|  2.93M|		got = 0;
  305|  2.93M|		if (uc == ue)
  ------------------
  |  Branch (305:7): [True: 12, False: 2.93M]
  ------------------
  306|     12|			goto out;
  307|  2.93M|		if (*uc == '+' || *uc == '-')
  ------------------
  |  Branch (307:7): [True: 1.27M, False: 1.65M]
  |  Branch (307:21): [True: 1.33M, False: 318k]
  ------------------
  308|  2.61M|			uc++;
  309|  5.92M|		for (; uc < ue; uc++) {
  ------------------
  |  Branch (309:10): [True: 5.92M, False: 22]
  ------------------
  310|  5.92M|			if (!json_isdigit(*uc))
  ------------------
  |  Branch (310:8): [True: 2.93M, False: 2.99M]
  ------------------
  311|  2.93M|				break;
  312|  2.99M|			got = 1;
  313|  2.99M|		}
  314|  2.93M|	}
  315|  4.65M|out:
  316|  4.65M|	if (!got)
  ------------------
  |  Branch (316:6): [True: 11.3k, False: 4.64M]
  ------------------
  317|  11.3k|		DPRINTF("Bad number: ", uc, *ucp);
  ------------------
  |  |   52|  11.3k|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 11.3k]
  |  |  ------------------
  ------------------
  318|  4.64M|	else
  319|  4.64M|		DPRINTF("Good number: ", uc, *ucp);
  ------------------
  |  |   52|  4.64M|#define DPRINTF(a, b, c)	do { } while (/*CONSTCOND*/0)
  |  |  ------------------
  |  |  |  Branch (52:53): [Folded, False: 4.64M]
  |  |  ------------------
  ------------------
  320|  4.65M|	*ucp = uc;
  321|  4.65M|	return got;
  322|  4.65M|}

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

file_is_tar:
   64|  12.2k|{
   65|  12.2k|	const unsigned char *buf = CAST(const unsigned char *, b->fbuf);
  ------------------
  |  |  460|  12.2k|#define CAST(T, b)	((T)(b))
  ------------------
   66|  12.2k|	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|  12.2k|	int tar;
   72|  12.2k|	int mime = ms->flags & MAGIC_MIME;
  ------------------
  |  |   44|  12.2k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   37|  12.2k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  ------------------
  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  ------------------
  |  |  |  |   43|  12.2k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  ------------------
  ------------------
   73|       |
   74|  12.2k|	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   45|  12.2k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
              	if ((ms->flags & (MAGIC_APPLE|MAGIC_EXTENSION)) != 0)
  ------------------
  |  |   46|  12.2k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (74:6): [True: 0, False: 12.2k]
  ------------------
   75|      0|		return 0;
   76|       |
   77|  12.2k|	tar = is_tar(buf, nbytes);
   78|  12.2k|	if (tar < 1 || tar > 3)
  ------------------
  |  Branch (78:6): [True: 12.2k, False: 42]
  |  Branch (78:17): [True: 0, False: 42]
  ------------------
   79|  12.2k|		return 0;
   80|       |
   81|     42|	if (mime == MAGIC_MIME_ENCODING)
  ------------------
  |  |   43|     42|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  ------------------
  |  Branch (81:6): [True: 0, False: 42]
  ------------------
   82|      0|		return 1;
   83|       |
   84|     42|	if (file_printf(ms, "%s", mime ? "application/x-tar" :
  ------------------
  |  Branch (84:6): [True: 0, False: 42]
  |  Branch (84:28): [True: 0, False: 42]
  ------------------
   85|     42|	    tartype[tar - 1]) == -1)
   86|      0|		return -1;
   87|       |
   88|     42|	return 1;
   89|     42|}
is_tar.c:is_tar:
  100|  12.2k|{
  101|  12.2k|	static const char gpkg_match[] = "/gpkg-1";
  102|       |
  103|  12.2k|	const union record *header = RCAST(const union record *,
  ------------------
  |  |  461|  12.2k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  104|  12.2k|	    RCAST(const void *, buf));
  105|  12.2k|	size_t i;
  106|  12.2k|	int sum, recsum;
  107|  12.2k|	const unsigned char *p, *ep;
  108|  12.2k|	const char *nulp;
  109|       |
  110|  12.2k|	if (nbytes < sizeof(*header))
  ------------------
  |  Branch (110:6): [True: 8.20k, False: 4.06k]
  ------------------
  111|  8.20k|		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.06k|	nulp = CAST(const char *,
  ------------------
  |  |  460|  4.06k|#define CAST(T, b)	((T)(b))
  ------------------
  117|  4.06k|	    memchr(header->header.name, 0, sizeof(header->header.name)));
  118|  4.06k|	if (nulp != NULL && nulp >= header->header.name + sizeof(gpkg_match) &&
  ------------------
  |  Branch (118:6): [True: 3.57k, False: 492]
  |  Branch (118:22): [True: 2.46k, False: 1.10k]
  ------------------
  119|  2.46k|	    memcmp(nulp - sizeof(gpkg_match) + 1, gpkg_match,
  ------------------
  |  Branch (119:6): [True: 6, False: 2.46k]
  ------------------
  120|  2.46k|	    sizeof(gpkg_match)) == 0)
  121|      6|	    return 0;
  122|       |
  123|  4.05k|	recsum = from_oct(header->header.chksum, sizeof(header->header.chksum));
  124|       |
  125|  4.05k|	sum = 0;
  126|  4.05k|	p = header->charptr;
  127|  4.05k|	ep = header->charptr + sizeof(*header);
  128|  2.08M|	while (p < ep)
  ------------------
  |  Branch (128:9): [True: 2.07M, False: 4.05k]
  ------------------
  129|  2.07M|		sum += *p++;
  130|       |
  131|       |	/* Adjust checksum to count the "chksum" field as blanks. */
  132|  36.5k|	for (i = 0; i < sizeof(header->header.chksum); i++)
  ------------------
  |  Branch (132:14): [True: 32.4k, False: 4.05k]
  ------------------
  133|  32.4k|		sum -= header->header.chksum[i];
  134|  4.05k|	sum += ' ' * sizeof(header->header.chksum);
  135|       |
  136|  4.05k|	if (sum != recsum)
  ------------------
  |  Branch (136:6): [True: 4.01k, False: 42]
  ------------------
  137|  4.01k|		return 0;	/* Not a tar archive */
  138|       |
  139|     42|	if (strncmp(header->header.magic, GNUTMAGIC,
  ------------------
  |  |   73|     42|#define	GNUTMAGIC	"ustar  "	/* 7 chars and a null */
  ------------------
  |  Branch (139:6): [True: 3, False: 39]
  ------------------
  140|     42|	    sizeof(header->header.magic)) == 0)
  141|      3|		return 3;		/* GNU Unix Standard tar archive */
  142|       |
  143|     39|	if (strncmp(header->header.magic, TMAGIC,
  ------------------
  |  |   72|     39|#define	TMAGIC		"ustar"		/* 5 chars and a null */
  ------------------
  |  Branch (143:6): [True: 3, False: 36]
  ------------------
  144|     39|	    sizeof(header->header.magic)) == 0)
  145|      3|		return 2;		/* Unix Standard tar archive */
  146|       |
  147|     36|	return 1;			/* Old fashioned tar archive */
  148|     39|}
is_tar.c:from_oct:
  158|  4.05k|{
  159|  4.05k|	int	value;
  160|       |
  161|  4.70k|	while (digs > 0 && isspace(CAST(unsigned char, *where))) {	/* Skip spaces */
  ------------------
  |  Branch (161:9): [True: 4.64k, False: 61]
  |  Branch (161:21): [True: 647, False: 3.99k]
  ------------------
  162|    647|		where++;
  163|    647|		digs--;
  164|    647|	}
  165|  4.05k|	if (digs == 0)
  ------------------
  |  Branch (165:6): [True: 61, False: 3.99k]
  ------------------
  166|     61|		return -1;		/* All blank field */
  167|  3.99k|	value = 0;
  168|  4.70k|	while (digs > 0 && isodigit(*where)) {	/* Scan til non-octal */
  ------------------
  |  |   51|  4.65k|#define	isodigit(c)	( ((c) >= '0') && ((c) <= '7') )
  |  |  ------------------
  |  |  |  Branch (51:23): [True: 1.56k, False: 3.09k]
  |  |  |  Branch (51:39): [True: 708, False: 853]
  |  |  ------------------
  ------------------
  |  Branch (168:9): [True: 4.65k, False: 53]
  ------------------
  169|    708|		value = (value << 3) | (*where++ - '0');
  170|    708|		digs--;
  171|    708|	}
  172|       |
  173|  3.99k|	if (digs > 0 && *where && !isspace(CAST(unsigned char, *where)))
  ------------------
  |  Branch (173:6): [True: 3.94k, False: 53]
  |  Branch (173:18): [True: 2.06k, False: 1.88k]
  |  Branch (173:28): [True: 2.04k, False: 16]
  ------------------
  174|  2.04k|		return -1;			/* Ended on non-(space/NUL) */
  175|       |
  176|  1.95k|	return value;
  177|  3.99k|}

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:
  319|      2|{
  320|      2|	if (ms == NULL)
  ------------------
  |  Branch (320:6): [True: 0, False: 2]
  ------------------
  321|      0|		return -1;
  322|      2|	return file_apprentice(ms, magicfile, FILE_LOAD);
  ------------------
  |  |  195|      2|#define	FILE_LOAD	0
  ------------------
  323|      2|}
magic_buffer:
  553|  8.25k|{
  554|  8.25k|	if (ms == NULL)
  ------------------
  |  Branch (554:6): [True: 0, False: 8.25k]
  ------------------
  555|      0|		return NULL;
  556|  8.25k|	if (file_reset(ms, 1) == -1)
  ------------------
  |  Branch (556:6): [True: 0, False: 8.25k]
  ------------------
  557|      0|		return NULL;
  558|       |	/*
  559|       |	 * The main work is done here!
  560|       |	 * We have the file name and/or the data buffer to be identified.
  561|       |	 */
  562|  8.25k|	if (file_buffer(ms, -1, NULL, NULL, buf, nb) == -1) {
  ------------------
  |  Branch (562:6): [True: 325, False: 7.92k]
  ------------------
  563|    325|		return NULL;
  564|    325|	}
  565|  7.92k|	return file_getbuffer(ms);
  566|  8.25k|}
magic_setflags:
  596|      2|{
  597|      2|	if (ms == NULL)
  ------------------
  |  Branch (597:6): [True: 0, False: 2]
  ------------------
  598|      0|		return -1;
  599|       |#if !defined(HAVE_UTIME) && !defined(HAVE_UTIMES)
  600|       |	if (flags & MAGIC_PRESERVE_ATIME)
  601|       |		return -1;
  602|       |#endif
  603|      2|	ms->flags = flags;
  604|      2|	return 0;
  605|      2|}

fmtcheck:
  236|  59.8k|{
  237|  59.8k|	const char	*f1p, *f2p;
  238|  59.8k|	EFT		f1t, f2t;
  239|       |
  240|  59.8k|	if (!f1) return f2;
  ------------------
  |  Branch (240:6): [True: 0, False: 59.8k]
  ------------------
  241|       |
  242|  59.8k|	f1p = f1;
  243|  59.8k|	f1t = FMTCHECK_START;
  244|  59.8k|	f2p = f2;
  245|  59.8k|	f2t = FMTCHECK_START;
  246|   119k|	while ((f1t = get_next_format(&f1p, f1t)) != FMTCHECK_DONE) {
  ------------------
  |  Branch (246:9): [True: 59.8k, False: 59.8k]
  ------------------
  247|  59.8k|		if (f1t == FMTCHECK_UNKNOWN)
  ------------------
  |  Branch (247:7): [True: 0, False: 59.8k]
  ------------------
  248|      0|			return f2;
  249|  59.8k|		f2t = get_next_format(&f2p, f2t);
  250|  59.8k|		if (f1t != f2t)
  ------------------
  |  Branch (250:7): [True: 0, False: 59.8k]
  ------------------
  251|      0|			return f2;
  252|  59.8k|	}
  253|  59.8k|	return f1;
  254|  59.8k|}
fmtcheck.c:get_next_format:
  190|   179k|{
  191|   179k|	int		infmt;
  192|   179k|	const char	*f;
  193|       |
  194|   179k|	if (eft == FMTCHECK_WIDTH) {
  ------------------
  |  Branch (194:6): [True: 0, False: 179k]
  ------------------
  195|      0|		(*pf)++;
  196|      0|		return get_next_format_from_width(pf);
  197|   179k|	} else if (eft == FMTCHECK_PRECISION) {
  ------------------
  |  Branch (197:13): [True: 0, False: 179k]
  ------------------
  198|      0|		(*pf)++;
  199|      0|		return get_next_format_from_precision(pf);
  200|      0|	}
  201|       |
  202|   179k|	f = *pf;
  203|   179k|	infmt = 0;
  204|   299k|	while (!infmt) {
  ------------------
  |  Branch (204:9): [True: 179k, False: 119k]
  ------------------
  205|   179k|		f = strchr(f, '%');
  206|   179k|		if (f == NULL)
  ------------------
  |  Branch (206:7): [True: 59.8k, False: 119k]
  ------------------
  207|  59.8k|			RETURN(pf,f,FMTCHECK_DONE);
  ------------------
  |  |   60|  59.8k|#define RETURN(pf,f,r) do { \
  |  |   61|  59.8k|			*(pf) = (f); \
  |  |   62|  59.8k|			return r; \
  |  |   63|  59.8k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  208|   119k|		f++;
  209|   119k|		if (!*f)
  ------------------
  |  Branch (209:7): [True: 0, False: 119k]
  ------------------
  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|   119k|		if (*f != '%')
  ------------------
  |  Branch (211:7): [True: 119k, False: 0]
  ------------------
  212|   119k|			infmt = 1;
  213|      0|		else
  214|      0|			f++;
  215|   119k|	}
  216|       |
  217|       |	/* Eat any of the flags */
  218|   130k|	while (*f && (strchr("#0- +", *f)))
  ------------------
  |  Branch (218:9): [True: 130k, False: 0]
  |  Branch (218:15): [True: 11.1k, False: 119k]
  ------------------
  219|  11.1k|		f++;
  220|       |
  221|   119k|	if (*f == '*') {
  ------------------
  |  Branch (221:6): [True: 0, False: 119k]
  ------------------
  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|   119k|	while (isdigit((unsigned char)*f)) f++;
  ------------------
  |  Branch (225:9): [True: 4.04k, False: 119k]
  ------------------
  226|   119k|	if (!*f) {
  ------------------
  |  Branch (226:6): [True: 0, False: 119k]
  ------------------
  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|   119k|	RETURN(pf,f,get_next_format_from_width(pf));
  ------------------
  |  |   60|   119k|#define RETURN(pf,f,r) do { \
  |  |   61|   119k|			*(pf) = (f); \
  |  |   62|   119k|			return r; \
  |  |   63|   119k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  231|       |	/*NOTREACHED*/
  232|   119k|}
fmtcheck.c:get_next_format_from_width:
  171|   119k|{
  172|   119k|	const char	*f;
  173|       |
  174|   119k|	f = *pf;
  175|   119k|	if (*f == '.') {
  ------------------
  |  Branch (175:6): [True: 5.75k, False: 113k]
  ------------------
  176|  5.75k|		f++;
  177|  5.75k|		if (*f == '*') {
  ------------------
  |  Branch (177:7): [True: 0, False: 5.75k]
  ------------------
  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|  7.76k|		while (isdigit((unsigned char)*f)) f++;
  ------------------
  |  Branch (181:10): [True: 7.76k, False: 5.75k]
  ------------------
  182|  5.75k|		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: 5.75k]
  ------------------
  183|  5.75k|	}
  184|   119k|	RETURN(pf,f,get_next_format_from_precision(pf));
  ------------------
  |  |   60|   119k|#define RETURN(pf,f,r) do { \
  |  |   61|   119k|			*(pf) = (f); \
  |  |   62|   119k|			return r; \
  |  |   63|   119k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  185|       |	/*NOTREACHED*/
  186|   119k|}
fmtcheck.c:get_next_format_from_precision:
   67|   119k|{
   68|   119k|	int		sh, lg, quad, longdouble;
   69|   119k|	const char	*f;
   70|       |
   71|   119k|	sh = lg = quad = longdouble = 0;
   72|       |
   73|   119k|	f = *pf;
   74|   119k|	switch (*f) {
   75|      0|	case 'h':
  ------------------
  |  Branch (75:2): [True: 0, False: 119k]
  ------------------
   76|      0|		f++;
   77|      0|		sh = 1;
   78|      0|		break;
   79|  5.41k|	case 'l':
  ------------------
  |  Branch (79:2): [True: 5.41k, False: 114k]
  ------------------
   80|  5.41k|		f++;
   81|  5.41k|		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: 5.41k]
  ------------------
   82|  5.41k|		if (*f == 'l') {
  ------------------
  |  Branch (82:7): [True: 5.41k, False: 0]
  ------------------
   83|  5.41k|			f++;
   84|  5.41k|			quad = 1;
   85|  5.41k|		} else {
   86|      0|			lg = 1;
   87|      0|		}
   88|  5.41k|		break;
   89|      0|	case 'q':
  ------------------
  |  Branch (89:2): [True: 0, False: 119k]
  ------------------
   90|      0|		f++;
   91|      0|		quad = 1;
   92|      0|		break;
   93|      0|	case 'L':
  ------------------
  |  Branch (93:2): [True: 0, False: 119k]
  ------------------
   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|   114k|	default:
  ------------------
  |  Branch (114:2): [True: 114k, False: 5.41k]
  ------------------
  115|   114k|		break;
  116|   119k|	}
  117|   119k|	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: 119k]
  ------------------
  118|   119k|	if (strchr("diouxX", *f)) {
  ------------------
  |  Branch (118:6): [True: 76.7k, False: 42.9k]
  ------------------
  119|  76.7k|		if (longdouble)
  ------------------
  |  Branch (119:7): [True: 0, False: 76.7k]
  ------------------
  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|  76.7k|		if (lg)
  ------------------
  |  Branch (121:7): [True: 0, False: 76.7k]
  ------------------
  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|  76.7k|		if (quad)
  ------------------
  |  Branch (123:7): [True: 5.41k, False: 71.3k]
  ------------------
  124|  5.41k|			RETURN(pf,f,FMTCHECK_QUAD);
  ------------------
  |  |   60|  5.41k|#define RETURN(pf,f,r) do { \
  |  |   61|  5.41k|			*(pf) = (f); \
  |  |   62|  5.41k|			return r; \
  |  |   63|  5.41k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  125|  71.3k|		RETURN(pf,f,FMTCHECK_INT);
  ------------------
  |  |   60|  71.3k|#define RETURN(pf,f,r) do { \
  |  |   61|  71.3k|			*(pf) = (f); \
  |  |   62|  71.3k|			return r; \
  |  |   63|  71.3k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  126|  71.3k|	}
  127|  42.9k|	if (*f == 'n') {
  ------------------
  |  Branch (127:6): [True: 0, False: 42.9k]
  ------------------
  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|  42.9k|	if (strchr("DOU", *f)) {
  ------------------
  |  Branch (138:6): [True: 0, False: 42.9k]
  ------------------
  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|  42.9k|	if (strchr("eEfg", *f)) {
  ------------------
  |  Branch (143:6): [True: 5.82k, False: 37.1k]
  ------------------
  144|  5.82k|		if (longdouble)
  ------------------
  |  Branch (144:7): [True: 0, False: 5.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|  5.82k|		if (sh + lg + quad)
  ------------------
  |  Branch (146:7): [True: 0, False: 5.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|  5.82k|		RETURN(pf,f,FMTCHECK_DOUBLE);
  ------------------
  |  |   60|  5.82k|#define RETURN(pf,f,r) do { \
  |  |   61|  5.82k|			*(pf) = (f); \
  |  |   62|  5.82k|			return r; \
  |  |   63|  5.82k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  149|  5.82k|	}
  150|  37.1k|	if (*f == 'c') {
  ------------------
  |  Branch (150:6): [True: 604, False: 36.5k]
  ------------------
  151|    604|		if (sh + lg + quad + longdouble)
  ------------------
  |  Branch (151:7): [True: 0, False: 604]
  ------------------
  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|    604|		RETURN(pf,f,FMTCHECK_INT);
  ------------------
  |  |   60|    604|#define RETURN(pf,f,r) do { \
  |  |   61|    604|			*(pf) = (f); \
  |  |   62|    604|			return r; \
  |  |   63|    604|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  154|    604|	}
  155|  36.5k|	if (*f == 's') {
  ------------------
  |  Branch (155:6): [True: 36.5k, False: 0]
  ------------------
  156|  36.5k|		if (sh + lg + quad + longdouble)
  ------------------
  |  Branch (156:7): [True: 0, False: 36.5k]
  ------------------
  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|  36.5k|		RETURN(pf,f,FMTCHECK_STRING);
  ------------------
  |  |   60|  36.5k|#define RETURN(pf,f,r) do { \
  |  |   61|  36.5k|			*(pf) = (f); \
  |  |   62|  36.5k|			return r; \
  |  |   63|  36.5k|		       } /*NOTREACHED*/ /*CONSTCOND*/ while (0)
  |  |  ------------------
  |  |  |  Branch (63:48): [Folded, False: 0]
  |  |  ------------------
  ------------------
  159|  36.5k|	}
  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|}

strlcpy:
   35|   330k|{
   36|   330k|	char *d = dst;
   37|   330k|	const char *s = src;
   38|   330k|	size_t n = siz;
   39|       |
   40|       |	/* Copy as many bytes as will fit */
   41|   330k|	if (n != 0 && --n != 0) {
  ------------------
  |  Branch (41:6): [True: 330k, False: 0]
  |  Branch (41:16): [True: 330k, False: 0]
  ------------------
   42|  2.13M|		do {
   43|  2.13M|			if ((*d++ = *s++) == 0)
  ------------------
  |  Branch (43:8): [True: 330k, False: 1.80M]
  ------------------
   44|   330k|				break;
   45|  2.13M|		} while (--n != 0);
  ------------------
  |  Branch (45:12): [True: 1.80M, False: 34]
  ------------------
   46|   330k|	}
   47|       |
   48|       |	/* Not enough room in dst, add NUL and traverse rest of src */
   49|   330k|	if (n == 0) {
  ------------------
  |  Branch (49:6): [True: 34, False: 330k]
  ------------------
   50|     34|		if (siz != 0)
  ------------------
  |  Branch (50:7): [True: 34, False: 0]
  ------------------
   51|     34|			*d = '\0';		/* NUL-terminate dst */
   52|     34|		while (*s++)
  ------------------
  |  Branch (52:10): [True: 0, False: 34]
  ------------------
   53|      0|			;
   54|     34|	}
   55|       |
   56|   330k|	return(s - src - 1);	/* count does not include NUL */
   57|   330k|}

file_fmtdatetime:
  311|  5.24k|{
  312|  5.24k|	char *pp;
  313|  5.24k|	time_t t;
  314|  5.24k|	struct tm *tm, tmz;
  315|       |
  316|  5.24k|	if (flags & FILE_T_WINDOWS) {
  ------------------
  |  |  549|  5.24k|#define FILE_T_WINDOWS	2
  ------------------
  |  Branch (316:6): [True: 1.94k, False: 3.30k]
  ------------------
  317|  1.94k|		struct timespec ts;
  318|  1.94k|		cdf_timestamp_to_timespec(&ts, CAST(cdf_timestamp_t, v));
  ------------------
  |  |  460|  1.94k|#define CAST(T, b)	((T)(b))
  ------------------
  319|  1.94k|		t = ts.tv_sec;
  320|  3.30k|	} else {
  321|       |		// XXX: perhaps detect and print something if overflow
  322|       |		// on 32 bit time_t?
  323|  3.30k|		t = CAST(time_t, v);
  ------------------
  |  |  460|  3.30k|#define CAST(T, b)	((T)(b))
  ------------------
  324|  3.30k|	}
  325|       |
  326|  5.24k|	if (t > MAX_CTIME)
  ------------------
  |  |  181|  5.24k|    CAST(time_t, sizeof(time_t) > 4 ? 0x3afff487cfULL : 0x7fffffffULL)
  |  |  ------------------
  |  |  |  |  460|  10.4k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (460:25): [True: 5.24k, Folded]
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
  |  Branch (326:6): [True: 1.35k, False: 3.89k]
  ------------------
  327|  1.35k|		goto out;
  328|       |
  329|  3.89k|	if (flags & FILE_T_LOCAL) {
  ------------------
  |  |  548|  3.89k|#define FILE_T_LOCAL	1
  ------------------
  |  Branch (329:6): [True: 847, False: 3.04k]
  ------------------
  330|    847|#ifdef HAVE_TZSET
  331|    847|		tzset();
  332|    847|#endif
  333|    847|		tm = localtime_r(&t, &tmz);
  334|  3.04k|	} else {
  335|  3.04k|		tm = gmtime_r(&t, &tmz);
  336|  3.04k|	}
  337|  3.89k|	if (tm == NULL)
  ------------------
  |  Branch (337:6): [True: 483, False: 3.40k]
  ------------------
  338|    483|		goto out;
  339|  3.40k|	pp = asctime_r(tm, buf);
  340|       |
  341|  3.40k|	if (pp == NULL)
  ------------------
  |  Branch (341:6): [True: 496, False: 2.91k]
  ------------------
  342|    496|		goto out;
  343|  2.91k|	pp[strcspn(pp, "\n")] = '\0';
  344|  2.91k|	return pp;
  345|  2.33k|out:
  346|  2.33k|	strlcpy(buf, "*Invalid datetime*", bsize);
  347|  2.33k|	return buf;
  348|  3.40k|}
file_fmtdate:
  356|    313|{
  357|    313|	struct tm tm;
  358|       |
  359|    313|	memset(&tm, 0, sizeof(tm));
  360|    313|	tm.tm_mday = v & 0x1f;
  361|    313|	tm.tm_mon = ((v >> 5) & 0xf) - 1;
  362|       |	// Sanity check because some OS's coredump with invalid values.
  363|       |	// Yes, Cygwin I am looking at you!
  364|    313|	if (tm.tm_mon < 0 || tm.tm_mon > 11)
  ------------------
  |  Branch (364:6): [True: 103, False: 210]
  |  Branch (364:23): [True: 128, False: 82]
  ------------------
  365|    231|		tm.tm_mon = 0;
  366|    313|	tm.tm_year = (v >> 9) + 80;
  367|       |
  368|    313|	if (strftime(buf, bsize, "%b %d %Y", &tm) == 0)
  ------------------
  |  Branch (368:6): [True: 0, False: 313]
  ------------------
  369|      0|		goto out;
  370|       |
  371|    313|	return buf;
  372|      0|out:
  373|      0|	strlcpy(buf, "*Invalid date*", bsize);
  374|      0|	return buf;
  375|    313|}
file_fmttime:
  379|    313|{
  380|    313|	struct tm tm;
  381|       |
  382|    313|	memset(&tm, 0, sizeof(tm));
  383|    313|	tm.tm_sec = (v & 0x1f) * 2;
  384|    313|	tm.tm_min = ((v >> 5) & 0x3f);
  385|    313|	tm.tm_hour = (v >> 11);
  386|       |
  387|    313|	if (strftime(buf, bsize, "%T", &tm) == 0)
  ------------------
  |  Branch (387:6): [True: 0, False: 313]
  ------------------
  388|      0|		goto out;
  389|       |
  390|    313|	return buf;
  391|      0|out:
  392|      0|	strlcpy(buf, "*Invalid time*", bsize);
  393|      0|	return buf;
  394|       |
  395|    313|}

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

file_softmagic:
  130|  14.6k|{
  131|  14.6k|	struct mlist *ml;
  132|  14.6k|	int rv = 0, printed_something = 0, need_separator = 0, firstline = 1;
  133|  14.6k|	uint16_t nc, ic;
  134|       |
  135|  14.6k|	if (name_count == NULL) {
  ------------------
  |  Branch (135:6): [True: 14.6k, False: 0]
  ------------------
  136|  14.6k|		nc = 0;
  137|  14.6k|		name_count = &nc;
  138|  14.6k|	}
  139|  14.6k|	if (indir_count == NULL) {
  ------------------
  |  Branch (139:6): [True: 14.6k, False: 0]
  ------------------
  140|  14.6k|		ic = 0;
  141|  14.6k|		indir_count = &ic;
  142|  14.6k|	}
  143|       |
  144|  28.9k|	for (ml = ms->mlist[0]->next; ml != ms->mlist[0]; ml = ml->next) {
  ------------------
  |  Branch (144:32): [True: 14.6k, False: 14.2k]
  ------------------
  145|  14.6k|		int ret = match(ms, ml->magic, ml->magic_rxcomp, ml->nmagic, b,
  146|  14.6k|		    0, mode, text, 0, indir_count, name_count,
  147|  14.6k|		    &printed_something, &need_separator, &firstline,
  148|  14.6k|		    NULL, NULL);
  149|  14.6k|		switch (ret) {
  150|    396|		case -1:
  ------------------
  |  Branch (150:3): [True: 396, False: 14.2k]
  ------------------
  151|    396|			return ret;
  152|  5.52k|		case 0:
  ------------------
  |  Branch (152:3): [True: 5.52k, False: 9.14k]
  ------------------
  153|  5.52k|			continue;
  154|  8.74k|		default:
  ------------------
  |  Branch (154:3): [True: 8.74k, False: 5.91k]
  ------------------
  155|  8.74k|			if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|  8.74k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (155:8): [True: 0, False: 8.74k]
  ------------------
  156|      0|				return ret;
  157|  8.74k|			rv = ret;
  158|  8.74k|			break;
  159|  14.6k|		}
  160|  14.6k|	}
  161|       |
  162|  14.2k|	return rv;
  163|  14.6k|}
softmagic.c:match:
  222|   100k|{
  223|   100k|	uint32_t magindex = 0;
  224|   100k|	unsigned int cont_level = 0;
  225|   100k|	int found_matchv = 0; /* if a match is found it is set to 1*/
  226|   100k|	int returnvalv = 0, e;
  227|   100k|	struct buffer bb;
  228|   100k|	int print = (ms->flags & MAGIC_NODESC) == 0;
  ------------------
  |  |   52|   100k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|   100k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|   100k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|   100k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|   100k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|   100k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  229|       |
  230|   100k|	(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|   100k|	if (returnval == NULL)
  ------------------
  |  Branch (235:6): [True: 49.3k, False: 51.4k]
  ------------------
  236|  49.3k|		returnval = &returnvalv;
  237|   100k|	if (found_match == NULL)
  ------------------
  |  Branch (237:6): [True: 49.3k, False: 51.4k]
  ------------------
  238|  49.3k|		found_match = &found_matchv;
  239|       |
  240|   100k|	if (file_check_mem(ms, cont_level) == -1)
  ------------------
  |  Branch (240:6): [True: 0, False: 100k]
  ------------------
  241|      0|		return -1;
  242|       |
  243|   186M|	for (magindex = 0; magindex < nmagic; magindex++) {
  ------------------
  |  Branch (243:21): [True: 185M, False: 88.0k]
  ------------------
  244|   185M|		int flush = 0;
  245|   185M|		struct magic *m = &magic[magindex];
  246|   185M|		file_regex_t **m_rxcomp = &magic_rxcomp[magindex];
  247|       |
  248|   185M|		if (m->type != FILE_NAME)
  ------------------
  |  |  298|   185M|#define				FILE_NAME		45
  ------------------
  |  Branch (248:7): [True: 185M, False: 51.4k]
  ------------------
  249|   185M|		if ((IS_STRING(m->type) &&
  ------------------
  |  |  318|   371M|	((t) == FILE_STRING || \
  |  |  ------------------
  |  |  |  |  258|   371M|#define				FILE_STRING		5
  |  |  ------------------
  |  |  |  Branch (318:3): [True: 113M, False: 71.9M]
  |  |  ------------------
  |  |  319|   185M|	 (t) == FILE_PSTRING || \
  |  |  ------------------
  |  |  |  |  266|   257M|#define				FILE_PSTRING		13
  |  |  ------------------
  |  |  |  Branch (319:3): [True: 48.7k, False: 71.8M]
  |  |  ------------------
  |  |  320|   185M|	 (t) == FILE_BESTRING16 || \
  |  |  ------------------
  |  |  |  |  271|   257M|#define				FILE_BESTRING16		18
  |  |  ------------------
  |  |  |  Branch (320:3): [True: 0, False: 71.8M]
  |  |  ------------------
  |  |  321|   185M|	 (t) == FILE_LESTRING16 || \
  |  |  ------------------
  |  |  |  |  272|   257M|#define				FILE_LESTRING16		19
  |  |  ------------------
  |  |  |  Branch (321:3): [True: 97.5k, False: 71.7M]
  |  |  ------------------
  |  |  322|   185M|	 (t) == FILE_REGEX || \
  |  |  ------------------
  |  |  |  |  270|   257M|#define				FILE_REGEX		17
  |  |  ------------------
  |  |  |  Branch (322:3): [True: 3.70M, False: 68.0M]
  |  |  ------------------
  |  |  323|   185M|	 (t) == FILE_SEARCH || \
  |  |  ------------------
  |  |  |  |  273|   253M|#define				FILE_SEARCH		20
  |  |  ------------------
  |  |  |  Branch (323:3): [True: 12.5M, False: 55.5M]
  |  |  ------------------
  |  |  324|   185M|	 (t) == FILE_INDIRECT || \
  |  |  ------------------
  |  |  |  |  294|   241M|#define				FILE_INDIRECT		41
  |  |  ------------------
  |  |  |  Branch (324:3): [True: 0, False: 55.5M]
  |  |  ------------------
  |  |  325|   185M|	 (t) == FILE_NAME || \
  |  |  ------------------
  |  |  |  |  298|   241M|#define				FILE_NAME		45
  |  |  ------------------
  |  |  |  Branch (325:3): [True: 0, False: 55.5M]
  |  |  ------------------
  |  |  326|   185M|	 (t) == FILE_USE || \
  |  |  ------------------
  |  |  |  |  299|   241M|#define				FILE_USE		46
  |  |  ------------------
  |  |  |  Branch (326:3): [True: 0, False: 55.5M]
  |  |  ------------------
  |  |  327|   371M|	 (t) == FILE_OCTAL)
  |  |  ------------------
  |  |  |  |  314|  55.5M|#define				FILE_OCTAL		61
  |  |  ------------------
  |  |  |  Branch (327:3): [True: 0, False: 55.5M]
  |  |  ------------------
  ------------------
  250|   130M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  251|   130M|		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  390|  13.1M|#define str_flags _u._s._flags
  ------------------
              		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  250|  13.1M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  410|  13.1M|#define STRING_BINTEST				BIT(6)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  13.1M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  409|  13.1M|#define STRING_TEXTTEST				BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|  13.1M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		     ((text && (m->str_flags & FLT) == STRING_BINTEST) ||
  ------------------
  |  |  410|  13.1M|#define STRING_BINTEST				BIT(6)
  |  |  ------------------
  |  |  |  |  403|  13.1M|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (251:10): [True: 13.1M, False: 117M]
  |  Branch (251:18): [True: 528k, False: 12.6M]
  ------------------
  252|   129M|		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  390|   117M|#define str_flags _u._s._flags
  ------------------
              		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  250|   117M|#define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  410|   117M|#define STRING_BINTEST				BIT(6)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|   117M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define FLT (STRING_BINTEST | STRING_TEXTTEST)
  |  |  ------------------
  |  |  |  |  409|   117M|#define STRING_TEXTTEST				BIT(5)
  |  |  |  |  ------------------
  |  |  |  |  |  |  403|   117M|#define BIT(A)   (1 << (A))
  |  |  |  |  ------------------
  |  |  ------------------
  ------------------
              		      (!text && (m->str_flags & FLT) == STRING_TEXTTEST))) ||
  ------------------
  |  |  409|   117M|#define STRING_TEXTTEST				BIT(5)
  |  |  ------------------
  |  |  |  |  403|   117M|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (252:10): [True: 117M, False: 12.6M]
  |  Branch (252:19): [True: 6.21M, False: 110M]
  ------------------
  253|   179M|		    (m->flag & mode) != mode) {
  ------------------
  |  Branch (253:7): [True: 21.1M, False: 157M]
  ------------------
  254|   185M|flush:
  255|       |			/* Skip sub-tests */
  256|   834M|			while (magindex < nmagic - 1 &&
  ------------------
  |  Branch (256:11): [True: 834M, False: 5.10k]
  ------------------
  257|   834M|			    magic[magindex + 1].cont_level != 0) {
  ------------------
  |  Branch (257:8): [True: 648M, False: 185M]
  ------------------
  258|   648M|				magindex++;
  259|   648M|			}
  260|   185M|			cont_level = 0;
  261|   185M|			continue; /* Skip to next top-level test*/
  262|  27.8M|		}
  263|       |
  264|   158M|		if (msetoffset(ms, m, &bb, b, offset, cont_level) == -1) {
  ------------------
  |  Branch (264:7): [True: 89.5k, False: 157M]
  ------------------
  265|  89.5k|			if (b->elen == FILE_BADSIZE)
  ------------------
  |  |  183|  89.5k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  89.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (265:8): [True: 0, False: 89.5k]
  ------------------
  266|      0|				continue;
  267|  89.5k|			else
  268|  89.5k|				goto flush;
  269|  89.5k|		}
  270|   157M|		ms->line = m->lineno;
  271|       |
  272|       |		/* if main entry matches, print it... */
  273|   157M|		switch (mget(ms, m, b, &bb, offset, cont_level,
  274|   157M|		    mode, text, flip, indir_count, name_count,
  275|   157M|		    printed_something, need_separator, firstline, returnval,
  276|   157M|		    found_match))
  277|   157M|		{
  278|    260|		case -1:
  ------------------
  |  Branch (278:3): [True: 260, False: 157M]
  ------------------
  279|    260|			return -1;
  280|  16.3M|		case 0:
  ------------------
  |  Branch (280:3): [True: 16.3M, False: 141M]
  ------------------
  281|  16.3M|			flush = m->reln != '!';
  282|  16.3M|			break;
  283|   141M|		default:
  ------------------
  |  Branch (283:3): [True: 141M, False: 16.3M]
  ------------------
  284|   141M|			if (m->type == FILE_INDIRECT) {
  ------------------
  |  |  294|   141M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (284:8): [True: 0, False: 141M]
  ------------------
  285|      0|				*found_match = 1;
  286|      0|				*returnval = 1;
  287|      0|			}
  288|       |
  289|   141M|			switch (magiccheck(ms, m, m_rxcomp)) {
  290|      0|			case -1:
  ------------------
  |  Branch (290:4): [True: 0, False: 141M]
  ------------------
  291|      0|				return -1;
  292|   141M|			case 0:
  ------------------
  |  Branch (292:4): [True: 141M, False: 576k]
  ------------------
  293|   141M|				flush++;
  294|   141M|				break;
  295|   576k|			default:
  ------------------
  |  Branch (295:4): [True: 576k, False: 141M]
  ------------------
  296|   576k|				flush = 0;
  297|   576k|				break;
  298|   141M|			}
  299|   141M|			break;
  300|   157M|		}
  301|   157M|		if (flush) {
  ------------------
  |  Branch (301:7): [True: 157M, False: 576k]
  ------------------
  302|       |			/*
  303|       |			 * main entry didn't match,
  304|       |			 * flush its continuations
  305|       |			 */
  306|   157M|			goto flush;
  307|   157M|		}
  308|       |
  309|   576k|		if ((e = handle_annotation(ms, m, *firstline)) != 0)
  ------------------
  |  Branch (309:7): [True: 0, False: 576k]
  ------------------
  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|   576k|		if (*m->desc) {
  ------------------
  |  Branch (323:7): [True: 14.9k, False: 561k]
  ------------------
  324|  14.9k|			*found_match = 1;
  325|  14.9k|			if (print) {
  ------------------
  |  Branch (325:8): [True: 14.9k, False: 0]
  ------------------
  326|  14.9k|				*returnval = 1;
  327|  14.9k|				*need_separator = 1;
  328|  14.9k|				*printed_something = 1;
  329|  14.9k|				if (print_sep(ms, *firstline) == -1)
  ------------------
  |  Branch (329:9): [True: 0, False: 14.9k]
  ------------------
  330|      0|					return -1;
  331|  14.9k|				if (mprint(ms, m) == -1)
  ------------------
  |  Branch (331:9): [True: 0, False: 14.9k]
  ------------------
  332|      0|					return -1;
  333|  14.9k|			}
  334|  14.9k|		}
  335|       |
  336|   576k|		switch (moffset(ms, m, bb.flen, offset,
  337|   576k|		    &ms->c.li[cont_level].off)) {
  338|  23.2k|		case -1:
  ------------------
  |  Branch (338:3): [True: 23.2k, False: 553k]
  ------------------
  339|  23.2k|		case 0:
  ------------------
  |  Branch (339:3): [True: 0, False: 576k]
  ------------------
  340|  23.2k|			goto flush;
  341|   553k|		default:
  ------------------
  |  Branch (341:3): [True: 553k, False: 23.2k]
  ------------------
  342|   553k|			break;
  343|   576k|		}
  344|       |
  345|       |		/* and any continuations that match */
  346|   553k|		if (file_check_mem(ms, ++cont_level) == -1)
  ------------------
  |  Branch (346:7): [True: 0, False: 553k]
  ------------------
  347|      0|			return -1;
  348|       |
  349|  6.22M|		while (magindex + 1 < nmagic &&
  ------------------
  |  Branch (349:10): [True: 6.14M, False: 82.9k]
  ------------------
  350|  6.14M|		    magic[magindex + 1].cont_level != 0) {
  ------------------
  |  Branch (350:7): [True: 5.68M, False: 457k]
  ------------------
  351|  5.68M|			m = &magic[++magindex];
  352|  5.68M|			m_rxcomp = &magic_rxcomp[magindex];
  353|  5.68M|			ms->line = m->lineno; /* for messages */
  354|       |
  355|  5.68M|			if (cont_level < m->cont_level)
  ------------------
  |  Branch (355:8): [True: 4.11M, False: 1.57M]
  ------------------
  356|  4.11M|				continue;
  357|  1.57M|			if (cont_level > m->cont_level) {
  ------------------
  |  Branch (357:8): [True: 109k, False: 1.46M]
  ------------------
  358|       |				/*
  359|       |				 * We're at the end of the level
  360|       |				 * "cont_level" continuations.
  361|       |				 */
  362|   109k|				cont_level = m->cont_level;
  363|   109k|			}
  364|  1.57M|			if (msetoffset(ms, m, &bb, b, offset, cont_level)
  ------------------
  |  Branch (364:8): [True: 112, False: 1.57M]
  ------------------
  365|  1.57M|			    == -1) {
  366|    112|				if (b->elen == FILE_BADSIZE)
  ------------------
  |  |  183|    112|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|    112|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (366:9): [True: 0, False: 112]
  ------------------
  367|      0|					continue;
  368|    112|				else
  369|    112|					goto flush;
  370|    112|			}
  371|  1.57M|			if (m->flag & OFFADD) {
  ------------------
  |  |  235|  1.57M|#define OFFADD		0x02	/* if '>&' or '>...(&' appears */
  ------------------
  |  Branch (371:8): [True: 207k, False: 1.36M]
  ------------------
  372|   207k|				if (cont_level == 0) {
  ------------------
  |  Branch (372:9): [True: 0, False: 207k]
  ------------------
  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|   207k|				ms->offset +=
  380|   207k|				    ms->c.li[cont_level - 1].off;
  381|   207k|			}
  382|       |
  383|  1.57M|#ifdef ENABLE_CONDITIONALS
  384|  1.57M|			if (m->cond == COND_ELSE ||
  ------------------
  |  |  371|  3.14M|#define				COND_ELSE	3
  ------------------
  |  Branch (384:8): [True: 0, False: 1.57M]
  ------------------
  385|  1.57M|			    m->cond == COND_ELIF) {
  ------------------
  |  |  370|  1.57M|#define				COND_ELIF	2
  ------------------
  |  Branch (385:8): [True: 0, False: 1.57M]
  ------------------
  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.57M|#endif
  390|  1.57M|			switch (mget(ms, m, b, &bb, offset,
  391|  1.57M|			    cont_level, mode, text, flip, indir_count,
  392|  1.57M|			    name_count, printed_something, need_separator,
  393|  1.57M|			    firstline, returnval, found_match)) {
  394|  12.4k|			case -1:
  ------------------
  |  Branch (394:4): [True: 12.4k, False: 1.56M]
  ------------------
  395|  12.4k|				return -1;
  396|   111k|			case 0:
  ------------------
  |  Branch (396:4): [True: 111k, False: 1.46M]
  ------------------
  397|   111k|				if (m->reln != '!')
  ------------------
  |  Branch (397:9): [True: 109k, False: 1.88k]
  ------------------
  398|   109k|					continue;
  399|  1.88k|				flush = 1;
  400|  1.88k|				break;
  401|  1.45M|			default:
  ------------------
  |  Branch (401:4): [True: 1.45M, False: 124k]
  ------------------
  402|  1.45M|				if (m->type == FILE_INDIRECT) {
  ------------------
  |  |  294|  1.45M|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (402:9): [True: 15.7k, False: 1.43M]
  ------------------
  403|  15.7k|					*found_match = 1;
  404|  15.7k|					*returnval = 1;
  405|  15.7k|				}
  406|  1.45M|				flush = 0;
  407|  1.45M|				break;
  408|  1.57M|			}
  409|       |
  410|  1.45M|			switch (flush ? 1 : magiccheck(ms, m, m_rxcomp)) {
  ------------------
  |  Branch (410:12): [True: 1.88k, False: 1.45M]
  ------------------
  411|      0|			case -1:
  ------------------
  |  Branch (411:4): [True: 0, False: 1.45M]
  ------------------
  412|      0|				return -1;
  413|  1.03M|			case 0:
  ------------------
  |  Branch (413:4): [True: 1.03M, False: 413k]
  ------------------
  414|  1.03M|#ifdef ENABLE_CONDITIONALS
  415|  1.03M|				ms->c.li[cont_level].last_match = 0;
  416|  1.03M|#endif
  417|  1.03M|				break;
  418|   413k|			default:
  ------------------
  |  Branch (418:4): [True: 413k, False: 1.03M]
  ------------------
  419|   413k|#ifdef ENABLE_CONDITIONALS
  420|   413k|				ms->c.li[cont_level].last_match = 1;
  421|   413k|#endif
  422|   413k|				if (m->type == FILE_CLEAR)
  ------------------
  |  |  300|   413k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (422:9): [True: 1.86k, False: 411k]
  ------------------
  423|  1.86k|					ms->c.li[cont_level].got_match = 0;
  424|   411k|				else if (ms->c.li[cont_level].got_match) {
  ------------------
  |  Branch (424:14): [True: 80.6k, False: 330k]
  ------------------
  425|  80.6k|					if (m->type == FILE_DEFAULT)
  ------------------
  |  |  256|  80.6k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (425:10): [True: 1.38k, False: 79.2k]
  ------------------
  426|  1.38k|						break;
  427|  80.6k|				} else
  428|   330k|					ms->c.li[cont_level].got_match = 1;
  429|       |
  430|   411k|				if ((e = handle_annotation(ms, m, *firstline))
  ------------------
  |  Branch (430:9): [True: 0, False: 411k]
  ------------------
  431|   411k|				    != 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|   411k|				if (*m->desc) {
  ------------------
  |  Branch (439:9): [True: 99.3k, False: 312k]
  ------------------
  440|  99.3k|					*found_match = 1;
  441|  99.3k|				}
  442|   411k|				if (print && *m->desc) {
  ------------------
  |  Branch (442:9): [True: 411k, False: 0]
  |  Branch (442:18): [True: 99.3k, False: 312k]
  ------------------
  443|  99.3k|					*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|  99.3k|					if (!*printed_something) {
  ------------------
  |  Branch (455:10): [True: 16.6k, False: 82.7k]
  ------------------
  456|  16.6k|						*printed_something = 1;
  457|  16.6k|						if (print_sep(ms, *firstline)
  ------------------
  |  Branch (457:11): [True: 0, False: 16.6k]
  ------------------
  458|  16.6k|						    == -1)
  459|      0|							return -1;
  460|  16.6k|					}
  461|       |					/* space if previous printed */
  462|  99.3k|					if (*need_separator
  ------------------
  |  Branch (462:10): [True: 95.6k, False: 3.69k]
  ------------------
  463|  95.6k|					    && (m->flag & NOSPACE) == 0) {
  ------------------
  |  |  238|  95.6k|#define NOSPACE		0x10	/* suppress space character before output */
  ------------------
  |  Branch (463:13): [True: 35.4k, False: 60.2k]
  ------------------
  464|  35.4k|						if (file_printf(ms, " ") == -1)
  ------------------
  |  Branch (464:11): [True: 0, False: 35.4k]
  ------------------
  465|      0|							return -1;
  466|  35.4k|					}
  467|  99.3k|					if (mprint(ms, m) == -1)
  ------------------
  |  Branch (467:10): [True: 0, False: 99.3k]
  ------------------
  468|      0|						return -1;
  469|  99.3k|					*need_separator = 1;
  470|  99.3k|				}
  471|       |
  472|   411k|				switch (moffset(ms, m, bb.flen, offset,
  473|   411k|				    &ms->c.li[cont_level].off)) {
  474|  4.23k|				case -1:
  ------------------
  |  Branch (474:5): [True: 4.23k, False: 407k]
  ------------------
  475|  4.23k|				case 0:
  ------------------
  |  Branch (475:5): [True: 0, False: 411k]
  ------------------
  476|  4.23k|					cont_level--;
  477|  4.23k|					break;
  478|   407k|				default:
  ------------------
  |  Branch (478:5): [True: 407k, False: 4.23k]
  ------------------
  479|   407k|					break;
  480|   411k|				}
  481|       |
  482|       |				/*
  483|       |				 * If we see any continuations
  484|       |				 * at a higher level,
  485|       |				 * process them.
  486|       |				 */
  487|   411k|				if (file_check_mem(ms, ++cont_level) == -1)
  ------------------
  |  Branch (487:9): [True: 0, False: 411k]
  ------------------
  488|      0|					return -1;
  489|   411k|				break;
  490|  1.45M|			}
  491|  1.45M|		}
  492|   540k|		if (*printed_something) {
  ------------------
  |  Branch (492:7): [True: 47.7k, False: 492k]
  ------------------
  493|  47.7k|			*firstline = 0;
  494|  47.7k|		}
  495|   540k|		if (*found_match) {
  ------------------
  |  Branch (495:7): [True: 269k, False: 271k]
  ------------------
  496|   269k|			if ((ms->flags & MAGIC_CONTINUE) == 0)
  ------------------
  |  |   38|   269k|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (496:8): [True: 0, False: 269k]
  ------------------
  497|      0|				return *returnval;
  498|       |			// So that we print a separator
  499|   269k|			*printed_something = 0;
  500|   269k|			*firstline = 0;
  501|   269k|		}
  502|   540k|		cont_level = 0;
  503|   540k|	}
  504|  88.0k|	return *returnval;
  505|   100k|}
softmagic.c:msetoffset:
 1571|   159M|{
 1572|   159M|	int32_t offset;
 1573|   159M|	if (m->flag & OFFNEGATIVE) {
  ------------------
  |  |  242|   159M|#define OFFNEGATIVE	0x80	/* relative to the end of file */
  ------------------
  |  Branch (1573:6): [True: 500k, False: 159M]
  ------------------
 1574|   500k|		offset = -m->offset;
 1575|   500k|		if (cont_level > 0) {
  ------------------
  |  Branch (1575:7): [True: 42.3k, False: 458k]
  ------------------
 1576|  42.3k|			if (m->flag & (OFFADD|INDIROFFADD))
  ------------------
  |  |  235|  42.3k|#define OFFADD		0x02	/* if '>&' or '>...(&' appears */
  ------------------
              			if (m->flag & (OFFADD|INDIROFFADD))
  ------------------
  |  |  236|  42.3k|#define INDIROFFADD	0x04	/* if '>&(' appears */
  ------------------
  |  Branch (1576:8): [True: 36.6k, False: 5.62k]
  ------------------
 1577|  36.6k|				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|  42.3k|		}
 1584|   463k|		if (buffer_fill(b) == -1)
  ------------------
  |  Branch (1584:7): [True: 0, False: 463k]
  ------------------
 1585|      0|			return -1;
 1586|   463k|		if (o != 0) {
  ------------------
  |  Branch (1586:7): [True: 37, False: 463k]
  ------------------
 1587|       |			// Not yet!
 1588|     37|			file_magerror(ms, "non zero offset %" SIZE_T_FORMAT
 1589|     37|			    "u at level %u", o, cont_level);
 1590|     37|			return -1;
 1591|     37|		}
 1592|   463k|		if (b->fd == -1) {
  ------------------
  |  Branch (1592:7): [True: 463k, False: 0]
  ------------------
 1593|   463k|			if (CAST(size_t, m->offset) > b->flen)
  ------------------
  |  |  460|   463k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1593:8): [True: 89.6k, False: 374k]
  ------------------
 1594|  89.6k|				return -1;
 1595|   374k|			ms->eoffset = ms->offset =
 1596|   374k|			    CAST(int32_t, b->flen - m->offset);
  ------------------
  |  |  460|   374k|#define CAST(T, b)	((T)(b))
  ------------------
 1597|   374k|		} else {
 1598|      0|			if (CAST(size_t, m->offset) > b->elen)
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1598:8): [True: 0, False: 0]
  ------------------
 1599|      0|				return -1;
 1600|      0|			buffer_init(bb, -1, NULL, b->ebuf, b->elen);
 1601|      0|			ms->eoffset = ms->offset =
 1602|      0|			    CAST(int32_t, b->elen - m->offset);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 1603|      0|		}
 1604|   159M|	} else {
 1605|   159M|		offset = m->offset;
 1606|   159M|		if ((m->flag & OFFPOSITIVE) || cont_level == 0) {
  ------------------
  |  |  243|   159M|#define OFFPOSITIVE	0x100	/* relative to the beginning of file */
  ------------------
  |  Branch (1606:7): [True: 68, False: 159M]
  |  Branch (1606:34): [True: 157M, False: 1.53M]
  ------------------
 1607|   157M|normal:
 1608|       |			// XXX: Pass real fd, then who frees bb?
 1609|   157M|			buffer_init(bb, -1, NULL, b->fbuf, b->flen);
 1610|   157M|			ms->offset = offset;
 1611|   157M|			ms->eoffset = 0;
 1612|   157M|		} else {
 1613|  1.53M|			ms->offset = ms->eoffset + offset;
 1614|  1.53M|		}
 1615|   159M|	}
 1616|   159M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   159M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1616:6): [True: 0, False: 159M]
  ------------------
 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|   159M|	return 0;
 1624|   159M|}
softmagic.c:mget:
 1654|   159M|{
 1655|   159M|	uint32_t eoffset, offset = ms->offset;
 1656|   159M|	struct buffer sbb;
 1657|   159M|	intmax_t lhs;
 1658|   159M|	file_pushbuf_t *pb;
 1659|   159M|	int rv, oneed_separator, in_type, nfound_match;
 1660|   159M|	char *rbuf;
 1661|   159M|	union VALUETYPE *p = &ms->ms_value;
 1662|   159M|	struct mlist ml, *mlp;
 1663|   159M|	struct cont c;
 1664|   159M|	const unsigned char *s = CAST(const unsigned char *, bb->fbuf);
  ------------------
  |  |  460|   159M|#define CAST(T, b)	((T)(b))
  ------------------
 1665|   159M|	size_t nbytes = bb->flen;
 1666|       |
 1667|   159M|	if (*indir_count >= ms->indir_max) {
  ------------------
  |  Branch (1667:6): [True: 257, False: 159M]
  ------------------
 1668|    257|		file_error(ms, 0, "indirect count (%hu) exceeded",
 1669|    257|		    *indir_count);
 1670|    257|		return -1;
 1671|    257|	}
 1672|       |
 1673|   159M|	if (*name_count >= ms->name_max) {
  ------------------
  |  Branch (1673:6): [True: 3, False: 159M]
  ------------------
 1674|      3|		file_error(ms, 0, "name use count (%hu) exceeded",
 1675|      3|		    *name_count);
 1676|      3|		return -1;
 1677|      3|	}
 1678|       |
 1679|       |
 1680|   159M|	if (mcopy(ms, p, m->type, m->flag & INDIR, s,
  ------------------
  |  |  234|   159M|#define INDIR		0x01	/* if '(...)' appears */
  ------------------
  |  Branch (1680:6): [True: 0, False: 159M]
  ------------------
 1681|   159M|	    CAST(uint32_t, offset + o), CAST(uint32_t, nbytes), m) == -1)
  ------------------
  |  |  460|   159M|#define CAST(T, b)	((T)(b))
  ------------------
              	    CAST(uint32_t, offset + o), CAST(uint32_t, nbytes), m) == -1)
  ------------------
  |  |  460|   159M|#define CAST(T, b)	((T)(b))
  ------------------
 1682|      0|		return -1;
 1683|       |
 1684|   159M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   159M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1684:6): [True: 0, False: 159M]
  ------------------
 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|   159M|	if (m->flag & INDIR) {
  ------------------
  |  |  234|   159M|#define INDIR		0x01	/* if '(...)' appears */
  ------------------
  |  Branch (1697:6): [True: 1.06M, False: 158M]
  ------------------
 1698|  1.06M|		intmax_t off = m->in_offset;
 1699|  1.06M|		const int sgn = m->in_op & FILE_OPSIGNED;
  ------------------
  |  |  363|  1.06M|#define				FILE_OPSIGNED	0x20
  ------------------
 1700|  1.06M|		if (m->in_op & FILE_OPINDIRECT) {
  ------------------
  |  |  365|  1.06M|#define				FILE_OPINDIRECT	0x80
  ------------------
  |  Branch (1700:7): [True: 958, False: 1.06M]
  ------------------
 1701|    958|			uint8_t *hb;
 1702|    958|			uint16_t hs;
 1703|    958|			uint32_t hl;
 1704|    958|			int op;
 1705|       |
 1706|    958|			if (offset_oob(nbytes, offset + off, 0))
  ------------------
  |  Branch (1706:8): [True: 107, False: 851]
  ------------------
 1707|    107|				return 0;
 1708|    851|			hb = CCAST(uint8_t *, s + offset + off);
  ------------------
  |  |  462|    851|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1709|    851|			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: 851]
  ------------------
 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: 851]
  ------------------
 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: 851]
  ------------------
 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: 851]
  ------------------
 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: 851]
  ------------------
 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: 851]
  ------------------
 1738|      0|			case FILE_BEID3:
  ------------------
  |  |  292|      0|#define				FILE_BEID3		39
  ------------------
  |  Branch (1738:4): [True: 0, False: 851]
  ------------------
 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: 851]
  ------------------
 1744|    851|			case FILE_LELONG:
  ------------------
  |  |  264|    851|#define				FILE_LELONG		11
  ------------------
  |  Branch (1744:4): [True: 851, False: 0]
  ------------------
 1745|    851|				if (offset_oob(nbytes, offset + off, 4))
  ------------------
  |  Branch (1745:9): [True: 86, False: 765]
  ------------------
 1746|     86|					return 0;
 1747|    765|				off = SEXT(sgn,32,LE32(hb));
  ------------------
  |  |  108|    765|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 765]
  |  |  ------------------
  |  |  109|    765|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    765|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    765|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1748|    765|				break;
 1749|      0|			case FILE_MELONG:
  ------------------
  |  |  276|      0|#define				FILE_MELONG		23
  ------------------
  |  Branch (1749:4): [True: 0, False: 851]
  ------------------
 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: 851]
  ------------------
 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: 851]
  ------------------
 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: 851]
  ------------------
 1765|      0|				if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1765:9): [True: 0, False: 0]
  ------------------
 1766|      0|					return 0;
 1767|      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))
  |  |  ------------------
  ------------------
 1768|      0|				break;
 1769|      0|			default:
  ------------------
  |  Branch (1769:4): [True: 0, False: 851]
  ------------------
 1770|      0|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1770:9): [True: 0, False: 0]
  ------------------
 1771|      0|					fprintf(stderr, "bad op=%d\n", op);
 1772|      0|				return 0;
 1773|    851|			}
 1774|    765|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    765|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1774:8): [True: 0, False: 765]
  ------------------
 1775|      0|				fprintf(stderr, "indirect offs=%jd\n", off);
 1776|    765|		}
 1777|  1.06M|		switch (in_type = cvt_flip(m->in_type, flip)) {
 1778|  21.1k|		case FILE_BYTE:
  ------------------
  |  |  254|  21.1k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1778:3): [True: 21.1k, False: 1.04M]
  ------------------
 1779|  21.1k|			if (offset_oob(nbytes, offset, 1))
  ------------------
  |  Branch (1779:8): [True: 36, False: 21.1k]
  ------------------
 1780|     36|				return 0;
 1781|  21.1k|			if (do_ops(ms, m, &offset, SEXT(sgn,8,p->b), off))
  ------------------
  |  |  108|  21.1k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 21.1k]
  |  |  ------------------
  |  |  109|  21.1k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  21.1k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  21.1k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1781:8): [True: 0, False: 21.1k]
  ------------------
 1782|      0|				return 0;
 1783|  21.1k|			break;
 1784|  21.1k|		case FILE_BESHORT:
  ------------------
  |  |  260|  10.9k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1784:3): [True: 10.9k, False: 1.05M]
  ------------------
 1785|  10.9k|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1785:8): [True: 162, False: 10.8k]
  ------------------
 1786|    162|				return 0;
 1787|  10.8k|			if (do_ops(ms, m, &offset, SEXT(sgn,16,BE16(p->hs)), off))
  ------------------
  |  |  108|  10.8k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 10.8k]
  |  |  ------------------
  |  |  109|  10.8k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  10.8k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  10.8k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1787:8): [True: 0, False: 10.8k]
  ------------------
 1788|      0|				return 0;
 1789|  10.8k|			break;
 1790|  10.8k|		case FILE_LESHORT:
  ------------------
  |  |  263|  9.32k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1790:3): [True: 9.32k, False: 1.05M]
  ------------------
 1791|  9.32k|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1791:8): [True: 1.04k, False: 8.27k]
  ------------------
 1792|  1.04k|				return 0;
 1793|  8.27k|			if (do_ops(ms, m, &offset, SEXT(sgn,16,LE16(p->hs)), off))
  ------------------
  |  |  108|  8.27k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 8.27k]
  |  |  ------------------
  |  |  109|  8.27k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  8.27k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  8.27k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1793:8): [True: 0, False: 8.27k]
  ------------------
 1794|      0|				return 0;
 1795|  8.27k|			break;
 1796|  8.27k|		case FILE_SHORT:
  ------------------
  |  |  255|      0|#define				FILE_SHORT		2
  ------------------
  |  Branch (1796:3): [True: 0, False: 1.06M]
  ------------------
 1797|      0|			if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1797:8): [True: 0, False: 0]
  ------------------
 1798|      0|				return 0;
 1799|      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 (1799:8): [True: 0, False: 0]
  ------------------
 1800|      0|				return 0;
 1801|      0|			break;
 1802|  2.51k|		case FILE_BELONG:
  ------------------
  |  |  261|  2.51k|#define				FILE_BELONG		8
  ------------------
  |  Branch (1802:3): [True: 2.51k, False: 1.06M]
  ------------------
 1803|  2.63k|		case FILE_BEID3:
  ------------------
  |  |  292|  2.63k|#define				FILE_BEID3		39
  ------------------
  |  Branch (1803:3): [True: 116, False: 1.06M]
  ------------------
 1804|  2.63k|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1804:8): [True: 194, False: 2.43k]
  ------------------
 1805|    194|				return 0;
 1806|  2.43k|			lhs = BE32(p->hl);
  ------------------
  |  |   95|  2.43k|#define BE32(p) ( \
  |  |   96|  2.43k|    (CAST(uint32_t, (p)[0])<<24)| \
  |  |  ------------------
  |  |  |  |  460|  2.43k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   97|  2.43k|    (CAST(uint32_t, (p)[1])<<16)| \
  |  |  ------------------
  |  |  |  |  460|  2.43k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   98|  2.43k|    (CAST(uint32_t, (p)[2])<<8)| \
  |  |  ------------------
  |  |  |  |  460|  2.43k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   99|  2.43k|    (CAST(uint32_t, (p)[3])))
  |  |  ------------------
  |  |  |  |  460|  2.43k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1807|  2.43k|			if (in_type == FILE_BEID3)
  ------------------
  |  |  292|  2.43k|#define				FILE_BEID3		39
  ------------------
  |  Branch (1807:8): [True: 84, False: 2.35k]
  ------------------
 1808|     84|				lhs = cvt_id3(ms, CAST(uint32_t, lhs));
  ------------------
  |  |  460|     84|#define CAST(T, b)	((T)(b))
  ------------------
 1809|  2.43k|			if (do_ops(ms, m, &offset, SEXT(sgn,32,lhs), off))
  ------------------
  |  |  108|  2.43k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 2.43k]
  |  |  ------------------
  |  |  109|  2.43k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  2.43k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  2.43k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1809:8): [True: 271, False: 2.16k]
  ------------------
 1810|    271|				return 0;
 1811|  2.16k|			break;
 1812|  1.01M|		case FILE_LELONG:
  ------------------
  |  |  264|  1.01M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1812:3): [True: 1.01M, False: 49.7k]
  ------------------
 1813|  1.01M|		case FILE_LEID3:
  ------------------
  |  |  293|  1.01M|#define				FILE_LEID3		40
  ------------------
  |  Branch (1813:3): [True: 0, False: 1.06M]
  ------------------
 1814|  1.01M|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1814:8): [True: 324k, False: 690k]
  ------------------
 1815|   324k|				return 0;
 1816|   690k|			lhs = LE32(p->hl);
  ------------------
  |  |   90|   690k|#define LE32(p) ( \
  |  |   91|   690k|    (CAST(uint32_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  460|   690k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   92|   690k|    (CAST(uint32_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  460|   690k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   93|   690k|    (CAST(uint32_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  460|   690k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   94|   690k|    (CAST(uint32_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  460|   690k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1817|   690k|			if (in_type == FILE_LEID3)
  ------------------
  |  |  293|   690k|#define				FILE_LEID3		40
  ------------------
  |  Branch (1817:8): [True: 0, False: 690k]
  ------------------
 1818|      0|				lhs = cvt_id3(ms, CAST(uint32_t, lhs));
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 1819|   690k|			if (do_ops(ms, m, &offset, SEXT(sgn,32,lhs), off))
  ------------------
  |  |  108|   690k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 690k]
  |  |  ------------------
  |  |  109|   690k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|   690k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|   690k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1819:8): [True: 7.73k, False: 682k]
  ------------------
 1820|  7.73k|				return 0;
 1821|   682k|			break;
 1822|   682k|		case FILE_MELONG:
  ------------------
  |  |  276|      0|#define				FILE_MELONG		23
  ------------------
  |  Branch (1822:3): [True: 0, False: 1.06M]
  ------------------
 1823|      0|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1823:8): [True: 0, False: 0]
  ------------------
 1824|      0|				return 0;
 1825|      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 (1825:8): [True: 0, False: 0]
  ------------------
 1826|      0|				return 0;
 1827|      0|			break;
 1828|    361|		case FILE_LONG:
  ------------------
  |  |  257|    361|#define				FILE_LONG		4
  ------------------
  |  Branch (1828:3): [True: 361, False: 1.06M]
  ------------------
 1829|    361|			if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1829:8): [True: 75, False: 286]
  ------------------
 1830|     75|				return 0;
 1831|    286|			if (do_ops(ms, m, &offset, SEXT(sgn,32,p->l), off))
  ------------------
  |  |  108|    286|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 286]
  |  |  ------------------
  |  |  109|    286|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    286|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    286|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1831:8): [True: 78, False: 208]
  ------------------
 1832|     78|				return 0;
 1833|    208|			break;
 1834|  4.54k|		case FILE_LEQUAD:
  ------------------
  |  |  278|  4.54k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1834:3): [True: 4.54k, False: 1.05M]
  ------------------
 1835|  4.54k|			if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1835:8): [True: 119, False: 4.42k]
  ------------------
 1836|    119|				return 0;
 1837|  4.42k|			if (do_ops(ms, m, &offset, SEXT(sgn,64,LE64(p->hq)), off))	
  ------------------
  |  |  108|  4.42k|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 4.42k]
  |  |  ------------------
  |  |  109|  4.42k|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|  4.42k|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|  4.42k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1837:8): [True: 1.40k, False: 3.01k]
  ------------------
 1838|  1.40k|				return 0;
 1839|  3.01k|			break;
 1840|  3.01k|		case FILE_BEQUAD:
  ------------------
  |  |  279|    429|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1840:3): [True: 429, False: 1.06M]
  ------------------
 1841|    429|			if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1841:8): [True: 0, False: 429]
  ------------------
 1842|      0|				return 0;
 1843|    429|			if (do_ops(ms, m, &offset, SEXT(sgn,64,BE64(p->hq)), off))
  ------------------
  |  |  108|    429|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 429]
  |  |  ------------------
  |  |  109|    429|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    429|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    429|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1843:8): [True: 300, False: 129]
  ------------------
 1844|    300|				return 0;
 1845|    129|			break;
 1846|    318|		case FILE_OCTAL:
  ------------------
  |  |  314|    318|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1846:3): [True: 318, False: 1.06M]
  ------------------
 1847|    318|			if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1847:8): [True: 112, False: 206]
  ------------------
 1848|    112|				return 0;
 1849|    206|			if(do_ops(ms, m, &offset,
  ------------------
  |  Branch (1849:7): [True: 67, False: 139]
  ------------------
 1850|    206|			    SEXT(sgn,64,strtoull(p->s, NULL, 8)), off))
  ------------------
  |  |  108|    206|#define SEXT(s,v,p) ((s) ? \
  |  |  ------------------
  |  |  |  Branch (108:22): [True: 0, False: 206]
  |  |  ------------------
  |  |  109|    206|	CAST(intmax_t, CAST(int##v##_t, p)) : \
  |  |  ------------------
  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  110|    206|	CAST(intmax_t, CAST(uint##v##_t, p)))
  |  |  ------------------
  |  |  |  |  460|    206|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1851|     67|				return 0;
 1852|    139|			break;
 1853|    139|		default:
  ------------------
  |  Branch (1853:3): [True: 0, False: 1.06M]
  ------------------
 1854|      0|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1854:8): [True: 0, False: 0]
  ------------------
 1855|      0|				fprintf(stderr, "bad in_type=%d\n", in_type);
 1856|      0|			return 0;
 1857|  1.06M|		}
 1858|       |
 1859|   728k|		if (m->flag & INDIROFFADD) {
  ------------------
  |  |  236|   728k|#define INDIROFFADD	0x04	/* if '>&(' appears */
  ------------------
  |  Branch (1859:7): [True: 5.10k, False: 723k]
  ------------------
 1860|  5.10k|			if (cont_level == 0) {
  ------------------
  |  Branch (1860:8): [True: 0, False: 5.10k]
  ------------------
 1861|      0|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|      0|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1861:9): [True: 0, False: 0]
  ------------------
 1862|      0|					fprintf(stderr,
 1863|      0|					    "indirect *zero* cont_level\n");
 1864|      0|				return 0;
 1865|      0|			}
 1866|  5.10k|			offset += ms->c.li[cont_level - 1].off;
 1867|  5.10k|			if (offset == 0) {
  ------------------
  |  Branch (1867:8): [True: 142, False: 4.96k]
  ------------------
 1868|    142|				if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    142|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1868:9): [True: 0, False: 142]
  ------------------
 1869|      0|					fprintf(stderr,
 1870|      0|					    "indirect *zero* offset\n");
 1871|    142|				return 0;
 1872|    142|			}
 1873|  4.96k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  4.96k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1873:8): [True: 0, False: 4.96k]
  ------------------
 1874|      0|				fprintf(stderr, "indirect +offs=%u\n", offset);
 1875|  4.96k|		}
 1876|   728k|		if (mcopy(ms, p, m->type, 0, s, offset, nbytes, m) == -1)
  ------------------
  |  Branch (1876:7): [True: 0, False: 728k]
  ------------------
 1877|      0|			return -1;
 1878|   728k|		ms->offset = offset;
 1879|       |
 1880|   728k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   728k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1880:7): [True: 0, False: 728k]
  ------------------
 1881|      0|			mdebug(offset, RCAST(char *, RCAST(void *, p)),
  ------------------
  |  |  461|      0|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1882|      0|			    sizeof(union VALUETYPE));
 1883|      0|#ifndef COMPILE_ONLY
 1884|      0|			file_mdump(m);
 1885|      0|#endif
 1886|      0|		}
 1887|   728k|	}
 1888|       |
 1889|       |	/* Verify we have enough data to match magic type */
 1890|   159M|	switch (m->type) {
 1891|  2.57M|	case FILE_BYTE:
  ------------------
  |  |  254|  2.57M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1891:2): [True: 2.57M, False: 156M]
  ------------------
 1892|  2.57M|		if (offset_oob(nbytes, offset, 1))
  ------------------
  |  Branch (1892:7): [True: 180k, False: 2.39M]
  ------------------
 1893|   180k|			return 0;
 1894|  2.39M|		break;
 1895|       |
 1896|  3.00M|	case FILE_SHORT:
  ------------------
  |  |  255|  3.00M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1896:2): [True: 3.00M, False: 156M]
  ------------------
 1897|  9.27M|	case FILE_BESHORT:
  ------------------
  |  |  260|  9.27M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1897:2): [True: 6.26M, False: 152M]
  ------------------
 1898|  15.1M|	case FILE_LESHORT:
  ------------------
  |  |  263|  15.1M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1898:2): [True: 5.86M, False: 153M]
  ------------------
 1899|  15.1M|		if (offset_oob(nbytes, offset, 2))
  ------------------
  |  Branch (1899:7): [True: 978k, False: 14.1M]
  ------------------
 1900|   978k|			return 0;
 1901|  14.1M|		break;
 1902|       |
 1903|  14.1M|	case FILE_LONG:
  ------------------
  |  |  257|  2.32M|#define				FILE_LONG		4
  ------------------
  |  Branch (1903:2): [True: 2.32M, False: 156M]
  ------------------
 1904|  21.9M|	case FILE_BELONG:
  ------------------
  |  |  261|  21.9M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1904:2): [True: 19.6M, False: 139M]
  ------------------
 1905|  32.1M|	case FILE_LELONG:
  ------------------
  |  |  264|  32.1M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1905:2): [True: 10.2M, False: 148M]
  ------------------
 1906|  32.1M|	case FILE_MELONG:
  ------------------
  |  |  276|  32.1M|#define				FILE_MELONG		23
  ------------------
  |  Branch (1906:2): [True: 37, False: 159M]
  ------------------
 1907|  32.1M|	case FILE_DATE:
  ------------------
  |  |  259|  32.1M|#define				FILE_DATE		6
  ------------------
  |  Branch (1907:2): [True: 0, False: 159M]
  ------------------
 1908|  32.1M|	case FILE_BEDATE:
  ------------------
  |  |  262|  32.1M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1908:2): [True: 617, False: 159M]
  ------------------
 1909|  32.1M|	case FILE_LEDATE:
  ------------------
  |  |  265|  32.1M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1909:2): [True: 202, False: 159M]
  ------------------
 1910|  32.1M|	case FILE_MEDATE:
  ------------------
  |  |  274|  32.1M|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1910:2): [True: 141, False: 159M]
  ------------------
 1911|  32.1M|	case FILE_LDATE:
  ------------------
  |  |  267|  32.1M|#define				FILE_LDATE		14
  ------------------
  |  Branch (1911:2): [True: 0, False: 159M]
  ------------------
 1912|  32.1M|	case FILE_BELDATE:
  ------------------
  |  |  268|  32.1M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1912:2): [True: 538, False: 159M]
  ------------------
 1913|  32.1M|	case FILE_LELDATE:
  ------------------
  |  |  269|  32.1M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1913:2): [True: 151, False: 159M]
  ------------------
 1914|  32.1M|	case FILE_MELDATE:
  ------------------
  |  |  275|  32.1M|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1914:2): [True: 0, False: 159M]
  ------------------
 1915|  32.1M|	case FILE_FLOAT:
  ------------------
  |  |  286|  32.1M|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1915:2): [True: 0, False: 159M]
  ------------------
 1916|  32.1M|	case FILE_BEFLOAT:
  ------------------
  |  |  287|  32.1M|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (1916:2): [True: 0, False: 159M]
  ------------------
 1917|  32.1M|	case FILE_LEFLOAT:
  ------------------
  |  |  288|  32.1M|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1917:2): [True: 10.2k, False: 159M]
  ------------------
 1918|  32.1M|		if (offset_oob(nbytes, offset, 4))
  ------------------
  |  Branch (1918:7): [True: 2.07M, False: 30.0M]
  ------------------
 1919|  2.07M|			return 0;
 1920|  30.0M|		break;
 1921|       |
 1922|  30.0M|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1922:2): [True: 0, False: 159M]
  ------------------
 1923|    233|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|    233|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1923:2): [True: 233, False: 159M]
  ------------------
 1924|  2.33k|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|  2.33k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1924:2): [True: 2.10k, False: 159M]
  ------------------
 1925|  2.33k|		if (offset_oob(nbytes, offset, 8))
  ------------------
  |  Branch (1925:7): [True: 772, False: 1.56k]
  ------------------
 1926|    772|			return 0;
 1927|  1.56k|		break;
 1928|       |
 1929|  1.56k|	case FILE_LEGUID:
  ------------------
  |  |  303|      0|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1929:2): [True: 0, False: 159M]
  ------------------
 1930|     73|	case FILE_BEGUID:
  ------------------
  |  |  304|     73|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1930:2): [True: 73, False: 159M]
  ------------------
 1931|   372k|	case FILE_GUID:
  ------------------
  |  |  302|   372k|#define				FILE_GUID		49
  ------------------
  |  Branch (1931:2): [True: 372k, False: 158M]
  ------------------
 1932|   372k|		if (offset_oob(nbytes, offset, 16))
  ------------------
  |  Branch (1932:7): [True: 23.5k, False: 349k]
  ------------------
 1933|  23.5k|			return 0;
 1934|   349k|		break;
 1935|       |
 1936|   103M|	case FILE_STRING:
  ------------------
  |  |  258|   103M|#define				FILE_STRING		5
  ------------------
  |  Branch (1936:2): [True: 103M, False: 55.9M]
  ------------------
 1937|   103M|	case FILE_PSTRING:
  ------------------
  |  |  266|   103M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1937:2): [True: 49.7k, False: 159M]
  ------------------
 1938|   104M|	case FILE_SEARCH:
  ------------------
  |  |  273|   104M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1938:2): [True: 1.39M, False: 157M]
  ------------------
 1939|   104M|	case FILE_OCTAL:
  ------------------
  |  |  314|   104M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1939:2): [True: 0, False: 159M]
  ------------------
 1940|   104M|		if (offset_oob(nbytes, offset, m->vallen))
  ------------------
  |  Branch (1940:7): [True: 12.8M, False: 91.8M]
  ------------------
 1941|  12.8M|			return 0;
 1942|  91.8M|		break;
 1943|       |
 1944|  91.8M|	case FILE_REGEX:
  ------------------
  |  |  270|   594k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1944:2): [True: 594k, False: 158M]
  ------------------
 1945|   594k|		if (nbytes < offset)
  ------------------
  |  Branch (1945:7): [True: 804, False: 593k]
  ------------------
 1946|    804|			return 0;
 1947|   593k|		break;
 1948|       |
 1949|   593k|	case FILE_INDIRECT:
  ------------------
  |  |  294|  36.6k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (1949:2): [True: 36.6k, False: 159M]
  ------------------
 1950|  36.6k|		if (m->str_flags & INDIRECT_RELATIVE)
  ------------------
  |  |  390|  36.6k|#define str_flags _u._s._flags
  ------------------
              		if (m->str_flags & INDIRECT_RELATIVE)
  ------------------
  |  |  443|  36.6k|#define	INDIRECT_RELATIVE			BIT(0)
  |  |  ------------------
  |  |  |  |  403|  36.6k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (1950:7): [True: 2.44k, False: 34.1k]
  ------------------
 1951|  2.44k|			offset += CAST(uint32_t, o);
  ------------------
  |  |  460|  2.44k|#define CAST(T, b)	((T)(b))
  ------------------
 1952|  36.6k|		if (offset == 0)
  ------------------
  |  Branch (1952:7): [True: 333, False: 36.2k]
  ------------------
 1953|    333|			return 0;
 1954|       |
 1955|  36.2k|		if (nbytes < offset)
  ------------------
  |  Branch (1955:7): [True: 1.62k, False: 34.6k]
  ------------------
 1956|  1.62k|			return 0;
 1957|       |
 1958|  34.6k|		if ((pb = file_push_buffer(ms)) == NULL)
  ------------------
  |  Branch (1958:7): [True: 8, False: 34.6k]
  ------------------
 1959|      8|			return -1;
 1960|       |
 1961|  34.6k|		(*indir_count)++;
 1962|  34.6k|		sbb = *b;
 1963|  34.6k|		sbb.fbuf = s + offset;
 1964|  34.6k|		sbb.flen = nbytes - offset;
 1965|  34.6k|		sbb.ebuf = NULL;
 1966|  34.6k|		sbb.elen = 0;
 1967|  34.6k|		rv = -1;
 1968|  42.0k|		for (mlp = ms->mlist[0]->next; mlp != ms->mlist[0];
  ------------------
  |  Branch (1968:34): [True: 34.6k, False: 7.33k]
  ------------------
 1969|  34.6k|		    mlp = mlp->next)
 1970|  34.6k|		{
 1971|  34.6k|			if ((rv = match(ms, mlp->magic, mlp->magic_rxcomp,
  ------------------
  |  Branch (1971:8): [True: 27.3k, False: 7.33k]
  ------------------
 1972|  34.6k|			    mlp->nmagic, &sbb, 0, BINTEST, text, 0, indir_count,
  ------------------
  |  |  239|  34.6k|#define BINTEST		0x20	/* test is for a binary type (set only
  ------------------
 1973|  34.6k|			    name_count, printed_something, need_separator,
 1974|  34.6k|			    firstline, NULL, NULL)) != 0)
 1975|  27.3k|				break;
 1976|  34.6k|		}
 1977|  34.6k|		buffer_fini(&sbb);
 1978|       |
 1979|  34.6k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  34.6k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1979:7): [True: 0, False: 34.6k]
  ------------------
 1980|      0|			fprintf(stderr, "indirect @offs=%u[%d]\n", offset, rv);
 1981|       |
 1982|  34.6k|		rbuf = file_pop_buffer(ms, pb);
 1983|  34.6k|		if (rbuf == NULL && ms->event_flags & EVENT_HAD_ERR)
  ------------------
  |  |  495|  16.0k|#define 		EVENT_HAD_ERR		0x01
  ------------------
  |  Branch (1983:7): [True: 16.0k, False: 18.6k]
  |  Branch (1983:23): [True: 11.4k, False: 4.61k]
  ------------------
 1984|  11.4k|			return -1;
 1985|       |
 1986|  23.2k|		if (rv == 1) {
  ------------------
  |  Branch (1986:7): [True: 15.9k, False: 7.33k]
  ------------------
 1987|  15.9k|			if ((ms->flags & MAGIC_NODESC) == 0 &&
  ------------------
  |  |   52|  15.9k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  15.9k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  15.9k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  15.9k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  15.9k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  15.9k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  |  Branch (1987:8): [True: 15.9k, False: 0]
  ------------------
 1988|  15.9k|			    file_printf(ms, F(ms, m->desc, "%u"), offset) == -1)
  ------------------
  |  |  167|  15.9k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (1988:8): [True: 0, False: 15.9k]
  ------------------
 1989|      0|			{
 1990|      0|				free(rbuf);
 1991|      0|				return -1;
 1992|      0|			}
 1993|  15.9k|			if (file_printf(ms, "%s", rbuf) == -1) {
  ------------------
  |  Branch (1993:8): [True: 125, False: 15.7k]
  ------------------
 1994|    125|				free(rbuf);
 1995|    125|				return -1;
 1996|    125|			}
 1997|  15.9k|		}
 1998|  23.1k|		free(rbuf);
 1999|  23.1k|		return rv;
 2000|       |
 2001|  53.4k|	case FILE_USE:
  ------------------
  |  |  299|  53.4k|#define				FILE_USE		46
  ------------------
  |  Branch (2001:2): [True: 53.4k, False: 159M]
  ------------------
 2002|  53.4k|		if (nbytes < offset)
  ------------------
  |  Branch (2002:7): [True: 2.01k, False: 51.4k]
  ------------------
 2003|  2.01k|			return 0;
 2004|  51.4k|		rbuf = m->value.s;
 2005|  51.4k|		if (*rbuf == '^') {
  ------------------
  |  Branch (2005:7): [True: 1.15k, False: 50.3k]
  ------------------
 2006|  1.15k|			rbuf++;
 2007|  1.15k|			flip = !flip;
 2008|  1.15k|		}
 2009|  51.4k|		if (file_magicfind(ms, rbuf, &ml) == -1) {
  ------------------
  |  Branch (2009:7): [True: 0, False: 51.4k]
  ------------------
 2010|      0|			file_error(ms, 0, "cannot find entry `%s'", rbuf);
 2011|      0|			return -1;
 2012|      0|		}
 2013|  51.4k|		if (save_cont(ms, &c) == -1) {
  ------------------
  |  Branch (2013:7): [True: 0, False: 51.4k]
  ------------------
 2014|      0|			file_error(ms, errno, "can't allocate continuation");
 2015|      0|			return -1;
 2016|      0|		}
 2017|       |
 2018|  51.4k|		oneed_separator = *need_separator;
 2019|  51.4k|		if (m->flag & NOSPACE)
  ------------------
  |  |  238|  51.4k|#define NOSPACE		0x10	/* suppress space character before output */
  ------------------
  |  Branch (2019:7): [True: 942, False: 50.5k]
  ------------------
 2020|    942|			*need_separator = 0;
 2021|       |
 2022|  51.4k|		nfound_match = 0;
 2023|  51.4k|		(*name_count)++;
 2024|  51.4k|		eoffset = ms->eoffset;
 2025|  51.4k|		rv = match(ms, ml.magic, ml.magic_rxcomp, ml.nmagic, b,
 2026|  51.4k|		    offset + o, mode, text, flip, indir_count, name_count,
 2027|  51.4k|		    printed_something, need_separator, firstline, returnval,
 2028|  51.4k|		    &nfound_match);
 2029|  51.4k|		ms->ms_value.q = nfound_match;
 2030|  51.4k|		(*name_count)--;
 2031|  51.4k|		*found_match |= nfound_match;
 2032|       |
 2033|  51.4k|		restore_cont(ms, &c);
 2034|       |
 2035|  51.4k|		if (rv != 1)
  ------------------
  |  Branch (2035:7): [True: 14.0k, False: 37.3k]
  ------------------
 2036|  14.0k|		    *need_separator = oneed_separator;
 2037|  51.4k|		ms->offset = offset;
 2038|  51.4k|		ms->eoffset = eoffset;
 2039|  51.4k|		return rv ? rv : *found_match;
  ------------------
  |  Branch (2039:10): [True: 38.2k, False: 13.2k]
  ------------------
 2040|       |
 2041|  51.4k|	case FILE_NAME:
  ------------------
  |  |  298|  51.4k|#define				FILE_NAME		45
  ------------------
  |  Branch (2041:2): [True: 51.4k, False: 159M]
  ------------------
 2042|  51.4k|		if (ms->flags & MAGIC_NODESC)
  ------------------
  |  |   52|  51.4k|#define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   46|  51.4k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   44|  51.4k|#define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   37|  51.4k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  |  |  |  |  ------------------
  |  |  |  |               #define MAGIC_MIME		(MAGIC_MIME_TYPE|MAGIC_MIME_ENCODING)
  |  |  |  |  ------------------
  |  |  |  |  |  |   43|  51.4k|#define	MAGIC_MIME_ENCODING	0x0000400 /* Return the MIME encoding */
  |  |  |  |  ------------------
  |  |  ------------------
  |  |               #define MAGIC_NODESC		(MAGIC_EXTENSION|MAGIC_MIME|MAGIC_APPLE)
  |  |  ------------------
  |  |  |  |   45|  51.4k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  |  |  ------------------
  ------------------
  |  Branch (2042:7): [True: 0, False: 51.4k]
  ------------------
 2043|      0|			return 1;
 2044|  51.4k|		if (file_printf(ms, "%s", m->desc) == -1)
  ------------------
  |  Branch (2044:7): [True: 0, False: 51.4k]
  ------------------
 2045|      0|			return -1;
 2046|  51.4k|		return 1;
 2047|   567k|	case FILE_DER:
  ------------------
  |  |  301|   567k|#define				FILE_DER		48
  ------------------
  |  Branch (2047:2): [True: 567k, False: 158M]
  ------------------
 2048|   576k|	case FILE_DEFAULT:	/* nothing to check */
  ------------------
  |  |  256|   576k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (2048:2): [True: 8.77k, False: 159M]
  ------------------
 2049|   578k|	case FILE_CLEAR:
  ------------------
  |  |  300|   578k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (2049:2): [True: 1.86k, False: 159M]
  ------------------
 2050|  3.51M|	default:
  ------------------
  |  Branch (2050:2): [True: 2.93M, False: 156M]
  ------------------
 2051|  3.51M|		break;
 2052|   159M|	}
 2053|   142M|	if (!mconvert(ms, m, flip))
  ------------------
  |  Branch (2053:6): [True: 94, False: 142M]
  ------------------
 2054|     94|		return 0;
 2055|   142M|	return 1;
 2056|   142M|}
softmagic.c:mcopy:
 1380|   160M|{
 1381|   160M|	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|   160M|	if (indir == 0) {
  ------------------
  |  Branch (1386:6): [True: 159M, False: 1.06M]
  ------------------
 1387|   159M|		switch (type) {
 1388|   567k|		case FILE_DER:
  ------------------
  |  |  301|   567k|#define				FILE_DER		48
  ------------------
  |  Branch (1388:3): [True: 567k, False: 158M]
  ------------------
 1389|  1.96M|		case FILE_SEARCH:
  ------------------
  |  |  273|  1.96M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1389:3): [True: 1.39M, False: 157M]
  ------------------
 1390|  1.96M|			if (offset > nbytes)
  ------------------
  |  Branch (1390:8): [True: 66.1k, False: 1.89M]
  ------------------
 1391|  66.1k|				offset = CAST(uint32_t, nbytes);
  ------------------
  |  |  460|  66.1k|#define CAST(T, b)	((T)(b))
  ------------------
 1392|  1.96M|			ms->search.s = RCAST(const char *, s) + offset;
  ------------------
  |  |  461|  1.96M|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1393|  1.96M|			ms->search.s_len = nbytes - offset;
 1394|  1.96M|			ms->search.offset = offset;
 1395|  1.96M|			return 0;
 1396|       |
 1397|   594k|		case FILE_REGEX: {
  ------------------
  |  |  270|   594k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1397:3): [True: 594k, False: 158M]
  ------------------
 1398|   594k|			const char *b;
 1399|   594k|			const char *c;
 1400|   594k|			const char *last;	/* end of search region */
 1401|   594k|			const char *buf;	/* start of search region */
 1402|   594k|			const char *end;
 1403|   594k|			size_t lines, linecnt, bytecnt;
 1404|       |
 1405|   594k|			if (s == NULL || nbytes < offset) {
  ------------------
  |  Branch (1405:8): [True: 0, False: 594k]
  |  Branch (1405:21): [True: 874, False: 593k]
  ------------------
 1406|    874|				ms->search.s_len = 0;
 1407|    874|				ms->search.s = NULL;
 1408|    874|				return 0;
 1409|    874|			}
 1410|       |
 1411|   593k|			if (m->str_flags & REGEX_LINE_COUNT) {
  ------------------
  |  |  390|   593k|#define str_flags _u._s._flags
  ------------------
              			if (m->str_flags & REGEX_LINE_COUNT) {
  ------------------
  |  |  417|   593k|#define REGEX_LINE_COUNT			BIT(11)
  |  |  ------------------
  |  |  |  |  403|   593k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (1411:8): [True: 62.9k, False: 530k]
  ------------------
 1412|  62.9k|				linecnt = m->str_range;
  ------------------
  |  |  389|  62.9k|#define str_range _u._s._count
  ------------------
 1413|  62.9k|				bytecnt = linecnt * 80;
 1414|   530k|			} else {
 1415|   530k|				linecnt = 0;
 1416|   530k|				bytecnt = m->str_range;
  ------------------
  |  |  389|   530k|#define str_range _u._s._count
  ------------------
 1417|   530k|			}
 1418|       |
 1419|   593k|			if (bytecnt == 0 || bytecnt > nbytes - offset)
  ------------------
  |  Branch (1419:8): [True: 258k, False: 334k]
  |  Branch (1419:24): [True: 196k, False: 138k]
  ------------------
 1420|   455k|				bytecnt = nbytes - offset;
 1421|   593k|			if (bytecnt > ms->regex_max)
  ------------------
  |  Branch (1421:8): [True: 82.6k, False: 510k]
  ------------------
 1422|  82.6k|				bytecnt = ms->regex_max;
 1423|       |
 1424|   593k|			buf = RCAST(const char *, s) + offset;
  ------------------
  |  |  461|   593k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1425|   593k|			end = last = RCAST(const char *, s) + bytecnt + offset;
  ------------------
  |  |  461|   593k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1426|       |			/* mget() guarantees buf <= last */
 1427|   814k|			for (lines = linecnt, b = buf; lines && b < end &&
  ------------------
  |  Branch (1427:35): [True: 281k, False: 532k]
  |  Branch (1427:44): [True: 277k, False: 3.76k]
  ------------------
 1428|   277k|			     ((b = CAST(const char *,
  ------------------
  |  |  460|   277k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1428:10): [True: 127k, False: 150k]
  ------------------
 1429|   277k|				 memchr(c = b, '\n', CAST(size_t, (end - b)))))
 1430|   150k|			     || (b = CAST(const char *,
  ------------------
  |  |  460|   150k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1430:12): [True: 93.5k, False: 56.8k]
  ------------------
 1431|   150k|				 memchr(c, '\r', CAST(size_t, (end - c))))));
 1432|   593k|			     lines--, b++) {
 1433|   220k|				if (b < end - 1 && b[0] == '\r' && b[1] == '\n')
  ------------------
  |  Branch (1433:9): [True: 217k, False: 3.16k]
  |  Branch (1433:24): [True: 92.6k, False: 124k]
  |  Branch (1433:40): [True: 0, False: 92.6k]
  ------------------
 1434|      0|					b++;
 1435|   220k|				if (b < end - 1 && b[0] == '\n')
  ------------------
  |  Branch (1435:9): [True: 217k, False: 3.16k]
  |  Branch (1435:24): [True: 124k, False: 92.6k]
  ------------------
 1436|   124k|					b++;
 1437|   220k|				last = b;
 1438|   220k|			}
 1439|   593k|			if (lines)
  ------------------
  |  Branch (1439:8): [True: 60.6k, False: 532k]
  ------------------
 1440|  60.6k|				last = end;
 1441|       |
 1442|   593k|			ms->search.s = buf;
 1443|   593k|			ms->search.s_len = last - buf;
 1444|   593k|			ms->search.offset = offset;
 1445|   593k|			ms->search.rm_len = 0;
 1446|   593k|			return 0;
 1447|   594k|		}
 1448|    138|		case FILE_BESTRING16:
  ------------------
  |  |  271|    138|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1448:3): [True: 138, False: 159M]
  ------------------
 1449|  93.3k|		case FILE_LESTRING16: {
  ------------------
  |  |  272|  93.3k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1449:3): [True: 93.2k, False: 159M]
  ------------------
 1450|  93.3k|			const unsigned char *src = s + offset;
 1451|  93.3k|			const unsigned char *esrc = s + nbytes;
 1452|  93.3k|			char *dst = p->s;
 1453|  93.3k|			char *edst = &p->s[sizeof(p->s) - 1];
 1454|       |
 1455|  93.3k|			if (type == FILE_BESTRING16)
  ------------------
  |  |  271|  93.3k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1455:8): [True: 138, False: 93.2k]
  ------------------
 1456|    138|				src++;
 1457|       |
 1458|       |			/* check that offset is within range */
 1459|  93.3k|			if (offset >= nbytes)
  ------------------
  |  Branch (1459:8): [True: 1.08k, False: 92.2k]
  ------------------
 1460|  1.08k|				break;
 1461|  7.20M|			for (/*EMPTY*/; src < esrc; src += 2, dst++) {
  ------------------
  |  Branch (1461:20): [True: 7.16M, False: 41.8k]
  ------------------
 1462|  7.16M|				if (dst < edst)
  ------------------
  |  Branch (1462:9): [True: 7.11M, False: 50.4k]
  ------------------
 1463|  7.11M|					*dst = *src;
 1464|  50.4k|				else
 1465|  50.4k|					break;
 1466|  7.11M|				if (*dst == '\0') {
  ------------------
  |  Branch (1466:9): [True: 3.27M, False: 3.83M]
  ------------------
 1467|  3.27M|					if (type == FILE_BESTRING16 ?
  ------------------
  |  |  271|  3.27M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1467:10): [True: 7.97k, False: 3.26M]
  |  Branch (1467:10): [True: 611k, False: 2.66M]
  ------------------
 1468|  7.97k|					    *(src - 1) != '\0' :
 1469|  3.27M|					    ((src + 1 < esrc) &&
  ------------------
  |  Branch (1469:11): [True: 3.26M, False: 3.74k]
  ------------------
 1470|  3.26M|					    *(src + 1) != '\0'))
  ------------------
  |  Branch (1470:10): [True: 608k, False: 2.65M]
  ------------------
 1471|   611k|						*dst = ' ';
 1472|  3.27M|				}
 1473|  7.11M|			}
 1474|  92.2k|			*edst = '\0';
 1475|  92.2k|			*dst = '\0';
 1476|  92.2k|			return 0;
 1477|  93.3k|		}
 1478|   103M|		case FILE_STRING:	/* XXX - these two should not need */
  ------------------
  |  |  258|   103M|#define				FILE_STRING		5
  ------------------
  |  Branch (1478:3): [True: 103M, False: 55.9M]
  ------------------
 1479|   103M|		case FILE_PSTRING:	/* to copy anything, but do anyway. */
  ------------------
  |  |  266|   103M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1479:3): [True: 49.7k, False: 159M]
  ------------------
 1480|   103M|			if (m->str_range != 0 && m->str_range < sizeof(*p))
  ------------------
  |  |  389|   103M|#define str_range _u._s._count
  ------------------
              			if (m->str_range != 0 && m->str_range < sizeof(*p))
  ------------------
  |  |  389|  89.1k|#define str_range _u._s._count
  ------------------
  |  Branch (1480:8): [True: 89.1k, False: 103M]
  |  Branch (1480:29): [True: 89.1k, False: 0]
  ------------------
 1481|  89.1k|				size = m->str_range;
  ------------------
  |  |  389|  89.1k|#define str_range _u._s._count
  ------------------
 1482|   103M|			break;
 1483|  53.2M|		default:
  ------------------
  |  Branch (1483:3): [True: 53.2M, False: 105M]
  ------------------
 1484|  53.2M|			break;
 1485|   159M|		}
 1486|   159M|	}
 1487|       |
 1488|   157M|	if (type == FILE_OFFSET) {
  ------------------
  |  |  305|   157M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1488:6): [True: 5.24k, False: 157M]
  ------------------
 1489|  5.24k|		(void)memset(p, '\0', sizeof(*p));
 1490|  5.24k|		p->q = offset;
 1491|  5.24k|		return 0;
 1492|  5.24k|	}
 1493|       |
 1494|   157M|	if (offset >= nbytes) {
  ------------------
  |  Branch (1494:6): [True: 7.15M, False: 150M]
  ------------------
 1495|  7.15M|		(void)memset(p, '\0', sizeof(*p));
 1496|  7.15M|		return 0;
 1497|  7.15M|	}
 1498|   150M|	if (nbytes - offset < size)
  ------------------
  |  Branch (1498:6): [True: 65.5M, False: 84.9M]
  ------------------
 1499|  65.5M|		nbytes = nbytes - offset;
 1500|  84.9M|	else
 1501|  84.9M|		nbytes = size;
 1502|       |
 1503|   150M|	(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|   150M|	if (nbytes < sizeof(*p))
  ------------------
  |  Branch (1509:6): [True: 65.6M, False: 84.8M]
  ------------------
 1510|  65.6M|		(void)memset(RCAST(char *, RCAST(void *, p)) + nbytes, '\0',
  ------------------
  |  |  461|  65.6M|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 1511|  65.6M|		    sizeof(*p) - nbytes);
 1512|   150M|	return 0;
 1513|   157M|}
softmagic.c:offset_oob:
  114|   156M| {
  115|   156M|	if (o < 0)
  ------------------
  |  Branch (115:6): [True: 0, False: 156M]
  ------------------
  116|      0|		return 1;
  117|   156M|        if ((uintmax_t)o > n)
  ------------------
  |  Branch (117:13): [True: 6.47M, False: 149M]
  ------------------
  118|  6.47M|		return 1;
  119|   149M|        return i > n - (uintmax_t)o;
  120|   156M|}
softmagic.c:cvt_flip:
 1028|   143M|{
 1029|   143M|	if (flip == 0)
  ------------------
  |  Branch (1029:6): [True: 143M, False: 23.3k]
  ------------------
 1030|   143M|		return type;
 1031|  23.3k|	switch (type) {
 1032|      7|	case FILE_BESHORT:
  ------------------
  |  |  260|      7|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1032:2): [True: 7, False: 23.3k]
  ------------------
 1033|      7|		return FILE_LESHORT;
  ------------------
  |  |  263|      7|#define				FILE_LESHORT		10
  ------------------
 1034|  7.57k|	case FILE_BELONG:
  ------------------
  |  |  261|  7.57k|#define				FILE_BELONG		8
  ------------------
  |  Branch (1034:2): [True: 7.57k, False: 15.7k]
  ------------------
 1035|  7.57k|		return FILE_LELONG;
  ------------------
  |  |  264|  7.57k|#define				FILE_LELONG		11
  ------------------
 1036|    120|	case FILE_BEDATE:
  ------------------
  |  |  262|    120|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1036:2): [True: 120, False: 23.1k]
  ------------------
 1037|    120|		return FILE_LEDATE;
  ------------------
  |  |  265|    120|#define				FILE_LEDATE		12
  ------------------
 1038|      0|	case FILE_BELDATE:
  ------------------
  |  |  268|      0|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1038:2): [True: 0, False: 23.3k]
  ------------------
 1039|      0|		return FILE_LELDATE;
  ------------------
  |  |  269|      0|#define				FILE_LELDATE		16
  ------------------
 1040|      0|	case FILE_BEQUAD:
  ------------------
  |  |  279|      0|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1040:2): [True: 0, False: 23.3k]
  ------------------
 1041|      0|		return FILE_LEQUAD;
  ------------------
  |  |  278|      0|#define				FILE_LEQUAD		25
  ------------------
 1042|  1.03k|	case FILE_BEQDATE:
  ------------------
  |  |  282|  1.03k|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1042:2): [True: 1.03k, False: 22.2k]
  ------------------
 1043|  1.03k|		return FILE_LEQDATE;
  ------------------
  |  |  281|  1.03k|#define				FILE_LEQDATE		28
  ------------------
 1044|      0|	case FILE_BEQLDATE:
  ------------------
  |  |  285|      0|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1044:2): [True: 0, False: 23.3k]
  ------------------
 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: 23.3k]
  ------------------
 1047|      0|		return FILE_LEQWDATE;
  ------------------
  |  |  296|      0|#define				FILE_LEQWDATE		43
  ------------------
 1048|  7.43k|	case FILE_LESHORT:
  ------------------
  |  |  263|  7.43k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1048:2): [True: 7.43k, False: 15.8k]
  ------------------
 1049|  7.43k|		return FILE_BESHORT;
  ------------------
  |  |  260|  7.43k|#define				FILE_BESHORT		7
  ------------------
 1050|  2.25k|	case FILE_LELONG:
  ------------------
  |  |  264|  2.25k|#define				FILE_LELONG		11
  ------------------
  |  Branch (1050:2): [True: 2.25k, False: 21.0k]
  ------------------
 1051|  2.25k|		return FILE_BELONG;
  ------------------
  |  |  261|  2.25k|#define				FILE_BELONG		8
  ------------------
 1052|     13|	case FILE_LEDATE:
  ------------------
  |  |  265|     13|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1052:2): [True: 13, False: 23.3k]
  ------------------
 1053|     13|		return FILE_BEDATE;
  ------------------
  |  |  262|     13|#define				FILE_BEDATE		9
  ------------------
 1054|      0|	case FILE_LELDATE:
  ------------------
  |  |  269|      0|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1054:2): [True: 0, False: 23.3k]
  ------------------
 1055|      0|		return FILE_BELDATE;
  ------------------
  |  |  268|      0|#define				FILE_BELDATE		15
  ------------------
 1056|    616|	case FILE_LEQUAD:
  ------------------
  |  |  278|    616|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1056:2): [True: 616, False: 22.7k]
  ------------------
 1057|    616|		return FILE_BEQUAD;
  ------------------
  |  |  279|    616|#define				FILE_BEQUAD		26
  ------------------
 1058|      0|	case FILE_LEQDATE:
  ------------------
  |  |  281|      0|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1058:2): [True: 0, False: 23.3k]
  ------------------
 1059|      0|		return FILE_BEQDATE;
  ------------------
  |  |  282|      0|#define				FILE_BEQDATE		29
  ------------------
 1060|    153|	case FILE_LEQLDATE:
  ------------------
  |  |  284|    153|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1060:2): [True: 153, False: 23.1k]
  ------------------
 1061|    153|		return FILE_BEQLDATE;
  ------------------
  |  |  285|    153|#define				FILE_BEQLDATE		32
  ------------------
 1062|      0|	case FILE_LEQWDATE:
  ------------------
  |  |  296|      0|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1062:2): [True: 0, False: 23.3k]
  ------------------
 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: 23.3k]
  ------------------
 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: 23.3k]
  ------------------
 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: 23.3k]
  ------------------
 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: 23.3k]
  ------------------
 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: 23.3k]
  ------------------
 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: 23.3k]
  ------------------
 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: 23.3k]
  ------------------
 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: 23.3k]
  ------------------
 1079|      0|		return FILE_BEMSDOSTIME;
  ------------------
  |  |  313|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
 1080|  4.11k|	default:
  ------------------
  |  Branch (1080:2): [True: 4.11k, False: 19.2k]
  ------------------
 1081|  4.11k|		return type;
 1082|  23.3k|	}
 1083|  23.3k|}
softmagic.c:do_ops:
 1518|   738k|{
 1519|   738k|	intmax_t offset;
 1520|       |	// On purpose not INTMAX_MAX
 1521|   738k|	if (lhs >= UINT_MAX || lhs <= INT_MIN ||
  ------------------
  |  Branch (1521:6): [True: 8.51k, False: 729k]
  |  Branch (1521:25): [True: 640, False: 728k]
  ------------------
 1522|   728k|	    off >= UINT_MAX || off <= INT_MIN) {
  ------------------
  |  Branch (1522:6): [True: 266, False: 728k]
  |  Branch (1522:25): [True: 0, False: 728k]
  ------------------
 1523|  9.42k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  9.42k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1523:7): [True: 0, False: 9.42k]
  ------------------
 1524|      0|			fprintf(stderr, "lhs/off overflow %jd %jd\n", lhs, off);
 1525|  9.42k|		return 1;
 1526|  9.42k|	}
 1527|       |	   
 1528|   728k|	if (off) {
  ------------------
  |  Branch (1528:6): [True: 67.6k, False: 660k]
  ------------------
 1529|  67.6k|		switch (m->in_op & FILE_OPS_MASK) {
  ------------------
  |  |  360|  67.6k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  ------------------
  |  Branch (1529:11): [True: 67.6k, False: 0]
  ------------------
 1530|     70|		case FILE_OPAND:
  ------------------
  |  |  352|     70|#define				FILE_OPAND	0
  ------------------
  |  Branch (1530:3): [True: 70, False: 67.5k]
  ------------------
 1531|     70|			offset = lhs & off;
 1532|     70|			break;
 1533|      0|		case FILE_OPOR:
  ------------------
  |  |  353|      0|#define				FILE_OPOR	1
  ------------------
  |  Branch (1533:3): [True: 0, False: 67.6k]
  ------------------
 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: 67.6k]
  ------------------
 1537|      0|			offset = lhs ^ off;
 1538|      0|			break;
 1539|  59.1k|		case FILE_OPADD:
  ------------------
  |  |  355|  59.1k|#define				FILE_OPADD	3
  ------------------
  |  Branch (1539:3): [True: 59.1k, False: 8.51k]
  ------------------
 1540|  59.1k|			offset = lhs + off;
 1541|  59.1k|			break;
 1542|  1.41k|		case FILE_OPMINUS:
  ------------------
  |  |  356|  1.41k|#define				FILE_OPMINUS	4
  ------------------
  |  Branch (1542:3): [True: 1.41k, False: 66.2k]
  ------------------
 1543|  1.41k|			offset = lhs - off;
 1544|  1.41k|			break;
 1545|  6.99k|		case FILE_OPMULTIPLY:
  ------------------
  |  |  357|  6.99k|#define				FILE_OPMULTIPLY	5
  ------------------
  |  Branch (1545:3): [True: 6.99k, False: 60.6k]
  ------------------
 1546|  6.99k|			offset = lhs * off;
 1547|  6.99k|			break;
 1548|     37|		case FILE_OPDIVIDE:
  ------------------
  |  |  358|     37|#define				FILE_OPDIVIDE	6
  ------------------
  |  Branch (1548:3): [True: 37, False: 67.6k]
  ------------------
 1549|     37|			offset = lhs / off;
 1550|     37|			break;
 1551|      0|		case FILE_OPMODULO:
  ------------------
  |  |  359|      0|#define				FILE_OPMODULO	7
  ------------------
  |  Branch (1551:3): [True: 0, False: 67.6k]
  ------------------
 1552|      0|			offset = lhs % off;
 1553|      0|			break;
 1554|  67.6k|		}
 1555|  67.6k|	} else
 1556|   660k|		offset = lhs;
 1557|   728k|	if (m->in_op & FILE_OPINVERSE)
  ------------------
  |  |  364|   728k|#define				FILE_OPINVERSE	0x40
  ------------------
  |  Branch (1557:6): [True: 0, False: 728k]
  ------------------
 1558|      0|		offset = ~offset;
 1559|   728k|	if (offset >= UINT_MAX) {
  ------------------
  |  Branch (1559:6): [True: 429, False: 728k]
  ------------------
 1560|    429|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|    429|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1560:7): [True: 0, False: 429]
  ------------------
 1561|      0|			fprintf(stderr, "offset overflow %jd\n", offset);
 1562|    429|		return 1;
 1563|    429|	}
 1564|   728k|	*rv = CAST(uint32_t, offset);
  ------------------
  |  |  460|   728k|#define CAST(T, b)	((T)(b))
  ------------------
 1565|   728k|	return 0;
 1566|   728k|}
softmagic.c:cvt_id3:
 1016|     84|{
 1017|     84|	v = ((((v >>  0) & 0x7f) <<  0) |
 1018|     84|	     (((v >>  8) & 0x7f) <<  7) |
 1019|     84|	     (((v >> 16) & 0x7f) << 14) |
 1020|     84|	     (((v >> 24) & 0x7f) << 21));
 1021|     84|	if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|     84|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (1021:6): [True: 0, False: 84]
  ------------------
 1022|      0|		fprintf(stderr, "id3 offs=%u\n", v);
 1023|     84|	return v;
 1024|     84|}
softmagic.c:file_fmtcheck:
  172|   127k|{
  173|   127k|	const char *ptr;
  174|       |
  175|   127k|	if (strchr(desc, '%') == NULL)
  ------------------
  |  Branch (175:6): [True: 67.2k, False: 59.8k]
  ------------------
  176|  67.2k|		return desc;
  177|       |
  178|  59.8k|	ptr = fmtcheck(desc, def);
  179|  59.8k|	if (ptr == def)
  ------------------
  |  Branch (179:6): [True: 0, False: 59.8k]
  ------------------
  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|  59.8k|	return ptr;
  184|   127k|}
softmagic.c:save_cont:
 1628|  51.4k|{
 1629|  51.4k|	size_t len;
 1630|  51.4k|	*c = ms->c;
 1631|  51.4k|	len = c->len * sizeof(*c->li);
 1632|  51.4k|	ms->c.li = CAST(struct level_info *, malloc(len));
  ------------------
  |  |  460|  51.4k|#define CAST(T, b)	((T)(b))
  ------------------
 1633|  51.4k|	if (ms->c.li == NULL) {
  ------------------
  |  Branch (1633:6): [True: 0, False: 51.4k]
  ------------------
 1634|      0|		ms->c = *c;
 1635|      0|		return -1;
 1636|      0|	}
 1637|  51.4k|	memcpy(ms->c.li, c->li, len);
 1638|  51.4k|	return 0;
 1639|  51.4k|}
softmagic.c:restore_cont:
 1643|  51.4k|{
 1644|  51.4k|	free(ms->c.li);
 1645|  51.4k|	ms->c = *c;
 1646|  51.4k|}
softmagic.c:mconvert:
 1205|   142M|{
 1206|   142M|	union VALUETYPE *p = &ms->ms_value;
 1207|       |
 1208|   142M|	switch (cvt_flip(m->type, flip)) {
 1209|  2.39M|	case FILE_BYTE:
  ------------------
  |  |  254|  2.39M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (1209:2): [True: 2.39M, False: 140M]
  ------------------
 1210|  2.39M|		if (cvt_8(p, m) == -1)
  ------------------
  |  Branch (1210:7): [True: 0, False: 2.39M]
  ------------------
 1211|      0|			goto out;
 1212|  2.39M|		return 1;
 1213|  2.57M|	case FILE_SHORT:
  ------------------
  |  |  255|  2.57M|#define				FILE_SHORT		2
  ------------------
  |  Branch (1213:2): [True: 2.57M, False: 140M]
  ------------------
 1214|  2.57M|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|  2.57M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (1214:2): [True: 0, False: 142M]
  ------------------
 1215|  2.57M|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|  2.57M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (1215:2): [True: 0, False: 142M]
  ------------------
 1216|  2.57M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1216:7): [True: 0, False: 2.57M]
  ------------------
 1217|      0|			goto out;
 1218|  2.57M|		return 1;
 1219|  2.21M|	case FILE_LONG:
  ------------------
  |  |  257|  2.21M|#define				FILE_LONG		4
  ------------------
  |  Branch (1219:2): [True: 2.21M, False: 140M]
  ------------------
 1220|  2.21M|	case FILE_DATE:
  ------------------
  |  |  259|  2.21M|#define				FILE_DATE		6
  ------------------
  |  Branch (1220:2): [True: 0, False: 142M]
  ------------------
 1221|  2.21M|	case FILE_LDATE:
  ------------------
  |  |  267|  2.21M|#define				FILE_LDATE		14
  ------------------
  |  Branch (1221:2): [True: 0, False: 142M]
  ------------------
 1222|  2.21M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1222:7): [True: 0, False: 2.21M]
  ------------------
 1223|      0|			goto out;
 1224|  2.21M|		return 1;
 1225|  93.8k|	case FILE_QUAD:
  ------------------
  |  |  277|  93.8k|#define				FILE_QUAD		24
  ------------------
  |  Branch (1225:2): [True: 93.8k, False: 142M]
  ------------------
 1226|  93.8k|	case FILE_QDATE:
  ------------------
  |  |  280|  93.8k|#define				FILE_QDATE		27
  ------------------
  |  Branch (1226:2): [True: 0, False: 142M]
  ------------------
 1227|  93.8k|	case FILE_QLDATE:
  ------------------
  |  |  283|  93.8k|#define				FILE_QLDATE		30
  ------------------
  |  Branch (1227:2): [True: 0, False: 142M]
  ------------------
 1228|  94.0k|	case FILE_QWDATE:
  ------------------
  |  |  295|  94.0k|#define				FILE_QWDATE		42
  ------------------
  |  Branch (1228:2): [True: 206, False: 142M]
  ------------------
 1229|  99.3k|	case FILE_OFFSET:
  ------------------
  |  |  305|  99.3k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (1229:2): [True: 5.24k, False: 142M]
  ------------------
 1230|  99.3k|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1230:7): [True: 0, False: 99.3k]
  ------------------
 1231|      0|			goto out;
 1232|  99.3k|		return 1;
 1233|  90.8M|	case FILE_STRING:
  ------------------
  |  |  258|  90.8M|#define				FILE_STRING		5
  ------------------
  |  Branch (1233:2): [True: 90.8M, False: 52.0M]
  ------------------
 1234|  90.8M|	case FILE_BESTRING16:
  ------------------
  |  |  271|  90.8M|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (1234:2): [True: 138, False: 142M]
  ------------------
 1235|  90.9M|	case FILE_LESTRING16:
  ------------------
  |  |  272|  90.9M|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (1235:2): [True: 93.2k, False: 142M]
  ------------------
 1236|  90.9M|	case FILE_OCTAL: {
  ------------------
  |  |  314|  90.9M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (1236:2): [True: 0, False: 142M]
  ------------------
 1237|       |		/* Null terminate and eat *trailing* return */
 1238|  90.9M|		p->s[sizeof(p->s) - 1] = '\0';
 1239|  90.9M|		return 1;
 1240|  90.9M|	}
 1241|  40.5k|	case FILE_PSTRING: {
  ------------------
  |  |  266|  40.5k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (1241:2): [True: 40.5k, False: 142M]
  ------------------
 1242|  40.5k|		char *ptr1, *ptr2;
 1243|  40.5k|		size_t len, sz = file_pstring_length_size(ms, m);
 1244|  40.5k|		if (sz == FILE_BADSIZE)
  ------------------
  |  |  183|  40.5k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  40.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1244:7): [True: 0, False: 40.5k]
  ------------------
 1245|      0|			return 0;
 1246|  40.5k|		ptr1 = p->s;
 1247|  40.5k|		ptr2 = ptr1 + sz;
 1248|  40.5k|		len = file_pstring_get_length(ms, m, ptr1);
 1249|  40.5k|		if (len == FILE_BADSIZE)
  ------------------
  |  |  183|  40.5k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  40.5k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (1249:7): [True: 94, False: 40.4k]
  ------------------
 1250|     94|			return 0;
 1251|  40.4k|		sz = sizeof(p->s) - sz; /* maximum length of string */
 1252|  40.4k|		if (len >= sz) {
  ------------------
  |  Branch (1252:7): [True: 7.02k, False: 33.3k]
  ------------------
 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|  7.02k|			len = sz;
 1262|  7.02k|		}
 1263|  3.11M|		while (len--)
  ------------------
  |  Branch (1263:10): [True: 3.07M, False: 40.4k]
  ------------------
 1264|  3.07M|			*ptr1++ = *ptr2++;
 1265|  40.4k|		*ptr1 = '\0';
 1266|  40.4k|		return 1;
 1267|  40.5k|	}
 1268|  5.98M|	case FILE_BESHORT:
  ------------------
  |  |  260|  5.98M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (1268:2): [True: 5.98M, False: 136M]
  ------------------
 1269|  5.98M|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|  5.98M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (1269:2): [True: 0, False: 142M]
  ------------------
 1270|  5.98M|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|  5.98M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (1270:2): [True: 0, False: 142M]
  ------------------
 1271|  5.98M|		p->h = CAST(short, BE16(p->hs));
  ------------------
  |  |  460|  5.98M|#define CAST(T, b)	((T)(b))
  ------------------
 1272|  5.98M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1272:7): [True: 0, False: 5.98M]
  ------------------
 1273|      0|			goto out;
 1274|  5.98M|		return 1;
 1275|  18.4M|	case FILE_BELONG:
  ------------------
  |  |  261|  18.4M|#define				FILE_BELONG		8
  ------------------
  |  Branch (1275:2): [True: 18.4M, False: 124M]
  ------------------
 1276|  18.4M|	case FILE_BEDATE:
  ------------------
  |  |  262|  18.4M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (1276:2): [True: 462, False: 142M]
  ------------------
 1277|  18.4M|	case FILE_BELDATE:
  ------------------
  |  |  268|  18.4M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (1277:2): [True: 504, False: 142M]
  ------------------
 1278|  18.4M|		p->l = CAST(int32_t, BE32(p->hl));
  ------------------
  |  |  460|  18.4M|#define CAST(T, b)	((T)(b))
  ------------------
 1279|  18.4M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1279:7): [True: 0, False: 18.4M]
  ------------------
 1280|      0|			goto out;
 1281|  18.4M|		return 1;
 1282|  1.48M|	case FILE_BEQUAD:
  ------------------
  |  |  279|  1.48M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (1282:2): [True: 1.48M, False: 141M]
  ------------------
 1283|  1.48M|	case FILE_BEQDATE:
  ------------------
  |  |  282|  1.48M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (1283:2): [True: 420, False: 142M]
  ------------------
 1284|  1.49M|	case FILE_BEQLDATE:
  ------------------
  |  |  285|  1.49M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (1284:2): [True: 393, False: 142M]
  ------------------
 1285|  1.49M|	case FILE_BEQWDATE:
  ------------------
  |  |  297|  1.49M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (1285:2): [True: 0, False: 142M]
  ------------------
 1286|  1.49M|		p->q = CAST(uint64_t, BE64(p->hq));
  ------------------
  |  |  460|  1.49M|#define CAST(T, b)	((T)(b))
  ------------------
 1287|  1.49M|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1287:7): [True: 0, False: 1.49M]
  ------------------
 1288|      0|			goto out;
 1289|  1.49M|		return 1;
 1290|  5.59M|	case FILE_LESHORT:
  ------------------
  |  |  263|  5.59M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (1290:2): [True: 5.59M, False: 137M]
  ------------------
 1291|  5.59M|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|  5.59M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (1291:2): [True: 313, False: 142M]
  ------------------
 1292|  5.59M|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|  5.59M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (1292:2): [True: 313, False: 142M]
  ------------------
 1293|  5.59M|		p->h = CAST(short, LE16(p->hs));
  ------------------
  |  |  460|  5.59M|#define CAST(T, b)	((T)(b))
  ------------------
 1294|  5.59M|		if (cvt_16(p, m) == -1)
  ------------------
  |  Branch (1294:7): [True: 0, False: 5.59M]
  ------------------
 1295|      0|			goto out;
 1296|  5.59M|		return 1;
 1297|  9.36M|	case FILE_LELONG:
  ------------------
  |  |  264|  9.36M|#define				FILE_LELONG		11
  ------------------
  |  Branch (1297:2): [True: 9.36M, False: 133M]
  ------------------
 1298|  9.36M|	case FILE_LEDATE:
  ------------------
  |  |  265|  9.36M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (1298:2): [True: 301, False: 142M]
  ------------------
 1299|  9.36M|	case FILE_LELDATE:
  ------------------
  |  |  269|  9.36M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (1299:2): [True: 84, False: 142M]
  ------------------
 1300|  9.36M|		p->l = CAST(int32_t, LE32(p->hl));
  ------------------
  |  |  460|  9.36M|#define CAST(T, b)	((T)(b))
  ------------------
 1301|  9.36M|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1301:7): [True: 0, False: 9.36M]
  ------------------
 1302|      0|			goto out;
 1303|  9.36M|		return 1;
 1304|  1.25M|	case FILE_LEQUAD:
  ------------------
  |  |  278|  1.25M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (1304:2): [True: 1.25M, False: 141M]
  ------------------
 1305|  1.25M|	case FILE_LEQDATE:
  ------------------
  |  |  281|  1.25M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (1305:2): [True: 1.07k, False: 142M]
  ------------------
 1306|  1.25M|	case FILE_LEQLDATE:
  ------------------
  |  |  284|  1.25M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (1306:2): [True: 100, False: 142M]
  ------------------
 1307|  1.25M|	case FILE_LEQWDATE:
  ------------------
  |  |  296|  1.25M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (1307:2): [True: 2.19k, False: 142M]
  ------------------
 1308|  1.25M|		p->q = CAST(uint64_t, LE64(p->hq));
  ------------------
  |  |  460|  1.25M|#define CAST(T, b)	((T)(b))
  ------------------
 1309|  1.25M|		if (cvt_64(p, m) == -1)
  ------------------
  |  Branch (1309:7): [True: 0, False: 1.25M]
  ------------------
 1310|      0|			goto out;
 1311|  1.25M|		return 1;
 1312|     37|	case FILE_MELONG:
  ------------------
  |  |  276|     37|#define				FILE_MELONG		23
  ------------------
  |  Branch (1312:2): [True: 37, False: 142M]
  ------------------
 1313|    178|	case FILE_MEDATE:
  ------------------
  |  |  274|    178|#define				FILE_MEDATE		21
  ------------------
  |  Branch (1313:2): [True: 141, False: 142M]
  ------------------
 1314|    178|	case FILE_MELDATE:
  ------------------
  |  |  275|    178|#define				FILE_MELDATE		22
  ------------------
  |  Branch (1314:2): [True: 0, False: 142M]
  ------------------
 1315|    178|		p->l = CAST(int32_t, ME32(p->hl));
  ------------------
  |  |  460|    178|#define CAST(T, b)	((T)(b))
  ------------------
 1316|    178|		if (cvt_32(p, m) == -1)
  ------------------
  |  Branch (1316:7): [True: 0, False: 178]
  ------------------
 1317|      0|			goto out;
 1318|    178|		return 1;
 1319|      0|	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (1319:2): [True: 0, False: 142M]
  ------------------
 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: 142M]
  ------------------
 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|  10.2k|	case FILE_LEFLOAT:
  ------------------
  |  |  288|  10.2k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (1328:2): [True: 10.2k, False: 142M]
  ------------------
 1329|  10.2k|		p->l = LE32(p->hl);
  ------------------
  |  |   90|  10.2k|#define LE32(p) ( \
  |  |   91|  10.2k|    (CAST(uint32_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  460|  10.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   92|  10.2k|    (CAST(uint32_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  460|  10.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   93|  10.2k|    (CAST(uint32_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  460|  10.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   94|  10.2k|    (CAST(uint32_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  460|  10.2k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1330|  10.2k|		if (cvt_float(p, m) == -1)
  ------------------
  |  Branch (1330:7): [True: 0, False: 10.2k]
  ------------------
 1331|      0|			goto out;
 1332|  10.2k|		return 1;
 1333|      0|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (1333:2): [True: 0, False: 142M]
  ------------------
 1334|      0|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1334:7): [True: 0, False: 0]
  ------------------
 1335|      0|			goto out;
 1336|      0|		return 1;
 1337|    168|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|    168|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (1337:2): [True: 168, False: 142M]
  ------------------
 1338|    168|		p->q = BE64(p->hq);
  ------------------
  |  |   72|    168|#define BE64(p) ( \
  |  |   73|    168|    (CAST(uint64_t, (p)[0])<<56)| \
  |  |  ------------------
  |  |  |  |  460|    168|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   74|    168|    (CAST(uint64_t, (p)[1])<<48)| \
  |  |  ------------------
  |  |  |  |  460|    168|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   75|    168|    (CAST(uint64_t, (p)[2])<<40)| \
  |  |  ------------------
  |  |  |  |  460|    168|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   76|    168|    (CAST(uint64_t, (p)[3])<<32)| \
  |  |  ------------------
  |  |  |  |  460|    168|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   77|    168|    (CAST(uint64_t, (p)[4])<<24)| \
  |  |  ------------------
  |  |  |  |  460|    168|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   78|    168|    (CAST(uint64_t, (p)[5])<<16)| \
  |  |  ------------------
  |  |  |  |  460|    168|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   79|    168|    (CAST(uint64_t, (p)[6])<<8)| \
  |  |  ------------------
  |  |  |  |  460|    168|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   80|    168|    (CAST(uint64_t, (p)[7])))
  |  |  ------------------
  |  |  |  |  460|    168|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1339|    168|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1339:7): [True: 0, False: 168]
  ------------------
 1340|      0|			goto out;
 1341|    168|		return 1;
 1342|  1.39k|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|  1.39k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (1342:2): [True: 1.39k, False: 142M]
  ------------------
 1343|  1.39k|		p->q = LE64(p->hq);
  ------------------
  |  |   81|  1.39k|#define LE64(p) ( \
  |  |   82|  1.39k|    (CAST(uint64_t, (p)[7])<<56)| \
  |  |  ------------------
  |  |  |  |  460|  1.39k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   83|  1.39k|    (CAST(uint64_t, (p)[6])<<48)| \
  |  |  ------------------
  |  |  |  |  460|  1.39k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   84|  1.39k|    (CAST(uint64_t, (p)[5])<<40)| \
  |  |  ------------------
  |  |  |  |  460|  1.39k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   85|  1.39k|    (CAST(uint64_t, (p)[4])<<32)| \
  |  |  ------------------
  |  |  |  |  460|  1.39k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   86|  1.39k|    (CAST(uint64_t, (p)[3])<<24)| \
  |  |  ------------------
  |  |  |  |  460|  1.39k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   87|  1.39k|    (CAST(uint64_t, (p)[2])<<16)| \
  |  |  ------------------
  |  |  |  |  460|  1.39k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   88|  1.39k|    (CAST(uint64_t, (p)[1])<<8)| \
  |  |  ------------------
  |  |  |  |  460|  1.39k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |   89|  1.39k|    (CAST(uint64_t, (p)[0])))
  |  |  ------------------
  |  |  |  |  460|  1.39k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
 1344|  1.39k|		if (cvt_double(p, m) == -1)
  ------------------
  |  Branch (1344:7): [True: 0, False: 1.39k]
  ------------------
 1345|      0|			goto out;
 1346|  1.39k|		return 1;
 1347|   593k|	case FILE_REGEX:
  ------------------
  |  |  270|   593k|#define				FILE_REGEX		17
  ------------------
  |  Branch (1347:2): [True: 593k, False: 142M]
  ------------------
 1348|  1.52M|	case FILE_SEARCH:
  ------------------
  |  |  273|  1.52M|#define				FILE_SEARCH		20
  ------------------
  |  Branch (1348:2): [True: 931k, False: 141M]
  ------------------
 1349|  1.53M|	case FILE_DEFAULT:
  ------------------
  |  |  256|  1.53M|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (1349:2): [True: 8.77k, False: 142M]
  ------------------
 1350|  1.53M|	case FILE_CLEAR:
  ------------------
  |  |  300|  1.53M|#define				FILE_CLEAR		47
  ------------------
  |  Branch (1350:2): [True: 1.86k, False: 142M]
  ------------------
 1351|  1.53M|	case FILE_NAME:
  ------------------
  |  |  298|  1.53M|#define				FILE_NAME		45
  ------------------
  |  Branch (1351:2): [True: 0, False: 142M]
  ------------------
 1352|  1.53M|	case FILE_USE:
  ------------------
  |  |  299|  1.53M|#define				FILE_USE		46
  ------------------
  |  Branch (1352:2): [True: 0, False: 142M]
  ------------------
 1353|  2.10M|	case FILE_DER:
  ------------------
  |  |  301|  2.10M|#define				FILE_DER		48
  ------------------
  |  Branch (1353:2): [True: 567k, False: 142M]
  ------------------
 1354|  2.45M|	case FILE_GUID:
  ------------------
  |  |  302|  2.45M|#define				FILE_GUID		49
  ------------------
  |  Branch (1354:2): [True: 349k, False: 142M]
  ------------------
 1355|  2.45M|	case FILE_LEGUID:
  ------------------
  |  |  303|  2.45M|#define				FILE_LEGUID		50
  ------------------
  |  Branch (1355:2): [True: 0, False: 142M]
  ------------------
 1356|  2.45M|	case FILE_BEGUID:
  ------------------
  |  |  304|  2.45M|#define				FILE_BEGUID		51
  ------------------
  |  Branch (1356:2): [True: 36, False: 142M]
  ------------------
 1357|  2.45M|		return 1;
 1358|      0|	default:
  ------------------
  |  Branch (1358:2): [True: 0, False: 142M]
  ------------------
 1359|      0|		file_magerror(ms, "invalid type %d in mconvert()", m->type);
 1360|      0|		return 0;
 1361|   142M|	}
 1362|      0|out:
 1363|      0|	file_magerror(ms, "zerodivide/overflow/underflow in mconvert()");
 1364|      0|	return 0;
 1365|   142M|}
softmagic.c:cvt_8:
 1139|  2.39M|{
 1140|  2.39M|	DO_CVT(m, b, 8);
  ------------------
  |  | 1131|  2.39M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  2.39M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 1.08M, False: 1.30M]
  |  |  ------------------
  |  | 1132|  1.08M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  1.08M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.08M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 159k, False: 926k]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.08M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   159k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 159k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   140k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   140k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 140k, False: 19.7k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   140k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   140k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   140k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 159k]
  |  |  |  |  ------------------
  |  |  |  | 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: 159k]
  |  |  |  |  ------------------
  |  |  |  | 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: 159k]
  |  |  |  |  ------------------
  |  |  |  | 1106|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			break; \
  |  |  |  | 1108|  19.2k|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  19.2k|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 19.2k, False: 140k]
  |  |  |  |  ------------------
  |  |  |  | 1109|  19.2k|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  19.2k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|  19.2k|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 159k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    235|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    235|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 235, False: 159k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    235|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    235|	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|    235|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 235]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    235|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    235|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    235|		return -1; \
  |  |  |  |  |  | 1090|    235|	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|    235|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 235]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    235|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    235|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    235|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    235|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    235|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 235]
  |  |  |  |  ------------------
  |  |  |  | 1117|    235|				return -1; \
  |  |  |  | 1118|    235|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    235|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    235|			break; \
  |  |  |  | 1120|    235|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    234|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 234, False: 159k]
  |  |  |  |  ------------------
  |  |  |  | 1121|    234|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    234|	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|    234|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 234]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    234|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    234|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    234|		return -1; \
  |  |  |  |  |  | 1090|    234|	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|    234|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 234]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    234|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    234|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    234|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    234|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    234|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 234]
  |  |  |  |  ------------------
  |  |  |  | 1123|    234|				return -1; \
  |  |  |  | 1124|    234|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    234|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    234|			break; \
  |  |  |  | 1126|   159k|		} \
  |  |  |  | 1127|  1.08M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.08M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.08M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.08M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  1.30M|	} else { \
  |  | 1134|  1.30M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  1.30M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.30M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 65.5k, False: 1.24M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.30M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|  65.5k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 65.5k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  52.6k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  52.6k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 52.6k, False: 12.8k]
  |  |  |  |  ------------------
  |  |  |  | 1097|  52.6k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  52.6k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  52.6k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 65.5k]
  |  |  |  |  ------------------
  |  |  |  | 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: 65.5k]
  |  |  |  |  ------------------
  |  |  |  | 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: 65.5k]
  |  |  |  |  ------------------
  |  |  |  | 1106|      0|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|      0|			break; \
  |  |  |  | 1108|  12.8k|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|  12.8k|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 12.8k, False: 52.7k]
  |  |  |  |  ------------------
  |  |  |  | 1109|  12.8k|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  12.8k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|  12.8k|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 65.5k]
  |  |  |  |  ------------------
  |  |  |  | 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: 65.5k]
  |  |  |  |  ------------------
  |  |  |  | 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: 65.5k]
  |  |  |  |  ------------------
  |  |  |  | 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|  65.5k|		} \
  |  |  |  | 1127|  1.30M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.30M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.30M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.30M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  1.30M|	}
  ------------------
 1141|  2.39M|	return 0;
 1142|  2.39M|}
softmagic.c:cvt_16:
 1146|  14.1M|{
 1147|  14.1M|	DO_CVT(m, h, 16);
  ------------------
  |  | 1131|  14.1M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  14.1M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 1.79M, False: 12.3M]
  |  |  ------------------
  |  | 1132|  1.79M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  1.79M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.79M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 181k, False: 1.61M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.79M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   181k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 181k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   180k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   180k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 180k, False: 1.09k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   180k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   180k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   180k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 181k]
  |  |  |  |  ------------------
  |  |  |  | 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: 181k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|    120|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|    120|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 120, False: 181k]
  |  |  |  |  ------------------
  |  |  |  | 1106|    120|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    120|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|    120|			break; \
  |  |  |  | 1108|    138|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|    138|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 138, False: 181k]
  |  |  |  |  ------------------
  |  |  |  | 1109|    138|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    138|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|    138|			break; \
  |  |  |  | 1111|     74|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|     74|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 74, False: 181k]
  |  |  |  |  ------------------
  |  |  |  | 1112|     74|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     74|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|     74|			break; \
  |  |  |  | 1114|    616|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    616|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 616, False: 181k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    616|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    616|	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|    616|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 616]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    616|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    616|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    616|		return -1; \
  |  |  |  |  |  | 1090|    616|	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|    616|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 616]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    616|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    616|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    616|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    616|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    616|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 616]
  |  |  |  |  ------------------
  |  |  |  | 1117|    616|				return -1; \
  |  |  |  | 1118|    616|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    616|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    616|			break; \
  |  |  |  | 1120|    616|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    142|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 142, False: 181k]
  |  |  |  |  ------------------
  |  |  |  | 1121|    142|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    142|	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|    142|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 142]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    142|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    142|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    142|		return -1; \
  |  |  |  |  |  | 1090|    142|	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|    142|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 142]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    142|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    142|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    142|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    142|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    142|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 142]
  |  |  |  |  ------------------
  |  |  |  | 1123|    142|				return -1; \
  |  |  |  | 1124|    142|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    142|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    142|			break; \
  |  |  |  | 1126|   181k|		} \
  |  |  |  | 1127|  1.79M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.79M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.79M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.79M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  12.3M|	} else { \
  |  | 1134|  12.3M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  12.3M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  12.3M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 634k, False: 11.7M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  12.3M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   634k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 634k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   602k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   602k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 602k, False: 32.3k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   602k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   602k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   602k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 634k]
  |  |  |  |  ------------------
  |  |  |  | 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: 634k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     84|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|     84|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 84, False: 634k]
  |  |  |  |  ------------------
  |  |  |  | 1106|     84|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     84|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     84|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 634k]
  |  |  |  |  ------------------
  |  |  |  | 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: 634k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|     66|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|     66|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 66, False: 634k]
  |  |  |  |  ------------------
  |  |  |  | 1115|     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): [True: 0, Folded]
  |  |  |  |  |  |  |  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): [True: 0, Folded]
  |  |  |  |  |  |  |  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
  |  |  |  |  ------------------
  |  |  |  | 1116|     66|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 66]
  |  |  |  |  ------------------
  |  |  |  | 1117|     66|				return -1; \
  |  |  |  | 1118|     66|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|     66|			break; \
  |  |  |  | 1120|  32.1k|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|  32.1k|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 32.1k, False: 602k]
  |  |  |  |  ------------------
  |  |  |  | 1121|  32.1k|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  32.1k|	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|  32.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 32.1k]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|  32.1k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  32.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|  32.1k|		return -1; \
  |  |  |  |  |  | 1090|  32.1k|	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|  32.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 32.1k]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|  32.1k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  32.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|  32.1k|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|  32.1k|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  32.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 32.1k]
  |  |  |  |  ------------------
  |  |  |  | 1123|  32.1k|				return -1; \
  |  |  |  | 1124|  32.1k|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  32.1k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|  32.1k|			break; \
  |  |  |  | 1126|   634k|		} \
  |  |  |  | 1127|  12.3M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  12.3M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 12.3M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  12.3M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  12.3M|	}
  ------------------
 1148|  14.1M|	return 0;
 1149|  14.1M|}
softmagic.c:cvt_32:
 1153|  30.0M|{
 1154|  30.0M|	DO_CVT(m, l, 32);
  ------------------
  |  | 1131|  30.0M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  30.0M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 4.46M, False: 25.6M]
  |  |  ------------------
  |  | 1132|  4.46M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  4.46M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  4.46M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 673k, False: 3.79M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  4.46M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   673k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 673k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   671k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   671k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 671k, False: 1.14k]
  |  |  |  |  ------------------
  |  |  |  | 1097|   671k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   671k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   671k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 673k]
  |  |  |  |  ------------------
  |  |  |  | 1100|      0|			p->fld |= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1101|      0|			break; \
  |  |  |  | 1102|     66|		case FILE_OPXOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  354|     66|#define				FILE_OPXOR	2
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1102:3): [True: 66, False: 672k]
  |  |  |  |  ------------------
  |  |  |  | 1103|     66|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     66|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|     66|			break; \
  |  |  |  | 1105|    274|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|    274|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 274, False: 672k]
  |  |  |  |  ------------------
  |  |  |  | 1106|    274|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    274|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|    274|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 673k]
  |  |  |  |  ------------------
  |  |  |  | 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: 673k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    552|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    552|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 552, False: 672k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    552|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    552|	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|    552|#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|    552|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    552|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    552|		return -1; \
  |  |  |  |  |  | 1090|    552|	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|    552|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 552]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    552|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    552|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    552|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    552|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    552|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 552]
  |  |  |  |  ------------------
  |  |  |  | 1117|    552|				return -1; \
  |  |  |  | 1118|    552|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    552|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    552|			break; \
  |  |  |  | 1120|    552|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    252|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 252, False: 672k]
  |  |  |  |  ------------------
  |  |  |  | 1121|    252|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    252|	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|    252|#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|    252|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    252|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    252|		return -1; \
  |  |  |  |  |  | 1090|    252|	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|    252|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 252]
  |  |  |  |  |  |  |  Branch (1090:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    252|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    252|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    252|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    252|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    252|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 252]
  |  |  |  |  ------------------
  |  |  |  | 1123|    252|				return -1; \
  |  |  |  | 1124|    252|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    252|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    252|			break; \
  |  |  |  | 1126|   673k|		} \
  |  |  |  | 1127|  4.46M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  4.46M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 4.46M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  4.46M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1133|  25.6M|	} else { \
  |  | 1134|  25.6M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  25.6M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  25.6M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 4.40M, False: 21.1M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  25.6M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|  4.40M|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 4.40M, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  4.40M|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  4.40M|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 4.40M, False: 932]
  |  |  |  |  ------------------
  |  |  |  | 1097|  4.40M|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  4.40M|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  4.40M|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 4.40M]
  |  |  |  |  ------------------
  |  |  |  | 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: 4.40M]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     84|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|     84|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 84, False: 4.40M]
  |  |  |  |  ------------------
  |  |  |  | 1106|     84|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     84|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     84|			break; \
  |  |  |  | 1108|    598|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|    598|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 598, False: 4.40M]
  |  |  |  |  ------------------
  |  |  |  | 1109|    598|			p->fld -= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    598|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1110|    598|			break; \
  |  |  |  | 1111|      0|		case FILE_OPMULTIPLY: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  357|      0|#define				FILE_OPMULTIPLY	5
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1111:3): [True: 0, False: 4.40M]
  |  |  |  |  ------------------
  |  |  |  | 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: 4.40M]
  |  |  |  |  ------------------
  |  |  |  | 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|    250|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|    250|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 250, False: 4.40M]
  |  |  |  |  ------------------
  |  |  |  | 1121|    250|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    250|	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    250|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 32 && sign && CAST(type, a) == CAST(type, 0x80000000) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    500|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 134, False: 116]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    250|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    134|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    384|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 134]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    250|		return -1; \
  |  |  |  |  |  | 1090|    250|	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|    250|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [Folded, False: 250]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    250|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    250|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    250|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|    250|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    250|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 250]
  |  |  |  |  ------------------
  |  |  |  | 1123|    250|				return -1; \
  |  |  |  | 1124|    250|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    250|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|    250|			break; \
  |  |  |  | 1126|  4.40M|		} \
  |  |  |  | 1127|  25.6M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  25.6M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 25.6M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  25.6M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  25.6M|	}
  ------------------
 1155|  30.0M|	return 0;
 1156|  30.0M|}
softmagic.c:cvt_64:
 1160|  2.84M|{
 1161|  2.84M|	DO_CVT(m, q, 64);
  ------------------
  |  | 1131|  2.84M|	if ((m)->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  2.84M|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (1131:6): [True: 1.07M, False: 1.77M]
  |  |  ------------------
  |  | 1132|  1.07M|		DO_CVT1(fld, uint##size##_t, size, 0); \
  |  |  ------------------
  |  |  |  | 1094|  1.07M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.07M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 325k, False: 745k]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.07M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|   325k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 325k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|   325k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|   325k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 325k, False: 94]
  |  |  |  |  ------------------
  |  |  |  | 1097|   325k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|   325k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|   325k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 325k]
  |  |  |  |  ------------------
  |  |  |  | 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: 325k]
  |  |  |  |  ------------------
  |  |  |  | 1103|      0|			p->fld ^= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1104|      0|			break; \
  |  |  |  | 1105|     60|		case FILE_OPADD: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  355|     60|#define				FILE_OPADD	3
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1105:3): [True: 60, False: 325k]
  |  |  |  |  ------------------
  |  |  |  | 1106|     60|			p->fld += CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     60|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1107|     60|			break; \
  |  |  |  | 1108|      0|		case FILE_OPMINUS: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  356|      0|#define				FILE_OPMINUS	4
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1108:3): [True: 0, False: 325k]
  |  |  |  |  ------------------
  |  |  |  | 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: 325k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|     34|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|     34|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 34, False: 325k]
  |  |  |  |  ------------------
  |  |  |  | 1115|     34|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|     34|	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|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 34]
  |  |  |  |  |  |  |  Branch (1087:20): [Folded, False: 0]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|     34|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|     34|		return -1; \
  |  |  |  |  |  | 1090|     34|	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|     34|#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|     34|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|     34|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|     34|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 34]
  |  |  |  |  ------------------
  |  |  |  | 1117|     34|				return -1; \
  |  |  |  | 1118|     34|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|     34|			break; \
  |  |  |  | 1120|     34|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|      0|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 0, False: 325k]
  |  |  |  |  ------------------
  |  |  |  | 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|   325k|		} \
  |  |  |  | 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 \
  |  |  ------------------
  |  | 1133|  1.77M|	} else { \
  |  | 1134|  1.77M|		DO_CVT1(s##fld, int##size##_t, size, 1); \
  |  |  ------------------
  |  |  |  | 1094|  1.77M|	if (m->num_mask) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  388|  1.77M|#define num_mask _u._mask
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1094:6): [True: 48.7k, False: 1.72M]
  |  |  |  |  ------------------
  |  |  |  | 1095|  1.77M|		switch (m->mask_op & FILE_OPS_MASK) { \
  |  |  |  |  ------------------
  |  |  |  |  |  |  360|  48.7k|#define				FILE_OPS_MASK	0x07 /* mask for above ops */
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1095:11): [True: 48.7k, False: 0]
  |  |  |  |  ------------------
  |  |  |  | 1096|  46.3k|		case FILE_OPAND: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  352|  46.3k|#define				FILE_OPAND	0
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1096:3): [True: 46.3k, False: 2.38k]
  |  |  |  |  ------------------
  |  |  |  | 1097|  46.3k|			p->fld &= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  46.3k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1098|  46.3k|			break; \
  |  |  |  | 1099|      0|		case FILE_OPOR: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  353|      0|#define				FILE_OPOR	1
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1099:3): [True: 0, False: 48.7k]
  |  |  |  |  ------------------
  |  |  |  | 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: 48.7k]
  |  |  |  |  ------------------
  |  |  |  | 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: 48.7k]
  |  |  |  |  ------------------
  |  |  |  | 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: 48.7k]
  |  |  |  |  ------------------
  |  |  |  | 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: 48.7k]
  |  |  |  |  ------------------
  |  |  |  | 1112|      0|			p->fld *= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1113|      0|			break; \
  |  |  |  | 1114|    240|		case FILE_OPDIVIDE: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  358|    240|#define				FILE_OPDIVIDE	6
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1114:3): [True: 240, False: 48.5k]
  |  |  |  |  ------------------
  |  |  |  | 1115|    240|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|    240|	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|    240|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 240]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|    240|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    240|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|    240|		return -1; \
  |  |  |  |  |  | 1090|    240|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    240|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    480|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 34, False: 206]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|    240|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|     34|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|    274|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 34]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|    240|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1116|    240|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    240|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1116:8): [True: 0, False: 240]
  |  |  |  |  ------------------
  |  |  |  | 1117|    240|				return -1; \
  |  |  |  | 1118|    240|			p->fld /= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|    240|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1119|    240|			break; \
  |  |  |  | 1120|  2.14k|		case FILE_OPMODULO: \
  |  |  |  |  ------------------
  |  |  |  |  |  |  359|  2.14k|#define				FILE_OPMODULO	7
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1120:3): [True: 2.14k, False: 46.6k]
  |  |  |  |  ------------------
  |  |  |  | 1121|  2.14k|			CHECKOVFL(type, p->fld, m->num_mask, size, sign); \
  |  |  |  |  ------------------
  |  |  |  |  |  | 1087|  2.14k|	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|  2.14k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1087:6): [Folded, False: 2.14k]
  |  |  |  |  |  |  |  Branch (1087:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1087:28): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1088|  2.14k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  2.14k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1088:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1089|  2.14k|		return -1; \
  |  |  |  |  |  | 1090|  2.14k|	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  2.14k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	if (size == 64 && sign && CAST(type, a) == CAST(type, 0x8000000000000000LL) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  4.28k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1090:6): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:20): [True: 0, Folded]
  |  |  |  |  |  |  |  Branch (1090:28): [True: 0, False: 2.14k]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1091|  2.14k|	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|      0|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |               	    && CAST(type, b) == CAST(type, -1)) \
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  460|  2.14k|#define CAST(T, b)	((T)(b))
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  Branch (1091:9): [True: 0, False: 0]
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  | 1092|  2.14k|		return -1
  |  |  |  |  ------------------
  |  |  |  | 1122|  2.14k|			if (CAST(type, m->num_mask) == 0) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  2.14k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1122:8): [True: 0, False: 2.14k]
  |  |  |  |  ------------------
  |  |  |  | 1123|  2.14k|				return -1; \
  |  |  |  | 1124|  2.14k|			p->fld %= CAST(type, m->num_mask); \
  |  |  |  |  ------------------
  |  |  |  |  |  |  460|  2.14k|#define CAST(T, b)	((T)(b))
  |  |  |  |  ------------------
  |  |  |  | 1125|  2.14k|			break; \
  |  |  |  | 1126|  48.7k|		} \
  |  |  |  | 1127|  1.77M|	if (m->mask_op & FILE_OPINVERSE) \
  |  |  |  |  ------------------
  |  |  |  |  |  |  364|  1.77M|#define				FILE_OPINVERSE	0x40
  |  |  |  |  ------------------
  |  |  |  |  |  Branch (1127:6): [True: 0, False: 1.77M]
  |  |  |  |  ------------------
  |  |  |  | 1128|  1.77M|		p->fld = ~p->fld \
  |  |  ------------------
  |  | 1135|  1.77M|	}
  ------------------
 1162|  2.84M|	return 0;
 1163|  2.84M|}
softmagic.c:cvt_float:
 1186|  10.2k|{
 1187|  10.2k|	DO_CVT2(f, float);
  ------------------
  |  | 1166|  10.2k|	if (m->num_mask) \
  |  |  ------------------
  |  |  |  |  388|  10.2k|#define num_mask _u._mask
  |  |  ------------------
  |  |  |  Branch (1166:6): [True: 0, False: 10.2k]
  |  |  ------------------
  |  | 1167|  10.2k|		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|  10.2k|	return 0;
 1189|  10.2k|}
softmagic.c:cvt_double:
 1193|  1.56k|{
 1194|  1.56k|	DO_CVT2(d, double);
  ------------------
  |  | 1166|  1.56k|	if (m->num_mask) \
  |  |  ------------------
  |  |  |  |  388|  1.56k|#define num_mask _u._mask
  |  |  ------------------
  |  |  |  Branch (1166:6): [True: 0, False: 1.56k]
  |  |  ------------------
  |  | 1167|  1.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|		} \
  ------------------
 1195|  1.56k|	return 0;
 1196|  1.56k|}
softmagic.c:magiccheck:
 2171|   143M|{
 2172|   143M|	uint64_t l = m->value.q;
 2173|   143M|	uint64_t v;
 2174|   143M|	float fl, fv;
 2175|   143M|	double dl, dv;
 2176|   143M|	int matched;
 2177|   143M|	union VALUETYPE *p = &ms->ms_value;
 2178|       |
 2179|   143M|	switch (m->type) {
 2180|  2.39M|	case FILE_BYTE:
  ------------------
  |  |  254|  2.39M|#define 			FILE_BYTE		1
  ------------------
  |  Branch (2180:2): [True: 2.39M, False: 140M]
  ------------------
 2181|  2.39M|		v = p->b;
 2182|  2.39M|		break;
 2183|       |
 2184|  2.57M|	case FILE_SHORT:
  ------------------
  |  |  255|  2.57M|#define				FILE_SHORT		2
  ------------------
  |  Branch (2184:2): [True: 2.57M, False: 140M]
  ------------------
 2185|  8.55M|	case FILE_BESHORT:
  ------------------
  |  |  260|  8.55M|#define				FILE_BESHORT		7
  ------------------
  |  Branch (2185:2): [True: 5.98M, False: 137M]
  ------------------
 2186|  14.1M|	case FILE_LESHORT:
  ------------------
  |  |  263|  14.1M|#define				FILE_LESHORT		10
  ------------------
  |  Branch (2186:2): [True: 5.60M, False: 137M]
  ------------------
 2187|  14.1M|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|  14.1M|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (2187:2): [True: 0, False: 143M]
  ------------------
 2188|  14.1M|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|  14.1M|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (2188:2): [True: 313, False: 143M]
  ------------------
 2189|  14.1M|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|  14.1M|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (2189:2): [True: 0, False: 143M]
  ------------------
 2190|  14.1M|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|  14.1M|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (2190:2): [True: 0, False: 143M]
  ------------------
 2191|  14.1M|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|  14.1M|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (2191:2): [True: 313, False: 143M]
  ------------------
 2192|  14.1M|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|  14.1M|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (2192:2): [True: 0, False: 143M]
  ------------------
 2193|  14.1M|		v = p->h;
 2194|  14.1M|		break;
 2195|       |
 2196|  2.21M|	case FILE_LONG:
  ------------------
  |  |  257|  2.21M|#define				FILE_LONG		4
  ------------------
  |  Branch (2196:2): [True: 2.21M, False: 140M]
  ------------------
 2197|  20.7M|	case FILE_BELONG:
  ------------------
  |  |  261|  20.7M|#define				FILE_BELONG		8
  ------------------
  |  Branch (2197:2): [True: 18.4M, False: 124M]
  ------------------
 2198|  30.0M|	case FILE_LELONG:
  ------------------
  |  |  264|  30.0M|#define				FILE_LELONG		11
  ------------------
  |  Branch (2198:2): [True: 9.36M, False: 133M]
  ------------------
 2199|  30.0M|	case FILE_MELONG:
  ------------------
  |  |  276|  30.0M|#define				FILE_MELONG		23
  ------------------
  |  Branch (2199:2): [True: 37, False: 143M]
  ------------------
 2200|  30.0M|	case FILE_DATE:
  ------------------
  |  |  259|  30.0M|#define				FILE_DATE		6
  ------------------
  |  Branch (2200:2): [True: 0, False: 143M]
  ------------------
 2201|  30.0M|	case FILE_BEDATE:
  ------------------
  |  |  262|  30.0M|#define				FILE_BEDATE		9
  ------------------
  |  Branch (2201:2): [True: 569, False: 143M]
  ------------------
 2202|  30.0M|	case FILE_LEDATE:
  ------------------
  |  |  265|  30.0M|#define				FILE_LEDATE		12
  ------------------
  |  Branch (2202:2): [True: 194, False: 143M]
  ------------------
 2203|  30.0M|	case FILE_MEDATE:
  ------------------
  |  |  274|  30.0M|#define				FILE_MEDATE		21
  ------------------
  |  Branch (2203:2): [True: 141, False: 143M]
  ------------------
 2204|  30.0M|	case FILE_LDATE:
  ------------------
  |  |  267|  30.0M|#define				FILE_LDATE		14
  ------------------
  |  Branch (2204:2): [True: 0, False: 143M]
  ------------------
 2205|  30.0M|	case FILE_BELDATE:
  ------------------
  |  |  268|  30.0M|#define				FILE_BELDATE		15
  ------------------
  |  Branch (2205:2): [True: 504, False: 143M]
  ------------------
 2206|  30.0M|	case FILE_LELDATE:
  ------------------
  |  |  269|  30.0M|#define				FILE_LELDATE		16
  ------------------
  |  Branch (2206:2): [True: 84, False: 143M]
  ------------------
 2207|  30.0M|	case FILE_MELDATE:
  ------------------
  |  |  275|  30.0M|#define				FILE_MELDATE		22
  ------------------
  |  Branch (2207:2): [True: 0, False: 143M]
  ------------------
 2208|  30.0M|		v = p->l;
 2209|  30.0M|		break;
 2210|       |
 2211|  93.8k|	case FILE_QUAD:
  ------------------
  |  |  277|  93.8k|#define				FILE_QUAD		24
  ------------------
  |  Branch (2211:2): [True: 93.8k, False: 142M]
  ------------------
 2212|  1.34M|	case FILE_LEQUAD:
  ------------------
  |  |  278|  1.34M|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (2212:2): [True: 1.25M, False: 141M]
  ------------------
 2213|  2.83M|	case FILE_BEQUAD:
  ------------------
  |  |  279|  2.83M|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (2213:2): [True: 1.48M, False: 141M]
  ------------------
 2214|  2.83M|	case FILE_QDATE:
  ------------------
  |  |  280|  2.83M|#define				FILE_QDATE		27
  ------------------
  |  Branch (2214:2): [True: 0, False: 143M]
  ------------------
 2215|  2.83M|	case FILE_BEQDATE:
  ------------------
  |  |  282|  2.83M|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (2215:2): [True: 1.45k, False: 143M]
  ------------------
 2216|  2.83M|	case FILE_LEQDATE:
  ------------------
  |  |  281|  2.83M|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (2216:2): [True: 39, False: 143M]
  ------------------
 2217|  2.83M|	case FILE_QLDATE:
  ------------------
  |  |  283|  2.83M|#define				FILE_QLDATE		30
  ------------------
  |  Branch (2217:2): [True: 0, False: 143M]
  ------------------
 2218|  2.83M|	case FILE_BEQLDATE:
  ------------------
  |  |  285|  2.83M|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (2218:2): [True: 240, False: 143M]
  ------------------
 2219|  2.83M|	case FILE_LEQLDATE:
  ------------------
  |  |  284|  2.83M|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (2219:2): [True: 253, False: 143M]
  ------------------
 2220|  2.83M|	case FILE_QWDATE:
  ------------------
  |  |  295|  2.83M|#define				FILE_QWDATE		42
  ------------------
  |  Branch (2220:2): [True: 206, False: 143M]
  ------------------
 2221|  2.83M|	case FILE_BEQWDATE:
  ------------------
  |  |  297|  2.83M|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (2221:2): [True: 0, False: 143M]
  ------------------
 2222|  2.83M|	case FILE_LEQWDATE:
  ------------------
  |  |  296|  2.83M|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (2222:2): [True: 2.19k, False: 143M]
  ------------------
 2223|  2.84M|	case FILE_OFFSET:
  ------------------
  |  |  305|  2.84M|#define				FILE_OFFSET		52
  ------------------
  |  Branch (2223:2): [True: 5.24k, False: 143M]
  ------------------
 2224|  2.84M|		v = p->q;
 2225|  2.84M|		break;
 2226|       |
 2227|      0|	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (2227:2): [True: 0, False: 143M]
  ------------------
 2228|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (2228:2): [True: 0, False: 143M]
  ------------------
 2229|  10.2k|	case FILE_LEFLOAT:
  ------------------
  |  |  288|  10.2k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (2229:2): [True: 10.2k, False: 143M]
  ------------------
 2230|  10.2k|		fl = m->value.f;
 2231|  10.2k|		fv = p->f;
 2232|  10.2k|		switch (m->reln) {
 2233|  1.58k|		case 'x':
  ------------------
  |  Branch (2233:3): [True: 1.58k, False: 8.61k]
  ------------------
 2234|  1.58k|			matched = 1;
 2235|  1.58k|			break;
 2236|       |
 2237|      0|		case '!':
  ------------------
  |  Branch (2237:3): [True: 0, False: 10.2k]
  ------------------
 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: 10.2k]
  ------------------
 2242|      0|			matched = isunordered(fl, fv) ? 0 : fv == fl;
  ------------------
  |  Branch (2242:14): [True: 0, False: 0]
  ------------------
 2243|      0|			break;
 2244|       |
 2245|  8.61k|		case '>':
  ------------------
  |  Branch (2245:3): [True: 8.61k, False: 1.58k]
  ------------------
 2246|  8.61k|			matched = isgreater(fv, fl);
 2247|  8.61k|			break;
 2248|       |
 2249|      0|		case '<':
  ------------------
  |  Branch (2249:3): [True: 0, False: 10.2k]
  ------------------
 2250|      0|			matched = isless(fv, fl);
 2251|      0|			break;
 2252|       |
 2253|      0|		default:
  ------------------
  |  Branch (2253:3): [True: 0, False: 10.2k]
  ------------------
 2254|      0|			file_magerror(ms, "cannot happen with float: "
 2255|      0|			    "invalid relation `%c'", m->reln);
 2256|      0|			return -1;
 2257|  10.2k|		}
 2258|  10.2k|		return matched;
 2259|       |
 2260|      0|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (2260:2): [True: 0, False: 143M]
  ------------------
 2261|    168|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|    168|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (2261:2): [True: 168, False: 143M]
  ------------------
 2262|  1.56k|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|  1.56k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (2262:2): [True: 1.39k, False: 143M]
  ------------------
 2263|  1.56k|		dl = m->value.d;
 2264|  1.56k|		dv = p->d;
 2265|  1.56k|		switch (m->reln) {
 2266|  1.32k|		case 'x':
  ------------------
  |  Branch (2266:3): [True: 1.32k, False: 238]
  ------------------
 2267|  1.32k|			matched = 1;
 2268|  1.32k|			break;
 2269|       |
 2270|      0|		case '!':
  ------------------
  |  Branch (2270:3): [True: 0, False: 1.56k]
  ------------------
 2271|      0|			matched = isunordered(dv, dl) ? 1 : dv != dl;
  ------------------
  |  Branch (2271:14): [True: 0, False: 0]
  ------------------
 2272|      0|			break;
 2273|       |
 2274|    238|		case '=':
  ------------------
  |  Branch (2274:3): [True: 238, False: 1.32k]
  ------------------
 2275|    238|			matched = isunordered(dv, dl) ? 0 : dv == dl;
  ------------------
  |  Branch (2275:14): [True: 66, False: 172]
  ------------------
 2276|    238|			break;
 2277|       |
 2278|      0|		case '>':
  ------------------
  |  Branch (2278:3): [True: 0, False: 1.56k]
  ------------------
 2279|      0|			matched = isgreater(dv, dl);
 2280|      0|			break;
 2281|       |
 2282|      0|		case '<':
  ------------------
  |  Branch (2282:3): [True: 0, False: 1.56k]
  ------------------
 2283|      0|			matched = isless(dv, dl);
 2284|      0|			break;
 2285|       |
 2286|      0|		default:
  ------------------
  |  Branch (2286:3): [True: 0, False: 1.56k]
  ------------------
 2287|      0|			file_magerror(ms, "cannot happen with double: "
 2288|      0|			    "invalid relation `%c'", m->reln);
 2289|      0|			return -1;
 2290|  1.56k|		}
 2291|  1.56k|		return matched;
 2292|       |
 2293|  8.77k|	case FILE_DEFAULT:
  ------------------
  |  |  256|  8.77k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (2293:2): [True: 8.77k, False: 143M]
  ------------------
 2294|  10.6k|	case FILE_CLEAR:
  ------------------
  |  |  300|  10.6k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (2294:2): [True: 1.86k, False: 143M]
  ------------------
 2295|  10.6k|		l = 0;
 2296|  10.6k|		v = 0;
 2297|  10.6k|		break;
 2298|       |
 2299|  90.8M|	case FILE_STRING:
  ------------------
  |  |  258|  90.8M|#define				FILE_STRING		5
  ------------------
  |  Branch (2299:2): [True: 90.8M, False: 52.1M]
  ------------------
 2300|  90.9M|	case FILE_PSTRING:
  ------------------
  |  |  266|  90.9M|#define				FILE_PSTRING		13
  ------------------
  |  Branch (2300:2): [True: 40.4k, False: 142M]
  ------------------
 2301|  90.9M|	case FILE_OCTAL:
  ------------------
  |  |  314|  90.9M|#define				FILE_OCTAL		61
  ------------------
  |  Branch (2301:2): [True: 0, False: 143M]
  ------------------
 2302|  90.9M|		l = 0;
 2303|  90.9M|		v = file_strncmp(m->value.s, p->s, CAST(size_t, m->vallen),
  ------------------
  |  |  460|  90.9M|#define CAST(T, b)	((T)(b))
  ------------------
 2304|  90.9M|		    sizeof(p->s), m->str_flags);
  ------------------
  |  |  390|  90.9M|#define str_flags _u._s._flags
  ------------------
 2305|  90.9M|		break;
 2306|       |
 2307|    138|	case FILE_BESTRING16:
  ------------------
  |  |  271|    138|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (2307:2): [True: 138, False: 143M]
  ------------------
 2308|  93.3k|	case FILE_LESTRING16:
  ------------------
  |  |  272|  93.3k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (2308:2): [True: 93.2k, False: 142M]
  ------------------
 2309|  93.3k|		l = 0;
 2310|  93.3k|		v = file_strncmp16(m->value.s, p->s, CAST(size_t, m->vallen),
  ------------------
  |  |  460|  93.3k|#define CAST(T, b)	((T)(b))
  ------------------
 2311|  93.3k|		    sizeof(p->s), m->str_flags);
  ------------------
  |  |  390|  93.3k|#define str_flags _u._s._flags
  ------------------
 2312|  93.3k|		break;
 2313|       |
 2314|   931k|	case FILE_SEARCH: { /* search ms->search.s for the string m->value.s */
  ------------------
  |  |  273|   931k|#define				FILE_SEARCH		20
  ------------------
  |  Branch (2314:2): [True: 931k, False: 142M]
  ------------------
 2315|   931k|		size_t slen;
 2316|   931k|		size_t idx;
 2317|       |
 2318|   931k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (2318:7): [True: 0, False: 931k]
  ------------------
 2319|      0|			return 0;
 2320|       |
 2321|   931k|		slen = MIN(m->vallen, sizeof(m->value.s));
  ------------------
  |  Branch (2321:10): [True: 931k, False: 0]
  ------------------
 2322|   931k|		l = 0;
 2323|   931k|		v = 0;
 2324|   931k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   931k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2324:7): [True: 0, False: 931k]
  ------------------
 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|   931k|#ifdef HAVE_MEMMEM
 2335|   931k|		if (slen > 0 && m->str_flags == 0) {
  ------------------
  |  |  390|   931k|#define str_flags _u._s._flags
  ------------------
  |  Branch (2335:7): [True: 931k, False: 0]
  |  Branch (2335:19): [True: 409k, False: 521k]
  ------------------
 2336|   409k|			const char *found;
 2337|   409k|			idx = m->str_range + slen;
  ------------------
  |  |  389|   409k|#define str_range _u._s._count
  ------------------
 2338|   409k|			if (m->str_range == 0 || ms->search.s_len < idx)
  ------------------
  |  |  389|   409k|#define str_range _u._s._count
  ------------------
  |  Branch (2338:8): [True: 4.49k, False: 404k]
  |  Branch (2338:29): [True: 102k, False: 302k]
  ------------------
 2339|   106k|				idx = ms->search.s_len;
 2340|   409k|			found = CAST(const char *, memmem(ms->search.s, idx,
  ------------------
  |  |  460|   409k|#define CAST(T, b)	((T)(b))
  ------------------
 2341|   409k|			    m->value.s, slen));
 2342|   409k|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   409k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2342:8): [True: 0, False: 409k]
  ------------------
 2343|      0|				fprintf(stderr, "] %sfound\n",
 2344|      0|				    found ? "" : "not ");
  ------------------
  |  Branch (2344:9): [True: 0, False: 0]
  ------------------
 2345|      0|			}
 2346|   409k|			if (!found) {
  ------------------
  |  Branch (2346:8): [True: 406k, False: 2.72k]
  ------------------
 2347|   406k|				v = 1;
 2348|   406k|				break;
 2349|   406k|			}
 2350|  2.72k|			idx = found - ms->search.s;
 2351|  2.72k|			ms->search.offset += idx;
 2352|  2.72k|			ms->search.rm_len = ms->search.s_len - idx;
 2353|  2.72k|			break;
 2354|   409k|		}
 2355|   521k|#endif
 2356|       |
 2357|  3.55G|		for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
  ------------------
  |  |  389|  3.55G|#define str_range _u._s._count
  ------------------
              		for (idx = 0; m->str_range == 0 || idx < m->str_range; idx++) {
  ------------------
  |  |  389|  3.55G|#define str_range _u._s._count
  ------------------
  |  Branch (2357:17): [True: 0, False: 3.55G]
  |  Branch (2357:38): [True: 3.55G, False: 363k]
  ------------------
 2358|  3.55G|			if (slen + idx > ms->search.s_len) {
  ------------------
  |  Branch (2358:8): [True: 136k, False: 3.55G]
  ------------------
 2359|   136k|				v = 1;
 2360|   136k|				break;
 2361|   136k|			}
 2362|       |
 2363|  3.55G|			v = file_strncmp(m->value.s, ms->search.s + idx, slen,
 2364|  3.55G|			    ms->search.s_len - idx, m->str_flags);
  ------------------
  |  |  390|  3.55G|#define str_flags _u._s._flags
  ------------------
 2365|  3.55G|			if (v == 0) {	/* found match */
  ------------------
  |  Branch (2365:8): [True: 21.8k, False: 3.55G]
  ------------------
 2366|  21.8k|				ms->search.offset += idx;
 2367|  21.8k|				ms->search.rm_len = ms->search.s_len - idx;
 2368|  21.8k|				break;
 2369|  21.8k|			}
 2370|  3.55G|		}
 2371|   521k|		if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   521k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2371:7): [True: 0, False: 521k]
  ------------------
 2372|      0|			fprintf(stderr, "] %sfound\n", v == 0 ? "" : "not ");
  ------------------
  |  Branch (2372:35): [True: 0, False: 0]
  ------------------
 2373|      0|		}
 2374|   521k|		break;
 2375|   931k|	}
 2376|   593k|	case FILE_REGEX: {
  ------------------
  |  |  270|   593k|#define				FILE_REGEX		17
  ------------------
  |  Branch (2376:2): [True: 593k, False: 142M]
  ------------------
 2377|   593k|		int rc;
 2378|   593k|		file_regex_t *rx = *m_cache;
 2379|   593k|		const char *search;
 2380|   593k|		regmatch_t pmatch;
 2381|   593k|		size_t slen = ms->search.s_len;
 2382|   593k|		char *copy;
 2383|       |
 2384|   593k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (2384:7): [True: 70, False: 593k]
  ------------------
 2385|     70|			return 0;
 2386|       |
 2387|   593k|		if (rx == NULL) {
  ------------------
  |  Branch (2387:7): [True: 162, False: 593k]
  ------------------
 2388|    162|			rx = *m_cache = alloc_regex(ms, m);
 2389|    162|			if (rx == NULL)
  ------------------
  |  Branch (2389:8): [True: 0, False: 162]
  ------------------
 2390|      0|				return -1;
 2391|    162|		}
 2392|   593k|		l = 0;
 2393|   593k|		if (slen != 0) {
  ------------------
  |  Branch (2393:7): [True: 591k, False: 2.35k]
  ------------------
 2394|   591k|		    copy = CAST(char *, malloc(slen));
  ------------------
  |  |  460|   591k|#define CAST(T, b)	((T)(b))
  ------------------
 2395|   591k|		    if (copy == NULL)  {
  ------------------
  |  Branch (2395:11): [True: 0, False: 591k]
  ------------------
 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|   591k|		    memcpy(copy, ms->search.s, slen);
 2402|   591k|		    copy[--slen] = '\0';
 2403|   591k|		    search = copy;
 2404|   591k|		} else {
 2405|  2.35k|		    search = CCAST(char *, "");
  ------------------
  |  |  462|  2.35k|#define CCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2406|  2.35k|		    copy = NULL;
 2407|  2.35k|		}
 2408|   593k|		rc = file_regexec(ms, rx, RCAST(const char *, search),
  ------------------
  |  |  461|   593k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2409|   593k|		    1, &pmatch, 0);
 2410|   593k|		free(copy);
 2411|   593k|		switch (rc) {
 2412|  4.05k|		case 0:
  ------------------
  |  Branch (2412:3): [True: 4.05k, False: 589k]
  ------------------
 2413|  4.05k|			ms->search.s += CAST(int, pmatch.rm_so);
  ------------------
  |  |  460|  4.05k|#define CAST(T, b)	((T)(b))
  ------------------
 2414|  4.05k|			ms->search.offset += CAST(size_t, pmatch.rm_so);
  ------------------
  |  |  460|  4.05k|#define CAST(T, b)	((T)(b))
  ------------------
 2415|  4.05k|			ms->search.rm_len = CAST(size_t,
  ------------------
  |  |  460|  4.05k|#define CAST(T, b)	((T)(b))
  ------------------
 2416|  4.05k|			    pmatch.rm_eo - pmatch.rm_so);
 2417|  4.05k|			v = 0;
 2418|  4.05k|			break;
 2419|       |
 2420|   589k|		case REG_NOMATCH:
  ------------------
  |  Branch (2420:3): [True: 589k, False: 4.05k]
  ------------------
 2421|   589k|			v = 1;
 2422|   589k|			break;
 2423|       |
 2424|      0|		default:
  ------------------
  |  Branch (2424:3): [True: 0, False: 593k]
  ------------------
 2425|      0|			return -1;
 2426|   593k|		}
 2427|   593k|		break;
 2428|   593k|	}
 2429|   593k|	case FILE_USE:
  ------------------
  |  |  299|  37.3k|#define				FILE_USE		46
  ------------------
  |  Branch (2429:2): [True: 37.3k, False: 142M]
  ------------------
 2430|  37.3k|		return ms->ms_value.q != 0;
 2431|  51.4k|	case FILE_NAME:
  ------------------
  |  |  298|  51.4k|#define				FILE_NAME		45
  ------------------
  |  Branch (2431:2): [True: 51.4k, False: 142M]
  ------------------
 2432|  67.2k|	case FILE_INDIRECT:
  ------------------
  |  |  294|  67.2k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (2432:2): [True: 15.7k, False: 143M]
  ------------------
 2433|  67.2k|		return 1;
 2434|   567k|	case FILE_DER:
  ------------------
  |  |  301|   567k|#define				FILE_DER		48
  ------------------
  |  Branch (2434:2): [True: 567k, False: 142M]
  ------------------
 2435|   567k|		matched = der_cmp(ms, m);
 2436|   567k|		if (matched == -1) {
  ------------------
  |  Branch (2436:7): [True: 194k, False: 373k]
  ------------------
 2437|   194k|			if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   194k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2437:8): [True: 0, False: 194k]
  ------------------
 2438|      0|				(void) fprintf(stderr,
 2439|      0|				    "EOF comparing DER entries\n");
 2440|      0|			}
 2441|   194k|			return 0;
 2442|   194k|		}
 2443|   373k|		return matched;
 2444|     36|	case FILE_BEGUID:
  ------------------
  |  |  304|     36|#define				FILE_BEGUID		51
  ------------------
  |  Branch (2444:2): [True: 36, False: 143M]
  ------------------
 2445|     36|	case FILE_LEGUID:
  ------------------
  |  |  303|     36|#define				FILE_LEGUID		50
  ------------------
  |  Branch (2445:2): [True: 0, False: 143M]
  ------------------
 2446|   349k|	case FILE_GUID:
  ------------------
  |  |  302|   349k|#define				FILE_GUID		49
  ------------------
  |  Branch (2446:2): [True: 349k, False: 142M]
  ------------------
 2447|   349k|		l = 0;
 2448|   349k|		v = memcmp(m->value.guid, p->guid, sizeof(p->guid));
 2449|   349k|		break;
 2450|      0|	default:
  ------------------
  |  Branch (2450:2): [True: 0, False: 143M]
  ------------------
 2451|      0|		file_magerror(ms, "invalid type %d in magiccheck()", m->type);
 2452|      0|		return -1;
 2453|   143M|	}
 2454|       |
 2455|   142M|	v = file_signextend(ms, m, v);
 2456|       |
 2457|   142M|	switch (m->reln) {
 2458|  92.8k|	case 'x':
  ------------------
  |  Branch (2458:2): [True: 92.8k, False: 142M]
  ------------------
 2459|  92.8k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  92.8k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2459:7): [True: 0, False: 92.8k]
  ------------------
 2460|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT
 2461|      0|			    "u == *any* = 1", CAST(unsigned long long, v));
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2462|  92.8k|		matched = 1;
 2463|  92.8k|		break;
 2464|       |
 2465|  68.2k|	case '!':
  ------------------
  |  Branch (2465:2): [True: 68.2k, False: 142M]
  ------------------
 2466|  68.2k|		matched = v != l;
 2467|  68.2k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  68.2k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2467:7): [True: 0, False: 68.2k]
  ------------------
 2468|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT "u != %"
 2469|      0|			    INT64_T_FORMAT "u = %d",
 2470|      0|			    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2471|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2472|  68.2k|		break;
 2473|       |
 2474|   141M|	case '=':
  ------------------
  |  Branch (2474:2): [True: 141M, False: 1.00M]
  ------------------
 2475|   141M|		matched = v == l;
 2476|   141M|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   141M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2476:7): [True: 0, False: 141M]
  ------------------
 2477|      0|			(void) fprintf(stderr, "%" INT64_T_FORMAT "u == %"
 2478|      0|			    INT64_T_FORMAT "u = %d",
 2479|      0|			    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2480|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2481|   141M|		break;
 2482|       |
 2483|   305k|	case '>':
  ------------------
  |  Branch (2483:2): [True: 305k, False: 142M]
  ------------------
 2484|   305k|		if (m->flag & UNSIGNED) {
  ------------------
  |  |  237|   305k|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (2484:7): [True: 222k, False: 83.1k]
  ------------------
 2485|   222k|			matched = v > l;
 2486|   222k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   222k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2486:8): [True: 0, False: 222k]
  ------------------
 2487|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2488|      0|				    "u > %" INT64_T_FORMAT "u = %d",
 2489|      0|				    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2490|      0|				    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2491|   222k|		}
 2492|  83.1k|		else {
 2493|  83.1k|			matched = CAST(int64_t, v) > CAST(int64_t, l);
  ------------------
  |  |  460|  83.1k|#define CAST(T, b)	((T)(b))
  ------------------
              			matched = CAST(int64_t, v) > CAST(int64_t, l);
  ------------------
  |  |  460|  83.1k|#define CAST(T, b)	((T)(b))
  ------------------
 2494|  83.1k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  83.1k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2494:8): [True: 0, False: 83.1k]
  ------------------
 2495|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2496|      0|				    "d > %" INT64_T_FORMAT "d = %d",
 2497|      0|				    CAST(long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2498|      0|				    CAST(long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2499|  83.1k|		}
 2500|   305k|		break;
 2501|       |
 2502|   490k|	case '<':
  ------------------
  |  Branch (2502:2): [True: 490k, False: 141M]
  ------------------
 2503|   490k|		if (m->flag & UNSIGNED) {
  ------------------
  |  |  237|   490k|#define UNSIGNED	0x08	/* comparison is unsigned */
  ------------------
  |  Branch (2503:7): [True: 409k, False: 80.4k]
  ------------------
 2504|   409k|			matched = v < l;
 2505|   409k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|   409k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2505:8): [True: 0, False: 409k]
  ------------------
 2506|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2507|      0|				    "u < %" INT64_T_FORMAT "u = %d",
 2508|      0|				    CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2509|      0|				    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2510|   409k|		}
 2511|  80.4k|		else {
 2512|  80.4k|			matched = CAST(int64_t, v) < CAST(int64_t, l);
  ------------------
  |  |  460|  80.4k|#define CAST(T, b)	((T)(b))
  ------------------
              			matched = CAST(int64_t, v) < CAST(int64_t, l);
  ------------------
  |  |  460|  80.4k|#define CAST(T, b)	((T)(b))
  ------------------
 2513|  80.4k|			if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  80.4k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2513:8): [True: 0, False: 80.4k]
  ------------------
 2514|      0|				(void) fprintf(stderr, "%" INT64_T_FORMAT
 2515|      0|				    "d < %" INT64_T_FORMAT "d = %d",
 2516|      0|				     CAST(long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2517|      0|				     CAST(long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2518|  80.4k|		}
 2519|   490k|		break;
 2520|       |
 2521|  47.9k|	case '&':
  ------------------
  |  Branch (2521:2): [True: 47.9k, False: 142M]
  ------------------
 2522|  47.9k|		matched = (v & l) == l;
 2523|  47.9k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  47.9k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2523:7): [True: 0, False: 47.9k]
  ------------------
 2524|      0|			(void) fprintf(stderr, "((%" INT64_T_FORMAT "x & %"
 2525|      0|			    INT64_T_FORMAT "x) == %" INT64_T_FORMAT
 2526|      0|			    "x) = %d", CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2527|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2528|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2529|      0|			    matched);
 2530|  47.9k|		break;
 2531|       |
 2532|  1.08k|	case '^':
  ------------------
  |  Branch (2532:2): [True: 1.08k, False: 142M]
  ------------------
 2533|  1.08k|		matched = (v & l) != l;
 2534|  1.08k|		if ((ms->flags & MAGIC_DEBUG) != 0)
  ------------------
  |  |   33|  1.08k|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2534:7): [True: 0, False: 1.08k]
  ------------------
 2535|      0|			(void) fprintf(stderr, "((%" INT64_T_FORMAT "x & %"
 2536|      0|			    INT64_T_FORMAT "x) != %" INT64_T_FORMAT
 2537|      0|			    "x) = %d", CAST(unsigned long long, v),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2538|      0|			    CAST(unsigned long long, l),
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2539|      0|			    CAST(unsigned long long, l), matched);
  ------------------
  |  |  460|      0|#define CAST(T, b)	((T)(b))
  ------------------
 2540|  1.08k|		break;
 2541|       |
 2542|      0|	default:
  ------------------
  |  Branch (2542:2): [True: 0, False: 142M]
  ------------------
 2543|      0|		file_magerror(ms, "cannot happen: invalid relation `%c'",
 2544|      0|		    m->reln);
 2545|      0|		return -1;
 2546|   142M|	}
 2547|   142M|	if ((ms->flags & MAGIC_DEBUG) != 0) {
  ------------------
  |  |   33|   142M|#define	MAGIC_DEBUG		0x0000001 /* Turn on debugging */
  ------------------
  |  Branch (2547:6): [True: 0, False: 142M]
  ------------------
 2548|      0|		(void) fprintf(stderr, " strength=%zu\n",
 2549|      0|		    file_magic_strength(m, 1));
 2550|      0|	}
 2551|       |
 2552|   142M|	return matched;
 2553|   142M|}
softmagic.c:file_strncmp:
 2061|  3.64G|{
 2062|       |	/*
 2063|       |	 * Convert the source args to unsigned here so that (1) the
 2064|       |	 * compare will be unsigned as it is in strncmp() and (2) so
 2065|       |	 * the ctype functions will work correctly without extra
 2066|       |	 * casting.
 2067|       |	 */
 2068|  3.64G|	const unsigned char *a = RCAST(const unsigned char *, s1);
  ------------------
  |  |  461|  3.64G|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2069|  3.64G|	const unsigned char *b = RCAST(const unsigned char *, s2);
  ------------------
  |  |  461|  3.64G|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
 2070|  3.64G|	uint32_t ws = flags & (STRING_COMPACT_WHITESPACE |
  ------------------
  |  |  404|  3.64G|#define STRING_COMPACT_WHITESPACE		BIT(0)
  |  |  ------------------
  |  |  |  |  403|  3.64G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
 2071|  3.64G|	    STRING_COMPACT_OPTIONAL_WHITESPACE);
  ------------------
  |  |  405|  3.64G|#define STRING_COMPACT_OPTIONAL_WHITESPACE	BIT(1)
  |  |  ------------------
  |  |  |  |  403|  3.64G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
 2072|  3.64G|	const unsigned char *eb = b + (ws ? maxlen : len);
  ------------------
  |  Branch (2072:33): [True: 125M, False: 3.51G]
  ------------------
 2073|  3.64G|	uint64_t v;
 2074|       |
 2075|       |	/*
 2076|       |	 * What we want here is v = strncmp(s1, s2, len),
 2077|       |	 * but ignoring any nulls.
 2078|       |	 */
 2079|  3.64G|	v = 0;
 2080|  3.64G|	len++;
 2081|  3.64G|	if (0L == flags) { /* normal string: do it fast */
  ------------------
  |  Branch (2081:6): [True: 86.2M, False: 3.55G]
  ------------------
 2082|  88.6M|		while (--len > 0)
  ------------------
  |  Branch (2082:10): [True: 88.6M, False: 30.8k]
  ------------------
 2083|  88.6M|			if ((v = *b++ - *a++) != '\0')
  ------------------
  |  Branch (2083:8): [True: 86.1M, False: 2.48M]
  ------------------
 2084|  86.1M|				break;
 2085|  86.2M|	}
 2086|  3.55G|	else { /* combine the others */
 2087|  3.56G|		while (--len > 0) {
  ------------------
  |  Branch (2087:10): [True: 3.56G, False: 64.5k]
  ------------------
 2088|  3.56G|			if (b >= eb) {
  ------------------
  |  Branch (2088:8): [True: 211k, False: 3.56G]
  ------------------
 2089|   211k|				v = 1;
 2090|   211k|				break;
 2091|   211k|			}
 2092|  3.56G|			if ((flags & STRING_IGNORE_LOWERCASE) &&
  ------------------
  |  |  406|  3.56G|#define STRING_IGNORE_LOWERCASE			BIT(2)
  |  |  ------------------
  |  |  |  |  403|  3.56G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2092:8): [True: 127M, False: 3.43G]
  ------------------
 2093|  3.56G|			    islower(*a)) {
  ------------------
  |  Branch (2093:8): [True: 6.52M, False: 121M]
  ------------------
 2094|  6.52M|				if ((v = tolower(*b++) - *a++) != '\0')
  ------------------
  |  Branch (2094:9): [True: 6.49M, False: 23.5k]
  |  Branch (2094:14): [True: 0, False: 0]
  |  Branch (2094:14): [Folded, False: 0]
  |  Branch (2094:14): [Folded, False: 6.52M]
  ------------------
 2095|  6.49M|					break;
 2096|  6.52M|			}
 2097|  3.55G|			else if ((flags & STRING_IGNORE_UPPERCASE) &&
  ------------------
  |  |  407|  3.55G|#define STRING_IGNORE_UPPERCASE			BIT(3)
  |  |  ------------------
  |  |  |  |  403|  3.55G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2097:13): [True: 16.1k, False: 3.55G]
  ------------------
 2098|  3.55G|			    isupper(*a)) {
  ------------------
  |  Branch (2098:8): [True: 15.4k, False: 641]
  ------------------
 2099|  15.4k|				if ((v = toupper(*b++) - *a++) != '\0')
  ------------------
  |  Branch (2099:9): [True: 15.3k, False: 96]
  |  Branch (2099:14): [True: 0, False: 0]
  |  Branch (2099:14): [Folded, False: 0]
  |  Branch (2099:14): [Folded, False: 15.4k]
  ------------------
 2100|  15.3k|					break;
 2101|  15.4k|			}
 2102|  3.55G|			else if ((flags & STRING_COMPACT_WHITESPACE) &&
  ------------------
  |  |  404|  3.55G|#define STRING_COMPACT_WHITESPACE		BIT(0)
  |  |  ------------------
  |  |  |  |  403|  3.55G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2102:13): [True: 108M, False: 3.44G]
  ------------------
 2103|  3.55G|			    isspace(*a)) {
  ------------------
  |  Branch (2103:8): [True: 1.81M, False: 106M]
  ------------------
 2104|  1.81M|				a++;
 2105|  1.81M|				if (isspace(*b)) {
  ------------------
  |  Branch (2105:9): [True: 268k, False: 1.54M]
  ------------------
 2106|   268k|					b++;
 2107|   268k|					if (!isspace(*a))
  ------------------
  |  Branch (2107:10): [True: 268k, False: 0]
  ------------------
 2108|  8.43G|						while (b < eb && isspace(*b))
  ------------------
  |  Branch (2108:14): [True: 8.43G, False: 211k]
  |  Branch (2108:24): [True: 8.43G, False: 56.6k]
  ------------------
 2109|  8.43G|							b++;
 2110|   268k|				}
 2111|  1.54M|				else {
 2112|  1.54M|					v = 1;
 2113|  1.54M|					break;
 2114|  1.54M|				}
 2115|  1.81M|			}
 2116|  3.55G|			else if ((flags & STRING_COMPACT_OPTIONAL_WHITESPACE) &&
  ------------------
  |  |  405|  3.55G|#define STRING_COMPACT_OPTIONAL_WHITESPACE	BIT(1)
  |  |  ------------------
  |  |  |  |  403|  3.55G|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2116:13): [True: 17.0M, False: 3.53G]
  ------------------
 2117|  3.55G|			    isspace(*a)) {
  ------------------
  |  Branch (2117:8): [True: 2.18k, False: 17.0M]
  ------------------
 2118|  2.18k|				a++;
 2119|   429k|				while (b < eb && isspace(*b))
  ------------------
  |  Branch (2119:12): [True: 429k, False: 48]
  |  Branch (2119:22): [True: 427k, False: 2.13k]
  ------------------
 2120|   427k|					b++;
 2121|  2.18k|			}
 2122|  3.55G|			else {
 2123|  3.55G|				if ((v = *b++ - *a++) != '\0')
  ------------------
  |  Branch (2123:9): [True: 3.54G, False: 6.26M]
  ------------------
 2124|  3.54G|					break;
 2125|  3.55G|			}
 2126|  3.56G|		}
 2127|  3.55G|		if (len == 0 && v == 0 && (flags & STRING_FULL_WORD)) {
  ------------------
  |  |  422|  64.5k|#define	STRING_FULL_WORD			BIT(14)
  |  |  ------------------
  |  |  |  |  403|  64.5k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (2127:7): [True: 64.5k, False: 3.55G]
  |  Branch (2127:19): [True: 64.5k, False: 0]
  |  Branch (2127:29): [True: 118, False: 64.4k]
  ------------------
 2128|    118|			if (*b && !isspace(*b))
  ------------------
  |  Branch (2128:8): [True: 84, False: 34]
  |  Branch (2128:14): [True: 50, False: 34]
  ------------------
 2129|     50|				v = 1;
 2130|    118|		}
 2131|  3.55G|	}
 2132|  3.64G|	return v;
 2133|  3.64G|}
softmagic.c:file_strncmp16:
 2138|  93.3k|{
 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|  93.3k|	flags = 0;
 2145|  93.3k|	return file_strncmp(a, b, len, maxlen, flags);
 2146|  93.3k|}
softmagic.c:alloc_regex:
 2150|    162|{
 2151|    162|	int rc;
 2152|    162|	file_regex_t *rx = CAST(file_regex_t *, malloc(sizeof(*rx)));
  ------------------
  |  |  460|    162|#define CAST(T, b)	((T)(b))
  ------------------
 2153|       |
 2154|    162|	if (rx == NULL) {
  ------------------
  |  Branch (2154:6): [True: 0, False: 162]
  ------------------
 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|    162|	rc = file_regcomp(ms, rx, m->value.s, REG_EXTENDED | REG_NEWLINE |
 2161|    162|	    REGEX_ICASE(m));
  ------------------
  |  |  440|    162|#define	REGEX_ICASE(m) (((m)->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)
  |  |  ------------------
  |  |  |  |  390|    162|#define str_flags _u._s._flags
  |  |  ------------------
  |  |               #define	REGEX_ICASE(m) (((m)->str_flags & STRING_IGNORE_CASE) ? REG_ICASE : 0)
  |  |  ------------------
  |  |  |  |  439|    162|#define STRING_IGNORE_CASE		(STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  406|    162|#define STRING_IGNORE_LOWERCASE			BIT(2)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  403|    162|#define BIT(A)   (1 << (A))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  |  |               #define STRING_IGNORE_CASE		(STRING_IGNORE_LOWERCASE|STRING_IGNORE_UPPERCASE)
  |  |  |  |  ------------------
  |  |  |  |  |  |  407|    162|#define STRING_IGNORE_UPPERCASE			BIT(3)
  |  |  |  |  |  |  ------------------
  |  |  |  |  |  |  |  |  403|    162|#define BIT(A)   (1 << (A))
  |  |  |  |  |  |  ------------------
  |  |  |  |  ------------------
  |  |  ------------------
  |  |  |  Branch (440:25): [True: 20, False: 142]
  |  |  ------------------
  ------------------
 2162|    162|	if (rc == 0)
  ------------------
  |  Branch (2162:6): [True: 162, False: 0]
  ------------------
 2163|    162|		return rx;
 2164|       |
 2165|      0|	free(rx);
 2166|       |	return NULL;
 2167|    162|}
softmagic.c:handle_annotation:
 2557|   988k|{
 2558|   988k|	if ((ms->flags & MAGIC_APPLE) && m->apple[0]) {
  ------------------
  |  |   45|   988k|#define	MAGIC_APPLE		0x0000800 /* Return the Apple creator/type */
  ------------------
  |  Branch (2558:6): [True: 0, False: 988k]
  |  Branch (2558:35): [True: 0, False: 0]
  ------------------
 2559|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2559:7): [True: 0, False: 0]
  |  Branch (2559:21): [True: 0, False: 0]
  ------------------
 2560|      0|			return 1;
 2561|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2561:7): [True: 0, False: 0]
  ------------------
 2562|      0|			return -1;
 2563|      0|		if (file_printf(ms, "%.8s", m->apple) == -1)
  ------------------
  |  Branch (2563:7): [True: 0, False: 0]
  ------------------
 2564|      0|			return -1;
 2565|      0|		return 1;
 2566|      0|	}
 2567|   988k|	if ((ms->flags & MAGIC_EXTENSION) && m->ext[0]) {
  ------------------
  |  |   46|   988k|#define	MAGIC_EXTENSION		0x1000000 /* Return a /-separated list of
  ------------------
  |  Branch (2567:6): [True: 0, False: 988k]
  |  Branch (2567:39): [True: 0, False: 0]
  ------------------
 2568|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2568:7): [True: 0, False: 0]
  |  Branch (2568:21): [True: 0, False: 0]
  ------------------
 2569|      0|			return 1;
 2570|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2570:7): [True: 0, False: 0]
  ------------------
 2571|      0|			return -1;
 2572|      0|		if (file_printf(ms, "%s", m->ext) == -1)
  ------------------
  |  Branch (2572:7): [True: 0, False: 0]
  ------------------
 2573|      0|			return -1;
 2574|      0|		return 1;
 2575|      0|	}
 2576|   988k|	if ((ms->flags & MAGIC_MIME_TYPE) && m->mimetype[0]) {
  ------------------
  |  |   37|   988k|#define	MAGIC_MIME_TYPE		0x0000010 /* Return the MIME type */
  ------------------
  |  Branch (2576:6): [True: 0, False: 988k]
  |  Branch (2576:39): [True: 0, False: 0]
  ------------------
 2577|      0|		char buf[1024];
 2578|      0|		const char *p;
 2579|      0|		if (!firstline && !(ms->flags & MAGIC_CONTINUE))
  ------------------
  |  |   38|      0|#define	MAGIC_CONTINUE		0x0000020 /* Return all matches */
  ------------------
  |  Branch (2579:7): [True: 0, False: 0]
  |  Branch (2579:21): [True: 0, False: 0]
  ------------------
 2580|      0|			return 1;
 2581|      0|		if (print_sep(ms, firstline) == -1)
  ------------------
  |  Branch (2581:7): [True: 0, False: 0]
  ------------------
 2582|      0|			return -1;
 2583|      0|		if (varexpand(ms, buf, sizeof(buf), m->mimetype) == -1)
  ------------------
  |  Branch (2583:7): [True: 0, False: 0]
  ------------------
 2584|      0|			p = m->mimetype;
 2585|      0|		else
 2586|      0|			p = buf;
 2587|      0|		if (file_printf(ms, "%s", p) == -1)
  ------------------
  |  Branch (2587:7): [True: 0, False: 0]
  ------------------
 2588|      0|			return -1;
 2589|      0|		return 1;
 2590|      0|	}
 2591|   988k|	return 0;
 2592|   988k|}
softmagic.c:varexpand:
  549|   114k|{
  550|   114k|	const char *ptr, *sptr, *e, *t, *ee, *et;
  551|   114k|	size_t l;
  552|       |
  553|   114k|	for (sptr = str; (ptr = strstr(sptr, "${")) != NULL;) {
  ------------------
  |  Branch (553:19): [True: 51, False: 114k]
  ------------------
  554|     51|		l = CAST(size_t, ptr - sptr);
  ------------------
  |  |  460|     51|#define CAST(T, b)	((T)(b))
  ------------------
  555|     51|		if (l >= len)
  ------------------
  |  Branch (555:7): [True: 0, False: 51]
  ------------------
  556|      0|			return -1;
  557|     51|		memcpy(buf, sptr, l);
  558|     51|		buf += l;
  559|     51|		len -= l;
  560|     51|		ptr += 2;
  561|     51|		if (!*ptr || ptr[1] != '?')
  ------------------
  |  Branch (561:7): [True: 0, False: 51]
  |  Branch (561:16): [True: 0, False: 51]
  ------------------
  562|      0|			return -1;
  563|    765|		for (et = t = ptr + 2; *et && *et != ':'; et++)
  ------------------
  |  Branch (563:26): [True: 765, False: 0]
  |  Branch (563:33): [True: 714, False: 51]
  ------------------
  564|    714|			continue;
  565|     51|		if (*et != ':')
  ------------------
  |  Branch (565:7): [True: 0, False: 51]
  ------------------
  566|      0|			return -1;
  567|    714|		for (ee = e = et + 1; *ee && *ee != '}'; ee++)
  ------------------
  |  Branch (567:25): [True: 714, False: 0]
  |  Branch (567:32): [True: 663, False: 51]
  ------------------
  568|    663|			continue;
  569|     51|		if (*ee != '}')
  ------------------
  |  Branch (569:7): [True: 0, False: 51]
  ------------------
  570|      0|			return -1;
  571|     51|		switch (*ptr) {
  572|     51|		case 'x':
  ------------------
  |  Branch (572:3): [True: 51, False: 0]
  ------------------
  573|     51|			if (ms->mode & 0111) {
  ------------------
  |  Branch (573:8): [True: 0, False: 51]
  ------------------
  574|      0|				ptr = t;
  575|      0|				l = et - t;
  576|     51|			} else {
  577|     51|				ptr = e;
  578|     51|				l = ee - e;
  579|     51|			}
  580|     51|			break;
  581|      0|		default:
  ------------------
  |  Branch (581:3): [True: 0, False: 51]
  ------------------
  582|      0|			return -1;
  583|     51|		}
  584|     51|		if (l >= len)
  ------------------
  |  Branch (584:7): [True: 0, False: 51]
  ------------------
  585|      0|			return -1;
  586|     51|		memcpy(buf, ptr, l);
  587|     51|		buf += l;
  588|     51|		len -= l;
  589|     51|		sptr = ee + 1;
  590|     51|	}
  591|       |
  592|   114k|	l = strlen(sptr);
  593|   114k|	if (l >= len)
  ------------------
  |  Branch (593:6): [True: 0, False: 114k]
  ------------------
  594|      0|		return -1;
  595|       |
  596|   114k|	memcpy(buf, sptr, l);
  597|   114k|	buf[l] = '\0';
  598|   114k|	return 0;
  599|   114k|}
softmagic.c:print_sep:
 2596|  31.6k|{
 2597|  31.6k|	if (firstline)
  ------------------
  |  Branch (2597:6): [True: 9.73k, False: 21.8k]
  ------------------
 2598|  9.73k|		return 0;
 2599|       |	/*
 2600|       |	 * we found another match
 2601|       |	 * put a newline and '-' to do some simple formatting
 2602|       |	 */
 2603|  21.8k|	return file_separator(ms);
 2604|  31.6k|}
softmagic.c:mprint:
  604|   114k|{
  605|   114k|	uint64_t v;
  606|   114k|	float vf;
  607|   114k|	double vd;
  608|   114k| 	char buf[128], tbuf[26], sbuf[512], ebuf[512];
  609|   114k|	const char *desc;
  610|   114k|	union VALUETYPE *p = &ms->ms_value;
  611|       |
  612|   114k|	if (varexpand(ms, ebuf, sizeof(ebuf), m->desc) == -1)
  ------------------
  |  Branch (612:6): [True: 0, False: 114k]
  ------------------
  613|      0|		desc = m->desc;
  614|   114k|	else
  615|   114k|		desc = ebuf;
  616|       |
  617|   114k|#define	PRINTER(value, format, stype, utype)	\
  618|   114k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  619|   114k|	switch (check_fmt(ms, desc)) { \
  620|   114k|	case -1: \
  621|   114k|		return -1; \
  622|   114k|	case 1: \
  623|   114k|		if (m->flag & UNSIGNED) { \
  624|   114k|			(void)snprintf(buf, sizeof(buf), "%" format "u", \
  625|   114k|			    CAST(utype, v)); \
  626|   114k|		} else { \
  627|   114k|			(void)snprintf(buf, sizeof(buf), "%" format "d", \
  628|   114k|			    CAST(stype, v)); \
  629|   114k|		} \
  630|   114k|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1) \
  631|   114k|			return -1; \
  632|   114k|		break; \
  633|   114k|	default: \
  634|   114k|		if (m->flag & UNSIGNED) { \
  635|   114k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  636|   114k|			   CAST(utype, v)) == -1) \
  637|   114k|			   return -1; \
  638|   114k|		} else { \
  639|   114k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  640|   114k|			   CAST(stype, v)) == -1) \
  641|   114k|			   return -1; \
  642|   114k|		} \
  643|   114k|		break; \
  644|   114k|	} \
  645|   114k|	break
  646|       |
  647|   114k|  	switch (m->type) {
  648|  14.0k|  	case FILE_BYTE:
  ------------------
  |  |  254|  14.0k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (648:4): [True: 14.0k, False: 100k]
  ------------------
  649|  14.0k|		PRINTER(p->b, "", int8_t, uint8_t);
  ------------------
  |  |  618|  14.0k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  14.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  14.0k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 14.0k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 14.0k]
  |  |  ------------------
  |  |  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|  14.0k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 14.0k, False: 0]
  |  |  ------------------
  |  |  634|  14.0k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  14.0k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 7.33k, False: 6.72k]
  |  |  ------------------
  |  |  635|  7.33k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  7.33k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 7.33k]
  |  |  ------------------
  |  |  636|  7.33k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  7.33k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  7.33k|			   return -1; \
  |  |  638|  7.33k|		} else { \
  |  |  639|  6.72k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  6.72k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 6.72k]
  |  |  ------------------
  |  |  640|  6.72k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  6.72k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  6.72k|			   return -1; \
  |  |  642|  6.72k|		} \
  |  |  643|  14.0k|		break; \
  |  |  644|  14.0k|	} \
  |  |  645|  14.0k|	break
  ------------------
  650|       |
  651|  14.0k|  	case FILE_SHORT:
  ------------------
  |  |  255|  2.52k|#define				FILE_SHORT		2
  ------------------
  |  Branch (651:4): [True: 2.52k, False: 111k]
  ------------------
  652|  12.5k|  	case FILE_BESHORT:
  ------------------
  |  |  260|  12.5k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (652:4): [True: 9.97k, False: 104k]
  ------------------
  653|  26.6k|  	case FILE_LESHORT:
  ------------------
  |  |  263|  26.6k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (653:4): [True: 14.0k, False: 100k]
  ------------------
  654|  26.6k|		PRINTER(p->h, "", int16_t, uint16_t);
  ------------------
  |  |  618|  26.6k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  26.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  26.6k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 26.6k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 26.6k]
  |  |  ------------------
  |  |  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.6k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 26.6k, False: 0]
  |  |  ------------------
  |  |  634|  26.6k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  26.6k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 15.6k, False: 10.9k]
  |  |  ------------------
  |  |  635|  15.6k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  15.6k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 15.6k]
  |  |  ------------------
  |  |  636|  15.6k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  15.6k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  15.6k|			   return -1; \
  |  |  638|  15.6k|		} else { \
  |  |  639|  10.9k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  10.9k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 10.9k]
  |  |  ------------------
  |  |  640|  10.9k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  10.9k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  10.9k|			   return -1; \
  |  |  642|  10.9k|		} \
  |  |  643|  26.6k|		break; \
  |  |  644|  26.6k|	} \
  |  |  645|  26.6k|	break
  ------------------
  655|       |
  656|  26.6k|  	case FILE_LONG:
  ------------------
  |  |  257|    705|#define				FILE_LONG		4
  ------------------
  |  Branch (656:4): [True: 705, False: 113k]
  ------------------
  657|  9.63k|  	case FILE_BELONG:
  ------------------
  |  |  261|  9.63k|#define				FILE_BELONG		8
  ------------------
  |  Branch (657:4): [True: 8.93k, False: 105k]
  ------------------
  658|  31.0k|  	case FILE_LELONG:
  ------------------
  |  |  264|  31.0k|#define				FILE_LELONG		11
  ------------------
  |  Branch (658:4): [True: 21.3k, False: 92.9k]
  ------------------
  659|  31.0k|  	case FILE_MELONG:
  ------------------
  |  |  276|  31.0k|#define				FILE_MELONG		23
  ------------------
  |  Branch (659:4): [True: 37, False: 114k]
  ------------------
  660|  31.0k|		PRINTER(p->l, "", int32_t, uint32_t);
  ------------------
  |  |  618|  31.0k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  31.0k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  31.0k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 31.0k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 31.0k]
  |  |  ------------------
  |  |  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|  31.0k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 31.0k, False: 0]
  |  |  ------------------
  |  |  634|  31.0k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  31.0k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 8.60k, False: 22.4k]
  |  |  ------------------
  |  |  635|  8.60k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  8.60k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 8.60k]
  |  |  ------------------
  |  |  636|  8.60k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  8.60k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  8.60k|			   return -1; \
  |  |  638|  22.4k|		} else { \
  |  |  639|  22.4k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  22.4k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 22.4k]
  |  |  ------------------
  |  |  640|  22.4k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  22.4k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  22.4k|			   return -1; \
  |  |  642|  22.4k|		} \
  |  |  643|  31.0k|		break; \
  |  |  644|  31.0k|	} \
  |  |  645|  31.0k|	break
  ------------------
  661|       |
  662|  31.0k|  	case FILE_QUAD:
  ------------------
  |  |  277|    263|#define				FILE_QUAD		24
  ------------------
  |  Branch (662:4): [True: 263, False: 114k]
  ------------------
  663|  1.49k|  	case FILE_BEQUAD:
  ------------------
  |  |  279|  1.49k|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (663:4): [True: 1.23k, False: 113k]
  ------------------
  664|  3.06k|  	case FILE_LEQUAD:
  ------------------
  |  |  278|  3.06k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (664:4): [True: 1.56k, False: 112k]
  ------------------
  665|  3.12k|	case FILE_OFFSET:
  ------------------
  |  |  305|  3.12k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (665:2): [True: 59, False: 114k]
  ------------------
  666|  3.12k|		PRINTER(p->q, INT64_T_FORMAT, long long, unsigned long long);
  ------------------
  |  |  618|  3.12k|	v = file_signextend(ms, m, CAST(uint64_t, value)); \
  |  |  ------------------
  |  |  |  |  460|  3.12k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  619|  3.12k|	switch (check_fmt(ms, desc)) { \
  |  |  620|      0|	case -1: \
  |  |  ------------------
  |  |  |  Branch (620:2): [True: 0, False: 3.12k]
  |  |  ------------------
  |  |  621|      0|		return -1; \
  |  |  622|      0|	case 1: \
  |  |  ------------------
  |  |  |  Branch (622:2): [True: 0, False: 3.12k]
  |  |  ------------------
  |  |  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|  3.12k|	default: \
  |  |  ------------------
  |  |  |  Branch (633:2): [True: 3.12k, False: 0]
  |  |  ------------------
  |  |  634|  3.12k|		if (m->flag & UNSIGNED) { \
  |  |  ------------------
  |  |  |  |  237|  3.12k|#define UNSIGNED	0x08	/* comparison is unsigned */
  |  |  ------------------
  |  |  |  Branch (634:7): [True: 1.36k, False: 1.75k]
  |  |  ------------------
  |  |  635|  1.36k|		       if (file_printf(ms, F(ms, desc, "%" format "u"), \
  |  |  ------------------
  |  |  |  |  167|  1.36k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (635:14): [True: 0, False: 1.36k]
  |  |  ------------------
  |  |  636|  1.36k|			   CAST(utype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  1.36k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  637|  1.36k|			   return -1; \
  |  |  638|  1.75k|		} else { \
  |  |  639|  1.75k|		       if (file_printf(ms, F(ms, desc, "%" format "d"), \
  |  |  ------------------
  |  |  |  |  167|  1.75k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  |  |  ------------------
  |  |  |  Branch (639:14): [True: 0, False: 1.75k]
  |  |  ------------------
  |  |  640|  1.75k|			   CAST(stype, v)) == -1) \
  |  |  ------------------
  |  |  |  |  460|  1.75k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  |  |  641|  1.75k|			   return -1; \
  |  |  642|  1.75k|		} \
  |  |  643|  3.12k|		break; \
  |  |  644|  3.12k|	} \
  |  |  645|  3.12k|	break
  ------------------
  667|       |
  668|  21.4k|  	case FILE_STRING:
  ------------------
  |  |  258|  21.4k|#define				FILE_STRING		5
  ------------------
  |  Branch (668:4): [True: 21.4k, False: 92.9k]
  ------------------
  669|  24.4k|  	case FILE_PSTRING:
  ------------------
  |  |  266|  24.4k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (669:4): [True: 3.04k, False: 111k]
  ------------------
  670|  24.5k|  	case FILE_BESTRING16:
  ------------------
  |  |  271|  24.5k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (670:4): [True: 138, False: 114k]
  ------------------
  671|  24.9k|  	case FILE_LESTRING16:
  ------------------
  |  |  272|  24.9k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (671:4): [True: 385, False: 113k]
  ------------------
  672|  24.9k|		if (m->reln == '=' || m->reln == '!') {
  ------------------
  |  Branch (672:7): [True: 11.1k, False: 13.7k]
  |  Branch (672:25): [True: 227, False: 13.5k]
  ------------------
  673|  11.4k|			if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  11.4k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (673:8): [True: 0, False: 11.4k]
  ------------------
  674|  11.4k|			    file_printable(ms, sbuf, sizeof(sbuf), m->value.s,
  675|  11.4k|			    sizeof(m->value.s))) == -1)
  676|      0|				return -1;
  677|  11.4k|		}
  678|  13.5k|		else {
  679|  13.5k|			char *str = p->s;
  680|       |
  681|       |			/* compute t before we mangle the string? */
  682|       |
  683|  13.5k|			if (*m->value.s == '\0')
  ------------------
  |  Branch (683:8): [True: 12.0k, False: 1.47k]
  ------------------
  684|  12.0k|				str[strcspn(str, "\r\n")] = '\0';
  685|       |
  686|  13.5k|			if (m->str_flags & STRING_TRIM)
  ------------------
  |  |  390|  13.5k|#define str_flags _u._s._flags
  ------------------
              			if (m->str_flags & STRING_TRIM)
  ------------------
  |  |  421|  13.5k|#define	STRING_TRIM				BIT(13)
  |  |  ------------------
  |  |  |  |  403|  13.5k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (686:8): [True: 294, False: 13.2k]
  ------------------
  687|    294|				str = file_strtrim(str);
  688|       |
  689|  13.5k|			if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  13.5k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (689:8): [True: 0, False: 13.5k]
  ------------------
  690|  13.5k|			    file_printable(ms, sbuf, sizeof(sbuf), str,
  691|  13.5k|				sizeof(p->s) - (str - p->s))) == -1)
  692|      0|				return -1;
  693|       |
  694|  13.5k|			if (m->type == FILE_PSTRING) {
  ------------------
  |  |  266|  13.5k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (694:8): [True: 2.94k, False: 10.6k]
  ------------------
  695|  2.94k|				size_t l = file_pstring_length_size(ms, m);
  696|  2.94k|				if (l == FILE_BADSIZE)
  ------------------
  |  |  183|  2.94k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  2.94k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (696:9): [True: 0, False: 2.94k]
  ------------------
  697|      0|					return -1;
  698|  2.94k|			}
  699|  13.5k|		}
  700|  24.9k|		break;
  701|       |
  702|  24.9k|	case FILE_DATE:
  ------------------
  |  |  259|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (702:2): [True: 0, False: 114k]
  ------------------
  703|    495|	case FILE_BEDATE:
  ------------------
  |  |  262|    495|#define				FILE_BEDATE		9
  ------------------
  |  Branch (703:2): [True: 495, False: 113k]
  ------------------
  704|    638|	case FILE_LEDATE:
  ------------------
  |  |  265|    638|#define				FILE_LEDATE		12
  ------------------
  |  Branch (704:2): [True: 143, False: 114k]
  ------------------
  705|    779|	case FILE_MEDATE:
  ------------------
  |  |  274|    779|#define				FILE_MEDATE		21
  ------------------
  |  Branch (705:2): [True: 141, False: 114k]
  ------------------
  706|    779|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    779|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (706:7): [True: 0, False: 779]
  ------------------
  707|    779|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->l, 0)) == -1)
  708|      0|			return -1;
  709|    779|		break;
  710|       |
  711|    779|	case FILE_LDATE:
  ------------------
  |  |  267|      0|#define				FILE_LDATE		14
  ------------------
  |  Branch (711:2): [True: 0, False: 114k]
  ------------------
  712|    452|	case FILE_BELDATE:
  ------------------
  |  |  268|    452|#define				FILE_BELDATE		15
  ------------------
  |  Branch (712:2): [True: 452, False: 113k]
  ------------------
  713|    536|	case FILE_LELDATE:
  ------------------
  |  |  269|    536|#define				FILE_LELDATE		16
  ------------------
  |  Branch (713:2): [True: 84, False: 114k]
  ------------------
  714|    536|	case FILE_MELDATE:
  ------------------
  |  |  275|    536|#define				FILE_MELDATE		22
  ------------------
  |  Branch (714:2): [True: 0, False: 114k]
  ------------------
  715|    536|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    536|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (715:7): [True: 0, False: 536]
  ------------------
  716|    536|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->l, FILE_T_LOCAL))
  ------------------
  |  |  548|    536|#define FILE_T_LOCAL	1
  ------------------
  717|    536|			== -1)
  718|      0|			return -1;
  719|    536|		break;
  720|       |
  721|    536|	case FILE_QDATE:
  ------------------
  |  |  280|      0|#define				FILE_QDATE		27
  ------------------
  |  Branch (721:2): [True: 0, False: 114k]
  ------------------
  722|  1.45k|	case FILE_BEQDATE:
  ------------------
  |  |  282|  1.45k|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (722:2): [True: 1.45k, False: 112k]
  ------------------
  723|  1.49k|	case FILE_LEQDATE:
  ------------------
  |  |  281|  1.49k|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (723:2): [True: 39, False: 114k]
  ------------------
  724|  1.49k|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  1.49k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (724:7): [True: 0, False: 1.49k]
  ------------------
  725|  1.49k|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, 0)) == -1)
  726|      0|			return -1;
  727|  1.49k|		break;
  728|       |
  729|  1.49k|	case FILE_QLDATE:
  ------------------
  |  |  283|      0|#define				FILE_QLDATE		30
  ------------------
  |  Branch (729:2): [True: 0, False: 114k]
  ------------------
  730|    240|	case FILE_BEQLDATE:
  ------------------
  |  |  285|    240|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (730:2): [True: 240, False: 114k]
  ------------------
  731|    493|	case FILE_LEQLDATE:
  ------------------
  |  |  284|    493|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (731:2): [True: 253, False: 114k]
  ------------------
  732|    493|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    493|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (732:7): [True: 0, False: 493]
  ------------------
  733|    493|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, FILE_T_LOCAL)) == -1)
  ------------------
  |  |  548|    493|#define FILE_T_LOCAL	1
  ------------------
  734|      0|			return -1;
  735|    493|		break;
  736|       |
  737|    493|	case FILE_QWDATE:
  ------------------
  |  |  295|    206|#define				FILE_QWDATE		42
  ------------------
  |  Branch (737:2): [True: 206, False: 114k]
  ------------------
  738|    206|	case FILE_BEQWDATE:
  ------------------
  |  |  297|    206|#define				FILE_BEQWDATE		44
  ------------------
  |  Branch (738:2): [True: 0, False: 114k]
  ------------------
  739|  1.94k|	case FILE_LEQWDATE:
  ------------------
  |  |  296|  1.94k|#define				FILE_LEQWDATE		43
  ------------------
  |  Branch (739:2): [True: 1.73k, False: 112k]
  ------------------
  740|  1.94k|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|  1.94k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (740:7): [True: 0, False: 1.94k]
  ------------------
  741|  1.94k|		    file_fmtdatetime(tbuf, sizeof(tbuf), p->q, FILE_T_WINDOWS))
  ------------------
  |  |  549|  1.94k|#define FILE_T_WINDOWS	2
  ------------------
  742|  1.94k|		    == -1)
  743|      0|			return -1;
  744|  1.94k|		break;
  745|       |
  746|  1.94k|	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (746:2): [True: 0, False: 114k]
  ------------------
  747|      0|	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (747:2): [True: 0, False: 114k]
  ------------------
  748|  2.11k|	case FILE_LEFLOAT:
  ------------------
  |  |  288|  2.11k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (748:2): [True: 2.11k, False: 112k]
  ------------------
  749|  2.11k|		vf = p->f;
  750|  2.11k|		switch (check_fmt(ms, desc)) {
  751|      0|		case -1:
  ------------------
  |  Branch (751:3): [True: 0, False: 2.11k]
  ------------------
  752|      0|			return -1;
  753|      0|		case 1:
  ------------------
  |  Branch (753:3): [True: 0, False: 2.11k]
  ------------------
  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|  2.11k|		default:
  ------------------
  |  Branch (758:3): [True: 2.11k, False: 0]
  ------------------
  759|  2.11k|			if (file_printf(ms, F(ms, desc, "%g"), vf) == -1)
  ------------------
  |  |  167|  2.11k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (759:8): [True: 0, False: 2.11k]
  ------------------
  760|      0|				return -1;
  761|  2.11k|			break;
  762|  2.11k|		}
  763|  2.11k|  		break;
  764|       |
  765|  2.11k|	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (765:2): [True: 0, False: 114k]
  ------------------
  766|      0|	case FILE_BEDOUBLE:
  ------------------
  |  |  290|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (766:2): [True: 0, False: 114k]
  ------------------
  767|  1.32k|	case FILE_LEDOUBLE:
  ------------------
  |  |  291|  1.32k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (767:2): [True: 1.32k, False: 113k]
  ------------------
  768|  1.32k|		vd = p->d;
  769|  1.32k|		switch (check_fmt(ms, desc)) {
  770|      0|		case -1:
  ------------------
  |  Branch (770:3): [True: 0, False: 1.32k]
  ------------------
  771|      0|			return -1;
  772|      0|		case 1:
  ------------------
  |  Branch (772:3): [True: 0, False: 1.32k]
  ------------------
  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|  1.32k|		default:
  ------------------
  |  Branch (777:3): [True: 1.32k, False: 0]
  ------------------
  778|  1.32k|			if (file_printf(ms, F(ms, desc, "%g"), vd) == -1)
  ------------------
  |  |  167|  1.32k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (778:8): [True: 0, False: 1.32k]
  ------------------
  779|      0|				return -1;
  780|  1.32k|			break;
  781|  1.32k|		}
  782|  1.32k|  		break;
  783|       |
  784|  1.32k|	case FILE_SEARCH:
  ------------------
  |  |  273|    377|#define				FILE_SEARCH		20
  ------------------
  |  Branch (784:2): [True: 377, False: 113k]
  ------------------
  785|  1.25k|	case FILE_REGEX: {
  ------------------
  |  |  270|  1.25k|#define				FILE_REGEX		17
  ------------------
  |  Branch (785:2): [True: 877, False: 113k]
  ------------------
  786|  1.25k|		char *cp, *scp;
  787|  1.25k|		int rval;
  788|       |
  789|  1.25k|		if (ms->search.s == NULL)
  ------------------
  |  Branch (789:7): [True: 0, False: 1.25k]
  ------------------
  790|      0|			break;
  791|       |
  792|  1.25k|		cp = strndup(RCAST(const char *, ms->search.s),
  ------------------
  |  |  461|  1.25k|#define RCAST(T, b)	((T)(uintptr_t)(b))
  ------------------
  793|  1.25k|		    ms->search.rm_len);
  794|  1.25k|		if (cp == NULL) {
  ------------------
  |  Branch (794:7): [True: 0, False: 1.25k]
  ------------------
  795|      0|			file_oomem(ms, ms->search.rm_len);
  796|      0|			return -1;
  797|      0|		}
  798|  1.25k|		scp = (m->str_flags & STRING_TRIM) ? file_strtrim(cp) : cp;
  ------------------
  |  |  390|  1.25k|#define str_flags _u._s._flags
  ------------------
              		scp = (m->str_flags & STRING_TRIM) ? file_strtrim(cp) : cp;
  ------------------
  |  |  421|  1.25k|#define	STRING_TRIM				BIT(13)
  |  |  ------------------
  |  |  |  |  403|  1.25k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (798:9): [True: 70, False: 1.18k]
  ------------------
  799|       |
  800|  1.25k|		rval = file_printf(ms, F(ms, desc, "%s"), file_printable(ms,
  ------------------
  |  |  167|  1.25k|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  801|  1.25k|		    sbuf, sizeof(sbuf), scp, ms->search.rm_len));
  802|  1.25k|		free(cp);
  803|       |
  804|  1.25k|		if (rval == -1)
  ------------------
  |  Branch (804:7): [True: 0, False: 1.25k]
  ------------------
  805|      0|			return -1;
  806|  1.25k|		break;
  807|  1.25k|	}
  808|       |
  809|  1.93k|	case FILE_DEFAULT:
  ------------------
  |  |  256|  1.93k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (809:2): [True: 1.93k, False: 112k]
  ------------------
  810|  2.21k|	case FILE_CLEAR:
  ------------------
  |  |  300|  2.21k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (810:2): [True: 284, False: 114k]
  ------------------
  811|  2.21k|	  	if (file_printf(ms, "%s", m->desc) == -1)
  ------------------
  |  Branch (811:9): [True: 0, False: 2.21k]
  ------------------
  812|      0|			return -1;
  813|  2.21k|		break;
  814|       |
  815|  2.21k|	case FILE_INDIRECT:
  ------------------
  |  |  294|    200|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (815:2): [True: 200, False: 114k]
  ------------------
  816|    245|	case FILE_USE:
  ------------------
  |  |  299|    245|#define				FILE_USE		46
  ------------------
  |  Branch (816:2): [True: 45, False: 114k]
  ------------------
  817|    919|	case FILE_NAME:
  ------------------
  |  |  298|    919|#define				FILE_NAME		45
  ------------------
  |  Branch (817:2): [True: 674, False: 113k]
  ------------------
  818|    919|		break;
  819|    638|	case FILE_DER:
  ------------------
  |  |  301|    638|#define				FILE_DER		48
  ------------------
  |  Branch (819:2): [True: 638, False: 113k]
  ------------------
  820|    638|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    638|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (820:7): [True: 0, False: 638]
  ------------------
  821|    638|		    file_printable(ms, sbuf, sizeof(sbuf), ms->ms_value.s,
  822|    638|			sizeof(ms->ms_value.s))) == -1)
  823|      0|			return -1;
  824|    638|		break;
  825|    638|	case FILE_GUID:
  ------------------
  |  |  302|    183|#define				FILE_GUID		49
  ------------------
  |  Branch (825:2): [True: 183, False: 114k]
  ------------------
  826|    183|	case FILE_LEGUID:
  ------------------
  |  |  303|    183|#define				FILE_LEGUID		50
  ------------------
  |  Branch (826:2): [True: 0, False: 114k]
  ------------------
  827|    183|		(void) file_print_leguid(buf, sizeof(buf), ms->ms_value.guid);
  828|    183|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|    183|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (828:7): [True: 0, False: 183]
  ------------------
  829|      0|			return -1;
  830|    183|		break;
  831|    183|	case FILE_BEGUID:
  ------------------
  |  |  304|     36|#define				FILE_BEGUID		51
  ------------------
  |  Branch (831:2): [True: 36, False: 114k]
  ------------------
  832|     36|		(void) file_print_beguid(buf, sizeof(buf), ms->ms_value.guid);
  833|     36|		if (file_printf(ms, F(ms, desc, "%s"), buf) == -1)
  ------------------
  |  |  167|     36|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (833:7): [True: 0, False: 36]
  ------------------
  834|      0|			return -1;
  835|     36|		break;
  836|     36|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|      0|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (836:2): [True: 0, False: 114k]
  ------------------
  837|      0|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|      0|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (837:2): [True: 0, False: 114k]
  ------------------
  838|    313|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|    313|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (838:2): [True: 313, False: 114k]
  ------------------
  839|    313|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    313|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (839:7): [True: 0, False: 313]
  ------------------
  840|    313|		    file_fmtdate(tbuf, sizeof(tbuf), p->h)) == -1)
  841|      0|			return -1;
  842|    313|		break;
  843|    313|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|      0|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (843:2): [True: 0, False: 114k]
  ------------------
  844|      0|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|      0|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (844:2): [True: 0, False: 114k]
  ------------------
  845|    313|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|    313|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (845:2): [True: 313, False: 114k]
  ------------------
  846|    313|		if (file_printf(ms, F(ms, desc, "%s"),
  ------------------
  |  |  167|    313|#define F(a, b, c) file_fmtcheck((a), (b), (c), __FILE__, __LINE__)
  ------------------
  |  Branch (846:7): [True: 0, False: 313]
  ------------------
  847|    313|		    file_fmttime(tbuf, sizeof(tbuf), p->h)) == -1)
  848|      0|			return -1;
  849|    313|		break;
  850|    313|	case FILE_OCTAL:
  ------------------
  |  |  314|      0|#define				FILE_OCTAL		61
  ------------------
  |  Branch (850:2): [True: 0, False: 114k]
  ------------------
  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: 114k]
  ------------------
  856|      0|		file_magerror(ms, "invalid m->type (%d) in mprint()", m->type);
  857|      0|		return -1;
  858|   114k|	}
  859|   114k|	return 0;
  860|   114k|}
softmagic.c:check_fmt:
  509|  78.2k|{
  510|  78.2k|	file_regex_t rx;
  511|  78.2k|	int rc;
  512|  78.2k|        const char* pat = "%[-0-9\\.]*s";
  513|       |
  514|  78.2k|	if (strchr(fmt, '%') == NULL)
  ------------------
  |  Branch (514:6): [True: 36.6k, False: 41.5k]
  ------------------
  515|  36.6k|		return 0;
  516|       |
  517|  41.5k|	rc = file_regcomp(ms, &rx, pat, REG_EXTENDED|REG_NOSUB);
  518|  41.5k|	if (rc != 0)
  ------------------
  |  Branch (518:6): [True: 0, False: 41.5k]
  ------------------
  519|      0|		return -1;
  520|  41.5k|	rc = !file_regexec(ms, &rx, fmt, 0, 0, 0);
  521|  41.5k|	file_regfree(&rx);
  522|  41.5k|	return rc;
  523|  41.5k|}
softmagic.c:moffset:
  865|   988k|{
  866|   988k|	int32_t o;
  867|   988k|	size_t vlen;
  868|       |
  869|   988k|  	switch (m->type) {
  870|   320k|  	case FILE_BYTE:
  ------------------
  |  |  254|   320k|#define 			FILE_BYTE		1
  ------------------
  |  Branch (870:4): [True: 320k, False: 667k]
  ------------------
  871|   320k|		o = CAST(int32_t, (ms->offset + sizeof(char)));
  ------------------
  |  |  460|   320k|#define CAST(T, b)	((T)(b))
  ------------------
  872|   320k|		break;
  873|       |
  874|  29.9k|  	case FILE_SHORT:
  ------------------
  |  |  255|  29.9k|#define				FILE_SHORT		2
  ------------------
  |  Branch (874:4): [True: 29.9k, False: 958k]
  ------------------
  875|  80.9k|  	case FILE_BESHORT:
  ------------------
  |  |  260|  80.9k|#define				FILE_BESHORT		7
  ------------------
  |  Branch (875:4): [True: 50.9k, False: 937k]
  ------------------
  876|   154k|  	case FILE_LESHORT:
  ------------------
  |  |  263|   154k|#define				FILE_LESHORT		10
  ------------------
  |  Branch (876:4): [True: 74.0k, False: 914k]
  ------------------
  877|   154k|	case FILE_MSDOSDATE:
  ------------------
  |  |  308|   154k|#define				FILE_MSDOSDATE		55
  ------------------
  |  Branch (877:2): [True: 0, False: 988k]
  ------------------
  878|   155k|	case FILE_LEMSDOSDATE:
  ------------------
  |  |  309|   155k|#define				FILE_LEMSDOSDATE	56
  ------------------
  |  Branch (878:2): [True: 313, False: 988k]
  ------------------
  879|   155k|	case FILE_BEMSDOSDATE:
  ------------------
  |  |  310|   155k|#define				FILE_BEMSDOSDATE	57
  ------------------
  |  Branch (879:2): [True: 0, False: 988k]
  ------------------
  880|   155k|	case FILE_MSDOSTIME:
  ------------------
  |  |  311|   155k|#define				FILE_MSDOSTIME		58
  ------------------
  |  Branch (880:2): [True: 0, False: 988k]
  ------------------
  881|   155k|	case FILE_LEMSDOSTIME:
  ------------------
  |  |  312|   155k|#define				FILE_LEMSDOSTIME	59
  ------------------
  |  Branch (881:2): [True: 313, False: 988k]
  ------------------
  882|   155k|	case FILE_BEMSDOSTIME:
  ------------------
  |  |  313|   155k|#define				FILE_BEMSDOSTIME	60
  ------------------
  |  Branch (882:2): [True: 0, False: 988k]
  ------------------
  883|   155k|		o = CAST(int32_t, (ms->offset + sizeof(short)));
  ------------------
  |  |  460|   155k|#define CAST(T, b)	((T)(b))
  ------------------
  884|   155k|		break;
  885|       |
  886|  13.5k|  	case FILE_LONG:
  ------------------
  |  |  257|  13.5k|#define				FILE_LONG		4
  ------------------
  |  Branch (886:4): [True: 13.5k, False: 974k]
  ------------------
  887|   113k|  	case FILE_BELONG:
  ------------------
  |  |  261|   113k|#define				FILE_BELONG		8
  ------------------
  |  Branch (887:4): [True: 100k, False: 887k]
  ------------------
  888|   214k|  	case FILE_LELONG:
  ------------------
  |  |  264|   214k|#define				FILE_LELONG		11
  ------------------
  |  Branch (888:4): [True: 100k, False: 887k]
  ------------------
  889|   214k|  	case FILE_MELONG:
  ------------------
  |  |  276|   214k|#define				FILE_MELONG		23
  ------------------
  |  Branch (889:4): [True: 37, False: 988k]
  ------------------
  890|   214k|		o = CAST(int32_t, (ms->offset + sizeof(int32_t)));
  ------------------
  |  |  460|   214k|#define CAST(T, b)	((T)(b))
  ------------------
  891|   214k|		break;
  892|       |
  893|  31.1k|  	case FILE_QUAD:
  ------------------
  |  |  277|  31.1k|#define				FILE_QUAD		24
  ------------------
  |  Branch (893:4): [True: 31.1k, False: 957k]
  ------------------
  894|  37.6k|  	case FILE_BEQUAD:
  ------------------
  |  |  279|  37.6k|#define				FILE_BEQUAD		26
  ------------------
  |  Branch (894:4): [True: 6.50k, False: 981k]
  ------------------
  895|  39.7k|  	case FILE_LEQUAD:
  ------------------
  |  |  278|  39.7k|#define				FILE_LEQUAD		25
  ------------------
  |  Branch (895:4): [True: 2.05k, False: 986k]
  ------------------
  896|  39.7k|		o = CAST(int32_t, (ms->offset + sizeof(int64_t)));
  ------------------
  |  |  460|  39.7k|#define CAST(T, b)	((T)(b))
  ------------------
  897|  39.7k|		break;
  898|       |
  899|  84.6k|  	case FILE_STRING:
  ------------------
  |  |  258|  84.6k|#define				FILE_STRING		5
  ------------------
  |  Branch (899:4): [True: 84.6k, False: 903k]
  ------------------
  900|  87.6k|  	case FILE_PSTRING:
  ------------------
  |  |  266|  87.6k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (900:4): [True: 3.06k, False: 985k]
  ------------------
  901|  87.8k|  	case FILE_BESTRING16:
  ------------------
  |  |  271|  87.8k|#define				FILE_BESTRING16		18
  ------------------
  |  Branch (901:4): [True: 138, False: 988k]
  ------------------
  902|  88.1k|  	case FILE_LESTRING16:
  ------------------
  |  |  272|  88.1k|#define				FILE_LESTRING16		19
  ------------------
  |  Branch (902:4): [True: 385, False: 987k]
  ------------------
  903|  88.1k|	case FILE_OCTAL:
  ------------------
  |  |  314|  88.1k|#define				FILE_OCTAL		61
  ------------------
  |  Branch (903:2): [True: 0, False: 988k]
  ------------------
  904|  88.1k|		if (m->reln == '=' || m->reln == '!') {
  ------------------
  |  Branch (904:7): [True: 30.5k, False: 57.5k]
  |  Branch (904:25): [True: 978, False: 56.6k]
  ------------------
  905|  31.5k|			o = ms->offset + m->vallen;
  906|  56.6k|		} else {
  907|  56.6k|			union VALUETYPE *p = &ms->ms_value;
  908|       |
  909|  56.6k|			if (*m->value.s == '\0')
  ------------------
  |  Branch (909:8): [True: 44.5k, False: 12.0k]
  ------------------
  910|  44.5k|				p->s[strcspn(p->s, "\r\n")] = '\0';
  911|  56.6k|			o = CAST(uint32_t, (ms->offset + strlen(p->s)));
  ------------------
  |  |  460|  56.6k|#define CAST(T, b)	((T)(b))
  ------------------
  912|  56.6k|			if (m->type == FILE_PSTRING) {
  ------------------
  |  |  266|  56.6k|#define				FILE_PSTRING		13
  ------------------
  |  Branch (912:8): [True: 2.96k, False: 53.6k]
  ------------------
  913|  2.96k|				size_t l = file_pstring_length_size(ms, m);
  914|  2.96k|				if (l == FILE_BADSIZE)
  ------------------
  |  |  183|  2.96k|#define FILE_BADSIZE CAST(size_t, ~0ul)
  |  |  ------------------
  |  |  |  |  460|  2.96k|#define CAST(T, b)	((T)(b))
  |  |  ------------------
  ------------------
  |  Branch (914:9): [True: 0, False: 2.96k]
  ------------------
  915|      0|					return -1;
  916|  2.96k|				o += CAST(uint32_t, l);
  ------------------
  |  |  460|  2.96k|#define CAST(T, b)	((T)(b))
  ------------------
  917|  2.96k|			}
  918|  56.6k|		}
  919|  88.1k|		break;
  920|       |
  921|  88.1k|	case FILE_DATE:
  ------------------
  |  |  259|      0|#define				FILE_DATE		6
  ------------------
  |  Branch (921:2): [True: 0, False: 988k]
  ------------------
  922|    495|	case FILE_BEDATE:
  ------------------
  |  |  262|    495|#define				FILE_BEDATE		9
  ------------------
  |  Branch (922:2): [True: 495, False: 987k]
  ------------------
  923|    638|	case FILE_LEDATE:
  ------------------
  |  |  265|    638|#define				FILE_LEDATE		12
  ------------------
  |  Branch (923:2): [True: 143, False: 988k]
  ------------------
  924|    779|	case FILE_MEDATE:
  ------------------
  |  |  274|    779|#define				FILE_MEDATE		21
  ------------------
  |  Branch (924:2): [True: 141, False: 988k]
  ------------------
  925|    779|		o = CAST(int32_t, (ms->offset + sizeof(uint32_t)));
  ------------------
  |  |  460|    779|#define CAST(T, b)	((T)(b))
  ------------------
  926|    779|		break;
  927|       |
  928|      0|	case FILE_LDATE:
  ------------------
  |  |  267|      0|#define				FILE_LDATE		14
  ------------------
  |  Branch (928:2): [True: 0, False: 988k]
  ------------------
  929|    452|	case FILE_BELDATE:
  ------------------
  |  |  268|    452|#define				FILE_BELDATE		15
  ------------------
  |  Branch (929:2): [True: 452, False: 987k]
  ------------------
  930|    536|	case FILE_LELDATE:
  ------------------
  |  |  269|    536|#define				FILE_LELDATE		16
  ------------------
  |  Branch (930:2): [True: 84, False: 988k]
  ------------------
  931|    536|	case FILE_MELDATE:
  ------------------
  |  |  275|    536|#define				FILE_MELDATE		22
  ------------------
  |  Branch (931:2): [True: 0, False: 988k]
  ------------------
  932|    536|		o = CAST(int32_t, (ms->offset + sizeof(uint32_t)));
  ------------------
  |  |  460|    536|#define CAST(T, b)	((T)(b))
  ------------------
  933|    536|		break;
  934|       |
  935|      0|	case FILE_QDATE:
  ------------------
  |  |  280|      0|#define				FILE_QDATE		27
  ------------------
  |  Branch (935:2): [True: 0, False: 988k]
  ------------------
  936|  1.45k|	case FILE_BEQDATE:
  ------------------
  |  |  282|  1.45k|#define				FILE_BEQDATE		29
  ------------------
  |  Branch (936:2): [True: 1.45k, False: 986k]
  ------------------
  937|  1.49k|	case FILE_LEQDATE:
  ------------------
  |  |  281|  1.49k|#define				FILE_LEQDATE		28
  ------------------
  |  Branch (937:2): [True: 39, False: 988k]
  ------------------
  938|  1.49k|		o = CAST(int32_t, (ms->offset + sizeof(uint64_t)));
  ------------------
  |  |  460|  1.49k|#define CAST(T, b)	((T)(b))
  ------------------
  939|  1.49k|		break;
  940|       |
  941|      0|	case FILE_QLDATE:
  ------------------
  |  |  283|      0|#define				FILE_QLDATE		30
  ------------------
  |  Branch (941:2): [True: 0, False: 988k]
  ------------------
  942|    240|	case FILE_BEQLDATE:
  ------------------
  |  |  285|    240|#define				FILE_BEQLDATE		32
  ------------------
  |  Branch (942:2): [True: 240, False: 988k]
  ------------------
  943|    493|	case FILE_LEQLDATE:
  ------------------
  |  |  284|    493|#define				FILE_LEQLDATE		31
  ------------------
  |  Branch (943:2): [True: 253, False: 988k]
  ------------------
  944|    493|		o = CAST(int32_t, (ms->offset + sizeof(uint64_t)));
  ------------------
  |  |  460|    493|#define CAST(T, b)	((T)(b))
  ------------------
  945|    493|		break;
  946|       |
  947|      0|  	case FILE_FLOAT:
  ------------------
  |  |  286|      0|#define				FILE_FLOAT		33
  ------------------
  |  Branch (947:4): [True: 0, False: 988k]
  ------------------
  948|      0|  	case FILE_BEFLOAT:
  ------------------
  |  |  287|      0|#define				FILE_BEFLOAT		34
  ------------------
  |  Branch (948:4): [True: 0, False: 988k]
  ------------------
  949|  2.11k|  	case FILE_LEFLOAT:
  ------------------
  |  |  288|  2.11k|#define				FILE_LEFLOAT		35
  ------------------
  |  Branch (949:4): [True: 2.11k, False: 986k]
  ------------------
  950|  2.11k|		o = CAST(int32_t, (ms->offset + sizeof(float)));
  ------------------
  |  |  460|  2.11k|#define CAST(T, b)	((T)(b))
  ------------------
  951|  2.11k|		break;
  952|       |
  953|      0|  	case FILE_DOUBLE:
  ------------------
  |  |  289|      0|#define				FILE_DOUBLE		36
  ------------------
  |  Branch (953:4): [True: 0, False: 988k]
  ------------------
  954|      0|  	case FILE_BEDOUBLE:
  ------------------
  |  |  290|      0|#define				FILE_BEDOUBLE		37
  ------------------
  |  Branch (954:4): [True: 0, False: 988k]
  ------------------
  955|  1.32k|  	case FILE_LEDOUBLE:
  ------------------
  |  |  291|  1.32k|#define				FILE_LEDOUBLE		38
  ------------------
  |  Branch (955:4): [True: 1.32k, False: 987k]
  ------------------
  956|  1.32k|		o = CAST(int32_t, (ms->offset + sizeof(double)));
  ------------------
  |  |  460|  1.32k|#define CAST(T, b)	((T)(b))
  ------------------
  957|  1.32k|		break;
  958|       |
  959|  1.90k|	case FILE_REGEX:
  ------------------
  |  |  270|  1.90k|#define				FILE_REGEX		17
  ------------------
  |  Branch (959:2): [True: 1.90k, False: 986k]
  ------------------
  960|       |		/* Why is regex and search different? */
  961|  1.90k|		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ?
  ------------------
  |  |  390|  1.90k|#define str_flags _u._s._flags
  ------------------
              		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ?
  ------------------
  |  |  408|  1.90k|#define REGEX_OFFSET_START			BIT(4)
  |  |  ------------------
  |  |  |  |  403|  1.90k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (961:10): [True: 1.76k, False: 141]
  ------------------
  962|  1.76k|		    ms->search.rm_len : 0;
  963|  1.90k|		o = CAST(int32_t, ms->search.offset + vlen - offset);
  ------------------
  |  |  460|  1.90k|#define CAST(T, b)	((T)(b))
  ------------------
  964|  1.90k|		break;
  965|       |
  966|  29.3k|	case FILE_SEARCH:
  ------------------
  |  |  273|  29.3k|#define				FILE_SEARCH		20
  ------------------
  |  Branch (966:2): [True: 29.3k, False: 959k]
  ------------------
  967|  29.3k|		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ? m->vallen : 0;
  ------------------
  |  |  390|  29.3k|#define str_flags _u._s._flags
  ------------------
              		vlen = (m->str_flags & REGEX_OFFSET_START) == 0 ? m->vallen : 0;
  ------------------
  |  |  408|  29.3k|#define REGEX_OFFSET_START			BIT(4)
  |  |  ------------------
  |  |  |  |  403|  29.3k|#define BIT(A)   (1 << (A))
  |  |  ------------------
  ------------------
  |  Branch (967:10): [True: 29.2k, False: 98]
  ------------------
  968|  29.3k|		o = CAST(int32_t, ms->search.offset + vlen - offset);
  ------------------
  |  |  460|  29.3k|#define CAST(T, b)	((T)(b))
  ------------------
  969|  29.3k|		break;
  970|       |
  971|  1.86k|	case FILE_CLEAR:
  ------------------
  |  |  300|  1.86k|#define				FILE_CLEAR		47
  ------------------
  |  Branch (971:2): [True: 1.86k, False: 986k]
  ------------------
  972|  9.25k|	case FILE_DEFAULT:
  ------------------
  |  |  256|  9.25k|#define				FILE_DEFAULT		3
  ------------------
  |  Branch (972:2): [True: 7.38k, False: 980k]
  ------------------
  973|  25.0k|	case FILE_INDIRECT:
  ------------------
  |  |  294|  25.0k|#define				FILE_INDIRECT		41
  ------------------
  |  Branch (973:2): [True: 15.7k, False: 972k]
  ------------------
  974|  25.2k|	case FILE_OFFSET:
  ------------------
  |  |  305|  25.2k|#define				FILE_OFFSET		52
  ------------------
  |  Branch (974:2): [True: 197, False: 988k]
  ------------------
  975|  43.1k|	case FILE_USE:
  ------------------
  |  |  299|  43.1k|#define				FILE_USE		46
  ------------------
  |  Branch (975:2): [True: 17.8k, False: 970k]
  ------------------
  976|  43.1k|		o = ms->offset;
  977|  43.1k|		break;
  978|       |
  979|  34.8k|	case FILE_DER:
  ------------------
  |  |  301|  34.8k|#define				FILE_DER		48
  ------------------
  |  Branch (979:2): [True: 34.8k, False: 953k]
  ------------------
  980|  34.8k|		o = der_offs(ms, m, nbytes);
  981|  34.8k|		if (o == -1 || CAST(size_t, o) > nbytes) {
  ------------------
  |  |  460|  34.8k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (981:7): [True: 0, False: 34.8k]
  |  Branch (981:18): [True: 0, False: 34.8k]
  ------------------
  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|  34.8k|		break;
  991|       |
  992|  34.8k|	case FILE_BEGUID:
  ------------------
  |  |  304|     36|#define				FILE_BEGUID		51
  ------------------
  |  Branch (992:2): [True: 36, False: 988k]
  ------------------
  993|     36|	case FILE_LEGUID:
  ------------------
  |  |  303|     36|#define				FILE_LEGUID		50
  ------------------
  |  Branch (993:2): [True: 0, False: 988k]
  ------------------
  994|    219|	case FILE_GUID:
  ------------------
  |  |  302|    219|#define				FILE_GUID		49
  ------------------
  |  Branch (994:2): [True: 183, False: 988k]
  ------------------
  995|    219|		o = CAST(int32_t, (ms->offset + 2 * sizeof(uint64_t)));
  ------------------
  |  |  460|    219|#define CAST(T, b)	((T)(b))
  ------------------
  996|    219|		break;
  997|       |
  998|  53.3k|	default:
  ------------------
  |  Branch (998:2): [True: 53.3k, False: 934k]
  ------------------
  999|  53.3k|		o = 0;
 1000|  53.3k|		break;
 1001|   988k|	}
 1002|       |
 1003|   988k|	if (CAST(size_t, o) > nbytes) {
  ------------------
  |  |  460|   988k|#define CAST(T, b)	((T)(b))
  ------------------
  |  Branch (1003:6): [True: 27.5k, False: 960k]
  ------------------
 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|  27.5k|		return -1;
 1009|  27.5k|	}
 1010|   960k|	*op = o;
 1011|   960k|	return 1;
 1012|   988k|}

LLVMFuzzerInitialize:
   39|      2|extern "C" int LLVMFuzzerInitialize(int* argc, char*** argv) {
   40|      2|  char* exe_path = (*argv)[0];
   41|       |  // dirname() can modify its argument.
   42|      2|  char* exe_path_copy = strdup(exe_path);
   43|      2|  char* dir = dirname(exe_path_copy);
   44|      2|  env = new Environment(dir);
   45|      2|  free(exe_path_copy);
   46|      2|  return 0;
   47|      2|}
LLVMFuzzerTestOneInput:
   49|  8.25k|extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
   50|  8.25k|  if (size < 1)
  ------------------
  |  Branch (50:7): [True: 0, False: 8.25k]
  ------------------
   51|      0|    return 0;
   52|  8.25k|  magic_buffer(env->magic, data, size);
   53|  8.25k|  return 0;
   54|  8.25k|}
_ZN11EnvironmentC2ENSt3__112basic_stringIcNS0_11char_traitsIcEENS0_9allocatorIcEEEE:
   25|      2|  Environment(std::string data_dir) {
   26|      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
  ------------------
   27|      2|    std::string magic_path = data_dir + "/magic";
   28|      2|    if (magic_load(magic, magic_path.c_str())) {
  ------------------
  |  Branch (28:9): [True: 0, False: 2]
  ------------------
   29|       |      fprintf(stderr, "error loading magic file: %s\n", magic_error(magic));
   30|      0|      exit(1);
   31|      0|    }
   32|      2|  }

